Compare commits

...

50 Commits

Author SHA1 Message Date
Andrew Johnson
d53521f160 Set version to 3.14.12.5-pre1 2015-02-25 16:23:05 -06:00
Andrew Johnson
12793d3313 Cosmetic changes in configure/os 2015-02-25 12:02:34 -06:00
Andrew Johnson
65d39fcbc8 Moved linux-arm cross-build link-time settings 2015-02-24 16:51:59 -06:00
Andrew Johnson
b7baa2504e Only build Cap5.so for the host architecture 2015-02-24 16:23:14 -06:00
Andrew Johnson
4a0880003c Support MinGW cross-builds on linux-x86 and x86_64 2015-02-24 14:30:42 -06:00
Andrew Johnson
d06b1a178a Applied Added-configure-files-for-linux-arm-debug.patch 2015-02-23 14:12:39 -06:00
Andrew Johnson
2bae36845e Adjust a few CONFIG_SITE files, mostly comments 2015-02-23 13:30:45 -06:00
Andrew Johnson
2d7a8a4aee Pull blockingSockTest.cpp from 3.15 2015-02-20 16:35:47 -06:00
Andrew Johnson
3601a73b77 Applied rtems-use-macro-for-BIN2BOOT.patch 2015-02-20 15:42:14 -06:00
Andrew Johnson
335cba0049 Applied rtems-mvme5500-needs-libbspExt.patch 2015-02-20 15:35:59 -06:00
Andrew Johnson
0f2d6eac9b Applied rtems-build-gesys-loadable-objects.patch 2015-02-20 15:34:57 -06:00
Andrew Johnson
88314d0374 Release notes for CMD_ variables 2015-02-20 15:24:29 -06:00
Andrew Johnson
4658a88584 Allow compiler flags from command line
The following variables are reserved for use from the
GNUmake command line:
  CMD_INCLUDES
  CMD_CPPFLAGS
  CMD_CFLAGS
  CMD_CXXFLAGS
  CMD_LDFLAGS
  CMD_DBFLAGS
  CMD_DBDFLAGS
  CMD_ARFLAGS

For example:
  make CMD_INCLUDES=/opt/local/include CMD_LDFLAGS=-L/opt/local/lib
2015-02-20 14:48:05 -06:00
Andrew Johnson
4cf3613ace Applied missing-header.patch 2015-02-20 12:38:26 -06:00
Andrew Johnson
0fa8702842 Applied test-epicsTimerQueue-reference-counter.patch 2015-02-20 12:34:53 -06:00
Andrew Johnson
a437768c9c Applied linux-runtime-disable-RT-priorities-if-not-supported.patch 2015-02-20 12:25:28 -06:00
Andrew Johnson
a6af0daae9 Applied linux-use-RT-thread-priorities.patch 2015-02-20 12:21:45 -06:00
Andrew Johnson
3e6597be90 Applied record-support-santity-check.patch 2015-02-20 12:13:05 -06:00
Michael Davidsaver
c0cf25eeee dbCa: dbCaPutLinkCallback initialize entire array
CA links will write the full target array size.
Ensure that uninitialized elements are zeroed.
2015-02-19 19:18:27 -05:00
Michael Davidsaver
3501fda48d dbCa: dbCaPutLinkCallback prevent out of bounds write
The internal buffer of the caLink is sized based on the
number of elements of the destination PV.
2015-02-19 19:18:16 -05:00
Andrew Johnson
e822d8d8c4 Suppress corrupt error output from dbStatic parser
The yyerror() routine gets called twice in some cases.
Don't print the yytext or input file location the second
time through -- yytext has already been freed, and the
user doesn't need to see the location twice.

Fixes lp:1422803
2015-02-19 17:33:27 -06:00
Andrew Johnson
9813fa6474 db: Allow link fields to return a DOUBLE value
A dbCa link does a ca_get with type DBR_CTRL_DOUBLE
to populate its list of attribute values immediately
after connecting. If the target is a DBF_*LINK field
it used to return an error, preventing the link from
properly connecting. This change makes dbGetField()
return a single NAN value instead of rejecting the
request.

Fixes: lp:545358
2015-02-19 15:55:48 -06:00
Andrew Johnson
b1e99f6f1a Merged Lewis Muir's readme-fixes branch 2015-02-18 17:11:51 -06:00
J. Lewis Muir
836d81f0b7 doc: HTML: fix typos and list of files in documentation directory 2015-02-18 16:55:09 -06:00
Andrew Johnson
804aeafaa7 Fix dbVerify()'s postfix buffer size 2015-02-18 16:44:07 -06:00
Andrew Johnson
dda4eb3a58 Fix more MS idiocy
Windows has signed characters, but if you pass a negative
value (i.e. a character with value >= 0x80) into the debug
version of its isprint() runtime library function it asserts.
2015-02-18 16:36:42 -06:00
J. Lewis Muir
b041041518 doc: fix typos and list of files in documentation directory 2015-02-18 15:46:05 -06:00
Andrew Johnson
d2a216b28e More MS Windows-x64 test fixes 2015-02-17 16:21:13 -06:00
Andrew Johnson
7e36a58f1e Back-ported dbLoadRecordsHook from the 3.15 branch 2015-02-17 14:29:20 -06:00
Andrew Johnson
f16bdb0c83 Merged trap-write-data branch 2015-02-17 14:02:15 -06:00
Andrew Johnson
681a996bf0 Unifying rsrv error messages 2015-02-17 13:59:13 -06:00
Michael Davidsaver
276ea54ee4 don't destroy locked mutex 2015-02-17 11:03:06 -05:00
Michael Davidsaver
2623c2f46f dbStaticLib.c: clean pdbbase after free 2015-02-17 11:01:49 -05:00
Michael Davidsaver
b996e63beb dbReadTest.c: flush errlog on exit as per lp:1419879 2015-02-17 10:57:05 -05:00
Michael Davidsaver
2f0e9172a4 tool_lib.c: ensure output string is always set
Ensure that val2str always writes to its output buffer,
which is static and shared between all PVs.
Should make bugs like lp:1418526 more obvious.
2015-02-17 10:45:30 -05:00
Andrew Johnson
c5ded30684 Extended asTrapWrite to provide put data
Backwards-compatible enhancement to the asTrapWrite API to provide
listener routines with the data being put by the client.
The asTrapWriteMessage structure is extended with 3 new fields
for data type, element count and a pointer to the source buffer.

Tim Mooney requested this enhancement for his caPutRecorder code,
which doesn't work if the record overwrites the new value within
its process() routine, e.g. when jogging a motor record.
2015-02-16 16:30:52 -06:00
Andrew Johnson
2e4d8b31ff Mark windows-x64 Math failures as TODO 2015-02-13 15:56:50 -06:00
Andrew Johnson
26d60bc516 Attempt to fix Windows test failures
epicsMessageQueue test wasn't printing the last test result.
2015-02-13 15:29:08 -06:00
Andrew Johnson
f874913cf7 Fix epicsExceptionTest on darwin
Clang's optimizer seems to elide the new (nothrow) if we don't
actually observe the value of p...
2015-02-13 12:17:24 -06:00
Andrew Johnson
26ab431c0a Back-ported the tapfiles build target from 3.15
This is the version that works on Windows.
2015-02-13 11:16:24 -06:00
Andrew Johnson
02aa7e2f73 Stop bogus error messages from CA Repeater on Windows
Required adding a new API to osiSock.h and the 2
implementations of epicsSocketConvertErrnoToString.
2015-02-10 18:10:33 -06:00
Andrew Johnson
727a3af59d Merged Richard Fearn's caget-lb-zero-fix branch
... after some modification.
2015-02-05 11:19:30 -06:00
Richard Fearn
1a094f5971 catools: make caget -lb output '0' instead of empty string for zero value 2015-02-05 11:53:33 +01:00
Andrew Johnson
4b0a4ffee2 Build configuration for iOS 2015-02-04 10:11:14 -06:00
Andrew Johnson
c91725d3a4 Linux flag changes to remove glibc 2.20 warnings
Replace _BSD_SOURCE and other flags with _GNU_SOURCE and _DEFAULT_SOURCE
2015-01-30 16:12:42 -06:00
Ralph Lange
6a9eccdec1 gdd: fix issue when copying from an emtpy array
if the source array is empty, the index of the first element to copy (0) being equal
   to the source array size (0) does not constitute an out-of-bounds condition
2015-01-29 14:36:55 +01:00
Andrew Johnson
2b950754c4 Fix FLNK-over-CA error message 2014-12-23 10:35:09 -06:00
Andrew Johnson
846d55dac5 Build support for 64-bit iPhone Simulator
From Tom Palaia.
2014-12-04 14:05:44 -06:00
Ralph Lange
db0fbf9f73 .bzrignore: add wildcard for suppressing QtCreator project files 2014-12-03 15:11:30 +01:00
Andrew Johnson
c1d33e614c Fix non-OS Perl xsubpp issue
This should be the right fix.
Also cleaned up compile warnings from Clang in the cap5 build.
2014-12-02 11:03:16 -06:00
99 changed files with 930 additions and 391 deletions

View File

@@ -6,3 +6,4 @@
./include
./templates
**/O.*
./QtC-*

View File

@@ -30,11 +30,11 @@ EPICS_MODIFICATION = 12
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
# Not included if zero
EPICS_PATCH_LEVEL = 4
EPICS_PATCH_LEVEL = 5
# This will end in -DEV between official releases
EPICS_DEV_SNAPSHOT=-DEV
#EPICS_DEV_SNAPSHOT=-pre1
#EPICS_DEV_SNAPSHOT=-DEV
EPICS_DEV_SNAPSHOT=-pre1
#EPICS_DEV_SNAPSHOT=-pre1-DEV
#EPICS_DEV_SNAPSHOT=-pre2
#EPICS_DEV_SNAPSHOT=-pre2-DEV

View File

