Compare commits

...

75 Commits

Author SHA1 Message Date
15364e8b91 allow to add new error symbols from dynamicly loaded modules 2019-10-24 16:24:50 +02:00
7e991c3f9f run tests on cross compiled host architectures 2019-10-10 17:35:03 +02:00
7ff7ee739d fix for SIGTRAP on powerbrick 2019-10-09 16:19:06 +02:00
d0adf702f1 merge with iocLogClientFixes 2019-09-27 14:50:14 +02:00
5f0df840a3 increase error message buffer size for long (Windows) error messges 2019-09-19 17:53:04 +02:00
301a6e00b9 moved logClientSendMessage and made it static 2019-09-19 17:47:30 +02:00
abbd54b2c8 fix wrong function name in comment 2019-09-19 17:47:17 +02:00
bad6295108 don't shutdown write channel of iocLogServer to allow logClient to detect disconnect 2019-09-18 16:08:15 +02:00
5801ff233a use dynamic debug flag for logClient 2019-09-18 15:59:53 +02:00
9dfed167dc improve logClientShow to show unsent bytes on level 2 (and fix level 1) 2019-09-18 15:55:47 +02:00
b925d3f902 (Re-)connect only when there is something to send. This avoids constant useless disconnect/connect cycles if the server (or firewall) keeps closing the connection. 2019-09-04 10:18:03 +02:00
871af36ac5 move -fno-strict-aliasing flag to central place for all Linux version 2019-09-02 16:44:53 +02:00
0ad6d2aec9 typo in comment 2019-09-02 13:53:21 +02:00
8837d2f275 use perl instead of date in EPICS_SITE_VERSION because of Windows 2019-09-02 10:49:44 +02:00
09a17127a9 make xxxTestHarness TESTPRODs instead of PRODs 2019-09-02 10:47:43 +02:00
2cafe6d65c detect when server closes connection. can only be done reliably with recv, not with send 2019-08-30 08:57:09 +02:00
2b0161d9bf no need to delay startup only because log server is currently not available 2019-08-30 08:57:08 +02:00
9df98c1838 send pending log messages directly after connecting 2019-08-30 08:57:08 +02:00
59aa9cfe74 avoid needless memmove calls 2019-08-30 08:57:08 +02:00
709208ef5c elimitate duplicate code in logClient 2019-08-30 08:57:08 +02:00
0a3427c835 do not discard unsent messages when log server has closed connection, instead try to send them after reconnect 2019-08-30 08:57:08 +02:00
2432878773 speed up logRestart thread termination at exit 2019-08-30 08:57:08 +02:00
62c3b0a585 don't send errlog on all logClients 2019-08-30 08:57:08 +02:00
Andrew Johnson
b2938459f8 Define pdevLibVME on non-VME RTEMS targets 2019-08-28 15:28:08 -05:00
3699c5bc4c fix strict-aliasing warnings 2019-08-26 15:50:07 +02:00
157b0867fa removed unused vxWorks version defaults 2019-08-14 14:06:05 +02:00
56529964f3 always use -g for non-vxWorks gnu compiler 2019-08-14 13:55:07 +02:00
c28e240fce clear whitespace 2019-08-14 11:39:30 +02:00
05cd95a821 astac argument checks 2019-08-13 20:37:43 -07:00
Andrew Johnson
fd48ee9aec Update submodules
Adjust comments in the embedded module CONFIG_*_VERSION files
2019-08-13 11:21:26 -05:00
b04b2dab22 fix astac crash 2019-08-13 15:13:54 +02:00
8edcd7b07f use READLINE as default for all Linux systems 2019-08-09 16:21:08 +02:00
ca78451122 move PSI specifics out to CONFIG_SITE. files 2019-08-09 13:33:41 +02:00
4cc44e3dce cleanup spaces 2019-08-09 13:32:49 +02:00
e81d3a1d7d remove strict-aliasing warnings in RHEL7 2019-08-09 11:34:50 +02:00
53dd61b80a merged with R7.0.3 2019-08-09 11:31:43 +02:00
Andrew Johnson
e0039d4e86 Expand epics-controls publication instructions 2019-08-01 16:20:53 -05:00
Andrew Johnson
969ffa3598 Checklist: Update version update instructions 2019-07-31 14:34:42 -05:00
Andrew Johnson
29fc49199d Update versions after tag, set DEVELOPMENT_FLAG/DEV_SNAPSHOT 2019-07-31 14:29:18 -05:00
5b754d320f fix posix epicsThreadSleepQuantum() implementation not to return 0.01 on Linux 2019-07-24 14:17:25 +02:00
2be2658cfc added modules/pcas 2019-07-22 17:12:22 +02:00
2b157096e6 merge branch '7.0' into 'PSI-7.0' 2019-07-22 15:44:08 +02:00
71eaddfd84 Merge branch 'refs/heads/PSI-7.0.1' into PSI-7.0 2019-07-22 15:36:33 +02:00
5589deb3ad make sure softIoc for vxWorks contains all functions 2019-07-22 15:17:18 +02:00
0bb80e373b add simple calculations to macros 2019-05-10 14:44:17 +02:00
4acdd83984 also build pcas 2019-05-10 11:13:23 +02:00
d12d38f970 re-enable -fno-strict-aliasing for vxWorks 2019-05-10 11:08:48 +02:00
74d9749255 fix install location 2019-05-10 11:07:50 +02:00
3276ada78a build for DeltaTau with ELDK-5.3 for newer C++ compiler 2019-05-08 17:32:50 +02:00
de378eec34 also build pcas 2019-04-03 15:14:34 +02:00
dbb2d875fb undo commit 2206934 which introduces a MKDIR rule that conflicts with driver/makefile 2019-04-03 15:13:00 +02:00
c7f966a1f5 fix install location 2019-04-03 15:10:28 +02:00
7889dda6f8 merged with upstream 2019-02-20 10:51:02 +01:00
a2ccf3b631 add raspberryPi and skip unused vxWorks archs 2018-10-31 15:23:05 +01:00
57db34b303 Merge branch 'FixShellCommands' into PSI-7.0 2018-10-24 09:25:44 +02:00
4f790758af no PVA for mvl40-xscale_be 2018-10-23 10:01:13 +02:00
ce9dfc6bb4 need some .o files, but there aren't many any more 2018-10-18 16:20:45 +02:00
4f40ad1927 build for mvl40-xscale_be (without PVA)configure/os/CONFIG.Common.mvl40-xscale_be 2018-10-18 16:20:13 +02:00
a42a4010d6 skip building with clang on old SL6 to avoid problems with cross build from RHEL7 2018-10-11 13:20:59 +02:00
a2aa17fafc some drivers complain about strict-aliasing 2018-10-11 08:36:35 +02:00
5bf2784db2 add -fno-strict-aliasing for those archs which complain about anyscalar.h 2018-10-05 10:43:08 +02:00
7a4e7b7600 add tar and copysrc make rules 2018-10-03 17:13:13 +02:00
70aa23513f use -isystem option to find correct headers for cross compiling for old Linux host versions 2018-10-03 16:47:57 +02:00
71ded2f25f install dbCaPvt.h needed by devIocStats/ioccar 2018-10-03 16:43:32 +02:00
11103351b2 add build year-month to version string 2018-10-03 16:38:53 +02:00
146a413977 add -isystem to avoid system headers in .d files (does not work for vxWorks 5) 2018-10-03 13:48:09 +02:00
4e44550f62 Merge branch 'FixShellCommands' into PSI-7.0 2018-09-28 11:41:52 +02:00
9952470486 Merge branch 'FixShellCommands' into PSI-7.0 2018-09-27 13:58:23 +02:00
02d30dedbc install server.h for misc module 2018-09-26 16:10:30 +02:00
5ed0fe52a0 Merge branch '7.0' into PSI-7.0 2018-09-26 11:45:19 +02:00
42b1f774da add PSI configuration 2018-09-25 11:13:08 +02:00
7738b68320 fix missing template instances for old vxWorks (uses -fno-implicit-templates) 2018-09-24 18:00:53 +02:00
1199fabe90 Fix strange compiler errors with gcc 2.96:
using <namespace::function>; seems not to work but
using namespace <namespace>; works
Also 'add' only works with explicit namespace. Why?
2018-09-21 16:21:13 +02:00
1aefc5f2f0 re-enable building vxWorks 5 2018-09-21 16:20:17 +02:00
6f666c6c22 Add mechanism to skip modules for selected architectures 2018-09-21 15:50:06 +02:00
86 changed files with 1008 additions and 283 deletions

3
.gitmodules vendored
View File

@@ -22,3 +22,6 @@
path = modules/pva2pva
url = https://github.com/epics-base/pva2pva
branch = master
[submodule "modules/pcas"]
path = modules/pcas
url = https://github.com/epics-modules/pcas

View File

