Compare commits
55 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9dbd4dd39 | ||
|
|
ccf34ae3d0 | ||
|
|
f559c36a6f | ||
|
|
8217fa86fe | ||
|
|
f0e118da91 | ||
|
|
5a55aa17d9 | ||
|
|
f79f2cf8fa | ||
|
|
f0f7a1ef06 | ||
|
|
1412abadf9 | ||
|
|
3a0371894b | ||
|
|
e92a9ae426 | ||
|
|
3a5fb898d6 | ||
|
|
2a14647eec | ||
|
|
597393a8ee | ||
|
|
bad8b25e4e | ||
|
|
7fe8373c32 | ||
|
|
72be690fec | ||
|
|
a5b3157ec1 | ||
|
|
9a062cd6a1 | ||
|
|
592b935146 | ||
|
|
638391249d | ||
|
|
cde682f7ba | ||
|
|
89da4130fc | ||
|
|
1d2637a04e | ||
|
|
a2123db9fb | ||
|
|
7f55bb0386 | ||
|
|
511a541f31 | ||
|
|
394c39da51 | ||
|
|
632d1f45c8 | ||
|
|
0f75e0aa7f | ||
|
|
c93ec231a2 | ||
|
|
d1149a0ba9 | ||
|
|
8c3c5a9731 | ||
|
|
44510f2fb2 | ||
|
|
933733465e | ||
|
|
688f32cff0 | ||
|
|
d3feb1e2f9 | ||
|
|
62c11c22c9 | ||
|
|
736075daf6 | ||
|
|
9ef3b77348 | ||
|
|
d15c8093ec | ||
|
|
0211698b69 | ||
|
|
e860617389 | ||
|
|
e918994704 | ||
|
|
5eb7da4595 | ||
|
|
2206934ae2 | ||
|
|
318fc96912 | ||
|
|
a58cc37a5e | ||
|
|
b5e041b991 | ||
|
|
5e1bad2b34 | ||
|
|
0ae50485cf | ||
|
|
bc7ee94e2c | ||
|
|
3fb10b6d59 | ||
|
|
a8fdf2efeb | ||
|
|
c9eda3ca48 |
@@ -36,7 +36,10 @@ case "$PREFIX" in
|
||||
esac
|
||||
|
||||
# Check for both <tag> and R<tag>
|
||||
if ! [ `git tag -l $TOPREV` ]
|
||||
if [ "$TOPREV" = "HEAD" ]
|
||||
then
|
||||
true
|
||||
elif ! [ `git tag -l $TOPREV` ]
|
||||
then
|
||||
if [ `git tag -l R$TOPREV` ]
|
||||
then
|
||||
|
||||
@@ -30,10 +30,11 @@ endif # BASE_TOP
|
||||
#---------------------------------------------------------------
|
||||
# Where to find the installed build tools
|
||||
# Windows does not like commands with relative paths starting ../
|
||||
# but the Perl scripts in TOP/src/tools are OK
|
||||
# so TOOLS must be an absolute path, although Perl scripts are OK.
|
||||
# FIND_TOOL is for scripts run before the build reaches src/tools.
|
||||
|
||||
TOOLS = $(abspath $(EPICS_BASE_HOST_BIN))
|
||||
FIND_TOOL = $(firstword $(wildcard $(TOOLS)/$(1) $(TOP)/src/tools/$(1)))
|
||||
FIND_TOOL = $(firstword $(wildcard $(TOOLS)/$(1) $(EPICS_BASE)/src/tools/$(1)))
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# EPICS Base build tools and tool flags
|
||||
@@ -54,3 +55,8 @@ INSTALL_LIBRARY = $(INSTALL)
|
||||
# tools for making header dependencies and variable replacement
|
||||
MKMF = $(PERL) $(TOOLS)/mkmf.pl
|
||||
REPLACEVAR = $(PERL) $(TOOLS)/replaceVAR.pl
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# tools for cleaning out unwanted files
|
||||
CVSCLEAN = $(call FIND_TOOL,cvsclean.pl)
|
||||
DEPCLEAN = $(call FIND_TOOL,depclean.pl)
|
||||
|
||||
@@ -52,9 +52,11 @@ EPICS_MODIFICATION = 2
|
||||
|
||||
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
|
||||
# Not included if zero
|
||||
EPICS_PATCH_LEVEL = 0
|
||||
EPICS_PATCH_LEVEL = 2
|
||||
|
||||
# This will end in -DEV between official releases
|
||||
# Between official releases, the EPICS_PATCH_LEVEL gets incremented
|
||||
# and a -DEV suffix is added (similar to the Maven -SNAPSHOT versions)
|
||||
EPICS_DEV_SNAPSHOT=
|
||||
#EPICS_DEV_SNAPSHOT=-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-pre1
|
||||
#EPICS_DEV_SNAPSHOT=-pre1-DEV
|
||||
@@ -64,7 +66,6 @@ EPICS_PATCH_LEVEL = 0
|
||||
#EPICS_DEV_SNAPSHOT=-rc1-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-rc2
|
||||
#EPICS_DEV_SNAPSHOT=-rc2-DEV
|
||||
EPICS_DEV_SNAPSHOT=
|
||||
|
||||
# No changes should be needed below here
|
||||
|
||||
|
||||
@@ -34,14 +34,9 @@
|
||||
# The future dates below assume the rules don't get changed;
|
||||
# see http://www.timeanddate.com/time/dst/2018.html to check.
|
||||
#
|
||||
# DST for 2018 US: Mar 11 - Nov 04
|
||||
# EU: Mar 25 - Oct 28
|
||||
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 = CUS::360:031002:110302
|
||||
#EPICS_TIMEZONE = MET::-60:033102:102703
|
||||
#
|
||||
# DST for 2020 US: Mar 08 - Nov 01
|
||||
@@ -58,6 +53,11 @@ EPICS_TIMEZONE = CUS::360:031102:110402
|
||||
# EU: Mar 27 - Oct 30
|
||||
#EPICS_TIMEZONE = CUS::360:031302:110602
|
||||
#EPICS_TIMEZONE = MET::-60:032702:103003
|
||||
#
|
||||
# DST for 2023 US: Mar 13 - Nov 06
|
||||
# EU: Mar 27 - Oct 30
|
||||
#EPICS_TIMEZONE = CUS::360:031202:110502
|
||||
#EPICS_TIMEZONE = MET::-60:032602:102903
|
||||
|
||||
# EPICS_TS_NTP_INET
|
||||
# NTP time server ip address for VxWorks and RTEMS.
|
||||
|
||||
@@ -202,9 +202,9 @@ endif
|
||||
|
||||
$(TESTPRODNAME) $(PRODNAME): $(PRODUCT_OBJS) $(PROD_RESS) $(PROD_DEPLIBS)
|
||||
|
||||
$(TESTPRODNAME) $(PRODNAME): %$(EXE):
|
||||
$(TESTPRODNAME) $(PRODNAME): %$(EXE): | $(INSTALL_LIB)
|
||||
@$(RM) $@
|
||||
$(DEBUGCMD) $(LINK.cpp)
|
||||
$(LINK.cpp)
|
||||
$(MT_EXE_COMMAND)
|
||||
|
||||
%_ctdt$(OBJ) : %_ctdt.c
|
||||
@@ -305,6 +305,10 @@ $(LOADABLE_SHRLIBNAME): $(LOADABLE_SHRLIB_PREFIX)%$(LOADABLE_SHRLIB_SUFFIX):
|
||||
$(LINK.shrlib)
|
||||
$(MT_DLL_COMMAND)
|
||||
|
||||
$(LIBNAME) $(SHRLIBNAME) $(LOADABLE_SHRLIBNAME): | $(INSTALL_LIB)
|
||||
$(INSTALL_LIB):
|
||||
@$(MKDIR) $@
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# C++ munching for VxWorks
|
||||
|
||||
@@ -467,9 +471,11 @@ $(INSTALL_TCLLIB)/%: ../%
|
||||
@$(INSTALL) -d -m $(BIN_PERMISSIONS) $< $(INSTALL_TCLLIB)
|
||||
endif
|
||||
|
||||
ifneq ($(TCLINDEX),)
|
||||
$(INSTALL_TCLLIB)/$(TCLINDEX): $(INSTALL_TCLLIBS)
|
||||
$(ECHO) "Updating $@"
|
||||
$(ECHO) eval auto_mkindex $(INSTALL_TCLLIB) "$(TCLLIBNAME)" | tclsh
|
||||
endif
|
||||
|
||||
$(INSTALL_LOADABLE_SHRLIBS): $(INSTALL_SHRLIB)/%: %
|
||||
$(ECHO) "Installing loadable shared library $@"
|
||||
@@ -547,6 +553,6 @@ include $(CONFIG)/RULES_EXPAND
|
||||
include $(CONFIG)/RULES_COMMON
|
||||
|
||||
else
|
||||
$(warning RULES_BUILD included more than once. \
|
||||
Use 'make show-makefiles' to work out why.)
|
||||
$(warning Warning: Base configure/RULES_BUILD file included more than once. \
|
||||
Does configure/RELEASE have multiple pointers to $(EPICS_BASE)?)
|
||||
endif # BASE_RULES_BUILD
|
||||
|
||||
@@ -8,16 +8,18 @@
|
||||
# These rules show the set of Makefiles, config files and
|
||||
# rules files loaded by GNUmake.
|
||||
|
||||
# Protect against filenames containing colons (Windows)
|
||||
SAFE_MAKEFILES = $(subst :,__colon__,$(MAKEFILE_LIST))
|
||||
SHOW_MAKEFILES = $(SAFE_MAKEFILES:%=show-makefile.%)
|
||||
show-makefiles: $(SHOW_MAKEFILES)
|
||||
show-makefiles::
|
||||
@echo
|
||||
@echo Makefiles read:
|
||||
define SHOW_MAKEFILE_template
|
||||
show-makefiles::
|
||||
@echo " $(1)"
|
||||
endef
|
||||
$(foreach file,$(MAKEFILE_LIST), \
|
||||
$(eval $(call SHOW_MAKEFILE_template,$(file))))
|
||||
|
||||
# The sort prevents warnings about duplicate targets:
|
||||
$(sort $(SHOW_MAKEFILES)): show-makefile.%:
|
||||
@echo " $(subst __colon__,:,$(@:show-makefile.%=%))"
|
||||
.PHONY: show-makefiles
|
||||
|
||||
.PHONY: show-makefiles show-makefile.%
|
||||
|
||||
# These rules support printing a Makefile variable values.
|
||||
# Many variables are only set inside an O.<arch> build directory.
|
||||
@@ -30,6 +32,17 @@ PRINT.%:
|
||||
.PHONY: PRINT PRINT.%
|
||||
|
||||
|
||||
# Clean rules for recursively deleting editor backup files
|
||||
# and dependency (.d) files from CWD and below.
|
||||
|
||||
cvsclean:
|
||||
$(PERL) $(CVSCLEAN)
|
||||
depclean:
|
||||
$(PERL) $(DEPCLEAN)
|
||||
|
||||
.PHONY: cvsclean depclean
|
||||
|
||||
|
||||
# User specific rules
|
||||
#
|
||||
-include $(HOME)/configure/RULES_USER
|
||||
|
||||
@@ -86,10 +86,11 @@ $(DIRS) $(dirActionTargets) $(dirArchTargets) $(dirActionArchTargets) :
|
||||
$(ARCHS) $(ACTIONS) $(actionArchTargets) :%: \
|
||||
$(foreach dir, $(DIRS), $(dir)$(DIVIDER)%)
|
||||
|
||||
.PHONY : $(DIRS) all host rebuild
|
||||
.PHONY : $(ARCHS) $(ACTIONS)
|
||||
.PHONY : $(dirActionTargets) $(dirArchTargets)
|
||||
.PHONY : $(dirActionArchTargets)
|
||||
.PHONY : $(actionArchTargets)
|
||||
|
||||
.PHONY: $(DIRS) all host rebuild
|
||||
.PHONY: $(ARCHS) $(ACTIONS)
|
||||
.PHONY: $(dirActionTargets) $(dirArchTargets)
|
||||
.PHONY: $(dirActionArchTargets)
|
||||
.PHONY: $(actionArchTargets)
|
||||
|
||||
include $(CONFIG)/RULES_COMMON
|
||||
|
||||
47
configure/RULES_MODULES
Normal file
47
configure/RULES_MODULES
Normal file
@@ -0,0 +1,47 @@
|
||||
#*************************************************************************
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
# Support modules can use these rules to build submodules too.
|
||||
#
|
||||
# The requirements to do so are:
|
||||
# 1. Create a file CONFIG_SITE.local in the same directory as the
|
||||
# Makefile, which defines these variables (the last one is empty):
|
||||
# PARENT_MODULE - The name submodules call their parent
|
||||
# INSTALL_LOCATION := $($(PARENT_MODULE))
|
||||
# CONFIG_INSTALLS =
|
||||
# 2. The Makefile must set TOP and include $(TOP)/configure/CONFIG and
|
||||
# CONFIG_SITE.local
|
||||
# 3. Submodules are added to the SUBMODULES variable in the Makefile
|
||||
# 4. Dependencies between submodules must be set using
|
||||
# <name>_DEPEND_DIRS = <prerequisites>
|
||||
# 5. The Makefile must end by including $(TOP)/configure/RULES_MODULES
|
||||
# 6. Submodules must have a configure/RELEASE file that contains
|
||||
# -include $(TOP)/../RELEASE.$(EPICS_HOST_ARCH).local
|
||||
# 7. Submodules must have a configure/CONFIG_SITE file that contains
|
||||
# -include $(TOP)/../CONFIG_SITE.local
|
||||
|
||||
# Add checked-out submodules to DIRS
|
||||
DIRS += $(subst /Makefile,,$(wildcard $(addsuffix /Makefile, $(SUBMODULES))))
|
||||
|
||||
include $(CONFIG)/RULES_DIRS
|
||||
|
||||
INSTALL_LOCATION_ABS := $(abspath $(INSTALL_LOCATION))
|
||||
RELEASE_LOCAL := RELEASE.$(EPICS_HOST_ARCH).local
|
||||
|
||||
# Ensure that RELEASE.<host>.local exists before doing anything else
|
||||
all host $(DIRS) $(ARCHS) $(ACTIONS) $(dirActionTargets) $(dirArchTargets) \
|
||||
$(dirActionArchTargets) $(actionArchTargets): | $(RELEASE_LOCAL)
|
||||
|
||||
# Convenience target
|
||||
RELEASE.host: $(RELEASE_LOCAL)
|
||||
|
||||
$(RELEASE_LOCAL): Makefile CONFIG_SITE.local
|
||||
$(ECHO) Creating $@ with
|
||||
$(ECHO) " $(PARENT_MODULE) = $(INSTALL_LOCATION_ABS)"
|
||||
@echo $(PARENT_MODULE) = $(INSTALL_LOCATION_ABS)> $@
|
||||
realclean:
|
||||
$(RM) $(wildcard RELEASE.*.local)
|
||||
|
||||
.PHONY: RELEASE.host realclean
|
||||
@@ -9,24 +9,30 @@
|
||||
|
||||
include $(CONFIG)/RULES_DIRS
|
||||
|
||||
# Disable most top rules when installing into a parent's tree, indicated
|
||||
# by PARENT_MODULE being set in the modules/CONFIG_SITE.local file and
|
||||
# INSTALL_LOCATION pointing to the the same place as in the parent.
|
||||
ifeq ($(origin PARENT_MODULE),file)
|
||||
ifeq ($(INSTALL_LOCATION),$($(PARENT_MODULE)))
|
||||
DISABLE_TOP_RULES=YES
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef DISABLE_TOP_RULES
|
||||
#
|
||||
# Rules for a regular application top directory
|
||||
#
|
||||
|
||||
distclean: realclean cvsclean realuninstall
|
||||
|
||||
CVSCLEAN = $(call FIND_TOOL,cvsclean.pl)
|
||||
cvsclean:
|
||||
$(PERL) $(CVSCLEAN)
|
||||
|
||||
DEPCLEAN = $(call FIND_TOOL,depclean.pl)
|
||||
depclean:
|
||||
$(PERL) $(DEPCLEAN)
|
||||
|
||||
realuninstall: uninstallDirs
|
||||
$(RMDIR) $(INSTALL_LOCATION_BIN)
|
||||
$(RMDIR) $(INSTALL_LOCATION_LIB)
|
||||
|
||||
UNINSTALL_DIRS += $(INSTALL_DBD) $(INSTALL_INCLUDE) $(INSTALL_DOC) \
|
||||
$(INSTALL_HTML) $(INSTALL_TEMPLATES) $(INSTALL_DB) $(DIRECTORY_TARGETS)
|
||||
UNINSTALL_DIRS += $(INSTALL_DB) $(INSTALL_DBD) $(INSTALL_DOC) $(INSTALL_HTML)
|
||||
UNINSTALL_DIRS += $(INSTALL_INCLUDE) $(INSTALL_TEMPLATES) $(DIRECTORY_TARGETS)
|
||||
ifneq ($(INSTALL_LOCATION),$(TOP))
|
||||
UNINSTALL_DIRS += $(INSTALL_CONFIG)
|
||||
UNINSTALL_DIRS += $(INSTALL_CONFIG)
|
||||
endif
|
||||
uninstallDirs:
|
||||
$(RMDIR) $(UNINSTALL_DIRS)
|
||||
@@ -40,6 +46,8 @@ uninstall$(DIVIDER)%:
|
||||
$(RMDIR) $(INSTALL_LOCATION_BIN)/$(archPart)
|
||||
$(RMDIR) $(INSTALL_LOCATION_LIB)/$(archPart)
|
||||
|
||||
# Remove the bin and lib directories if they have no sub-directories
|
||||
#
|
||||
cleandirs:
|
||||
@$(NOP)
|
||||
ifeq ($(wildcard $(INSTALL_LOCATION_BIN)/*),)
|
||||
@@ -49,6 +57,16 @@ ifeq ($(wildcard $(INSTALL_LOCATION_LIB)/*),)
|
||||
$(RMDIR) $(INSTALL_LOCATION_LIB)
|
||||
endif
|
||||
|
||||
else
|
||||
#
|
||||
# Using a disabled rule aborts
|
||||
#
|
||||
|
||||
cleandirs distclean uninstall realuninstall archuninstall:
|
||||
$(error Target '$@' not available in a submodule)
|
||||
|
||||
endif # DISABLE_TOP_RULES
|
||||
|
||||
|
||||
help:
|
||||
@echo "Usage: gnumake [options] [target] ..."
|
||||
@@ -64,33 +82,39 @@ help:
|
||||
@echo " Cannot be used within an O.<arch> dir"
|
||||
@echo " rebuild - Same as clean install"
|
||||
@echo " archclean - Removes O.<arch> dirs but not O.Common dir"
|
||||
@echo " runtests - Run self-tests, summarize results"
|
||||
@echo " depclean - Removes .d files from all O.<arch> dirs."
|
||||
@echo " cvsclean - Removes backup files etc. from all dirs below"
|
||||
@echo " runtests - Run self-tests, summarize results immediately"
|
||||
@echo " tapfiles - Run self-tests, save to O.<arch>/*.tap files"
|
||||
@echo " test-results - Summarize all O.<arch>/*.tap files"
|
||||
@echo " clean-tests - Removes all O.<arch>/*.tap files"
|
||||
@echo "\"Partial\" build targets supported by Makefiles:"
|
||||
@echo " host - Builds and installs $(EPICS_HOST_ARCH) only."
|
||||
@echo " inc$(DIVIDER)<arch> - Installs <arch> only header files."
|
||||
@echo " build$(DIVIDER)<arch> - Builds and installs <arch> only."
|
||||
@echo " install$(DIVIDER)<arch> - Builds and installs <arch> only."
|
||||
@echo " clean$(DIVIDER)<arch> - Cleans <arch> binaries in O.<arch> dirs only."
|
||||
@echo " uninstall$(DIVIDER)<arch> - Remove bin & lib directories for <arch> only."
|
||||
@echo "Targets supported by top level Makefile:"
|
||||
ifndef DISABLE_TOP_RULES
|
||||
@echo " archuninstall - Remove bin & lib directories created by this hostarch."
|
||||
@echo " uninstall$(DIVIDER)<arch> - Remove bin & lib directories for <arch> only."
|
||||
@echo " uninstall - Remove install directories created by this hostarch."
|
||||
@echo " realuninstall - Removes ALL install dirs"
|
||||
@echo " distclean - Same as realclean cvsclean realuninstall."
|
||||
@echo " depclean - Removes all .d files from O.<arch> directories."
|
||||
@echo " cvsclean - Removes cvs .#* files in all dirs of directory tree"
|
||||
endif
|
||||
@echo " help - Prints this list of valid make targets "
|
||||
@echo "Indiv. object targets are supported by O.<arch> level Makefile .e.g"
|
||||
@echo "Object targets are supported by the O.<arch> level Makefile .e.g"
|
||||
@echo " xxxRecord.o"
|
||||
|
||||
.PHONY: cleandirs distclean cvsclean depclean
|
||||
.PHONY: cleandirs distclean uninstall help
|
||||
.PHONY: realuninstall archuninstall uninstallDirs
|
||||
.PHONY: uninstall help
|
||||
|
||||
# Include <top>/cfg/TOP_RULES* files from tops defined in RELEASE* files
|
||||
#
|
||||
RELEASE_CFG_TOP_RULES = $(foreach top, $(RELEASE_TOPS), \
|
||||
$(wildcard $($(top))/cfg/TOP_RULES*))
|
||||
ifneq ($(RELEASE_CFG_TOP_RULES),)
|
||||
include $(RELEASE_CFG_TOP_RULES)
|
||||
ifndef DISABLE_TOP_RULES
|
||||
# Include <top>/cfg/TOP_RULES* files from tops defined in RELEASE* files
|
||||
#
|
||||
RELEASE_CFG_TOP_RULES = $(foreach top, $(RELEASE_TOPS), \
|
||||
$(wildcard $($(top))/cfg/TOP_RULES*))
|
||||
ifneq ($(RELEASE_CFG_TOP_RULES),)
|
||||
include $(RELEASE_CFG_TOP_RULES)
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -65,7 +65,7 @@ GNU = NO
|
||||
#
|
||||
# Darwin shared libraries
|
||||
#
|
||||
SHRLIB_LDFLAGS = -dynamiclib -undefined dynamic_lookup \
|
||||
SHRLIB_LDFLAGS = -dynamiclib -flat_namespace -undefined dynamic_lookup \
|
||||
-install_name $(shell $(FULLPATHNAME) $(INSTALL_LIB))/$@ \
|
||||
$(addprefix -compatibility_version , $(SHRLIB_VERSION)) \
|
||||
$(addprefix -current_version , $(SHRLIB_VERSION))
|
||||
|
||||
@@ -20,8 +20,7 @@ release.</p>
|
||||
which should also be read to understand what has changed since an earlier
|
||||
release.</p>
|
||||
|
||||
|
||||
<h1 align="center">EPICS Release 7.0.2</h1>
|
||||
<h1 align="center">EPICS Release 7.0.2.2</h1>
|
||||
|
||||
<!-- Insert new items immediately below this template ...
|
||||
|
||||
@@ -31,6 +30,102 @@ release.</p>
|
||||
|
||||
-->
|
||||
|
||||
<h3>Build System changes</h3>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>The GNUmake build targets <tt>cvsclean</tt> and <tt>depclean</tt> are now
|
||||
available from any directory; previously they were only available from
|
||||
application top directories.</li>
|
||||
|
||||
<li>The approach that EPICS Base uses for building submodules inside the parent
|
||||
module looks useful for support modules too. The rules for building submodules
|
||||
have been modified and extracted into a new <tt>RULES_MODULES</tt> file, so a
|
||||
support module will be able to use them too without having to copy them into its
|
||||
own <tt>modules/Makefile</tt>. There are some specific requirements that support
|
||||
modules and their submodules must follow, which are described as comments in the
|
||||
new <tt>base/configure/RULES_MODULES</tt> file itself.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h3>EPICS_BASE_VERSION Update Policy change</h3>
|
||||
|
||||
<p>In the past, a build of EPICS using sources checked out from the repository
|
||||
branch between official releases would have shown the version number of the
|
||||
previous release, followed by a <q>-DEV</q> suffix, for example
|
||||
<q>7.0.2.1-DEV</q>.</p>
|
||||
|
||||
<p>The policy that controls when the number gets updated has been changed, and
|
||||
now immediately after a release has been tagged the version number will be
|
||||
updated to the next patch release version, plus the <q>-DEV</q> suffix as
|
||||
before. Thus following <q>7.0.2.2</q> the version number will show as
|
||||
<q>7.0.2.3-DEV</q>. This does not require the next official release to be
|
||||
numbered <q>7.0.2.3</q> though, it could become <q>7.0.3</q> or even
|
||||
<q>7.1.0</q> if the changes incorporated into it are more substantial than bug
|
||||
fixes.</p>
|
||||
|
||||
<h3>Drop CLOCK_MONOTONIC_RAW from posix/osdMonotonic.c</h3>
|
||||
|
||||
<p>Turns out this is ~10x slower to query than CLOCK_MONOTONIC.</p>
|
||||
|
||||
|
||||
<h1 align="center">EPICS Release 7.0.2.1</h1>
|
||||
|
||||
<h3>Linking shared libraries on macOS</h3>
|
||||
|
||||
<p>The linker flag <tt>-flat_namespace</tt> has been restored for creating
|
||||
shared libraries, although not for loadable libraries (bundles). This was
|
||||
required for building using the latest versions of Apple XCode.</p>
|
||||
|
||||
<h3>Fix DB_LINK loop breaking</h3>
|
||||
|
||||
<p>A regression was introduced in 7.0.2 which caused record chains with loops to
|
||||
be incorrectly broken. Processing should be skipped when a DB_LINK with Process
|
||||
Passive (PP) closes a loop to a synchronous record.</p>
|
||||
|
||||
<p>Instead in 7.0.2 the targeted record would be processed if processing began
|
||||
with a remote action (or some other caller of <tt>dbPutField()</tt>). This would
|
||||
result in the loop running a second time. The loop would be broken on the second
|
||||
iteration.</p>
|
||||
|
||||
<p><a href="https://bugs.launchpad.net/epics-base/+bug/1809570">See lp:
|
||||
#1809570</a></p>
|
||||
|
||||
<h3>Old dbStaticLib APIs removed</h3>
|
||||
|
||||
<p>Support for some obsolete dbStaticLib Database Configuration Tool (DCT) APIs
|
||||
was removed some time ago, but vestiges of them still remained. The following
|
||||
routines and macros and have now finally been removed:</p>
|
||||
|
||||
<ul>
|
||||
<li>int dbGetFieldType(DBENTRY *pdbentry)</li>
|
||||
<li>int dbGetLinkType(DBENTRY *pdbentry)</li>
|
||||
<li>DCT_STRING</li>
|
||||
<li>DCT_INTEGER</li>
|
||||
<li>DCT_REAL</li>
|
||||
<li>DCT_MENU</li>
|
||||
<li>DCT_MENUFORM</li>
|
||||
<li>DCT_INLINK</li>
|
||||
<li>DCT_OUTLINK</li>
|
||||
<li>DCT_FWDLINK</li>
|
||||
<li>DCT_NOACCESS</li>
|
||||
<li>DCT_LINK_CONSTANT</li>
|
||||
<li>DCT_LINK_FORM</li>
|
||||
<li>DCT_LINK_PV</li>
|
||||
</ul>
|
||||
|
||||
<h3>Fix for <tt>dbhcr</tt> before <tt>iocInit</tt></h3>
|
||||
|
||||
<p>The <tt>dbhcr</tt> command used to work before <tt>iocInit</tt> as well as
|
||||
afterwards. It displays all records that have hardware addresses (VME_IO,
|
||||
CAMAC_IO, GPIB_IO, INST_IO etc.) but stopped working if run before iocInit due
|
||||
to the rewrite of the link address parser code in dbStaticLib. This release
|
||||
fixes that issue, although in some cases the output may be slightly different
|
||||
than it used to be.</p>
|
||||
|
||||
|
||||
<h1 align="center">EPICS Release 7.0.2</h1>
|
||||
|
||||
<h3>Launchpad Bugs</h3>
|
||||
|
||||
<p>The list of tracked bugs fixed in this release can be found on the
|
||||
@@ -920,6 +1015,15 @@ of its CALLBACK objects.</p>
|
||||
|
||||
<!-- Insert inherited items immediately below here ... -->
|
||||
|
||||
<h3>Perl CA bindings fixed for macOS Mojave</h3>
|
||||
|
||||
<p>Apple removed some Perl header files from macOS Mojave that were available
|
||||
in their SDK, requiring a change to the include paths used when compiling the
|
||||
CA bindings. The new version should build on new and older macOS versions, and
|
||||
these changes may also help other targets that have an incomplete installation
|
||||
of Perl (the build will continue after printing a warning that the Perl CA
|
||||
bindings could not be built).</p>
|
||||
|
||||
<h3>Routine <tt>epicsTempName()</tt> removed from libCom</h3>
|
||||
|
||||
<p>This routine was a simple wrapper around the C89 function <tt>tmpnam()</tt>
|
||||
|
||||
@@ -37,6 +37,8 @@ that should be performed when creating production releases of EPICS Base.</p>
|
||||
|
||||
<h3>The Release Process</h3>
|
||||
|
||||
<h4>Full Process</h4>
|
||||
|
||||
<p>The version released on the Feature Freeze date is designated the first
|
||||
pre-release, <tt>-pre1</tt>. The first release candidate <tt>-rc1</tt> is the
|
||||
first version that has undergone testing by the developers and has shown no
|
||||
@@ -49,6 +51,13 @@ release candidate has been available for 2 weeks without any new problems being
|
||||
reported or major changes having to be committed, the final release can be
|
||||
made.</p>
|
||||
|
||||
<h4>Short Process for Patch Releases</h4>
|
||||
|
||||
<p>The Patch Release date and its scope are agreed upon a few weeks ahead of the
|
||||
release. If no blocking issues are raised, the release is made by the Release
|
||||
Manager on or as soon as possible after that date, following the steps below
|
||||
starting at <a href="#ReleaseApproval">Release Approval</a>.</p>
|
||||
|
||||
<h3>Roles</h3>
|
||||
|
||||
<p>The following roles are used below:</p>
|
||||
@@ -64,6 +73,7 @@ made.</p>
|
||||
<dd>Responsible for the EPICS website</dd>
|
||||
</dl>
|
||||
|
||||
<form>
|
||||
<table border="1" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -124,14 +134,14 @@ made.</p>
|
||||
<th colspan="3">Creating pre-release and release-candidate versions</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Release Manager</td>
|
||||
<!-- Submodules... -->
|
||||
<td>Edit and commit changes to the EPICS version number file
|
||||
configure/CONFIG_BASE_VERSION.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Release Manager</td>
|
||||
<td>Tag the module in Git, using these tag conventions:
|
||||
<ul>
|
||||
@@ -153,7 +163,7 @@ made.</p>
|
||||
that are only tagged at the final release.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Release Manager</td>
|
||||
<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
|
||||
@@ -169,27 +179,27 @@ made.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Release Manager</td>
|
||||
<td>Test the tarfile by extracting its contents and building it on at
|
||||
least one supported platform.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Website Manager</td>
|
||||
<td>Copy the tarfile and its signature to the Base download area of the
|
||||
website and add the new files to the website Base download index
|
||||
page.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Website Manager</td>
|
||||
<td>Create or update a website subdirectory to hold the release
|
||||
documentation, and copy in selected files from the base/documentation
|
||||
and base/html directories of the tarfile.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Website Manager</td>
|
||||
<td>Create or modify the webpage for the new release with links to the
|
||||
release documents and tar file. Pre-release and release-candidate
|
||||
@@ -249,10 +259,11 @@ made.</p>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th colspan="3">Release Approval</th>
|
||||
<th colspan="3" id="ReleaseApproval">
|
||||
Release Approval</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Release Manager</td>
|
||||
<td>Obtain a positive <q>Ok to release</q> from all platform developers
|
||||
once a release candidate version has gone for 2 weeks without any major
|
||||
@@ -262,7 +273,7 @@ made.</p>
|
||||
<th colspan="3">Creating the final release version</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Release Manager</td>
|
||||
<td>
|
||||
<p>For each external submodule, check if the module's release version
|
||||
@@ -274,7 +285,7 @@ made.</p>
|
||||
commit.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Release Manager</td>
|
||||
<td>Edit and commit changes to the EPICS Base version number file and
|
||||
the embedded module version files:
|
||||
@@ -286,33 +297,33 @@ made.</p>
|
||||
</ul></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Release Manager</td>
|
||||
<td>Tag the epics-base module in Git:
|
||||
<blockquote><tt>
|
||||
cd base-7.0<br />
|
||||
git tag -m 'ANJ: Tagged for 7.0.2' R7.0.2</i>
|
||||
git tag -m 'ANJ: Tagged for 7.0.2.2' R7.0.2.2</i>
|
||||
</tt></blockquote>
|
||||
Don't push the new tag to the Launchpad repository yet.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Release Manager</td>
|
||||
<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-7.0<br />
|
||||
./.tools/make-tar.sh R7.0.2 base-7.0.2.tar.gz base-7.0.2/
|
||||
./.tools/make-tar.sh R7.0.2.2 base-7.0.2.2.tar.gz base-7.0.2.2/
|
||||
</tt></blockquote>
|
||||
Create a GPG signature file of the tarfile as follows:
|
||||
<blockquote><tt>
|
||||
gpg --armor --sign --detach-sig base-7.0.2.tar.gz
|
||||
gpg --armor --sign --detach-sig base-7.0.2.2.tar.gz
|
||||
</tt></blockquote>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Release Manager</td>
|
||||
<td>Test the tar file by extracting its contents and building it on at
|
||||
least one supported platform. When this succeeds the new git tag can be
|
||||
@@ -323,13 +334,28 @@ made.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Release Manager</td>
|
||||
<td>Edit and commit changes to the EPICS Base version number file and
|
||||
the embedded module version files:
|
||||
<ul>
|
||||
<li>configure/CONFIG_BASE_VERSION </li>
|
||||
<li>modules/libcom/configure/CONFIG_LIBCOM_VERSION</li>
|
||||
<li>modules/ca/configure/CONFIG_CA_VERSION</li>
|
||||
<li>modules/database/configure/CONFIG_DATABASE_VERSION</li>
|
||||
</ul>
|
||||
Version numbers should be set to the next expected patch release,
|
||||
with a "-DEV" tag added (where applicable).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Release Manager</td>
|
||||
<td>Copy the tarfile and its signature to the Base download area of the
|
||||
website.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Release Manager</td>
|
||||
<td>Find all Launchpad bug reports with the status Fix Committed which
|
||||
have been fixed in this release and mark them Fix Released.</td>
|
||||
@@ -338,48 +364,49 @@ made.</p>
|
||||
<th colspan="3">Publish and Announce it</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Website Manager</td>
|
||||
<td>Upload the tar file and its <tt>.asc</tt> signature file to the
|
||||
Launchpad milestone for this release version.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Website Manager</td>
|
||||
<td>Update the website subdirectory that holds the release
|
||||
documentation, and copy in the files from the base/documentation
|
||||
directory of the tarfile.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Website Manager</td>
|
||||
<td>Update the webpage for the new release with links to the release
|
||||
documents and tar file.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Website Manager</td>
|
||||
<td>Add the new release tar file to the website Base download index
|
||||
page.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Website Manager</td>
|
||||
<td>Link to the release webpage from other relevent areas of the
|
||||
website - update front page and sidebars.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Website Manager</td>
|
||||
<td>Add an entry to the website News page, linking to the new version
|
||||
webpage.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>Release Manager</td>
|
||||
<td>Announce the release on the tech-talk mailing list.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -3,8 +3,11 @@
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
# When building submodules, this should always be true:
|
||||
INSTALL_LOCATION = $(EPICS_BASE)
|
||||
# The name our submodules know us by:
|
||||
PARENT_MODULE = EPICS_BASE
|
||||
|
||||
# Stop submodules from installing their configuration files:
|
||||
# When building submodules, this should always be true:
|
||||
INSTALL_LOCATION := $($(PARENT_MODULE))
|
||||
|
||||
# Stop submodules installing their configure/ files into our area
|
||||
CONFIG_INSTALLS =
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
TOP = ..
|
||||
include $(TOP)/configure/CONFIG
|
||||
include CONFIG_SITE.local
|
||||
|
||||
# Submodules for bundle build
|
||||
SUBMODULES += libcom
|
||||
@@ -39,20 +40,4 @@ example_DEPEND_DIRS = pva2pva pvaClient
|
||||
# Allow sites to add extra submodules
|
||||
-include Makefile.local
|
||||
|
||||
# Add only checked-out submodules to DIRS
|
||||
DIRS += $(subst /Makefile,,$(wildcard $(addsuffix /Makefile, $(SUBMODULES))))
|
||||
|
||||
include $(TOP)/configure/RULES_DIRS
|
||||
|
||||
INSTALL_LOCATION_ABS := $(abspath $(INSTALL_LOCATION))
|
||||
RELEASE_LOCAL := RELEASE.$(EPICS_HOST_ARCH).local
|
||||
|
||||
# Ensure that RELEASE.<host>.local exists before doing anything else
|
||||
all host $(DIRS) $(ARCHS) $(ACTIONS) $(dirActionTargets) $(dirArchTargets) \
|
||||
$(dirActionArchTargets) $(actionArchTargets): | $(RELEASE_LOCAL)
|
||||
|
||||
$(RELEASE_LOCAL):
|
||||
$(ECHO) Creating $@, EPICS_BASE = $(INSTALL_LOCATION_ABS)
|
||||
@echo EPICS_BASE = $(INSTALL_LOCATION_ABS)> $@
|
||||
realclean:
|
||||
$(RM) $(RELEASE_LOCAL)
|
||||
include $(TOP)/configure/RULES_MODULES
|
||||
|
||||
@@ -8,6 +8,18 @@
|
||||
TOP = ../..
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
ifdef T_A
|
||||
PERL_VERSION = $(shell $(PERL) ../perlConfig.pl version)
|
||||
PERL_ARCHNAME = $(shell $(PERL) ../perlConfig.pl archname)
|
||||
PERL_ARCHPATH := $(PERL_VERSION)/$(PERL_ARCHNAME)
|
||||
|
||||
PERL_ARCHLIB := $(shell $(PERL) ../perlConfig.pl archlib)
|
||||
PERL_h = $(PERL_ARCHLIB)/CORE/perl.h
|
||||
|
||||
EXTUTILS := $(shell $(PERL) ../perlConfig.pl privlib)/ExtUtils
|
||||
PERLBIN := $(shell $(PERL) ../perlConfig.pl bin)
|
||||
XSUBPP := $(firstword $(wildcard $(PERLBIN)/xsubpp $(EXTUTILS)/xsubpp))
|
||||
|
||||
# Special settings for Darwin:
|
||||
ifeq ($(OS_CLASS),Darwin)
|
||||
# Use hdepends command (not GNU compiler flags)
|
||||
@@ -18,22 +30,23 @@ ifeq ($(OS_CLASS),Darwin)
|
||||
# Perl loadable libraries on Darwin have funny names
|
||||
LOADABLE_SHRLIB_PREFIX =
|
||||
LOADABLE_SHRLIB_SUFFIX = .$(shell $(PERL) ../perlConfig.pl dlext)
|
||||
|
||||
ifeq ($(wildcard $(PERL_h)),)
|
||||
# Perl's headers moved in Mojave
|
||||
SDK_PATH := $(shell xcodebuild -version -sdk macosx Path)
|
||||
PERL_ARCHLIB := $(SDK_PATH)/$(PERL_ARCHLIB)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef T_A
|
||||
PERL_VERSION = $(shell $(PERL) ../perlConfig.pl version)
|
||||
PERL_ARCHNAME = $(shell $(PERL) ../perlConfig.pl archname)
|
||||
PERL_ARCHPATH := $(PERL_VERSION)/$(PERL_ARCHNAME)
|
||||
|
||||
EXTUTILS := $(shell $(PERL) ../perlConfig.pl privlib)/ExtUtils
|
||||
PERLBIN := $(shell $(PERL) ../perlConfig.pl bin)
|
||||
XSUBPP := $(firstword $(wildcard $(PERLBIN)/xsubpp $(EXTUTILS)/xsubpp))
|
||||
|
||||
ifeq ($(T_A),$(EPICS_HOST_ARCH)) # No cross-builds (wrong Perl!)
|
||||
ifeq ($(strip $(XSUBPP)),)
|
||||
$(warning Perl's xsubpp program was not found.)
|
||||
$(warning The Perl CA module will not be built.)
|
||||
else
|
||||
ifeq ($(T_A),$(EPICS_HOST_ARCH)) # No cross-builds (wrong Perl!)
|
||||
ifeq ($(wildcard $(PERL_h)),)
|
||||
$(warning Perl's C header files were not found.)
|
||||
$(warning The Perl CA module will not be built.)
|
||||
else
|
||||
ifeq ($(findstring $(OS_CLASS),WIN32 cygwin32),) # Doesn't build on WIN32
|
||||
LOADABLE_LIBRARY_HOST = Cap5
|
||||
|
||||
@@ -50,10 +63,11 @@ endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
Cap5_SRCS = Cap5.xs
|
||||
Cap5_LIBS = ca Com
|
||||
Cap5_INCLUDES = -I$(shell $(PERL) ../perlConfig.pl archlib)/CORE
|
||||
Cap5_INCLUDES = -I$(PERL_ARCHLIB)/CORE
|
||||
Cap5_CFLAGS = $(shell $(PERL) ../perlConfig.pl ccflags)
|
||||
|
||||
CLEANS += Cap5.c
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
EPICS_DATABASE_MAJOR_VERSION = 3
|
||||
EPICS_DATABASE_MINOR_VERSION = 17
|
||||
EPICS_DATABASE_MAINTENANCE_VERSION = 2
|
||||
EPICS_DATABASE_MAINTENANCE_VERSION = 3
|
||||
EPICS_DATABASE_DEVELOPMENT_FLAG = 0
|
||||
|
||||
@@ -601,6 +601,31 @@ all_done:
|
||||
return status;
|
||||
}
|
||||
|
||||
long dbEntryToAddr(const DBENTRY *pdbentry, DBADDR *paddr)
|
||||
{
|
||||
dbFldDes *pflddes = pdbentry->pflddes;
|
||||
short dbfType = pflddes->field_type;
|
||||
|
||||
paddr->precord = pdbentry->precnode->precord;
|
||||
paddr->pfield = pdbentry->pfield;
|
||||
paddr->pfldDes = pflddes;
|
||||
paddr->no_elements = 1;
|
||||
paddr->field_type = dbfType;
|
||||
paddr->field_size = pflddes->size;
|
||||
paddr->special = pflddes->special;
|
||||
paddr->dbr_field_type = mapDBFToDBR[dbfType];
|
||||
|
||||
if (paddr->special == SPC_DBADDR) {
|
||||
const rset *prset = dbGetRset(paddr);
|
||||
|
||||
/* Let record type modify paddr */
|
||||
if (prset && prset->cvt_dbaddr) {
|
||||
return prset->cvt_dbaddr(paddr);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fill out a database structure (*paddr) for
|
||||
* a record given by the name "pname."
|
||||
@@ -611,9 +636,7 @@ all_done:
|
||||
long dbNameToAddr(const char *pname, DBADDR *paddr)
|
||||
{
|
||||
DBENTRY dbEntry;
|
||||
dbFldDes *pflddes;
|
||||
long status = 0;
|
||||
short dbfType;
|
||||
|
||||
if (!pname || !*pname || !pdbbase)
|
||||
return S_db_notFound;
|
||||
@@ -628,46 +651,28 @@ long dbNameToAddr(const char *pname, DBADDR *paddr)
|
||||
status = dbGetAttributePart(&dbEntry, &pname);
|
||||
if (status) goto finish;
|
||||
|
||||
pflddes = dbEntry.pflddes;
|
||||
dbfType = pflddes->field_type;
|
||||
|
||||
paddr->precord = dbEntry.precnode->precord;
|
||||
paddr->pfield = dbEntry.pfield;
|
||||
paddr->pfldDes = pflddes;
|
||||
paddr->no_elements = 1;
|
||||
paddr->field_type = dbfType;
|
||||
paddr->field_size = pflddes->size;
|
||||
paddr->special = pflddes->special;
|
||||
paddr->dbr_field_type = mapDBFToDBR[dbfType];
|
||||
|
||||
if (paddr->special == SPC_DBADDR) {
|
||||
rset *prset = dbGetRset(paddr);
|
||||
|
||||
/* Let record type modify paddr */
|
||||
if (prset && prset->cvt_dbaddr) {
|
||||
status = prset->cvt_dbaddr(paddr);
|
||||
if (status)
|
||||
goto finish;
|
||||
dbfType = paddr->field_type;
|
||||
}
|
||||
}
|
||||
status = dbEntryToAddr(&dbEntry, paddr);
|
||||
if (status) goto finish;
|
||||
|
||||
/* Handle field modifiers */
|
||||
if (*pname++ == '$') {
|
||||
short dbfType = paddr->field_type;
|
||||
|
||||
/* Some field types can be accessed as char arrays */
|
||||
if (dbfType == DBF_STRING) {
|
||||
paddr->no_elements = paddr->field_size;
|
||||
paddr->field_type = DBF_CHAR;
|
||||
paddr->field_size = 1;
|
||||
paddr->dbr_field_type = DBR_CHAR;
|
||||
} else if (dbfType >= DBF_INLINK && dbfType <= DBF_FWDLINK) {
|
||||
}
|
||||
else if (dbfType >= DBF_INLINK && dbfType <= DBF_FWDLINK) {
|
||||
/* Clients see a char array, but keep original dbfType */
|
||||
paddr->no_elements = PVLINK_STRINGSZ;
|
||||
paddr->field_size = 1;
|
||||
paddr->dbr_field_type = DBR_CHAR;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
status = S_dbLib_fieldNotFound;
|
||||
goto finish;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -679,7 +684,7 @@ finish:
|
||||
void dbInitEntryFromAddr(struct dbAddr *paddr, DBENTRY *pdbentry)
|
||||
{
|
||||
struct dbCommon *prec = paddr->precord;
|
||||
dbCommonPvt *ppvt = CONTAINER(prec, dbCommonPvt, common);
|
||||
dbCommonPvt *ppvt = dbRec2Pvt(prec);
|
||||
|
||||
memset((char *)pdbentry,'\0',sizeof(DBENTRY));
|
||||
|
||||
@@ -693,7 +698,7 @@ void dbInitEntryFromAddr(struct dbAddr *paddr, DBENTRY *pdbentry)
|
||||
|
||||
void dbInitEntryFromRecord(struct dbCommon *prec, DBENTRY *pdbentry)
|
||||
{
|
||||
dbCommonPvt *ppvt = CONTAINER(prec, dbCommonPvt, common);
|
||||
dbCommonPvt *ppvt = dbRec2Pvt(prec);
|
||||
|
||||
memset((char *)pdbentry,'\0',sizeof(DBENTRY));
|
||||
|
||||
|
||||
@@ -204,6 +204,8 @@ struct dbr_alDouble {DBRalDouble};
|
||||
#define S_db_notInit (M_dbAccess|67) /*Not initialized*/
|
||||
#define S_db_bufFull (M_dbAccess|68) /*Buffer full*/
|
||||
|
||||
struct dbEntry;
|
||||
|
||||
epicsShareFunc long dbPutSpecial(struct dbAddr *paddr,int pass);
|
||||
epicsShareFunc rset * dbGetRset(const struct dbAddr *paddr);
|
||||
epicsShareFunc long dbPutAttribute(
|
||||
@@ -213,8 +215,29 @@ epicsShareFunc int dbGetFieldIndex(const struct dbAddr *paddr);
|
||||
epicsShareFunc long dbScanPassive(
|
||||
struct dbCommon *pfrom,struct dbCommon *pto);
|
||||
epicsShareFunc long dbProcess(struct dbCommon *precord);
|
||||
epicsShareFunc long dbNameToAddr(
|
||||
const char *pname,struct dbAddr *);
|
||||
epicsShareFunc long dbNameToAddr(const char *pname, struct dbAddr *paddr);
|
||||
|
||||
/** Initialize DBADDR from a dbEntry
|
||||
* Also handles SPC_DBADDR processing. This is really an internal
|
||||
* routine for use by dbNameToAddr() and dbChannelCreate().
|
||||
*/
|
||||
epicsShareFunc long dbEntryToAddr(const struct dbEntry *pdbentry,
|
||||
struct dbAddr *paddr);
|
||||
|
||||
/** Initialize DBENTRY from a valid dbAddr*
|
||||
* Constant time equivalent of dbInitEntry() then dbFindRecord(),
|
||||
* and finally dbFollowAlias().
|
||||
*/
|
||||
epicsShareFunc void dbInitEntryFromAddr(struct dbAddr *paddr,
|
||||
struct dbEntry *pdbentry);
|
||||
|
||||
/** Initialize DBENTRY from a valid record (dbCommon*)
|
||||
* Constant time equivalent of dbInitEntry() then dbFindRecord(),
|
||||
* and finally dbFollowAlias() when no field is specified.
|
||||
*/
|
||||
epicsShareFunc void dbInitEntryFromRecord(struct dbCommon *prec,
|
||||
struct dbEntry *pdbentry);
|
||||
|
||||
epicsShareFunc devSup* dbDTYPtoDevSup(dbRecordType *prdes, int dtyp);
|
||||
epicsShareFunc devSup* dbDSETtoDevSup(dbRecordType *prdes, struct dset *pdset);
|
||||
epicsShareFunc long dbGetField(
|
||||
|
||||
@@ -473,9 +473,7 @@ dbChannel * dbChannelCreate(const char *name)
|
||||
dbChannel *chan = NULL;
|
||||
char *cname;
|
||||
dbAddr *paddr;
|
||||
dbFldDes *pflddes;
|
||||
long status;
|
||||
short dbfType;
|
||||
|
||||
if (!name || !*name || !pdbbase)
|
||||
return NULL;
|
||||
@@ -498,32 +496,14 @@ dbChannel * dbChannelCreate(const char *name)
|
||||
ellInit(&chan->post_chain);
|
||||
|
||||
paddr = &chan->addr;
|
||||
pflddes = dbEntry.pflddes;
|
||||
dbfType = pflddes->field_type;
|
||||
|
||||
paddr->precord = dbEntry.precnode->precord;
|
||||
paddr->pfield = dbEntry.pfield;
|
||||
paddr->pfldDes = pflddes;
|
||||
paddr->no_elements = 1;
|
||||
paddr->field_type = dbfType;
|
||||
paddr->field_size = pflddes->size;
|
||||
paddr->special = pflddes->special;
|
||||
paddr->dbr_field_type = mapDBFToDBR[dbfType];
|
||||
|
||||
if (paddr->special == SPC_DBADDR) {
|
||||
rset *prset = dbGetRset(paddr);
|
||||
|
||||
/* Let record type modify paddr */
|
||||
if (prset && prset->cvt_dbaddr) {
|
||||
status = prset->cvt_dbaddr(paddr);
|
||||
if (status)
|
||||
goto finish;
|
||||
dbfType = paddr->field_type;
|
||||
}
|
||||
}
|
||||
status = dbEntryToAddr(&dbEntry, paddr);
|
||||
if (status)
|
||||
goto finish;
|
||||
|
||||
/* Handle field modifiers */
|
||||
if (*pname) {
|
||||
short dbfType = paddr->field_type;
|
||||
|
||||
if (*pname == '$') {
|
||||
/* Some field types can be accessed as char arrays */
|
||||
if (dbfType == DBF_STRING) {
|
||||
@@ -531,12 +511,14 @@ dbChannel * dbChannelCreate(const char *name)
|
||||
paddr->field_type = DBF_CHAR;
|
||||
paddr->field_size = 1;
|
||||
paddr->dbr_field_type = DBR_CHAR;
|
||||
} else if (dbfType >= DBF_INLINK && dbfType <= DBF_FWDLINK) {
|
||||
}
|
||||
else if (dbfType >= DBF_INLINK && dbfType <= DBF_FWDLINK) {
|
||||
/* Clients see a char array, but keep original dbfType */
|
||||
paddr->no_elements = PVLINK_STRINGSZ;
|
||||
paddr->field_size = 1;
|
||||
paddr->dbr_field_type = DBR_CHAR;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
status = S_dbLib_fieldNotFound;
|
||||
goto finish;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,27 @@
|
||||
#ifndef DBCOMMONPVT_H
|
||||
#define DBCOMMONPVT_H
|
||||
|
||||
#include <compilerDependencies.h>
|
||||
#include <dbDefs.h>
|
||||
#include "dbCommon.h"
|
||||
|
||||
struct epicsThreadOSD;
|
||||
|
||||
/** Base internal additional information for every record
|
||||
*/
|
||||
typedef struct dbCommonPvt {
|
||||
struct dbRecordNode *recnode;
|
||||
|
||||
/* Thread which is currently processing this record */
|
||||
struct epicsThreadOSD* procThread;
|
||||
|
||||
struct dbCommon common;
|
||||
} dbCommonPvt;
|
||||
|
||||
static EPICS_ALWAYS_INLINE
|
||||
dbCommonPvt* dbRec2Pvt(struct dbCommon *prec)
|
||||
{
|
||||
return CONTAINER(prec, dbCommonPvt, common);
|
||||
}
|
||||
|
||||
#endif // DBCOMMONPVT_H
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
#include "dbAddr.h"
|
||||
#include "dbBase.h"
|
||||
#include "dbBkpt.h"
|
||||
#include "dbCommon.h"
|
||||
#include "dbCommonPvt.h"
|
||||
#include "dbConvertFast.h"
|
||||
#include "dbConvert.h"
|
||||
#include "db_field_log.h"
|
||||
@@ -386,8 +386,11 @@ static long processTarget(dbCommon *psrc, dbCommon *pdst)
|
||||
{
|
||||
char context[40] = "";
|
||||
int trace = dbAccessDebugPUTF && *dbLockSetAddrTrace(psrc);
|
||||
int claim_src = dbRec2Pvt(psrc)->procThread==NULL;
|
||||
int claim_dst = psrc!=pdst && dbRec2Pvt(pdst)->procThread==NULL;
|
||||
long status;
|
||||
epicsUInt8 pact = psrc->pact;
|
||||
epicsThreadId self = epicsThreadGetIdSelf();
|
||||
|
||||
psrc->pact = TRUE;
|
||||
|
||||
@@ -406,14 +409,11 @@ static long processTarget(dbCommon *psrc, dbCommon *pdst)
|
||||
printf("%s: '%s' -> '%s' with PUTF=%u\n",
|
||||
context, psrc->name, pdst->name, psrc->putf);
|
||||
|
||||
if (pdst->putf)
|
||||
errlogPrintf("Warning: '%s.PUTF' found true with PACT false\n",
|
||||
pdst->name);
|
||||
|
||||
pdst->putf = psrc->putf;
|
||||
}
|
||||
else if (psrc->putf) {
|
||||
/* The dst record is busy (awaiting async reprocessing) and
|
||||
else if (psrc->putf && claim_dst) {
|
||||
/* The dst record is busy (awaiting async reprocessing),
|
||||
* not being processed recursively by us, and
|
||||
* we were originally triggered by a call to dbPutField(),
|
||||
* so we mark the dst record for reprocessing once the async
|
||||
* completion is over.
|
||||
@@ -426,17 +426,43 @@ static long processTarget(dbCommon *psrc, dbCommon *pdst)
|
||||
pdst->rpro = TRUE;
|
||||
}
|
||||
else {
|
||||
/* The dst record is busy, but we weren't triggered by a call
|
||||
* to dbPutField(). Do nothing.
|
||||
/* The dst record is busy, but either is being processed recursively,
|
||||
* or wasn't triggered by a call to dbPutField(). Do nothing.
|
||||
*/
|
||||
if (trace)
|
||||
printf("%s: '%s' -> Active '%s', done\n",
|
||||
context, psrc->name, pdst->name);
|
||||
}
|
||||
|
||||
if(claim_src) {
|
||||
dbRec2Pvt(psrc)->procThread = self;
|
||||
}
|
||||
if(claim_dst) {
|
||||
dbRec2Pvt(pdst)->procThread = self;
|
||||
}
|
||||
|
||||
if(dbRec2Pvt(psrc)->procThread!=self ||
|
||||
dbRec2Pvt(pdst)->procThread!=self) {
|
||||
errlogPrintf("Logic Error: processTarget 1 from %p, %s(%p) -> %s(%p)\n",
|
||||
self, psrc->name, dbRec2Pvt(psrc), pdst->name, dbRec2Pvt(pdst));
|
||||
}
|
||||
|
||||
status = dbProcess(pdst);
|
||||
|
||||
psrc->pact = pact;
|
||||
|
||||
if(dbRec2Pvt(psrc)->procThread!=self ||
|
||||
dbRec2Pvt(pdst)->procThread!=self) {
|
||||
errlogPrintf("Logic Error: processTarget 2 from %p, %s(%p) -> %s(%p)\n",
|
||||
self, psrc->name, dbRec2Pvt(psrc), pdst->name, dbRec2Pvt(pdst));
|
||||
}
|
||||
|
||||
if(claim_src) {
|
||||
dbRec2Pvt(psrc)->procThread = NULL;
|
||||
}
|
||||
if(claim_dst) {
|
||||
dbRec2Pvt(pdst)->procThread = NULL;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -86,12 +86,6 @@ typedef struct notifyGlobal {
|
||||
|
||||
static notifyGlobal *pnotifyGlobal = 0;
|
||||
|
||||
/*Local routines*/
|
||||
static void notifyInit(processNotify *ppn);
|
||||
static void notifyCleanup(processNotify *ppn);
|
||||
static void restartCheck(processNotifyRecord *ppnr);
|
||||
static void callDone(dbCommon *precord,processNotify *ppn);
|
||||
static void processNotifyCommon(processNotify *ppn,dbCommon *precord);
|
||||
static void notifyCallback(CALLBACK *pcallback);
|
||||
|
||||
#define ellSafeAdd(list,listnode) \
|
||||
@@ -210,7 +204,7 @@ static void callDone(dbCommon *precord, processNotify *ppn)
|
||||
return;
|
||||
}
|
||||
|
||||
static void processNotifyCommon(processNotify *ppn,dbCommon *precord)
|
||||
static void processNotifyCommon(processNotify *ppn, dbCommon *precord, int first)
|
||||
{
|
||||
notifyPvt *pnotifyPvt = (notifyPvt *) ppn->pnotifyPvt;
|
||||
int didPut = 0;
|
||||
@@ -256,6 +250,9 @@ static void processNotifyCommon(processNotify *ppn,dbCommon *precord)
|
||||
doProcess = 1;
|
||||
|
||||
if (doProcess) {
|
||||
if (first) {
|
||||
precord->putf = TRUE;
|
||||
}
|
||||
ppn->wasProcessed = 1;
|
||||
precord->ppn = ppn;
|
||||
ellSafeAdd(&pnotifyPvt->waitList, &precord->ppnr->waitNode);
|
||||
@@ -298,7 +295,7 @@ static void notifyCallback(CALLBACK *pcallback)
|
||||
return;
|
||||
}
|
||||
if(pnotifyPvt->state == notifyRestartCallbackRequested) {
|
||||
processNotifyCommon(ppn, precord);
|
||||
processNotifyCommon(ppn, precord, 0);
|
||||
return;
|
||||
}
|
||||
/* All done. Clean up and call userCallback */
|
||||
@@ -382,7 +379,7 @@ void dbProcessNotify(processNotify *ppn)
|
||||
precord->ppnr->precord = precord;
|
||||
ellInit(&precord->ppnr->restartList);
|
||||
}
|
||||
processNotifyCommon(ppn, precord);
|
||||
processNotifyCommon(ppn, precord, 1);
|
||||
}
|
||||
|
||||
void dbNotifyCancel(processNotify *ppn)
|
||||
@@ -582,7 +579,7 @@ static void tpnThread(void *pvt)
|
||||
processNotify *ppn = (processNotify *) ptpnInfo->ppn;
|
||||
|
||||
dbProcessNotify(ppn);
|
||||
epicsEventWait(ptpnInfo->callbackDone);
|
||||
epicsEventMustWait(ptpnInfo->callbackDone);
|
||||
dbNotifyCancel(ppn);
|
||||
epicsEventDestroy(ptpnInfo->callbackDone);
|
||||
dbChannelDelete(ppn->chan);
|
||||
|
||||
@@ -434,6 +434,10 @@ static void dbMenuHead(char *name)
|
||||
dbMenu *pdbMenu;
|
||||
GPHENTRY *pgphentry;
|
||||
|
||||
if (!*name) {
|
||||
yyerrorAbort("dbMenuHead: Menu name can't be empty");
|
||||
return;
|
||||
}
|
||||
pgphentry = gphFind(pdbbase->pgpHash,name,&pdbbase->menuList);
|
||||
if(pgphentry) {
|
||||
duplicate = TRUE;
|
||||
@@ -447,6 +451,10 @@ static void dbMenuHead(char *name)
|
||||
|
||||
static void dbMenuChoice(char *name,char *value)
|
||||
{
|
||||
if (!*name) {
|
||||
yyerror("dbMenuChoice: Menu choice name can't be empty");
|
||||
return;
|
||||
}
|
||||
if(duplicate) return;
|
||||
allocTemp(epicsStrDup(name));
|
||||
allocTemp(epicsStrDup(value));
|
||||
@@ -494,6 +502,10 @@ static void dbRecordtypeHead(char *name)
|
||||
dbRecordType *pdbRecordType;
|
||||
GPHENTRY *pgphentry;
|
||||
|
||||
if (!*name) {
|
||||
yyerrorAbort("dbRecordtypeHead: Recordtype name can't be empty");
|
||||
return;
|
||||
}
|
||||
pgphentry = gphFind(pdbbase->pgpHash,name,&pdbbase->recordTypeList);
|
||||
if(pgphentry) {
|
||||
duplicate = TRUE;
|
||||
@@ -512,6 +524,10 @@ static void dbRecordtypeFieldHead(char *name,char *type)
|
||||
dbFldDes *pdbFldDes;
|
||||
int i;
|
||||
|
||||
if (!*name) {
|
||||
yyerrorAbort("dbRecordtypeFieldHead: Field name can't be empty");
|
||||
return;
|
||||
}
|
||||
if(duplicate) return;
|
||||
pdbFldDes = dbCalloc(1,sizeof(dbFldDes));
|
||||
allocTemp(pdbFldDes);
|
||||
@@ -580,7 +596,7 @@ static void dbRecordtypeFieldItem(char *name,char *value)
|
||||
if(sscanf(value,"%hd",&pdbFldDes->special)==1) {
|
||||
return;
|
||||
}
|
||||
yyerror("Illegal special value.");
|
||||
yyerror("Illegal 'special' value.");
|
||||
return;
|
||||
}
|
||||
if(strcmp(name,"pp")==0) {
|
||||
@@ -589,13 +605,13 @@ static void dbRecordtypeFieldItem(char *name,char *value)
|
||||
} else if((strcmp(value,"NO")==0) || (strcmp(value,"FALSE")==0)) {
|
||||
pdbFldDes->process_passive = FALSE;
|
||||
} else {
|
||||
yyerror("Illegal value. Must be NO or YES");
|
||||
yyerror("Illegal 'pp' value, must be YES/NO/TRUE/FALSE");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(strcmp(name,"interest")==0) {
|
||||
if(sscanf(value,"%hd",&pdbFldDes->interest)!=1)
|
||||
yyerror("Illegal value. Must be integer");
|
||||
yyerror("Illegal 'interest' value, must be integer");
|
||||
return;
|
||||
}
|
||||
if(strcmp(name,"base")==0) {
|
||||
@@ -604,13 +620,13 @@ static void dbRecordtypeFieldItem(char *name,char *value)
|
||||
} else if(strcmp(value,"HEX")==0) {
|
||||
pdbFldDes->base = CT_HEX;
|
||||
} else {
|
||||
yyerror("Illegal value. Must be CT_DECIMAL or CT_HEX");
|
||||
yyerror("Illegal 'base' value, must be DECIMAL/HEX");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(strcmp(name,"size")==0) {
|
||||
if(sscanf(value,"%hd",&pdbFldDes->size)!=1)
|
||||
yyerror("Illegal value. Must be integer");
|
||||
yyerror("Illegal 'size' value, must be integer");
|
||||
return;
|
||||
}
|
||||
if(strcmp(name,"extra")==0) {
|
||||
@@ -802,6 +818,10 @@ static void dbDriver(char *name)
|
||||
drvSup *pdrvSup;
|
||||
GPHENTRY *pgphentry;
|
||||
|
||||
if (!*name) {
|
||||
yyerrorAbort("dbDriver: Driver name can't be empty");
|
||||
return;
|
||||
}
|
||||
pgphentry = gphFind(pdbbase->pgpHash,name,&pdbbase->drvList);
|
||||
if(pgphentry) {
|
||||
return;
|
||||
@@ -841,6 +861,10 @@ static void dbRegistrar(char *name)
|
||||
dbText *ptext;
|
||||
GPHENTRY *pgphentry;
|
||||
|
||||
if (!*name) {
|
||||
yyerrorAbort("dbRegistrar: Registrar name can't be empty");
|
||||
return;
|
||||
}
|
||||
pgphentry = gphFind(pdbbase->pgpHash,name,&pdbbase->registrarList);
|
||||
if(pgphentry) {
|
||||
return;
|
||||
@@ -860,6 +884,10 @@ static void dbFunction(char *name)
|
||||
dbText *ptext;
|
||||
GPHENTRY *pgphentry;
|
||||
|
||||
if (!*name) {
|
||||
yyerrorAbort("dbFunction: Function name can't be empty");
|
||||
return;
|
||||
}
|
||||
pgphentry = gphFind(pdbbase->pgpHash,name,&pdbbase->functionList);
|
||||
if(pgphentry) {
|
||||
return;
|
||||
@@ -879,6 +907,10 @@ static void dbVariable(char *name, char *type)
|
||||
dbVariableDef *pvar;
|
||||
GPHENTRY *pgphentry;
|
||||
|
||||
if (!*name) {
|
||||
yyerrorAbort("dbVariable: Variable name can't be empty");
|
||||
return;
|
||||
}
|
||||
pgphentry = gphFind(pdbbase->pgpHash,name,&pdbbase->variableList);
|
||||
if(pgphentry) {
|
||||
return;
|
||||
@@ -899,6 +931,10 @@ static void dbBreakHead(char *name)
|
||||
brkTable *pbrkTable;
|
||||
GPHENTRY *pgphentry;
|
||||
|
||||
if (!*name) {
|
||||
yyerrorAbort("dbBreakHead: Breaktable name can't be empty");
|
||||
return;
|
||||
}
|
||||
pgphentry = gphFind(pdbbase->pgpHash,name,&pdbbase->bptList);
|
||||
if(pgphentry) {
|
||||
duplicate = TRUE;
|
||||
@@ -1001,6 +1037,10 @@ static void dbRecordHead(char *recordType, char *name, int visible)
|
||||
DBENTRY *pdbentry;
|
||||
long status;
|
||||
|
||||
if (!*name) {
|
||||
yyerrorAbort("dbRecordHead: Record name can't be empty");
|
||||
return;
|
||||
}
|
||||
badch = strpbrk(name, " \"'.$");
|
||||
if (badch) {
|
||||
epicsPrintf("Bad character '%c' in record name \"%s\"\n",
|
||||
@@ -1108,6 +1148,10 @@ static void dbRecordInfo(char *name, char *value)
|
||||
tempListNode *ptempListNode;
|
||||
long status;
|
||||
|
||||
if (!*name) {
|
||||
yyerrorAbort("dbRecordInfo: Info item name can't be empty");
|
||||
return;
|
||||
}
|
||||
if (duplicate) return;
|
||||
ptempListNode = (tempListNode *)ellFirst(&tempList);
|
||||
pdbentry = ptempListNode->item;
|
||||
@@ -1132,6 +1176,10 @@ static void dbRecordAlias(char *name)
|
||||
tempListNode *ptempListNode;
|
||||
long status;
|
||||
|
||||
if (!*name) {
|
||||
yyerrorAbort("dbRecordAlias: Alias name can't be empty");
|
||||
return;
|
||||
}
|
||||
if (duplicate) return;
|
||||
ptempListNode = (tempListNode *)ellFirst(&tempList);
|
||||
pdbentry = ptempListNode->item;
|
||||
@@ -1149,6 +1197,10 @@ static void dbAlias(char *name, char *alias)
|
||||
DBENTRY dbEntry;
|
||||
DBENTRY *pdbEntry = &dbEntry;
|
||||
|
||||
if (!*alias) {
|
||||
yyerrorAbort("dbAlias: Alias name can't be empty");
|
||||
return;
|
||||
}
|
||||
dbInitEntry(pdbbase, pdbEntry);
|
||||
if (dbFindRecord(pdbEntry, name)) {
|
||||
epicsPrintf("Alias \"%s\" refers to unknown record \"%s\"\n",
|
||||
|
||||
@@ -79,16 +79,6 @@ epicsShareDef maplinkType pamaplinkType[LINK_NTYPES] = {
|
||||
{"VXI_IO",VXI_IO}
|
||||
};
|
||||
|
||||
static int mapDBFtoDCT[DBF_NOACCESS+1] = {
|
||||
DCT_STRING,
|
||||
DCT_INTEGER,DCT_INTEGER,DCT_INTEGER,DCT_INTEGER,DCT_INTEGER,DCT_INTEGER,
|
||||
DCT_REAL,DCT_REAL,
|
||||
DCT_INTEGER,
|
||||
DCT_MENU,
|
||||
DCT_MENUFORM,
|
||||
DCT_INLINK,DCT_OUTLINK,DCT_FWDLINK,
|
||||
DCT_NOACCESS};
|
||||
|
||||
/*forward references for private routines*/
|
||||
static void dbMsgPrint(DBENTRY *pdbentry, const char *fmt, ...)
|
||||
EPICS_PRINTF_STYLE(2,3);
|
||||
@@ -166,38 +156,6 @@ void dbFreePath(DBBASE *pdbbase)
|
||||
}
|
||||
|
||||
|
||||
static void entryErrMessage(DBENTRY *pdbentry,long status,char *mess)
|
||||
{
|
||||
char message[200];
|
||||
char *pmessage=&message[0];
|
||||
dbRecordNode *precnode = pdbentry->precnode;
|
||||
dbFldDes *pflddes = pdbentry->pflddes;
|
||||
char *pname = NULL;
|
||||
|
||||
*pmessage=0;
|
||||
if(pdbentry->precordType) pname = pdbentry->precordType->name;
|
||||
if(pname) {
|
||||
strcat(pmessage,"RecordType:");
|
||||
strcat(pmessage,pname);
|
||||
}
|
||||
if(precnode){
|
||||
if (dbIsAlias(pdbentry))
|
||||
strcat(pmessage," Record Alias:");
|
||||
else
|
||||
strcat(pmessage," Record:");
|
||||
strcat(pmessage,(char *)precnode->precord);
|
||||
}
|
||||
if(pflddes) {
|
||||
char *pstr=pflddes->name;
|
||||
|
||||
strcat(pmessage," Field:");
|
||||
strcat(pmessage,pstr);
|
||||
}
|
||||
strcat(pmessage,"\n");
|
||||
strcat(pmessage,mess);
|
||||
errMessage(status,pmessage);
|
||||
}
|
||||
|
||||
static void zeroDbentry(DBENTRY *pdbentry)
|
||||
{
|
||||
/*NOTE that pdbbase and message MUST NOT be set to NULL*/
|
||||
@@ -1398,19 +1356,6 @@ long dbNextField(DBENTRY *pdbentry,int dctonly)
|
||||
}
|
||||
}
|
||||
|
||||
int dbGetFieldType(DBENTRY *pdbentry)
|
||||
{
|
||||
dbFldDes *pflddes = pdbentry->pflddes;
|
||||
long status;
|
||||
|
||||
if(!pflddes){
|
||||
status = S_dbLib_flddesNotFound;
|
||||
entryErrMessage(pdbentry,status,"dbGetFieldType");
|
||||
return(status);
|
||||
}
|
||||
return(mapDBFtoDCT[pflddes->field_type]);
|
||||
}
|
||||
|
||||
int dbGetNFields(DBENTRY *pdbentry,int dctonly)
|
||||
{
|
||||
dbRecordType *precordType = pdbentry->precordType;
|
||||
@@ -3216,48 +3161,21 @@ int dbGetNLinks(DBENTRY *pdbentry)
|
||||
return((int)precordType->no_links);
|
||||
}
|
||||
|
||||
long dbGetLinkField(DBENTRY *pdbentry,int index)
|
||||
long dbGetLinkField(DBENTRY *pdbentry, int index)
|
||||
{
|
||||
dbRecordType *precordType = pdbentry->precordType;
|
||||
dbFldDes *pflddes;
|
||||
dbRecordType *precordType = pdbentry->precordType;
|
||||
dbFldDes *pflddes;
|
||||
|
||||
if (!precordType)
|
||||
return S_dbLib_recordTypeNotFound;
|
||||
|
||||
if (index < 0 || index >= precordType->no_links)
|
||||
return S_dbLib_badLink;
|
||||
|
||||
if(!precordType) return(S_dbLib_recordTypeNotFound);
|
||||
if(index<0 || index>=precordType->no_links) return(S_dbLib_badLink);
|
||||
pdbentry->indfield = precordType->link_ind[index];
|
||||
pdbentry->pflddes = pflddes = precordType->papFldDes[pdbentry->indfield];
|
||||
dbGetFieldAddress(pdbentry);
|
||||
return(0);
|
||||
}
|
||||
|
||||
int dbGetLinkType(DBENTRY *pdbentry)
|
||||
{
|
||||
dbFldDes *pflddes;
|
||||
DBLINK *plink;
|
||||
int field_type;
|
||||
|
||||
dbGetFieldAddress(pdbentry);
|
||||
pflddes = pdbentry->pflddes;
|
||||
if(!pflddes) return(-1);
|
||||
plink = (DBLINK *)pdbentry->pfield;
|
||||
if(!plink) return(-1);
|
||||
field_type = pflddes->field_type;
|
||||
switch (field_type) {
|
||||
case DBF_INLINK:
|
||||
case DBF_OUTLINK:
|
||||
case DBF_FWDLINK:
|
||||
switch(plink->type) {
|
||||
case CONSTANT:
|
||||
return(DCT_LINK_CONSTANT);
|
||||
case PV_LINK:
|
||||
case PN_LINK:
|
||||
case DB_LINK:
|
||||
case CA_LINK:
|
||||
return(DCT_LINK_PV);
|
||||
default:
|
||||
return(DCT_LINK_FORM);
|
||||
}
|
||||
}
|
||||
return(-1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dbDumpPath(DBBASE *pdbbase)
|
||||
@@ -3556,68 +3474,110 @@ void dbDumpBreaktable(DBBASE *pdbbase,const char *name)
|
||||
return;
|
||||
}
|
||||
|
||||
static char *bus[VXI_IO+1] = {"","","VME","CAMAC","AB",
|
||||
"GPIB","BITBUS","","","","","","INST","BBGPIB","VXI"};
|
||||
void dbReportDeviceConfig(dbBase *pdbbase,FILE *report)
|
||||
static char *bus[LINK_NTYPES] = {
|
||||
"", /* CONSTANT */
|
||||
NULL, /* PV_LINK */
|
||||
"VME",
|
||||
"CAMAC",
|
||||
"AB",
|
||||
"GPIB",
|
||||
"BITBUS",
|
||||
NULL, /* MACRO_LINK */
|
||||
NULL, /* JSON_LINK */
|
||||
NULL, /* PN_LINK */
|
||||
NULL, /* DB_LINK */
|
||||
NULL, /* CA_LINK */
|
||||
"INST",
|
||||
"BBGPIB",
|
||||
"VXI"
|
||||
};
|
||||
void dbReportDeviceConfig(dbBase *pdbbase, FILE *report)
|
||||
{
|
||||
DBENTRY dbentry;
|
||||
DBENTRY *pdbentry=&dbentry;
|
||||
long status;
|
||||
char linkValue[messagesize];
|
||||
char dtypValue[50];
|
||||
char cvtValue[40];
|
||||
int ilink,nlinks;
|
||||
struct link *plink;
|
||||
int linkType;
|
||||
FILE *stream = (report==0) ? stdout : report;
|
||||
DBENTRY dbentry, *pdbentry = &dbentry;
|
||||
long status;
|
||||
FILE *stream = report ? report : stdout;
|
||||
|
||||
if(!pdbbase) {
|
||||
fprintf(stderr,"pdbbase not specified\n");
|
||||
return;
|
||||
if (!pdbbase) {
|
||||
fprintf(stderr, "dbReportDeviceConfig: pdbbase not specified\n");
|
||||
return;
|
||||
}
|
||||
|
||||
dbInitEntry(pdbbase,pdbentry);
|
||||
status = dbFirstRecordType(pdbentry);
|
||||
while(!status) {
|
||||
status = dbFirstRecord(pdbentry);
|
||||
while(!status) {
|
||||
nlinks = dbGetNLinks(pdbentry);
|
||||
for(ilink=0; ilink<nlinks; ilink++) {
|
||||
status = dbGetLinkField(pdbentry,ilink);
|
||||
if(status || dbGetLinkType(pdbentry)!=DCT_LINK_FORM) continue;
|
||||
plink = pdbentry->pfield;
|
||||
linkType = plink->type;
|
||||
if(bus[linkType][0]==0) continue;
|
||||
strncpy(linkValue, dbGetString(pdbentry), NELEMENTS(linkValue)-1);
|
||||
linkValue[NELEMENTS(linkValue)-1] = '\0';
|
||||
status = dbFindField(pdbentry,"DTYP");
|
||||
if(status) break;
|
||||
strcpy(dtypValue,dbGetString(pdbentry));
|
||||
status = dbFindField(pdbentry,"LINR");
|
||||
if(status) {
|
||||
cvtValue[0] = 0;
|
||||
} else {
|
||||
if(strcmp(dbGetString(pdbentry),"LINEAR")!=0) {
|
||||
cvtValue[0] = 0;
|
||||
} else {
|
||||
strcpy(cvtValue,"cvt(");
|
||||
status = dbFindField(pdbentry,"EGUL");
|
||||
if(!status) strcat(cvtValue,dbGetString(pdbentry));
|
||||
status = dbFindField(pdbentry,"EGUF");
|
||||
if(!status) {
|
||||
strcat(cvtValue,",");
|
||||
strcat(cvtValue,dbGetString(pdbentry));
|
||||
}
|
||||
strcat(cvtValue,")");
|
||||
}
|
||||
}
|
||||
fprintf(stream,"%-8s %-20s %-20s %-20s %-s\n",
|
||||
bus[linkType],linkValue,dtypValue,
|
||||
dbGetRecordName(pdbentry),cvtValue);
|
||||
break;
|
||||
}
|
||||
status = dbNextRecord(pdbentry);
|
||||
}
|
||||
status = dbNextRecordType(pdbentry);
|
||||
while (!status) {
|
||||
const int nlinks = dbGetNLinks(pdbentry);
|
||||
|
||||
status = dbFirstRecord(pdbentry);
|
||||
while (!status) {
|
||||
int ilink;
|
||||
|
||||
for (ilink=0; ilink<nlinks; ilink++) {
|
||||
char linkValue[messagesize];
|
||||
char dtypValue[50];
|
||||
char cvtValue[40];
|
||||
struct link *plink;
|
||||
int linkType;
|
||||
|
||||
status = dbGetLinkField(pdbentry, ilink);
|
||||
if (status)
|
||||
continue;
|
||||
|
||||
plink = pdbentry->pfield;
|
||||
linkType = plink->type;
|
||||
if (plink->text) { /* Not yet parsed */
|
||||
dbLinkInfo linfo;
|
||||
|
||||
if (dbParseLink(plink->text, pdbentry->pflddes->field_type, &linfo))
|
||||
continue;
|
||||
|
||||
linkType = linfo.ltype;
|
||||
if (linkType && bus[linkType])
|
||||
strncpy(linkValue, plink->text, messagesize-1);
|
||||
|
||||
dbFreeLinkInfo(&linfo);
|
||||
}
|
||||
else {
|
||||
strncpy(linkValue, dbGetString(pdbentry), messagesize-1);
|
||||
}
|
||||
|
||||
if (!linkType || !bus[linkType])
|
||||
continue;
|
||||
linkValue[messagesize-1] = '\0';
|
||||
|
||||
status = dbFindField(pdbentry, "DTYP");
|
||||
if (status)
|
||||
break; /* Next record type */
|
||||
|
||||
strcpy(dtypValue, dbGetString(pdbentry));
|
||||
status = dbFindField(pdbentry, "LINR");
|
||||
if (status) {
|
||||
cvtValue[0] = 0;
|
||||
}
|
||||
else {
|
||||
if (strcmp(dbGetString(pdbentry), "LINEAR") != 0) {
|
||||
cvtValue[0] = 0;
|
||||
}
|
||||
else {
|
||||
strcpy(cvtValue,"cvt(");
|
||||
status = dbFindField(pdbentry, "EGUL");
|
||||
if (!status)
|
||||
strcat(cvtValue, dbGetString(pdbentry));
|
||||
status = dbFindField(pdbentry, "EGUF");
|
||||
if (!status) {
|
||||
strcat(cvtValue, ",");
|
||||
strcat(cvtValue, dbGetString(pdbentry));
|
||||
}
|
||||
strcat(cvtValue, ")");
|
||||
}
|
||||
}
|
||||
fprintf(stream,"%-8s %-20s %-20s %-20s %-s\n",
|
||||
bus[linkType], linkValue, dtypValue,
|
||||
dbGetRecordName(pdbentry), cvtValue);
|
||||
break;
|
||||
}
|
||||
status = dbNextRecord(pdbentry);
|
||||
}
|
||||
status = dbNextRecordType(pdbentry);
|
||||
}
|
||||
dbFinishEntry(pdbentry);
|
||||
finishOutstream(stream);
|
||||
|
||||
@@ -28,25 +28,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*Field types as seen by static database access clients*/
|
||||
#define DCT_STRING 0
|
||||
#define DCT_INTEGER 1
|
||||
#define DCT_REAL 2
|
||||
#define DCT_MENU 3
|
||||
#define DCT_MENUFORM 4
|
||||
#define DCT_INLINK 5
|
||||
#define DCT_OUTLINK 6
|
||||
#define DCT_FWDLINK 7
|
||||
#define DCT_NOACCESS 8
|
||||
|
||||
/*Link types as seen by static database access clients*/
|
||||
#define DCT_LINK_CONSTANT 0
|
||||
#define DCT_LINK_FORM 1
|
||||
#define DCT_LINK_PV 2
|
||||
|
||||
typedef dbBase DBBASE;
|
||||
|
||||
typedef struct{
|
||||
typedef struct dbEntry {
|
||||
DBBASE *pdbbase;
|
||||
dbRecordType *precordType;
|
||||
dbFldDes *pflddes;
|
||||
@@ -57,9 +41,6 @@ typedef struct{
|
||||
short indfield;
|
||||
} DBENTRY;
|
||||
|
||||
struct dbAddr;
|
||||
struct dbCommon;
|
||||
|
||||
/* Static database access routines*/
|
||||
epicsShareFunc DBBASE * dbAllocBase(void);
|
||||
epicsShareFunc void dbFreeBase(DBBASE *pdbbase);
|
||||
@@ -68,18 +49,6 @@ epicsShareFunc void dbFreeEntry(DBENTRY *pdbentry);
|
||||
epicsShareFunc void dbInitEntry(DBBASE *pdbbase,
|
||||
DBENTRY *pdbentry);
|
||||
|
||||
/** Initialize DBENTRY from a valid dbAddr*.
|
||||
* Constant time equivalent of dbInitEntry() then dbFindRecord(),
|
||||
* and finally dbFollowAlias()
|
||||
*/
|
||||
epicsShareFunc void dbInitEntryFromAddr(struct dbAddr *paddr, DBENTRY *pdbentry);
|
||||
|
||||
/** Initialize DBENTRY from a valid record (dbCommon*).
|
||||
* Constant time equivalent of dbInitEntry() then dbFindRecord(),
|
||||
* and finally dbFollowAlias() when no field is specified.
|
||||
*/
|
||||
epicsShareFunc void dbInitEntryFromRecord(struct dbCommon *prec, DBENTRY *pdbentry);
|
||||
|
||||
epicsShareFunc void dbFinishEntry(DBENTRY *pdbentry);
|
||||
epicsShareFunc DBENTRY * dbCopyEntry(DBENTRY *pdbentry);
|
||||
epicsShareFunc void dbCopyEntryContents(DBENTRY *pfrom,
|
||||
@@ -139,7 +108,6 @@ epicsShareFunc long dbGetAttributePart(DBENTRY *pdbentry,
|
||||
|
||||
epicsShareFunc long dbFirstField(DBENTRY *pdbentry, int dctonly);
|
||||
epicsShareFunc long dbNextField(DBENTRY *pdbentry, int dctonly);
|
||||
epicsShareFunc int dbGetFieldType(DBENTRY *pdbentry);
|
||||
epicsShareFunc int dbGetNFields(DBENTRY *pdbentry, int dctonly);
|
||||
epicsShareFunc char * dbGetFieldName(DBENTRY *pdbentry);
|
||||
epicsShareFunc char * dbGetDefault(DBENTRY *pdbentry);
|
||||
@@ -231,7 +199,6 @@ epicsShareFunc linkSup * dbFindLinkSup(dbBase *pdbbase,
|
||||
|
||||
epicsShareFunc int dbGetNLinks(DBENTRY *pdbentry);
|
||||
epicsShareFunc long dbGetLinkField(DBENTRY *pdbentry, int index);
|
||||
epicsShareFunc int dbGetLinkType(DBENTRY *pdbentry);
|
||||
|
||||
/* Dump routines */
|
||||
epicsShareFunc void dbDumpPath(DBBASE *pdbbase);
|
||||
|
||||
@@ -179,7 +179,7 @@ long dbFreeRecord(DBENTRY *pdbentry)
|
||||
if(!pdbRecordType) return(S_dbLib_recordTypeNotFound);
|
||||
if(!precnode) return(S_dbLib_recNotFound);
|
||||
if(!precnode->precord) return(S_dbLib_recNotFound);
|
||||
free(CONTAINER(precnode->precord, dbCommonPvt, common));
|
||||
free(dbRec2Pvt(precnode->precord));
|
||||
precnode->precord = NULL;
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -183,17 +183,16 @@ static long special(DBADDR *paddr, int after)
|
||||
|
||||
#define indexof(field) int64inRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr,char *units)
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
{
|
||||
int64inRecord *prec=(int64inRecord *)paddr->precord;
|
||||
int64inRecord *prec = (int64inRecord *) paddr->precord;
|
||||
|
||||
if(paddr->pfldDes->field_type == DBF_LONG) {
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
if (paddr->pfldDes->field_type == DBF_INT64) {
|
||||
strncpy(units, prec->egu, DB_UNITS_SIZE);
|
||||
}
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
|
||||
{
|
||||
int64inRecord *prec=(int64inRecord *)paddr->precord;
|
||||
@@ -255,7 +254,7 @@ static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
|
||||
|
||||
static void checkAlarms(int64inRecord *prec, epicsTimeStamp *timeLast)
|
||||
{
|
||||
enum {
|
||||
enum {
|
||||
range_Lolo = 1,
|
||||
range_Low,
|
||||
range_Normal,
|
||||
|
||||
@@ -212,7 +212,7 @@ sub _getline {
|
||||
|
||||
my $line = readline $self->{stdout};
|
||||
if (defined $line) {
|
||||
chomp $line;
|
||||
$line =~ s/[\r\n]+ $//x; # chomp broken on Windows?
|
||||
printf "#%d >> %s\n", $self->{pid}, $line if $self->{debug};
|
||||
}
|
||||
elsif (eof($self->{stdout})) {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <testMain.h>
|
||||
#include <dbUnitTest.h>
|
||||
#include <errlog.h>
|
||||
#include <dbCommon.h>
|
||||
#include <dbAccess.h>
|
||||
#include <epicsEvent.h>
|
||||
@@ -16,6 +17,7 @@
|
||||
#include <iocsh.h>
|
||||
#include "registryFunction.h"
|
||||
#include <subRecord.h>
|
||||
#include <dbScan.h>
|
||||
|
||||
epicsEventId done;
|
||||
static int waitFor;
|
||||
@@ -28,11 +30,17 @@ long doneSubr(subRecord *prec)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
void dummydone(void *usr, struct dbCommon* prec)
|
||||
{
|
||||
epicsEventMustTrigger(done);
|
||||
}
|
||||
|
||||
void asyncproctest_registerRecordDeviceDriver(struct dbBase *);
|
||||
|
||||
MAIN(asyncproctest)
|
||||
{
|
||||
testPlan(21);
|
||||
testPlan(27);
|
||||
|
||||
done = epicsEventMustCreate(epicsEventEmpty);
|
||||
|
||||
@@ -99,6 +107,40 @@ MAIN(asyncproctest)
|
||||
testdbGetFieldEqual("chain3", DBF_LONG, 7);
|
||||
testdbGetFieldEqual("chain3.A", DBF_LONG, 2);
|
||||
|
||||
testDiag("===== Chain 4 ======");
|
||||
|
||||
{
|
||||
dbCommon *dummy=testdbRecordPtr("chain4_dummy");
|
||||
|
||||
testdbPutFieldOk("chain4_pos.PROC", DBF_LONG, 0);
|
||||
|
||||
/* sync once queue to wait for any queued RPRO */
|
||||
scanOnceCallback(dummy, dummydone, NULL);
|
||||
|
||||
if (epicsEventWaitWithTimeout(done, 10.0) != epicsEventOK)
|
||||
testAbort("Processing timed out");
|
||||
|
||||
testdbGetFieldEqual("chain4_pos", DBF_SHORT, 1);
|
||||
testdbGetFieldEqual("chain4_rel", DBF_SHORT, 1);
|
||||
testdbGetFieldEqual("chain4_lim", DBF_SHORT, 1);
|
||||
}
|
||||
|
||||
testDiag("===== Chain 5 ======");
|
||||
|
||||
{
|
||||
dbCommon *dummy=testdbRecordPtr("chain4_dummy");
|
||||
|
||||
testdbPutFieldOk("chain5_cnt.PROC", DBF_LONG, 0);
|
||||
|
||||
/* sync once queue to wait for any queued RPRO */
|
||||
scanOnceCallback(dummy, dummydone, NULL);
|
||||
|
||||
if (epicsEventWaitWithTimeout(done, 10.0) != epicsEventOK)
|
||||
testAbort("Processing timed out");
|
||||
|
||||
testdbGetFieldEqual("chain5_cnt", DBF_SHORT, 1);
|
||||
}
|
||||
|
||||
testIocShutdownOk();
|
||||
|
||||
testdbCleanup();
|
||||
|
||||
@@ -53,3 +53,41 @@ record(sub, "done3") {
|
||||
field(FLNK, "chain3")
|
||||
field(TPRO, "$(TPRO=)")
|
||||
}
|
||||
|
||||
|
||||
# loop breaking regression
|
||||
# should _not_ RPRO
|
||||
record(calcout,"chain4_pos") {
|
||||
field(CALC, "E:=E+1;E")
|
||||
field(OUT,"chain4_rel.A PP")
|
||||
field(TPRO, "$(TPRO=)")
|
||||
}
|
||||
|
||||
record(calc,"chain4_rel") {
|
||||
field(CALC, "E:=E+1;E")
|
||||
field(FLNK,"chain4_lim")
|
||||
field(TPRO, "$(TPRO=)")
|
||||
}
|
||||
|
||||
record(calc,"chain4_lim") {
|
||||
field(CALC, "E:=E+1;E")
|
||||
field(INPA,"chain4_pos PP")
|
||||
field(INPB,"chain4_pos.HIGH PP")
|
||||
field(INPC,"chain4_pos.LOW PP")
|
||||
field(FLNK,"chain4_pos")
|
||||
field(TPRO, "$(TPRO=)")
|
||||
}
|
||||
|
||||
record(bo, "chain4_dummy") {
|
||||
field(TPRO, "$(TPRO=)")
|
||||
}
|
||||
|
||||
# loop breaking regression part 2
|
||||
# selft link should _not_ RPRO
|
||||
record(calcout,"chain5_cnt") {
|
||||
field(CALC, "E:=E+1;E")
|
||||
field(INPA,"chain5_cnt.A PP")
|
||||
field(OUT,"chain5_cnt.A PP")
|
||||
field(FLNK,"chain5_cnt")
|
||||
field(TPRO, "$(TPRO=)")
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ $ENV{HARNESS_ACTIVE} = 1 if scalar @ARGV && shift eq '-tap';
|
||||
$ENV{EPICS_CA_AUTO_ADDR_LIST} = 'NO';
|
||||
$ENV{EPICS_CA_ADDR_LIST} = 'localhost';
|
||||
$ENV{EPICS_CA_SERVER_PORT} = 55064;
|
||||
$ENV{EPICS_CAS_BEACON_PORT} = 55065;
|
||||
$ENV{EPICS_CAS_INTF_ADDR_LIST} = 'localhost';
|
||||
|
||||
$ENV{EPICS_PVA_AUTO_ADDR_LIST} = 'NO';
|
||||
@@ -29,13 +30,32 @@ my $prefix = "test-$$";
|
||||
my $ioc = EPICS::IOC->new();
|
||||
#$ioc->debug(1);
|
||||
|
||||
$SIG{__DIE__} = $SIG{INT} = $SIG{QUIT} = $SIG{ALRM} = sub {
|
||||
$ioc->kill
|
||||
if ref($ioc) eq 'EPICS::IOC' && $ioc->started;
|
||||
$SIG{__DIE__} = $SIG{INT} = $SIG{QUIT} = sub {
|
||||
$ioc->kill;
|
||||
BAIL_OUT('Caught signal');
|
||||
};
|
||||
|
||||
alarm 30;
|
||||
|
||||
# Watchdog utilities
|
||||
|
||||
sub kill_bail {
|
||||
my $doing = shift;
|
||||
return sub {
|
||||
$ioc->kill;
|
||||
BAIL_OUT("Timeout $doing");
|
||||
}
|
||||
}
|
||||
|
||||
sub watchdog (&$$) {
|
||||
my ($do, $timeout, $abort) = @_;
|
||||
$SIG{ALRM} = $abort;
|
||||
alarm $timeout;
|
||||
&$do;
|
||||
alarm 0;
|
||||
}
|
||||
|
||||
|
||||
# Start the IOC
|
||||
|
||||
my $softIoc = "$bin/softIocPVA$exe";
|
||||
$softIoc = "$bin/softIoc$exe"
|
||||
@@ -43,42 +63,78 @@ $softIoc = "$bin/softIoc$exe"
|
||||
BAIL_OUT("Can't find a softIoc executable")
|
||||
unless -x $softIoc;
|
||||
|
||||
$ioc->start($softIoc, '-x', $prefix);
|
||||
$ioc->cmd; # Wait for command prompt
|
||||
watchdog {
|
||||
$ioc->start($softIoc, '-x', $prefix);
|
||||
$ioc->cmd; # Wait for command prompt
|
||||
} 10, kill_bail('starting softIoc');
|
||||
|
||||
|
||||
# Get Base Version number from PV
|
||||
|
||||
my $pv = "$prefix:BaseVersion";
|
||||
|
||||
my @pvs = $ioc->dbl('stringin');
|
||||
grep(m/$pv/, @pvs)
|
||||
or BAIL_OUT('No BaseVersion record found');
|
||||
watchdog {
|
||||
my @pvs = $ioc->dbl('stringin');
|
||||
grep(m/^ $pv $/x, @pvs)
|
||||
or BAIL_OUT('No BaseVersion record found');
|
||||
} 10, kill_bail('running dbl');
|
||||
|
||||
my $version = $ioc->dbgf("$pv");
|
||||
my $version;
|
||||
watchdog {
|
||||
$version = $ioc->dbgf("$pv");
|
||||
} 10, kill_bail('getting BaseVersion');
|
||||
like($version, qr/^ \d+ \. \d+ \. \d+ /x,
|
||||
"Got BaseVersion '$version' from iocsh");
|
||||
|
||||
note("CA server configuration:\n",
|
||||
map(" $_\n", $ioc->cmd('casr', 1)));
|
||||
|
||||
my $caget = "$bin/caget$exe";
|
||||
# Channel Access
|
||||
|
||||
SKIP: {
|
||||
skip "caget not available", 1 unless -x $caget;
|
||||
my $caVersion = `$caget -w5 $pv`;
|
||||
like($caVersion, qr/$pv \s+ \Q$version\E/x,
|
||||
'Got same BaseVersion from caget');
|
||||
my $caget = "$bin/caget$exe";
|
||||
skip "caget not available", 1
|
||||
unless -x $caget;
|
||||
|
||||
# CA Server Diagnostics
|
||||
|
||||
watchdog {
|
||||
note("CA server configuration:\n",
|
||||
map(" $_\n", $ioc->cmd('casr', 1)));
|
||||
} 10, kill_bail('running casr');
|
||||
|
||||
# CA Client test
|
||||
|
||||
watchdog {
|
||||
my $caVersion = `$caget -w5 $pv`;
|
||||
like($caVersion, qr/^ $pv \s+ \Q$version\E $/x,
|
||||
'Got same BaseVersion from caget');
|
||||
} 10, kill_bail('doing caget');
|
||||
}
|
||||
|
||||
my $pvget = "$bin/pvget$exe";
|
||||
|
||||
# PV Access
|
||||
|
||||
SKIP: {
|
||||
my $pvget = "$bin/pvget$exe";
|
||||
skip "softIocPVA not available", 1
|
||||
if $softIoc eq "$bin/softIoc$exe";
|
||||
note("PVA server configuration:\n",
|
||||
map(" $_\n", $ioc->cmd('pvasr')));
|
||||
|
||||
# PVA Server Diagnostics
|
||||
|
||||
watchdog {
|
||||
note("PVA server configuration:\n",
|
||||
map(" $_\n", $ioc->cmd('pvasr')));
|
||||
} 10, kill_bail('running pvasr');
|
||||
|
||||
skip "pvget not available", 1
|
||||
unless -x $pvget;
|
||||
my $pvaVersion = `$pvget -w5 $pv`;
|
||||
like($pvaVersion, qr/$pv \s .* \Q$version\E/x,
|
||||
'Got same BaseVersion from pvget');
|
||||
|
||||
# PVA Client test
|
||||
|
||||
watchdog {
|
||||
my $pvaVersion = `$pvget -w5 $pv`;
|
||||
like($pvaVersion, qr/^ $pv \s .* \Q$version\E \s* $/x,
|
||||
'Got same BaseVersion from pvget');
|
||||
} 10, kill_bail('doing pvget');
|
||||
}
|
||||
|
||||
$ioc->kill;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
EPICS_LIBCOM_MAJOR_VERSION = 3
|
||||
EPICS_LIBCOM_MINOR_VERSION = 17
|
||||
EPICS_LIBCOM_MAINTENANCE_VERSION = 2
|
||||
EPICS_LIBCOM_MAINTENANCE_VERSION = 4
|
||||
EPICS_LIBCOM_DEVELOPMENT_FLAG = 0
|
||||
|
||||
@@ -319,7 +319,7 @@ static const iocshArg epicsMutexShowAllArg1 = { "level",iocshArgInt};
|
||||
static const iocshArg * const epicsMutexShowAllArgs[2] =
|
||||
{&epicsMutexShowAllArg0,&epicsMutexShowAllArg1};
|
||||
static const iocshFuncDef epicsMutexShowAllFuncDef =
|
||||
{"epicsMutexShowAll",1,epicsMutexShowAllArgs};
|
||||
{"epicsMutexShowAll",2,epicsMutexShowAllArgs};
|
||||
static void epicsMutexShowAllCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
epicsMutexShowAll(args[0].ival,args[1].ival);
|
||||
|
||||
@@ -18,9 +18,6 @@ void osdMonotonicInit(void)
|
||||
{
|
||||
unsigned i;
|
||||
clockid_t ids[] = {
|
||||
#ifdef CLOCK_MONOTONIC_RAW
|
||||
CLOCK_MONOTONIC_RAW, /* Linux specific */
|
||||
#endif
|
||||
#ifdef CLOCK_HIGHRES
|
||||
CLOCK_HIGHRES, /* solaris specific */
|
||||
#endif
|
||||
|
||||
@@ -567,14 +567,13 @@ static epicsThreadOSD *createImplicit(void)
|
||||
pthreadInfo->osiPriority = 0;
|
||||
|
||||
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && _POSIX_THREAD_PRIORITY_SCHEDULING > 0
|
||||
{
|
||||
struct sched_param param;
|
||||
int policy;
|
||||
if(pthread_getschedparam(tid,&policy,¶m) == 0)
|
||||
pthreadInfo->osiPriority =
|
||||
(param.sched_priority - pcommonAttr->minPriority) * 100.0 /
|
||||
if(pthread_getschedparam(tid,&pthreadInfo->schedPolicy,&pthreadInfo->schedParam) == 0) {
|
||||
if ( pcommonAttr->usePolicy && pthreadInfo->schedPolicy == pcommonAttr->schedPolicy ) {
|
||||
pthreadInfo->osiPriority =
|
||||
(pthreadInfo->schedParam.sched_priority - pcommonAttr->minPriority) * 100.0 /
|
||||
(pcommonAttr->maxPriority - pcommonAttr->minPriority + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
|
||||
|
||||
status = pthread_setspecific(getpthreadInfo,(void *)pthreadInfo);
|
||||
|
||||
@@ -288,4 +288,15 @@ TESTPROD_HOST += cvtFastPerform
|
||||
cvtFastPerform_SRCS += cvtFastPerform.cpp
|
||||
testHarness_SRCS += cvtFastPerform.cpp
|
||||
|
||||
ifeq ($(OS_CLASS),Linux)
|
||||
ifeq ($(USE_POSIX_THREAD_PRIORITY_SCHEDULING),YES)
|
||||
TESTPROD_HOST += nonEpicsThreadPriorityTest
|
||||
nonEpicsThreadPriorityTest_SRCS += nonEpicsThreadPriorityTest.cpp
|
||||
nonEpicsThreadPriorityTest_SYS_LIBS += $(POSIX_LDLIBS:-l%=%)
|
||||
testHarness_SRCS += nonEpicsThreadPriorityTest.cpp
|
||||
epicsRunLibComTests_CFLAGS += -DHAVE_PTHREAD_PRIORITY_SCHEDULING
|
||||
TESTS += nonEpicsThreadPriorityTest
|
||||
endif
|
||||
endif
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
|
||||
100
modules/libcom/test/nonEpicsThreadPriorityTest.cpp
Normal file
100
modules/libcom/test/nonEpicsThreadPriorityTest.cpp
Normal file
@@ -0,0 +1,100 @@
|
||||
#include <epicsThread.h>
|
||||
#include "epicsUnitTest.h"
|
||||
#include "testMain.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __rtems__
|
||||
|
||||
/* RTEMS is posix but currently does not use the pthread API */
|
||||
MAIN(nonEpicsThreadPriorityTest)
|
||||
{
|
||||
testPlan(1);
|
||||
testSkip(1, "Platform does not use pthread API");
|
||||
return testDone();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void *nonEpicsTestFunc(void *arg)
|
||||
{
|
||||
unsigned int pri;
|
||||
// epicsThreadGetIdSelf() creates an EPICS context
|
||||
// verify that the priority computed by epics context
|
||||
// is OK
|
||||
pri = epicsThreadGetPriority( epicsThreadGetIdSelf() );
|
||||
if ( ! testOk( 0 == pri, "'createImplicit' assigned correct priority (%d) to non-EPICS thread", pri) ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (void*)1;
|
||||
}
|
||||
|
||||
|
||||
static void testFunc(void *arg)
|
||||
{
|
||||
epicsEventId ev = (epicsEventId)arg;
|
||||
int policy;
|
||||
struct sched_param param;
|
||||
int status;
|
||||
pthread_t tid;
|
||||
void *rval;
|
||||
pthread_attr_t attr;
|
||||
|
||||
status = pthread_getschedparam(pthread_self(), &policy,¶m);
|
||||
if ( status ) {
|
||||
testSkip(1, "pthread_getschedparam failed");
|
||||
goto done;
|
||||
}
|
||||
|
||||
if ( SCHED_FIFO != policy ) {
|
||||
testSkip(1, "nonEpicsThreadPriorityTest must be executed with privileges to use SCHED_FIFO");
|
||||
goto done;
|
||||
}
|
||||
|
||||
if ( pthread_attr_init( &attr ) ) {
|
||||
testSkip(1, "pthread_attr_init failed");
|
||||
goto done;
|
||||
}
|
||||
if ( pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ) ) {
|
||||
testSkip(1, "pthread_attr_setinheritsched failed");
|
||||
goto done;
|
||||
}
|
||||
if ( pthread_attr_setschedpolicy ( &attr, SCHED_OTHER ) ) {
|
||||
testSkip(1, "pthread_attr_setschedpolicy failed");
|
||||
goto done;
|
||||
}
|
||||
param.sched_priority = 0;
|
||||
if ( pthread_attr_setschedparam ( &attr, ¶m ) ) {
|
||||
testSkip(1, "pthread_attr_setschedparam failed");
|
||||
goto done;
|
||||
}
|
||||
|
||||
if ( pthread_create( &tid, &attr, nonEpicsTestFunc, 0 ) ) {
|
||||
testSkip(1, "pthread_create failed");
|
||||
goto done;
|
||||
}
|
||||
|
||||
if ( pthread_join( tid, &rval ) ) {
|
||||
testSkip(1, "pthread_join failed");
|
||||
goto done;
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
epicsEventSignal( ev );
|
||||
}
|
||||
|
||||
MAIN(nonEpicsThreadPriorityTest)
|
||||
{
|
||||
testPlan(2);
|
||||
epicsEventId testComplete = epicsEventMustCreate(epicsEventEmpty);
|
||||
epicsThreadMustCreate("nonEpicsThreadPriorityTest", epicsThreadPriorityLow,
|
||||
epicsThreadGetStackSize(epicsThreadStackMedium),
|
||||
testFunc, testComplete);
|
||||
epicsEventWaitStatus status = epicsEventWait(testComplete);
|
||||
testOk(status == epicsEventWaitOK,
|
||||
"epicsEventWait returned %d", status);
|
||||
return testDone();
|
||||
}
|
||||
#endif
|
||||
Submodule modules/normativeTypes updated: 41d56fdf89...e803240fbf
Submodule modules/pvAccess updated: 5e79342219...5b333922d5
Submodule modules/pvData updated: d776f6eaf0...6da871fa64
Submodule modules/pvDatabase updated: 07a951c3a2...2715f585e0
Submodule modules/pva2pva updated: a245adb5cf...521154fd52
Submodule modules/pvaClient updated: b1c101578b...428adb270e
Reference in New Issue
Block a user