@@ -209,6 +209,16 @@ USR_CPPFLAGS =
USR_DBDFLAGS =
USR_ARFLAGS =
# Variables to be set only on the command-line:
# CMD_INCLUDES =
# CMD_CFLAGS =
# CMD_CXXFLAGS =
# CMD_LDFLAGS =
# CMD_CPPFLAGS =
# CMD_DBFLAGS =
# CMD_DBDFLAGS =
# CMD_ARFLAGS =
# Debug specific options
DEBUG_CPPFLAGS =
DEBUG_CFLAGS =
@@ -267,32 +277,35 @@ RUNTIME_LDFLAGS += $(RUNTIME_LDFLAGS_$(COMMANDLINE_LIBRARY))
# Flags
INCLUDES = -I. $(SRC_INCLUDES) $(INSTALL_INCLUDES) $(RELEASE_INCLUDES)\
$(TARGET_INCLUDES) $(USR_INCLUDES) $(OP_SYS_INCLUDES) $($(BUILD_CLASS)_INCLUDES)
$(TARGET_INCLUDES) $(USR_INCLUDES) $(CMD_INCLUDES) $(OP_SYS_INCLUDES)\
$($(BUILD_CLASS)_INCLUDES)
CFLAGS = $($(BUILD_CLASS)_CFLAGS) $(POSIX_CFLAGS) $(OPT_CFLAGS) $(DEBUG_CFLAGS)\
$(PIPE_CFLAGS) $(WARN_CFLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS)\
$(CODE_CFLAGS) $(STATIC_CFLAGS) $(OP_SYS_CFLAGS) $(LIBRARY_SRC_CFLAGS) $(HDEPENDS_CFLAGS)
CFLAGS = $($(BUILD_CLASS)_CFLAGS) $(POSIX_CFLAGS) $(OPT_CFLAGS)\
$(DEBUG_CFLAGS) $(PIPE_CFLAGS) $(WARN_CFLAGS) $(TARGET_CFLAGS)\
$(USR_CFLAGS) $(CMD_CFLAGS) $(ARCH_DEP_CFLAGS) $(CODE_CFLAGS)\
$(STATIC_CFLAGS) $(OP_SYS_CFLAGS) $(LIBRARY_SRC_CFLAGS) $(HDEPENDS_CFLAGS)
CXXFLAGS = $($(BUILD_CLASS)_CXXFLAGS) $(POSIX_CXXFLAGS) $(OPT_CXXFLAGS) $(DEBUG_CXXFLAGS)\
$(PIPE_CFLAGS) $(WARN_CXXFLAGS) $(TARGET_CXXFLAGS) $(USR_CXXFLAGS) $(ARCH_DEP_CXXFLAGS)\
$(CODE_CXXFLAGS) $(STATIC_CXXCFLAGS) $(OP_SYS_CXXFLAGS) $(LIBRARY_SRC_CFLAGS) $(HDEPENDS_CFLAGS)
CXXFLAGS = $($(BUILD_CLASS)_CXXFLAGS) $(POSIX_CXXFLAGS) $(OPT_CXXFLAGS)\
$(DEBUG_CXXFLAGS) $(PIPE_CFLAGS) $(WARN_CXXFLAGS) $(TARGET_CXXFLAGS)\
$(USR_CXXFLAGS) $(CMD_CXXFLAGS) $(ARCH_DEP_CXXFLAGS) $(CODE_CXXFLAGS)\
$(STATIC_CXXCFLAGS) $(OP_SYS_CXXFLAGS) $(LIBRARY_SRC_CFLAGS) $(HDEPENDS_CFLAGS)
LDFLAGS = $(OPT_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(POSIX_LDFLAGS) \
$(ARCH_DEP_LDFLAGS) $(DEBUG_LDFLAGS) $(OP_SYS_LDFLAGS) $($(BUILD_CLASS)_LDFLAGS)\
$(RUNTIME_LDFLAGS) $(CODE_LDFLAGS)
LDFLAGS = $(OPT_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(CMD_LDFLAGS)\
$(POSIX_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(DEBUG_LDFLAGS) $(OP_SYS_LDFLAGS)\
$($(BUILD_CLASS)_LDFLAGS) $(RUNTIME_LDFLAGS) $(CODE_LDFLAGS)
LDLIBS = \
$(POSIX_LDLIBS) $(ARCH_DEP_LDLIBS) $(DEBUG_LDLIBS) $(OP_SYS_LDLIBS) $(GNU_LDLIBS_$(GNU))
LDLIBS = $(POSIX_LDLIBS) $(ARCH_DEP_LDLIBS) $(DEBUG_LDLIBS) $(OP_SYS_LDLIBS)\
$(GNU_LDLIBS_$(GNU))
CPPFLAGS += $($(BUILD_CLASS)_CPPFLAGS) $(POSIX_CPPFLAGS)\
$(OPT_CPPFLAGS) $(DEBUG_CPPFLAGS) $(WARN_CPPFLAGS)\
$(BASE_CPPFLAGS) $(TARGET_CPPFLAGS) $(USR_CPPFLAGS) $(ARCH_DEP_CPPFLAGS)\
$(OP_SYS_CPPFLAGS) $(OP_SYS_INCLUDE_CPPFLAGS) $(CODE_CPPFLAGS)
CPPFLAGS = $($(BUILD_CLASS)_CPPFLAGS) $(POSIX_CPPFLAGS) $(OPT_CPPFLAGS)\
$(DEBUG_CPPFLAGS) $(WARN_CPPFLAGS) $(BASE_CPPFLAGS) $(TARGET_CPPFLAGS)\
$(USR_CPPFLAGS) $(CMD_CPPFLAGS) $(ARCH_DEP_CPPFLAGS) $(OP_SYS_CPPFLAGS)\
$(OP_SYS_INCLUDE_CPPFLAGS) $(CODE_CPPFLAGS)
#--------------------------------------------------
# ar definition default
ARFLAGS =
ARCMD = $(AR) $(ARFLAGS) $(USR_ARFLAGS) $@ $(LIBRARY_LD_OBJS)
ARCMD = $(AR) $(ARFLAGS) $(USR_ARFLAGS) $(CMD_ARFLAGS) $@ $(LIBRARY_LD_OBJS)
#--------------------------------------------------
# 'Munch' link-edit

View File

@@ -176,7 +176,7 @@ COMPAT_313=NO
#INSTALL_LOCATION=<fullpathname>
# Use POSIX thread priority scheduling (YES or NO)
USE_POSIX_THREAD_PRIORITY_SCHEDULING = NO
USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES
# Site version number, if set will append '-' and this string to the
# EPICS version number string that is reported by many tools

View File

@@ -24,8 +24,8 @@ vpath %.acs $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)
DBD_SEARCH_DIRS = . .. $(COMMON_DIR) $(SRC_DIRS) $(INSTALL_DBD) $(RELEASE_DBD_DIRS)
DB_SEARCH_DIRS = . .. $(COMMON_DIR) $(SRC_DIRS) $(INSTALL_DB) $(RELEASE_DB_DIRS)
DBDFLAGS = $(USR_DBDFLAGS) $(addprefix -I,$(DBD_SEARCH_DIRS))
DBFLAGS = $($*_DBFLAGS) $(USR_DBFLAGS) $(addprefix -I,$(DB_SEARCH_DIRS))
DBDFLAGS = $(USR_DBDFLAGS) $(CMD_DBDFLAGS) $(addprefix -I,$(DBD_SEARCH_DIRS))
DBFLAGS = $($*_DBFLAGS) $(USR_DBFLAGS) $(CMD_DBFLAGS) $(addprefix -I,$(DB_SEARCH_DIRS))
#####################################################
# To allow os specific dbd files AND have the -j option work properly,
@@ -134,7 +134,7 @@ ACTIONS += build
ACTIONS += install
ACTIONS += buildInstall
ACTIONS += browse
ACTIONS += runtests
ACTIONS += runtests tapfiles
actionArchTargets = $(foreach x, $(ACTIONS),\ $(foreach arch,$(BUILD_ARCHS), $(x)$(DIVIDER)$(arch)))

View File

@@ -17,7 +17,7 @@ ACTIONS += build
ACTIONS += install
ACTIONS += buildInstall
ACTIONS += browse
ACTIONS += runtests
ACTIONS += runtests tapfiles
#ACTIONS += rebuild
actionPart = $(word 1, $(subst $(DIVIDER), ,$@))

View File

@@ -96,6 +96,8 @@ ifneq (,$(strip $(TESTS)))
TARGETS += testspec
endif
TAPFILES += $(TESTSCRIPTS:.t=.tap)
#---------------------------------------------------------------
# Libraries
#
@@ -142,7 +144,8 @@ clean::
@$(RM) *.i *$(OBJ) *.a $(TESTPRODNAME) $(LIBNAME) $(SHRLIBNAME) \
$(INC) $(TARGETS) $(DLL_LINK_LIBNAME) $(TDS) \
*.out MakefileInclude $(LOADABLE_SHRLIBNAME) *.manifest *.exp \
$(COMMON_INC) $(HDEPENDS_FILES) $(PRODTARGETS) $(TESTSCRIPTS)
$(COMMON_INC) $(HDEPENDS_FILES) $(PRODTARGETS) \
$(TESTSCRIPTS) $(TAPFILES)
ifdef RES
@$(RM) *$(RES)
endif
@@ -328,6 +331,12 @@ $(OBJLIB_MUNCHNAME):%.munch : %_ctdt$(OBJ) %$(OBJ)
@$(RM) $@
$(MUNCH_CMD)
# GeSys modules for RTEMS
$(MODNAME): %$(MODEXT): %$(EXE)
@echo "Building module $@"
@$(RM) $@
$(LINK.mod)
runtests: $(TESTSCRIPTS)
-$(PERL) -MTest::Harness -e 'runtests @ARGV if @ARGV;' $^
@@ -338,16 +347,22 @@ testspec: $(TESTSCRIPTS)
$(if $^, @echo Tests: $^ >> $@)
$(if $(TESTSPEC_$(OS_CLASS)), @echo "Harness: $(TESTSPEC_$(OS_CLASS))" >> $@)
tapfiles: $(TESTSCRIPTS) $(TAPFILES)
# A .tap file is the output from running the associated test script
%.tap: %.t
-$(PERL) $< -tap > $@
# If there's a perl test script (.plt) available, use it
%.t: ../%.plt
@$(RM) $@
@$(CP) $< $@
$(CP) $< $@
# Some versions of Test::Harness expect test programs in perl only.
# Test programs (.t files) must be written in Perl.
# Generate a perl program to exec the real test binary.
%.t: %$(EXE)
%.t: %$(EXE) $(TOOLS)/makeTestfile.pl
@$(RM) $@
@$(PERL) $(TOOLS)/makeTestfile.pl $@ $<
$(PERL) $(TOOLS)/makeTestfile.pl $@ $<
#---------------------------------------------------------------
## Install rules for BIN_INSTALLS and LIB_INSTALLS

View File

@@ -12,7 +12,8 @@
ARCHS += $(BUILD_ARCHS)
ACTIONS += inc build install buildInstall clean realclean archclean runtests
ACTIONS += inc build install buildInstall clean realclean archclean
ACTIONS += runtests tapfiles
dirPart = $(join $(dir $@), $(word 1, $(subst $(DIVIDER), ,$(notdir $@))))

View File

@@ -49,28 +49,29 @@ RANLIB := $(RTEMS_TOOLS)/bin/$(RANLIB)
VALID_BUILDS = Ioc
#--------------------------------------------------
# The RTEMS Makefiles redefine several macros, so we have to go
# through the following contortions to get the EPICS flags back.
CFLAGS = $(CROSS_CFLAGS) $(OPT_CFLAGS) $(DEBUG_CFLAGS)\
$(WARN_CFLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS)\
$(CODE_CFLAGS) $(STATIC_CFLAGS) $(OP_SYS_CFLAGS) $(LIBRARY_SRC_CFLAGS)\
$(HDEPENDS_CFLAGS)
# The RTEMS Makefiles redefine several macros, so we have to
# reset them to the proper EPICS values, from CONFIG_COMMON
CFLAGS = $($(BUILD_CLASS)_CFLAGS) $(POSIX_CFLAGS) $(OPT_CFLAGS)\
$(DEBUG_CFLAGS) $(PIPE_CFLAGS) $(WARN_CFLAGS) $(TARGET_CFLAGS)\
$(USR_CFLAGS) $(CMD_CFLAGS) $(ARCH_DEP_CFLAGS) $(CODE_CFLAGS)\
$(STATIC_CFLAGS) $(OP_SYS_CFLAGS) $(LIBRARY_SRC_CFLAGS) $(HDEPENDS_CFLAGS)
CXXFLAGS = $(CROSS_CXXFLAGS) $(OPT_CXXFLAGS)\
$(DEBUG_CXXFLAGS) $(WARN_CXXFLAGS) $(TARGET_CXXFLAGS) $(USR_CXXFLAGS)\
$(ARCH_DEP_CXXFLAGS) $(CODE_CXXFLAGS) $(STATIC_CXXCFLAGS) $(OP_SYS_CXXFLAGS)\
$(LIBRARY_SRC_CFLAGS) $(HDEPENDS_CFLAGS)
CXXFLAGS = $($(BUILD_CLASS)_CXXFLAGS) $(POSIX_CXXFLAGS) $(OPT_CXXFLAGS)\
$(DEBUG_CXXFLAGS) $(PIPE_CFLAGS) $(WARN_CXXFLAGS) $(TARGET_CXXFLAGS)\
$(USR_CXXFLAGS) $(CMD_CXXFLAGS) $(ARCH_DEP_CXXFLAGS) $(CODE_CXXFLAGS)\
$(STATIC_CXXCFLAGS) $(OP_SYS_CXXFLAGS) $(LIBRARY_SRC_CFLAGS) $(HDEPENDS_CFLAGS)
LDFLAGS = $(OPT_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) \
$(ARCH_DEP_LDFLAGS) $(DEBUG_LDFLAGS) $(OP_SYS_LDFLAGS) $(CROSS_LDFLAGS)\
$(RUNTIME_LDFLAGS) $(CODE_LDFLAGS)
LDFLAGS = $(OPT_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(CMD_LDFLAGS)\
$(POSIX_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(DEBUG_LDFLAGS) $(OP_SYS_LDFLAGS)\
$($(BUILD_CLASS)_LDFLAGS) $(RUNTIME_LDFLAGS) $(CODE_LDFLAGS)
LDLIBS = \
$(POSIX_LDLIBS) $(ARCH_DEP_LDLIBS) $(DEBUG_LDLIBS) $(OP_SYS_LDLIBS)
LDLIBS = $(POSIX_LDLIBS) $(ARCH_DEP_LDLIBS) $(DEBUG_LDLIBS) $(OP_SYS_LDLIBS)\
$(GNU_LDLIBS_$(GNU))
CPPFLAGS += $(CROSS_CPPFLAGS) $(POSIX_CPPFLAGS)\
$(BASE_CPPFLAGS) $(TARGET_CPPFLAGS) $(USR_CPPFLAGS) $(ARCH_DEP_CPPFLAGS)\
$(OP_SYS_CPPFLAGS) $(OP_SYS_INCLUDE_CPPFLAGS) $(CODE_CPPFLAGS)
CPPFLAGS += $($(BUILD_CLASS)_CPPFLAGS) $(POSIX_CPPFLAGS) $(OPT_CPPFLAGS)\
$(DEBUG_CPPFLAGS) $(WARN_CPPFLAGS) $(BASE_CPPFLAGS) $(TARGET_CPPFLAGS)\
$(USR_CPPFLAGS) $(CMD_CPPFLAGS) $(ARCH_DEP_CPPFLAGS) $(OP_SYS_CPPFLAGS)\
$(OP_SYS_INCLUDE_CPPFLAGS) $(CODE_CPPFLAGS)
#--------------------------------------------------
# Although RTEMS uses gcc, it wants to use gcc its own way
@@ -82,6 +83,8 @@ OPT_CXXFLAGS_YES = $(CFLAGS_OPTIMIZE_V)
OPT_CFLAGS_NO = $(CFLAGS_DEBUG_V)
OPT_CXXFLAGS_NO = $(CFLAGS_DEBUG_V)
MODEXT=.obj
#--------------------------------------------------
# operating system class (include/os/<os_class>)
OS_CLASS = RTEMS
@@ -96,6 +99,42 @@ OP_SYS_LDFLAGS += $(CPU_CFLAGS) -u Init \
$(PROJECT_RELEASE)/lib/no-signal.rel \
$(PROJECT_RELEASE)/lib/no-rtmon.rel
MOD_SYS_LDFLAGS += $(CPU_CFLAGS) -Wl,-r -nostdlib
# Do not link against libraries which are part of the Generic Image
GESYS_LIBS += -lgcc
GESYS_LIBS += -lc -lm -lrtemscpu -lrtemsbsp -lrtems++ -lbspExt
GESYS_LIBS += -lcexp -ltecla_r -lspencer_regexp -lpmelf -lpmbfd
GESYS_LIBS += -lnfs -ltelnetd -lrtems-gdb-stub
# While not part of the Generic Image it provides symbols which
# would conflict.
GESYS_LIBS += -lrtemsCom
#--------------------------------------------------
# Options for building GeSys loadable objects
MODNAME_YES = $(PRODNAME:%$(EXE)=%$(MODEXT))
MODNAME += $(MODNAME_$(USE_GESYS))
PRODTARGETS += $(MODNAME)
BIN_INSTALLS += $(MODNAME)
# changes to LDFLAGS in CONFIG_COMMON and LINK.cpp in CONFIG.Common.UnixCommon
# should be reflected here with the following exceptions
#
# replace OP_SYS_LDFLAGS with MOD_SYS_LDFLAGS
# replace PROD_LDLIBS with MOD_LDLIBS
# remove STATIC_LDFLAGS
MOD_LDLIBS = $(filter-out $(GESYS_LIBS),$(PROD_LDLIBS))
MOD_LDFLAGS = $(OPT_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(POSIX_LDFLAGS) \
$(ARCH_DEP_LDFLAGS) $(DEBUG_LDFLAGS) $(MOD_SYS_LDFLAGS) $($(BUILD_CLASS)_LDFLAGS)\
$(RUNTIME_LDFLAGS) $(CODE_LDFLAGS)
LINK.mod = $(CCC) -o $@ $(PRODDIR_LDFLAGS) $(MOD_LDFLAGS)
LINK.mod += $(PROD_LDFLAGS) $(PROD_LD_OBJS) $(PROD_LD_RESS) $(MOD_LDLIBS)
#--------------------------------------------------
# RTEMS has neither shared libraries nor dynamic loading
STATIC_BUILD=YES

View File

@@ -22,4 +22,6 @@ define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
endef
OP_SYS_LDLIBS += -lbspExt
include $(CONFIG)/os/CONFIG.Common.RTEMS

View File

@@ -12,7 +12,7 @@ MUNCH_SUFFIX = .boot
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< temp.bin
$(PROJECT_RELEASE)/build-tools/bin2boot $@ 0x00097E00 \
$(BIN2BOOT) $@ 0x00097E00 \
$(PROJECT_RELEASE)/lib/start16.bin 0x00097C00 0 temp.bin 0x00100000 0
rm -f temp.bin
endef

View File

@@ -13,10 +13,5 @@ IOS_PLATFORM = iPhoneSimulator
OP_SYS_CFLAGS += -mios-simulator-version-min=$(IOS_DEPLOYMENT_TARGET)
OP_SYS_LDFLAGS += -mios-simulator-version-min=$(IOS_DEPLOYMENT_TARGET)
#
# Architecture-specific information
#
ARCH_CLASS = i386
# Include definitions common to all iOS targets
include $(CONFIG)/os/CONFIG.Common.iosCommon

View File

@@ -25,7 +25,7 @@ OS_CLASS = iOS
#--------------------------------------------------
# GNU and SDK directories
GNU_DIR = $(PLATFORM_DIR)/Developer/usr
SDK_DIR = $(PLATFORM_DIR)/Developer/SDKs/$(IOS_PLATFORM)$(IOS_VERSION).sdk
SDK_DIR = $(PLATFORM_DIR)/Developer/SDKs/$(IOS_PLATFORM).sdk
#-------------------------------------------------------
# Build architecture flags

View File

@@ -1,9 +1,7 @@
# CONFIG.Common.linux-arm
#
# This file is maintained by the build community.
#
# Definitions for linux-arm target builds
# Sites may override these definitions in CONFIG_SITE.Common.linux-arm
# Override these settings in CONFIG_SITE.Common.linux-arm
#-------------------------------------------------------
# Include definitions common to all Linux targets
@@ -11,26 +9,3 @@ include $(CONFIG)/os/CONFIG.Common.linuxCommon
ARCH_CLASS = arm
ifeq ($(BUILD_CLASS),CROSS)
VALID_BUILDS = Ioc
GNU_TARGET = arm-linux
# prefix of compiler tools
CMPLR_SUFFIX =
CMPLR_PREFIX = $(addsuffix -,$(GNU_TARGET))
# Provide a link-time path for shared libraries
SHRLIBDIR_RPATH_LDFLAGS_YES += $(SHRLIB_DEPLIB_DIRS:%=-Wl,-rpath-link,%)
SHRLIBDIR_LDFLAGS += $(SHRLIBDIR_RPATH_LDFLAGS_$(LINKER_USE_RPATH))
# Provide a link-time path for products
PRODDIR_RPATH_LDFLAGS_YES += $(PROD_DEPLIB_DIRS:%=-Wl,-rpath-link,%)
PRODDIR_LDFLAGS += $(PRODDIR_RPATH_LDFLAGS_$(LINKER_USE_RPATH))
# Provide a link-time path for readline
RUNTIME_LDFLAGS_READLINE_YES = -Wl,-rpath-link,$(GNU_DIR)/lib
RUNTIME_LDFLAGS_READLINE = $(RUNTIME_LDFLAGS_READLINE_$(LINKER_USE_RPATH))
RUNTIME_LDFLAGS_READLINE_CURSES = $(RUNTIME_LDFLAGS_READLINE_$(LINKER_USE_RPATH))
RUNTIME_LDFLAGS_READLINE_NCURSES = $(RUNTIME_LDFLAGS_READLINE_$(LINKER_USE_RPATH))
endif

View File

@@ -0,0 +1,13 @@
# CONFIG.Common.linux-arm-debug
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for linux-arm with debug compiler flags
# Override these settings in CONFIG_SITE.Common.linux-arm-debug
#-------------------------------------------------------
# Include definitions common to all linux-arm target archs
include $(CONFIG)/os/CONFIG.Common.linux-arm
HOST_OPT=NO

View File

@@ -12,13 +12,10 @@ include $(CONFIG)/os/CONFIG.Common.UnixCommon
OS_CLASS = Linux
CODE_CPPFLAGS = -D_REENTRANT
POSIX_CPPFLAGS = -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS -D_XOPEN_SOURCE=500
# Define _GNU_SOURCE and _DEFAULT_SOURCE for maximum portability
POSIX_CPPFLAGS = -D_GNU_SOURCE -D_DEFAULT_SOURCE
POSIX_LDLIBS = -lpthread
# -D_BSD_SOURCE for gethostname() in unistd.h as needed by cacChannelIO.cpp.
OP_SYS_CPPFLAGS += -D_BSD_SOURCE
OP_SYS_CPPFLAGS += -Dlinux
OP_SYS_LDLIBS += -lrt -ldl

View File

@@ -34,7 +34,8 @@ ARCH_DEP_LDFLAGS += -m32
# Override for -DUNIX from CONFIG.Common.UnixCommon
OP_SYS_CPPFLAGS = -D_MINGW
EXE=.exe
EXE = .exe
RES = .coff
VISC_DLL_NO = -DEPICS_DLL_NO
VISC_DLL_YES =

View File

@@ -0,0 +1,12 @@
# CONFIG.linux-arm-debug.Common
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for linux-arm-debug host builds
# Override these settings in CONFIG_SITE.linux-arm-debug.Common
#-------------------------------------------------------
#Include definitions common to linux-arm hosts
include $(CONFIG)/os/CONFIG.linux-arm.Common

View File

@@ -0,0 +1,14 @@
# CONFIG.linux-arm-debug.linux-arm-debug
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for linux-arm-debug host and target build
# Override these settings in CONFIG_SITE.linux-arm-debug.linux-arm-debug
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.linux-arm.linux-arm
# Removes -O optimization and adds -g compile option
HOST_OPT=NO

View File

@@ -0,0 +1,15 @@
# CONFIG.linux-arm.linux-arm-debug
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for linux-arm host - linux-arm-debug target build
# Override these settings in CONFIG_SITE.linux-arm.linux-arm-debug
#-------------------------------------------------------
-include $(CONFIG)/os/CONFIG.linux-arm.linux-arm
-include $(CONFIG)/os/CONFIG_SITE.Common.linux-arm
-include $(CONFIG)/os/CONFIG_SITE.linux-arm.linux-arm
BUILD_CLASS=HOST
HOST_OPT=NO

View File

@@ -1,10 +1,31 @@
# CONFIG.linux-x86.linux-arm
#
# Definitions for linux-x86 host - linux-arm target builds
# Sites may override these definitions in CONFIG_SITE.linux-x86.linux-arm
# Override these settings in CONFIG_SITE.linux-x86.linux-arm
#-------------------------------------------------------
# Copied from x86.x86
VALID_BUILDS = Ioc
GNU_TARGET = arm-linux
# prefix of compiler tools
CMPLR_SUFFIX =
CMPLR_PREFIX = $(addsuffix -,$(GNU_TARGET))
# Provide a link-time path for shared libraries
SHRLIBDIR_RPATH_LDFLAGS_YES += $(SHRLIB_DEPLIB_DIRS:%=-Wl,-rpath-link,%)
SHRLIBDIR_LDFLAGS += $(SHRLIBDIR_RPATH_LDFLAGS_$(LINKER_USE_RPATH))
# Provide a link-time path for products
PRODDIR_RPATH_LDFLAGS_YES += $(PROD_DEPLIB_DIRS:%=-Wl,-rpath-link,%)
PRODDIR_LDFLAGS += $(PRODDIR_RPATH_LDFLAGS_$(LINKER_USE_RPATH))
# Provide a link-time path for readline
RUNTIME_LDFLAGS_READLINE_YES = -Wl,-rpath-link,$(GNU_DIR)/lib
RUNTIME_LDFLAGS_READLINE = $(RUNTIME_LDFLAGS_READLINE_$(LINKER_USE_RPATH))
RUNTIME_LDFLAGS_READLINE_CURSES = $(RUNTIME_LDFLAGS_READLINE_$(LINKER_USE_RPATH))
RUNTIME_LDFLAGS_READLINE_NCURSES = $(RUNTIME_LDFLAGS_READLINE_$(LINKER_USE_RPATH))
# Library flags
STATIC_LDFLAGS_YES= -Wl,-Bstatic
STATIC_LDFLAGS_NO=
STATIC_LDLIBS_YES= -Wl,-Bdynamic

View File

@@ -0,0 +1,9 @@
# CONFIG.linux-x86.linux-arm-debug
#
# Definitions for linux-x86 host - linux-arm-debug target builds
# Override these settings in CONFIG_SITE.linux-x86.linux-arm-debug
#-------------------------------------------------------
# Include definitions for linux-arm targets
include $(CONFIG)/os/CONFIG.linux-x86.linux-arm

View File

@@ -0,0 +1,22 @@
# CONFIG.linux-x86.win32-x86-mingw
#
# Definitions for linux-x86 host win32-x86-mingw target builds
# Override these definitions in CONFIG_SITE.linux-x86.win32-x86-mingw
#-------------------------------------------------------
# Include common gnu compiler definitions
include $(CONFIG)/CONFIG.gnuCommon
# Add resource compiler
RCCMD = $(CMPLR_PREFIX)windres$(CMPLR_SUFFIX) $(INCLUDES) $< $@
# Remove -fPIC flags, add out-implib
SHRLIB_CFLAGS =
SHRLIB_LDFLAGS = -shared -Wl,--out-implib,$(LIB_PREFIX)$*$(LIB_SUFFIX)
LOADABLE_SHRLIB_LDFLAGS = -shared -Wl,--out-implib,$(LIB_PREFIX)$*$(LIB_SUFFIX)
# Don't link with gcc library
GNU_LDLIBS_YES =
# Link with winsock2
OP_SYS_LDLIBS = -lws2_32

View File

@@ -0,0 +1,8 @@
# CONFIG.linux-x86_64.linux-arm
#
# Definitions for linux-x86_64 host - linux-arm target builds
# Sites may override these definitions in CONFIG_SITE.linux-x86_64.linux-arm
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.linux-x86.linux-arm

View File

@@ -0,0 +1,8 @@
# CONFIG.linux-x86_64.linux-arm-debug
#
# Definitions for linux-x86_64 host - linux-arm-debug target builds
# Override these settings in CONFIG_SITE.linux-x86_64.linux-arm-debug
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.linux-x86.linux-arm

View File

@@ -0,0 +1,9 @@
# CONFIG.linux-x86_64.win32-x86-mingw
#
# Definitions for linux-x86_64 host win32-x86-mingw target builds
# Override these definitions in CONFIG_SITE.linux-x86_64.win32-x86-mingw
#-------------------------------------------------------
# Settings as for the linux-x86 host architecture
include $(CONFIG)/os/CONFIG.linux-x86.win32-x86-mingw

View File

@@ -9,22 +9,27 @@
# Include common gnu compiler definitions
include $(CONFIG)/CONFIG.gnuCommon
# Undo various things set by CONFIG.gnuCommon
CMPLR_PREFIX =
# Remove $(GNU_BIN)/ path
CC = $(CMPLR_PREFIX)gcc
CCC = $(CMPLR_PREFIX)g++
AR = $(CMPLR_PREFIX)ar -rc
LD = $(CMPLR_PREFIX)ld -r
RANLIB = $(CMPLR_PREFIX)ranlib
RES = .coff
# Add resource compiler
RCCMD = $(CMPLR_PREFIX)windres $(INCLUDES) $< $@
# No -fPIC avoids "-fPIC ignored for target (all code is position independent)"
# Remove -fPIC flags, add out-implib
SHRLIB_CFLAGS =
SHRLIB_LDFLAGS = -shared -Wl,--out-implib,$(LIB_PREFIX)$*$(LIB_SUFFIX)
LOADABLE_SHRLIB_LDFLAGS = -shared -Wl,--out-implib,$(LIB_PREFIX)$*$(LIB_SUFFIX)
# Override linking with gcc library from CONFIG.gnuCommon
# Don't link with gcc library
GNU_LDLIBS_YES =
# Link with winsock2
OP_SYS_LDLIBS = -lws2_32

View File

@@ -189,7 +189,8 @@ OP_SYS_CXXFLAGS = $(COMPILER_CXXFLAGS)
# '-entry:_DllMainCRTStartup$(DLLENTRY)'
DLLENTRY = @12
WIN32_DLLFLAGS = /subsystem:windows /dll $(OPT_LDFLAGS) $(USR_LDFLAGS) $(TARGET_LDFLAGS) $(LIB_LDFLAGS)
WIN32_DLLFLAGS = /subsystem:windows /dll $(OPT_LDFLAGS) \
$(USR_LDFLAGS) $(CMD_LDFLAGS) $(TARGET_LDFLAGS) $(LIB_LDFLAGS)
#
# specify dll .def file only if it exists

View File

@@ -1,17 +1,26 @@
# CONFIG_SITE.Common.RTEMS
#
# $Revision-Id$
#
# Site-specific information for all RTEMS targets
#
#-------------------------------------------------------
# Where to find RTEMS
#
# APS:
RTEMS_VERSION = 4.10.2
RTEMS_BASE = /usr/local/rtems/rtems-$(RTEMS_VERSION)
RTEMS_BASE = /usr/local/vw/rtems/rtems-$(RTEMS_VERSION)
# Cross-compile toolchain in $(RTEMS_TOOLS)/bin
#
RTEMS_TOOLS = $(RTEMS_BASE)
# Link Generic System loadable objects instead of full executable.
#
# A GeSys object is similar to a shared library. It can be (un)loaded
# at runtime by the Generic System loader which is available as a
# patch against RTEMS.
USE_GESYS = NO
# If you're using neither BOOTP/DHCP nor FLASH to pick up your IOC
# network configuration you must uncomment and specify your Internet

View File

@@ -16,11 +16,12 @@
#
# Xcode 4.5 dropped support for the ARMv6.
#
# ARMv8 (arm64) devices: iPhone 5S
# ARMv7s devices: iPhone 5 and 5C, iPad Gen 4
# ARMv7 devices: iPhone 3GS, 4 and 4S, iPod Touch Gen 3 to 5
# iPad Gen 1 to 3, iPad Mini, Apple TV Gen 2 and 3
# ARMv6 devices: iPhone 1 and 3G, iPod Touch Gen 1 and 2
# arm64 devices: iPhone 5S, 6 and 6 Plus, iPad Air Gen 1 and 2,
# iPad Mini Gen 2 and 3
# armv7s devices: iPhone 5 and 5C, iPad Gen 4
# armv7 devices: iPhone 3GS, 4 and 4S, iPod Touch Gen 3 to 5
# iPad Gen 1 to 3, iPad Mini, Apple TV Gen 2 and 3
# armv6 devices: iPhone 1 and 3G, iPod Touch Gen 1 and 2
#ARCH_CLASS = arm64
#ARCH_CLASS = armv7s arm64

View File

@@ -0,0 +1,18 @@
# CONFIG_SITE.Common.ios-x86
#
# $Revision-Id$
#
# Site-specific settings for ios-x86 target builds
#-------------------------------------------------------
# Which x86 instruction set(s) to generate code for:
# The iPhone Simulator now supports both 32-bit and 64-bit
# instruction sets since the iPhone 6 uses a 64-bit CPU.
#
# Apple's compilers can build for multiple architectures,
# generating a Universal binary. This is larger and takes
# longer to compile, but runs efficiently on all devices.
#ARCH_CLASS = i386
ARCH_CLASS = i386 x86_64
#ARCH_CLASS = x86_64

View File

@@ -5,16 +5,6 @@
# Site-specific settings for Apple iOS builds
#-------------------------------------------------------
# iOS SDK Version number (not the XCode version).
# We haven't tested our current build rules on the older
# versions of either XCode or the iOS SDK, be warned!
#IOS_VERSION = 5.0
#IOS_VERSION = 5.1
#IOS_VERSION = 6.0
#IOS_VERSION = 6.1
IOS_VERSION = 7.0
# Minimum version of iOS the executables must run on.
# Earlier versions may work, if XCode supports them.
@@ -23,6 +13,8 @@ IOS_VERSION = 7.0
#IOS_DEPLOYMENT_TARGET = 6.0
#IOS_DEPLOYMENT_TARGET = 6.1
IOS_DEPLOYMENT_TARGET = 7.0
#IOS_DEPLOYMENT_TARGET = 8.0
#IOS_DEPLOYMENT_TARGET = 8.1
# Which compiler to use:

View File

@@ -0,0 +1,41 @@
# CONFIG_SITE.Common.linux-arm
#
# $Revision-Id$
#
# Site Specific definitions for all linux-arm targets
#-------------------------------------------------------
# NOTE for SHARED_LIBRARIES: In most cases if this is set to YES the
# shared libraries will be found automatically. However if the .so
# files are installed at a different path to their compile-time path
# then in order to be found at runtime do one of these:
# a) LD_LIBRARY_PATH must include the full absolute pathname to
# $(INSTALL_LOCATION)/lib/$(EPICS_HOST_ARCH) when invoking base
# executables.
# b) Add the runtime path to SHRLIB_DEPLIB_DIRS and PROD_DEPLIB_DIRS, which
# will add the named directory to the list contained in the executables.
# c) Add the runtime path to /etc/ld.so.conf and run ldconfig
# to inform the system of the shared library location.
# Depending on your version of Linux you'll want one of the following
# lines to enable command-line editing and history in iocsh. If you're
# not sure which, start with the top one and work downwards until the
# build doesn't fail to link the readline library. If none of them work,
# comment them all out to build without readline support.
# No other libraries needed (recent Fedora, Ubuntu etc.):
#COMMANDLINE_LIBRARY = READLINE
# Needs -lncurses (RHEL 5 etc.):
#COMMANDLINE_LIBRARY = READLINE_NCURSES
# Needs -lcurses (older versions)
#COMMANDLINE_LIBRARY = READLINE_CURSES
# It makes sense to include debugging symbols even in optimized builds
# in case you want to attach gdb to the process or examine a core-dump.
# This does cost disk space, but not memory as debug symbols are not
# loaded into RAM when the binary is loaded.
OPT_CFLAGS_YES += -g
OPT_CXXFLAGS_YES += -g

View File

@@ -1,9 +1,12 @@
# CONFIG_SITE.Common.linux-xscale_be
#
# $Revision-Id$
#
# Site specific definitions for linux-xscale_be target builds.
#-------------------------------------------------------
# Set GNU_DIR to point to directory containing the tool-chain
GNU_DIR = /usr/local/xscale_be
# APS:
GNU_DIR = /usr/local/vw/xscale_be

View File

@@ -1,11 +1,9 @@
# CONFIG_SITE.win32-x86-mingw.Common
# CONFIG_SITE.Common.win32-x86-mingw
#
# $Revision-Id$
#
# Site Specific definitions for cygwin-x86 target
# Only the local epics system manager should modify this file
# Site Specific definitions for win32-x86-mingw target
# If readline is not installed comment the following line
# to omit command-line editing and history support
# If readline is available uncomment the following line
# to enable command-line editing and history support
#COMMANDLINE_LIBRARY = READLINE

View File

@@ -0,0 +1,13 @@
# CONFIG_SITE.linux-arm-debug.linux-arm-debug
#
# $Revision-Id$
#
# Site specific overrides for linux-arm-debug host and target builds
#-------------------------------------------------------
#Prepares the object code to collect data for profiling with prof.
#PROFILE=YES
#Compiles for profiling with the gprof profiler.
#GPROF=YES

View File

@@ -1,3 +1,9 @@
# CONFIG_SITE.linux-x86-debug.linux-x86-debug
#
# $Revision-Id$
#
# Site specific overrides for linux-x86-debug host and target builds
#-------------------------------------------------------
#Prepares the object code to collect data for profiling with prof.
#PROFILE=YES

View File

@@ -1,4 +1,4 @@
# CONFIG_SITE.linux-x86.linux-arm
# CONFIG_SITE.linux-x86.linux-arm
#
# $Revision-Id$
#
@@ -8,7 +8,8 @@
# Tools install path
#GNU_DIR = /home/targetOS/linux-arm/host/x86-linux/gcc_3.3.3
GNU_DIR = /net/phoebus/vw/zynq-2011.09
# APS:
GNU_DIR = /usr/local/vw/zynq-2011.09
# GNU crosscompiler target name
GNU_TARGET = arm-xilinx-linux-gnueabi

View File

@@ -0,0 +1,9 @@
# CONFIG_SITE.linux-x86.linux-arm-debug
#
# $Revision-Id$
#
# Site specific settings for linux-x86 host - linux-arm-debug target builds
#-------------------------------------------------------
# Inherit settings from linux-arm
include $(CONFIG)/os/CONFIG_SITE.linux-x86.linux-arm

View File

@@ -0,0 +1,23 @@
# CONFIG_SITE.linux-x86.win32-x86-mingw
#
# Configuration for linux-x86 host win32-x86-mingw target builds
#-------------------------------------------------------
# Early versions of the MinGW cross-build tools can only build
# static (non-DLL) libraries. Fedora's cross-build of gcc 4.4.6
# needs these uncommented, other distributions have not been
# tested with this release of Base:
SHARED_LIBRARIES = NO
STATIC_BUILD = YES
# The cross-build tools are in $(GNU_DIR)/bin
# Default is /usr
#GNU_DIR = /usr/local
# Different distribution cross-build packages use different prefixes:
# Ubuntu:
#CMPLR_PREFIX = i686-w64-mingw32-
# RHEL:
CMPLR_PREFIX = i686-pc-mingw32-
# Debian?
#CMPLR_PREFIX = i586-mingw32msvc-

View File

@@ -2,10 +2,8 @@
#
# $Revision-Id$
#
# Site specific override definitions for solaris-sparc host builds
# Only the local epics system manager should modify this file
# Site specific overrides for linux-x86_64 host and target builds
#-------------------------------------------------------
#Prepares the object code to collect data for profiling with prof.
#PROFILE=YES

View File

@@ -0,0 +1,9 @@
# CONFIG_SITE.linux-x86_64.linux-arm
#
# $Revision-Id$
#
# Site specific settings for linux-x86_64 host - linux-arm target builds
#-------------------------------------------------------
# Inherit setting from linux-x86
include $(CONFIG)/os/CONFIG_SITE.linux-x86.linux-arm

View File

@@ -0,0 +1,9 @@
# CONFIG_SITE.linux-x86_64.linux-arm-debug
#
# $Revision-Id$
#
# Site specific settings for linux-x86_64 host - linux-arm-debug target builds
#-------------------------------------------------------
# Inherit settings from linux-arm
include $(CONFIG)/os/CONFIG_SITE.linux-x86.linux-arm

View File

@@ -0,0 +1,8 @@
# CONFIG_SITE.linux-x86_64.win32-x86-mingw
#
# Configuration for linux-x86_64 host win32-x86-mingw target builds
#-------------------------------------------------------
# Inherit from the linux-x86 host architecture
include $(CONFIG)/os/CONFIG_SITE.linux-x86.win32-x86-mingw

View File

@@ -3,15 +3,9 @@
# $Revision-Id$
#
# Site Specific definitions for win32-x86-mingw target
# Only the local epics system manager should modify this file
# The MinGW bin directory must be in your path.
# Uncomment the following settings for MinGW_w32 releases
# <MinGW directory>/bin should be in your path
#CMPLR_PREFIX=i686-w64-mingw32-
#CC = $(CMPLR_PREFIX)gcc
#CCC = $(CMPLR_PREFIX)g++
#AR = $(CMPLR_PREFIX)ar -rc
#LD = $(CMPLR_PREFIX)ld -r
#RANLIB = $(CMPLR_PREFIX)ranlib
# Set the compiler prefix for your MinGW installation
#CMPLR_PREFIX = i686-w64-mingw32-
#CMPLR_PREFIX = i586-mingw32msvc-

View File

@@ -100,7 +100,7 @@
later.
GNU readline or Tecla library
GNU readline and Tecla librararies can be used by the IOC shell to
GNU readline and Tecla libraries can be used by the IOC shell to
provide command line editing and command line history recall and edit.
GNU readline (or Tecla library) must be installed on your target system
when COMMANDLINE_LIBRARY is set to READLINE (or TECLA) for that target.
@@ -124,7 +124,7 @@
EPICS documentation is available through the [3]EPICS website at
Argonne.
Release specific documenataion can also be found in the
Release specific documentation can also be found in the
base/documentation directory of the distribution.
Directory Structure
@@ -137,7 +137,7 @@
base/configure Operating system independent build config files
base/configure/os Operating system dependent build config files
base/configure/tools Perl and shell scripts used in the build
base/documentation Distributation documentation
base/documentation Distribution documentation
base/src All epics base source code in subdirectories
base/src/RTEMS Code to configure RTEMS for EPICS
base/src/as Access security
@@ -170,7 +170,7 @@
base/src/libCom/macLib Macro substitution handler
base/src/libCom/misc Miscellaneous utilities
base/src/libCom/osi Operating system independent API
base/src/libCom/osi/os Operating system dependant code in subdirectories
base/src/libCom/osi/os Operating system dependent code in subdirectories
base/src/libCom/ring Methods for creating and using ring buffers
base/src/libCom/taskwd Task watchdog
base/src/libCom/test Test tools (timer, semBinary, semMutex,fdmgr, ...)
@@ -206,14 +206,14 @@
Build related components
base/documentation/README* files
base/documentation directory - contains setup, build, and install documents
README.1st Instructions for setup and building epics base
README.html html version of README.1st
README.WIN32 Microsoft WIN32 specific instructions
README.cxxTemplates Information about C++ templates in EPICS base
README.MS_Windows Microsoft Windows specific instructions
README.cris Axis CRIS specific instructions
README.darwin.html Installation notes for OS X (Darwin)
README.niCpu030 NI cpu030 specific instructions
README.darwin Installation notes for Mac OS X (Darwin)
RELEASE_NOTES.html Notes on release changes
KnownProblems.html List of known problems and workarounds
Converting*To*.html Release specific conversion instructions
@@ -240,7 +240,7 @@
CONFIG_BASE_VERSION Definitions for EPICS base version number
CONFIG_COMMON Definitions common to all builds
CONFIG_ENV Definitions of EPICS environment variables
CONFIG_SITE Site specific make defintions
CONFIG_SITE Site specific make definitions
CONFIG_SITE_ENV Site defaults for EPICS environment variables
MAKEFILE Installs CONFIG* RULES* creates
CONFIG_APP_INCLUDE
@@ -271,7 +271,7 @@
base/src/tools directory - contains Perl scripts used for the build
Makefile Makefile for installing the scripts into cfg dir
convertRelease.pl Performs consistancy checks on RELEASE files
convertRelease.pl Performs consistency checks on RELEASE files
cvsclean.pl Remove all .#* files in directory tree
dos2unix.pl Converts text file from DOS CR/LF to unix ISO
expandvars.pl Tool to expand @VAR@ variables while copying a file

View File

@@ -1,4 +1,7 @@
<!DOCTYPE HTML>
<!-- Generate the README.1st file from this file using:
elinks -dump -no-numbering -no-references -dump-width 80 README.html
-->
<HTML>
<HEAD>
<TITLE>README - EPICS Base Installation Instructions</TITLE>
@@ -102,7 +105,7 @@
For RTEMS targets, you need RTEMS core and toolset version 4.9.2 or later.</P>
<P><B>GNU readline or Tecla library</B><BR>
GNU readline and Tecla librararies can be used by the IOC shell to
GNU readline and Tecla libraries can be used by the IOC shell to
provide command line editing and command line history recall and edit.
GNU readline (or Tecla library) must be installed on your target system
when COMMANDLINE_LIBRARY is set to READLINE (or TECLA) for that target.
@@ -124,7 +127,7 @@
<H3><A NAME="0_0_8"> Documentation</A></H3>
<BLOCKQUOTE>EPICS documentation is available through the
<a href="http://www.aps.anl.gov/epics/">EPICS website</a> at Argonne.
<P>Release specific documenataion can also be found in the base/documentation
<P>Release specific documentation can also be found in the base/documentation
directory of the distribution.</BLOCKQUOTE>
<H3><A NAME="0_0_10"> Directory Structure</A></H3>
@@ -137,7 +140,7 @@
base/configure Operating system independent build config files
base/configure/os Operating system dependent build config files
base/configure/tools Perl and shell scripts used in the build
base/documentation Distributation documentation
base/documentation Distribution documentation
base/src All epics base source code in subdirectories
base/src/RTEMS Code to configure RTEMS for EPICS
base/src/as Access security
@@ -170,7 +173,7 @@
base/src/libCom/macLib Macro substitution handler
base/src/libCom/misc Miscellaneous utilities
base/src/libCom/osi Operating system independent API
base/src/libCom/osi/os Operating system dependant code in subdirectories
base/src/libCom/osi/os Operating system dependent code in subdirectories
base/src/libCom/ring Methods for creating and using ring buffers
base/src/libCom/taskwd Task watchdog
base/src/libCom/test Test tools (timer, semBinary, semMutex,fdmgr, ...)
@@ -210,14 +213,15 @@
<H3><A NAME="0_0_11"> Build related components</A></H3>
<BLOCKQUOTE>
<H4>base/documentation/README* files</H4>
<H4>base/documentation directory - contains setup, build, and install
documents</H4>
<PRE>
README.1st Instructions for setup and building epics base
README.html html version of README.1st
README.WIN32 Microsoft WIN32 specific instructions
README.cxxTemplates Information about C++ templates in EPICS base
README.MS_Windows Microsoft Windows specific instructions
README.cris Axis CRIS specific instructions
README.darwin.html Installation notes for OS X (Darwin)
README.niCpu030 NI cpu030 specific instructions
README.darwin Installation notes for Mac OS X (Darwin)
RELEASE_NOTES.html Notes on release changes
KnownProblems.html List of known problems and workarounds
Converting*To*.html Release specific conversion instructions
@@ -246,7 +250,7 @@
CONFIG_BASE_VERSION Definitions for EPICS base version number
CONFIG_COMMON Definitions common to all builds
CONFIG_ENV Definitions of EPICS environment variables
CONFIG_SITE Site specific make defintions
CONFIG_SITE Site specific make definitions
CONFIG_SITE_ENV Site defaults for EPICS environment variables
MAKEFILE Installs CONFIG* RULES* creates
CONFIG_APP_INCLUDE
@@ -279,7 +283,7 @@
<H4>base/src/tools directory - contains Perl scripts used for the build</H4>
<PRE>
Makefile Makefile for installing the scripts into cfg dir
convertRelease.pl Performs consistancy checks on RELEASE files
convertRelease.pl Performs consistency checks on RELEASE files
cvsclean.pl Remove all .#* files in directory tree
dos2unix.pl Converts text file from DOS CR/LF to unix ISO
expandvars.pl Tool to expand @VAR@ variables while copying a file

View File

@@ -13,6 +13,83 @@
<!-- Insert new items immediately below here ... -->
<h3>MinGW Cross-builds from Linux</h3>
<p>Build configuration files have been back-ported from the 3.15 branch that
allows cross-building of the win32-x86-mingw target from either linux-x86 or
linux-x86_64 hosts. Many Linux distributions now package the necessary MinGW
cross-build tools and libraries to support this. Adjust the settings in
configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw and add win32-x86-mingw to
the CROSS_COMPILER_TARGET_ARCHS variable in configure/CONFIG_SITE or in
configure/os/CONFIG_SITE.linux-x86.Common.</p>
<h3>Build rules for RTEMS GESYS modules</h3>
<p>RTEMS target builds can now be configured to make GESYS modules by changing
the <CODE>USE_GESYS=NO</code> setting in the file
configure/os/CONFIG_SITE.Common.RTEMS to <code>YES</code>.</p>
<h3>Added Make variables for command-line use</h3>
<p>The following variables are now used during the build process, reserved for
setting on the command-line only (Makefiles should continue to use the
<code>USR_</code> equivalents):</p>
<ul>
<li>CMD_INCLUDES</li>
<li>CMD_CPPFLAGS</li>
<li>CMD_CFLAGS</li>
<li>CMD_CXXFLAGS</li>
<li>CMD_LDFLAGS</li>
<li>CMD_DBFLAGS</li>
<li>CMD_DBDFLAGS</li>
<li>CMD_ARFLAGS</li>
</ul>
<p>For example:</p>
<blockquote><pre>
make CMD_INCLUDES=/opt/local/include CMD_LDFLAGS=-L/opt/local/lib
</pre></blockquote>
<h3>Back-ported dbLoadRecordsHook from the 3.15 branch</h3>
<p>See the Release Notes from the Base 3.15.1 release for details.</p>
<h3>Enhanced API for asTrapWrite listeners</h3>
<p>External software such as the CA Put Logging module that registers a listener
with the asTrapWrite subsystem was not previously given access to the actual
data being sent by the CA client. In most cases this was not a problem as the
listener can look at the field being modified both before and after the
operation, but if the put processes the record which immediately overwrites the
new value, the client's value cannot be observed.</p>
<p>This release adds three fields to the asTrapWriteMessage structure that is
passed to the listener routines. These new fields provide the CA data type, the
number of array elements, and a pointer to the source data buffer. This change
is completely backwards compatible with listener code written against the
original API. The new API can be detected at compile-time as follows:</p>
<blockquote><pre>
#include "asLib.h"
/* ... */
#ifdef asTrapWriteWithData
/* Enhanced API */
#endif
</pre></blockquote>
<h3>Back-ported the <q>tapfiles</q> build target from 3.15</h3>
<p>This GNUmake target runs the same tests as the <q>runtests</q> target, but
instead of summarizing or displaying the output for each test script it creates
a <q>.tap</q> file inside the architecture build directory which contains the
detailed test output. The output file can be parsed by continuous integration
packages such as <a href="http://www.jenkins-ci.org/">Jenkins</a> to show the
test results.</p>
<h3>Fix buffer overflow in epicsStrnRawFromEscaped()</h3>
<p>Launchpad <a href="https://bugs.launchpad.net/bugs/1388313">bug

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -30,25 +30,38 @@ typedef enum{
} asClientStatus;
typedef void (*ASCLIENTCALLBACK) (ASCLIENTPVT,asClientStatus);
/* The following routines are macros with the following syntax
long asCheckGet(ASCLIENTPVT asClientPvt);
long asCheckPut(ASCLIENTPVT asClientPvt);
*/
#define asCheckGet(asClientPvt)\
(asActive \
? ((asClientPvt)->access>=asREAD ? TRUE : FALSE)\
: TRUE)
#define asCheckPut(asClientPvt)\
(asActive \
? ((asClientPvt)->access>=asWRITE ? TRUE : FALSE)\
: TRUE)
#define asTrapWriteBefore(asClientPvt,user,host,addr) \
(((asActive) && (asClientPvt)->trapMask) \
? asTrapWriteBeforeWrite((user),(host),(addr)) \
: 0)
#define asCheckGet(asClientPvt) \
(!asActive || ((asClientPvt)->access >= asREAD))
#define asCheckPut(asClientPvt) \
(!asActive || ((asClientPvt)->access >= asWRITE))
/* More convenience macros
void *asTrapWriteWithData(ASCLIENTPVT asClientPvt,
const char *userid, const char *hostid, void *addr,
int dbrType, int no_elements, void *data);
void asTrapWriteAfter(ASCLIENTPVT asClientPvt);
*/
#define asTrapWriteWithData(asClientPvt, user, host, addr, type, count, data) \
((asActive && (asClientPvt)->trapMask) \
? asTrapWriteBeforeWithData((user), (host), (addr), (type), (count), (data)) \
: 0)
#define asTrapWriteAfter(pvt) \
if (pvt) asTrapWriteAfterWrite(pvt)
/* This macro is for backwards compatibility, upgrade any code
calling it to use asTrapWriteWithData() instead ASAP:
void *asTrapWriteBefore(ASCLIENTPVT asClientPvt,
const char *userid, const char *hostid, void *addr);
*/
#define asTrapWriteBefore(asClientPvt, user, host, addr) \
asTrapWriteWithData(asClientPvt, user, host, addr, 0, 0, NULL)
#define asTrapWriteAfter(pvt) if((pvt)) asTrapWriteAfterWrite((pvt))
epicsShareFunc long epicsShareAPI asInitialize(ASINPUTFUNCPTR inputfunction);
epicsShareFunc long epicsShareAPI asInitFile(
const char *filename,const char *substitutions);
@@ -100,8 +113,9 @@ epicsShareFunc int epicsShareAPI asDumpMemFP(FILE *fp,const char *asgname,
epicsShareFunc int epicsShareAPI asDumpHash(void);
epicsShareFunc int epicsShareAPI asDumpHashFP(FILE *fp);
epicsShareFunc void * epicsShareAPI asTrapWriteBeforeWrite(
const char *userid,const char *hostid,void *addr);
epicsShareFunc void * epicsShareAPI asTrapWriteBeforeWithData(
const char *userid, const char *hostid, void *addr,
int dbrType, int no_elements, void *data);
epicsShareFunc void epicsShareAPI asTrapWriteAfterWrite(void *pvt);

View File

@@ -3,8 +3,7 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*asTrapWrite.c */
@@ -100,47 +99,53 @@ void epicsShareAPI asTrapWriteUnregisterListener(asTrapWriteId id)
= (listenerPvt *)ellNext(&plistenerPvt->node);
if(plistenerPvt->plistener == plistener) {
ellDelete(&pwriteMessage->listenerPvtList,&plistenerPvt->node);
freeListFree(pasTrapWritePvt->freeListListenerPvt,(void *)plistenerPvt);
freeListFree(pasTrapWritePvt->freeListListenerPvt, plistenerPvt);
}
plistenerPvt = pnext;
}
pwriteMessage = (writeMessage *)ellNext(&pwriteMessage->node);
}
ellDelete(&pasTrapWritePvt->listenerList,&plistener->node);
free((void *)plistener);
free(plistener);
epicsMutexUnlock(pasTrapWritePvt->lock);
}
void * epicsShareAPI asTrapWriteBeforeWrite(
const char *userid,const char *hostid,void *addr)
void * epicsShareAPI asTrapWriteBeforeWithData(
const char *userid, const char *hostid, void *addr,
int dbrType, int no_elements, void *data)
{
writeMessage *pwriteMessage;
listener *plistener;
listenerPvt *plistenerPvt;
if(pasTrapWritePvt==0) return(0);
if(ellCount(&pasTrapWritePvt->listenerList)<=0) return 0;
if (pasTrapWritePvt == 0 ||
ellCount(&pasTrapWritePvt->listenerList) <= 0) return 0;
pwriteMessage = (writeMessage *)freeListCalloc(
pasTrapWritePvt->freeListWriteMessage);
pwriteMessage->message.userid = userid;
pwriteMessage->message.hostid = hostid;
pwriteMessage->message.serverSpecific = addr;
pwriteMessage->message.dbrType = dbrType;
pwriteMessage->message.no_elements = no_elements;
pwriteMessage->message.data = data;
ellInit(&pwriteMessage->listenerPvtList);
epicsMutexMustLock(pasTrapWritePvt->lock);
ellAdd(&pasTrapWritePvt->writeMessageList,&pwriteMessage->node);
ellAdd(&pasTrapWritePvt->writeMessageList, &pwriteMessage->node);
plistener = (listener *)ellFirst(&pasTrapWritePvt->listenerList);
while(plistener) {
plistenerPvt = (listenerPvt *)freeListCalloc(
while (plistener) {
listenerPvt *plistenerPvt = (listenerPvt *)freeListCalloc(
pasTrapWritePvt->freeListListenerPvt);
plistenerPvt->plistener = plistener;
pwriteMessage->message.userPvt = 0;
(*plistener->func)(&pwriteMessage->message,0);
plistener->func(&pwriteMessage->message, 0);
plistenerPvt->userPvt = pwriteMessage->message.userPvt;
ellAdd(&pwriteMessage->listenerPvtList,&plistenerPvt->node);
ellAdd(&pwriteMessage->listenerPvtList, &plistenerPvt->node);
plistener = (listener *)ellNext(&plistener->node);
}
epicsMutexUnlock(pasTrapWritePvt->lock);
return((void *)pwriteMessage);
return pwriteMessage;
}
void epicsShareAPI asTrapWriteAfterWrite(void *pvt)
@@ -148,20 +153,22 @@ void epicsShareAPI asTrapWriteAfterWrite(void *pvt)
writeMessage *pwriteMessage = (writeMessage *)pvt;
listenerPvt *plistenerPvt;
if(pwriteMessage==0 || pasTrapWritePvt==0) return;
if (pwriteMessage == 0 ||
pasTrapWritePvt == 0) return;
epicsMutexMustLock(pasTrapWritePvt->lock);
plistenerPvt = (listenerPvt *)ellFirst(&pwriteMessage->listenerPvtList);
while(plistenerPvt) {
while (plistenerPvt) {
listenerPvt *pnext = (listenerPvt *)ellNext(&plistenerPvt->node);
listener *plistener;
plistener = plistenerPvt->plistener;
listener *plistener = plistenerPvt->plistener;
pwriteMessage->message.userPvt = plistenerPvt->userPvt;
(*plistener->func)(&pwriteMessage->message,1);
ellDelete(&pwriteMessage->listenerPvtList,&plistenerPvt->node);
freeListFree(pasTrapWritePvt->freeListListenerPvt,(void *)plistenerPvt);
plistener->func(&pwriteMessage->message, 1);
ellDelete(&pwriteMessage->listenerPvtList, &plistenerPvt->node);
freeListFree(pasTrapWritePvt->freeListListenerPvt, plistenerPvt);
plistenerPvt = pnext;
}
ellDelete(&pasTrapWritePvt->writeMessageList,&pwriteMessage->node);
freeListFree(pasTrapWritePvt->freeListWriteMessage,(void *)pwriteMessage);
ellDelete(&pasTrapWritePvt->writeMessageList, &pwriteMessage->node);
freeListFree(pasTrapWritePvt->freeListWriteMessage, pwriteMessage);
epicsMutexUnlock(pasTrapWritePvt->lock);
}

View File

@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*asTrapWrite.h*/
/* Author: Marty Kraimer Date: 07NOV2000 */
@@ -24,6 +23,9 @@ typedef struct asTrapWriteMessage {
const char *hostid;
void *serverSpecific;
void *userPvt;
int dbrType; /* Data type from ca/db_access.h, NOT dbFldTypes.h */
int no_elements;
void *data; /* Might be NULL if no data is available */
} asTrapWriteMessage;

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -3,8 +3,7 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -16,26 +15,6 @@
* Author: Jeff Hill
* Date: 3-27-90
*
* Control System Software for the GTA Project
*
* Copyright 1988, 1989, the Regents of the University of California.
*
* This software was produced under a U.S. Government contract
* (W-7405-ENG-36) at the Los Alamos National Laboratory, which is
* operated by the University of California for the U.S. Department
* of Energy.
*
* Developed by the Controls and Automation Group (AT-8)
* Accelerator Technology Division
* Los Alamos National Laboratory
*
* Direct inqueries to:
* Jeff HIll, AT-8, Mail Stop H820
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
* Phone: (505) 665-1831
* E-mail: johill@lanl.gov
*
* PURPOSE:
* Broadcasts fan out over the LAN, but old IP kernels do not allow
* two processes on the same machine to get the same broadcast
@@ -108,17 +87,17 @@ static const unsigned short PORT_ANY = 0u;
/*
* makeSocket()
*/
static bool makeSocket ( unsigned short port, bool reuseAddr, SOCKET * pSock )
static int makeSocket ( unsigned short port, bool reuseAddr, SOCKET * pSock )
{
int status;
union {
struct sockaddr_in ia;
struct sockaddr sa;
} bd;
union {
struct sockaddr_in ia;
struct sockaddr sa;
} bd;
SOCKET sock = epicsSocketCreate ( AF_INET, SOCK_DGRAM, 0 );
if ( sock == INVALID_SOCKET ) {
return false;
return SOCKERRNO;
}
/*
@@ -132,15 +111,16 @@ static bool makeSocket ( unsigned short port, bool reuseAddr, SOCKET * pSock )
bd.ia.sin_port = htons ( port );
status = bind ( sock, &bd.sa, (int) sizeof(bd) );
if ( status < 0 ) {
status = SOCKERRNO;
epicsSocketDestroy ( sock );
return false;
return status;
}
if ( reuseAddr ) {
epicsSocketEnableAddressReuseDuringTimeWaitState ( sock );
}
}
*pSock = sock;
return true;
return 0;
}
repeaterClient::repeaterClient ( const osiSockAddr &fromIn ) :
@@ -156,10 +136,10 @@ bool repeaterClient::connect ()
{
int status;
if ( ! makeSocket ( PORT_ANY, false, & this->sock ) ) {
if ( int sockerrno = makeSocket ( PORT_ANY, false, & this->sock ) ) {
char sockErrBuf[64];
epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
epicsSocketConvertErrorToString (
sockErrBuf, sizeof ( sockErrBuf ), sockerrno );
fprintf ( stderr, "%s: no client sock because \"%s\"\n",
__FILE__, sockErrBuf );
return false;
@@ -300,20 +280,25 @@ inline bool repeaterClient::identicalPort ( const osiSockAddr &fromIn )
bool repeaterClient::verify ()
{
SOCKET tmpSock;
bool success = makeSocket ( this->port (), false, & tmpSock );
if ( success ) {
int sockerrno = makeSocket ( this->port (), false, & tmpSock );
if ( sockerrno == SOCK_EADDRINUSE ) {
// Normal result, client using port
return true;
}
if ( sockerrno == 0 ) {
// Client went away, released port
epicsSocketDestroy ( tmpSock );
}
else {
if ( SOCKERRNO != SOCK_EADDRINUSE ) {
char sockErrBuf[64];
epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
fprintf ( stderr, "CA Repeater: bind test err was \"%s\"\n",
sockErrBuf );
}
char sockErrBuf[64];
epicsSocketConvertErrorToString (
sockErrBuf, sizeof ( sockErrBuf ), sockerrno );
fprintf ( stderr, "CA Repeater: Bind test error \"%s\"\n",
sockErrBuf );
}
return ! success;
return false;
}
@@ -387,10 +372,10 @@ static void register_new_client ( osiSockAddr & from,
if ( ! init ) {
SOCKET sock;
if ( ! makeSocket ( PORT_ANY, true, & sock ) ) {
if ( int sockerrno = makeSocket ( PORT_ANY, true, & sock ) ) {
char sockErrBuf[64];
epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
epicsSocketConvertErrorToString (
sockErrBuf, sizeof ( sockErrBuf ), sockerrno );
fprintf ( stderr, "%s: Unable to create repeater bind test socket because \"%s\"\n",
__FILE__, sockErrBuf );
}
@@ -511,18 +496,18 @@ void ca_repeater ()
port = envGetInetPortConfigParam ( & EPICS_CA_REPEATER_PORT,
static_cast <unsigned short> (CA_REPEATER_PORT) );
if ( ! makeSocket ( port, true, & sock ) ) {
if ( int sockerrno = makeSocket ( port, true, & sock ) ) {
/*
* test for server was already started
*/
if ( SOCKERRNO == SOCK_EADDRINUSE ) {
if ( sockerrno == SOCK_EADDRINUSE ) {
osiSockRelease ();
debugPrintf ( ( "CA Repeater: exiting because a repeater is already running\n" ) );
return;
}
char sockErrBuf[64];
epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
epicsSocketConvertErrorToString (
sockErrBuf, sizeof ( sockErrBuf ), sockerrno );
fprintf ( stderr, "%s: Unable to create repeater socket because \"%s\" - fatal\n",
__FILE__, sockErrBuf );
osiSockRelease ();

View File

@@ -462,7 +462,7 @@ SV * CA_new(const char *class, const char *name, ...) {
SvREFCNT_dec(ca_ref);
if (pch->conn_sub)
SvREFCNT_dec(pch->conn_sub);
croak(get_error_msg(status));
croak("%s", get_error_msg(status));
}
return ca_ref;
@@ -491,7 +491,7 @@ void CA_DESTROY(SV *ca_ref) {
Safefree(pch);
if (status != ECA_NORMAL)
croak(get_error_msg(status));
croak("%s", get_error_msg(status));
}
@@ -516,7 +516,7 @@ void CA_change_connection_event(SV *ca_ref, SV *sub) {
status = ca_change_connection_event(pch->chan, handler);
if (status != ECA_NORMAL) {
croak(get_error_msg(status));
croak("%s", get_error_msg(status));
}
}
@@ -600,7 +600,7 @@ void CA_put(SV *ca_ref, SV *val, ...) {
Safefree(p.dbr);
}
if (status != ECA_NORMAL) {
croak(get_error_msg(status));
croak("%s", get_error_msg(status));
}
XSRETURN(0);
}
@@ -695,7 +695,7 @@ void CA_put_callback(SV *ca_ref, SV *sub, SV *val, ...) {
}
if (status != ECA_NORMAL) {
SvREFCNT_dec(put_sub);
croak(get_error_msg(status));
croak("%s", get_error_msg(status));
}
XSRETURN(0);
}
@@ -736,7 +736,7 @@ void CA_put_acks(SV *ca_ref, SV *sevr, ...) {
status = ca_put(DBR_PUT_ACKS, pch->chan, &acks);
if (status != ECA_NORMAL)
croak(get_error_msg(status));
croak("%s", get_error_msg(status));
XSRETURN(0);
}
@@ -760,7 +760,7 @@ void CA_put_ackt(SV *ca_ref, int ack, ...) {
status = ca_put(DBR_PUT_ACKS, pch->chan, &ackt);
if (status != ECA_NORMAL)
croak(get_error_msg(status));
croak("%s", get_error_msg(status));
XSRETURN(0);
}
@@ -788,7 +788,7 @@ void CA_get(SV *ca_ref) {
status = ca_get(best_type(pch), pch->chan, &pch->data);
}
if (status != ECA_NORMAL) {
croak(get_error_msg(status));
croak("%s", get_error_msg(status));
}
}
@@ -869,7 +869,7 @@ void CA_get_callback(SV *ca_ref, SV *sub, ...) {
exit_croak:
SvREFCNT_dec(get_sub);
croak(croak_msg);
croak("%s", croak_msg);
}
@@ -953,7 +953,7 @@ SV * CA_create_subscription(SV *ca_ref, const char *mask_str, SV *sub, ...) {
exit_croak:
SvREFCNT_dec(mon_ref);
SvREFCNT_dec(mon_sub);
croak(croak_msg);
croak("%s", croak_msg);
}
@@ -970,7 +970,7 @@ void CA_clear_subscription(const char *class, SV *mon_ref) {
status = ca_clear_subscription(event);
if (status != ECA_NORMAL) {
croak(get_error_msg(status));
croak("%s", get_error_msg(status));
}
}
@@ -980,7 +980,7 @@ void CA_clear_subscription(const char *class, SV *mon_ref) {
void CA_pend_io(const char *class, double timeout) {
int status = ca_pend_io(timeout);
if (status != ECA_NORMAL) {
croak(get_error_msg(status));
croak("%s", get_error_msg(status));
}
}
@@ -995,7 +995,7 @@ int CA_test_io(const char *class) {
void CA_pend_event(const char *class, double timeout) {
int status = ca_pend_event(timeout);
if (status != ECA_TIMEOUT) {
croak(get_error_msg(status));
croak("%s", get_error_msg(status));
}
}
@@ -1089,7 +1089,7 @@ void CA_add_exception_event(const char *class, SV *sub) {
if (status != ECA_NORMAL) {
SvREFCNT_dec(exception_sub);
exception_sub = NULL;
croak(get_error_msg(status));
croak("%s", get_error_msg(status));
}
}
@@ -1147,7 +1147,7 @@ void CA_replace_printf_handler(const char *class, SV *sub) {
if (status != ECA_NORMAL) {
SvREFCNT_dec(printf_sub);
printf_sub = NULL;
croak(get_error_msg(status));
croak("%s", get_error_msg(status));
}
}

View File

@@ -25,9 +25,8 @@ PERL_VERSION = $(shell $(PERL) ../perlConfig.pl version)
PERL_ARCHNAME = $(shell $(PERL) ../perlConfig.pl archname)
PERL_ARCHPATH = $(PERL_VERSION)/$(PERL_ARCHNAME)
ifeq ($(findstring Host,$(VALID_BUILDS)),Host)
ifeq ($(findstring $(OS_CLASS),WIN32 cygwin32),)
# Doesn't build on WIN32
ifeq ($(T_A),$(EPICS_HOST_ARCH)) # No cross-builds (wrong Perl!)
ifeq ($(findstring $(OS_CLASS),WIN32 cygwin32),) # Doesn't build on WIN32
LOADABLE_LIBRARY_HOST = Cap5
PERL_SCRIPTS += cainfo.pl
@@ -53,7 +52,8 @@ include $(TOP)/configure/RULES
ifdef T_A
EXTUTILS = $(shell $(PERL) ../perlConfig.pl privlib)/ExtUtils
XSUBPP = $(firstword $(wildcard /usr/bin/xsubpp $(EXTUTILS)/xsubpp))
PERLBIN = $(shell $(PERL) ../perlConfig.pl bin)
XSUBPP = $(firstword $(wildcard $(PERLBIN)/xsubpp $(EXTUTILS)/xsubpp))
%.c: ../%.xs
$(RM) $@ $@_new

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -61,28 +61,33 @@ capri caPriority = DEFAULT_CA_PRIORITY; /* CA Priority */
void sprint_long (char *ret, long val, IntFormatT outType)
static void sprint_long (char *ret, dbr_long_t val, IntFormatT outType)
{
long i, bit, skip=-1L; /* used only for printing bits */
switch (outType) {
case hex: sprintf(ret, "0x%lX", val); break;
case oct: sprintf(ret, "0o%lo", val); break;
case bin:
for (i=31; i>=0 ; i--)
{
bit = (val>>i) & 0x1L;
if (skip<0 && bit)
{
if (outType == bin && val != 0) {
/* sprintf doesn't do binary; this code doesn't handle 0 */
int i, skip = -1;
for (i = 31; i >= 0; i--) {
int bit = (val >> i) & 1;
if (skip < 0 && bit) {
skip = 31 - i; /* skip leading 0's */
ret[i+1] = '\0';
}
if (skip >= 0)
{
ret[31-i-skip] = (bit) ? '1' : '0';
if (skip >= 0) {
ret[31-i-skip] = '0' + bit;
}
}
break;
default: sprintf(ret, "%ld", val); /* decimal */
}
else {
const char *fmt[4] = { /* Order must match the enum IntFormatT */
"%ld" /* dec */,
"0" /* bin, val is 0 */,
"0o%lo" /* oct */,
"0x%lX" /* hex */
};
sprintf(ret, fmt[outType], val);
}
}
@@ -115,6 +120,7 @@ char *val2str (const void *v, unsigned type, int index)
strcpy (str, "*** invalid type");
return str;
}
strcpy (str, "!!!");
base_type = type % (LAST_TYPE+1);

View File

@@ -61,6 +61,10 @@
epicsShareDef struct dbBase *pdbbase = 0;
epicsShareDef volatile int interruptAccept=FALSE;
/* Hook Routines */
epicsShareDef DB_LOAD_RECORDS_HOOK_ROUTINE dbLoadRecordsHook = NULL;
static short mapDBFToDBR[DBF_NTYPES] = {
/* DBF_STRING => */ DBR_STRING,
/* DBF_CHAR => */ DBR_CHAR,
@@ -817,7 +821,11 @@ int epicsShareAPI dbLoadDatabase(const char *file, const char *path, const char
int epicsShareAPI dbLoadRecords(const char* file, const char* subs)
{
return dbReadDatabase(&pdbbase, file, 0, subs);
int status = dbReadDatabase(&pdbbase, file, 0, subs);
if (!status && dbLoadRecordsHook)
dbLoadRecordsHook(file, subs);
return status;
}
@@ -961,6 +969,11 @@ long epicsShareAPI dbGetField(DBADDR *paddr,short dbrType,
if (nRequest && *nRequest > 1) *nRequest = 1;
break;
case DBR_DOUBLE: /* Needed for dbCa links */
if (nRequest && *nRequest) *nRequest = 1;
*(double *)pbuffer = epicsNAN;
goto done;
case DBR_CHAR:
case DBR_UCHAR:
if (nRequest && *nRequest > 0) {

View File

@@ -276,9 +276,14 @@ epicsShareFunc long epicsShareAPI dbBufferSize(
short dbrType,long options,long nRequest);
epicsShareFunc long epicsShareAPI dbValueSize(short dbrType);
/* Hook Routine */
typedef void (*DB_LOAD_RECORDS_HOOK_ROUTINE)(const char* filename,
const char* substitutions);
epicsShareExtern DB_LOAD_RECORDS_HOOK_ROUTINE dbLoadRecordsHook;
epicsShareFunc int epicsShareAPI dbLoadDatabase(
const char *filename, const char *path, const char *substitutions);
epicsShareFunc int epicsShareAPI dbLoadRecords(
const char* filename, const char* substitutions);

View File

@@ -367,7 +367,7 @@ long dbCaPutLinkCallback(struct link *plink,short dbrType,
plink->value.pv_link.pvlMask |= pvlOptOutNative;
*/
}
if (nRequest == 1){
if (nRequest == 1 && pca->nelements==1){
long (*fConvert)(const void *from, void *to, struct dbAddr *paddr);
fConvert = dbFastPutConvertRoutine[dbrType][newType];
@@ -381,7 +381,13 @@ long dbCaPutLinkCallback(struct link *plink,short dbrType,
dbAddr.pfield = pca->pputNative;
/*Following only used for DBF_STRING*/
dbAddr.field_size = MAX_STRING_SIZE;
if(nRequest>pca->nelements)
nRequest = pca->nelements;
status = aConvert(&dbAddr, pbuffer, nRequest, pca->nelements, 0);
if(nRequest<pca->nelements) {
long elemsize = dbr_value_size[ca_field_type(pca->chid)];
memset(nRequest*elemsize+(char*)pca->pputNative, 0, (pca->nelements-nRequest)*elemsize);
}
}
link_action |= CA_WRITE_NATIVE;
pca->gotOutNative = TRUE;

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -181,6 +181,7 @@ void dbPvdFreeMem(dbBase *pdbbase)
ellDelete(&pbucket->list, (ELLNODE *)ppvdNode);
free(ppvdNode);
}
epicsMutexUnlock(pbucket->lock);
epicsMutexDestroy(pbucket->lock);
free(pbucket);
}

View File

@@ -86,5 +86,6 @@ int main(int argc,char **argv)
dbReportDeviceConfig(pdbbase,stdout);
*/
dbFreeBase(pdbbase);
errlogFlush();
return(0);
}

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -45,7 +45,7 @@
int dbStaticDebug = 0;
static char *pNullString = "";
#define messagesize 100
#define RPCL_LEN 184
#define RPCL_LEN INFIX_TO_POSTFIX_SIZE(80)
static char *ppstring[5]={"NPP","PP","CA","CP","CPP"};
static char *msstring[4]={"NMS","MS","MSI","MSS"};
@@ -727,6 +727,7 @@ void epicsShareAPI dbFreeBase(dbBase *pdbbase)
dbPvdFreeMem(pdbbase);
dbFreePath(pdbbase);
free((void *)pdbbase);
pdbbase = NULL;
return;
}

View File

@@ -228,12 +228,14 @@ int main(int argc,char **argv)
fprintf(outFile,"#ifdef __cplusplus\n");
fprintf(outFile,"extern \"C\" {\n");
fprintf(outFile,"#endif\n");
fprintf(outFile,"#include <epicsAssert.h>\n");
fprintf(outFile,"#include <epicsExport.h>\n");
pdbRecordType = (dbRecordType *)ellFirst(&pdbbase->recordTypeList);
while(pdbRecordType) {
fprintf(outFile,"static int %sRecordSizeOffset(dbRecordType *pdbRecordType)\n{\n",
pdbRecordType->name);
fprintf(outFile," %sRecord *prec = 0;\n",pdbRecordType->name);
fprintf(outFile," assert(pdbRecordType->no_fields==%u);\n", pdbRecordType->no_fields);
for(i=0; i<pdbRecordType->no_fields; i++) {
char name[256];
int j;

View File

@@ -266,12 +266,14 @@ alias: tokenALIAS '(' tokenSTRING ',' tokenSTRING ')'
static int yyerror(char *str)
{
if (str)
epicsPrintf("Error: %s\n ", str);
epicsPrintf("Error: %s\n", str);
else
epicsPrintf("Error");
epicsPrintf(" at or before \"%s\"", yytext);
dbIncludePrint();
yyFailed = TRUE;
if (!yyFailed) { /* Only print this stuff once */
epicsPrintf(" at or before \"%s\"", yytext);
dbIncludePrint();
yyFailed = TRUE;
}
return(0);
}
static long pvt_yy_parse(void)

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -1353,7 +1353,7 @@ gddStatus gdd::put ( const gdd * dd )
// clip to upper limit of source
aitUint32 srcCopySize;
const aitUint32 unusedSrcBelow = srcCopyFirst - srcFirst;
if ( srcElemCount <= unusedSrcBelow ) {
if ( srcElemCount && srcElemCount <= unusedSrcBelow ) {
return gddErrorOutOfBounds;
}

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -19,6 +19,7 @@
#define epicsSingleton_h
#include <new>
#include <cstddef>
#include "shareLib.h"
#include "epicsAssert.h"

View File

@@ -88,7 +88,7 @@ int epicsStrnRawFromEscaped(char *to, size_t outsize, const char *from,
pfrom++; /*skip the x*/
for (i=0; i<2; i++) {
if (!isxdigit((int)*pfrom)) break;
if (!isxdigit(0xff & (int)*pfrom)) break;
strval[i] = *pfrom++; nfrom++;
}
sscanf(strval,"%x",&ival);
@@ -131,7 +131,7 @@ int epicsStrnEscapedFromRaw(char *outbuf, size_t outsize, const char *inbuf,
case '\'': len = epicsSnprintf(outpos, maxout, "\\'"); break;
case '\"': len = epicsSnprintf(outpos, maxout, "\\\""); break;
default:
if (isprint((int)c))
if (isprint(0xff & (int)c))
len = epicsSnprintf(outpos, maxout, "%c", c);
else
len = epicsSnprintf(outpos, maxout, "\\%03o",
@@ -166,7 +166,7 @@ size_t epicsStrnEscapedFromRawSize(const char *inbuf, size_t inlen)
nout++;
break;
default:
if (!isprint((int)c))
if (!isprint(0xff & (int)c))
nout += 3;
}
}
@@ -230,7 +230,7 @@ int epicsStrPrintEscaped(FILE *fp, const char *s, size_t len)
case '\'': nout += fprintf(fp, "\\'"); break;
case '\"': nout += fprintf(fp, "\\\""); break;
default:
if (isprint((int)c))
if (isprint(0xff & (int)c))
nout += fprintf(fp, "%c", c);
else
nout += fprintf(fp, "\\%03o", (unsigned char)c);

View File

@@ -1,11 +1,9 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -20,28 +18,36 @@
#include "epicsStdio.h"
/*
* epicsSocketConvertErrnoToString ()
* epicsSocketConvertErrorToString ()
*/
void epicsSocketConvertErrnoToString (
char * pBuf, unsigned bufSize )
void epicsSocketConvertErrorToString (
char * pBuf, unsigned bufSize, int theSockError )
{
if ( bufSize ) {
/*
* this does not work on systems prior to W2K
*/
int theSockError = SOCKERRNO;
DWORD success = FormatMessage (
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_MAX_WIDTH_MASK,
NULL, theSockError,
MAKELANGID ( LANG_NEUTRAL, SUBLANG_DEFAULT ), /* Default language */
pBuf, bufSize, NULL );
if ( ! success ) {
/*
* this does not work on systems prior to W2K
*/
DWORD success = FormatMessage (
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_MAX_WIDTH_MASK,
NULL, theSockError,
MAKELANGID ( LANG_NEUTRAL, SUBLANG_DEFAULT ), /* Default language */
pBuf, bufSize, NULL );
if ( ! success ) {
int status = epicsSnprintf (
pBuf, bufSize, "WINSOCK Error %d", theSockError );
if ( status <= 0 ) {
strncpy ( pBuf, "WINSOCK Error", bufSize );
pBuf [bufSize - 0] = '\0';
}
}
}
}
}
/*
* epicsSocketConvertErrnoToString ()
*/
void epicsSocketConvertErrnoToString (
char * pBuf, unsigned bufSize )
{
epicsSocketConvertErrorToString ( pBuf, bufSize, SOCKERRNO );
}

View File

@@ -1,11 +1,9 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* osdSock.c */
@@ -22,14 +20,22 @@
#include "osiSock.h"
/*
* epicsSocketConvertErrnoToString()
* epicsSocketConvertErrorToString()
*/
void epicsSocketConvertErrnoToString (
char * pBuf, unsigned bufSize )
void epicsSocketConvertErrorToString (
char * pBuf, unsigned bufSize, int theSockError )
{
if ( bufSize ) {
strncpy ( pBuf, strerror ( SOCKERRNO ), bufSize );
strncpy ( pBuf, strerror ( theSockError ), bufSize );
pBuf[bufSize-1] = '\0';
}
}
/*
* epicsSocketConvertErrnoToString()
*/
void epicsSocketConvertErrnoToString (
char * pBuf, unsigned bufSize )
{
epicsSocketConvertErrorToString ( pBuf, bufSize, SOCKERRNO );
}

View File

@@ -57,6 +57,7 @@ typedef struct commonAttr{
int maxPriority;
int minPriority;
int schedPolicy;
int usePolicy;
} commonAttr;
typedef struct epicsThreadOSD {
@@ -79,6 +80,7 @@ typedef struct epicsThreadOSD {
typedef struct {
int min_pri, max_pri;
int policy;
int ok;
} priAvailable;
#endif
@@ -138,6 +140,8 @@ static void setSchedulingPolicy(epicsThreadOSD *pthreadInfo,int policy)
#if defined (_POSIX_THREAD_PRIORITY_SCHEDULING)
int status;
if(!pcommonAttr->usePolicy) return;
status = pthread_attr_getschedparam(
&pthreadInfo->attr,&pthreadInfo->schedParam);
checkStatusOnce(status,"pthread_attr_getschedparam");
@@ -278,6 +282,7 @@ int low, try;
prm->min_pri = min;
prm->max_pri = try_pri(max, prm->policy) ? max-1 : max;
prm->ok = 1;
return 0;
}
@@ -290,6 +295,7 @@ void *dummy;
int status;
arg.policy = a_p->schedPolicy;
arg.ok = 0;
status = pthread_create(&id, 0, find_pri_range, &arg);
checkStatusQuit(status, "pthread_create","epicsThreadInit");
@@ -299,6 +305,7 @@ int status;
a_p->minPriority = arg.min_pri;
a_p->maxPriority = arg.max_pri;
a_p->usePolicy = arg.ok;
}
#endif
@@ -608,6 +615,7 @@ epicsShareFunc void epicsShareAPI epicsThreadSetPriority(epicsThreadId pthreadIn
pthreadInfo->osiPriority = priority;
if(!pthreadInfo->isFifoScheduled) return;
#if defined (_POSIX_THREAD_PRIORITY_SCHEDULING)
if(!pcommonAttr->usePolicy) return;
pthreadInfo->schedParam.sched_priority = getOssPriorityValue(pthreadInfo);
status = pthread_attr_setschedparam(
&pthreadInfo->attr,&pthreadInfo->schedParam);

View File

@@ -140,9 +140,11 @@ epicsShareFunc int epicsShareAPI osiSockAttach (void); /* returns T if success,
epicsShareFunc void epicsShareAPI osiSockRelease (void);
/*
* convert socket error number to a string
* convert socket error numbers to a string
*/
epicsShareFunc void epicsSocketConvertErrnoToString (
epicsShareFunc void epicsSocketConvertErrorToString (
char * pBuf, unsigned bufSize, int error );
epicsShareFunc void epicsSocketConvertErrnoToString (
char * pBuf, unsigned bufSize );
typedef union osiSockAddr {

View File

@@ -60,7 +60,9 @@ public:
void start ();
void daemon ();
void stop ();
address addr () const;
protected:
address srvaddr;
SOCKET sock;
epicsThreadId id;
bool exit;
@@ -156,18 +158,20 @@ extern "C" void serverDaemon ( void * pParam ) {
}
server::server ( const address & addrIn ) :
srvaddr ( addrIn ),
sock ( epicsSocketCreate ( AF_INET, SOCK_STREAM, IPPROTO_TCP ) ),
id ( 0 ), exit ( false )
{
testOk ( this->sock != INVALID_SOCKET, "Server socket valid" );
// setup server side
address tmpAddr = addrIn;
int status = bind ( this->sock,
& tmpAddr.sa, sizeof ( tmpAddr ) );
osiSocklen_t slen = sizeof ( this->srvaddr );
int status = bind ( this->sock, & this->srvaddr.sa, slen );
if ( status ) {
testDiag ( "bind to server socket failed, status = %d", status );
testAbort ( "Stop all CA servers before running this test." );
}
if ( getsockname(this->sock, & this->srvaddr.sa, & slen) != 0 ) {
testAbort ( "Failed to read socket address" );
}
status = listen ( this->sock, 10 );
testOk ( status == 0, "Server socket listening" );
@@ -182,7 +186,7 @@ void server::start ()
testOk ( this->id != 0, "Server thread created" );
}
void server::daemon ()
void server::daemon ()
{
while ( ! this->exit ) {
// accept client side
@@ -204,13 +208,18 @@ void server::stop ()
epicsSocketDestroy ( this->sock );
}
address server::addr () const
{
return this->srvaddr;
}
serverCircuit::serverCircuit ( SOCKET sockIn ) :
circuit ( sockIn )
{
circuit * pCir = this;
epicsThreadId threadId = epicsThreadCreate (
"server circuit", epicsThreadPriorityMedium,
epicsThreadGetStackSize(epicsThreadStackMedium),
epicsThreadId threadId = epicsThreadCreate (
"server circuit", epicsThreadPriorityMedium,
epicsThreadGetStackSize(epicsThreadStackMedium),
socketRecvTest, pCir );
testOk ( threadId != 0, "Server circuit thread created" );
}
@@ -231,7 +240,7 @@ static const char *mechName(int mech)
{esscimqi_socketBothShutdownRequired, "esscimqi_socketBothShutdownRequired" },
{esscimqi_socketSigAlarmRequired, "esscimqi_socketSigAlarmRequired" }
};
for (unsigned i=0; i < (sizeof(mechs) / sizeof(mechs[0])); ++i) {
if (mech == mechs[i].mech)
return mechs[i].name;
@@ -248,10 +257,11 @@ MAIN(blockingSockTest)
memset ( (char *) & addr, 0, sizeof ( addr ) );
addr.ia.sin_family = AF_INET;
addr.ia.sin_addr.s_addr = htonl ( INADDR_LOOPBACK );
addr.ia.sin_port = htons ( 5064 ); // CA
addr.ia.sin_port = 0;
server srv ( addr );
srv.start ();
addr = srv.addr ();
clientCircuit client ( addr );
epicsThreadSleep ( 1.0 );

View File

@@ -553,10 +553,18 @@ MAIN(epicsCalcTest)
testExpr(0.0 + NaN);
testExpr(Inf + 0.0);
testExpr(Inf + Inf);
#if defined(_WIN64) && defined(_MSC_VER)
testCalc("Inf + -Inf", NaN);
#else
testExpr(Inf + -Inf);
#endif
testExpr(Inf + NaN);
testExpr(-Inf + 0.0);
#if defined(_WIN64) && defined(_MSC_VER)
testCalc("-Inf + Inf", NaN);
#else
testExpr(-Inf + Inf);
#endif
testExpr(-Inf + -Inf);
testExpr(-Inf + NaN);
testExpr(NaN + 0.0);

View File

@@ -77,7 +77,7 @@ static void epicsExceptionTestPrivate ()
try {
char * p = new ( nothrow )
char [unsuccessfulNewSize];
testOk(p == 0, "new (nothrow)");
testOk(p == 0, "new (nothrow) returned %p", p);
}
catch( ... ) {
testFail("new (nothrow): threw");

View File

@@ -31,11 +31,26 @@ MAIN(epicsMathTest)
testOk1(epicsINF == epicsINF);
testOk1(epicsINF > 0.0);
testOk1(epicsINF - epicsINF != 0.0);
#if defined(_WIN64) && defined(_MSC_VER)
testTodoBegin("Known failure on windows-x64");
#endif
testOk1(epicsINF + -epicsINF != 0.0);
testOk1(-epicsINF + epicsINF != 0.0);
#if defined(_WIN64) && defined(_MSC_VER)
testTodoEnd();
#endif
testOk1(isnan(epicsINF - epicsINF));
#if defined(_WIN64) && defined(_MSC_VER)
testTodoBegin("Known failure on windows-x64");
#endif
testOk1(isnan(epicsINF + -epicsINF));
testOk1(isnan(-epicsINF + epicsINF));
#if defined(_WIN64) && defined(_MSC_VER)
testTodoEnd();
#endif
testOk1(isnan(epicsNAN));
testOk1(!isinf(epicsNAN));
@@ -46,8 +61,15 @@ MAIN(epicsMathTest)
testOk1(!(epicsNAN >= epicsNAN));
testOk1(!(epicsNAN > epicsNAN));
testOk1(isnan(epicsNAN - epicsNAN));
#if defined(_WIN64) && defined(_MSC_VER)
testTodoBegin("Known failure on windows-x64");
#endif
testOk1(isnan(epicsNAN + -epicsNAN));
testOk1(isnan(-epicsNAN + epicsNAN));
#if defined(_WIN64) && defined(_MSC_VER)
testTodoEnd();
#endif
c = huge / tiny;
testOk(!isnan(c), "!isnan(1e300 / 1e-300)");

View File

@@ -10,8 +10,6 @@
* $Revision-Id$
*
* Author W. Eric Norum
* norume@aps.anl.gov
* 630 252 4793
*/
#include <stdio.h>
#include <stdlib.h>
@@ -109,6 +107,7 @@ receiver(void *arg)
testDiag("Sender %d -- %d messages", sender, expectmsg[sender-1]-1);
}
testOk1(errors == 0);
testDiag("Receiver finished");
epicsEventSignal(finished);
}
@@ -126,6 +125,7 @@ sender(void *arg)
epicsThreadSleep(0.005 * (randBelow(5)));
epicsThreadSleep(0.005 * (randBelow(20)));
}
testDiag("%s exiting, sent %d messages", epicsThreadGetNameSelf(), i-1);
}
extern "C" void messageQueueTest(void *parm)
@@ -273,13 +273,13 @@ extern "C" void messageQueueTest(void *parm)
* Single receiver, multiple sender tests
*/
testDiag("Single receiver, multiple sender tests:");
testDiag("This test takes 5 minutes...");
testDiag("This test lasts 60 seconds...");
epicsThreadCreate("Sender 1", epicsThreadPriorityLow, epicsThreadGetStackSize(epicsThreadStackMedium), sender, q1);
epicsThreadCreate("Sender 2", epicsThreadPriorityMedium, epicsThreadGetStackSize(epicsThreadStackMedium), sender, q1);
epicsThreadCreate("Sender 3", epicsThreadPriorityHigh, epicsThreadGetStackSize(epicsThreadStackMedium), sender, q1);
epicsThreadCreate("Sender 4", epicsThreadPriorityHigh, epicsThreadGetStackSize(epicsThreadStackMedium), sender, q1);
epicsThreadSleep(300.0);
epicsThreadSleep(60.0);
testExit = 1;
}
@@ -295,6 +295,7 @@ MAIN(epicsMessageQueueTest)
messageQueueTest, NULL);
epicsEventWait(finished);
epicsThreadSleep(1.0);
return testDone();
}

View File

@@ -29,6 +29,41 @@
#define verify(exp) ((exp) ? (void)0 : \
epicsAssert(__FILE__, __LINE__, #exp, epicsAssertAuthor))
class notified : public epicsTimerNotify
{
public:
bool done;
notified() : epicsTimerNotify(), done(false) {}
expireStatus expire(const epicsTime &currentTime)
{done=true; return expireStatus(noRestart);}
};
void testRefCount()
{
notified action;
epicsTimerQueueActive *Q1, *Q2;
epicsTimer *T1, *T2;
Q1 = &epicsTimerQueueActive::allocate ( true, epicsThreadPriorityMin );
T1 = &Q1->createTimer();
//timer->start(action, 0.0);
Q2 = &epicsTimerQueueActive::allocate ( true, epicsThreadPriorityMin );
testOk1(Q1==Q2);
T2 = &Q2->createTimer();
T2->destroy();
Q2->release();
T1->destroy();
Q1->release();
}
static const double delayVerifyOffset = 1.0; // sec
class delayVerify : public epicsTimerNotify {
@@ -419,7 +454,8 @@ void testPeriodic ()
MAIN(epicsTimerTest)
{
testPlan(40);
testPlan(41);
testRefCount();
testAccuracy ();
testCancel ();
testExpireDestroy ();

View File

@@ -461,9 +461,11 @@ static void doResolveLinks(dbRecordType *pdbRecordType, dbCommon *precord,
if (pperiod && strstr(pperiod,"PROC")) {
plink->value.pv_link.pvlMask |= pvlOptFWD;
} else {
errlogPrintf("%s.FLNK is a Channel Access Link "
" but does not link to a PROC field\n",
precord->name);
errlogPrintf("Forward-link uses Channel Access "
"without pointing to PROC field\n"
" %s.%s = %s\n",
precord->name, pdbFldDes->name,
plink->value.pv_link.pvname);
}
}
}

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -274,21 +274,18 @@ static void log_header (
pciu = MPTOPCIU(mp);
if (pContext) {
epicsPrintf ("CAS: request from %s => \"%s\"\n",
epicsPrintf ("CAS: request from %s => %s\n",
hostName, pContext);
}
epicsPrintf (
"CAS: Request from %s => cmmd=%d cid=0x%x type=%d count=%d postsize=%u\n",
epicsPrintf ( "CAS: Request from %s => cmmd=%d cid=0x%x type=%d count=%d postsize=%u\n",
hostName, mp->m_cmmd, mp->m_cid, mp->m_dataType, mp->m_count, mp->m_postsize);
epicsPrintf (
"CAS: Request from %s => available=0x%x \tN=%u paddr=%p\n",
hostName, mp->m_available, mnum, (pciu?(void *)&pciu->addr:NULL));
epicsPrintf ( "CAS: Request from %s => available=0x%x \tN=%u paddr=%p\n",
hostName, mp->m_available, mnum, (pciu ? (void *)&pciu->addr : NULL));
if (mp->m_cmmd==CA_PROTO_WRITE && mp->m_dataType==DBF_STRING && pPayLoad ) {
epicsPrintf (
"CAS: Request from %s => \tThe string written: %s \n",
epicsPrintf ( "CAS: Request from %s => Wrote string \"%s\"\n",
hostName, (char *)pPayLoad );
}
}
@@ -814,10 +811,10 @@ static int write_action ( caHdrLargeArray *mp,
return RSRV_ERROR;
}
asWritePvt = asTrapWriteBefore ( pciu->asClientPVT,
asWritePvt = asTrapWriteWithData ( pciu->asClientPVT,
pciu->client->pUserName ? pciu->client->pUserName : "",
pciu->client->pHostName ? pciu->client->pHostName : "",
(void *) &pciu->addr );
(void *) &pciu->addr, mp->m_dataType, mp->m_count, pPayload );
dbStatus = db_put_field(
&pciu->addr,
@@ -1819,11 +1816,12 @@ static int write_notify_action ( caHdrLargeArray *mp, void *pPayload,
return RSRV_OK;
}
pciu->pPutNotify->asWritePvt = asTrapWriteBefore (
pciu->pPutNotify->asWritePvt = asTrapWriteWithData (
pciu->asClientPVT,
pciu->client->pUserName ? pciu->client->pUserName : "",
pciu->client->pHostName ? pciu->client->pHostName : "",
(void *) &pciu->addr );
(void *) &pciu->addr, mp->m_dataType, mp->m_count,
pciu->pPutNotify->dbPutNotify.pbuffer );
dbPutNotify(&pciu->pPutNotify->dbPutNotify);

View File

@@ -67,9 +67,10 @@ void camsgtask ( void *pParm )
status = socket_ioctl (client->sock, FIONREAD, &nchars);
if (status < 0) {
char sockErrBuf[64];
epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
errlogPrintf("CAS: io ctl err - %s\n",
errlogPrintf("CAS: ioctl error - %s\n",
sockErrBuf);
cas_send_bs_msg(client, TRUE);
}
@@ -98,9 +99,8 @@ void camsgtask ( void *pParm )
}
if ( anerrno == SOCK_ENOBUFS ) {
errlogPrintf (
"rsrv: system low on network buffers "
"- receive retry in 15 seconds\n" );
errlogPrintf (
"CAS: Out of network buffers, retring receive in 15 seconds\n" );
epicsThreadSleep ( 15.0 );
continue;
}
@@ -109,10 +109,15 @@ void camsgtask ( void *pParm )
* normal conn lost conditions
*/
if ( ( anerrno != SOCK_ECONNABORTED &&
anerrno != SOCK_ECONNRESET &&
anerrno != SOCK_ETIMEDOUT ) ||
CASDEBUG > 2 ) {
errlogPrintf ( "CAS: client disconnect(errno=%d)\n", anerrno );
anerrno != SOCK_ECONNRESET &&
anerrno != SOCK_ETIMEDOUT ) ||
CASDEBUG > 2 ) {
char sockErrBuf[64];
epicsSocketConvertErrorToString(
sockErrBuf, sizeof ( sockErrBuf ), anerrno);
errlogPrintf ( "CAS: Client disconnected - %s\n",
sockErrBuf );
}
break;
}

View File

@@ -90,7 +90,8 @@ void cas_send_bs_msg ( struct client *pclient, int lock_needed )
}
if ( anerrno == SOCK_ENOBUFS ) {
errlogPrintf ( "rsrv: system low on network buffers - send retry in 15 seconds\n" );
errlogPrintf (
"CAS: Out of network buffers, retrying send in 15 seconds\n" );
epicsThreadSleep ( 15.0 );
continue;
}
@@ -108,8 +109,7 @@ void cas_send_bs_msg ( struct client *pclient, int lock_needed )
char sockErrBuf[64];
epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
errlogPrintf (
"CAS: TCP send to \"%s\" failed because \"%s\"\n",
errlogPrintf ( "CAS: TCP send to %s failed - %s\n",
buf, sockErrBuf);
}
pclient->disconnect = TRUE;
@@ -135,7 +135,7 @@ void cas_send_bs_msg ( struct client *pclient, int lock_needed )
char sockErrBuf[64];
epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
errlogPrintf ("rsrv: socket shutdown error was %s\n",
errlogPrintf ("CAS: Socket shutdown error - %s\n",
sockErrBuf );
}
}
@@ -204,7 +204,7 @@ void cas_send_dg_msg ( struct client * pclient )
}
else {
errlogPrintf (
"cas: system failed to send entire udp frame?\n" );
"CAS: System failed to send entire udp frame?\n" );
}
}
else {
@@ -213,11 +213,8 @@ void cas_send_dg_msg ( struct client * pclient )
epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
ipAddrToDottedIP ( &pclient->addr, buf, sizeof(buf) );
errlogPrintf(
"CAS: UDP send to \"%s\" "
"failed because \"%s\"\n",
buf,
sockErrBuf);
errlogPrintf( "CAS: UDP send to %s failed - %s\n",
buf, sockErrBuf);
}
pclient->send.stk = 0u;

View File

@@ -252,7 +252,7 @@ int rsrv_init (void)
status = envGetLongConfigParam ( &EPICS_CA_MAX_ARRAY_BYTES, &maxBytesAsALong );
if ( status || maxBytesAsALong < 0 ) {
errlogPrintf ( "cas: EPICS_CA_MAX_ARRAY_BYTES was not a positive integer\n" );
errlogPrintf ( "CAS: EPICS_CA_MAX_ARRAY_BYTES was not a positive integer\n" );
rsrvSizeofLargeBufTCP = MAX_TCP;
}
else {
@@ -266,7 +266,7 @@ int rsrv_init (void)
maxBytes = 0xffffffff;
}
if ( maxBytes < MAX_TCP ) {
errlogPrintf ( "cas: EPICS_CA_MAX_ARRAY_BYTES was rounded up to %u\n", MAX_TCP );
errlogPrintf ( "CAS: EPICS_CA_MAX_ARRAY_BYTES was rounded up to %u\n", MAX_TCP );
rsrvSizeofLargeBufTCP = MAX_TCP;
}
else {
@@ -551,7 +551,7 @@ void destroy_client ( struct client *client )
freeListFree ( rsrvLargeBufFreeListTCP, client->send.buf );
}
else {
errlogPrintf ( "cas: Corrupt send buffer free list type code=%u during client cleanup?\n",
errlogPrintf ( "CAS: Corrupt send buffer free list type code=%u during client cleanup?\n",
client->send.type );
}
}
@@ -563,7 +563,7 @@ void destroy_client ( struct client *client )
freeListFree ( rsrvLargeBufFreeListTCP, client->recv.buf );
}
else {
errlogPrintf ( "cas: Corrupt recv buffer free list type code=%u during client cleanup?\n",
errlogPrintf ( "CAS: Corrupt recv buffer free list type code=%u during client cleanup?\n",
client->send.type );
}
}

View File

@@ -1,4 +1,4 @@
#include <Winver.h>
#include <winver.h>
#include "epicsVersion.h"
VS_VERSION_INFO VERSIONINFO

View File

@@ -12,6 +12,8 @@
# because some versions of the Perl test harness can only run test scripts
# that are actually written in Perl. The script we generate execs the
# real test program which must be in the same directory as the .t file.
# If the script is given an argument -tap it sets HARNESS_ACTIVE in the
# environment to make the epicsUnitTest code generate strict TAP output.
# Usage: makeTestfile.pl target.t executable
# target.t is the name of the Perl script to generate
@@ -25,6 +27,7 @@ open(my $OUT, '>', $target) or die "Can't create $target: $!\n";
print $OUT <<EOF;
#!/usr/bin/perl
\$ENV{HARNESS_ACTIVE} = 1 if scalar \@ARGV && shift eq '-tap';
exec './$exe' or die 'exec failed';
EOF