@@ -23,3 +23,10 @@ DIRS += modules
modules_DEPEND_DIRS = src
include $(TOP)/configure/RULES_TOP
UNINSTALL_DIRS += $(INSTALL_LOCATION)/src
copysrc:
tar cf - --exclude-vcs --exclude-backups --exclude=O.* modules/*/src | tar xf - -C $(INSTALL_LOCATION)
tar:
tar cfjP epics_base-$(EPICS_VERSION_NUMBER).tar.bz2 $(INSTALL_LOCATION)

View File

@@ -34,7 +34,7 @@ CODE_CFLAGS = $(PROF_CFLAGS_$(PROFILE)) $(GPROF_CFLAGS_$(GPROF))
CODE_CFLAGS += $(ASAN_FLAGS_$(ENABLE_ASAN))
WARN_CFLAGS_YES = -Wall
WARN_CFLAGS_NO = -w
OPT_CFLAGS_YES = -O3
OPT_CFLAGS_YES = -O3 -g
OPT_CFLAGS_NO = -g
PROF_CXXFLAGS_YES = -p
@@ -43,7 +43,7 @@ CODE_CXXFLAGS = $(PROF_CXXFLAGS_$(PROFILE)) $(GPROF_CXXFLAGS_$(GPROF))
CODE_CXXFLAGS += $(ASAN_FLAGS_$(ENABLE_ASAN))
WARN_CXXFLAGS_YES = -Wall
WARN_CXXFLAGS_NO = -w
OPT_CXXFLAGS_YES = -O3
OPT_CXXFLAGS_YES = -O3 -g
OPT_CXXFLAGS_NO = -g
CODE_LDFLAGS = $(PROF_CXXFLAGS_$(PROFILE)) $(GPROF_CXXFLAGS_$(GPROF))

View File

@@ -52,12 +52,12 @@ EPICS_MODIFICATION = 3
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
# Not included in the official EPICS version number if zero
EPICS_PATCH_LEVEL = 0
EPICS_PATCH_LEVEL = 1
# Between official releases, the EPICS_PATCH_LEVEL gets incremented
# and a -DEV suffix is added (similar to the Maven -SNAPSHOT versions)
EPICS_DEV_SNAPSHOT=
#EPICS_DEV_SNAPSHOT=-DEV
# Immediately after an official release the EPICS_PATCH_LEVEL is incremented
# and the -DEV suffix is added (similar to the Maven -SNAPSHOT versions)
#EPICS_DEV_SNAPSHOT=
EPICS_DEV_SNAPSHOT=-DEV
#EPICS_DEV_SNAPSHOT=-pre1
#EPICS_DEV_SNAPSHOT=-pre1-DEV
#EPICS_DEV_SNAPSHOT=-pre2

View File

@@ -161,7 +161,7 @@ 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.
EPICS_SITE_VERSION =
EPICS_SITE_VERSION=$(shell $(PERL) -MPOSIX -e 'print strftime "%Y-%m-%d $(shell git describe --tags --dirty)", localtime')
# For GNU compiler, use pipes rather than temporary files for
# communication between the various stages of compilation.

View File

@@ -86,6 +86,23 @@ include $(CONFIG)/RULES_FILE_TYPE
include $(CONFIG)/RULES.Db
#---------------------------------------------------------------
# Do not build anything if current path matches SKIP_BUILD
ifneq (,$(strip $(SKIP_BUILDS)))
CURRENT_MODULE=$(subst $(realpath $(TOP)/..)/,,$(subst $(realpath $(dir $(lastword $(MAKEFILE_LIST)))..)/,,$(realpath ..)))
ifneq ($(filter $(SKIP_BUILDS) $(addsuffix /%,$(SKIP_BUILDS)),$(CURRENT_MODULE)),)
$(info Skipping $(CURRENT_MODULE) for $(T_A))
PROD=
TESTPROD=
LIBRARY=
TESTLIBRARY=
LOADABLE_LIBRARY=
TESTS=
SRC_FILES=
endif
endif
#---------------------------------------------------------------
# Include defines and rules for prod, library and test* targets
@@ -202,9 +219,9 @@ endif
$(TESTPRODNAME) $(PRODNAME): $(PRODUCT_OBJS) $(PROD_RESS) $(PROD_DEPLIBS)
$(TESTPRODNAME) $(PRODNAME): %$(EXE): | $(INSTALL_LIB)
$(TESTPRODNAME) $(PRODNAME): %$(EXE):
@$(RM) $@
$(LINK.cpp)
$(DEBUGCMD) $(LINK.cpp)
$(MT_EXE_COMMAND)
%_ctdt$(OBJ) : %_ctdt.c
@@ -305,10 +322,6 @@ $(LOADABLE_SHRLIBNAME): $(LOADABLE_SHRLIB_PREFIX)%$(LOADABLE_SHRLIB_SUFFIX):
$(LINK.shrlib)
$(MT_DLL_COMMAND)
$(LIBNAME) $(SHRLIBNAME) $(LOADABLE_SHRLIBNAME): | $(INSTALL_LIB)
$(INSTALL_LIB):
@$(MKDIR) $@
#---------------------------------------------------------------
# C++ munching for VxWorks
@@ -471,11 +484,9 @@ $(INSTALL_TCLLIB)/%: ../%
@$(INSTALL) -d -m $(BIN_PERMISSIONS) $< $(INSTALL_TCLLIB)
endif
ifneq ($(TCLINDEX),)
$(INSTALL_TCLLIB)/$(TCLINDEX): $(INSTALL_TCLLIBS)
$(ECHO) "Updating $@"
$(ECHO) eval auto_mkindex $(INSTALL_TCLLIB) "$(TCLLIBNAME)" | tclsh
endif
$(INSTALL_LOADABLE_SHRLIBS): $(INSTALL_SHRLIB)/%: %
$(ECHO) "Installing loadable shared library $@"

View File

@@ -0,0 +1,2 @@
# Include definitions common to linux pentium targets
include $(CONFIG)/os/CONFIG.Common.linux-x86_64

View File

@@ -0,0 +1 @@
include $(CONFIG)/os/CONFIG.Common.linux-clang

View File

@@ -0,0 +1,6 @@
# Include definitions common to linux pentium targets
include $(CONFIG)/os/CONFIG.Common.linux-x86
COMMANDLINE_LIBRARY = READLINE_NCURSES
ARCH_DEP_CFLAGS += -march=i686

View File

@@ -0,0 +1,4 @@
# Include definitions common to linux pentium targets
include $(CONFIG)/os/CONFIG.Common.linux-x86_64
COMMANDLINE_LIBRARY = READLINE_NCURSES

View File

@@ -0,0 +1,4 @@
# Include definitions common to linux pentium targets
include $(CONFIG)/os/CONFIG.Common.linux-x86
ARCH_DEP_CFLAGS += -march=i686

View File

@@ -0,0 +1,2 @@
# Include definitions common to linux pentium targets
include $(CONFIG)/os/CONFIG.Common.linux-x86_64

View File

@@ -0,0 +1 @@
include $(CONFIG)/os/CONFIG.Common.linux-clang

View File

@@ -0,0 +1,8 @@
include $(CONFIG)/os/CONFIG.Common.vxWorks-ppc604_long
VXWORKS_VERSION = 5.5.1
WIND_BASE = /afs/psi.ch/project/vxworks/Tornado2.2.1
#there is a problem with our ccppc and optimization
# -O0 works, -O and -O1 and higher are buggy
OPT_CFLAGS_YES = -O0
OPT_CXXFLAGS_YES = -O0

View File

@@ -0,0 +1,2 @@
include $(CONFIG)/os/CONFIG.Common.vxWorks-ppc604_long
VXWORKS_VERSION = 6.2

View File

@@ -0,0 +1,5 @@
include $(CONFIG)/os/CONFIG.Common.vxWorks-ppc603_long
VXWORKS_VERSION = 6.3
# Buggy "uninitialized variable" warning produces many false positives
ARCH_DEP_CXXFLAGS += -Wno-uninitialized

View File

@@ -0,0 +1,5 @@
include $(CONFIG)/os/CONFIG.Common.vxWorks-ppc604_long
VXWORKS_VERSION = 6.3
# Buggy "uninitialized variable" warning produces many false positives
ARCH_DEP_CXXFLAGS += -Wno-uninitialized

View File

@@ -0,0 +1,2 @@
include $(CONFIG)/os/CONFIG.Common.vxWorks-ppc603_long
VXWORKS_VERSION = 6.6

View File

@@ -0,0 +1,2 @@
include $(CONFIG)/os/CONFIG.Common.vxWorks-ppc604_long
VXWORKS_VERSION = 6.6

View File

@@ -0,0 +1,5 @@
include $(CONFIG)/os/CONFIG.Common.vxWorks-ppc604_long
VXWORKS_VERSION = 6.7
#needed when including memPartLib.h, e.g. through moduleLib.h or loadLib.h
ARCH_DEP_CFLAGS += -D_VSB_CONFIG_FILE='<../lib/h/config/vsbConfig.h>'

View File

@@ -0,0 +1,25 @@
# DeltaTau PowerPMAC with ELDK 4.2
# Include definitions common to all Linux targets
include $(CONFIG)/os/CONFIG.Common.linuxCommon
COMMANDLINE_LIBRARY = READLINE_NCURSES
ARCH_CLASS = ppc
ELDK=/opt/eldk-4.2
GNU_TARGET=ppc_4xxFP
GNU_DIR=$(ELDK)/usr
# Optimizer is buggy. Throws SIGTRAP in typeinfo for epics::pvAccess::ChannelArray
OPT_CXXFLAGS_YES += -fno-inline-functions
ARCH_DEP_CPPFLAGS += --sysroot=$(ELDK)/$(GNU_TARGET)
ARCH_DEP_LDFLAGS = --sysroot=$(ELDK)/$(GNU_TARGET)
# This cross tool chain is installed in a somehow weird way
# Without the following lines it does not work on RHEL7
# but it worked on SL6
ARCH_DEP_CXXFLAGS += -I $(ELDK)/$(GNU_TARGET)/usr/include/c++/4.2.2
ARCH_DEP_CXXFLAGS += -I $(ELDK)/$(GNU_TARGET)/usr/include/c++/4.2.2/powerpc-linux
ARCH_DEP_CXXFLAGS += -I $(ELDK)/$(GNU_TARGET)/usr/include/c++/4.2.2/backward

View File

@@ -0,0 +1,14 @@
# Virtex FPGA embedded Processor with ELDK 5.1
# Include definitions common to all Linux targets
include $(CONFIG)/os/CONFIG.Common.linuxCommon
ARCH_CLASS = ppc
SDK = eldk
SDK_DIR = /opt/eldk-5.1
SDK_HOST_ARCH = $(GNU_HOST_ARCH)-$(SDK)-$(GNU_HOST_OS)
GNU_TARGET = powerpc-4xx-softfloat
GNU_ARCH = ppc405-linux
GNU_DIR = $(SDK_DIR)/$(GNU_TARGET)/sysroots/$(SDK_HOST_ARCH)/usr
GNU_BIN = $(GNU_DIR)/bin/$(GNU_ARCH)

View File

@@ -0,0 +1,15 @@
# IOxOS IFC1210 with ELDK 5.2
# Include definitions common to all Linux targets
include $(CONFIG)/os/CONFIG.Common.linuxCommon
ARCH_CLASS = ppc
SDK = eldk
SDK_DIR = /opt/eldk-5.2
SDK_HOST_ARCH = $(GNU_HOST_ARCH)-$(SDK)-$(GNU_HOST_OS)
GNU_TARGET = powerpc-e500v2
GNU_ARCH = ppce500v2-linux-gnuspe
GNU_DIR = $(SDK_DIR)/$(GNU_TARGET)/sysroots/$(SDK_HOST_ARCH)/usr
GNU_BIN = $(GNU_DIR)/bin/$(GNU_ARCH)
GNU_TARGET_INCLUDE_DIR =

View File

@@ -0,0 +1,21 @@
# DeltaTau PowerPMAC with ELDK 5.3
# Include definitions common to all Linux targets
include $(CONFIG)/os/CONFIG.Common.linuxCommon
ARCH_CLASS = ppc
SDK = eldk
SDK_DIR = /opt/eldk-5.3
SDK_HOST_ARCH = $(GNU_HOST_ARCH)-$(SDK)-$(GNU_HOST_OS)
GNU_ARCH = ppc440e-linux
SDKTARGETSYSROOT=$(SDK_DIR)/powerpc-4xx/sysroots
GNU_DIR = $(SDKTARGETSYSROOT)/$(SDK_HOST_ARCH)/usr
GNU_BIN = $(GNU_DIR)/bin/$(GNU_ARCH)
GNU_TARGET_INCLUDE_DIR =
GNU_TARGET=powerpc-linux
ARCH_DEP_CPPFLAGS = -m32 -mcpu=440fp -mhard-float
ARCH_DEP_CPPFLAGS += --sysroot=$(SDKTARGETSYSROOT)/$(GNU_ARCH)
ARCH_DEP_LDFLAGS = --sysroot=$(SDKTARGETSYSROOT)/$(GNU_ARCH)
AS=$(GNU_BIN)/$(GNU_TARGET)-as

View File

@@ -0,0 +1,23 @@
# IOxOS IFC1211 with Freescale QorIQ 2.0 toolchain
# Include definitions common to all Linux targets
include $(CONFIG)/os/CONFIG.Common.linuxCommon
ARCH_CLASS = ppc
SDK = fslsdk
SDK_DIR = /opt/fsl-qoriq/2.0
SDK_HOST_ARCH = $(GNU_HOST_ARCH_64)-$(SDK)-$(GNU_HOST_OS)
SDK_TARGET = ppc64e6500-fsl-linux
GNU_TARGET = powerpc64-fsl-linux
SDKTARGETSYSROOT = $(SDK_DIR)/sysroots/$(SDK_TARGET)
GNU_DIR = $(SDK_DIR)/sysroots/$(SDK_HOST_ARCH)/usr
GNU_BIN = $(GNU_DIR)/bin/$(GNU_TARGET)
ARCH_DEP_CPPFLAGS = --sysroot=$(SDKTARGETSYSROOT)
ARCH_DEP_CFLAGS = -mcpu=e6500 -m64 -mhard-float
ARCH_DEP_LDFLAGS = --sysroot=$(SDKTARGETSYSROOT)
# warning -O2 and higher are broken!
#OPT_CFLAGS_YES = -O1
#OPT_CXXFLAGS_YES = -O1

View File

@@ -0,0 +1,5 @@
include $(CONFIG)/os/CONFIG.Common.linuxCommon
GNU = NO
CMPLR_CLASS = clang
CC = clang
CCC = clang++

View File

@@ -0,0 +1,16 @@
# Moxa DA-66x with SDK 4.2 and ARM7 processor
# Include definitions common to all Linux ARM targets
include $(CONFIG)/os/CONFIG.Common.linux-arm
GNU_DIR=/afs/psi.ch/project/embeddedlinux/moxa/arm-linux-4.4.2-v4
GNU_TARGET=arm
ARCH_DEP_LDFLAGS+=-Wl,-rpath-link,$(GNU_DIR)/arm-none-linux-gnueabi/lib
ARCH_DEP_LDFLAGS+=-Wl,-rpath-link,$(INSTALL_LIB)
COMMANDLINE_LIBRARY = READLINE_NCURSES
# suppress note "the mangling of 'va_list' has changed in GCC 4.4"
ARCH_DEP_CXXFLAGS += -Wno-psabi
ARCH_DEP_CFLAGS += -funwind-tables

View File

@@ -0,0 +1,15 @@
# Moxa DA-66x with Montavista Linux 4.0
# Include definitions common to all Linux targets
include $(CONFIG)/os/CONFIG.Common.linuxCommon
COMMANDLINE_LIBRARY = READLINE_CURSES
ARCH_CLASS = xscale
GNU_DIR=/afs/psi.ch/project/embeddedlinux/moxa/xscale_be/armv5teb-montavista-linuxeabi
ARCH_DEP_CFLAGS += -funwind-tables
# Cannot build PVA because of missing boost support
SKIP_BUILDS = pv% normativeTypes

View File

@@ -0,0 +1,41 @@
# RaspberryPi with github.com/raspberrypi/tools toolchain
# Tested on:
# * Raspberry 3B+ Raspbian 9
# * Raspberry 2 Raspbian 7
# Include definitions common to all Linux targets
include $(CONFIG)/os/CONFIG.Common.linuxCommon
# Using readline:
# Due to missing/messed up libs in the toolchain, readline needs copies of
# libtinfo.so.5.9 and libreadline.so.6.2 from a Raspbian 7 rootfs
# /lib/arm-linux-gnueabihf/ to the toolchain, e.g.
# $(SDK_DIR)/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf/
# and manually created links libtinfo.so.5 and libreadline.so.
# For gcc-linaro-arm-linux-gnueabihf-raspbian, an existing incompatible
# libtinfo.so.5 is in the way. Remove it.
# (Built with glibc 2.16 like installed on Raspbian 9 but toolchain uses glibc 2.13.)
# Also copy /usr/include/readline/ directory from some readline 6 installation
# to $(SDK_DIR)/gcc-linaro-arm-linux-gnueabihf-raspbian/arm-linux-gnueabihf/libc/usr/include/
ARCH_CLASS = arm
SDK_DIR = /opt/raspberrypi/arm-bcm2708
# Available SDK_TARGETs:
# gcc 4.8.3 for 32 bit hosts with GLIBC 2.3 or higher
SDK_TARGET = gcc-linaro-arm-linux-gnueabihf-raspbian
# gcc 4.8.3 for 64 bit hosts with GLIBC 2.14 or higher
# SDK_TARGET = gcc-linaro-arm-linux-gnueabihf-raspbian-x64
# gcc 4.7.1 for 64 bit hosts with GLIBC 2.8 or higher
# SDK_TARGET = arm-linux-gnueabihf
# gcc 4.7.1 for 32 bit hosts with GLIBC 2.4 or higher
# SDK_TARGET = arm-bcm2708hardfp-linux-gnueabi
# SDK_TARGET = arm-bcm2708-linux-gnueabi
GNU_DIR = $(SDK_DIR)/$(SDK_TARGET)
GNU_TARGET = $(if $(filter arm-bcm2708%,SDK_TARGET),$(SDK_TARGET),arm-linux-gnueabihf)

View File

@@ -13,7 +13,7 @@ CMPLR_SUFFIX = ppc
ARCH_CLASS = ppc
# Architecture specific build flags
ARCH_DEP_CPPFLAGS = -DCPU=PPC603
ARCH_DEP_CPPFLAGS = -DCPU=PPC603
ARCH_DEP_CFLAGS = -mcpu=603 -mstrict-align
GNU_TARGET = powerpc-wrs-vxworks

View File

@@ -0,0 +1,18 @@
# XILINX Zynq with Yocto 2.1 / Petalinux toolchain
# Include definitions common to all Linux targets
include $(CONFIG)/os/CONFIG.Common.linuxCommon
ARCH_CLASS = arm64
SDK = petalinux
SDK_DIR = /opt/petalinux-gfa/2017.2
SDK_HOST_ARCH = $(GNU_HOST_ARCH_64)-$(SDK)-$(GNU_HOST_OS)
SDK_TARGET = aarch64-xilinx-linux
GNU_TARGET = $(SDK_TARGET)
SDKTARGETSYSROOT = $(SDK_DIR)/sysroots/$(SDK_TARGET)
GNU_DIR = $(SDK_DIR)/sysroots/$(SDK_HOST_ARCH)/usr
GNU_BIN = $(GNU_DIR)/bin/$(GNU_TARGET)
ARCH_DEP_CPPFLAGS = --sysroot=$(SDKTARGETSYSROOT)
ARCH_DEP_LDFLAGS = --sysroot=$(SDKTARGETSYSROOT)

View File

@@ -0,0 +1,3 @@
#CONFIG.$(EPICS_HOST_ARCH).Common is required by build system
#Include definitions common to linux hosts
include $(CONFIG)/os/CONFIG.linux-x86_64.Common

View File

@@ -0,0 +1,2 @@
# Include common linux definitions
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86

View File

@@ -0,0 +1,16 @@
# "cross compile" for older Linux version
# Use older compiler and older libraries
# Used packages:
# compat-gcc-44-c++-4.4
# compat-gcc-44-4.4
# compat-glibc-headers-2.12-4
# It was neccessary to install 32 bit compatibility libraries manually
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86
CC = $(GNU_BIN)/$(CMPLR_PREFIX)gcc44
CCC = $(GNU_BIN)/$(CMPLR_PREFIX)g++44
TARGET_CPPFLAGS = -isystem /usr/lib/x86_64-redhat-linux6E/include
TARGET_LDFLAGS = -L /usr/lib/x86_64-redhat-linux6E/lib
LINK.cpp += --as-needed -lc -lm -lrt -lpthread -lreadline -ltinfo

View File

@@ -0,0 +1,16 @@
# "cross compile" for older Linux version
# Use older compiler and older libraries
# Used packages:
# compat-gcc-44-c++-4.4
# compat-gcc-44-4.4
# compat-glibc-headers-2.12-4
# compat-glibc-2.12-4
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86
CC = $(GNU_BIN)/$(CMPLR_PREFIX)gcc44
CCC = $(GNU_BIN)/$(CMPLR_PREFIX)g++44
TARGET_CPPFLAGS = -isystem /usr/lib/x86_64-redhat-linux6E/include
TARGET_LDFLAGS = -L /usr/lib/x86_64-redhat-linux6E/lib64
LINK.cpp += --as-needed -lc -lm -lrt -lpthread -lreadline -ltinfo

View File

@@ -0,0 +1,3 @@
#CONFIG.$(EPICS_HOST_ARCH).Common is required by build system
#Include definitions common to linux hosts
include $(CONFIG)/os/CONFIG.linux-x86.Common

View File

@@ -0,0 +1,2 @@
# Include common linux definitions
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86

View File

@@ -0,0 +1,3 @@
#CONFIG.$(EPICS_HOST_ARCH).Common is required by build system
#Include definitions common to linux hosts
include $(CONFIG)/os/CONFIG.linux-x86_64.Common

View File

@@ -0,0 +1,2 @@
# Include common linux definitions
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86

View File

@@ -0,0 +1,2 @@
#CONFIG.$(EPICS_HOST_ARCH).Common is required by build system
#Include definitions common to linux hosts

View File

@@ -0,0 +1,2 @@
# Include common linux definitions
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86

View File

@@ -0,0 +1,3 @@
#CONFIG.$(EPICS_HOST_ARCH).Common is required by build system
#Include definitions common to linux hosts
include $(CONFIG)/os/CONFIG.linux-x86_64.Common

View File

@@ -0,0 +1,2 @@
# Include common linux definitions
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86

View File

@@ -0,0 +1,2 @@
# Include common linux definitions
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86

View File

@@ -0,0 +1,2 @@
SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE)
LOADABLE_SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE)

View File

@@ -0,0 +1,2 @@
COMMANDLINE_LIBRARY = READLINE
CODE_CPPFLAGS += -fno-strict-aliasing

View File

@@ -2,24 +2,58 @@
#
# Site specific definitions for vxWorks target builds.
# Compiler options can vary with the vxWorks version number, so we
# need to know that. Do not include any third-level digits.
#### Fixes for CONFIG.Common.vxWorksCommon #######
# Note: vxWorks 5.4.x and 5.5.x (Tornado 2.x) are not supported.
# VxWorks 6.0 through 6.5 use older, untested versions of GCC.
# These are needed for vxWorks 6.x; the GNU toolset version number
# is in the path to the compiler tools:
VX_GNU_VERSION_5 = 2.96
VX_GNU_VERSION_6 = $(VX_GNU_VERSION_$(VXWORKS_VERSION))
VX_GNU_VERSION = $(VX_GNU_VERSION_$(VXWORKS_MAJOR_VERSION))
VX_GNU_MINOR_VERSION = $(basename $(patsubst $(VX_GNU_MAJOR_VERSION).%,%,$(VX_GNU_VERSION)))
#VXWORKS_VERSION = 6.6
#VXWORKS_VERSION = 6.7
#VXWORKS_VERSION = 6.8
VXWORKS_VERSION = 6.9
# gcc version before 3.4 are "old" and need special treatment
VX_OLD_GCC_2 = OLD
VX_OLD_GCC_3.3 = OLD
VX_OLD_GCC_3 = $(VX_OLD_GCC_3.$(VX_GNU_MINOR_VERSION))
VX_OLD_GCC = $(VX_OLD_GCC_$(VX_GNU_MAJOR_VERSION))
# vxWorks directory definitions
VX_DIR_5 = $(WIND_BASE)
VX_DIR_6 = $(WIND_BASE)/vxworks-$(VXWORKS_VERSION)
VX_DIR = $(VX_DIR_$(VXWORKS_MAJOR_VERSION))
# Sites may override the following path for a particular host
# architecture by adding it to an appropriate
# CONFIG_SITE.$(EPICS_HOST_ARCH).vxWorksCommon file.
VX_INCLUDE_DIRS_5 = $(VX_DIR)/target/h
VX_INCLUDE_DIRS_6 = $(VX_DIR)/target/h $(VX_DIR)/target/h/wrn/coreip
GNU_TARGET_INCLUDE_DIR = $(VX_INCLUDE_DIRS_$(VXWORKS_MAJOR_VERSION))
TARGET_CPPFLAGS = -isystem $(VX_DIR)/target/h
# vxWorks GNU directories
GNU_DIR_5 = $(WIND_BASE)/host/$(WIND_HOST_TYPE)
GNU_DIR_6 = $(WIND_BASE)/gnu/$(VX_GNU_VERSION)-vxworks-$(VXWORKS_VERSION)/$(WIND_HOST_TYPE)
GNU_DIR = $(GNU_DIR_$(VXWORKS_MAJOR_VERSION))
# Operating system flags
OP_SYS_CFLAGS += -fno-strict-aliasing
# For gcc versions before 3.4 we need this g++ compiler flag
# However WindRiver says gcc 3.3 does not need it any more
# which would allow to build vxWorks 6 without this flag.
# Maybe we can live without it at the penalty of larger code.
# See vxWorks 5 docs/gnu2.96+ppc/gcc.html
# chapter 4.5 "Where's the Template?"
CODE_CXXFLAGS_OLD = -fno-implicit-templates
CODE_CXXFLAGS = $(CODE_CXXFLAGS_$(VX_OLD_GCC))
# WIND_BASE is where you installed the Wind River software.
WIND_BASE = /afs/psi.ch/project/vxworks/VxWorks$(VXWORKS_VERSION)
#--------------------------------------------------
# Modules we cannot build with old compiler
PV_MODULES = pv% normativeTypes
SKIP_BUILDS_5 = $(PV_MODULES)
SKIP_BUILDS_OLD = $(PV_MODULES)
SKIP_BUILDS_6 = $(SKIP_BUILDS_$(VX_OLD_GCC))
SKIP_BUILDS = $(SKIP_BUILDS_$(VXWORKS_MAJOR_VERSION))
#WIND_BASE = /usr/local/vw/tornado22-$(ARCH_CLASS)
WIND_BASE = /usr/local/vw/vxWorks-$(VXWORKS_VERSION)
#WIND_BASE = /ade/vxWorks/$(VXWORKS_VERSION)

View File

@@ -0,0 +1,17 @@
include $(CONFIG)/os/CONFIG_SITE.linux-x86_64.Common
# Build 32 bit version as a cross architecture
#CROSS_COMPILER_TARGET_ARCHS += RHEL7-x86
#CROSS_COMPILER_RUNTEST_ARCHS += RHEL7-x86
# Improved error checking with clang
CROSS_COMPILER_TARGET_ARCHS += RHEL7-x86_64-clang
CROSS_COMPILER_RUNTEST_ARCHS += RHEL7-x86_64-clang
# Build for old SL6 64 bit
CROSS_COMPILER_TARGET_ARCHS += SL6-x86_64
CROSS_COMPILER_RUNTEST_ARCHS += SL6-x86_64
# Build for old SL6 32 bit
CROSS_COMPILER_TARGET_ARCHS += SL6-x86
CROSS_COMPILER_RUNTEST_ARCHS += SL6-x86_64

View File

@@ -0,0 +1 @@
include $(CONFIG)/os/CONFIG_SITE.linux-x86.Common

View File

@@ -0,0 +1,3 @@
include $(CONFIG)/os/CONFIG_SITE.linux-x86.Common
# Build 32 bit version as a cross architecture
CROSS_COMPILER_TARGET_ARCHS += SL5-x86

View File

@@ -0,0 +1 @@
include $(CONFIG)/os/CONFIG_SITE.linux-x86.Common

View File

@@ -0,0 +1,7 @@
# Build 32 bit version as a cross architecture
CROSS_COMPILER_TARGET_ARCHS += SL6-x86
# Improved error checking with clang
#CROSS_COMPILER_TARGET_ARCHS += SL6-x86_64-clang
include $(CONFIG)/os/CONFIG_SITE.linux-x86_64.Common

View File

@@ -1,9 +1,42 @@
# CONFIG_SITE.linux-x86.Common
#
# Site override definitions for linux-x86 host builds
#-------------------------------------------------------
INSTALL_LOCATION=/usr/local/epics/base-$(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION)
# JBA test override values
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 solaris-sparc
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040
#CROSS_COMPILER_TARGET_ARCHS = RTEMS-mvme2100 RTEMS-pc386 # RTEMS-mvme5500 RTEMS-mvme167
GNU_HOST_ARCH=i686
GNU_HOST_OS=linux
# LD_LIBRARY_PATH may cause problems for eldk53-ppc4xxFP
LD_LIBRARY_PATH=
# vxWorks 5.5 for MVxxxx boards
CROSS_COMPILER_TARGET_ARCHS += T2-ppc604
# vxWorks 6.7 for MVxxxx boards
CROSS_COMPILER_TARGET_ARCHS += V67-ppc604
# NI compact RIO
CROSS_COMPILER_TARGET_ARCHS += V63-ppc603
# MOXA montavista linux (No PVA because of missing boost support)
CROSS_COMPILER_TARGET_ARCHS += mvl40-xscale_be
# MOXA SDK 4.2
CROSS_COMPILER_TARGET_ARCHS += moxa42-armv6l
# Virtex embedded PPC
CROSS_COMPILER_TARGET_ARCHS += eldk51-ppc4xxSF
# IOxOS IFC1210
CROSS_COMPILER_TARGET_ARCHS += eldk52-e500v2
# DeltaTau PowerPMAC
CROSS_COMPILER_TARGET_ARCHS += eldk42-ppc4xxFP
CROSS_COMPILER_TARGET_ARCHS += eldk53-ppc4xxFP
# Test other vxWorks versions
#CROSS_COMPILER_TARGET_ARCHS += V66-ppc603
CROSS_COMPILER_TARGET_ARCHS += V66-ppc604
#CROSS_COMPILER_TARGET_ARCHS += V63-ppc604
# (No PVA because of old compiler)
CROSS_COMPILER_TARGET_ARCHS += V62-ppc604
# Raspberry Pi
CROSS_COMPILER_TARGET_ARCHS += raspbian-arm

View File

@@ -1,9 +1,9 @@
# CONFIG_SITE.linux-x86_64.Common
#
# Site override definitions for linux-x86_64 host builds
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG_SITE.linux-x86.Common
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 solaris-sparc
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040
#CROSS_COMPILER_TARGET_ARCHS = RTEMS-mvme2100
GNU_HOST_ARCH_64=x86_64
# IOxOS IFC1211
CROSS_COMPILER_TARGET_ARCHS += fslqoriq20-e6500_64
# Zynq
CROSS_COMPILER_TARGET_ARCHS += yocto21-aarch64

View File

@@ -20,7 +20,7 @@ release.</p>
which should also be read to understand what has changed since an earlier
release.</p>
<h1 align="center">EPICS Release 7.0.3</h1>
<h1 align="center">EPICS Release 7.0.3.1</h1>
<!-- Insert new items immediately below this template ...
@@ -30,6 +30,18 @@ release.</p>
-->
<h3>Non-VME RTEMS targets now define pdevLibVME</h3>
<p>Previously IOC executables that made calls to devLib routines would fail to
link when built for some non-VME based RTEMS targets, which would have to be
explicitly filtered out by sites that build Base for those targets.
<a href="https://bugs.launchpad.net/epics-base/+bug/1841692">This fix</a> makes
that no longer necessary, all RTEMS targets should now link although the IOC
won't be able to be used with the VME I/O on those systems (that we don't have
VMEbus I/O support for in libCom).</p>
<h1 align="center">EPICS Release 7.0.3</h1>
<h3>epicsTimeGetCurrent() optimization</h3>
<p>Add a fast path to epicsTimeGetCurrent() and related calls

View File

@@ -289,13 +289,20 @@ starting at <a href="#ReleaseApproval">Release Approval</a>.</p>
<td><input type="checkbox"></td>
<td>Release Manager</td>
<td>Edit and commit changes to the EPICS Base version number file and
the embedded module version files:
these embedded module version files:
<ul>
<li>configure/CONFIG_BASE_VERSION </li>
<li>modules/libcom/configure/CONFIG_LIBCOM_VERSION</li>
<li>modules/ca/configure/CONFIG_CA_VERSION</li>
<li>modules/database/configure/CONFIG_DATABASE_VERSION</li>
</ul></td>
</ul>
<p>Version numbers should be set according to the level of changes
made since the last release. Note that the MAINTENANCE_VERSION or
PATCH_LEVEL value should have been incremented after the previous
release tag was applied.</p>
<p>Set all DEVELOPMENT_FLAG values to 0 and EPICS_DEV_SNAPSHOT to the
empty string.</p>
</td>
</tr>
<tr>
<td><input type="checkbox"></td>
@@ -305,7 +312,26 @@ starting at <a href="#ReleaseApproval">Release Approval</a>.</p>
cd base-7.0<br />
git tag -m 'ANJ: Tagged for 7.0.3' R7.0.3</i>
</tt></blockquote>
Don't push the new tag to the Launchpad repository yet.</td>
<p>Don't push these commits or the new tag to the Launchpad repository
yet.</td>
</tr>
<tr>
<td><input type="checkbox"></td>
<td>Release Manager</td>
<td>Edit and commit changes to the EPICS Base version number file and
the embedded module version files as follows:
<ul>
<li>configure/CONFIG_BASE_VERSION </li>
<li>modules/libcom/configure/CONFIG_LIBCOM_VERSION</li>
<li>modules/ca/configure/CONFIG_CA_VERSION</li>
<li>modules/database/configure/CONFIG_DATABASE_VERSION</li>
</ul>
<p>Version numbers should be set for the next expected patch/maintenance
release by incrementing the MAINTENANCE_VERSION or PATCH_LEVEL
value in each file.</p>
<p>Set all DEVELOPMENT_FLAG values to 1 and EPICS_DEV_SNAPSHOT to
"-DEV".</p>
</td>
</tr>
<tr>
<td><input type="checkbox"></td>
@@ -327,29 +353,13 @@ starting at <a href="#ReleaseApproval">Release Approval</a>.</p>
<td><input type="checkbox"></td>
<td>Release Manager</td>
<td>Test the tar file by extracting its contents and building it on at
least one supported platform. When this succeeds the new git tag can be
pushed to the Launchpad repository:
least one supported platform. When this succeeds the commits and new git
tag can be pushed to the Launchpad repository:
<blockquote><tt>
git push --follow-tags upstream 7.0
</tt></blockquote>
</td>
</tr>
<tr>
<td><input type="checkbox"></td>
<td>Release Manager</td>
<td>Edit and commit changes to the EPICS Base version number file and
the embedded module version files:
<ul>
<li>configure/CONFIG_BASE_VERSION </li>
<li>modules/libcom/configure/CONFIG_LIBCOM_VERSION</li>
<li>modules/ca/configure/CONFIG_CA_VERSION</li>
<li>modules/database/configure/CONFIG_DATABASE_VERSION</li>
</ul>
Version numbers should be set to the next expected patch release,
with a "-DEV" tag added (where applicable).
</td>
</tr>
<tr>
<th colspan="3">Publish to epics.anl.gov</th>
</tr>
@@ -398,7 +408,11 @@ starting at <a href="#ReleaseApproval">Release Approval</a>.</p>
<td><input type="checkbox"></td>
<td>Website Manager</td>
<td>Upload the tar file and its <tt>.asc</tt> signature file to the
epics-controls web-server [ToDo: ssh-key, location]</td>
epics-controls web-server.
<blockquote><tt>
scp base-7.0.3.tar.gz base-7.0.3.tar.gz.asc epics-controls:download/base<br />
</tt></blockquote>
</td>
</tr>
<tr>
<td><input type="checkbox"></td>
@@ -406,7 +420,10 @@ starting at <a href="#ReleaseApproval">Release Approval</a>.</p>
<td>Follow instructions on
<a href="https://epics-controls.org/resources-and-support/documents/epics-website-documentation/adding-a-page-for-a-new-release/">
Add a page for a new release</a> to create a new release webpage (not
required for a patch release though, just edit the existing page).</td>
required for a patch release, just edit the existing page). Update the
TablePress "Point Releases" table and add the new download, and adjust
the XYZ Html Snippet for the series download.
</td>
</tr>
<tr>

View File

@@ -37,6 +37,9 @@ pva2pva_DEPEND_DIRS = pvAccess
SUBMODULES += example
example_DEPEND_DIRS = pva2pva pvaClient
SUBMODULES += pcas
pcas_DEPEND_DIRS = ca
# Allow sites to add extra submodules
-include Makefile.local

View File

@@ -1,4 +1,12 @@
# Version number for the Channel Access API and shared library
EPICS_CA_MAJOR_VERSION = 4
EPICS_CA_MINOR_VERSION = 13
EPICS_CA_MAINTENANCE_VERSION = 4
EPICS_CA_DEVELOPMENT_FLAG = 0
EPICS_CA_MAINTENANCE_VERSION = 5
# Development flag, set to zero for release versions
EPICS_CA_DEVELOPMENT_FLAG = 1
# Immediately after a release the MAINTENANCE_VERSION
# will be incremented and the DEVELOPMENT_FLAG set to 1

View File

@@ -72,6 +72,7 @@ LIBSRCS += comQueSend.cpp
LIBSRCS += comBuf.cpp
LIBSRCS += hostNameCache.cpp
LIBSRCS += msgForMultiplyDefinedPV.cpp
LIBSRCS_vxWorks += templateInstances.cpp
LIBRARY=ca

View File

@@ -0,0 +1,66 @@
/*************************************************************************\
* 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
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
*
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
*
* Copyright, 1986, The Regents of the University of California.
*
*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
*/
#include "cac.h"
#include "oldAccess.h"
#include "repeaterClient.h"
template class chronIntIdResTable < nciu >;
template class chronIntIdResTable < baseNMIU >;
template class chronIntIdResTable < CASG >;
template class resTable < nciu, chronIntId >;
template class resTable < baseNMIU, chronIntId >;
template class resTable < CASG, chronIntId >;
template class resTable < bhe, inetAddrID >;
template class resTable < tcpiiu, caServerID >;
template class tsFreeList < bhe, 0x100 >;
template class tsFreeList < tcpiiu, 32, epicsMutexNOOP >;
template class tsFreeList < netReadNotifyIO, 1024, epicsMutexNOOP >;
template class tsFreeList < netWriteNotifyIO, 1024, epicsMutexNOOP >;
template class tsFreeList < netSubscription, 1024, epicsMutexNOOP >;
template class tsFreeList < CASG, 128, epicsMutexNOOP >;
template class tsFreeList < syncGroupReadNotify, 128, epicsMutexNOOP >;
template class tsFreeList < syncGroupWriteNotify, 128, epicsMutexNOOP >;
template class tsFreeList < comBuf, 0x20 >;
template class tsFreeList < getCallback, 1024, epicsMutexNOOP >;
template class tsFreeList < getCopy, 1024, epicsMutexNOOP >;
template class tsFreeList < msgForMultiplyDefinedPV, 16 >;
template class tsFreeList < nciu, 1024, epicsMutexNOOP>;
template class tsFreeList < oldChannelNotify, 1024, epicsMutexNOOP >;
template class tsFreeList < oldSubscription, 1024, epicsMutexNOOP >;
template class tsFreeList < putCallback, 1024, epicsMutexNOOP >;
template class tsFreeList < repeaterClient, 0x20 >;
template class epicsSingleton < localHostName >;
template unsigned comBuf :: push ( const double * pValue, unsigned nElem );
template unsigned comBuf :: push ( const float * pValue, unsigned nElem );
template unsigned comBuf :: push ( const int * pValue, unsigned nElem );
template unsigned comBuf :: push ( const short * pValue, unsigned nElem );
template comBuf :: popStatus comBuf :: pop ( unsigned int & returnVal );
template comBuf :: popStatus comBuf :: pop ( unsigned short & returnVal );
template comBuf :: popStatus comBuf :: pop ( unsigned char & returnVal );
template void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO
(epicsGuard < epicsMutex > &, syncGroupWriteNotify & );
template void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO
( epicsGuard < epicsMutex > &, syncGroupReadNotify & );

