Compare commits
147 Commits
R7.0.1-pre
...
R3.15.6-rc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b319b4722f | ||
|
|
b4cc5fdf4b | ||
|
|
d35835659c | ||
|
|
cbb13bf6b1 | ||
|
|
150d764d28 | ||
|
|
7dd1ea4cab | ||
|
|
922ed30136 | ||
|
|
9f9f119e7e | ||
|
|
d8214a4531 | ||
|
|
120b100e7e | ||
|
|
949e9d788a | ||
|
|
27c6e6a385 | ||
|
|
4b59476170 | ||
|
|
526b565c6b | ||
|
|
1b7b2bcceb | ||
|
|
49c925d064 | ||
|
|
6a2ed4b333 | ||
|
|
d3bcf5737f | ||
|
|
6c5505ad3e | ||
|
|
4247d98b08 | ||
|
|
13735a8088 | ||
|
|
58d4242b68 | ||
|
|
8e42f516b0 | ||
|
|
9051cdbb34 | ||
|
|
8ffea9de27 | ||
|
|
2548a37267 | ||
|
|
1dc1b25aaa | ||
|
|
fb31dd784b | ||
|
|
fe7260e263 | ||
|
|
67e2b74758 | ||
|
|
c09b6e2f1b | ||
|
|
45be2306bd | ||
|
|
6027f906c3 | ||
|
|
ec351c5e2f | ||
| 89870e2817 | |||
| 4e9cf72d71 | |||
| 80869a0868 | |||
| 998fa984ba | |||
| 31844af88e | |||
| 8f161f9463 | |||
| e0399478ad | |||
|
|
2a2a1e54ac | ||
|
|
20d2cff501 | ||
|
|
860ce156a2 | ||
|
|
0f21196670 | ||
|
|
31fc35fbe8 | ||
|
|
f892731b3f | ||
| ab493264b2 | |||
| 68779943eb | |||
| 7a5ff26984 | |||
| eae59183cc | |||
|
|
8144d2ea01 | ||
|
|
b32629c3bf | ||
|
|
220e404203 | ||
|
|
8f55a1307d | ||
|
|
e459e8bdd4 | ||
|
|
b558bd9b16 | ||
|
|
3c16c3c0da | ||
|
|
a9d7f7be13 | ||
|
|
23c4eb42a3 | ||
|
|
6d7f70f200 | ||
|
|
67844bacc3 | ||
|
|
7e7d230d8c | ||
|
|
c1ece40f41 | ||
|
|
a732539eee | ||
|
|
3bc0805a89 | ||
|
|
c72e35c769 | ||
|
|
2d9c5e99a1 | ||
|
|
ca22d50831 | ||
|
|
4972803ce2 | ||
|
|
3b7e348a8c | ||
|
|
00a974ce52 | ||
|
|
490c504736 | ||
|
|
49371cfe00 | ||
|
|
06ad4a0d70 | ||
|
|
a2ae07dfcd | ||
|
|
b539ced6d5 | ||
|
|
1b332361e7 | ||
|
|
5cb91d9f6d | ||
|
|
116c90c2ea | ||
|
|
3f3696fb91 | ||
|
|
91ce807e8b | ||
|
|
3d88316eab | ||
|
|
b9443f8813 | ||
|
|
d8802c8b24 | ||
|
|
b7d4609e57 | ||
|
|
7b5b23f6d3 | ||
|
|
c8a7e1597d | ||
|
|
8333338f99 | ||
|
|
ceaff61c09 | ||
|
|
2307e94d1c | ||
|
|
05a3699b49 | ||
|
|
be8f35d782 | ||
|
|
6cc623a7b4 | ||
| 2b4a9632b7 | |||
| 396cf4ee3f | |||
|
|
a9764c8f62 | ||
|
|
98d9ea4545 | ||
|
|
8eb4eec7d2 | ||
|
|
98930eebc4 | ||
| e50c468512 | |||
|
|
c18b6f2ccf | ||
|
|
e41f8bf518 | ||
|
|
ae548d3400 | ||
| 428a8f57e9 | |||
| 29795656e6 | |||
| b2d6b67b06 | |||
| 1e9826d187 | |||
| 0691fc5f57 | |||
| 8a3080c16f | |||
| d19afc73af | |||
| adf5375616 | |||
|
|
550beeab9f | ||
|
|
bf91275200 | ||
|
|
ac4d5c95ac | ||
| 7d836d9554 | |||
| 51e492fbb1 | |||
|
|
61296b8cff | ||
|
|
de442e9584 | ||
|
|
ac367398b3 | ||
|
|
713c2d5080 | ||
|
|
af07016464 | ||
|
|
734d16291f | ||
|
|
f1e5e9689b | ||
|
|
1454f42a27 | ||
|
|
ddbdcf9462 | ||
|
|
729e6fda4d | ||
|
|
0315e90e6e | ||
|
|
66c6aaa44f | ||
|
|
c830a3a4ee | ||
|
|
8766ce05aa | ||
|
|
8f62940265 | ||
|
|
8a1477ecab | ||
|
|
89cbb95c2c | ||
|
|
006ce1a240 | ||
|
|
276dee2c3e | ||
|
|
98a2871727 | ||
|
|
5ca1bb3bd5 | ||
|
|
f6be3c7f70 | ||
|
|
00924dcba0 | ||
|
|
3b0f34e0be | ||
|
|
db005ac3fe | ||
|
|
0f0deb8903 | ||
|
|
baf997193e | ||
|
|
5278799575 | ||
|
|
e794639e31 | ||
|
|
2af98c33c9 |
2
README
2
README
@@ -20,5 +20,5 @@ Additional information about EPICS including mailing list
|
||||
archives and subscription instructions, documentation and
|
||||
training materials, additional components, links to other
|
||||
websites etc. is available on the EPICS home page at
|
||||
http://www.aps.anl.gov/epics/
|
||||
https://epics.anl.gov/
|
||||
|
||||
|
||||
@@ -40,11 +40,12 @@ configuration:
|
||||
# Environment variables: compiler toolchain
|
||||
environment:
|
||||
matrix:
|
||||
- TOOLCHAIN: 9.0
|
||||
- TOOLCHAIN: 10.0
|
||||
- TOOLCHAIN: 11.0
|
||||
- TOOLCHAIN: 12.0
|
||||
- TOOLCHAIN: 14.0
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
TOOLCHAIN: 2017
|
||||
- TOOLCHAIN: cygwin
|
||||
- TOOLCHAIN: mingw
|
||||
|
||||
@@ -57,8 +58,6 @@ platform:
|
||||
matrix:
|
||||
exclude:
|
||||
# VS Express installs don't have the 64 bit compiler
|
||||
- platform: x64
|
||||
TOOLCHAIN: 9.0
|
||||
- platform: x64
|
||||
TOOLCHAIN: 10.0
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
:: Universal build script for AppVeyor (https://ci.appveyor.com/)
|
||||
:: Environment:
|
||||
:: TOOLCHAIN - toolchain version [9.0/10.0/11.0/12.0/14.0/cygwin/mingw]
|
||||
:: TOOLCHAIN - toolchain version [10.0/11.0/12.0/14.0/2017/cygwin/mingw]
|
||||
:: CONFIGURATION - determines EPICS build [dynamic/static]
|
||||
:: PLATFORM - architecture [x86/x64]
|
||||
::
|
||||
@@ -57,10 +57,22 @@ if "%TOOLCHAIN%"=="mingw" (
|
||||
)
|
||||
|
||||
set "VSINSTALL=C:\Program Files (x86)\Microsoft Visual Studio %TOOLCHAIN%"
|
||||
if not exist "%VSINSTALL%\" set "VSINSTALL=C:\Program Files (x86)\Microsoft Visual Studio\%TOOLCHAIN%\Community"
|
||||
if not exist "%VSINSTALL%\" goto MSMissing
|
||||
|
||||
set "MAKE=C:\tools\make"
|
||||
|
||||
echo [INFO] APPVEYOR_BUILD_WORKER_IMAGE=%APPVEYOR_BUILD_WORKER_IMAGE%
|
||||
|
||||
if "%OS%"=="64BIT" (
|
||||
set EPICS_HOST_ARCH=windows-x64%ST%
|
||||
:: VS 2017
|
||||
if exist "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" (
|
||||
call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat"
|
||||
where cl
|
||||
if !ERRORLEVEL! NEQ 0 goto MSMissing
|
||||
goto MSFound
|
||||
)
|
||||
if exist "%VSINSTALL%\VC\vcvarsall.bat" (
|
||||
call "%VSINSTALL%\VC\vcvarsall.bat" amd64
|
||||
where cl
|
||||
@@ -79,12 +91,19 @@ if "%OS%"=="64BIT" (
|
||||
)
|
||||
) else (
|
||||
set EPICS_HOST_ARCH=win32-x86%ST%
|
||||
:: VS 2017
|
||||
if exist "%VSINSTALL%\VC\Auxiliary\Build\vcvars32.bat" (
|
||||
call "%VSINSTALL%\VC\Auxiliary\Build\vcvars32.bat"
|
||||
where cl
|
||||
if !ERRORLEVEL! NEQ 0 goto MSMissing
|
||||
goto MSFound
|
||||
)
|
||||
if exist "%VSINSTALL%\VC\vcvarsall.bat" (
|
||||
call "%VSINSTALL%\VC\vcvarsall.bat" x86
|
||||
where cl
|
||||
if !ERRORLEVEL! NEQ 0 goto MSMissing
|
||||
goto MSFound
|
||||
)
|
||||
)
|
||||
if exist "%VSINSTALL%\VC\bin\vcvars32.bat" (
|
||||
call "%VSINSTALL%\VC\bin\vcvars32.bat"
|
||||
where cl
|
||||
|
||||
@@ -65,6 +65,6 @@ if "%TOOLCHAIN%"=="mingw" (
|
||||
)
|
||||
|
||||
echo [INFO] Installing Make 4.1
|
||||
@powershell -Command "(new-object net.webclient).DownloadFile('https://www.aps.anl.gov/epics/download/tools/make-4.1-win64.zip', 'C:\tools\make-4.1.zip')"
|
||||
curl -fsS --retry 3 -o C:\tools\make-4.1.zip https://epics.anl.gov/download/tools/make-4.1-win64.zip
|
||||
cd \tools
|
||||
"C:\Program Files\7-Zip\7z" e make-4.1.zip
|
||||
|
||||
@@ -17,7 +17,7 @@ ticker() {
|
||||
|
||||
CACHEKEY=1
|
||||
|
||||
EPICS_HOST_ARCH=`sh startup/EpicsHostArch`
|
||||
EPICS_HOST_ARCH=`perl src/tools/EpicsHostArch.pl`
|
||||
|
||||
[ -e configure/os/CONFIG_SITE.Common.linux-x86 ] || die "Wrong location: $PWD"
|
||||
|
||||
|
||||
@@ -20,11 +20,15 @@ else
|
||||
endif
|
||||
|
||||
# Provide a default if the user hasn't set EPICS_HOST_ARCH
|
||||
ifeq ($(origin EPICS_HOST_ARCH), undefined)
|
||||
# NB: We use a simply expanded variable here for performance:
|
||||
EPICS_HOST_ARCH := $(shell $(CONFIG)/../startup/EpicsHostArch.pl)
|
||||
endif
|
||||
#
|
||||
ifeq ($(origin EPICS_HOST_ARCH), undefined)
|
||||
# Bootstrapping ...
|
||||
EHA := $(firstword $(wildcard $(EPICS_BASE)/lib/perl/EpicsHostArch.pl \
|
||||
$(TOP)/src/tools/EpicsHostArch.pl))
|
||||
# NB: We use a simply expanded variable here for performance:
|
||||
export EPICS_HOST_ARCH := $(shell perl $(EHA))
|
||||
EHA :=
|
||||
endif
|
||||
|
||||
-include $(CONFIG)/RELEASE
|
||||
-include $(CONFIG)/RELEASE.$(EPICS_HOST_ARCH)
|
||||
|
||||
@@ -27,19 +27,19 @@ EPICS_VERSION = 3
|
||||
EPICS_REVISION = 15
|
||||
|
||||
# EPICS_MODIFICATION must be a number >=0 and <256
|
||||
EPICS_MODIFICATION = 5
|
||||
EPICS_MODIFICATION = 6
|
||||
|
||||
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
|
||||
# Not included if zero
|
||||
EPICS_PATCH_LEVEL = 0
|
||||
|
||||
# This will end in -DEV between official releases
|
||||
EPICS_DEV_SNAPSHOT=-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-pre1
|
||||
#EPICS_DEV_SNAPSHOT=-pre1-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-pre2
|
||||
#EPICS_DEV_SNAPSHOT=-pre2-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-rc1
|
||||
EPICS_DEV_SNAPSHOT=-rc1
|
||||
#EPICS_DEV_SNAPSHOT=-rc1-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-rc2
|
||||
#EPICS_DEV_SNAPSHOT=-rc2-DEV
|
||||
|
||||
@@ -34,35 +34,30 @@
|
||||
# The future dates below assume the rules don't get changed;
|
||||
# see http://www.timeanddate.com/time/dst/2018.html to check.
|
||||
#
|
||||
# DST for 2017 US: Mar 12 - Nov 05
|
||||
# EU: Mar 26 - Oct 29
|
||||
EPICS_TIMEZONE = CUS::360:031202:110502
|
||||
#EPICS_TIMEZONE = MET::-60:032602:102902
|
||||
#
|
||||
# DST for 2018 US: Mar 11 - Nov 04
|
||||
# EU: Mar 25 - Oct 28
|
||||
#EPICS_TIMEZONE = CUS::360:031102:110402
|
||||
#EPICS_TIMEZONE = MET::-60:032502:102802
|
||||
EPICS_TIMEZONE = CUS::360:031102:110402
|
||||
#EPICS_TIMEZONE = MET::-60:032502:102803
|
||||
#
|
||||
# DST for 2019 US: Mar 10 - Nov 03
|
||||
# EU: Mar 31 - Oct 27
|
||||
#EPICS_TIMEZONE = CUS::360:031002:110302
|
||||
#EPICS_TIMEZONE = MET::-60:033102:102702
|
||||
#EPICS_TIMEZONE = MET::-60:033102:102703
|
||||
#
|
||||
# DST for 2020 US: Mar 08 - Nov 01
|
||||
# EU: Mar 29 - Oct 25
|
||||
#EPICS_TIMEZONE = CUS::360:030802:110102
|
||||
#EPICS_TIMEZONE = MET::-60:032902:102502
|
||||
#EPICS_TIMEZONE = MET::-60:032902:102503
|
||||
#
|
||||
# DST for 2021 US: Mar 14 - Nov 07
|
||||
# EU: Mar 28 - Oct 31
|
||||
#EPICS_TIMEZONE = CUS::360:031402:110702
|
||||
#EPICS_TIMEZONE = MET::-60:032802:103102
|
||||
#EPICS_TIMEZONE = MET::-60:032802:103103
|
||||
#
|
||||
# DST for 2022 US: Mar 13 - Nov 06
|
||||
# EU: Mar 27 - Oct 30
|
||||
#EPICS_TIMEZONE = CUS::360:031302:110602
|
||||
#EPICS_TIMEZONE = MET::-60:032702:103002
|
||||
#EPICS_TIMEZONE = MET::-60:032702:103003
|
||||
|
||||
# EPICS_TS_NTP_INET
|
||||
# NTP time server ip address for VxWorks and RTEMS.
|
||||
|
||||
@@ -102,6 +102,7 @@ endif
|
||||
# Products and Object libraries
|
||||
#
|
||||
PRODTARGETS += $(PRODNAME) $(MUNCHNAME) $(CTDT_SRCS) $(CTDT_OBJS) $(NMS)
|
||||
TESTPRODTARGETS += $(TESTPRODNAME) $(TESTMUNCHNAME)
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Test specifications and test result files
|
||||
@@ -140,7 +141,7 @@ rebuild: clean install
|
||||
|
||||
build: inc
|
||||
|
||||
build: $(OBJSNAME) $(LIBTARGETS) $(PRODTARGETS) $(TESTPRODNAME) \
|
||||
build: $(OBJSNAME) $(LIBTARGETS) $(PRODTARGETS) $(TESTPRODTARGETS) \
|
||||
$(TARGETS) $(TESTSCRIPTS) $(INSTALL_LIB_INSTALLS)
|
||||
|
||||
inc : $(COMMON_INC) $(INSTALL_INC) $(INSTALL_CONFIGS)
|
||||
@@ -158,20 +159,21 @@ clean: build_clean
|
||||
|
||||
build_clean:
|
||||
$(ECHO) "Cleaning"
|
||||
@$(RM) *.i *$(OBJ) *.a $(TESTPRODNAME) \
|
||||
@$(RM) *.i *$(OBJ) *.a \
|
||||
$(LIBNAME) $(TESTLIBNAME) $(SHRLIBNAME) $(TESTSHRLIBNAME) \
|
||||
$(DLLSTUB_LIBNAME) $(TESTDLLSTUB_LIBNAME) \
|
||||
$(LOADABLE_SHRLIBNAME) \
|
||||
$(INC) $(TARGETS) $(TDS) $(CLEANS) \
|
||||
*.out MakefileInclude *.manifest *.exp \
|
||||
$(COMMON_INC) $(HDEPENDS_FILES) $(PRODTARGETS) \
|
||||
$(COMMON_INC) $(HDEPENDS_FILES) $(PRODTARGETS) $(TESTPRODTARGETS) \
|
||||
$(TESTSCRIPTS) $(TAPFILES) $(JUNITFILES)
|
||||
ifdef RES
|
||||
@$(RM) *$(RES)
|
||||
endif
|
||||
|
||||
$(DIRECTORY_TARGETS) :
|
||||
$(MKDIR) -p $@
|
||||
# Sort mkdir targets to remove duplicates & make parents first
|
||||
$(DIRECTORY_TARGETS):
|
||||
$(MKDIR) $(sort $@)
|
||||
|
||||
# Install LIB_INSTALLS libraries before linking executables
|
||||
$(TESTPRODNAME) $(PRODNAME): | $(INSTALL_LIB_INSTALLS)
|
||||
@@ -254,15 +256,13 @@ YACCOPT ?= $($*_YACCOPT)
|
||||
$(MV) $*.tab.c $*.c
|
||||
$(if $(findstring -d, $(YACCOPT)),$(MV) $*.tab.h $*.h,)
|
||||
|
||||
# must be a seperate rule since when not using '-d' the
|
||||
# must be a separate rule since when not using '-d' the
|
||||
# prefix for .h will be different then .c
|
||||
%.h : %.c %.y
|
||||
|
||||
%.c: %.l
|
||||
@$(RM) $*.yy.c
|
||||
$(LEX) $(LEXOPT) -t $< > $*.yy.c
|
||||
@$(RM) $@
|
||||
$(MV) $*.yy.c $@
|
||||
$(LEX) $(LEXOPT) -o$@ $<
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Libraries, shared/DLL and stubs
|
||||
@@ -321,6 +321,10 @@ $(MUNCHNAME): %$(MUNCH_SUFFIX): $(MUNCH_DEPENDS) %$(EXE)
|
||||
@$(RM) $@
|
||||
$(MUNCH_CMD)
|
||||
|
||||
$(TESTMUNCHNAME): %$(MUNCH_SUFFIX): $(MUNCH_DEPENDS) %$(EXE)
|
||||
@$(RM) $@
|
||||
$(MUNCH_CMD)
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# GeSys modules for RTEMS
|
||||
$(MODNAME): %$(MODEXT): %$(EXE)
|
||||
|
||||
@@ -38,6 +38,17 @@ $(foreach target, $(PROD) $(TESTPROD), \
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
# These must be done before PROD2_template
|
||||
define TESTLIBRARY_template
|
||||
$(1)_DIR = .
|
||||
TESTBUILD_LIBRARY += $$(if $$(strip $$($(1)_OBJSNAME) $$(LIBRARY_OBJS)),$(1),)
|
||||
endef
|
||||
|
||||
$(foreach target, $(TESTLIBRARY), \
|
||||
$(eval $(call TESTLIBRARY_template,$(strip $(target)))))
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
define TARGET2_template
|
||||
$(1)_LDLIBS += $$($(1)_LIBS)
|
||||
$(1)_LDLIBS += $$(if $$(strip $$($(1)_LIBS_$(OS_CLASS))), \
|
||||
@@ -123,16 +134,6 @@ $(foreach target, $(LIBRARY), \
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
define LIBRARY3_template
|
||||
$(1)_DIR = .
|
||||
TESTBUILD_LIBRARY += $$(if $$(strip $$($(1)_OBJSNAME) $$(LIBRARY_OBJS)),$(1),)
|
||||
endef
|
||||
|
||||
$(foreach target, $(TESTLIBRARY), \
|
||||
$(eval $(call LIBRARY3_template,$(strip $(target)))))
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
define LOADABLE_LIBRARY_template
|
||||
LOADABLE_BUILD_LIBRARY += $$(if $$(strip $$($(1)_OBJSNAME) $$(LIBRARY_OBJS)),$(1),)
|
||||
|
||||
|
||||
@@ -136,6 +136,13 @@ MOD_LDFLAGS = $(OPT_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(POSIX_LDFLAGS) \
|
||||
LINK.mod = $(CCC) -o $@ $(PRODDIR_LDFLAGS) $(MOD_LDFLAGS)
|
||||
LINK.mod += $(PROD_LDFLAGS) $(PROD_LD_OBJS) $(PROD_LD_RESS) $(MOD_LDLIBS)
|
||||
|
||||
#--------------------------------------------------
|
||||
# Here munching means creating a bootable object binary
|
||||
ifdef MUNCH_SUFFIX
|
||||
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
TESTMUNCHNAME = $(TESTPRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
endif
|
||||
|
||||
#--------------------------------------------------
|
||||
# RTEMS has neither shared libraries nor dynamic loading
|
||||
STATIC_BUILD=YES
|
||||
|
||||
@@ -15,7 +15,6 @@ ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120
|
||||
OP_SYS_LDLIBS += -lbspExt
|
||||
|
||||
MUNCH_SUFFIX = .boot
|
||||
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
define MUNCH_CMD
|
||||
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
|
||||
endef
|
||||
|
||||
@@ -13,7 +13,6 @@ ARCH_DEP_CFLAGS += -DHAVE_PPCBUG
|
||||
OP_SYS_LDLIBS += -lbspExt
|
||||
|
||||
MUNCH_SUFFIX = .boot
|
||||
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
define MUNCH_CMD
|
||||
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< rtems
|
||||
gzip -f9 rtems
|
||||
|
||||
@@ -7,7 +7,6 @@ ARCH_DEP_CFLAGS += -DHAVE_PPCBUG
|
||||
ARCH_DEP_CFLAGS += -DNVRAM_INDIRECT
|
||||
|
||||
MUNCH_SUFFIX = .boot
|
||||
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
define MUNCH_CMD
|
||||
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< rtems
|
||||
gzip -f9 rtems
|
||||
|
||||
@@ -15,7 +15,6 @@ ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120
|
||||
OP_SYS_LDLIBS += -lbspExt
|
||||
|
||||
MUNCH_SUFFIX = .boot
|
||||
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
define MUNCH_CMD
|
||||
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
|
||||
endef
|
||||
|
||||
@@ -16,7 +16,6 @@ ARCH_DEP_CFLAGS += -DBSP_NVRAM_BASE_ADDR=0xf1110000
|
||||
OP_SYS_LDLIBS += -lbspExt
|
||||
|
||||
MUNCH_SUFFIX = .boot
|
||||
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
define MUNCH_CMD
|
||||
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
|
||||
endef
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
RTEMS_TARGET_CPU=i386
|
||||
|
||||
MUNCH_SUFFIX = .boot
|
||||
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
define MUNCH_CMD
|
||||
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< temp.bin
|
||||
$(BIN2BOOT) $@ 0x00097E00 \
|
||||
|
||||
@@ -9,7 +9,6 @@ RTEMS_TARGET_CPU = m68k
|
||||
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
|
||||
|
||||
MUNCH_SUFFIX = .boot
|
||||
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
define MUNCH_CMD
|
||||
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< $@
|
||||
endef
|
||||
|
||||
@@ -65,14 +65,14 @@ GNU = NO
|
||||
#
|
||||
# Darwin shared libraries
|
||||
#
|
||||
SHRLIB_LDFLAGS = -dynamiclib -flat_namespace -undefined suppress \
|
||||
SHRLIB_LDFLAGS = -dynamiclib -undefined dynamic_lookup \
|
||||
-install_name $(shell $(FULLPATHNAME) $(INSTALL_LIB))/$@ \
|
||||
$(addprefix -compatibility_version , $(SHRLIB_VERSION)) \
|
||||
$(addprefix -current_version , $(SHRLIB_VERSION))
|
||||
SHRLIB_SUFFIX_BASE = .dylib
|
||||
SHRLIB_SUFFIX = $(addprefix ., $(SHRLIB_VERSION))$(SHRLIB_SUFFIX_BASE)
|
||||
|
||||
LOADABLE_SHRLIB_LDFLAGS = -bundle -flat_namespace -undefined suppress
|
||||
LOADABLE_SHRLIB_LDFLAGS = -bundle -undefined dynamic_lookup
|
||||
|
||||
#
|
||||
# Position-independent code is the default on Darwin.
|
||||
|
||||
@@ -79,16 +79,20 @@ CPP = cl -nologo -C -E
|
||||
|
||||
# Configure OS vendor C++ compiler
|
||||
#
|
||||
# __STDC__=0 gives us both:
|
||||
# 1) define STDC for code (pretend ANSI conformance)
|
||||
# 2) set it to 0 to use MS C "extensions" (open for _open etc.)
|
||||
# because MS uses: if __STDC__ ... disable many nice things
|
||||
#
|
||||
# -EHsc - generate code for exceptions
|
||||
# -GR - generate code for run time type identification
|
||||
#
|
||||
CCC = cl -EHsc -GR
|
||||
CODE_CPPFLAGS += -nologo -D__STDC__=0
|
||||
|
||||
# Other compiler flags, used for CPP, C and C++
|
||||
#
|
||||
# -FC - Show absolute path of source file in diagnostics
|
||||
# -D__STDC__=0 gives us both:
|
||||
# 1) define STDC for code (pretend ANSI conformance)
|
||||
# 2) set it to 0 to use MS C "extensions" (open for _open etc.)
|
||||
# because MS uses: if __STDC__ ... disable many nice things
|
||||
#
|
||||
CODE_CPPFLAGS += -nologo -FC -D__STDC__=0
|
||||
CODE_CPPFLAGS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
|
||||
|
||||
|
||||
@@ -136,6 +140,16 @@ STATIC_LDLIBS_NO=
|
||||
STATIC_LDFLAGS=
|
||||
RANLIB=
|
||||
|
||||
#
|
||||
# option needed for parallel builds with Visual Studio 2015 onward
|
||||
#
|
||||
# -FS Force Synchronous PDB Writes
|
||||
ifneq ($(VisualStudioVersion),)
|
||||
OPT_CXXFLAGS_NO += -FS
|
||||
OPT_CFLAGS_NO += -FS
|
||||
endif
|
||||
|
||||
|
||||
#
|
||||
# add -profile here to run the ms profiler
|
||||
# -LTCG whole program optimization
|
||||
|
||||
@@ -15,7 +15,7 @@ base-3.15.6 tree. Download them, then use the GNU Patch program as
|
||||
follows:</p>
|
||||
|
||||
<blockquote><pre>% <b>cd <i>/path/to/</i>base-3.15.6</b>
|
||||
% <b>patch -p0 < <i>/path/to/</i>file.patch</b></pre></blockquote>
|
||||
% <b>patch -p1 < <i>/path/to/</i>file.patch</b></pre></blockquote>
|
||||
|
||||
<p>The following significant problems have been reported with this
|
||||
version of EPICS Base:</p>
|
||||
|
||||
@@ -6,19 +6,19 @@
|
||||
|
||||
Table of Contents
|
||||
|
||||
* What is EPICS base?
|
||||
* What is new in this release?
|
||||
* Copyright
|
||||
* Supported platforms
|
||||
* Supported compilers
|
||||
* Software requirements
|
||||
* Host system storage requirements
|
||||
* Documentation
|
||||
* Directory Structure
|
||||
* Build related components
|
||||
* Building EPICS base (Unix and Win32)
|
||||
* Example application and extension
|
||||
* Multiple host platforms
|
||||
* What is EPICS base?
|
||||
* What is new in this release?
|
||||
* Copyright
|
||||
* Supported platforms
|
||||
* Supported compilers
|
||||
* Software requirements
|
||||
* Host system storage requirements
|
||||
* Documentation
|
||||
* Directory Structure
|
||||
* Build related components
|
||||
* Building EPICS base (Unix and Win32)
|
||||
* Example application and extension
|
||||
* Multiple host platforms
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
@@ -166,12 +166,11 @@
|
||||
|
||||
base/startup directory - contains scripts to set environment and path
|
||||
|
||||
EpicsHostArch C shell script to set EPICS_HOST_ARCH env variable
|
||||
EpicsHostArch.pl Perl script to set EPICS_HOST_ARCH env variable
|
||||
Site.profile bourne shell script to set path and env variables
|
||||
Site.cshrc c shell script to set path and env variables
|
||||
cygwin.bat WIN32 bat file to set cygwin path and env variables
|
||||
win32.bat WIN32 bat file to set path and env variables
|
||||
EpicsHostArch Shell script to set EPICS_HOST_ARCH env variable
|
||||
unix.csh C shell script to set path and env variables
|
||||
unix.sh Bourne shell script to set path and env variables
|
||||
win32.bat Bat file example to configure win32-x86 target
|
||||
windows.bat Bat file example to configure windows-x64 target
|
||||
|
||||
base/configure directory - contains build definitions and rules
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ of my Bash login script (~/.bash_login):
|
||||
#
|
||||
EPICS_BASE="${HOME}/src/EPICS/base"
|
||||
EPICS_EXTENSIONS="${HOME}/src/EPICS/extensions"
|
||||
<strong>.</strong> "${EPICS_BASE}"/startup/Site.profile
|
||||
<strong>.</strong> "${EPICS_BASE}"/startup/unix.sh
|
||||
</pre>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
@@ -98,8 +98,8 @@
|
||||
base/configure/os/CONFIG_SITE.Common.vxWorksCommon file or in one of its
|
||||
target-specific overrides.</P>
|
||||
|
||||
<P>Consult the <a href="http://www.aps.anl.gov/epics/base/tornado.php">vxWorks
|
||||
5.x</a> or <a href="http://www.aps.anl.gov/epics/base/vxWorks6.php">vxWorks
|
||||
<P>Consult the <a href="https://epics.anl.gov/base/tornado.php">vxWorks
|
||||
5.x</a> or <a href="https://epics.anl.gov/base/vxWorks6.php">vxWorks
|
||||
6.x</a> EPICS web pages about and the vxWorks documentation for information
|
||||
about configuring your vxWorks operating system for use with EPICS.</P>
|
||||
|
||||
@@ -129,7 +129,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.
|
||||
<a href="https://epics.anl.gov/">EPICS website</a> at Argonne.
|
||||
<P>Release specific documentation can also be found in the base/documentation
|
||||
directory of the distribution.</BLOCKQUOTE>
|
||||
|
||||
@@ -177,12 +177,11 @@
|
||||
|
||||
<H4>base/startup directory - contains scripts to set environment and path</H4>
|
||||
<PRE>
|
||||
EpicsHostArch C shell script to set EPICS_HOST_ARCH env variable
|
||||
EpicsHostArch.pl Perl script to set EPICS_HOST_ARCH env variable
|
||||
Site.profile bourne shell script to set path and env variables
|
||||
Site.cshrc c shell script to set path and env variables
|
||||
cygwin.bat WIN32 bat file to set cygwin path and env variables
|
||||
win32.bat WIN32 bat file to set path and env variables
|
||||
EpicsHostArch Shell script to set EPICS_HOST_ARCH env variable
|
||||
unix.csh C shell script to set path and env variables
|
||||
unix.sh Bourne shell script to set path and env variables
|
||||
win32.bat Bat file example to configure win32-x86 target
|
||||
windows.bat Bat file example to configure windows-x64 target
|
||||
</PRE>
|
||||
|
||||
<H4>base/configure directory - contains build definitions and rules</H4>
|
||||
|
||||
@@ -16,6 +16,50 @@
|
||||
|
||||
<!-- Insert new items immediately below here ... -->
|
||||
|
||||
<h3>Warning indicators in msi (and macLib) output</h3>
|
||||
|
||||
<p>The libCom macro expansion library has been modified so that when the
|
||||
SUPPRESS_WARNINGS flag is set it will no longer include any <tt>,undefined</tt>
|
||||
or <tt>,recursive</tt> indicators in its output when undefined or recursive
|
||||
macros are encountered. These indicators were harmless when the output was fed
|
||||
into an IOC along with a definition for the macro, but when the <tt>msi</tt>
|
||||
tool was used to generate other kinds of files they caused problems. If the
|
||||
<tt>msi -V</tt> flag is used the markers will still be present in the output
|
||||
whenever the appropriate condition is seen.</p>
|
||||
|
||||
<h3>Improvements to msi</h3>
|
||||
|
||||
<p>In addition to fixing its response to discovering parsing errors in its
|
||||
substitution input file (reported as Launchpad
|
||||
<a href="https://bugs.launchpad.net/epics-base/+bug/1503661">bug #1503661</a>)
|
||||
so it now deletes the incomplete output file, the msi program has been cleaned
|
||||
up a little bit internally.</p>
|
||||
|
||||
<h3>All array records now post monitors on their array-length fields</h3>
|
||||
|
||||
<p>The waveform record has been posting monitors on its NORD field since Base
|
||||
3.15.0.1; we finally got around to doing the equivalent in all the other
|
||||
built-in record types, which even required modifying device support in some
|
||||
cases. This fixes <a href="https://bugs.launchpad.net/epics-base/+bug/1730727">
|
||||
Launchpad bug #1730727</a>.</p>
|
||||
|
||||
<h3>HOWTO: Converting Wiki Record Reference to POD</h3>
|
||||
|
||||
<p>Some documentation has been added to the <tt>dbdToHtml.pl</tt> script
|
||||
explaining how Perl POD (Plain Old Documentation) markup can be added to
|
||||
<tt>.dbd</tt> files to generate HTML documentation for the record types. To see
|
||||
these instructions, run <tt>perl bin/<host>/dbdToHtml.pl -H</tt>
|
||||
or <tt>perldoc bin/<host>/dbdToHtml.pl</tt>.</p>
|
||||
|
||||
<h3>Fix problem with numeric soft events</h3>
|
||||
|
||||
<p>Changing from numeric to named soft events introduced an incompatibility
|
||||
when a numeric event 1-255 is converted from a DOUBLE, e.g. from a calc record.
|
||||
The <tt>post_event()</tt> API is not marked deprecated any more.
|
||||
|
||||
<p>Also <code>scanpel</code> has been modified to accept a glob pattern for
|
||||
event name filtering and to show events with no connected records as well.</p>
|
||||
|
||||
<h3>Add osiSockOptMcastLoop_t and osiSockTest</h3>
|
||||
|
||||
<p>Added a new OS-independent typedef for multicast socket options, and a test
|
||||
@@ -34,6 +78,114 @@ tells git to ignore all configure/*.local files.</p>
|
||||
|
||||
<!-- Insert inherited items immediately below here ... -->
|
||||
|
||||
<h3>Fix broken <tt>EPICS_IOC_LOG_FILE_LIMIT=0</tt> setting</h3>
|
||||
|
||||
<p>The Application Developers' Guide says this is allowed and disables the
|
||||
limit on the log-file, but it hasn't actually worked for some time (if ever).
|
||||
Note that the iocLogServer will be removed from newer Base release sometime
|
||||
soon as its functionality can be implemented by other dedicated log servers
|
||||
such as logstash or syslog-ng.</p>
|
||||
|
||||
<p>Fixes <a href="https://bugs.launchpad.net/bugs/1786858">lp:1786858</a>
|
||||
and part of <a href="https://bugs.launchpad.net/bugs/1786966">lp:1786966</a>.
|
||||
</p>
|
||||
|
||||
<h3>Cleanup of startup directory</h3>
|
||||
|
||||
<p>The files in the startup directory have not been maintained in recent years
|
||||
and have grown crufty (technical term). This release includes the following
|
||||
updates to these files:</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>The Perl <tt>EpicsHostArch.pl</tt> script has been rewritten, and support
|
||||
for a few previously missing host architectures has been added to it.</li>
|
||||
|
||||
<li>The <tt>EpicsHostArch.pl</tt> script has also been moved into the standard
|
||||
<tt>src/tools</tt> directory, from where it will be installed into
|
||||
<tt>lib/perl</tt>. In this new location it is no longer executable, so it must
|
||||
be run by the <tt>perl</tt> executable.</li>
|
||||
|
||||
<li>The build system has been adjusted to look for <tt>EpicsHostArch.pl</tt> in
|
||||
both places if the <tt>EPICS_HOST_ARCH</tt> environment variable has not been
|
||||
set at build-time.</li>
|
||||
|
||||
<li>Sites that used the original Perl script to set <tt>EPICS_HOST_ARCH</tt> as
|
||||
part of their standard environment will need to adjust their scripts when they
|
||||
upgrade to this release.</li>
|
||||
|
||||
<li>The <tt>EpicsHostArch</tt> shell script has been replaced with a wrapper
|
||||
routine that calls the Perl <tt>EpicsHostArch.pl</tt> script. Sites that rely on
|
||||
this script to set <tt>EPICS_HOST_ARCH</tt> should consider switching to the
|
||||
Perl script instead.</li>
|
||||
|
||||
<li>The <tt>Site.cshrc</tt> and <tt>Site.profile</tt> files have been renamed to
|
||||
<tt>unix.csh</tt> and <tt>unix.sh</tt>, respectively.</li>
|
||||
|
||||
<li>The existing <tt>win32.bat</tt> file has been cleaned up and a new
|
||||
<tt>windows.bat</tt> file added for 64-bit targets. The contents of these files
|
||||
should be seen as examples, don't uncomment or install parts for software that
|
||||
you don't explicitly know that you need.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h3>Recent Apple XCode Build Issues</h3>
|
||||
|
||||
<p>The latest version of XCode will not compile calls to <tt>system()</tt> or
|
||||
<tt>clock_settime()</tt> for iOS targets. There were several places in Base
|
||||
where these were being compiled, although there were probably never called. The
|
||||
code has now been modified to permit iOS builds to complete again.</p>
|
||||
|
||||
<h3>Prevent illegal alarm severities</h3>
|
||||
|
||||
<p>A check has been added to <tt>recGblResetAlarms()</tt> that prevents records
|
||||
from getting an alarm severity higher than INVALID_ALARM. It is still possible
|
||||
for a field like HSV to get set to a value that is not a legal alarm severity,
|
||||
but the core IOC code should never copy such a value into a record's SEVR or
|
||||
ACKS fields. With this fix the record's alarm severity will be limited to
|
||||
INVALID_ALARM.</p>
|
||||
|
||||
<h3>Fixes for Launchpad bugs</h3>
|
||||
|
||||
<p>The following launchpad bugs have fixes included:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1786320">
|
||||
lp: #1786320</a>, dbCa subscribes twice to ENUM</li>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/541221">
|
||||
lp: #541221</a>, 'assert (pca->pgetNative)' failed in ../dbCa.c</li>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1747091">
|
||||
lp: #1747091</a>, epicsTimeGetEvent() / generalTime bug</li>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1743076">
|
||||
lp: #1743076</a>, Segfault in ca_attach_context() during exits</li>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1751380">
|
||||
lp: #1751380</a>, Deadlock in ca_clear_subscription()</li>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1597809">
|
||||
lp: #1597809</a>, Setting NAME field in DB file may break IOC</li>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1770292">
|
||||
lp: #1770292</a>, get_alarm_double() inconsistent across record types</li>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1771298">
|
||||
lp: #1771298</a>, Conversion of NaN to integer relies on undefined
|
||||
behavior</li>
|
||||
</ul>
|
||||
|
||||
<h3>Updated VxWorks Timezone settings</h3>
|
||||
|
||||
<p>Removed the settings for 2017; fixed the hour of the change for MET.</p>
|
||||
|
||||
<h3>Fixed camonitor server side relative timestamps bug</h3>
|
||||
|
||||
<p>Initialize the first time-stamp from the first monitor, not the client-side
|
||||
current time in this configuration.</p>
|
||||
|
||||
<h3>Build changes for MSVC</h3>
|
||||
|
||||
<p>Windows builds using Visual Studio 2015 and later now use the <tt>-FS</tt>
|
||||
compiler option to allow parallel builds to work properly.</p>
|
||||
|
||||
<p>We now give the <tt>-FC</tt> option to tell the compiler to print absolute
|
||||
paths for source files in diagnostic messages.</p>
|
||||
|
||||
<h3>Extend maximum Posix epicsEventWaitWithTimeout() delay</h3>
|
||||
|
||||
<p>The Posix implementation of epicsEventWaitWithTimeout() was limiting the
|
||||
|
||||
@@ -91,7 +91,7 @@ relevent roles unless the Release Manager designates otherwise:</p>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>Release Manager</td>
|
||||
<td>Set the Feature Freeze date, by which time all Bazaar commits for
|
||||
<td>Set the Feature Freeze date, by which time all Git commits for
|
||||
enhancements and new functionality should have been completed. After
|
||||
this date, commits should only be made to fix problems that show up
|
||||
during testing.</td>
|
||||
@@ -133,7 +133,7 @@ relevent roles unless the Release Manager designates otherwise:</p>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>Release Manager</td>
|
||||
<td>Tag the module in Bazaar, using these tag conventions:
|
||||
<td>Tag the module in Git, using these tag conventions:
|
||||
<ul>
|
||||
<li>
|
||||
<tt>R3.15.6-pre1</tt>
|
||||
@@ -145,23 +145,20 @@ relevent roles unless the Release Manager designates otherwise:</p>
|
||||
</li>
|
||||
</ul>
|
||||
<blockquote><tt>
|
||||
cd ~/base/mirror-3.15<br />
|
||||
bzr tag R3.15.6-rc1
|
||||
cd base-3.15<br />
|
||||
git tag -m 'RL: Tagged for 3.15.6-rc1' R3.15.6-rc1
|
||||
</tt></blockquote>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>Release Manager</td>
|
||||
<td>Export the tagged version into a tarfile. Note that this command
|
||||
generates a gzipped tarfile directly from the repository:
|
||||
<td>Export the tagged version into a tarfile. The <tt>make-tar.sh</tt>
|
||||
script generates a gzipped tarfile directly from the tag, excluding the
|
||||
files and directories that are only used for continuous integration:
|
||||
<blockquote><tt>
|
||||
cd ~/base<br />
|
||||
bzr export
|
||||
--root=base-3.15.6-rc1
|
||||
-r tag:R3.15.6-rc1
|
||||
base-3.15.6-rc1.tar.gz
|
||||
mirror-3.15
|
||||
cd base-3.15<br />
|
||||
git archive --prefix=base-3.15.6-rc1/ R3.15.6-rc1 --output=base-3.15.6-rc1.tar.gz
|
||||
</tt></blockquote>
|
||||
Create a GPG signature file of the tarfile as follows:
|
||||
<blockquote><tt>
|
||||
@@ -274,10 +271,10 @@ relevent roles unless the Release Manager designates otherwise:</p>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>Release Manager</td>
|
||||
<td>Tag the module in Bazaar:
|
||||
<td>Tag the module in Git:
|
||||
<blockquote><tt>
|
||||
cd ~/base/mirror-3.15<br />
|
||||
bzr tag R3.15.6</i>
|
||||
cd base-3.15<br />
|
||||
git tag -m 'RL: Tagged for 3.15.6' R3.15.6
|
||||
</tt></blockquote>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -287,12 +284,8 @@ relevent roles unless the Release Manager designates otherwise:</p>
|
||||
<td>Export the tagged version into a tarfile. Note that this command
|
||||
generates a gzipped tarfile directly from the repository:
|
||||
<blockquote><tt>
|
||||
cd ~/base<br />
|
||||
bzr export
|
||||
--root=base-3.15.6
|
||||
-r tag:R3.15.6
|
||||
base-3.15.6.tar.gz
|
||||
mirror-3.15
|
||||
cd base-3.15<br />
|
||||
git archive --prefix=base-3.15.6/ R3.15.6 --output=base-3.15.6.tar.gz
|
||||
</tt></blockquote>
|
||||
Create a GPG signature file of the tarfile as follows:
|
||||
<blockquote><tt>
|
||||
|
||||
@@ -1009,7 +1009,7 @@ d:/user/epics/base-3.15/lib/win32-x86/Com.lib</code></p>
|
||||
<h2><a name="CommandUtils">Command Line Utilities</a></h2>
|
||||
|
||||
<h3><a name="acctst">acctst</a></h3>
|
||||
<pre>acctst <PV name> [progress logging level] [channel duplication count]
|
||||
<pre>acctst <PV name> [progress logging level] [channel duplication count]
|
||||
[test repetition count] [enable preemptive callback]</pre>
|
||||
|
||||
<h4>Description</h4>
|
||||
@@ -2079,7 +2079,7 @@ example, be beneficial when tuning an archiver installation.</p>
|
||||
<p>Significant performance gains can be realized when the CA client library
|
||||
doesn't wait for a response to return from the server after each request. All
|
||||
requests which require interaction with a CA server are accumulated (buffered)
|
||||
and not forwarded to the IOC until one of <code>ca_flush_io()</code>,
|
||||
and not forwarded to the IOC until one of <code>ca_flush_io()</code>,
|
||||
<code>ca_pend_io()</code>, <code>ca_pend_event()</code>, or
|
||||
<code>ca_sg_block()</code> are called allowing several operations to be
|
||||
efficiently sent over the network together. Any process variable values written
|
||||
@@ -2103,16 +2103,16 @@ shouldn't test the success of a CA function call by checking to see if the
|
||||
returned value is zero as is the UNIX convention. Below are several methods to
|
||||
test CA function returns. See <a href="#ca_signal"><code>ca_signal()</code> and
|
||||
<code>SEVCHK()</code></a> for more information on this topic.</p>
|
||||
<pre>status = ca_XXXX();
|
||||
SEVCHK( status, "ca_XXXX() returned failure status");
|
||||
<pre>status = ca_XXXX();
|
||||
SEVCHK( status, "ca_XXXX() returned failure status");
|
||||
|
||||
if ( status & CA_M_SUCCESS ) {
|
||||
printf ( "The requested ca_XXXX() operation didn't complete successfully");
|
||||
}
|
||||
if ( status & CA_M_SUCCESS ) {
|
||||
printf ( "The requested ca_XXXX() operation didn't complete successfully");
|
||||
}
|
||||
|
||||
if ( status != ECA_NORMAL ) {
|
||||
if ( status != ECA_NORMAL ) {
|
||||
printf("The requested ca_XXXX() operation didn't complete successfully because \"%s\"\n",
|
||||
ca_message ( status ) );
|
||||
ca_message ( status ) );
|
||||
}</pre>
|
||||
|
||||
<h3><a name="Channel">Channel Access Data Types</a></h3>
|
||||
@@ -2285,7 +2285,7 @@ int main ( int argc, char ** argv )
|
||||
unsigned nBytes;
|
||||
unsigned elementCount;
|
||||
char timeString[32];
|
||||
unsigned i;
|
||||
unsigned i;
|
||||
chid chan;
|
||||
double sum;
|
||||
int status;
|
||||
@@ -2328,7 +2328,7 @@ int main ( int argc, char ** argv )
|
||||
epicsTimeToStrftime ( timeString, sizeof ( timeString ),
|
||||
"%a %b %d %Y %H:%M:%S.%f", & pTD->stamp );
|
||||
|
||||
printf ( "The sum of elements in %s at %s was %f\n",
|
||||
printf ( "The sum of elements in %s at %s was %f\n",
|
||||
argv[1], timeString, sum );
|
||||
|
||||
ca_clear_channel ( chan );
|
||||
@@ -2359,7 +2359,7 @@ executing within the user's callback function.</p>
|
||||
<pre>typedef struct event_handler_args {
|
||||
void *usr; /* user argument supplied with request */
|
||||
chanId chid; /* channel id */
|
||||
long type; /* the type of the item returned */
|
||||
long type; /* the type of the item returned */
|
||||
long count; /* the element count of the item returned */
|
||||
const void *dbr; /* a pointer to the item returned */
|
||||
int status; /* ECA_XXX status of the requested op from the server */
|
||||
@@ -2382,7 +2382,7 @@ attached to the request, an exception handler is executed in the client. The
|
||||
default exception handler prints a message on the console and exits if the
|
||||
exception condition is severe. Certain internal exceptions within the CA client
|
||||
library, and failures detected by the SEVCHK macro may also cause the exception
|
||||
handler to be invoked. To modify this behavior see
|
||||
handler to be invoked. To modify this behavior see
|
||||
<code><a href="#ca_add_exception_event">ca_add_exception_event</a>()</code>.</p>
|
||||
|
||||
<h3><a name="Server">Server and Client Share the Same Address Space on The Same
|
||||
@@ -2674,6 +2674,14 @@ automatically released by the system when the process exits and
|
||||
vxWorks or RTEMS no cleanup occurs unless the application calls
|
||||
<code>ca_context_destroy()</code>.</p>
|
||||
|
||||
<p>Note: This operation blocks until any user callbacks for any channel
|
||||
created in the current context have run to completion. If callbacks take a
|
||||
lock (mutex) then it is the user's responsibility to ensure that this lock
|
||||
is not held when <code>ca_clear_context()</code> is called, otherwise a
|
||||
deadlock may ensue. (See also
|
||||
<code><a href="#ca_clear_channel">ca_clear_channel</a>()</code> and
|
||||
<code><a href="#ca_clear_event">ca_clear_subscription</a>()</code>.)</p>
|
||||
|
||||
<h4>Returns</h4>
|
||||
|
||||
<p>ECA_NORMAL - Normal successful completion</p>
|
||||
@@ -2819,6 +2827,12 @@ efficiently sent over the network in one message.</p>
|
||||
clearing a channel does shutdown and reclaim any channel state change event
|
||||
subscriptions (monitors) registered with the channel.</p>
|
||||
|
||||
<p>Note: This operation blocks until any user callbacks for this channel
|
||||
have run to completion. If callbacks take a lock (mutex) then it is the
|
||||
user's responsibility to ensure that this lock is not held when
|
||||
<code>ca_clear_channel()</code> is called, otherwise a deadlock may ensue.
|
||||
(See also <code><a href="#ca_clear_event">ca_clear_subscription</a>()</code>.)</p>
|
||||
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt><code>CHID</code></dt>
|
||||
@@ -2833,16 +2847,16 @@ subscriptions (monitors) registered with the channel.</p>
|
||||
|
||||
<h3><code><a name="ca_put">ca_put()</a></code></h3>
|
||||
<pre>#include <cadef.h>
|
||||
int ca_put ( chtype TYPE,
|
||||
chid CHID, void *PVALUE );
|
||||
int ca_array_put ( chtype TYPE, unsigned long COUNT,
|
||||
int ca_put ( chtype TYPE,
|
||||
chid CHID, void *PVALUE );
|
||||
int ca_array_put ( chtype TYPE, unsigned long COUNT,
|
||||
chid CHID, const void *PVALUE);
|
||||
typedef void ( caEventCallBackFunc ) (struct event_handler_args);
|
||||
int ca_put_callback ( chtype TYPE,
|
||||
chid CHID, const void *PVALUE,
|
||||
caEventCallBackFunc PFUNC, void *USERARG );
|
||||
int ca_array_put_callback ( chtype TYPE, unsigned long COUNT,
|
||||
chid CHID, const void *PVALUE,
|
||||
int ca_put_callback ( chtype TYPE,
|
||||
chid CHID, const void *PVALUE,
|
||||
caEventCallBackFunc PFUNC, void *USERARG );
|
||||
int ca_array_put_callback ( chtype TYPE, unsigned long COUNT,
|
||||
chid CHID, const void *PVALUE,
|
||||
caEventCallBackFunc PFUNC, void *USERARG );</pre>
|
||||
|
||||
<h4>Description</h4>
|
||||
@@ -3069,7 +3083,7 @@ when a CA get request is initiated.</p>
|
||||
typedef void ( caEventCallBackFunc ) (struct event_handler_args);
|
||||
int ca_create_subscription ( chtype TYPE, unsigned long COUNT,
|
||||
chid CHID, unsigned long MASK,
|
||||
caEventCallBackFunc USERFUNC, void *USERARG,
|
||||
caEventCallBackFunc USERFUNC, void *USERARG,
|
||||
evid *PEVID );</pre>
|
||||
|
||||
<h4>Description</h4>
|
||||
@@ -3153,7 +3167,7 @@ indicating the current state of the channel.</p>
|
||||
<dt><code>MASK</code></dt>
|
||||
<dd>A mask with bits set for each of the event trigger types requested. The
|
||||
event trigger mask must be a <em>bitwise or</em> of one or more of the
|
||||
following constants.
|
||||
following constants.
|
||||
<ul>
|
||||
<li>DBE_VALUE - Trigger events when the channel value exceeds the
|
||||
monitor dead band</li>
|
||||
@@ -3200,6 +3214,13 @@ and not forwarded to the server until one of <code>ca_flush_io()</code>, <code>c
|
||||
<code>ca_pend_event()</code>, or <code>ca_sg_block()</code> are called. This allows several requests to be
|
||||
efficiently sent together in one message.</p>
|
||||
|
||||
<p>Note: This operation blocks until any user callbacks for this channel
|
||||
have run to completion. If callbacks take a lock (mutex) then it is the
|
||||
user's responsibility to ensure that this lock is not held when
|
||||
<code>ca_clear_subscription()</code> is called, otherwise a deadlock may
|
||||
ensue. (See also <code><a
|
||||
href="#ca_clear_channel">ca_clear_channel</a>()</code>.)</p>
|
||||
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>EVID</dt>
|
||||
@@ -3364,7 +3385,7 @@ becomes full.</p>
|
||||
|
||||
<h3><code><a name="ca_signal">ca_signal()</a></code></h3>
|
||||
<pre>#include <cadef.h>
|
||||
int ca_signal ( long CA_STATUS, const char * CONTEXT_STRING );
|
||||
int ca_signal ( long CA_STATUS, const char * CONTEXT_STRING );
|
||||
void SEVCHK( CA_STATUS, CONTEXT_STRING );</pre>
|
||||
|
||||
<h4>Description</h4>
|
||||
@@ -3381,7 +3402,7 @@ recommended error handler for simple applications which do not wish to write
|
||||
code testing the status returned from each channel access call.</p>
|
||||
|
||||
<h4>Examples</h4>
|
||||
<pre>status = ca_context_create (...);
|
||||
<pre>status = ca_context_create (...);
|
||||
SEVCHK ( status, "Unable to create a CA client context" );</pre>
|
||||
|
||||
<p>If the application only wishes to print the message associated with an error
|
||||
@@ -3405,7 +3426,7 @@ this purpose.</p>
|
||||
|
||||
<h3><code><a
|
||||
name="ca_add_exception_event">ca_add_exception_event()</a></code></h3>
|
||||
<pre>#include <cadef.h>
|
||||
<pre>#include <cadef.h>
|
||||
typedef void (*pCallback) ( struct exception_handler_args HANDLERARGS );
|
||||
int ca_add_exception_event ( pCallback USERFUNC, void *USERARG );</pre>
|
||||
|
||||
@@ -3614,7 +3635,7 @@ specified channel.</p>
|
||||
<dt><code>PFUNC</code></dt>
|
||||
<dd>Pointer to a user supplied callback function. A null pointer uninstalls
|
||||
the current handler. The following arguments are passed <em>by value</em>
|
||||
to the supplied callback handler.
|
||||
to the supplied callback handler.
|
||||
<pre>typedef struct ca_access_rights {
|
||||
unsigned read_access:1;
|
||||
unsigned write_access:1;
|
||||
@@ -3954,8 +3975,8 @@ type.</p>
|
||||
prints diagnostics to standard out.</p>
|
||||
|
||||
<h4>Examples</h4>
|
||||
<pre>void ca_test_event ();
|
||||
status = ca_create_subscription ( type, chid, ca_test_event, NULL, NULL );
|
||||
<pre>void ca_test_event ();
|
||||
status = ca_create_subscription ( type, chid, ca_test_event, NULL, NULL );
|
||||
SEVCHK ( status, .... );</pre>
|
||||
|
||||
<h4>See Also</h4>
|
||||
@@ -3989,8 +4010,8 @@ outstanding within them at any given time.</p>
|
||||
</dl>
|
||||
|
||||
<h4>Examples</h4>
|
||||
<pre>CA_SYNC_GID gid;
|
||||
status = ca_sg_create ( &gid );
|
||||
<pre>CA_SYNC_GID gid;
|
||||
status = ca_sg_create ( &gid );
|
||||
SEVCHK ( status, Sync group create failed );</pre>
|
||||
|
||||
<h4>Returns</h4>
|
||||
@@ -4028,8 +4049,8 @@ int ca_sg_delete ( CA_SYNC_GID GID );</pre>
|
||||
</dl>
|
||||
|
||||
<h4>Examples</h4>
|
||||
<pre>CA_SYNC_GID gid;
|
||||
status = ca_sg_delete ( gid );
|
||||
<pre>CA_SYNC_GID gid;
|
||||
status = ca_sg_delete ( gid );
|
||||
SEVCHK ( status, Sync group delete failed );</pre>
|
||||
|
||||
<h4>Returns</h4>
|
||||
@@ -4140,7 +4161,7 @@ will not block unless additional subsequent requests are made.</p>
|
||||
</dl>
|
||||
|
||||
<h4>Examples</h4>
|
||||
<pre>CA_SYNC_GID gid;
|
||||
<pre>CA_SYNC_GID gid;
|
||||
status = ca_sg_reset(gid);</pre>
|
||||
|
||||
<h4>Returns</h4>
|
||||
@@ -4153,7 +4174,7 @@ status = ca_sg_reset(gid);</pre>
|
||||
<pre>#include <cadef.h>
|
||||
int ca_sg_put ( CA_SYNC_GID GID, chtype TYPE,
|
||||
chid CHID, void *PVALUE );
|
||||
int ca_sg_array_put ( CA_SYNC_GID GID, chtype TYPE,
|
||||
int ca_sg_array_put ( CA_SYNC_GID GID, chtype TYPE,
|
||||
unsigned long COUNT, chid CHID, void *PVALUE );</pre>
|
||||
|
||||
<p>Write a value, or array of values, to a channel and increment the outstanding
|
||||
@@ -4294,7 +4315,7 @@ reissued.</p>
|
||||
|
||||
<h3><code><a name="ca_client_status">ca_client_status()</a></code></h3>
|
||||
<pre>int ca_client_status ( unsigned level );
|
||||
int ca_context_status ( struct ca_client_context *CONTEXT,
|
||||
int ca_context_status ( struct ca_client_context *CONTEXT,
|
||||
unsigned LEVEL );</pre>
|
||||
|
||||
<h4>Description</h4>
|
||||
|
||||
@@ -127,21 +127,10 @@ const char * ca_message_text []
|
||||
|
||||
static epicsThreadOnceId caClientContextIdOnce = EPICS_THREAD_ONCE_INIT;
|
||||
|
||||
extern "C" void ca_client_exit_handler (void *)
|
||||
{
|
||||
if ( caClientContextId ) {
|
||||
epicsThreadPrivateDelete ( caClientContextId );
|
||||
caClientContextId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// runs once only for each process
|
||||
extern "C" void ca_init_client_context ( void * )
|
||||
{
|
||||
caClientContextId = epicsThreadPrivateCreate ();
|
||||
if ( caClientContextId ) {
|
||||
epicsAtExit ( ca_client_exit_handler,0 );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -390,7 +390,7 @@ int epicsShareAPI ca_array_get_callback ( chtype type,
|
||||
{
|
||||
caStatus = ECA_ALLOCMEM;
|
||||
}
|
||||
catch ( cacChannel::msgBodyCacheTooSmall ) {
|
||||
catch ( cacChannel::msgBodyCacheTooSmall & ) {
|
||||
caStatus = ECA_TOLARGE;
|
||||
}
|
||||
catch ( ... )
|
||||
|
||||
@@ -652,7 +652,7 @@ not follow this pattern, but are still printable strings.
|
||||
|
||||
=item [1] R3.15 Channel Access Reference Manual by Jeffrey O. Hill
|
||||
|
||||
L<http://www.aps.anl.gov/epics/base/R3-15/2-docs/CAref.html>
|
||||
L<https://epics.anl.gov/base/R3-15/5-docs/CAref.html>
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ Cap5_LIBS = ca Com
|
||||
Cap5_INCLUDES = -I$(shell $(PERL) ../perlConfig.pl archlib)/CORE
|
||||
Cap5_CFLAGS = $(shell $(PERL) ../perlConfig.pl ccflags)
|
||||
|
||||
CLEANS += Cap5.c pod2htmd.tmp pod2htmi.tmp
|
||||
CLEANS += Cap5.c
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
|
||||
|
||||
@@ -140,6 +140,10 @@ sub display {
|
||||
printf " Lo ctrl limit: %g\n", $data->{lower_ctrl_limit};
|
||||
printf " Hi ctrl limit: %g\n", $data->{upper_ctrl_limit};
|
||||
}
|
||||
if (exists $data->{ackt}) {
|
||||
printf " Ack transients: %s\n", $data->{ackt} ? 'YES' : 'NO';
|
||||
printf " Ack severity: %s\n", $data->{acks};
|
||||
}
|
||||
} else {
|
||||
my $value = format_number($data, $type);
|
||||
if ($opt_t) {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Copyright (c) 2002 Berliner Elektronenspeicherringgesellschaft fuer
|
||||
* Synchrotronstrahlung.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
@@ -419,7 +419,7 @@ int main (int argc, char *argv[])
|
||||
if (argc > optind+1) {
|
||||
for (i = optind + 1; i < argc; i++) {
|
||||
strcat(cbuf, " ");
|
||||
strcat(cbuf, argv[i]);
|
||||
strcat(cbuf, argv[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -530,6 +530,11 @@ int main (int argc, char *argv[])
|
||||
/* Use standard put with defined timeout */
|
||||
result = ca_array_put (dbrType, count, pvs[0].chid, pbuf);
|
||||
}
|
||||
if (result != ECA_NORMAL) {
|
||||
fprintf(stderr, "Error from put operation: %s\n", ca_message(result));
|
||||
return 1;
|
||||
}
|
||||
|
||||
result = ca_pend_io(caTimeout);
|
||||
if (result == ECA_TIMEOUT) {
|
||||
fprintf(stderr, "Write operation timed out: Data was not written.\n");
|
||||
@@ -545,7 +550,7 @@ int main (int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (result != ECA_NORMAL) {
|
||||
fprintf(stderr, "Error occured writing data.\n");
|
||||
fprintf(stderr, "Error occured writing data: %s\n", ca_message(result));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -414,6 +414,12 @@ char *dbr2str (const void *value, unsigned type)
|
||||
ptsNewS = &((struct TYPE *)value)->stamp; \
|
||||
ptsNewC = &tsNow; \
|
||||
\
|
||||
if (!tsInitS) \
|
||||
{ \
|
||||
tsFirst = *ptsNewS; \
|
||||
tsInitS = 1; \
|
||||
} \
|
||||
\
|
||||
switch (tsType) { \
|
||||
case relative: \
|
||||
ptsRefC = &tsStart; \
|
||||
@@ -506,12 +512,6 @@ void print_time_val_sts (pv* pv, unsigned long reqElems)
|
||||
epicsTimeGetCurrent(&tsNow);
|
||||
epicsTimeToStrftime(timeText, TIMETEXTLEN, timeFormatStr, &tsNow);
|
||||
|
||||
if (!tsInitS)
|
||||
{
|
||||
tsFirst = tsNow;
|
||||
tsInitS = 1;
|
||||
}
|
||||
|
||||
if (pv->nElems <= 1 && fieldSeparator == ' ') printf("%-30s", pv->name);
|
||||
else printf("%s", pv->name);
|
||||
printf("%c", fieldSeparator);
|
||||
|
||||
@@ -644,6 +644,11 @@ caStatus casDGClient::processDG ()
|
||||
if ( status != S_cas_success ) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ( this->in.bytesPresent () > 0 && dgInBytesConsumed == 0 && status == S_cas_success ) {
|
||||
this->in.removeMsg ( this->in.bytesPresent() );
|
||||
}
|
||||
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
* Author Jeffrey O. Hill
|
||||
@@ -26,33 +26,39 @@
|
||||
#include "casAsyncIOI.h"
|
||||
#include "casMonitor.h"
|
||||
|
||||
casPVI::casPVI ( casPV & intf ) :
|
||||
pCAS ( NULL ), pPV ( & intf ), nMonAttached ( 0u ),
|
||||
|
||||
// Use casErrMessage instead of errMessage to show PV name
|
||||
#define casErrMessage(S, PM) \
|
||||
errPrintf(S, __FILE__, __LINE__, ", %s, %s", getName(), PM)
|
||||
|
||||
casPVI::casPVI ( casPV & intf ) :
|
||||
pCAS ( NULL ), pPV ( & intf ), nMonAttached ( 0u ),
|
||||
nIOAttached ( 0u ), deletePending ( false ) {}
|
||||
|
||||
casPVI::~casPVI ()
|
||||
{
|
||||
//
|
||||
// all channels should have been destroyed
|
||||
// (otherwise the server tool is yanking the
|
||||
//
|
||||
// all channels should have been destroyed
|
||||
// (otherwise the server tool is yanking the
|
||||
// PV out from under the server)
|
||||
//
|
||||
casVerify ( this->chanList.count() == 0u );
|
||||
//
|
||||
casVerify ( this->chanList.count() == 0u );
|
||||
|
||||
//
|
||||
// all outstanding IO should have been deleted
|
||||
// when we destroyed the channels
|
||||
//
|
||||
casVerify ( this->nIOAttached == 0u );
|
||||
//
|
||||
// all outstanding IO should have been deleted
|
||||
// when we destroyed the channels
|
||||
//
|
||||
casVerify ( this->nIOAttached == 0u );
|
||||
if ( this->nIOAttached ) {
|
||||
errlogPrintf ( "The number of IO objected attached is %u\n", this->nIOAttached );
|
||||
errlogPrintf ( "%u IO objects still attached in destructor\n",
|
||||
this->nIOAttached );
|
||||
}
|
||||
|
||||
//
|
||||
// all monitors should have been deleted
|
||||
// when we destroyed the channels
|
||||
//
|
||||
casVerify ( this->nMonAttached == 0u );
|
||||
//
|
||||
// all monitors should have been deleted
|
||||
// when we destroyed the channels
|
||||
//
|
||||
casVerify ( this->nMonAttached == 0u );
|
||||
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
@@ -139,26 +145,26 @@ caStatus casPVI::attachToServer ( caServerI & cas )
|
||||
caStatus casPVI::updateEnumStringTable ( casCtx & ctxIn )
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
|
||||
|
||||
//
|
||||
// create a gdd with the "enum string table" application type
|
||||
//
|
||||
// gddArray(int app, aitEnum prim, int dimen, ...);
|
||||
gdd * pTmp = new gddScalar ( gddAppType_enums );
|
||||
if ( pTmp == NULL ) {
|
||||
errMessage ( S_cas_noMemory,
|
||||
casErrMessage ( S_cas_noMemory,
|
||||
"unable to create gdd for read of application type \"enums\" string"
|
||||
" conversion table for enumerated PV" );
|
||||
return S_cas_noMemory;
|
||||
}
|
||||
|
||||
caStatus status = convertContainerMemberToAtomic ( *pTmp,
|
||||
caStatus status = convertContainerMemberToAtomic ( *pTmp,
|
||||
gddAppType_enums, MAX_ENUM_STATES );
|
||||
if ( status != S_cas_success ) {
|
||||
pTmp->unreference ();
|
||||
errMessage ( status,
|
||||
"unable to to config gdd for read of application type \"enums\" string"
|
||||
" conversion table for enumerated PV");
|
||||
casErrMessage ( status,
|
||||
"unable to config gdd for read of application type \"enums\" string"
|
||||
" conversion table for enumerated PV" );
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -169,12 +175,11 @@ caStatus casPVI::updateEnumStringTable ( casCtx & ctxIn )
|
||||
if ( status == S_cas_success ) {
|
||||
updateEnumStringTableAsyncCompletion ( *pTmp );
|
||||
}
|
||||
else if ( status != S_casApp_asyncCompletion &&
|
||||
else if ( status != S_casApp_asyncCompletion &&
|
||||
status != S_casApp_postponeAsyncIO ) {
|
||||
errPrintf ( status, __FILE__, __LINE__,
|
||||
"- unable to read application type \"enums\" "
|
||||
" (string conversion table) from enumerated native type PV \"%s\"",
|
||||
this->getName() );
|
||||
casErrMessage ( status,
|
||||
"unable to read application type \"enums\" "
|
||||
" (string conversion table) from enumerated native type PV" );
|
||||
}
|
||||
|
||||
pTmp->unreference ();
|
||||
@@ -185,40 +190,39 @@ caStatus casPVI::updateEnumStringTable ( casCtx & ctxIn )
|
||||
void casPVI::updateEnumStringTableAsyncCompletion ( const gdd & resp )
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
|
||||
|
||||
if ( resp.isContainer() ) {
|
||||
errMessage ( S_cas_badType,
|
||||
"application type \"enums\" string conversion table for"
|
||||
" enumerated PV was a container (expected vector of strings)" );
|
||||
casErrMessage ( S_cas_badType,
|
||||
"Invalid \"enums\" string conversion table for"
|
||||
" enumerated PV (container instead of vector of strings)" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( resp.dimension() == 0 ) {
|
||||
if ( resp.primitiveType() == aitEnumString ) {
|
||||
aitString *pStr = (aitString *) resp.dataVoid ();
|
||||
if ( ! this->enumStrTbl.setString ( 0, pStr->string() ) ) {
|
||||
errMessage ( S_cas_noMemory,
|
||||
casErrMessage ( S_cas_noMemory,
|
||||
"no memory to set enumerated PV string cache" );
|
||||
}
|
||||
}
|
||||
else if ( resp.primitiveType() == aitEnumFixedString ) {
|
||||
aitFixedString *pStr = (aitFixedString *) resp.dataVoid ();
|
||||
if ( ! this->enumStrTbl.setString ( 0, pStr->fixed_string ) ) {
|
||||
errMessage ( S_cas_noMemory,
|
||||
casErrMessage ( S_cas_noMemory,
|
||||
"no memory to set enumerated PV string cache" );
|
||||
}
|
||||
}
|
||||
else {
|
||||
errPrintf ( S_cas_badType, __FILE__, __LINE__,
|
||||
casErrMessage ( S_cas_badType,
|
||||
"application type \"enums\" string conversion"
|
||||
" table for enumerated PV \"%s\" isnt a string type?",
|
||||
getName() );
|
||||
" table for enumerated PV isnt a string type?" );
|
||||
}
|
||||
}
|
||||
else if ( resp.dimension() == 1 ) {
|
||||
gddStatus gdd_status;
|
||||
aitIndex index, first, count;
|
||||
|
||||
|
||||
gdd_status = resp.getBound ( 0, first, count );
|
||||
assert ( gdd_status == 0 );
|
||||
|
||||
@@ -232,7 +236,7 @@ void casPVI::updateEnumStringTableAsyncCompletion ( const gdd & resp )
|
||||
aitString *pStr = (aitString *) resp.dataVoid ();
|
||||
for ( index = 0; index<count; index++ ) {
|
||||
if ( ! this->enumStrTbl.setString ( index, pStr[index].string() ) ) {
|
||||
errMessage ( S_cas_noMemory,
|
||||
casErrMessage ( S_cas_noMemory,
|
||||
"no memory to set enumerated PV string cache" );
|
||||
}
|
||||
}
|
||||
@@ -241,19 +245,18 @@ void casPVI::updateEnumStringTableAsyncCompletion ( const gdd & resp )
|
||||
aitFixedString *pStr = (aitFixedString *) resp.dataVoid ();
|
||||
for ( index = 0; index < count; index++ ) {
|
||||
if ( ! this->enumStrTbl.setString ( index, pStr[index].fixed_string ) ) {
|
||||
errMessage ( S_cas_noMemory,
|
||||
casErrMessage ( S_cas_noMemory,
|
||||
"no memory to set enumerated PV string cache" );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
errMessage ( S_cas_badType,
|
||||
"application type \"enums\" string conversion"
|
||||
" table for enumerated PV isnt a string type?" );
|
||||
casErrMessage( S_cas_badType,
|
||||
"bad \"enums\" string conversion table for enumerated PV" );
|
||||
}
|
||||
}
|
||||
else {
|
||||
errMessage ( S_cas_badType,
|
||||
casErrMessage ( S_cas_badType,
|
||||
"application type \"enums\" string conversion table"
|
||||
" for enumerated PV was multi-dimensional"
|
||||
" (expected vector of strings)" );
|
||||
@@ -287,7 +290,7 @@ void casPVI::postEvent ( const casEventMask & select, const gdd & event )
|
||||
}
|
||||
}
|
||||
|
||||
caStatus casPVI::installMonitor (
|
||||
caStatus casPVI::installMonitor (
|
||||
casMonitor & mon, tsDLList < casMonitor > & monitorList )
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
@@ -303,14 +306,14 @@ caStatus casPVI::installMonitor (
|
||||
}
|
||||
}
|
||||
|
||||
casMonitor * casPVI::removeMonitor (
|
||||
casMonitor * casPVI::removeMonitor (
|
||||
tsDLList < casMonitor > & list, ca_uint32_t clientIdIn )
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
casMonitor * pMon = 0;
|
||||
//
|
||||
// (it is reasonable to do a linear search here because
|
||||
// sane clients will require only one or two monitors
|
||||
// sane clients will require only one or two monitors
|
||||
// per channel)
|
||||
//
|
||||
tsDLIter < casMonitor > iter = list.firstIter ();
|
||||
@@ -359,9 +362,9 @@ void casPVI::installChannel ( chanIntfForPV & chan )
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
this->chanList.add ( chan );
|
||||
}
|
||||
|
||||
void casPVI::removeChannel (
|
||||
chanIntfForPV & chan, tsDLList < casMonitor > & src,
|
||||
|
||||
void casPVI::removeChannel (
|
||||
chanIntfForPV & chan, tsDLList < casMonitor > & src,
|
||||
tsDLList < casMonitor > & dest )
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
@@ -380,8 +383,8 @@ void casPVI::clearOutstandingReads ( tsDLList < casAsyncIOI > & ioList )
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
|
||||
// cancel any pending asynchronous IO
|
||||
tsDLIter < casAsyncIOI > iterIO =
|
||||
// cancel any pending asynchronous IO
|
||||
tsDLIter < casAsyncIOI > iterIO =
|
||||
ioList.firstIter ();
|
||||
while ( iterIO.valid () ) {
|
||||
tsDLIter < casAsyncIOI > tmp = iterIO;
|
||||
@@ -407,7 +410,7 @@ void casPVI::destroyAllIO ( tsDLList < casAsyncIOI > & ioList )
|
||||
}
|
||||
}
|
||||
|
||||
void casPVI::installIO (
|
||||
void casPVI::installIO (
|
||||
tsDLList < casAsyncIOI > & ioList, casAsyncIOI & io )
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
@@ -416,7 +419,7 @@ void casPVI::installIO (
|
||||
this->nIOAttached++;
|
||||
}
|
||||
|
||||
void casPVI::uninstallIO (
|
||||
void casPVI::uninstallIO (
|
||||
tsDLList < casAsyncIOI > & ioList, casAsyncIOI & io )
|
||||
{
|
||||
{
|
||||
@@ -517,8 +520,8 @@ aitEnum casPVI::bestExternalType () const
|
||||
}
|
||||
}
|
||||
|
||||
// CA only does 1D arrays for now
|
||||
aitIndex casPVI::nativeCount ()
|
||||
// CA only does 1D arrays for now
|
||||
aitIndex casPVI::nativeCount ()
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
if ( this->pPV ) {
|
||||
@@ -542,4 +545,3 @@ const char * casPVI::getName () const
|
||||
return "<disconnected>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "epicsExport.h"
|
||||
#include "link.h"
|
||||
#include "recSup.h"
|
||||
#include "dbUnitTest.h" /* for testSyncCallback() */
|
||||
|
||||
|
||||
static int callbackQueueSize = 2000;
|
||||
@@ -353,3 +354,86 @@ void callbackRequestProcessCallbackDelayed(CALLBACK *pcallback,
|
||||
callbackSetProcess(pcallback, Priority, pRec);
|
||||
callbackRequestDelayed(pcallback, seconds);
|
||||
}
|
||||
|
||||
/* Sync. process of testSyncCallback()
|
||||
*
|
||||
* 1. For each priority, make a call to callbackRequest() for each worker.
|
||||
* 2. Wait until all callbacks are concurrently being executed
|
||||
* 3. Last worker to begin executing signals success and begins waking up other workers
|
||||
* 4. Last worker to wake signals testSyncCallback() to complete
|
||||
*/
|
||||
typedef struct {
|
||||
epicsEventId wait_phase2, wait_phase4;
|
||||
int nphase2, nphase3;
|
||||
epicsCallback cb;
|
||||
} sync_helper;
|
||||
|
||||
static void sync_callback(epicsCallback *cb)
|
||||
{
|
||||
sync_helper *helper;
|
||||
callbackGetUser(helper, cb);
|
||||
|
||||
testGlobalLock();
|
||||
|
||||
assert(helper->nphase2 > 0);
|
||||
if(--helper->nphase2!=0) {
|
||||
/* we are _not_ the last to start. */
|
||||
testGlobalUnlock();
|
||||
epicsEventMustWait(helper->wait_phase2);
|
||||
testGlobalLock();
|
||||
}
|
||||
|
||||
/* we are either the last to start, or have been
|
||||
* woken by the same and must pass the wakeup along
|
||||
*/
|
||||
epicsEventMustTrigger(helper->wait_phase2);
|
||||
|
||||
assert(helper->nphase2 == 0);
|
||||
assert(helper->nphase3 > 0);
|
||||
|
||||
if(--helper->nphase3==0) {
|
||||
/* we are the last to wake up. wake up testSyncCallback() */
|
||||
epicsEventMustTrigger(helper->wait_phase4);
|
||||
}
|
||||
|
||||
testGlobalUnlock();
|
||||
}
|
||||
|
||||
void testSyncCallback(void)
|
||||
{
|
||||
sync_helper helper[NUM_CALLBACK_PRIORITIES];
|
||||
unsigned i;
|
||||
|
||||
testDiag("Begin testSyncCallback()");
|
||||
|
||||
for(i=0; i<NUM_CALLBACK_PRIORITIES; i++) {
|
||||
helper[i].wait_phase2 = epicsEventMustCreate(epicsEventEmpty);
|
||||
helper[i].wait_phase4 = epicsEventMustCreate(epicsEventEmpty);
|
||||
|
||||
/* no real need to lock here, but do so anyway so that valgrind can establish
|
||||
* the locking requirements for sync_helper.
|
||||
*/
|
||||
testGlobalLock();
|
||||
helper[i].nphase2 = helper[i].nphase3 = callbackQueue[i].threadsRunning;
|
||||
testGlobalUnlock();
|
||||
|
||||
callbackSetUser(&helper[i], &helper[i].cb);
|
||||
callbackSetPriority(i, &helper[i].cb);
|
||||
callbackSetCallback(sync_callback, &helper[i].cb);
|
||||
|
||||
callbackRequest(&helper[i].cb);
|
||||
}
|
||||
|
||||
for(i=0; i<NUM_CALLBACK_PRIORITIES; i++) {
|
||||
epicsEventMustWait(helper[i].wait_phase4);
|
||||
}
|
||||
|
||||
for(i=0; i<NUM_CALLBACK_PRIORITIES; i++) {
|
||||
testGlobalLock();
|
||||
epicsEventDestroy(helper[i].wait_phase2);
|
||||
epicsEventDestroy(helper[i].wait_phase4);
|
||||
testGlobalUnlock();
|
||||
}
|
||||
|
||||
testDiag("Complete testSyncCallback()");
|
||||
}
|
||||
|
||||
@@ -42,7 +42,9 @@ typedef struct callbackPvt {
|
||||
int priority;
|
||||
void *user; /*for use by callback user*/
|
||||
void *timer; /*for use by callback itself*/
|
||||
}CALLBACK;
|
||||
}epicsCallback;
|
||||
|
||||
typedef epicsCallback CALLBACK;
|
||||
|
||||
typedef void (*CALLBACKFUNC)(struct callbackPvt*);
|
||||
|
||||
|
||||
@@ -291,10 +291,14 @@ static void get_alarm(DBADDR *paddr, char **ppbuffer,
|
||||
if (*options & DBR_AL_LONG) {
|
||||
struct dbr_alLong *pal = (struct dbr_alLong*) pbuffer;
|
||||
|
||||
pal->upper_alarm_limit = (epicsInt32) ald.upper_alarm_limit;
|
||||
pal->upper_warning_limit = (epicsInt32) ald.upper_warning_limit;
|
||||
pal->lower_warning_limit = (epicsInt32) ald.lower_warning_limit;
|
||||
pal->lower_alarm_limit = (epicsInt32) ald.lower_alarm_limit;
|
||||
pal->upper_alarm_limit = finite(ald.upper_alarm_limit) ?
|
||||
(epicsInt32) ald.upper_alarm_limit : 0;
|
||||
pal->upper_warning_limit = finite(ald.upper_warning_limit) ?
|
||||
(epicsInt32) ald.upper_warning_limit : 0;
|
||||
pal->lower_warning_limit = finite(ald.lower_warning_limit) ?
|
||||
(epicsInt32) ald.lower_warning_limit : 0;
|
||||
pal->lower_alarm_limit = finite(ald.lower_alarm_limit) ?
|
||||
(epicsInt32) ald.lower_alarm_limit : 0;
|
||||
|
||||
if (no_data)
|
||||
*options ^= DBR_AL_LONG; /*Turn off option*/
|
||||
|
||||
@@ -410,7 +410,7 @@ long dbd(const char *record_name)
|
||||
|
||||
precord = addr.precord;
|
||||
|
||||
if (! precord->bkpt & BKPT_ON_MASK) {
|
||||
if (!(precord->bkpt & BKPT_ON_MASK)) {
|
||||
printf(" BKPT> No breakpoint set in this record\n");
|
||||
return(S_db_bkptNotSet);
|
||||
}
|
||||
|
||||
@@ -649,11 +649,16 @@ static void connectionCallback(struct connection_handler_args arg)
|
||||
if (pca->gotFirstConnection) {
|
||||
if (pca->nelements != ca_element_count(arg.chid) ||
|
||||
pca->dbrType != ca_field_type(arg.chid)) {
|
||||
/* BUG: We have no way to clear any old subscription with the
|
||||
* originally chosen data type/size. That will continue
|
||||
* to send us data and will result in an assert() fail.
|
||||
*/
|
||||
/* Let next dbCaGetLink and/or dbCaPutLink determine options */
|
||||
/* Size or type changed, clear everything and let the next call
|
||||
to dbCaGetLink() and/or dbCaPutLink() reset everything */
|
||||
if (pca->evidNative) {
|
||||
ca_clear_event(pca->evidNative);
|
||||
pca->evidNative = 0;
|
||||
}
|
||||
if (pca->evidString) {
|
||||
ca_clear_event(pca->evidString);
|
||||
pca->evidString = 0;
|
||||
}
|
||||
plink->value.pv_link.pvlMask &=
|
||||
~(pvlOptInpNative | pvlOptInpString |
|
||||
pvlOptOutNative | pvlOptOutString);
|
||||
@@ -701,6 +706,7 @@ static void eventCallback(struct event_handler_args arg)
|
||||
struct dbr_time_double *pdbr_time_double;
|
||||
dbCaCallback monitor = 0;
|
||||
void *userPvt = 0;
|
||||
int doScan = 1;
|
||||
|
||||
assert(pca);
|
||||
epicsMutexMustLock(pca->lock);
|
||||
@@ -729,10 +735,13 @@ static void eventCallback(struct event_handler_args arg)
|
||||
memcpy(pca->pgetString, dbr_value_ptr(arg.dbr, arg.type), size);
|
||||
pca->gotInString = TRUE;
|
||||
} else switch (arg.type){
|
||||
case DBR_TIME_ENUM:
|
||||
/* Disable the record scan if we also have a string monitor */
|
||||
doScan = !(plink->value.pv_link.pvlMask & pvlOptInpString);
|
||||
/* fall through */
|
||||
case DBR_TIME_STRING:
|
||||
case DBR_TIME_SHORT:
|
||||
case DBR_TIME_FLOAT:
|
||||
case DBR_TIME_ENUM:
|
||||
case DBR_TIME_CHAR:
|
||||
case DBR_TIME_LONG:
|
||||
case DBR_TIME_DOUBLE:
|
||||
@@ -748,7 +757,7 @@ static void eventCallback(struct event_handler_args arg)
|
||||
pca->sevr = pdbr_time_double->severity;
|
||||
pca->stat = pdbr_time_double->status;
|
||||
memcpy(&pca->timeStamp, &pdbr_time_double->stamp, sizeof(epicsTimeStamp));
|
||||
if (precord) {
|
||||
if (doScan && precord) {
|
||||
struct pv_link *ppv_link = &plink->value.pv_link;
|
||||
|
||||
if ((ppv_link->pvlMask & pvlOptCP) ||
|
||||
@@ -1005,7 +1014,8 @@ static void dbCaTask(void *arg)
|
||||
status = ca_add_array_event(
|
||||
ca_field_type(pca->chid)+DBR_TIME_STRING,
|
||||
ca_element_count(pca->chid),
|
||||
pca->chid, eventCallback, pca, 0.0, 0.0, 0.0, 0);
|
||||
pca->chid, eventCallback, pca, 0.0, 0.0, 0.0,
|
||||
&pca->evidNative);
|
||||
if (status != ECA_NORMAL) {
|
||||
errlogPrintf("dbCaTask ca_add_array_event %s\n",
|
||||
ca_message(status));
|
||||
@@ -1017,7 +1027,8 @@ static void dbCaTask(void *arg)
|
||||
pca->pgetString = dbCalloc(1, MAX_STRING_SIZE);
|
||||
epicsMutexUnlock(pca->lock);
|
||||
status = ca_add_array_event(DBR_TIME_STRING, 1,
|
||||
pca->chid, eventCallback, pca, 0.0, 0.0, 0.0, 0);
|
||||
pca->chid, eventCallback, pca, 0.0, 0.0, 0.0,
|
||||
&pca->evidString);
|
||||
if (status != ECA_NORMAL) {
|
||||
errlogPrintf("dbCaTask ca_add_array_event %s\n",
|
||||
ca_message(status));
|
||||
|
||||
@@ -78,6 +78,8 @@ typedef struct caLink
|
||||
char *pgetString;
|
||||
void *pputNative;
|
||||
char *pputString;
|
||||
evid evidNative;
|
||||
evid evidString;
|
||||
char gotInNative;
|
||||
char gotInString;
|
||||
char gotOutNative;
|
||||
|
||||
@@ -117,6 +117,8 @@ static char *EVENT_PEND_NAME = "eventTask";
|
||||
|
||||
static struct evSubscrip canceledEvent;
|
||||
|
||||
static epicsMutexId stopSync;
|
||||
|
||||
static unsigned short ringSpace ( const struct event_que *pevq )
|
||||
{
|
||||
if ( pevq->evque[pevq->putix] == EVENTQEMPTY ) {
|
||||
@@ -258,6 +260,10 @@ dbEventCtx db_init_events (void)
|
||||
{
|
||||
struct event_user * evUser;
|
||||
|
||||
if (!stopSync) {
|
||||
stopSync = epicsMutexMustCreate();
|
||||
}
|
||||
|
||||
if (!dbevEventUserFreeList) {
|
||||
freeListInitPvt(&dbevEventUserFreeList,
|
||||
sizeof(struct event_user),8);
|
||||
@@ -321,6 +327,8 @@ fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* intentionally leak stopSync to avoid possible shutdown races */
|
||||
/*
|
||||
* DB_CLOSE_EVENTS()
|
||||
*
|
||||
@@ -356,11 +364,15 @@ void db_close_events (dbEventCtx ctx)
|
||||
|
||||
epicsMutexUnlock ( evUser->lock );
|
||||
|
||||
epicsMutexMustLock (stopSync);
|
||||
|
||||
epicsEventDestroy(evUser->pexitsem);
|
||||
epicsEventDestroy(evUser->ppendsem);
|
||||
epicsEventDestroy(evUser->pflush_sem);
|
||||
epicsMutexDestroy(evUser->lock);
|
||||
|
||||
epicsMutexUnlock (stopSync);
|
||||
|
||||
freeListFree(dbevEventUserFreeList, evUser);
|
||||
}
|
||||
|
||||
@@ -1043,8 +1055,15 @@ static void event_task (void *pParm)
|
||||
|
||||
taskwdRemove(epicsThreadGetIdSelf());
|
||||
|
||||
/* use stopSync to ensure pexitsem is not destroy'd
|
||||
* until epicsEventSignal() has returned.
|
||||
*/
|
||||
epicsMutexMustLock (stopSync);
|
||||
|
||||
epicsEventSignal(evUser->pexitsem);
|
||||
|
||||
epicsMutexUnlock(stopSync);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -651,7 +651,7 @@ long dbGetLink(struct link *plink, short dbrType, void *pbuffer,
|
||||
inherit_severity(&plink->value.pv_link, precord, stat, sevr);
|
||||
break;
|
||||
default:
|
||||
cantProceed("dbGetLinkValue: Illegal link type %d\n", plink->type);
|
||||
printf("dbGetLinkValue: Illegal link type %d\n", plink->type);
|
||||
status = -1;
|
||||
}
|
||||
if (status) {
|
||||
@@ -755,7 +755,7 @@ long dbPutLink(struct link *plink, short dbrType, const void *pbuffer,
|
||||
status = dbCaPutLink(plink, dbrType, pbuffer, nRequest);
|
||||
break;
|
||||
default:
|
||||
cantProceed("dbPutLinkValue: Illegal link type %d\n", plink->type);
|
||||
printf("dbPutLinkValue: Illegal link type %d\n", plink->type);
|
||||
status = -1;
|
||||
}
|
||||
if (status) {
|
||||
@@ -836,4 +836,3 @@ long dbPutLinkLS(struct link *plink, char *pbuffer, epicsUInt32 len)
|
||||
|
||||
return dbPutLink(plink, DBR_STRING, pbuffer, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -552,10 +552,10 @@ long dblsr(char *recordname,int level)
|
||||
printf(" Not Locked\n");
|
||||
} else {
|
||||
printf(" thread %p",plockSet->thread_id);
|
||||
if(! plockSet->precord || !plockSet->precord->name)
|
||||
printf(" NULL record or record name\n");
|
||||
if(! plockSet->precord)
|
||||
printf(" NULL record\n");
|
||||
else
|
||||
printf(" record %s\n",plockSet->precord->name);
|
||||
printf(" record %s\n",plockSet->precord->name);
|
||||
}
|
||||
if(level==0) { if(recordname) break; continue; }
|
||||
for(plockRecord = (lockRecord *)ellFirst(&plockSet->lockRecordList);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (c) 2013 Helmholtz-Zentrum Berlin
|
||||
* für Materialien und Energie GmbH.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/* dbScan.c */
|
||||
/* tasks and subroutines to scan the database */
|
||||
@@ -111,8 +111,8 @@ static char *priorityName[NUM_CALLBACK_PRIORITIES] = {
|
||||
typedef struct event_list {
|
||||
CALLBACK callback[NUM_CALLBACK_PRIORITIES];
|
||||
scan_list scan_list[NUM_CALLBACK_PRIORITIES];
|
||||
struct event_list *next;
|
||||
char event_name[MAX_STRING_SIZE];
|
||||
struct event_list *next;
|
||||
char eventname[1]; /* actually arbitrary size */
|
||||
} event_list;
|
||||
static event_list * volatile pevent_list[256];
|
||||
static epicsMutexId event_lock;
|
||||
@@ -249,11 +249,6 @@ void scanAdd(struct dbCommon *precord)
|
||||
event_list *pel;
|
||||
|
||||
eventname = precord->evnt;
|
||||
if (strlen(eventname) >= MAX_STRING_SIZE) {
|
||||
recGblRecordError(S_db_badField, (void *)precord,
|
||||
"scanAdd: too long EVNT value");
|
||||
return;
|
||||
}
|
||||
prio = precord->prio;
|
||||
if (prio < 0 || prio >= NUM_CALLBACK_PRIORITIES) {
|
||||
recGblRecordError(-1, (void *)precord,
|
||||
@@ -317,24 +312,17 @@ void scanDelete(struct dbCommon *precord)
|
||||
recGblRecordError(-1, (void *)precord,
|
||||
"scanDelete detected illegal SCAN value");
|
||||
} else if (scan == menuScanEvent) {
|
||||
char* eventname;
|
||||
int prio;
|
||||
event_list *pel;
|
||||
scan_list *psl = 0;
|
||||
|
||||
eventname = precord->evnt;
|
||||
prio = precord->prio;
|
||||
if (prio < 0 || prio >= NUM_CALLBACK_PRIORITIES) {
|
||||
recGblRecordError(-1, (void *)precord,
|
||||
"scanDelete detected illegal PRIO field");
|
||||
return;
|
||||
}
|
||||
do /* multithreading: make sure pel is consistent */
|
||||
pel = pevent_list[0];
|
||||
while (pel != pevent_list[0]);
|
||||
for (; pel; pel=pel->next) {
|
||||
if (strcmp(pel->event_name, eventname) == 0) break;
|
||||
}
|
||||
pel = eventNameToHandle(precord->evnt);
|
||||
if (pel && (psl = &pel->scan_list[prio]))
|
||||
deleteFromList(precord, psl);
|
||||
} else if (scan == menuScanI_O_Intr) {
|
||||
@@ -422,14 +410,12 @@ int scanpel(const char* eventname) /* print event list */
|
||||
int prio;
|
||||
event_list *pel;
|
||||
|
||||
do /* multithreading: make sure pel is consistent */
|
||||
pel = pevent_list[0];
|
||||
while (pel != pevent_list[0]);
|
||||
for (; pel; pel = pel->next) {
|
||||
if (!eventname || strcmp(pel->event_name, eventname) == 0) {
|
||||
for (pel = pevent_list[0]; pel; pel = pel->next) {
|
||||
if (!eventname || epicsStrGlobMatch(pel->eventname, eventname)) {
|
||||
printf("Event \"%s\"\n", pel->eventname);
|
||||
for (prio = 0; prio < NUM_CALLBACK_PRIORITIES; prio++) {
|
||||
if (ellCount(&pel->scan_list[prio].list) == 0) continue;
|
||||
sprintf(message, "Event \"%s\" Priority %s", pel->event_name, priorityName[prio]);
|
||||
sprintf(message, " Priority %s", priorityName[prio]);
|
||||
printList(&pel->scan_list[prio], message);
|
||||
}
|
||||
}
|
||||
@@ -480,18 +466,52 @@ event_list *eventNameToHandle(const char *eventname)
|
||||
int prio;
|
||||
event_list *pel;
|
||||
static epicsThreadOnceId onceId = EPICS_THREAD_ONCE_INIT;
|
||||
double eventnumber = 0;
|
||||
size_t namelength;
|
||||
|
||||
if (!eventname || eventname[0] == 0)
|
||||
return NULL;
|
||||
if (!eventname) return NULL;
|
||||
while (isspace((unsigned char)eventname[0])) eventname++;
|
||||
if (!eventname[0]) return NULL;
|
||||
namelength = strlen(eventname);
|
||||
while (isspace((unsigned char)eventname[namelength-1])) namelength--;
|
||||
|
||||
/* Backward compatibility with numeric events:
|
||||
Treat any string that represents a double with an
|
||||
integer part between 0 and 255 the same as the integer
|
||||
because it is most probably a conversion from double
|
||||
like from a calc record.
|
||||
*/
|
||||
if (epicsParseDouble(eventname, &eventnumber, NULL) == 0)
|
||||
{
|
||||
if (eventnumber >= 0 && eventnumber < 256)
|
||||
{
|
||||
if (eventnumber < 1)
|
||||
return NULL; /* 0 is no event */
|
||||
if ((pel = pevent_list[(int)eventnumber]) != NULL)
|
||||
return pel;
|
||||
}
|
||||
else
|
||||
eventnumber = 0; /* not a numeric event between 1 and 255 */
|
||||
}
|
||||
|
||||
epicsThreadOnce(&onceId, eventOnce, NULL);
|
||||
epicsMutexMustLock(event_lock);
|
||||
for (pel = pevent_list[0]; pel; pel=pel->next) {
|
||||
if (strcmp(pel->event_name, eventname) == 0) break;
|
||||
if (strncmp(pel->eventname, eventname, namelength) == 0
|
||||
&& pel->eventname[namelength] == 0)
|
||||
break;
|
||||
}
|
||||
if (pel == NULL) {
|
||||
pel = dbCalloc(1, sizeof(event_list));
|
||||
strcpy(pel->event_name, eventname);
|
||||
pel = calloc(1, sizeof(event_list) + namelength);
|
||||
if (!pel)
|
||||
goto done;
|
||||
if (eventnumber > 0) {
|
||||
/* backward compatibility: make all numeric events look like integers */
|
||||
sprintf(pel->eventname, "%i", (int)eventnumber);
|
||||
pevent_list[(int)eventnumber] = pel;
|
||||
}
|
||||
else
|
||||
strncpy(pel->eventname, eventname, namelength);
|
||||
for (prio = 0; prio < NUM_CALLBACK_PRIORITIES; prio++) {
|
||||
callbackSetUser(&pel->scan_list[prio], &pel->callback[prio]);
|
||||
callbackSetPriority(prio, &pel->callback[prio]);
|
||||
@@ -501,13 +521,8 @@ event_list *eventNameToHandle(const char *eventname)
|
||||
}
|
||||
pel->next=pevent_list[0];
|
||||
pevent_list[0]=pel;
|
||||
{ /* backward compatibility */
|
||||
char* p;
|
||||
long e = strtol(eventname, &p, 0);
|
||||
if (*p == 0 && e > 0 && e <= 255)
|
||||
pevent_list[e] = pel;
|
||||
}
|
||||
}
|
||||
done:
|
||||
epicsMutexUnlock(event_lock);
|
||||
return pel;
|
||||
}
|
||||
@@ -527,13 +542,8 @@ void postEvent(event_list *pel)
|
||||
/* backward compatibility */
|
||||
void post_event(int event)
|
||||
{
|
||||
event_list* pel;
|
||||
|
||||
if (event <= 0 || event > 255) return;
|
||||
do { /* multithreading: make sure pel is consistent */
|
||||
pel = pevent_list[event];
|
||||
} while (pel != pevent_list[event]);
|
||||
postEvent(pel);
|
||||
postEvent(pevent_list[event]);
|
||||
}
|
||||
|
||||
static void ioscanOnce(void *arg)
|
||||
|
||||
@@ -50,7 +50,7 @@ epicsShareFunc void scanCleanup(void);
|
||||
|
||||
epicsShareFunc EVENTPVT eventNameToHandle(const char* event);
|
||||
epicsShareFunc void postEvent(EVENTPVT epvt);
|
||||
epicsShareFunc void post_event(int event) EPICS_DEPRECATED;
|
||||
epicsShareFunc void post_event(int event);
|
||||
epicsShareFunc void scanAdd(struct dbCommon *);
|
||||
epicsShareFunc void scanDelete(struct dbCommon *);
|
||||
epicsShareFunc double scanPeriod(int scan);
|
||||
|
||||
@@ -308,6 +308,11 @@ long dbgf(const char *pname)
|
||||
if (nameToAddr(pname, &addr))
|
||||
return -1;
|
||||
|
||||
if (addr.precord->lset == NULL) {
|
||||
printf("dbgf only works after iocInit\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
no_elements = MIN(addr.no_elements, sizeof(buffer)/addr.field_size);
|
||||
if (addr.dbr_field_type == DBR_ENUM) {
|
||||
long status = dbGetField(&addr, DBR_STRING, pbuffer,
|
||||
@@ -344,6 +349,11 @@ long dbpf(const char *pname,const char *pvalue)
|
||||
if (nameToAddr(pname, &addr))
|
||||
return -1;
|
||||
|
||||
if (addr.precord->lset == NULL) {
|
||||
printf("dbpf only works after iocInit\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (addr.no_elements > 1 &&
|
||||
(addr.dbr_field_type == DBR_CHAR || addr.dbr_field_type == DBR_UCHAR)) {
|
||||
dbrType = addr.dbr_field_type;
|
||||
@@ -398,6 +408,11 @@ long dbtr(const char *pname)
|
||||
if (nameToAddr(pname, &addr))
|
||||
return -1;
|
||||
|
||||
if (addr.precord->lset == NULL) {
|
||||
printf("dbtr only works after iocInit\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
precord = (struct dbCommon*)addr.precord;
|
||||
if (precord->pact) {
|
||||
printf("record active\n");
|
||||
@@ -437,6 +452,11 @@ long dbtgf(const char *pname)
|
||||
if (nameToAddr(pname, &addr))
|
||||
return -1;
|
||||
|
||||
if (addr.precord->lset == NULL) {
|
||||
printf("dbtgf only works after iocInit\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* try all options first */
|
||||
req_options = 0xffffffff;
|
||||
ret_options = req_options;
|
||||
@@ -534,6 +554,11 @@ long dbtpf(const char *pname, const char *pvalue)
|
||||
if (nameToAddr(pname, &addr))
|
||||
return -1;
|
||||
|
||||
if (addr.precord->lset == NULL) {
|
||||
printf("dbtpf only works after iocInit\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
val_long = strtol(pvalue, &pend, 10);
|
||||
validLong = (*pend == 0);
|
||||
|
||||
@@ -797,7 +822,7 @@ static void printBuffer(
|
||||
|
||||
printf("no_strs = %u:\n",
|
||||
pdbr_enumStrs->no_str);
|
||||
for (i = 0; i < pdbr_enumStrs->no_str; i++)
|
||||
for (i = 0; i < pdbr_enumStrs->no_str; i++)
|
||||
printf("\t\"%s\"\n", pdbr_enumStrs->strs[i]);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "epicsUnitTest.h"
|
||||
#include "osiFileName.h"
|
||||
#include "registry.h"
|
||||
#include "epicsThread.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "dbAccess.h"
|
||||
@@ -111,7 +112,7 @@ long testdbVPutField(const char* pv, short dbrType, va_list ap)
|
||||
return dbPutField(&addr, dbrType, pod.bytes, 1);
|
||||
}
|
||||
|
||||
void testdbPutFieldOk(const char* pv, short dbrType, ...)
|
||||
void testdbPutFieldOk(const char* pv, int dbrType, ...)
|
||||
{
|
||||
long ret;
|
||||
va_list ap;
|
||||
@@ -123,7 +124,7 @@ void testdbPutFieldOk(const char* pv, short dbrType, ...)
|
||||
testOk(ret==0, "dbPutField(%s, %d, ...) == %ld", pv, dbrType, ret);
|
||||
}
|
||||
|
||||
void testdbPutFieldFail(long status, const char* pv, short dbrType, ...)
|
||||
void testdbPutFieldFail(long status, const char* pv, int dbrType, ...)
|
||||
{
|
||||
long ret;
|
||||
va_list ap;
|
||||
@@ -138,7 +139,7 @@ void testdbPutFieldFail(long status, const char* pv, short dbrType, ...)
|
||||
testFail("dbPutField(\"%s\", %d, ...) != %ld (%ld)", pv, dbrType, status, ret);
|
||||
}
|
||||
|
||||
void testdbGetFieldEqual(const char* pv, short dbrType, ...)
|
||||
void testdbGetFieldEqual(const char* pv, int dbrType, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
@@ -268,3 +269,26 @@ dbCommon* testdbRecordPtr(const char* pv)
|
||||
|
||||
return addr.precord;
|
||||
}
|
||||
|
||||
static
|
||||
epicsMutexId test_global;
|
||||
|
||||
static
|
||||
epicsThreadOnceId test_global_once = EPICS_THREAD_ONCE_INIT;
|
||||
|
||||
static
|
||||
void test_global_init(void* ignored)
|
||||
{
|
||||
test_global = epicsMutexMustCreate();
|
||||
}
|
||||
|
||||
void testGlobalLock(void)
|
||||
{
|
||||
epicsThreadOnce(&test_global_once, &test_global_init, NULL);
|
||||
epicsMutexMustLock(test_global);
|
||||
}
|
||||
|
||||
void testGlobalUnlock(void)
|
||||
{
|
||||
epicsMutexUnlock(test_global);
|
||||
}
|
||||
|
||||
@@ -46,13 +46,13 @@ epicsShareFunc void testdbCleanup(void);
|
||||
* testdbPutFieldOk("pvname", DBF_FLOAT, (double)4.1);
|
||||
* testdbPutFieldOk("pvname", DBF_STRING, "hello world");
|
||||
*/
|
||||
epicsShareFunc void testdbPutFieldOk(const char* pv, short dbrType, ...);
|
||||
epicsShareFunc void testdbPutFieldOk(const char* pv, int dbrType, ...);
|
||||
/* Tests for put failure */
|
||||
epicsShareFunc void testdbPutFieldFail(long status, const char* pv, short dbrType, ...);
|
||||
epicsShareFunc void testdbPutFieldFail(long status, const char* pv, int dbrType, ...);
|
||||
|
||||
epicsShareFunc long testdbVPutField(const char* pv, short dbrType, va_list ap);
|
||||
|
||||
epicsShareFunc void testdbGetFieldEqual(const char* pv, short dbrType, ...);
|
||||
epicsShareFunc void testdbGetFieldEqual(const char* pv, int dbrType, ...);
|
||||
epicsShareFunc void testdbVGetFieldEqual(const char* pv, short dbrType, va_list ap);
|
||||
|
||||
/**
|
||||
@@ -74,6 +74,65 @@ epicsShareFunc void testdbGetArrFieldEqual(const char* pv, short dbfType, long n
|
||||
|
||||
epicsShareFunc dbCommon* testdbRecordPtr(const char* pv);
|
||||
|
||||
/** Synchronize the shared callback queues.
|
||||
*
|
||||
* Block until all callback queue jobs which were queued, or running,
|
||||
* have completed.
|
||||
*/
|
||||
epicsShareFunc void testSyncCallback(void);
|
||||
|
||||
/** Global mutex for use by test code.
|
||||
*
|
||||
* This utility mutex is intended to be used to avoid races in situations
|
||||
* where some other syncronization primitive is being destroyed (epicsEvent,
|
||||
* epicsMutex, ...).
|
||||
*
|
||||
* For example. The following has a subtle race where the event may be
|
||||
* destroyed (free()'d) before the call to epicsEventMustSignal() has
|
||||
* returned. On some targets this leads to a use after free() error.
|
||||
*
|
||||
@code
|
||||
epicsEventId evt;
|
||||
void thread1() {
|
||||
evt = epicsEventMustCreate(...);
|
||||
// spawn thread2()
|
||||
epicsEventMustWait(evt);
|
||||
epicsEventDestroy(evt);
|
||||
}
|
||||
// ...
|
||||
void thread2() {
|
||||
epicsEventMustSignal(evt);
|
||||
}
|
||||
@endcode
|
||||
*
|
||||
* One way to avoid this race is to use a global mutex to ensure
|
||||
* that epicsEventMustSignal() has returned before destroying
|
||||
* the event.
|
||||
*
|
||||
@code
|
||||
epicsEventId evt;
|
||||
void thread1() {
|
||||
evt = epicsEventMustCreate(...);
|
||||
// spawn thread2()
|
||||
epicsEventMustWait(evt);
|
||||
testGlobalLock(); // <-- added
|
||||
epicsEventDestroy(evt);
|
||||
testGlobalUnlock(); // <-- added
|
||||
}
|
||||
// ...
|
||||
void thread2() {
|
||||
testGlobalLock(); // <-- added
|
||||
epicsEventMustSignal(evt);
|
||||
testGlobalUnlock(); // <-- added
|
||||
}
|
||||
@endcode
|
||||
*
|
||||
* This must be a global mutex to avoid simply shifting the race
|
||||
* from the event to a locally allocated mutex.
|
||||
*/
|
||||
epicsShareFunc void testGlobalLock(void);
|
||||
epicsShareFunc void testGlobalUnlock(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <limits.h>
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "alarm.h"
|
||||
#include "epicsMath.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "epicsStdlib.h"
|
||||
@@ -181,6 +182,9 @@ unsigned short recGblResetAlarms(void *precord)
|
||||
epicsEnum16 val_mask = 0;
|
||||
epicsEnum16 stat_mask = 0;
|
||||
|
||||
if (new_sevr > INVALID_ALARM)
|
||||
new_sevr = INVALID_ALARM;
|
||||
|
||||
pdbc->stat = new_stat;
|
||||
pdbc->sevr = new_sevr;
|
||||
pdbc->nsta = 0;
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
*
|
||||
* Two time intervals are measured. The time to queue and run each of
|
||||
* the immediate callbacks, and the actual delay of the delayed callback.
|
||||
*
|
||||
* Slow callbacks no longer fail the test, they just emit a diagnostic.
|
||||
*/
|
||||
|
||||
#define NCALLBACKS 169
|
||||
@@ -108,7 +110,7 @@ MAIN(callbackParallelTest)
|
||||
for (j = 0; j < 5; j++)
|
||||
setupError[i][j] = timeError[i][j] = defaultError[j];
|
||||
|
||||
testPlan(4);
|
||||
testPlan(2);
|
||||
|
||||
testDiag("Starting %d parallel callback threads", noCpus);
|
||||
|
||||
@@ -165,7 +167,8 @@ MAIN(callbackParallelTest)
|
||||
}
|
||||
}
|
||||
testOk(faults == 0, "%d faults during callback setup", faults);
|
||||
testOk(slowups <= 1, "%d slowups during callback setup", slowups);
|
||||
if (slowups)
|
||||
testDiag("%d slowups during callback setup", slowups);
|
||||
|
||||
slowups = 0;
|
||||
for (i = 0; i < NCALLBACKS ; i++) {
|
||||
@@ -182,7 +185,8 @@ MAIN(callbackParallelTest)
|
||||
}
|
||||
updateStats(timeError[i%NUM_CALLBACK_PRIORITIES], error);
|
||||
}
|
||||
testOk(slowups < 5, "%d slowups during callbacks", slowups);
|
||||
if (slowups)
|
||||
testDiag("%d slowups during callback setup", slowups);
|
||||
|
||||
testDiag("Setup time statistics");
|
||||
printStats(setupError[0], "LOW");
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
*
|
||||
* Two time intervals are measured. The time to queue and run each of
|
||||
* the immediate callbacks, and the actual delay of the delayed callback.
|
||||
*
|
||||
* Slow callbacks no longer fail the test, they just emit a diagnostic.
|
||||
*/
|
||||
|
||||
#define NCALLBACKS 169
|
||||
@@ -108,7 +110,7 @@ MAIN(callbackTest)
|
||||
for (j = 0; j < 5; j++)
|
||||
setupError[i][j] = timeError[i][j] = defaultError[j];
|
||||
|
||||
testPlan(4);
|
||||
testPlan(2);
|
||||
|
||||
callbackInit();
|
||||
epicsThreadSleep(1.0);
|
||||
@@ -162,7 +164,8 @@ MAIN(callbackTest)
|
||||
}
|
||||
}
|
||||
testOk(faults == 0, "%d faults during callback setup", faults);
|
||||
testOk(slowups <= 1, "%d slowups during callback setup", slowups);
|
||||
if (slowups)
|
||||
testDiag("%d slowups during callback setup", slowups);
|
||||
|
||||
slowups = 0;
|
||||
for (i = 0; i < NCALLBACKS ; i++) {
|
||||
@@ -179,7 +182,8 @@ MAIN(callbackTest)
|
||||
}
|
||||
updateStats(timeError[i%NUM_CALLBACK_PRIORITIES], error);
|
||||
}
|
||||
testOk(slowups < 5, "%d slowups during callbacks", slowups);
|
||||
if (slowups)
|
||||
testDiag("%d slowups during callback setup", slowups);
|
||||
|
||||
testDiag("Setup time statistics");
|
||||
printStats(setupError[0], "LOW");
|
||||
|
||||
@@ -1036,23 +1036,29 @@ static void dbRecordHead(char *recordType, char *name, int visible)
|
||||
|
||||
static void dbRecordField(char *name,char *value)
|
||||
{
|
||||
DBENTRY *pdbentry;
|
||||
tempListNode *ptempListNode;
|
||||
long status;
|
||||
DBENTRY *pdbentry;
|
||||
tempListNode *ptempListNode;
|
||||
long status;
|
||||
|
||||
if(duplicate) return;
|
||||
if (duplicate) return;
|
||||
ptempListNode = (tempListNode *)ellFirst(&tempList);
|
||||
pdbentry = ptempListNode->item;
|
||||
status = dbFindField(pdbentry,name);
|
||||
if(status) {
|
||||
epicsPrintf("Record \"%s\" does not have a field \"%s\"\n",
|
||||
dbGetRecordName(pdbentry), name);
|
||||
yyerror(NULL);
|
||||
return;
|
||||
if (status) {
|
||||
epicsPrintf("Record \"%s\" does not have a field \"%s\"\n",
|
||||
dbGetRecordName(pdbentry), name);
|
||||
yyerror(NULL);
|
||||
return;
|
||||
}
|
||||
if (pdbentry->indfield == 0) {
|
||||
epicsPrintf("Can't set \"NAME\" field of record \"%s\"\n",
|
||||
dbGetRecordName(pdbentry));
|
||||
yyerror(NULL);
|
||||
return;
|
||||
}
|
||||
dbTranslateEscape(value, value); /* yuck: in-place, but safe */
|
||||
status = dbPutString(pdbentry,value);
|
||||
if(status) {
|
||||
if (status) {
|
||||
epicsPrintf("Can't set \"%s.%s\" to \"%s\"\n",
|
||||
dbGetRecordName(pdbentry), name, value);
|
||||
yyerror(NULL);
|
||||
@@ -1062,33 +1068,34 @@ static void dbRecordField(char *name,char *value)
|
||||
|
||||
static void dbRecordInfo(char *name, char *value)
|
||||
{
|
||||
DBENTRY *pdbentry;
|
||||
tempListNode *ptempListNode;
|
||||
long status;
|
||||
DBENTRY *pdbentry;
|
||||
tempListNode *ptempListNode;
|
||||
long status;
|
||||
|
||||
if(duplicate) return;
|
||||
if (duplicate) return;
|
||||
ptempListNode = (tempListNode *)ellFirst(&tempList);
|
||||
pdbentry = ptempListNode->item;
|
||||
dbTranslateEscape(value, value); /* yuck: in-place, but safe */
|
||||
status = dbPutInfo(pdbentry,name,value);
|
||||
if(status) {
|
||||
epicsPrintf("Can't set \"%s\" info \"%s\" to \"%s\"\n",
|
||||
if (status) {
|
||||
epicsPrintf("Can't set \"%s\" info \"%s\" to \"%s\"\n",
|
||||
dbGetRecordName(pdbentry), name, value);
|
||||
yyerror(NULL);
|
||||
return;
|
||||
yyerror(NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void dbRecordAlias(char *name)
|
||||
{
|
||||
DBENTRY *pdbentry;
|
||||
tempListNode *ptempListNode;
|
||||
long status;
|
||||
DBENTRY *pdbentry;
|
||||
tempListNode *ptempListNode;
|
||||
long status;
|
||||
|
||||
if(duplicate) return;
|
||||
if (duplicate) return;
|
||||
ptempListNode = (tempListNode *)ellFirst(&tempList);
|
||||
pdbentry = ptempListNode->item;
|
||||
status = dbCreateAlias(pdbentry, name);
|
||||
if(status) {
|
||||
if (status) {
|
||||
epicsPrintf("Can't create alias \"%s\" for \"%s\"\n",
|
||||
name, dbGetRecordName(pdbentry));
|
||||
yyerror(NULL);
|
||||
@@ -1098,15 +1105,16 @@ static void dbRecordAlias(char *name)
|
||||
|
||||
static void dbAlias(char *name, char *alias)
|
||||
{
|
||||
DBENTRY dbEntry;
|
||||
DBENTRY *pdbEntry = &dbEntry;
|
||||
DBENTRY dbEntry;
|
||||
DBENTRY *pdbEntry = &dbEntry;
|
||||
|
||||
dbInitEntry(pdbbase, pdbEntry);
|
||||
if (dbFindRecord(pdbEntry, name)) {
|
||||
epicsPrintf("Alias \"%s\" refers to unknown record \"%s\"\n",
|
||||
alias, name);
|
||||
yyerror(NULL);
|
||||
} else if (dbCreateAlias(pdbEntry, alias)) {
|
||||
}
|
||||
else if (dbCreateAlias(pdbEntry, alias)) {
|
||||
epicsPrintf("Can't create alias \"%s\" referring to \"%s\"\n",
|
||||
alias, name);
|
||||
yyerror(NULL);
|
||||
@@ -1116,14 +1124,14 @@ static void dbAlias(char *name, char *alias)
|
||||
|
||||
static void dbRecordBody(void)
|
||||
{
|
||||
DBENTRY *pdbentry;
|
||||
DBENTRY *pdbentry;
|
||||
|
||||
if(duplicate) {
|
||||
duplicate = FALSE;
|
||||
return;
|
||||
if (duplicate) {
|
||||
duplicate = FALSE;
|
||||
return;
|
||||
}
|
||||
pdbentry = (DBENTRY *)popFirstTemp();
|
||||
if(ellCount(&tempList))
|
||||
yyerrorAbort("dbRecordBody: tempList not empty");
|
||||
if (ellCount(&tempList))
|
||||
yyerrorAbort("dbRecordBody: tempList not empty");
|
||||
dbFreeEntry(pdbentry);
|
||||
}
|
||||
|
||||
@@ -851,10 +851,14 @@ long dbWriteRecordFP(
|
||||
status=dbNextField(pdbentry,dctonly);
|
||||
}
|
||||
status = dbFirstInfo(pdbentry);
|
||||
while(!status) {
|
||||
fprintf(fp,"\tinfo(\"%s\",\"%s\")\n",
|
||||
dbGetInfoName(pdbentry), dbGetInfoString(pdbentry));
|
||||
status=dbNextInfo(pdbentry);
|
||||
while (!status) {
|
||||
const char *pinfostr = dbGetInfoString(pdbentry);
|
||||
|
||||
fprintf(fp, "\tinfo(\"%s\",\"",
|
||||
dbGetInfoName(pdbentry));
|
||||
epicsStrPrintEscaped(fp, pinfostr, strlen(pinfostr));
|
||||
fprintf(fp, "\")\n");
|
||||
status = dbNextInfo(pdbentry);
|
||||
}
|
||||
fprintf(fp,"}\n");
|
||||
status = dbNextRecord(pdbentry);
|
||||
@@ -1631,19 +1635,22 @@ int dbIsVisibleRecord(DBENTRY *pdbentry)
|
||||
|
||||
long dbCreateAlias(DBENTRY *pdbentry, const char *alias)
|
||||
{
|
||||
dbRecordType *precordType = pdbentry->precordType;
|
||||
dbRecordNode *precnode = pdbentry->precnode;
|
||||
dbRecordNode *pnewnode;
|
||||
PVDENTRY *ppvd;
|
||||
ELLLIST *preclist = NULL;
|
||||
dbRecordType *precordType = pdbentry->precordType;
|
||||
dbRecordNode *precnode = pdbentry->precnode;
|
||||
dbRecordNode *pnewnode;
|
||||
DBENTRY tempEntry;
|
||||
PVDENTRY *ppvd;
|
||||
|
||||
if (!precordType)
|
||||
return S_dbLib_recordTypeNotFound;
|
||||
if (!precnode)
|
||||
return S_dbLib_recNotFound;
|
||||
|
||||
dbInitEntry(pdbentry->pdbbase, &tempEntry);
|
||||
if (!dbFindRecord(&tempEntry, alias))
|
||||
return S_dbLib_recExists;
|
||||
dbFinishEntry(&tempEntry);
|
||||
|
||||
if (!precordType) return S_dbLib_recordTypeNotFound;
|
||||
if (!precnode) return S_dbLib_recNotFound;
|
||||
zeroDbentry(pdbentry);
|
||||
if (!dbFindRecord(pdbentry, alias)) return S_dbLib_recExists;
|
||||
zeroDbentry(pdbentry);
|
||||
pdbentry->precordType = precordType;
|
||||
preclist = &precordType->recList;
|
||||
pnewnode = dbCalloc(1, sizeof(dbRecordNode));
|
||||
pnewnode->recordname = epicsStrDup(alias);
|
||||
pnewnode->precord = precnode->precord;
|
||||
@@ -1651,11 +1658,16 @@ long dbCreateAlias(DBENTRY *pdbentry, const char *alias)
|
||||
if (!(precnode->flags & DBRN_FLAGS_ISALIAS))
|
||||
precnode->flags |= DBRN_FLAGS_HASALIAS;
|
||||
ellInit(&pnewnode->infoList);
|
||||
ellAdd(preclist, &pnewnode->node);
|
||||
|
||||
ellAdd(&precordType->recList, &pnewnode->node);
|
||||
precordType->no_aliases++;
|
||||
pdbentry->precnode = pnewnode;
|
||||
|
||||
ppvd = dbPvdAdd(pdbentry->pdbbase, precordType, pnewnode);
|
||||
if (!ppvd) {errMessage(-1,"Logic Err: Could not add to PVD");return(-1);}
|
||||
if (!ppvd) {
|
||||
errMessage(-1, "dbCreateAlias: Add to PVD failed");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,10 +34,10 @@ be written to stdout unless the -o option is given.</p>
|
||||
|
||||
<dl>
|
||||
<dt><tt>-V</tt></dt>
|
||||
<dd>Verbose warnings; if this parameter is specified then any undefined
|
||||
macro discovered in the template file which does not have an associated
|
||||
default value is considered an error. An error message is generated, and
|
||||
when msi terminates it will do so with an exit status of 2.</dd>
|
||||
<dd>Verbose warnings; if this parameter is specified then any undefined or
|
||||
recursive macros discovered in the template will be considered an error and
|
||||
will be marked in the output file. An error message will be shown, and when
|
||||
msi terminates it will do so with an exit status of 2.</dd>
|
||||
|
||||
<dt><tt>-g</tt></dt>
|
||||
<dd>When this flag is given all macros defined in a substitution file will
|
||||
|
||||
@@ -31,18 +31,18 @@ ok(msi('-S ../t5-substitute.txt ../t5-template.txt'), slurp('../t5-result.txt'))
|
||||
# Substitution file, pattern format
|
||||
ok(msi('-S../t6-substitute.txt ../t6-template.txt'), slurp('../t6-result.txt'));
|
||||
|
||||
# Output option -o
|
||||
# Output option -o and verbose option -V
|
||||
my $out = 't7-output.txt';
|
||||
my $count = 5; # Try up to 5 times...
|
||||
my $result;
|
||||
do {
|
||||
unlink $out;
|
||||
msi("-I.. -o $out ../t1-template.txt");
|
||||
msi("-I.. -V -o $out ../t1-template.txt");
|
||||
$result = slurp($out);
|
||||
print "# msi output file empty, retrying\n"
|
||||
if $result eq '';
|
||||
} while ($result eq '') && (--$count > 0);
|
||||
ok($result, slurp('../t1-result.txt'));
|
||||
ok($result, slurp('../t7-result.txt'));
|
||||
|
||||
# Dependency generation, include/substitute model
|
||||
ok(msi('-I.. -D -o t8.txt ../t1-template.txt'), slurp('../t8-result.txt'));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
This is t1-template.txt
|
||||
|
||||
With $(a,undefined) & $(b,undefined):
|
||||
With $(a) & $(b):
|
||||
This is t1-include.txt
|
||||
a = default value used when a is undefined
|
||||
b = default value used when b is undefined
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
a = va1-a b = def-b c = def-c d = $(d,undefined)
|
||||
a = va2-a b = va2-b c = def-c d = $(d,undefined)
|
||||
a = va3-a b = va3-b c = va3-c d = $(d,undefined)
|
||||
a = va4-a b = va4-b c = def-c d = $(d,undefined)
|
||||
a = va5-a b = def-b c = def-c d = $(d,undefined)
|
||||
a = pt3-a b = pt3-b c = pt3-c d = $(d,undefined)
|
||||
a = va1-a b = def-b c = def-c d = $(d)
|
||||
a = va2-a b = va2-b c = def-c d = $(d)
|
||||
a = va3-a b = va3-b c = va3-c d = $(d)
|
||||
a = va4-a b = va4-b c = def-c d = $(d)
|
||||
a = va5-a b = def-b c = def-c d = $(d)
|
||||
a = pt3-a b = pt3-b c = pt3-c d = $(d)
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
a = gb1-a b = gb1-b c = def-c d = $(d,undefined)
|
||||
a = va1-a b = gb1-b c = def-c d = $(d,undefined)
|
||||
a = va2-a b = va2-b c = def-c d = $(d,undefined)
|
||||
a = va3-a b = va3-b c = va3-c d = $(d,undefined)
|
||||
a = va4-a b = va4-b c = def-c d = $(d,undefined)
|
||||
a = va5-a b = gb1-b c = def-c d = $(d,undefined)
|
||||
a = gb1-a b = gb1-b c = def-c d = $(d,undefined)
|
||||
a = gb2-a b = gb2-b c = def-c d = $(d,undefined)
|
||||
a = va1-a b = gb2-b c = def-c d = $(d,undefined)
|
||||
a = va2-a b = va2-b c = def-c d = $(d,undefined)
|
||||
a = va3-a b = va3-b c = va3-c d = $(d,undefined)
|
||||
a = va4-a b = va4-b c = def-c d = $(d,undefined)
|
||||
a = va5-a b = gb2-b c = def-c d = $(d,undefined)
|
||||
a = gb2-a b = gb2-b c = def-c d = $(d,undefined)
|
||||
a = gb3-a b = gb3-b c = def-c d = $(d,undefined)
|
||||
a = pt1-a b = gb3-b c = def-c d = $(d,undefined)
|
||||
a = pt2-a b = pt2-b c = def-c d = $(d,undefined)
|
||||
a = pt3-a b = pt3-b c = pt3-c d = $(d,undefined)
|
||||
a = pt4-a b = pt4-b c = def-c d = $(d,undefined)
|
||||
a = pt5-a b = gb3-b c = def-c d = $(d,undefined)
|
||||
a = gb3-a b = gb3-b c = def-c d = $(d,undefined)
|
||||
a = gb4-a b = gb4-b c = def-c d = $(d,undefined)
|
||||
a = pt1-a b = gb4-b c = def-c d = $(d,undefined)
|
||||
a = pt2-a b = pt2-b c = def-c d = $(d,undefined)
|
||||
a = pt3-a b = pt3-b c = pt3-c d = $(d,undefined)
|
||||
a = pt4-a b = pt4-b c = def-c d = $(d,undefined)
|
||||
a = pt5-a b = gb4-b c = def-c d = $(d,undefined)
|
||||
a = gb4-a b = gb4-b c = def-c d = $(d,undefined)
|
||||
a = gb1-a b = gb1-b c = def-c d = $(d)
|
||||
a = va1-a b = gb1-b c = def-c d = $(d)
|
||||
a = va2-a b = va2-b c = def-c d = $(d)
|
||||
a = va3-a b = va3-b c = va3-c d = $(d)
|
||||
a = va4-a b = va4-b c = def-c d = $(d)
|
||||
a = va5-a b = gb1-b c = def-c d = $(d)
|
||||
a = gb1-a b = gb1-b c = def-c d = $(d)
|
||||
a = gb2-a b = gb2-b c = def-c d = $(d)
|
||||
a = va1-a b = gb2-b c = def-c d = $(d)
|
||||
a = va2-a b = va2-b c = def-c d = $(d)
|
||||
a = va3-a b = va3-b c = va3-c d = $(d)
|
||||
a = va4-a b = va4-b c = def-c d = $(d)
|
||||
a = va5-a b = gb2-b c = def-c d = $(d)
|
||||
a = gb2-a b = gb2-b c = def-c d = $(d)
|
||||
a = gb3-a b = gb3-b c = def-c d = $(d)
|
||||
a = pt1-a b = gb3-b c = def-c d = $(d)
|
||||
a = pt2-a b = pt2-b c = def-c d = $(d)
|
||||
a = pt3-a b = pt3-b c = pt3-c d = $(d)
|
||||
a = pt4-a b = pt4-b c = def-c d = $(d)
|
||||
a = pt5-a b = gb3-b c = def-c d = $(d)
|
||||
a = gb3-a b = gb3-b c = def-c d = $(d)
|
||||
a = gb4-a b = gb4-b c = def-c d = $(d)
|
||||
a = pt1-a b = gb4-b c = def-c d = $(d)
|
||||
a = pt2-a b = pt2-b c = def-c d = $(d)
|
||||
a = pt3-a b = pt3-b c = pt3-c d = $(d)
|
||||
a = pt4-a b = pt4-b c = def-c d = $(d)
|
||||
a = pt5-a b = gb4-b c = def-c d = $(d)
|
||||
a = gb4-a b = gb4-b c = def-c d = $(d)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
a = va1-a b = def-b c = def-c d = $(d,undefined)
|
||||
a = va2-a b = va2-b c = def-c d = $(d,undefined)
|
||||
a = va3-a b = va3-b c = va3-c d = $(d,undefined)
|
||||
a = va4-a b = va4-b c = va3-c d = $(d,undefined)
|
||||
a = va5-a b = va4-b c = va3-c d = $(d,undefined)
|
||||
a = pt3-a b = pt3-b c = pt3-c d = $(d,undefined)
|
||||
a = va1-a b = def-b c = def-c d = $(d)
|
||||
a = va2-a b = va2-b c = def-c d = $(d)
|
||||
a = va3-a b = va3-b c = va3-c d = $(d)
|
||||
a = va4-a b = va4-b c = va3-c d = $(d)
|
||||
a = va5-a b = va4-b c = va3-c d = $(d)
|
||||
a = pt3-a b = pt3-b c = pt3-c d = $(d)
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
a = 111
|
||||
b = 222
|
||||
c = xx
|
||||
d = $(d,undefined)
|
||||
d = $(d)
|
||||
# comment line
|
||||
a = aaa
|
||||
b = bbb
|
||||
c = ccc
|
||||
d = $(d,undefined)
|
||||
d = $(d)
|
||||
# comment line
|
||||
a = AA
|
||||
b = BB
|
||||
c = xx
|
||||
d = $(d,undefined)
|
||||
d = $(d)
|
||||
# comment line
|
||||
a = aaa
|
||||
b = bbb
|
||||
c = yy
|
||||
d = $(d,undefined)
|
||||
d = $(d)
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
a = 111
|
||||
b = 222
|
||||
c = xx
|
||||
d = $(d,undefined)
|
||||
d = $(d)
|
||||
# comment line
|
||||
a = aaa
|
||||
b = bbb
|
||||
c = ccc
|
||||
d = $(d,undefined)
|
||||
d = $(d)
|
||||
# comment line
|
||||
a = AA
|
||||
b = BB
|
||||
c = xx
|
||||
d = $(d,undefined)
|
||||
d = $(d)
|
||||
# comment line
|
||||
a = aaa
|
||||
b = bbb
|
||||
c = yy
|
||||
d = $(d,undefined)
|
||||
d = $(d)
|
||||
|
||||
21
src/ioc/dbtemplate/test/t7-result.txt
Normal file
21
src/ioc/dbtemplate/test/t7-result.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
This is t1-template.txt
|
||||
|
||||
With $(a,undefined) & $(b,undefined):
|
||||
This is t1-include.txt
|
||||
a = default value used when a is undefined
|
||||
b = default value used when b is undefined
|
||||
End of t1-include.txt
|
||||
|
||||
On defining a=aaa & b=bbb:
|
||||
This is t1-include.txt again
|
||||
a = aaa
|
||||
b = bbb
|
||||
End of t1-include.txt
|
||||
|
||||
On setting a="aa":
|
||||
This is t1-include.txt again
|
||||
a = "aa"
|
||||
b = bbb
|
||||
End of t1-include.txt
|
||||
|
||||
End of t1-template.txt
|
||||
@@ -26,3 +26,4 @@ dbCore_SRCS += miscIocRegister.c
|
||||
dbCore_SRCS += dlload.c
|
||||
dbCore_SRCS += iocshRegisterCommon.c
|
||||
|
||||
miscIocRegister_CFLAGS_iOS = -DSYSTEM_UNAVAILABLE
|
||||
|
||||
@@ -17,9 +17,6 @@
|
||||
#define epicsExportSharedSymbols
|
||||
#include "epicsRelease.h"
|
||||
|
||||
static const char id[] EPICS_UNUSED =
|
||||
"@(#) " EPICS_VERSION_STRING ", Misc. Utilities Library" __DATE__;
|
||||
|
||||
epicsShareFunc int coreRelease(void)
|
||||
{
|
||||
printf ( "############################################################################\n" );
|
||||
|
||||
@@ -66,10 +66,12 @@ void miscIocRegister(void)
|
||||
|
||||
/* system -- escape to system command interpreter.
|
||||
*
|
||||
* Disabled by default, for security reasons. To enable this command, add
|
||||
* Disabled by default for security reasons, not available on all OSs.
|
||||
* To enable this command, add
|
||||
* registrar(iocshSystemCommand)
|
||||
* to an application dbd file.
|
||||
* to an application dbd file, or include system.dbd
|
||||
*/
|
||||
#ifndef SYSTEM_UNAVAILABLE
|
||||
static const iocshArg systemArg0 = { "command string",iocshArgString};
|
||||
static const iocshArg * const systemArgs[] = {&systemArg0};
|
||||
static const iocshFuncDef systemFuncDef = {"system",1,systemArgs};
|
||||
@@ -77,12 +79,15 @@ static void systemCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
system(args[0].sval);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void iocshSystemCommand(void)
|
||||
{
|
||||
#ifndef SYSTEM_UNAVAILABLE
|
||||
if (system(NULL))
|
||||
iocshRegister(&systemFuncDef, systemCallFunc);
|
||||
else
|
||||
#endif
|
||||
errlogPrintf ("Can't register 'system' command -- no command interpreter available.\n");
|
||||
}
|
||||
epicsExportRegistrar(iocshSystemCommand);
|
||||
|
||||
@@ -45,7 +45,6 @@ void rsrv_online_notify_task(void *pParm)
|
||||
caHdr msg;
|
||||
int status;
|
||||
ca_uint32_t beaconCounter = 0;
|
||||
char buf[16];
|
||||
|
||||
taskwdInsert (epicsThreadGetIdSelf(),NULL,NULL);
|
||||
|
||||
@@ -85,10 +84,12 @@ void rsrv_online_notify_task(void *pParm)
|
||||
&pAddr->addr.sa, sizeof(pAddr->addr));
|
||||
if (status < 0) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
ipAddrToDottedIP (&pAddr->addr.ia, buf, sizeof(buf));
|
||||
char sockDipBuf[22];
|
||||
|
||||
epicsSocketConvertErrnoToString(sockErrBuf, sizeof(sockErrBuf));
|
||||
ipAddrToDottedIP(&pAddr->addr.ia, sockDipBuf, sizeof(sockDipBuf));
|
||||
errlogPrintf ( "CAS: CA beacon send to %s error: %s\n",
|
||||
buf, sockErrBuf);
|
||||
sockDipBuf, sockErrBuf);
|
||||
}
|
||||
else {
|
||||
assert (status == sizeof(msg));
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/* flex - tool to generate fast lexical analyzers */
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Vern Paxson.
|
||||
*
|
||||
*
|
||||
* The United States Government has rights in this work pursuant
|
||||
* to contract no. DE-AC03-76SF00098 between the United States
|
||||
* Department of Energy and the University of California.
|
||||
@@ -495,6 +495,13 @@ void flexinit(int argc, char **argv)
|
||||
/* stupid do-nothing deprecated option */
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
if ( i != 1 )
|
||||
flexerror( "-o flag must be given separately" );
|
||||
|
||||
outfile = arg + i + 1;
|
||||
goto get_next_arg;
|
||||
|
||||
case 'p':
|
||||
performance_report = true;
|
||||
break;
|
||||
|
||||
@@ -347,11 +347,6 @@ static int openLogFile (struct ioc_log_server *pserver)
|
||||
{
|
||||
enum TF_RETURN ret;
|
||||
|
||||
if (ioc_log_file_limit==0u) {
|
||||
pserver->poutfile = stderr;
|
||||
return IOCLS_ERROR;
|
||||
}
|
||||
|
||||
if (pserver->poutfile && pserver->poutfile != stderr){
|
||||
fclose (pserver->poutfile);
|
||||
pserver->poutfile = NULL;
|
||||
@@ -627,7 +622,7 @@ static void writeMessagesToLog (struct iocLogClient *pclient)
|
||||
strlen(pclient->ascii_time) + nchar + 3u;
|
||||
assert (nTotChar <= INT_MAX);
|
||||
ntci = (int) nTotChar;
|
||||
if ( pclient->pserver->filePos+ntci >= pclient->pserver->max_file_size ) {
|
||||
if ( pclient->pserver->max_file_size && pclient->pserver->filePos+ntci >= pclient->pserver->max_file_size ) {
|
||||
if ( pclient->pserver->max_file_size >= pclient->pserver->filePos ) {
|
||||
unsigned nPadChar;
|
||||
/*
|
||||
@@ -771,7 +766,7 @@ static int getConfig(void)
|
||||
&EPICS_IOC_LOG_FILE_LIMIT,
|
||||
&ioc_log_file_limit);
|
||||
if(status>=0){
|
||||
if (ioc_log_file_limit<=0) {
|
||||
if (ioc_log_file_limit < 0) {
|
||||
envFailureNotify (&EPICS_IOC_LOG_FILE_LIMIT);
|
||||
return IOCLS_ERROR;
|
||||
}
|
||||
|
||||
@@ -902,11 +902,16 @@ static void refer ( MAC_HANDLE *handle, MAC_ENTRY *entry, int level,
|
||||
}
|
||||
}
|
||||
|
||||
/* Bad reference, insert $(name,errval) */
|
||||
/* Bad reference, insert either $(name,<error>) or $(name) */
|
||||
if ( v < valend ) *v++ = '$';
|
||||
if ( v < valend ) *v++ = '(';
|
||||
cpy2val( refname, &v, valend );
|
||||
cpy2val( errval, &v, valend );
|
||||
if (handle->flags & FLAG_SUPPRESS_WARNINGS) {
|
||||
if ( v < valend ) *v++ = ')';
|
||||
*v = '\0';
|
||||
}
|
||||
else
|
||||
cpy2val( errval, &v, valend );
|
||||
|
||||
cleanup:
|
||||
if (pop) {
|
||||
|
||||
@@ -269,7 +269,7 @@ static int generalTimeGetEventPriority(epicsTimeStamp *pDest, int eventNumber,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (epicsTimeGreaterThanEqual(pDest,
|
||||
if (epicsTimeGreaterThanEqual(&ts,
|
||||
>Pvt.eventTime[eventNumber])) {
|
||||
*pDest = ts;
|
||||
gtPvt.eventTime[eventNumber] = ts;
|
||||
@@ -279,7 +279,6 @@ static int generalTimeGetEventPriority(epicsTimeStamp *pDest, int eventNumber,
|
||||
key = epicsInterruptLock();
|
||||
gtPvt.ErrorCounts++;
|
||||
epicsInterruptUnlock(key);
|
||||
}
|
||||
|
||||
IFDEBUG(10) {
|
||||
char last[40], buff[40];
|
||||
@@ -291,6 +290,7 @@ static int generalTimeGetEventPriority(epicsTimeStamp *pDest, int eventNumber,
|
||||
" %s, using %s instead\n",
|
||||
ptp->name, buff, last);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -34,20 +34,22 @@ extern "C" {
|
||||
|
||||
/* Make printf, puts and putchar use *our* version of stdout */
|
||||
|
||||
#ifdef printf
|
||||
# undef printf
|
||||
#endif /* printf */
|
||||
#define printf epicsStdoutPrintf
|
||||
#ifndef epicsStdioStdPrintfEtc
|
||||
# ifdef printf
|
||||
# undef printf
|
||||
# endif
|
||||
# define printf epicsStdoutPrintf
|
||||
|
||||
#ifdef puts
|
||||
# undef puts
|
||||
#endif /* puts */
|
||||
#define puts epicsStdoutPuts
|
||||
# ifdef puts
|
||||
# undef puts
|
||||
# endif
|
||||
# define puts epicsStdoutPuts
|
||||
|
||||
#ifdef putchar
|
||||
# undef putchar
|
||||
#endif /* putchar */
|
||||
#define putchar epicsStdoutPutchar
|
||||
# ifdef putchar
|
||||
# undef putchar
|
||||
# endif
|
||||
# define putchar epicsStdoutPutchar
|
||||
#endif
|
||||
|
||||
epicsShareFunc int epicsShareAPI epicsSnprintf(
|
||||
char *str, size_t size, const char *format, ...) EPICS_PRINTF_STYLE(3,4);
|
||||
@@ -87,6 +89,17 @@ epicsShareFunc int epicsShareAPI epicsStdoutPutchar(int c);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Also pull functions into the std namespace (see lp:1786927) */
|
||||
namespace std {
|
||||
using ::epicsGetStdin;
|
||||
using ::epicsGetStdout;
|
||||
using ::epicsGetStderr;
|
||||
using ::epicsStdoutPrintf;
|
||||
using ::epicsStdoutPuts;
|
||||
using ::epicsStdoutPutchar;
|
||||
}
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* epicsStdioh */
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "osiProcess.h"
|
||||
#include "errlog.h"
|
||||
|
||||
epicsShareFunc osiGetUserNameReturn epicsShareAPI osiGetUserName (char *pBuf, unsigned bufSizeIn)
|
||||
{
|
||||
@@ -94,16 +94,11 @@ epicsShareFunc osiSpawnDetachedProcessReturn epicsShareAPI osiSpawnDetachedProce
|
||||
pFmtArgs[1] = (char *) pBaseExecutableName;
|
||||
pFmtArgs[2] = errStrMsgBuf;
|
||||
pFmtArgs[3] = "Changes may be required in your \"path\" environment variable.";
|
||||
pFmtArgs[4] = "PATH = ";
|
||||
pFmtArgs[5] = getenv ("path");
|
||||
if ( pFmtArgs[5] == NULL ) {
|
||||
pFmtArgs[5] = "<empty string>";
|
||||
}
|
||||
|
||||
W32status = FormatMessage(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING |
|
||||
FORMAT_MESSAGE_ARGUMENT_ARRAY | 80,
|
||||
"%1 \"%2\". %3 %4 %5 \"%6\"",
|
||||
"%1 \"%2\". %3 %4",
|
||||
0,
|
||||
MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
|
||||
(LPTSTR) &complteMsgBuf,
|
||||
@@ -111,24 +106,20 @@ epicsShareFunc osiSpawnDetachedProcessReturn epicsShareAPI osiSpawnDetachedProce
|
||||
pFmtArgs
|
||||
);
|
||||
if (W32status) {
|
||||
/* Display the string. */
|
||||
MessageBox (NULL, complteMsgBuf, "Configuration Problem",
|
||||
MB_OK | MB_ICONINFORMATION);
|
||||
fprintf (stderr, "%s\n", (char *) complteMsgBuf);
|
||||
LocalFree (complteMsgBuf);
|
||||
}
|
||||
else {
|
||||
/* Display the string. */
|
||||
MessageBox (NULL, errStrMsgBuf, "Failed to start executable",
|
||||
MB_OK | MB_ICONINFORMATION);
|
||||
fprintf (stderr, "%s\n", (char *) errStrMsgBuf);
|
||||
}
|
||||
|
||||
/* Free the buffer. */
|
||||
LocalFree (errStrMsgBuf);
|
||||
}
|
||||
else {
|
||||
errlogPrintf ("!!WARNING!!\n");
|
||||
errlogPrintf ("Unable to locate executable \"%s\".\n", pBaseExecutableName);
|
||||
errlogPrintf ("You may need to modify your \"path\" environment variable.\n");
|
||||
fprintf (stderr, "!!WARNING!!\n");
|
||||
fprintf (stderr, "Unable to locate executable \"%s\".\n", pBaseExecutableName);
|
||||
fprintf (stderr, "You may need to modify your \"path\" environment variable.\n");
|
||||
}
|
||||
return osiSpawnDetachedProcessFail;
|
||||
}
|
||||
|
||||
@@ -41,16 +41,18 @@ static epicsThreadOnceId onceId = EPICS_THREAD_ONCE_INIT;
|
||||
|
||||
|
||||
#ifdef CLOCK_REALTIME
|
||||
/* This code is not used on systems without Posix CLOCK_REALTIME such
|
||||
* as Darwin, but the only way to detect that is from the OS headers,
|
||||
* so the Makefile can't exclude building this file on those systems.
|
||||
/* This code is not used on systems without Posix CLOCK_REALTIME,
|
||||
* but the only way to detect that is from the OS headers, so the
|
||||
* Makefile can't exclude compiling this file on those systems.
|
||||
*/
|
||||
|
||||
/* Forward references */
|
||||
|
||||
static int ClockTimeGetCurrent(epicsTimeStamp *pDest);
|
||||
static void ClockTimeSync(void *dummy);
|
||||
|
||||
#if defined(vxWorks) || defined(__rtems__)
|
||||
static void ClockTimeSync(void *dummy);
|
||||
#endif
|
||||
|
||||
/* ClockTime_Report iocsh command */
|
||||
static const iocshArg ReportArg0 = { "interest_level", iocshArgArgv};
|
||||
@@ -98,12 +100,18 @@ void ClockTime_Init(int synchronize)
|
||||
|
||||
if (synchronize == CLOCKTIME_SYNC) {
|
||||
if (ClockTimePvt.synchronize == CLOCKTIME_NOSYNC) {
|
||||
|
||||
#if defined(vxWorks) || defined(__rtems__)
|
||||
/* Start synchronizing */
|
||||
ClockTimePvt.synchronize = synchronize;
|
||||
|
||||
epicsThreadCreate("ClockTimeSync", epicsThreadPriorityHigh,
|
||||
epicsThreadGetStackSize(epicsThreadStackSmall),
|
||||
ClockTimeSync, NULL);
|
||||
#else
|
||||
errlogPrintf("Clock synchronization must be performed by the OS\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
else {
|
||||
/* No change, sync thread should already be running */
|
||||
@@ -139,6 +147,7 @@ void ClockTime_GetProgramStart(epicsTimeStamp *pDest)
|
||||
|
||||
/* Synchronization thread */
|
||||
|
||||
#if defined(vxWorks) || defined(__rtems__)
|
||||
static void ClockTimeSync(void *dummy)
|
||||
{
|
||||
taskwdInsert(0, NULL, NULL);
|
||||
@@ -177,6 +186,7 @@ static void ClockTimeSync(void *dummy)
|
||||
ClockTimePvt.synchronized = 0;
|
||||
taskwdRemove(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Time Provider Routine */
|
||||
@@ -188,6 +198,7 @@ static int ClockTimeGetCurrent(epicsTimeStamp *pDest)
|
||||
/* If a Hi-Res clock is available and works, use it */
|
||||
#ifdef CLOCK_REALTIME_HR
|
||||
clock_gettime(CLOCK_REALTIME_HR, &clockNow) &&
|
||||
/* Note: Uses the lo-res clock below if the above call fails */
|
||||
#endif
|
||||
clock_gettime(CLOCK_REALTIME, &clockNow);
|
||||
|
||||
@@ -195,9 +206,15 @@ static int ClockTimeGetCurrent(epicsTimeStamp *pDest)
|
||||
clockNow.tv_sec < POSIX_TIME_AT_EPICS_EPOCH) {
|
||||
clockNow.tv_sec = POSIX_TIME_AT_EPICS_EPOCH + 86400;
|
||||
clockNow.tv_nsec = 0;
|
||||
|
||||
#if defined(vxWorks) || defined(__rtems__)
|
||||
clock_settime(CLOCK_REALTIME, &clockNow);
|
||||
errlogPrintf("WARNING: OS Clock time was read before being set.\n"
|
||||
"Using 1990-01-02 00:00:00.000000 UTC\n");
|
||||
#else
|
||||
errlogPrintf("WARNING: OS Clock pre-dates the EPICS epoch!\n"
|
||||
"Using 1990-01-02 00:00:00.000000 UTC\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
epicsTimeFromTimespec(pDest, &clockNow);
|
||||
|
||||
@@ -391,7 +391,7 @@ MAIN(epicsCalcTest)
|
||||
testExpr(isnan(0.));
|
||||
testExpr(isnan(Inf));
|
||||
testExpr(isnan(-Inf));
|
||||
testExpr(isnan(NaN));
|
||||
testExpr(!!isnan(NaN)); // As above
|
||||
testCalc("isnan(0,1,2)", 0);
|
||||
testCalc("isnan(0,1,NaN)", 1);
|
||||
testCalc("isnan(0,NaN,2)", 1);
|
||||
|
||||
@@ -65,11 +65,11 @@ static void ovcheck(void)
|
||||
|
||||
MAIN(macLibTest)
|
||||
{
|
||||
testPlan(91);
|
||||
testPlan(93);
|
||||
|
||||
if (macCreateHandle(&h, NULL))
|
||||
testAbort("macCreateHandle() failed");
|
||||
macSuppressWarning(h, TRUE);
|
||||
eltc(0);
|
||||
|
||||
check("FOO", " FOO");
|
||||
|
||||
@@ -215,6 +215,10 @@ MAIN(macLibTest)
|
||||
check("${FOO,FOO=${FOO}}", "!$(FOO,recursive)");
|
||||
check("${FOO=GRIBBLE,FOO=${FOO}}", "!$(FOO,recursive)");
|
||||
|
||||
macSuppressWarning(h, TRUE);
|
||||
check("$(CRUX)", "!$(CRUX)");
|
||||
check("${FOO}", "!$(BAR)");
|
||||
|
||||
ovcheck();
|
||||
|
||||
return testDone();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "alarm.h"
|
||||
#include "dbDefs.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "recGbl.h"
|
||||
#include "devSup.h"
|
||||
#include "cantProceed.h"
|
||||
@@ -71,13 +72,18 @@ static long init_record(aaiRecord *prec)
|
||||
|
||||
static long read_aai(aaiRecord *prec)
|
||||
{
|
||||
epicsUInt32 nord = prec->nord;
|
||||
long nRequest = prec->nelm;
|
||||
|
||||
dbGetLink(prec->simm == menuYesNoYES ? &prec->siol : &prec->inp,
|
||||
prec->ftvl, prec->bptr, 0, &nRequest);
|
||||
|
||||
if (nRequest > 0) {
|
||||
prec->nord = nRequest;
|
||||
prec->udf=FALSE;
|
||||
if (nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
|
||||
prec->udf = FALSE;
|
||||
if (prec->tsel.type == CONSTANT &&
|
||||
prec->tse == epicsTimeEventDeviceTime)
|
||||
dbGetTimeStamp(&prec->inp, &prec->time);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (c) 2002 Lawrence Berkeley Laboratory,The Control Systems
|
||||
* Group, Systems Engineering Department
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "alarm.h"
|
||||
#include "dbDefs.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
#include "recGbl.h"
|
||||
#include "devSup.h"
|
||||
#include "subArrayRecord.h"
|
||||
@@ -67,6 +68,7 @@ static long init_record(subArrayRecord *prec)
|
||||
static long read_sa(subArrayRecord *prec)
|
||||
{
|
||||
long nRequest = prec->indx + prec->nelm;
|
||||
epicsUInt32 nord = prec->nord;
|
||||
long ecount;
|
||||
|
||||
if (nRequest > prec->malm)
|
||||
@@ -89,6 +91,8 @@ static long read_sa(subArrayRecord *prec)
|
||||
ecount = 0;
|
||||
|
||||
prec->nord = ecount;
|
||||
if (nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
|
||||
if (nRequest > 0 &&
|
||||
prec->tsel.type == CONSTANT &&
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
@@ -67,11 +67,16 @@ static long init_record(waveformRecord *prec)
|
||||
|
||||
static long read_wf(waveformRecord *prec)
|
||||
{
|
||||
epicsUInt32 nord = prec->nord;
|
||||
long nRequest = prec->nelm;
|
||||
|
||||
dbGetLink(&prec->inp, prec->ftvl, prec->bptr, 0, &nRequest);
|
||||
|
||||
if (nRequest > 0) {
|
||||
prec->nord = nRequest;
|
||||
if (nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
|
||||
if (prec->tsel.type == CONSTANT &&
|
||||
prec->tse == epicsTimeEventDeviceTime)
|
||||
dbGetTimeStamp(&prec->inp, &prec->time);
|
||||
|
||||
@@ -146,9 +146,9 @@ Note: Negative index numbers address from the end of the array, with C<-1> being
|
||||
|
||||
=item Square bracket notation C<[start:increment:end]> (shorthand)
|
||||
|
||||
The common square bracket notation with can be used in place of JSON.
|
||||
The common square bracket notation which can be used in place of JSON.
|
||||
Any parameter may be omitted (keeping the colons) to use the default value.
|
||||
If only one colon is included, this means C<[start:end]> with a increment of 1.
|
||||
If only one colon is included, this means C<[start:end]> with an increment of 1.
|
||||
If only a single parameter is used C<[index]> the filter returns one element.
|
||||
|
||||
=item Start index C<"s">
|
||||
|
||||
@@ -206,6 +206,14 @@ static long init_record(aSubRecord *prec, int pass)
|
||||
}
|
||||
strcpy(prec->onam, prec->snam);
|
||||
prec->oval = prec->val;
|
||||
for (i = 0; i < NUM_ARGS; i++) {
|
||||
epicsUInt32 nev = (&prec->neva)[i];
|
||||
|
||||
(&prec->onva)[i] = nev;
|
||||
if (nev)
|
||||
memcpy((&prec->ovla)[i], (&prec->vala)[i],
|
||||
dbValueSize((&prec->ftva)[i]) * nev);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2002 Southeastern Universities Research Association, as
|
||||
* Operator of Thomas Jefferson National Accelerator Facility.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/* recAai.c */
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* Original Author: Dave Barker
|
||||
*
|
||||
* C E B A F
|
||||
*
|
||||
*
|
||||
* Continuous Electron Beam Accelerator Facility
|
||||
* Newport News, Virginia, USA.
|
||||
*
|
||||
@@ -139,12 +139,12 @@ static long init_record(aaiRecord *prec, int pass)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* SIML must be a CONSTANT or a PV_LINK or a DB_LINK */
|
||||
if (prec->siml.type == CONSTANT) {
|
||||
recGblInitConstantLink(&prec->siml,DBF_USHORT,&prec->simm);
|
||||
}
|
||||
|
||||
|
||||
/* must have read_aai function defined */
|
||||
if (pdset->number < 5 || pdset->read_aai == NULL) {
|
||||
recGblRecordError(S_dev_missingSup, prec, "aai: init_record");
|
||||
@@ -204,10 +204,14 @@ static long get_array_info(DBADDR *paddr, long *no_elements, long *offset)
|
||||
static long put_array_info(DBADDR *paddr, long nNew)
|
||||
{
|
||||
aaiRecord *prec = (aaiRecord *)paddr->precord;
|
||||
epicsUInt32 nord = prec->nord;
|
||||
|
||||
prec->nord = nNew;
|
||||
if (prec->nord > prec->nelm)
|
||||
prec->nord = prec->nelm;
|
||||
|
||||
if (nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -220,7 +224,7 @@ static long get_units(DBADDR *paddr, char *units)
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
if (prec->ftvl == DBF_STRING || prec->ftvl == DBF_ENUM)
|
||||
break;
|
||||
break;
|
||||
case indexof(HOPR):
|
||||
case indexof(LOPR):
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
@@ -314,12 +318,11 @@ static void monitor(aaiRecord *prec)
|
||||
|
||||
static long readValue(aaiRecord *prec)
|
||||
{
|
||||
long status;
|
||||
struct aaidset *pdset = (struct aaidset *)prec->dset;
|
||||
long status;
|
||||
|
||||
if (prec->pact == TRUE){
|
||||
status = pdset->read_aai(prec);
|
||||
return status;
|
||||
return pdset->read_aai(prec);
|
||||
}
|
||||
|
||||
status = dbGetLink(&prec->siml, DBR_ENUM, &prec->simm, 0, 0);
|
||||
@@ -327,10 +330,16 @@ static long readValue(aaiRecord *prec)
|
||||
return status;
|
||||
|
||||
if (prec->simm == menuYesNoNO){
|
||||
return pdset->read_aai(prec);
|
||||
epicsUInt32 nord = prec->nord;
|
||||
|
||||
status = pdset->read_aai(prec);
|
||||
if (nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
if (prec->simm == menuYesNoYES){
|
||||
epicsUInt32 nord = prec->nord;
|
||||
/* Device suport is responsible for buffer
|
||||
which might be read-only so we may not be
|
||||
allowed to call dbGetLink on it.
|
||||
@@ -339,10 +348,13 @@ static long readValue(aaiRecord *prec)
|
||||
Thus call device now.
|
||||
*/
|
||||
recGblSetSevr(prec, SIMM_ALARM, prec->sims);
|
||||
return pdset->read_aai(prec);
|
||||
|
||||
status = pdset->read_aai(prec);
|
||||
if (nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
return status;
|
||||
}
|
||||
|
||||
recGblSetSevr(prec, SOFT_ALARM, INVALID_ALARM);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) 2002 Southeastern Universities Research Association, as
|
||||
* Operator of Thomas Jefferson National Accelerator Facility.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/* recAao.c */
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* Original Author: Dave Barker
|
||||
*
|
||||
* C E B A F
|
||||
*
|
||||
*
|
||||
* Continuous Electron Beam Accelerator Facility
|
||||
* Newport News, Virginia, USA.
|
||||
*
|
||||
@@ -204,10 +204,14 @@ static long get_array_info(DBADDR *paddr, long *no_elements, long *offset)
|
||||
static long put_array_info(DBADDR *paddr, long nNew)
|
||||
{
|
||||
aaoRecord *prec = (aaoRecord *)paddr->precord;
|
||||
epicsUInt32 nord = prec->nord;
|
||||
|
||||
prec->nord = nNew;
|
||||
if (prec->nord > prec->nelm)
|
||||
prec->nord = prec->nelm;
|
||||
|
||||
if (nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -220,7 +224,7 @@ static long get_units(DBADDR *paddr, char *units)
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
if (prec->ftvl == DBF_STRING || prec->ftvl == DBF_ENUM)
|
||||
break;
|
||||
break;
|
||||
case indexof(HOPR):
|
||||
case indexof(LOPR):
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
@@ -343,4 +347,3 @@ static long writeValue(aaoRecord *prec)
|
||||
recGblSetSevr(prec, SOFT_ALARM, INVALID_ALARM);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
* Original Author: Bob Dalesio
|
||||
* Date: 7-14-89
|
||||
* Date: 7-14-89
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
@@ -405,11 +405,15 @@ static long get_array_info(DBADDR *paddr, long *no_elements, long *offset)
|
||||
static long put_array_info(DBADDR *paddr, long nNew)
|
||||
{
|
||||
compressRecord *prec = (compressRecord *) paddr->precord;
|
||||
epicsUInt32 nuse = prec->nuse;
|
||||
|
||||
prec->off = (prec->off + nNew) % prec->nsam;
|
||||
prec->nuse += nNew;
|
||||
if (prec->nuse > prec->nsam)
|
||||
prec->nuse = prec->nsam;
|
||||
|
||||
if (nuse != prec->nuse)
|
||||
db_post_events(prec, &prec->nuse, DBE_VALUE | DBE_LOG);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "epicsMath.h"
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
@@ -225,15 +226,17 @@ static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
|
||||
{
|
||||
longinRecord *prec=(longinRecord *)paddr->precord;
|
||||
|
||||
if(dbGetFieldIndex(paddr) == indexof(VAL)){
|
||||
pad->upper_alarm_limit = prec->hihi;
|
||||
pad->upper_warning_limit = prec->high;
|
||||
pad->lower_warning_limit = prec->low;
|
||||
pad->lower_alarm_limit = prec->lolo;
|
||||
} else recGblGetAlarmDouble(paddr,pad);
|
||||
return(0);
|
||||
if (dbGetFieldIndex(paddr) == indexof(VAL)){
|
||||
pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
|
||||
pad->upper_warning_limit = prec->hsv ? prec->high : epicsNAN;
|
||||
pad->lower_warning_limit = prec->lsv ? prec->low : epicsNAN;
|
||||
pad->lower_alarm_limit = prec->llsv ? prec->lolo : epicsNAN;
|
||||
}
|
||||
else
|
||||
recGblGetAlarmDouble(paddr,pad);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void checkAlarms(longinRecord *prec, epicsTimeStamp *timeLast)
|
||||
{
|
||||
enum {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "epicsMath.h"
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
@@ -256,15 +257,17 @@ static long get_alarm_double(DBADDR *paddr,struct dbr_alDouble *pad)
|
||||
{
|
||||
longoutRecord *prec=(longoutRecord *)paddr->precord;
|
||||
|
||||
if(dbGetFieldIndex(paddr) == indexof(VAL)) {
|
||||
pad->upper_alarm_limit = prec->hihi;
|
||||
pad->upper_warning_limit = prec->high;
|
||||
pad->lower_warning_limit = prec->low;
|
||||
pad->lower_alarm_limit = prec->lolo;
|
||||
} else recGblGetAlarmDouble(paddr,pad);
|
||||
return(0);
|
||||
if (dbGetFieldIndex(paddr) == indexof(VAL)) {
|
||||
pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
|
||||
pad->upper_warning_limit = prec->hsv ? prec->high : epicsNAN;
|
||||
pad->lower_warning_limit = prec->lsv ? prec->low : epicsNAN;
|
||||
pad->lower_alarm_limit = prec->llsv ? prec->lolo : epicsNAN;
|
||||
}
|
||||
else
|
||||
recGblGetAlarmDouble(paddr,pad);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void checkAlarms(longoutRecord *prec)
|
||||
{
|
||||
epicsInt32 val, hyst, lalm;
|
||||
|
||||
@@ -93,6 +93,7 @@ static long readValue(stringinRecord *);
|
||||
static long init_record(stringinRecord *prec, int pass)
|
||||
{
|
||||
STATIC_ASSERT(sizeof(prec->oval)==sizeof(prec->val));
|
||||
STATIC_ASSERT(sizeof(prec->sval)==sizeof(prec->val));
|
||||
struct stringindset *pdset;
|
||||
long status;
|
||||
|
||||
@@ -119,7 +120,7 @@ static long init_record(stringinRecord *prec, int pass)
|
||||
if( pdset->init_record ) {
|
||||
if((status=(*pdset->init_record)(prec))) return(status);
|
||||
}
|
||||
strcpy(prec->oval,prec->val);
|
||||
strncpy(prec->oval, prec->val, sizeof(prec->val));
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -193,7 +194,7 @@ static long readValue(stringinRecord *prec)
|
||||
status=dbGetLink(&(prec->siol),DBR_STRING,
|
||||
prec->sval,0,0);
|
||||
if (status==0) {
|
||||
strcpy(prec->val,prec->sval);
|
||||
strncpy(prec->val, prec->sval, sizeof(prec->val));
|
||||
prec->udf=FALSE;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -95,6 +95,7 @@ static long writeValue(stringoutRecord *);
|
||||
static long init_record(stringoutRecord *prec, int pass)
|
||||
{
|
||||
STATIC_ASSERT(sizeof(prec->oval)==sizeof(prec->val));
|
||||
STATIC_ASSERT(sizeof(prec->ivov)==sizeof(prec->val));
|
||||
struct stringoutdset *pdset;
|
||||
long status=0;
|
||||
|
||||
@@ -121,7 +122,7 @@ static long init_record(stringoutRecord *prec, int pass)
|
||||
if( pdset->init_record ) {
|
||||
if((status=(*pdset->init_record)(prec))) return(status);
|
||||
}
|
||||
strcpy(prec->oval,prec->val);
|
||||
strncpy(prec->oval, prec->val, sizeof(prec->val));
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -159,7 +160,7 @@ static long process(stringoutRecord *prec)
|
||||
break;
|
||||
case (menuIvoaSet_output_to_IVOV) :
|
||||
if(prec->pact == FALSE){
|
||||
strcpy(prec->val,prec->ivov);
|
||||
strncpy(prec->val, prec->ivov, sizeof(prec->val));
|
||||
}
|
||||
status=writeValue(prec); /* write the new value */
|
||||
break;
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
* Copyright (c) 2002 Lawrence Berkeley Laboratory,The Control Systems
|
||||
* Group, Systems Engineering Department
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/* recSubArray.c - Record Support Routines for SubArray records
|
||||
/* recSubArray.c - Record Support Routines for SubArray records
|
||||
*
|
||||
*
|
||||
* Author: Carl Lionberger
|
||||
* Date: 090293
|
||||
*
|
||||
* NOTES:
|
||||
* Derived from waveform record.
|
||||
* Derived from waveform record.
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
*/
|
||||
@@ -124,7 +124,7 @@ static long init_record(subArrayRecord *prec, int pass)
|
||||
}
|
||||
|
||||
if (pdset->init_record)
|
||||
return (*pdset->init_record)(prec);
|
||||
return pdset->init_record(prec);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -191,11 +191,14 @@ static long get_array_info(DBADDR *paddr, long *no_elements, long *offset)
|
||||
static long put_array_info(DBADDR *paddr, long nNew)
|
||||
{
|
||||
subArrayRecord *prec = (subArrayRecord *) paddr->precord;
|
||||
epicsUInt32 nord = prec->nord;
|
||||
|
||||
if (nNew > prec->malm)
|
||||
nNew = prec->malm;
|
||||
prec->nord = nNew;
|
||||
if (prec->nord > prec->malm)
|
||||
prec->nord = prec->malm;
|
||||
|
||||
if (nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -208,7 +211,7 @@ static long get_units(DBADDR *paddr, char *units)
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
if (prec->ftvl == DBF_STRING || prec->ftvl == DBF_ENUM)
|
||||
break;
|
||||
break;
|
||||
case indexof(HOPR):
|
||||
case indexof(LOPR):
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
@@ -318,4 +321,3 @@ static long readValue(subArrayRecord *prec)
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
TOP=../../../..
|
||||
|
||||
@@ -37,7 +37,19 @@ testHarness_SRCS += analogMonitorTest_registerRecordDeviceDriver.cpp
|
||||
TESTFILES += $(COMMON_DIR)/analogMonitorTest.dbd ../analogMonitorTest.db
|
||||
TESTS += analogMonitorTest
|
||||
|
||||
TARGETS += $(COMMON_DIR)/scanEventTest.dbd
|
||||
DBDDEPENDS_FILES += scanEventTest.dbd$(DEP)
|
||||
scanEventTest_DBD += base.dbd
|
||||
TESTPROD_HOST += scanEventTest
|
||||
scanEventTest_SRCS += scanEventTest.c
|
||||
scanEventTest_SRCS += scanEventTest_registerRecordDeviceDriver.cpp
|
||||
testHarness_SRCS += scanEventTest.c
|
||||
testHarness_SRCS += scanEventTest_registerRecordDeviceDriver.cpp
|
||||
TESTFILES += $(COMMON_DIR)/scanEventTest.dbd ../scanEventTest.db
|
||||
TESTS += scanEventTest
|
||||
|
||||
TARGETS += $(COMMON_DIR)/regressTest.dbd
|
||||
DBDDEPENDS_FILES += regressTest.dbd$(DEP)
|
||||
regressTest_DBD += base.dbd
|
||||
TESTPROD_HOST += regressTest
|
||||
regressTest_SRCS += regressTest.c
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
int analogMonitorTest(void);
|
||||
int arrayOpTest(void);
|
||||
int scanEventTest(void);
|
||||
|
||||
void epicsRunRecordTests(void)
|
||||
{
|
||||
@@ -23,5 +24,7 @@ void epicsRunRecordTests(void)
|
||||
|
||||
runTest(arrayOpTest);
|
||||
|
||||
runTest(scanEventTest);
|
||||
|
||||
epicsExit(0); /* Trigger test harness */
|
||||
}
|
||||
|
||||
143
src/std/rec/test/scanEventTest.c
Normal file
143
src/std/rec/test/scanEventTest.c
Normal file
@@ -0,0 +1,143 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2018 Paul Scherrer Institut
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
* Author: Dirk Zimoch <dirk.zimoch@psi.ch>
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "dbStaticLib.h"
|
||||
#include "dbAccessDefs.h"
|
||||
#include "dbUnitTest.h"
|
||||
#include "testMain.h"
|
||||
#include "osiFileName.h"
|
||||
#include "epicsThread.h"
|
||||
#include "dbScan.h"
|
||||
|
||||
void scanEventTest_registerRecordDeviceDriver(struct dbBase *);
|
||||
|
||||
/* test name to event number:
|
||||
num = 0 is no event,
|
||||
num > 0 is numeric event
|
||||
num < 0 is string event (use same unique number for aliases)
|
||||
*/
|
||||
const struct {char* name; int num;} events[] = {
|
||||
/* No events */
|
||||
{NULL, 0},
|
||||
{"", 0},
|
||||
{" ", 0},
|
||||
{"0", 0},
|
||||
{"0.000000", 0},
|
||||
{"-0.00000", 0},
|
||||
{"0.9", 0},
|
||||
/* Numeric events */
|
||||
{"2", 2},
|
||||
{"2.000000", 2},
|
||||
{"2.5", 2},
|
||||
{" 2.5 ", 2},
|
||||
{"+0x02", 2},
|
||||
{"3", 3},
|
||||
/* Named events */
|
||||
{"info 1", -1},
|
||||
{" info 1 ", -1},
|
||||
{"-0.9", -2},
|
||||
{"-2", -3},
|
||||
{"-2.000000", -4},
|
||||
{"-2.5", -5},
|
||||
{" -2.5 ", -5},
|
||||
{"nan", -6},
|
||||
{"NaN", -7},
|
||||
{"-NAN", -8},
|
||||
{"-inf", -9},
|
||||
{"inf", -10},
|
||||
};
|
||||
|
||||
MAIN(scanEventTest)
|
||||
{
|
||||
int i, e;
|
||||
int aliases[512] ;
|
||||
int expected_count[512];
|
||||
#define INDX(i) 256-events[i].num
|
||||
#define MAXEV 5
|
||||
|
||||
testPlan(NELEMENTS(events)*2+(MAXEV+1)*5);
|
||||
|
||||
testdbPrepare();
|
||||
|
||||
memset(aliases, 0, sizeof(aliases));
|
||||
memset(expected_count, 0, sizeof(expected_count));
|
||||
|
||||
testdbReadDatabase("scanEventTest.dbd", NULL, NULL);
|
||||
|
||||
scanEventTest_registerRecordDeviceDriver(pdbbase);
|
||||
for (i = 0; i < NELEMENTS(events); i++) {
|
||||
char substitutions[256];
|
||||
sprintf(substitutions, "N=%d,EVENT=%s", i, events[i].name);
|
||||
testdbReadDatabase("scanEventTest.db", NULL, substitutions);
|
||||
}
|
||||
testIocInitOk();
|
||||
testDiag("Test if eventNameToHandle() strips spaces and handles numeric events");
|
||||
for (i = 0; i < NELEMENTS(events); i++) {
|
||||
EVENTPVT pev = eventNameToHandle(events[i].name);
|
||||
/* test that some names are not events (num=0) */
|
||||
if (events[i].num == 0)
|
||||
testOk(pev == NULL, "\"%s\" -> no event", events[i].name);
|
||||
else
|
||||
{
|
||||
expected_count[INDX(i)]++; /* +1 for postEvent */
|
||||
if (events[i].num > 0)
|
||||
{
|
||||
testOk(pev != NULL, "\"%s\" -> numeric event %d", events[i].name, events[i].num);
|
||||
expected_count[INDX(i)]++; /* +1 for post_event */
|
||||
}
|
||||
else
|
||||
{
|
||||
/* test that some strings resolve the same event (num!=0) */
|
||||
if (!aliases[INDX(i)])
|
||||
{
|
||||
aliases[INDX(i)] = i;
|
||||
testOk(pev != NULL, "\"%s\" -> new named event", events[i].name);
|
||||
}
|
||||
else
|
||||
{
|
||||
testOk(pev == eventNameToHandle(events[aliases[INDX(i)]].name),
|
||||
"\"%s\" alias for \"%s\"", events[i].name, events[aliases[INDX(i)]].name);
|
||||
}
|
||||
}
|
||||
}
|
||||
post_event(events[i].num); /* triggers numeric events only */
|
||||
postEvent(pev);
|
||||
}
|
||||
|
||||
testDiag("Check calculated numeric events (backward compatibility)");
|
||||
for (e = 0; e <= MAXEV; e++) {
|
||||
testdbPutFieldOk("eventnum", DBR_LONG, e);
|
||||
testdbGetFieldEqual("e1", DBR_LONG, e);
|
||||
testdbGetFieldEqual("e2", DBR_LONG, e);
|
||||
testdbPutFieldOk("e3", DBR_LONG, e);
|
||||
testdbPutFieldOk("e3.PROC", DBR_LONG, 1);
|
||||
for (i = 0; i < NELEMENTS(events); i++)
|
||||
if (e > 0 && e < 256 && events[i].num == e) { /* numeric events */
|
||||
expected_count[INDX(i)]+=3; /* +1 for eventnum->e1, +1 for e2<-eventnum, +1 for e3 */
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* Allow records to finish processing */
|
||||
testSyncCallback();
|
||||
testDiag("Check if events have been processed the expected number of times");
|
||||
for (i = 0; i < NELEMENTS(events); i++) {
|
||||
char pvname[100];
|
||||
sprintf(pvname, "c%d", i);
|
||||
testDiag("Event \"%s\" expected %d times", events[i].name, expected_count[INDX(i)]);
|
||||
testdbGetFieldEqual(pvname, DBR_LONG, expected_count[INDX(i)]);
|
||||
}
|
||||
|
||||
testIocShutdownOk();
|
||||
|
||||
testdbCleanup();
|
||||
|
||||
return testDone();
|
||||
}
|
||||
16
src/std/rec/test/scanEventTest.db
Normal file
16
src/std/rec/test/scanEventTest.db
Normal file
@@ -0,0 +1,16 @@
|
||||
record(calc, "c$(N)") {
|
||||
field(SCAN, "Event")
|
||||
field(EVNT, "$(EVENT)")
|
||||
field(CALC, "VAL+1")
|
||||
}
|
||||
record(dfanout, "eventnum") {
|
||||
field(OUTA, "e1 PP")
|
||||
field(FLNK, "e2")
|
||||
}
|
||||
record(event, "e1") {
|
||||
}
|
||||
record(event, "e2") {
|
||||
field(INP, "eventnum")
|
||||
}
|
||||
record(event, "e3") {
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/* recWaveform.c - Record Support Routines for Waveform records */
|
||||
@@ -184,12 +184,14 @@ static long get_array_info(DBADDR *paddr, long *no_elements, long *offset)
|
||||
static long put_array_info(DBADDR *paddr, long nNew)
|
||||
{
|
||||
waveformRecord *prec = (waveformRecord *) paddr->precord;
|
||||
epicsUInt32 nord = prec->nord;
|
||||
|
||||
prec->nord = nNew;
|
||||
if (prec->nord > prec->nelm)
|
||||
prec->nord = prec->nelm;
|
||||
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
if (nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -202,7 +204,7 @@ static long get_units(DBADDR *paddr, char *units)
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
if (prec->ftvl == DBF_STRING || prec->ftvl == DBF_ENUM)
|
||||
break;
|
||||
break;
|
||||
case indexof(HOPR):
|
||||
case indexof(LOPR):
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
@@ -305,36 +307,37 @@ static void monitor(waveformRecord *prec)
|
||||
|
||||
static long readValue(waveformRecord *prec)
|
||||
{
|
||||
long status;
|
||||
struct wfdset *pdset = (struct wfdset *) prec->dset;
|
||||
long status;
|
||||
|
||||
if (prec->pact == TRUE){
|
||||
return (*pdset->read_wf)(prec);
|
||||
return pdset->read_wf(prec);
|
||||
}
|
||||
|
||||
status = dbGetLink(&(prec->siml), DBR_ENUM, &(prec->simm),0,0);
|
||||
status = dbGetLink(&prec->siml, DBR_ENUM, &prec->simm, 0, 0);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
if (prec->simm == menuYesNoNO){
|
||||
epicsUInt32 nord = prec->nord;
|
||||
|
||||
status = (*pdset->read_wf)(prec);
|
||||
status = pdset->read_wf(prec);
|
||||
if (nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
return status;
|
||||
}
|
||||
|
||||
if (prec->simm == menuYesNoYES){
|
||||
epicsUInt32 nord = prec->nord;
|
||||
long nRequest = prec->nelm;
|
||||
|
||||
status = dbGetLink(&(prec->siol), prec->ftvl, prec->bptr, 0, &nRequest);
|
||||
/* nord set only for db links: needed for old db_access */
|
||||
status = dbGetLink(&prec->siol, prec->ftvl, prec->bptr, 0, &nRequest);
|
||||
if (prec->siol.type != CONSTANT) {
|
||||
prec->nord = nRequest;
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
if (nord != prec->nord)
|
||||
db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG);
|
||||
if (status == 0)
|
||||
prec->udf=FALSE;
|
||||
prec->udf = FALSE;
|
||||
}
|
||||
} else {
|
||||
recGblSetSevr(prec, SOFT_ALARM, INVALID_ALARM);
|
||||
@@ -344,4 +347,3 @@ static long readValue(waveformRecord *prec)
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
|
||||
if $running_under_some_shell;
|
||||
#!/usr/bin/env perl
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2010 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
|
||||
@@ -198,8 +198,8 @@ static long get_alarm_double(DBADDR *paddr,struct dbr_alDouble *pad)
|
||||
|
||||
static void checkAlarms(xxxRecord *prec)
|
||||
{
|
||||
double val;
|
||||
float hyst, lalm, hihi, high, low, lolo;
|
||||
double val, hyst, lalm;
|
||||
float hihi, high, low, lolo;
|
||||
unsigned short hhsv, llsv, hsv, lsv;
|
||||
|
||||
if(prec->udf == TRUE ){
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
TOP = ../..
|
||||
include $(TOP)/configure/CONFIG
|
||||
ARCH = $(EPICS_HOST_ARCH)
|
||||
TARGETS = envPaths
|
||||
include $(TOP)/configure/RULES.ioc
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
TOP = ../..
|
||||
include $(TOP)/configure/CONFIG
|
||||
ARCH = $(EPICS_HOST_ARCH)
|
||||
TARGETS = envPaths
|
||||
include $(TOP)/configure/RULES.ioc
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user