View File

@@ -1,4 +1,12 @@
# Version number for the database APIs and shared library
EPICS_DATABASE_MAJOR_VERSION = 3
EPICS_DATABASE_MINOR_VERSION = 17
EPICS_DATABASE_MAINTENANCE_VERSION = 4
EPICS_DATABASE_DEVELOPMENT_FLAG = 0
EPICS_DATABASE_MAINTENANCE_VERSION = 5
# Development flag, set to zero for release versions
EPICS_DATABASE_DEVELOPMENT_FLAG = 1
# Immediately after a release the MAINTENANCE_VERSION
# will be incremented and the DEVELOPMENT_FLAG set to 1

View File

@@ -240,6 +240,10 @@ int astac(const char *pname,const char *user,const char *location)
char *puser;
char *plocation;
if (!pname || !user || !location){
printf("Usage: astac \"record name\", \"user\", \"host\"\n");
return(1);
}
paddr = dbCalloc(1,sizeof(DBADDR) + sizeof(ASCLIENTPVT));
pasclientpvt = (ASCLIENTPVT *)(paddr + 1);
status=dbNameToAddr(pname,paddr);

View File

@@ -42,6 +42,7 @@ INC += dbState.h
INC += db_access_routines.h
INC += db_convert.h
INC += dbUnitTest.h
INC += dbCaPvt.h
# Generate menuGlobal.dbd, not really by concatenation, see RULES
DBDCAT += menuGlobal.dbd
@@ -96,4 +97,5 @@ dbCore_SRCS += chfPlugin.c
dbCore_SRCS += dbState.c
dbCore_SRCS += dbUnitTest.c
dbCore_SRCS += dbServer.c
dbCore_SRCS_vxWorks += templateInstances.cpp

View File

@@ -0,0 +1,9 @@
#include "dbCAC.h"
#include "dbChannelIO.h"
#include "dbPutNotifyBlocker.h"
template class tsFreeList < dbSubscriptionIO, 256, epicsMutexNOOP >;
template class tsFreeList < dbChannelIO, 256, epicsMutexNOOP >;
template class tsFreeList < dbPutNotifyBlocker, 64, epicsMutexNOOP >;
template class resTable < dbBaseIO, chronIntId >;
template class chronIntIdResTable < dbBaseIO >;

View File

@@ -33,3 +33,6 @@ variable(callbackParallelThreadsDefault,int)
# Real-time operation
variable(dbThreadRealtimeLock,int)
# show logClient network activity
variable(logClientDebug,int)

View File

@@ -16,6 +16,7 @@ caserverio_INCLUDES = -I$(SRC)/ca/client
camessage_INCLUDES = -I$(SRC)/ca/client
INC += rsrv.h
INC += server.h
DBD += rsrv.dbd

View File

@@ -12,6 +12,8 @@ SRC_DIRS += $(STDDIR)/softIoc
PROD_IOC_DEFAULT = softIoc
PROD_IOC_iOS = -nil-
PROD_LDFLAGS_vxWorks = --whole-archive
DBD += base.dbd
DBD += asSub.dbd
DBD += softIoc.dbd

View File

@@ -182,8 +182,8 @@ dbTestHarness_SRCS_RTEMS += rtemsTestHarness.c
PROD_SRCS_RTEMS += rtemsTestData.c
PROD_vxWorks = dbTestHarness
PROD_RTEMS = dbTestHarness
TESTPROD_vxWorks = dbTestHarness
TESTPROD_RTEMS = dbTestHarness
TESTSPEC_vxWorks = dbTestHarness.munch; epicsRunDbTests
TESTSPEC_RTEMS = dbTestHarness.boot; epicsRunDbTests

View File

@@ -65,8 +65,8 @@ filterTestHarness_SRCS_RTEMS += rtemsTestHarness.c
PROD_SRCS_RTEMS += rtemsTestData.c
PROD_vxWorks = filterTestHarness
PROD_RTEMS = filterTestHarness
TESTPROD_vxWorks = filterTestHarness
TESTPROD_RTEMS = filterTestHarness
TESTSPEC_vxWorks = filterTestHarness.munch; epicsRunFilterTests
TESTSPEC_RTEMS = filterTestHarness.boot; epicsRunFilterTests

View File

@@ -45,8 +45,8 @@ testHarness_SRCS += epicsRunLinkTests.c
linkTestHarness_SRCS += $(testHarness_SRCS)
linkTestHarness_SRCS_RTEMS += rtemsTestHarness.c
PROD_vxWorks = linkTestHarness
PROD_RTEMS = linkTestHarness
TESTPROD_vxWorks = linkTestHarness
TESTPROD_RTEMS = linkTestHarness
TESTSPEC_vxWorks = linkTestHarness.munch; epicsRunLinkTests
TESTSPEC_RTEMS = linkTestHarness.boot; epicsRunLinkTests

View File

@@ -158,8 +158,8 @@ recordTestHarness_SRCS_RTEMS += rtemsTestHarness.c
PROD_SRCS_RTEMS += rtemsTestData.c
PROD_vxWorks = recordTestHarness
PROD_RTEMS = recordTestHarness
TESTPROD_vxWorks = recordTestHarness
TESTPROD_RTEMS = recordTestHarness
TESTSPEC_vxWorks = recordTestHarness.munch; epicsRunRecordTests
TESTSPEC_RTEMS = recordTestHarness.boot; epicsRunRecordTests

View File

@@ -1,4 +1,12 @@
# Version number for the libcom APIs and shared library
EPICS_LIBCOM_MAJOR_VERSION = 3
EPICS_LIBCOM_MINOR_VERSION = 17
EPICS_LIBCOM_MAINTENANCE_VERSION = 5
EPICS_LIBCOM_DEVELOPMENT_FLAG = 0
EPICS_LIBCOM_MAINTENANCE_VERSION = 6
# Development flag, set to zero for release versions
EPICS_LIBCOM_DEVELOPMENT_FLAG = 1
# Immediately after a release the MAINTENANCE_VERSION
# will be incremented and the DEVELOPMENT_FLAG set to 1

View File

@@ -40,9 +40,8 @@ typedef struct errnumnode {
long pad;
} ERRNUMNODE;
static ELLLIST errnumlist = ELLLIST_INIT;
static ERRNUMNODE **hashtable;
static int initialized = 0;
static ERRNUMNODE **hashtable = NULL;
#define initialized (hashtable!=NULL)
extern ERRSYMTAB_ID errSymTbl;
/****************************************************************
@@ -56,9 +55,6 @@ extern ERRSYMTAB_ID errSymTbl;
int errSymBld(void)
{
ERRSYMBOL *errArray = errSymTbl->symbols;
ERRNUMNODE *perrNumNode = NULL;
ERRNUMNODE *pNextNode = NULL;
ERRNUMNODE **phashnode = NULL;
int i;
int modnum;
@@ -79,22 +75,6 @@ int errSymBld(void)
continue;
}
}
perrNumNode = (ERRNUMNODE *) ellFirst(&errnumlist);
while (perrNumNode) {
/* hash each perrNumNode->errNum */
epicsUInt16 hashInd = errhash(perrNumNode->errNum);
phashnode = (ERRNUMNODE**)&hashtable[hashInd];
pNextNode = (ERRNUMNODE*) *phashnode;
/* search for last node (NULL) of hashnode linked list */
while (pNextNode) {
phashnode = &pNextNode->hashnode;
pNextNode = *phashnode;
}
*phashnode = perrNumNode;
perrNumNode = (ERRNUMNODE *) ellNext((ELLNODE *) perrNumNode);
}
initialized = 1;
return(0);
}
@@ -118,12 +98,32 @@ static epicsUInt16 errhash(long errNum)
***************************************************************/
int errSymbolAdd(long errNum, const char *name)
{
ERRNUMNODE *pNew = (ERRNUMNODE*) callocMustSucceed(1,
ERRNUMNODE *perrNumNode;
ERRNUMNODE *pNextNode = NULL;
ERRNUMNODE **phashnode = NULL;
epicsUInt16 hashInd;
if (!initialized)
errSymBld();
perrNumNode = (ERRNUMNODE*) callocMustSucceed(1,
sizeof(ERRNUMNODE), "errSymbolAdd");
pNew->errNum = errNum;
pNew->message = name;
ellAdd(&errnumlist, (ELLNODE*)pNew);
perrNumNode->errNum = errNum;
perrNumNode->message = name;
/* hash each perrNumNode->errNum */
hashInd = errhash(perrNumNode->errNum);
phashnode = (ERRNUMNODE**)&hashtable[hashInd];
pNextNode = (ERRNUMNODE*) *phashnode;
/* search for last node (NULL) of hashnode linked list */
while (pNextNode) {
phashnode = &pNextNode->hashnode;
pNextNode = *phashnode;
}
*phashnode = perrNumNode;
perrNumNode = (ERRNUMNODE *) ellNext((ELLNODE *) perrNumNode);
return 0;
}

View File

@@ -18,8 +18,10 @@
#define epicsExportSharedSymbols
#include "envDefs.h"
#include "errlog.h"
#include "logClient.h"
#include "iocLog.h"
#include "epicsExit.h"
int iocLogDisable = 0;
@@ -74,6 +76,24 @@ void epicsShareAPI epicsShareAPI iocLogFlush (void)
}
}
/*
* logClientSendMessage ()
*/
static void logClientSendMessage ( logClientId id, const char * message )
{
if ( !iocLogDisable ) {
logClientSend (id, message);
}
}
/*
* iocLogClientDestroy()
*/
static void iocLogClientDestroy (logClientId id)
{
errlogRemoveListeners (logClientSendMessage, id);
}
/*
* iocLogClientInit()
*/
@@ -89,6 +109,10 @@ static logClientId iocLogClientInit (void)
return NULL;
}
id = logClientCreate (addr, port);
if (id != NULL) {
errlogAddListener (logClientSendMessage, id);
epicsAtExit (iocLogClientDestroy, id);
}
return id;
}
@@ -135,3 +159,4 @@ logClientId epicsShareAPI logClientInit (void)
{
return iocLogClientInit ();
}

View File

@@ -486,18 +486,6 @@ static void acceptNewClient ( void *pParam )
}
}
status = shutdown(pclient->insock, SHUT_WR);
if(status<0){
char sockErrBuf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
fprintf (stderr, "%s:%d shutdown err %s\n", __FILE__, __LINE__,
sockErrBuf);
epicsSocketDestroy ( pclient->insock );
free(pclient);
return;
}
status = fdmgr_add_callback(
pserver->pfdctx,
pclient->insock,

View File

@@ -21,11 +21,9 @@
#include <string.h>
#include <stdio.h>
#define epicsExportSharedSymbols
#include "dbDefs.h"
#include "epicsEvent.h"
#include "iocLog.h"
#include "errlog.h"
#include "epicsMutex.h"
#include "epicsThread.h"
#include "epicsTime.h"
@@ -33,9 +31,13 @@
#include "epicsAssert.h"
#include "epicsExit.h"
#include "epicsSignal.h"
#include "epicsExport.h"
#include "logClient.h"
int logClientDebug = 0;
epicsExportAddress (int, logClientDebug);
typedef struct {
char msgBuf[0x4000];
struct sockaddr_in addr;
@@ -44,6 +46,7 @@ typedef struct {
SOCKET sock;
epicsThreadId restartThreadId;
epicsEventId stateChangeNotify;
epicsEventId shutdownNotify;
unsigned connectCount;
unsigned nextMsgIndex;
unsigned connected;
@@ -53,7 +56,6 @@ typedef struct {
} logClient;
static const double LOG_RESTART_DELAY = 5.0; /* sec */
static const double LOG_SERVER_CREATE_CONNECT_SYNC_TIMEOUT = 5.0; /* sec */
static const double LOG_SERVER_SHUTDOWN_TIMEOUT = 30.0; /* sec */
/*
@@ -66,10 +68,10 @@ static char* logClientPrefix = NULL;
*/
static void logClientClose ( logClient *pClient )
{
# ifdef DEBUG
if (logClientDebug) {
fprintf (stderr, "log client: lingering for connection close...");
fflush (stderr);
# endif
}
/*
* mutex on
@@ -84,8 +86,6 @@ static void logClientClose ( logClient *pClient )
pClient->sock = INVALID_SOCKET;
}
pClient->nextMsgIndex = 0u;
memset ( pClient->msgBuf, '\0', sizeof ( pClient->msgBuf ) );
pClient->connected = 0u;
/*
@@ -93,9 +93,8 @@ static void logClientClose ( logClient *pClient )
*/
epicsMutexUnlock (pClient->mutex);
# ifdef DEBUG
if (logClientDebug)
fprintf (stderr, "done\n");
# endif
}
/*
@@ -113,6 +112,7 @@ static void logClientDestroy (logClientId id)
epicsMutexMustLock ( pClient->mutex );
pClient->shutdown = 1u;
epicsMutexUnlock ( pClient->mutex );
epicsEventSignal ( pClient->shutdownNotify );
/* unblock log client thread blocking in send() or connect() */
interruptInfo =
@@ -154,17 +154,40 @@ static void logClientDestroy (logClientId id)
return;
}
errlogRemoveListeners ( logClientSendMessage, (void *) pClient );
logClientClose ( pClient );
epicsMutexDestroy ( pClient->mutex );
epicsEventDestroy ( pClient->stateChangeNotify );
epicsEventDestroy ( pClient->shutdownNotify );
free ( pClient );
}
/*
* logClientCheckConnection
*/
static void logClientCheckConnection( logClient * pClient )
{
epicsMutexMustLock ( pClient->mutex );
while ( pClient->connected ) {
struct timeval timeout = { 0, 0 };
fd_set set;
char buffer[256];
FD_ZERO ( &set );
FD_SET ( pClient->sock, &set );
if ( select ( pClient->sock + 1, &set, NULL, NULL, &timeout ) == 0)
break;
if ( recv ( pClient->sock, buffer, sizeof ( buffer ), 0 ) == 0 ) {
fprintf ( stderr, "log client: connection closed by server \"%s\"\n",
pClient->name );
logClientClose ( pClient );
break;
}
}
epicsMutexUnlock ( pClient->mutex );
}
/*
* This method requires the pClient->mutex be owned already.
*/
@@ -176,57 +199,24 @@ static void sendMessageChunk(logClient * pClient, const char * message) {
unsigned msgBufBytesLeft =
sizeof ( pClient->msgBuf ) - pClient->nextMsgIndex;
if ( strSize > msgBufBytesLeft ) {
int status;
if ( ! pClient->connected ) {
break;
}
if ( msgBufBytesLeft > 0u ) {
memcpy ( & pClient->msgBuf[pClient->nextMsgIndex],
message, msgBufBytesLeft );
pClient->nextMsgIndex += msgBufBytesLeft;
strSize -= msgBufBytesLeft;
message += msgBufBytesLeft;
}
status = send ( pClient->sock, pClient->msgBuf,
pClient->nextMsgIndex, 0 );
if ( status > 0 ) {
unsigned nSent = (unsigned) status;
if ( nSent < pClient->nextMsgIndex ) {
unsigned newNextMsgIndex = pClient->nextMsgIndex - nSent;
memmove ( pClient->msgBuf, & pClient->msgBuf[nSent],
newNextMsgIndex );
pClient->nextMsgIndex = newNextMsgIndex;
}
else {
pClient->nextMsgIndex = 0u;
}
}
else {
if ( ! pClient->shutdown ) {
char sockErrBuf[64];
if ( status ) {
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
}
else {
strcpy ( sockErrBuf, "server initiated disconnect" );
}
fprintf ( stderr, "log client: lost contact with log server at \"%s\" because \"%s\"\n",
pClient->name, sockErrBuf );
}
logClientClose ( pClient );
break;
}
if ( msgBufBytesLeft < strSize && pClient->nextMsgIndex != 0u && pClient->connected)
{
/* buffer is full, thus flush it */
logClientCheckConnection( pClient );
logClientFlush ( pClient );
msgBufBytesLeft = sizeof ( pClient->msgBuf ) - pClient->nextMsgIndex;
}
else {
memcpy ( & pClient->msgBuf[pClient->nextMsgIndex],
message, strSize );
pClient->nextMsgIndex += strSize;
if ( msgBufBytesLeft == 0u ) {
fprintf ( stderr, "log client: messages to \"%s\" are lost\n",
pClient->name );
break;
}
if ( msgBufBytesLeft > strSize) msgBufBytesLeft = strSize;
memcpy ( & pClient->msgBuf[pClient->nextMsgIndex],
message, msgBufBytesLeft );
pClient->nextMsgIndex += msgBufBytesLeft;
strSize -= msgBufBytesLeft;
message += msgBufBytesLeft;
}
}
@@ -255,32 +245,25 @@ void epicsShareAPI logClientSend ( logClientId id, const char * message )
void epicsShareAPI logClientFlush ( logClientId id )
{
unsigned nSent = 0u;
logClient * pClient = ( logClient * ) id;
if ( ! pClient ) {
if ( ! pClient || ! pClient->connected ) {
return;
}
epicsMutexMustLock ( pClient->mutex );
while ( pClient->nextMsgIndex && pClient->connected ) {
int status = send ( pClient->sock, pClient->msgBuf,
pClient->nextMsgIndex, 0 );
while ( nSent < pClient->nextMsgIndex && pClient->connected ) {
int status = send ( pClient->sock, pClient->msgBuf + nSent,
pClient->nextMsgIndex - nSent, 0 );
if ( status > 0 ) {
unsigned nSent = (unsigned) status;
if ( nSent < pClient->nextMsgIndex ) {
unsigned newNextMsgIndex = pClient->nextMsgIndex - nSent;
memmove ( pClient->msgBuf, & pClient->msgBuf[nSent],
newNextMsgIndex );
pClient->nextMsgIndex = newNextMsgIndex;
}
else {
pClient->nextMsgIndex = 0u;
}
nSent += (unsigned) status;
}
else {
if ( ! pClient->shutdown ) {
char sockErrBuf[64];
char sockErrBuf[128];
if ( status ) {
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
}
@@ -294,6 +277,11 @@ void epicsShareAPI logClientFlush ( logClientId id )
break;
}
}
pClient->nextMsgIndex -= nSent;
if ( nSent > 0 && pClient->nextMsgIndex > 0 ) {
memmove ( pClient->msgBuf, & pClient->msgBuf[nSent],
pClient->nextMsgIndex );
}
epicsMutexUnlock ( pClient->mutex );
}
@@ -302,10 +290,10 @@ void epicsShareAPI logClientFlush ( logClientId id )
*/
static void logClientMakeSock (logClient *pClient)
{
# ifdef DEBUG
if (logClientDebug) {
fprintf (stderr, "log client: creating socket...");
# endif
fflush (stderr);
}
epicsMutexMustLock (pClient->mutex);
@@ -314,7 +302,7 @@ static void logClientMakeSock (logClient *pClient)
*/
pClient->sock = epicsSocketCreate ( AF_INET, SOCK_STREAM, 0 );
if ( pClient->sock == INVALID_SOCKET ) {
char sockErrBuf[64];
char sockErrBuf[128];
epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
fprintf ( stderr, "log client: no socket error %s\n",
@@ -323,10 +311,8 @@ static void logClientMakeSock (logClient *pClient)
epicsMutexUnlock (pClient->mutex);
# ifdef DEBUG
if (logClientDebug)
fprintf (stderr, "done\n");
# endif
}
/*
@@ -366,7 +352,7 @@ static void logClientConnect (logClient *pClient)
}
else {
if ( pClient->connFailStatus != errnoCpy && ! pClient->shutdown ) {
char sockErrBuf[64];
char sockErrBuf[128];
epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
fprintf (stderr,
@@ -392,26 +378,12 @@ static void logClientConnect (logClient *pClient)
optval = TRUE;
status = setsockopt (pClient->sock, SOL_SOCKET, SO_KEEPALIVE, (char *)&optval, sizeof(optval));
if (status<0) {
char sockErrBuf[64];
char sockErrBuf[128];
epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
fprintf (stderr, "log client: unable to enable keepalive option because \"%s\"\n", sockErrBuf);
}
/*
* we don't need full-duplex (clients only write), so we shutdown
* the read end of our socket
*/
status = shutdown (pClient->sock, SHUT_RD);
if (status < 0) {
char sockErrBuf[64];
epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
fprintf (stderr, "%s:%d shutdown(%d,SHUT_RD) error was \"%s\"\n",
__FILE__, __LINE__, pClient->sock, sockErrBuf);
/* not fatal (although it shouldn't happen) */
}
/*
* set how long we will wait for the TCP state machine
* to clean up when we issue a close(). This
@@ -425,7 +397,7 @@ static void logClientConnect (logClient *pClient)
lingerval.l_linger = 60*5;
status = setsockopt (pClient->sock, SOL_SOCKET, SO_LINGER, (char *) &lingerval, sizeof(lingerval));
if (status<0) {
char sockErrBuf[64];
char sockErrBuf[128];
epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
fprintf (stderr, "log client: unable to set linger options because \"%s\"\n", sockErrBuf);
@@ -451,20 +423,21 @@ static void logClientRestart ( logClientId id )
/* SMP safe state inspection */
epicsMutexMustLock ( pClient->mutex );
while ( ! pClient->shutdown ) {
unsigned isConn;
unsigned isConn, dataToSend;
logClientCheckConnection( pClient );
isConn = pClient->connected;
dataToSend = pClient->nextMsgIndex;
epicsMutexUnlock ( pClient->mutex );
if ( isConn ) {
if ( dataToSend ) {
if ( ! isConn ) logClientConnect ( pClient );
logClientFlush ( pClient );
}
else {
logClientConnect ( pClient );
}
epicsThreadSleep ( LOG_RESTART_DELAY );
epicsEventWaitWithTimeout ( pClient->shutdownNotify, LOG_RESTART_DELAY);
epicsMutexMustLock ( pClient->mutex );
}
@@ -480,9 +453,7 @@ static void logClientRestart ( logClientId id )
logClientId epicsShareAPI logClientCreate (
struct in_addr server_addr, unsigned short server_port)
{
epicsTimeStamp begin, current;
logClient *pClient;
double diff;
pClient = calloc (1, sizeof (*pClient));
if (pClient==NULL) {
@@ -507,14 +478,22 @@ logClientId epicsShareAPI logClientCreate (
pClient->shutdownConfirm = 0;
epicsAtExit (logClientDestroy, (void*) pClient);
pClient->stateChangeNotify = epicsEventCreate (epicsEventEmpty);
if ( ! pClient->stateChangeNotify ) {
epicsMutexDestroy ( pClient->mutex );
free ( pClient );
return NULL;
}
pClient->shutdownNotify = epicsEventCreate (epicsEventEmpty);
if ( ! pClient->shutdownNotify ) {
epicsMutexDestroy ( pClient->mutex );
epicsEventDestroy ( pClient->stateChangeNotify );
free ( pClient );
return NULL;
}
pClient->restartThreadId = epicsThreadCreate (
"logRestart", epicsThreadPriorityLow,
epicsThreadGetStackSize(epicsThreadStackSmall),
@@ -522,35 +501,12 @@ logClientId epicsShareAPI logClientCreate (
if ( pClient->restartThreadId == NULL ) {
epicsMutexDestroy ( pClient->mutex );
epicsEventDestroy ( pClient->stateChangeNotify );
epicsEventDestroy ( pClient->shutdownNotify );
free (pClient);
fprintf(stderr, "log client: unable to start log client connection watch dog thread\n");
return NULL;
}
/*
* attempt to synchronize with circuit connect
*/
epicsTimeGetCurrent ( & begin );
epicsMutexMustLock ( pClient->mutex );
do {
epicsMutexUnlock ( pClient->mutex );
epicsEventWaitWithTimeout (
pClient->stateChangeNotify,
LOG_SERVER_CREATE_CONNECT_SYNC_TIMEOUT / 10.0 );
epicsTimeGetCurrent ( & current );
diff = epicsTimeDiffInSeconds ( & current, & begin );
epicsMutexMustLock ( pClient->mutex );
}
while ( ! pClient->connected && diff < LOG_SERVER_CREATE_CONNECT_SYNC_TIMEOUT );
epicsMutexUnlock ( pClient->mutex );
if ( ! pClient->connected ) {
fprintf (stderr, "log client create: timed out synchronizing with circuit connect to \"%s\" after %.1f seconds\n",
pClient->name, LOG_SERVER_CREATE_CONNECT_SYNC_TIMEOUT );
}
errlogAddListener ( logClientSendMessage, (void *) pClient );
return (void *) pClient;
}
@@ -568,24 +524,21 @@ void epicsShareAPI logClientShow (logClientId id, unsigned level)
printf ("log client: disconnected from log server at \"%s\"\n", pClient->name);
}
if (level>1) {
printf ("log client: sock=%s, connect cycles = %u\n",
pClient->sock==INVALID_SOCKET?"INVALID":"OK",
pClient->connectCount);
}
if (logClientPrefix) {
printf ("log client: prefix is \"%s\"\n", logClientPrefix);
}
}
/*
* logClientSendMessage (); deprecated
*/
void logClientSendMessage ( logClientId id, const char * message )
{
if ( !iocLogDisable ) {
logClientSend (id, message);
if (level>0) {
printf ("log client: sock %s, connect cycles = %u\n",
pClient->sock==INVALID_SOCKET?"INVALID":"OK",
pClient->connectCount);
}
if (level>1) {
printf ("log client: %u bytes in buffer\n", pClient->nextMsgIndex);
if (pClient->nextMsgIndex)
printf("-------------------------\n"
"%.*s-------------------------\n",
(int)(pClient->nextMsgIndex), pClient->msgBuf);
}
}

View File

@@ -38,7 +38,6 @@ epicsShareFunc void epicsShareAPI iocLogPrefix(const char* prefix);
/* deprecated interface; retained for backward compatibility */
/* note: implementations are in iocLog.c, not logClient.c */
epicsShareFunc logClientId epicsShareAPI logClientInit (void);
epicsShareFunc void logClientSendMessage (logClientId id, const char *message);
#ifdef __cplusplus
}

View File

@@ -568,6 +568,186 @@ static MAC_ENTRY *create( MAC_HANDLE *handle, const char *name, int special )
return entry;
}
#define SUCCESS 0
#define NOVALUE 1
#define UNTERMINATED 2
#define DIVZERO 3
static int parseExpr( const char** pp, int* v, int level );
/* Value is a number or an expression in () */
static int parseValue( const char** pp, int* v )
{
int status;
int val;
const char *p = *pp;
int neg = 0;
while (isspace((unsigned char)*p)) p++;
if (*p == '+' || *p == '-') neg = *p++ == '-';
while (isspace((unsigned char)*p)) p++;
if (*p == '(')
{
p++;
if ((status = parseExpr(&p, &val, 0)) != SUCCESS) return status;
if (*p++ != ')')
{
printf("macLib: missing ) after '%s'\n", *pp);
return UNTERMINATED;
}
}
else
{
char* e;
val = strtol(p, &e, 0);
if (e == p) return NOVALUE;
p = e;
}
if (neg) val = -val;
*pp = p;
*v = val;
return SUCCESS;
}
/* Expr is a sum or product of Values or a conditional */
static int parseExpr( const char** pp, int* v, int level )
{
const char *p = *pp;
int o = 0;
int val0, val1, val2;
int status = SUCCESS;
int stat1, stat2;
val0 = 0;
/* handle sums and differences */
do {
if ((stat1 = parseValue(&p, &val1)) != SUCCESS)
{
if (o && stat1 == NOVALUE)
printf ("macLib: missing operand after '%c'\n", o);
return stat1;
}
while (isspace((unsigned char)*p)) p++;
o = *p;
/* handle products and quotients */
while (o == '*' || o == '/' || o == '%')
{
p++;
if ((stat2 = parseValue(&p, &val2)) != SUCCESS)
{
if (stat2 == NOVALUE)
printf ("macLib: missing operand after '%c'\n", o);
return stat2;
}
if (o == '*') val1 *= val2;
else if (val2 == 0)
{
status = DIVZERO;
val1 = 1;
}
else if (o == '/') val1 /= val2;
else val1 %= val2;
while (isspace((unsigned char)*p)) p++;
o = *p;
}
val0 += val1;
} while (o == '+' || o == '-');
/* handle comparisons */
o = *p;
if (o == '<' || o == '>')
{
p++;
if ((stat1 = parseExpr(&p, &val1, 1)) != SUCCESS)
{
if (stat1 == NOVALUE)
printf ("macLib: missing expression after '%c'\n", o);
return stat1;
}
if (o == '<')
val0 = (val0 < val1);
else
val0 = (val0 > val1);
}
/* handle conditionals */
if (*p == '?' && level == 0)
{
p++;
while (isspace((unsigned char)*p)) p++;
if (*p != ':')
{
stat1 = parseExpr(&p, &val1, 0);
}
else
{
val1 = val0;
stat1 = status;
}
if (*p != ':')
{
printf("macLib: missing : after '%s'\n", *pp);
return UNTERMINATED;
}
p++;
stat2 = parseExpr(&p, &val2, 0);
status = val0 ? stat1 : stat2;
val0 = val0 ? val1 : val2;
}
*v = val0;
*pp = p;
return status;
}
static MAC_ENTRY *evalExpr( MAC_HANDLE *handle, const char *expr )
{
MAC_ENTRY *entry = NULL;
int status;
const char* p = expr;
int value;
char valuestr[40];
char format[20] = "%d";
while (isspace((unsigned char)*p)) p++;
if (*p == '%')
{
int i = 1;
p++;
while (i < sizeof(format) && strchr(" #-+0", *p))
format[i++] = *p++;
while (i < sizeof(format) && strchr("0123456789", *p))
format[i++] = *p++;
if (i < sizeof(format) && strchr("diouxXc", *p))
{
format[i++] = *p++;
format[i] = 0;
}
else
return NULL;
}
status = parseExpr(&p, &value, 0);
if (status == DIVZERO)
printf ("macLib: division by zero\n");
if (status != SUCCESS)
return NULL;
while (isspace((unsigned char)*p)) p++;
if (*p)
{
printf("macLib: rubbish at end of expression: %s\n", p);
return NULL;
}
sprintf(valuestr, format, value);
entry = create( handle, expr, TRUE );
if ( entry )
{
entry->type = "calculation";
if ( rawval( handle, entry, valuestr ) == NULL )
return NULL;
}
return entry;
}
/*
* Look up macro entry with matching "special" attribute by name
*/
@@ -579,6 +759,10 @@ static MAC_ENTRY *lookup( MAC_HANDLE *handle, const char *name, int special )
printf( "lookup-> level = %d, name = %s, special = %d\n",
handle->level, name, special );
if ( (special == FALSE) ) {
entry = evalExpr( handle, name );
if (entry) return entry;
}
/* search backwards so scoping works */
for ( entry = last( handle ); entry != NULL; entry = previous( entry ) ) {
if ( entry->special != special )
@@ -698,6 +882,7 @@ static void trans( MAC_HANDLE *handle, MAC_ENTRY *entry, int level,
/* return immediately if raw value is NULL */
if ( *rawval == NULL ) return;
/* discard quotes and escapes if level is > 0 (i.e. if these aren't
the user's quotes and escapes) */
discard = ( level > 0 );

View File

@@ -350,7 +350,12 @@ static void unsolicitedHandlerEPICS(int vectorNumber)
);
}
#endif /* defined(__PPC__) && defined(mpc750) */
#else /* !defined(__PPC__) && !defined(__mcf528x__) */
/* No known VME interface here, provide a dummy */
devLibVME *pdevLibVME;
#endif /* defined(__PPC__) || defined(__mcf528x__) */
/*
* Some vxWorks convenience routines

View File

@@ -904,11 +904,13 @@ epicsShareFunc void epicsShareAPI *epicsThreadPrivateGet(epicsThreadPrivateId id
epicsShareFunc double epicsShareAPI epicsThreadSleepQuantum ()
{
double hz;
hz = sysconf ( _SC_CLK_TCK );
if(hz<=0)
return 0.0;
return 1.0 / hz;
#ifdef CLOCK_REALTIME
struct timespec res;
if (clock_getres(CLOCK_REALTIME, &res) == 0)
return res.tv_sec + 1e-9 * res.tv_nsec;
else
#endif
return 1e-3;
}
epicsShareFunc int epicsThreadGetCPUs(void)

View File

@@ -247,8 +247,8 @@ testHarness_SRCS += epicsRunLibComTests.c
libComTestHarness_SRCS += $(testHarness_SRCS)
libComTestHarness_SRCS_RTEMS += rtemsTestHarness.c
PROD_vxWorks = libComTestHarness
PROD_RTEMS += libComTestHarness
TESTPROD_vxWorks = libComTestHarness
TESTPROD_RTEMS += libComTestHarness
TESTSPEC_vxWorks = libComTestHarness.munch; epicsRunLibComTests
TESTSPEC_RTEMS = libComTestHarness.boot; epicsRunLibComTests

View File

@@ -8,6 +8,8 @@
#include "epicsUnitTest.h"
#include "testMain.h"
using namespace epics::atomic;
namespace {
template < class T >
@@ -52,7 +54,7 @@ static void add ( void *arg )
using epics::atomic::increment;
TestDataAddSub < T > * const pTestData =
reinterpret_cast < TestDataAddSub < T > * > ( arg );
add ( pTestData->m_testValue, TestDataAddSub < T > :: delta );
epics::atomic::add ( pTestData->m_testValue, TestDataAddSub < T > :: delta );
increment ( pTestData->m_testIterations );
}

1
modules/pcas Submodule

Submodule modules/pcas added at 49c4882f73