Compare commits
17 Commits
PSI-7.0.5.
...
PSI-3.14.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 19c04ace1d | |||
| 538bc88760 | |||
| 0b6eb67137 | |||
| 5c080a64f9 | |||
| 3f1a366291 | |||
| 0d332dbb41 | |||
| c1447d9cb4 | |||
| 76ba742563 | |||
| 6a75f3258b | |||
| a2bf0f3c66 | |||
| d2c4fd85d7 | |||
| 2772d57842 | |||
| c9a8a551e8 | |||
| 2718a0d706 | |||
| 1b9a104215 | |||
| c6a9818539 | |||
| f400e12743 |
7
Makefile
7
Makefile
@@ -24,3 +24,10 @@ config_DEPEND_DIRS = src
|
||||
|
||||
include $(TOP)/configure/RULES_TOP
|
||||
|
||||
|
||||
UNINSTALL_DIRS += $(INSTALL_LOCATION)/src
|
||||
copysrc:
|
||||
tar cf - --exclude=CVS --exclude=O.* src | tar xf - -C $(INSTALL_LOCATION)
|
||||
|
||||
tar: install copysrc
|
||||
tar cfjP epics_base-3.14.12.tar.bz2 $(INSTALL_LOCATION) --exclude=*.o
|
||||
|
||||
@@ -27,7 +27,7 @@ GPROF_CFLAGS_YES = -pg
|
||||
CODE_CFLAGS = $(PROF_CFLAGS_$(PROFILE)) $(GPROF_CFLAGS_$(GPROF))
|
||||
WARN_CFLAGS_YES = -Wall
|
||||
WARN_CFLAGS_NO = -w
|
||||
OPT_CFLAGS_YES = -O3
|
||||
OPT_CFLAGS_YES = -O3 -g
|
||||
OPT_CFLAGS_NO = -g
|
||||
|
||||
PROF_CXXFLAGS_YES = -p
|
||||
@@ -35,7 +35,7 @@ GPROF_CXXFLAGS_YES = -pg
|
||||
CODE_CXXFLAGS = $(PROF_CXXFLAGS_$(PROFILE)) $(GPROF_CXXFLAGS_$(GPROF))
|
||||
WARN_CXXFLAGS_YES = -Wall
|
||||
WARN_CXXFLAGS_NO = -w
|
||||
OPT_CXXFLAGS_YES = -O3
|
||||
OPT_CXXFLAGS_YES = -O3 -g
|
||||
OPT_CXXFLAGS_NO = -g
|
||||
|
||||
CODE_LDFLAGS = $(PROF_CXXFLAGS_$(PROFILE)) $(GPROF_CXXFLAGS_$(GPROF))
|
||||
|
||||
@@ -35,7 +35,7 @@ EPICS_BASE_HOST_LIBS += ca Com
|
||||
# Version number for base shared libraries (and win32 products)
|
||||
|
||||
ifdef BASE_TOP
|
||||
SHRLIB_VERSION = $(EPICS_VERSION).$(EPICS_REVISION)
|
||||
#SHRLIB_VERSION = $(EPICS_VERSION).$(EPICS_REVISION)
|
||||
PROD_VERSION = $(EPICS_VERSION).$(EPICS_REVISION)
|
||||
endif # BASE_TOP
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ CROSS_WARN=YES
|
||||
# NOTE: Set to YES only if you have existing R3.13 extensions to be
|
||||
# built with this base
|
||||
#
|
||||
#COMPAT_TOOLS_313=YES
|
||||
COMPAT_TOOLS_313=YES
|
||||
|
||||
# Create and/or install files for R3.13 ioc application and extension builds?
|
||||
# must be either YES or NO
|
||||
@@ -178,19 +178,20 @@ CROSS_WARN=YES
|
||||
# NOTE: Set to YES only if you have existing R3.13 ioc applications
|
||||
# and extensions to be built with this base
|
||||
#
|
||||
COMPAT_313=NO
|
||||
COMPAT_313=YES
|
||||
|
||||
# Installation directory
|
||||
# If you don't want to install into $(TOP) dir then
|
||||
# define INSTALL_LOCATION here
|
||||
#INSTALL_LOCATION=<fullpathname>
|
||||
INSTALL_LOCATION=/usr/local/epics/base-3.14.12
|
||||
|
||||
# Use POSIX thread priority scheduling (YES or NO)
|
||||
USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES
|
||||
|
||||
# Site version number, if set will append '-' and this string to the
|
||||
# EPICS version number string that is reported by many tools
|
||||
EPICS_SITE_VERSION =
|
||||
EPICS_SITE_VERSION := $(shell date +%Y-%m)
|
||||
|
||||
# For GNU compiler, use pipes rather than temporary files for communication
|
||||
# between the various stages of compilation.
|
||||
|
||||
@@ -438,6 +438,9 @@ ifneq (,$(strip $(SHRLIB_VERSION)))
|
||||
@$(RM) $(subst $(SHRLIB_SUFFIX),$(SHRLIB_SUFFIX_BASE),$@)
|
||||
ln -s $< $(subst $(SHRLIB_SUFFIX),$(SHRLIB_SUFFIX_BASE),$@)
|
||||
endif # SHRLIB_VERSION
|
||||
else
|
||||
@$(RM) $@.3.14
|
||||
ln -s $< $@.3.14
|
||||
endif # SHRLIB_SUFFIX
|
||||
|
||||
ifneq ($(INSTALL_TCLLIB),$(INSTALL_BIN))
|
||||
|
||||
4
configure/os/CONFIG.Common.RHEL7-x86_64
Normal file
4
configure/os/CONFIG.Common.RHEL7-x86_64
Normal file
@@ -0,0 +1,4 @@
|
||||
# Include definitions common to linux pentium targets
|
||||
include $(CONFIG)/os/CONFIG.Common.linux-x86_64
|
||||
|
||||
COMMANDLINE_LIBRARY = READLINE
|
||||
3
configure/os/CONFIG.Common.RHEL7-x86_64-clang
Normal file
3
configure/os/CONFIG.Common.RHEL7-x86_64-clang
Normal file
@@ -0,0 +1,3 @@
|
||||
include $(CONFIG)/os/CONFIG.Common.linux-clang
|
||||
|
||||
COMMANDLINE_LIBRARY = READLINE
|
||||
6
configure/os/CONFIG.Common.SL5-x86
Normal file
6
configure/os/CONFIG.Common.SL5-x86
Normal file
@@ -0,0 +1,6 @@
|
||||
# Include definitions common to linux pentium targets
|
||||
include $(CONFIG)/os/CONFIG.Common.linux-x86
|
||||
|
||||
COMMANDLINE_LIBRARY = READLINE_NCURSES
|
||||
|
||||
ARCH_DEP_CFLAGS += -march=i686
|
||||
4
configure/os/CONFIG.Common.SL5-x86_64
Normal file
4
configure/os/CONFIG.Common.SL5-x86_64
Normal file
@@ -0,0 +1,4 @@
|
||||
# Include definitions common to linux pentium targets
|
||||
include $(CONFIG)/os/CONFIG.Common.linux-x86_64
|
||||
|
||||
COMMANDLINE_LIBRARY = READLINE_NCURSES
|
||||
7
configure/os/CONFIG.Common.SL6-x86
Normal file
7
configure/os/CONFIG.Common.SL6-x86
Normal file
@@ -0,0 +1,7 @@
|
||||
# Include definitions common to linux pentium targets
|
||||
include $(CONFIG)/os/CONFIG.Common.linux-x86
|
||||
|
||||
COMMANDLINE_LIBRARY = READLINE
|
||||
|
||||
ARCH_DEP_CFLAGS += -march=i686
|
||||
ARCH_DEP_CXXFLAGS += -fno-strict-aliasing
|
||||
6
configure/os/CONFIG.Common.SL6-x86_64
Normal file
6
configure/os/CONFIG.Common.SL6-x86_64
Normal file
@@ -0,0 +1,6 @@
|
||||
# Include definitions common to linux pentium targets
|
||||
include $(CONFIG)/os/CONFIG.Common.linux-x86_64
|
||||
|
||||
COMMANDLINE_LIBRARY = READLINE
|
||||
|
||||
ARCH_DEP_CXXFLAGS += -fno-strict-aliasing
|
||||
3
configure/os/CONFIG.Common.SL6-x86_64-clang
Normal file
3
configure/os/CONFIG.Common.SL6-x86_64-clang
Normal file
@@ -0,0 +1,3 @@
|
||||
include $(CONFIG)/os/CONFIG.Common.linux-clang
|
||||
|
||||
COMMANDLINE_LIBRARY = READLINE
|
||||
8
configure/os/CONFIG.Common.T2-ppc604
Normal file
8
configure/os/CONFIG.Common.T2-ppc604
Normal file
@@ -0,0 +1,8 @@
|
||||
include $(CONFIG)/os/CONFIG.Common.vxWorks-ppc604_long
|
||||
VXWORKS_VERSION = 5.5.1
|
||||
WIND_BASE = /afs/psi.ch/project/vxworks/Tornado2.2.1
|
||||
|
||||
#there is a problem with our ccppc and optimization
|
||||
# -O0 works, -O and -O1 and higher are buggy
|
||||
OPT_CFLAGS_YES = -O0
|
||||
OPT_CXXFLAGS_YES = -O0
|
||||
2
configure/os/CONFIG.Common.V62-ppc604
Normal file
2
configure/os/CONFIG.Common.V62-ppc604
Normal file
@@ -0,0 +1,2 @@
|
||||
include $(CONFIG)/os/CONFIG.Common.vxWorks-ppc604_long
|
||||
VXWORKS_VERSION = 6.2
|
||||
5
configure/os/CONFIG.Common.V63-ppc603
Normal file
5
configure/os/CONFIG.Common.V63-ppc603
Normal file
@@ -0,0 +1,5 @@
|
||||
include $(CONFIG)/os/CONFIG.Common.vxWorks-ppc603_long
|
||||
VXWORKS_VERSION = 6.3
|
||||
|
||||
# Buggy "uninitialized variable" warning produces many false positives
|
||||
ARCH_DEP_CXXFLAGS += -Wno-uninitialized
|
||||
5
configure/os/CONFIG.Common.V63-ppc604
Normal file
5
configure/os/CONFIG.Common.V63-ppc604
Normal file
@@ -0,0 +1,5 @@
|
||||
include $(CONFIG)/os/CONFIG.Common.vxWorks-ppc604_long
|
||||
VXWORKS_VERSION = 6.3
|
||||
|
||||
# Buggy "uninitialized variable" warning produces many false positives
|
||||
ARCH_DEP_CXXFLAGS += -Wno-uninitialized
|
||||
2
configure/os/CONFIG.Common.V66-ppc603
Normal file
2
configure/os/CONFIG.Common.V66-ppc603
Normal file
@@ -0,0 +1,2 @@
|
||||
include $(CONFIG)/os/CONFIG.Common.vxWorks-ppc603_long
|
||||
VXWORKS_VERSION = 6.6
|
||||
2
configure/os/CONFIG.Common.V66-ppc604
Normal file
2
configure/os/CONFIG.Common.V66-ppc604
Normal file
@@ -0,0 +1,2 @@
|
||||
include $(CONFIG)/os/CONFIG.Common.vxWorks-ppc604_long
|
||||
VXWORKS_VERSION = 6.6
|
||||
5
configure/os/CONFIG.Common.V67-ppc604
Normal file
5
configure/os/CONFIG.Common.V67-ppc604
Normal file
@@ -0,0 +1,5 @@
|
||||
include $(CONFIG)/os/CONFIG.Common.vxWorks-ppc604_long
|
||||
VXWORKS_VERSION = 6.7
|
||||
|
||||
#needed when including memPartLib.h, e.g. through moduleLib.h or loadLib.h
|
||||
ARCH_DEP_CFLAGS += -D_VSB_CONFIG_FILE='<../lib/h/config/vsbConfig.h>'
|
||||
24
configure/os/CONFIG.Common.eldk42-ppc4xxFP
Normal file
24
configure/os/CONFIG.Common.eldk42-ppc4xxFP
Normal file
@@ -0,0 +1,24 @@
|
||||
# DeltaTau PowerPMAC with ELDK 4.2
|
||||
|
||||
# Include definitions common to all Linux targets
|
||||
include $(CONFIG)/os/CONFIG.Common.linuxCommon
|
||||
|
||||
COMMANDLINE_LIBRARY = READLINE_NCURSES
|
||||
|
||||
ARCH_CLASS = ppc
|
||||
|
||||
ELDK=/opt/eldk-4.2
|
||||
GNU_TARGET=ppc_4xxFP
|
||||
GNU_DIR=$(ELDK)/usr
|
||||
|
||||
ARCH_DEP_CFLAGS += -fno-strict-aliasing
|
||||
|
||||
# This cross tool chain is installed in a somehow weired way
|
||||
# Without the following lines it does not work on RHEL7
|
||||
# but it worked on SL6
|
||||
ARCH_DEP_CXXFLAGS += -I $(ELDK)/$(GNU_TARGET)/usr/include/c++/4.2.2
|
||||
ARCH_DEP_CXXFLAGS += -I $(ELDK)/$(GNU_TARGET)/usr/include/c++/4.2.2/powerpc-linux
|
||||
ARCH_DEP_CXXFLAGS += -I $(ELDK)/$(GNU_TARGET)/usr/include/c++/4.2.2/backward
|
||||
|
||||
ARCH_DEP_LDFLAGS += -Wl,-rpath-link,$(ELDK)/$(GNU_TARGET)/lib
|
||||
ARCH_DEP_LDFLAGS += -Wl,-rpath-link,$(ELDK)/$(GNU_TARGET)/usr/lib
|
||||
16
configure/os/CONFIG.Common.eldk51-ppc4xxSF
Normal file
16
configure/os/CONFIG.Common.eldk51-ppc4xxSF
Normal file
@@ -0,0 +1,16 @@
|
||||
# Virtex FPGA embedded Processor with ELDK 5.1
|
||||
|
||||
# Include definitions common to all Linux targets
|
||||
include $(CONFIG)/os/CONFIG.Common.linuxCommon
|
||||
|
||||
COMMANDLINE_LIBRARY = READLINE
|
||||
|
||||
ARCH_CLASS = ppc
|
||||
|
||||
SDK = eldk
|
||||
SDK_DIR = /opt/eldk-5.1
|
||||
SDK_HOST_ARCH = $(GNU_HOST_ARCH)-$(SDK)-$(GNU_HOST_OS)
|
||||
GNU_TARGET = powerpc-4xx-softfloat
|
||||
GNU_ARCH = ppc405-linux
|
||||
GNU_DIR = $(SDK_DIR)/$(GNU_TARGET)/sysroots/$(SDK_HOST_ARCH)/usr
|
||||
GNU_BIN = $(GNU_DIR)/bin/$(GNU_ARCH)
|
||||
17
configure/os/CONFIG.Common.eldk52-e500v2
Normal file
17
configure/os/CONFIG.Common.eldk52-e500v2
Normal file
@@ -0,0 +1,17 @@
|
||||
# IOxOS IFC1210 with ELDK 5.2
|
||||
|
||||
# Include definitions common to all Linux targets
|
||||
include $(CONFIG)/os/CONFIG.Common.linuxCommon
|
||||
|
||||
COMMANDLINE_LIBRARY = READLINE
|
||||
|
||||
ARCH_CLASS = ppc
|
||||
|
||||
SDK = eldk
|
||||
SDK_DIR = /opt/eldk-5.2
|
||||
SDK_HOST_ARCH = $(GNU_HOST_ARCH)-$(SDK)-$(GNU_HOST_OS)
|
||||
GNU_TARGET = powerpc-e500v2
|
||||
GNU_ARCH = ppce500v2-linux-gnuspe
|
||||
GNU_DIR = $(SDK_DIR)/$(GNU_TARGET)/sysroots/$(SDK_HOST_ARCH)/usr
|
||||
GNU_BIN = $(GNU_DIR)/bin/$(GNU_ARCH)
|
||||
GNU_TARGET_INCLUDE_DIR =
|
||||
25
configure/os/CONFIG.Common.fslqoriq20-e6500_64
Normal file
25
configure/os/CONFIG.Common.fslqoriq20-e6500_64
Normal file
@@ -0,0 +1,25 @@
|
||||
# IOxOS IFC1211 with Freescale QorIQ 2.0 toolchain
|
||||
|
||||
# Include definitions common to all Linux targets
|
||||
include $(CONFIG)/os/CONFIG.Common.linuxCommon
|
||||
|
||||
COMMANDLINE_LIBRARY = READLINE
|
||||
|
||||
ARCH_CLASS = ppc
|
||||
|
||||
SDK = fslsdk
|
||||
SDK_DIR = /opt/fsl-qoriq/2.0
|
||||
SDK_HOST_ARCH = $(GNU_HOST_ARCH_64)-$(SDK)-$(GNU_HOST_OS)
|
||||
SDK_TARGET = ppc64e6500-fsl-linux
|
||||
GNU_TARGET = powerpc64-fsl-linux
|
||||
SDKTARGETSYSROOT = $(SDK_DIR)/sysroots/$(SDK_TARGET)
|
||||
GNU_DIR = $(SDK_DIR)/sysroots/$(SDK_HOST_ARCH)/usr
|
||||
GNU_BIN = $(GNU_DIR)/bin/$(GNU_TARGET)
|
||||
|
||||
ARCH_DEP_CPPFLAGS = --sysroot=$(SDKTARGETSYSROOT)
|
||||
ARCH_DEP_CFLAGS = -mcpu=e6500 -m64 -mhard-float
|
||||
ARCH_DEP_LDFLAGS = --sysroot=$(SDKTARGETSYSROOT)
|
||||
|
||||
# warning -O2 and higher are broken!
|
||||
#OPT_CFLAGS_YES = -O1
|
||||
#OPT_CXXFLAGS_YES = -O1
|
||||
5
configure/os/CONFIG.Common.linux-clang
Normal file
5
configure/os/CONFIG.Common.linux-clang
Normal file
@@ -0,0 +1,5 @@
|
||||
include $(CONFIG)/os/CONFIG.Common.linuxCommon
|
||||
GNU = NO
|
||||
CMPLR_CLASS = clang
|
||||
CC = clang
|
||||
CCC = clang++
|
||||
17
configure/os/CONFIG.Common.moxa42-armv6l
Normal file
17
configure/os/CONFIG.Common.moxa42-armv6l
Normal file
@@ -0,0 +1,17 @@
|
||||
# Moxa DA-66x with SDK 4.2 and ARM7 processor
|
||||
|
||||
# Include definitions common to all Linux ARM targets
|
||||
include $(CONFIG)/os/CONFIG.Common.linux-arm
|
||||
|
||||
GNU_DIR=/afs/psi.ch/project/embeddedlinux/moxa/arm-linux-4.4.2-v4
|
||||
GNU_TARGET=arm
|
||||
ARCH_DEP_LDFLAGS+=-Wl,-rpath-link,$(GNU_DIR)/arm-none-linux-gnueabi/lib
|
||||
ARCH_DEP_LDFLAGS+=-Wl,-rpath-link,$(INSTALL_LIB)
|
||||
|
||||
COMMANDLINE_LIBRARY = READLINE_NCURSES
|
||||
|
||||
# suppress note "the mangling of 'va_list' has changed in GCC 4.4"
|
||||
ARCH_DEP_CXXFLAGS += -Wno-psabi
|
||||
|
||||
ARCH_DEP_CFLAGS += -funwind-tables
|
||||
ARCH_DEP_CXXFLAGS += -fno-strict-aliasing
|
||||
13
configure/os/CONFIG.Common.mvl40-xscale_be
Normal file
13
configure/os/CONFIG.Common.mvl40-xscale_be
Normal file
@@ -0,0 +1,13 @@
|
||||
# Moxa DA-66x with Montavista Linux 4.0
|
||||
|
||||
# Include definitions common to all Linux targets
|
||||
include $(CONFIG)/os/CONFIG.Common.linuxCommon
|
||||
|
||||
COMMANDLINE_LIBRARY = READLINE_CURSES
|
||||
|
||||
ARCH_CLASS = xscale
|
||||
|
||||
GNU_DIR=/afs/psi.ch/project/embeddedlinux/moxa/xscale_be/armv5teb-montavista-linuxeabi
|
||||
|
||||
ARCH_DEP_CFLAGS += -funwind-tables
|
||||
ARCH_DEP_CPPFLAGS += -fno-strict-aliasing
|
||||
@@ -161,7 +161,9 @@ OPT_CXXFLAGS_YES = -O2
|
||||
|
||||
#--------------------------------------------------
|
||||
# code flags
|
||||
CODE_CFLAGS =
|
||||
CODE_CPPFLAGS_6 = $(CODE_CPPFLAGS_$(VXWORKS_VERSION))
|
||||
CODE_CPPFLAGS_6 += -fno-strict-aliasing
|
||||
CODE_CPPFLAGS += $(CODE_CPPFLAGS_$(VXWORKS_MAJOR_VERSION))
|
||||
#
|
||||
# For vxWorks versions before 6.3 we need this g++ compiler flag
|
||||
CODE_CXXFLAGS_5 = -fno-implicit-templates
|
||||
@@ -169,7 +171,7 @@ CODE_CXXFLAGS_6.0 = -fno-implicit-templates
|
||||
CODE_CXXFLAGS_6.1 = -fno-implicit-templates
|
||||
CODE_CXXFLAGS_6.2 = -fno-implicit-templates
|
||||
CODE_CXXFLAGS_6 = $(CODE_CXXFLAGS_$(VXWORKS_VERSION))
|
||||
CODE_CXXFLAGS = $(CODE_CXXFLAGS_$(VXWORKS_MAJOR_VERSION))
|
||||
CODE_CXXFLAGS += $(CODE_CXXFLAGS_$(VXWORKS_MAJOR_VERSION))
|
||||
|
||||
#--------------------------------------------------
|
||||
# no shared libs for vxWorks
|
||||
|
||||
20
configure/os/CONFIG.Common.yocto21-aarch64
Normal file
20
configure/os/CONFIG.Common.yocto21-aarch64
Normal file
@@ -0,0 +1,20 @@
|
||||
# XILINX Zynq with Yocto 2.1 / Petalinux toolchain
|
||||
|
||||
# Include definitions common to all Linux targets
|
||||
include $(CONFIG)/os/CONFIG.Common.linuxCommon
|
||||
|
||||
COMMANDLINE_LIBRARY = READLINE
|
||||
|
||||
ARCH_CLASS = arm64
|
||||
|
||||
SDK = petalinux
|
||||
SDK_DIR = /opt/petalinux-gfa/2017.2
|
||||
SDK_HOST_ARCH = $(GNU_HOST_ARCH_64)-$(SDK)-$(GNU_HOST_OS)
|
||||
SDK_TARGET = aarch64-xilinx-linux
|
||||
GNU_TARGET = $(SDK_TARGET)
|
||||
SDKTARGETSYSROOT = $(SDK_DIR)/sysroots/$(SDK_TARGET)
|
||||
GNU_DIR = $(SDK_DIR)/sysroots/$(SDK_HOST_ARCH)/usr
|
||||
GNU_BIN = $(GNU_DIR)/bin/$(GNU_TARGET)
|
||||
|
||||
ARCH_DEP_CPPFLAGS = --sysroot=$(SDKTARGETSYSROOT)
|
||||
ARCH_DEP_LDFLAGS = --sysroot=$(SDKTARGETSYSROOT)
|
||||
3
configure/os/CONFIG.RHEL7-x86_64.Common
Normal file
3
configure/os/CONFIG.RHEL7-x86_64.Common
Normal file
@@ -0,0 +1,3 @@
|
||||
#CONFIG.$(EPICS_HOST_ARCH).Common is required by build system
|
||||
#Include definitions common to linux hosts
|
||||
include $(CONFIG)/os/CONFIG.linux-x86_64.Common
|
||||
2
configure/os/CONFIG.RHEL7-x86_64.RHEL7-x86_64
Normal file
2
configure/os/CONFIG.RHEL7-x86_64.RHEL7-x86_64
Normal file
@@ -0,0 +1,2 @@
|
||||
# Include common linux definitions
|
||||
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86
|
||||
14
configure/os/CONFIG.RHEL7-x86_64.SL6-x86
Normal file
14
configure/os/CONFIG.RHEL7-x86_64.SL6-x86
Normal file
@@ -0,0 +1,14 @@
|
||||
# "cross compile" for older Linux version
|
||||
# Use older compiler and older libraries
|
||||
# Used packages:
|
||||
# compat-gcc-44-c++-4.4
|
||||
# compat-gcc-44-4.4
|
||||
# compat-glibc-headers-2.12-4
|
||||
# It was neccessary to install 32 bit compatibility libraries manually
|
||||
#-------------------------------------------------------
|
||||
|
||||
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86
|
||||
CC = $(GNU_BIN)/$(CMPLR_PREFIX)gcc44
|
||||
CCC = $(GNU_BIN)/$(CMPLR_PREFIX)g++44
|
||||
TARGET_LDFLAGS = -L /usr/lib/x86_64-redhat-linux6E/lib
|
||||
LINK.cpp += --as-needed -lc -lm -lrt -lpthread -lreadline -ltinfo
|
||||
14
configure/os/CONFIG.RHEL7-x86_64.SL6-x86_64
Normal file
14
configure/os/CONFIG.RHEL7-x86_64.SL6-x86_64
Normal file
@@ -0,0 +1,14 @@
|
||||
# "cross compile" for older Linux version
|
||||
# Use older compiler and older libraries
|
||||
# Used packages:
|
||||
# compat-gcc-44-c++-4.4
|
||||
# compat-gcc-44-4.4
|
||||
# compat-glibc-headers-2.12-4
|
||||
# compat-glibc-2.12-4
|
||||
#-------------------------------------------------------
|
||||
|
||||
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86
|
||||
CC = $(GNU_BIN)/$(CMPLR_PREFIX)gcc44
|
||||
CCC = $(GNU_BIN)/$(CMPLR_PREFIX)g++44
|
||||
TARGET_LDFLAGS = -L /usr/lib/x86_64-redhat-linux6E/lib64
|
||||
LINK.cpp += --as-needed -lc -lm -lrt -lpthread -lreadline -ltinfo
|
||||
3
configure/os/CONFIG.SL5-x86.Common
Normal file
3
configure/os/CONFIG.SL5-x86.Common
Normal file
@@ -0,0 +1,3 @@
|
||||
#CONFIG.$(EPICS_HOST_ARCH).Common is required by build system
|
||||
#Include definitions common to linux hosts
|
||||
include $(CONFIG)/os/CONFIG.linux-x86.Common
|
||||
2
configure/os/CONFIG.SL5-x86.SL5-x86
Normal file
2
configure/os/CONFIG.SL5-x86.SL5-x86
Normal file
@@ -0,0 +1,2 @@
|
||||
# Include common linux definitions
|
||||
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86
|
||||
3
configure/os/CONFIG.SL5-x86_64.Common
Normal file
3
configure/os/CONFIG.SL5-x86_64.Common
Normal file
@@ -0,0 +1,3 @@
|
||||
#CONFIG.$(EPICS_HOST_ARCH).Common is required by build system
|
||||
#Include definitions common to linux hosts
|
||||
include $(CONFIG)/os/CONFIG.linux-x86_64.Common
|
||||
2
configure/os/CONFIG.SL5-x86_64.SL5-x86_64
Normal file
2
configure/os/CONFIG.SL5-x86_64.SL5-x86_64
Normal file
@@ -0,0 +1,2 @@
|
||||
# Include common linux definitions
|
||||
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86
|
||||
2
configure/os/CONFIG.SL6-x86.Common
Normal file
2
configure/os/CONFIG.SL6-x86.Common
Normal file
@@ -0,0 +1,2 @@
|
||||
#CONFIG.$(EPICS_HOST_ARCH).Common is required by build system
|
||||
#Include definitions common to linux hosts
|
||||
2
configure/os/CONFIG.SL6-x86.SL6-x86
Normal file
2
configure/os/CONFIG.SL6-x86.SL6-x86
Normal file
@@ -0,0 +1,2 @@
|
||||
# Include common linux definitions
|
||||
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86
|
||||
3
configure/os/CONFIG.SL6-x86_64.Common
Normal file
3
configure/os/CONFIG.SL6-x86_64.Common
Normal file
@@ -0,0 +1,3 @@
|
||||
#CONFIG.$(EPICS_HOST_ARCH).Common is required by build system
|
||||
#Include definitions common to linux hosts
|
||||
include $(CONFIG)/os/CONFIG.linux-x86_64.Common
|
||||
2
configure/os/CONFIG.SL6-x86_64.SL6-x86
Normal file
2
configure/os/CONFIG.SL6-x86_64.SL6-x86
Normal file
@@ -0,0 +1,2 @@
|
||||
# Include common linux definitions
|
||||
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86
|
||||
2
configure/os/CONFIG.SL6-x86_64.SL6-x86_64
Normal file
2
configure/os/CONFIG.SL6-x86_64.SL6-x86_64
Normal file
@@ -0,0 +1,2 @@
|
||||
# Include common linux definitions
|
||||
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86
|
||||
@@ -32,5 +32,6 @@ VXWORKS_VERSION = 6.9
|
||||
|
||||
#WIND_BASE = /usr/local/vw/tornado202p1
|
||||
#WIND_BASE = /usr/local/vw/tornado22-$(ARCH_CLASS)
|
||||
WIND_BASE = /usr/local/vw/vxWorks-$(VXWORKS_VERSION)
|
||||
#WIND_BASE = /usr/local/vw/vxWorks-$(VXWORKS_VERSION)
|
||||
#WIND_BASE = /ade/vxWorks/$(VXWORKS_VERSION)
|
||||
WIND_BASE = /afs/psi.ch/project/vxworks/VxWorks$(VXWORKS_VERSION)
|
||||
|
||||
13
configure/os/CONFIG_SITE.RHEL7-x86_64.Common
Normal file
13
configure/os/CONFIG_SITE.RHEL7-x86_64.Common
Normal file
@@ -0,0 +1,13 @@
|
||||
# Build 32 bit version as a cross architecture
|
||||
#CROSS_COMPILER_TARGET_ARCHS += RHEL7-x86
|
||||
|
||||
# Improved error checking with clang
|
||||
CROSS_COMPILER_TARGET_ARCHS += RHEL7-x86_64-clang
|
||||
|
||||
# Build for old SL6 64 bit
|
||||
CROSS_COMPILER_TARGET_ARCHS += SL6-x86_64
|
||||
|
||||
# Build for old SL6 32 bit
|
||||
CROSS_COMPILER_TARGET_ARCHS += SL6-x86
|
||||
|
||||
include $(CONFIG)/os/CONFIG_SITE.linux-x86_64.Common
|
||||
1
configure/os/CONFIG_SITE.SL5-x86.Common
Normal file
1
configure/os/CONFIG_SITE.SL5-x86.Common
Normal file
@@ -0,0 +1 @@
|
||||
include $(CONFIG)/os/CONFIG_SITE.linux-x86.Common
|
||||
3
configure/os/CONFIG_SITE.SL5-x86_64.Common
Normal file
3
configure/os/CONFIG_SITE.SL5-x86_64.Common
Normal file
@@ -0,0 +1,3 @@
|
||||
include $(CONFIG)/os/CONFIG_SITE.linux-x86.Common
|
||||
# Build 32 bit version as a cross architecture
|
||||
CROSS_COMPILER_TARGET_ARCHS += SL5-x86
|
||||
1
configure/os/CONFIG_SITE.SL6-x86.Common
Normal file
1
configure/os/CONFIG_SITE.SL6-x86.Common
Normal file
@@ -0,0 +1 @@
|
||||
include $(CONFIG)/os/CONFIG_SITE.linux-x86.Common
|
||||
7
configure/os/CONFIG_SITE.SL6-x86_64.Common
Normal file
7
configure/os/CONFIG_SITE.SL6-x86_64.Common
Normal file
@@ -0,0 +1,7 @@
|
||||
# Build 32 bit version as a cross architecture
|
||||
CROSS_COMPILER_TARGET_ARCHS += SL6-x86
|
||||
|
||||
# Improved error checking with clang
|
||||
CROSS_COMPILER_TARGET_ARCHS += SL6-x86_64-clang
|
||||
|
||||
include $(CONFIG)/os/CONFIG_SITE.linux-x86_64.Common
|
||||
@@ -7,3 +7,36 @@
|
||||
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 solaris-sparc
|
||||
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040
|
||||
#CROSS_COMPILER_TARGET_ARCHS = RTEMS-mvme2100 RTEMS-pc386 # RTEMS-mvme5500 RTEMS-mvme167
|
||||
|
||||
GNU_HOST_ARCH=i686
|
||||
GNU_HOST_OS=linux
|
||||
|
||||
# vxWorks 5 for MVxxxx boards
|
||||
CROSS_COMPILER_TARGET_ARCHS += T2-ppc604
|
||||
|
||||
# vxWorks 6.7 for MVxxxx boards
|
||||
CROSS_COMPILER_TARGET_ARCHS += V67-ppc604
|
||||
|
||||
# NI compact RIO
|
||||
CROSS_COMPILER_TARGET_ARCHS += V63-ppc603
|
||||
|
||||
# MOXA montavista linux
|
||||
CROSS_COMPILER_TARGET_ARCHS += mvl40-xscale_be
|
||||
|
||||
# MOXA SDK 4.2
|
||||
CROSS_COMPILER_TARGET_ARCHS += moxa42-armv6l
|
||||
|
||||
# Virtex embedded PPC
|
||||
CROSS_COMPILER_TARGET_ARCHS += eldk51-ppc4xxSF
|
||||
|
||||
# IOxOS IFC1210
|
||||
CROSS_COMPILER_TARGET_ARCHS += eldk52-e500v2
|
||||
|
||||
# DeltaTau PowerPMAC
|
||||
CROSS_COMPILER_TARGET_ARCHS += eldk42-ppc4xxFP
|
||||
|
||||
# Test other vxWorks versions
|
||||
CROSS_COMPILER_TARGET_ARCHS += V66-ppc603
|
||||
CROSS_COMPILER_TARGET_ARCHS += V66-ppc604
|
||||
CROSS_COMPILER_TARGET_ARCHS += V63-ppc604
|
||||
CROSS_COMPILER_TARGET_ARCHS += V62-ppc604
|
||||
|
||||
@@ -7,3 +7,12 @@
|
||||
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040
|
||||
#CROSS_COMPILER_TARGET_ARCHS = RTEMS-mvme2100
|
||||
|
||||
include $(CONFIG)/os/CONFIG_SITE.linux-x86.Common
|
||||
|
||||
GNU_HOST_ARCH_64=x86_64
|
||||
|
||||
# IOxOS IFC1211
|
||||
CROSS_COMPILER_TARGET_ARCHS += fslqoriq20-e6500_64
|
||||
|
||||
# Zynq
|
||||
CROSS_COMPILER_TARGET_ARCHS += yocto21-aarch64
|
||||
|
||||
@@ -1415,6 +1415,10 @@ giving correct initial monitor behavior in some circumstances.</p>
|
||||
|
||||
<p>Fixed a crash when ALG (algorithm) was changed to Average at runtime.</p>
|
||||
|
||||
<h4>Named Soft Events</h4>
|
||||
|
||||
<p>Soft events can now be meaningful strings instead of numbers 1-255.
|
||||
|
||||
<h4>configure/RELEASE Enhancements</h4>
|
||||
|
||||
<p>Variable definitions in a <tt>configure/RELEASE</tt> file may now use the
|
||||
|
||||
@@ -765,6 +765,12 @@ void epicsShareAPI ca_detach_context ()
|
||||
}
|
||||
}
|
||||
|
||||
// backward compatibility with 3.14.8
|
||||
extern "C" void _Z17ca_detach_contextv ()
|
||||
{
|
||||
ca_detach_context();
|
||||
}
|
||||
|
||||
int epicsShareAPI ca_preemtive_callback_is_enabled ()
|
||||
{
|
||||
ca_client_context *pcac = (ca_client_context *) epicsThreadPrivateGet ( caClientContextId );
|
||||
|
||||
@@ -26,6 +26,8 @@ SRC_DIRS += $(CA)
|
||||
INC += casdef.h
|
||||
INC += casEventMask.h
|
||||
INC += caNetAddr.h
|
||||
INC += casCtx.h
|
||||
INC += caHdrLargeArray.h
|
||||
|
||||
LIBSRCS += caServer.cc
|
||||
LIBSRCS += caServerI.cc
|
||||
|
||||
@@ -38,6 +38,7 @@ static unsigned long reqElems = 0;
|
||||
static unsigned long eventMask = DBE_VALUE | DBE_ALARM; /* Event mask used */
|
||||
static int floatAsString = 0; /* Flag: fetch floats as string */
|
||||
static int nConn = 0; /* Number of connected PVs */
|
||||
static int caDebug = 0;
|
||||
|
||||
|
||||
void usage (void)
|
||||
@@ -83,6 +84,9 @@ void usage (void)
|
||||
" -0b: Print as binary number\n"
|
||||
"Alternate output field separator:\n"
|
||||
" -F <ofs>: Use <ofs> to separate fields in output\n"
|
||||
"Debuging:\n"
|
||||
" Default: Do not print debug messages\n"
|
||||
" -d: Print debug messages to stderr\n"
|
||||
"\n"
|
||||
"Example: camonitor -f8 my_channel another_channel\n"
|
||||
" (doubles are printed as %%f with precision of 8)\n\n"
|
||||
@@ -106,6 +110,11 @@ static void event_handler (evargs args)
|
||||
{
|
||||
pv* pv = args.usr;
|
||||
|
||||
if (caDebug)
|
||||
{
|
||||
fprintf(stderr, "event_handler(%s) %s[%ld]\n %s\n",
|
||||
ca_name(args.chid), dbr_type_to_text(args.type), args.count, ca_message(args.status));
|
||||
}
|
||||
pv->status = args.status;
|
||||
if (args.status == ECA_NORMAL)
|
||||
{
|
||||
@@ -134,9 +143,30 @@ static void event_handler (evargs args)
|
||||
static void connection_handler ( struct connection_handler_args args )
|
||||
{
|
||||
pv *ppv = ( pv * ) ca_puser ( args.chid );
|
||||
if (caDebug)
|
||||
{
|
||||
fprintf(stderr, "connection_handler(%s) %s\n",
|
||||
ca_name(args.chid),
|
||||
args.op == CA_OP_CONN_UP ? "UP" :
|
||||
args.op == CA_OP_CONN_DOWN ? "DOWN" :
|
||||
"unknown op");
|
||||
}
|
||||
if ( args.op == CA_OP_CONN_UP ) {
|
||||
nConn++;
|
||||
if (!ppv->onceConnected) {
|
||||
|
||||
if (ppv->onceConnected && ppv->dbfType != ca_field_type(ppv->chid)) {
|
||||
/* Data type has changed. Rebuild connection with new type. */
|
||||
if (caDebug)
|
||||
{
|
||||
fprintf(stderr, " Data type changed %s -> %s\n",
|
||||
dbr_type_to_text(ppv->dbfType),
|
||||
dbr_type_to_text(ca_field_type(ppv->chid)));
|
||||
}
|
||||
ca_clear_subscription(ppv->evid);
|
||||
ppv->evid = NULL;
|
||||
}
|
||||
|
||||
if (!ppv->evid) {
|
||||
ppv->onceConnected = 1;
|
||||
/* Set up pv structure */
|
||||
/* ------------------- */
|
||||
@@ -167,7 +197,7 @@ static void connection_handler ( struct connection_handler_args args )
|
||||
eventMask,
|
||||
event_handler,
|
||||
(void*)ppv,
|
||||
NULL);
|
||||
&ppv->evid);
|
||||
}
|
||||
}
|
||||
else if ( args.op == CA_OP_CONN_DOWN ) {
|
||||
@@ -209,11 +239,14 @@ int main (int argc, char *argv[])
|
||||
|
||||
LINE_BUFFER(stdout); /* Configure stdout buffering */
|
||||
|
||||
while ((opt = getopt(argc, argv, ":nhm:sSe:f:g:l:#:0:w:t:p:F:")) != -1) {
|
||||
while ((opt = getopt(argc, argv, ":ndhm:sSe:f:g:l:#:0:w:t:p:F:")) != -1) {
|
||||
switch (opt) {
|
||||
case 'h': /* Print usage */
|
||||
usage();
|
||||
return 0;
|
||||
case 'd':
|
||||
caDebug=1;
|
||||
break;
|
||||
case 'n': /* Print ENUM as index numbers */
|
||||
enumAsNr=1;
|
||||
break;
|
||||
|
||||
@@ -78,6 +78,7 @@ typedef struct
|
||||
epicsTimeStamp tsPreviousS;
|
||||
char firstStampPrinted;
|
||||
char onceConnected;
|
||||
evid evid;
|
||||
} pv;
|
||||
|
||||
|
||||
|
||||
@@ -675,6 +675,8 @@ long epicsShareAPI dbNameToAddr(const char *pname, DBADDR *paddr)
|
||||
status = dbFindFieldPart(&dbEntry, &pname);
|
||||
if (status == S_dbLib_fieldNotFound)
|
||||
status = dbGetAttributePart(&dbEntry, &pname);
|
||||
if (status == S_dbLib_fieldNotFound)
|
||||
status = dbFindInfoPart(&dbEntry, &pname);
|
||||
if (status) goto finish;
|
||||
|
||||
paddr->precord = dbEntry.precnode->precord;
|
||||
|
||||
@@ -43,10 +43,11 @@
|
||||
special(SPC_SCAN)
|
||||
interest(1)
|
||||
}
|
||||
field(EVNT,DBF_SHORT) {
|
||||
prompt("Event Number")
|
||||
field(EVNT,DBF_STRING) {
|
||||
prompt("Event Name")
|
||||
promptgroup(GUI_SCAN)
|
||||
special(SPC_SCAN)
|
||||
size(40)
|
||||
interest(1)
|
||||
}
|
||||
field(TSE,DBF_SHORT) {
|
||||
|
||||
@@ -277,16 +277,26 @@ static void scanpplCallFunc(const iocshArgBuf *args)
|
||||
{ scanppl(args[0].dval);}
|
||||
|
||||
/* scanpel */
|
||||
static const iocshArg scanpelArg0 = { "event number",iocshArgInt};
|
||||
static const iocshArg scanpelArg0 = { "event name",iocshArgString};
|
||||
static const iocshArg * const scanpelArgs[1] = {&scanpelArg0};
|
||||
static const iocshFuncDef scanpelFuncDef = {"scanpel",1,scanpelArgs};
|
||||
static void scanpelCallFunc(const iocshArgBuf *args)
|
||||
{ scanpel(args[0].ival);}
|
||||
{ scanpel(args[0].sval);}
|
||||
|
||||
/* scanpiol */
|
||||
static const iocshFuncDef scanpiolFuncDef = {"scanpiol",0};
|
||||
static void scanpiolCallFunc(const iocshArgBuf *args) { scanpiol();}
|
||||
|
||||
/* postEvent */
|
||||
static const iocshArg postEventArg0 = { "event name",iocshArgString};
|
||||
static const iocshArg * const postEventArgs[1] = {&postEventArg0};
|
||||
static const iocshFuncDef postEventFuncDef = {"postEvent",1,postEventArgs};
|
||||
static void postEventCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
EVENTPVT pel = eventNameToHandle(args[0].sval);
|
||||
postEvent(pel);
|
||||
}
|
||||
|
||||
/* callbackSetQueueSize */
|
||||
static const iocshArg callbackSetQueueSizeArg0 = { "bufsize",iocshArgInt};
|
||||
static const iocshArg * const callbackSetQueueSizeArgs[1] =
|
||||
@@ -340,6 +350,7 @@ void epicsShareAPI dbIocRegister(void)
|
||||
iocshRegister(&scanOnceSetQueueSizeFuncDef,scanOnceSetQueueSizeCallFunc);
|
||||
iocshRegister(&scanpplFuncDef,scanpplCallFunc);
|
||||
iocshRegister(&scanpelFuncDef,scanpelCallFunc);
|
||||
iocshRegister(&postEventFuncDef,postEventCallFunc);
|
||||
iocshRegister(&scanpiolFuncDef,scanpiolCallFunc);
|
||||
|
||||
iocshRegister(&callbackSetQueueSizeFuncDef,callbackSetQueueSizeCallFunc);
|
||||
|
||||
200
src/db/dbScan.c
200
src/db/dbScan.c
@@ -19,12 +19,14 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "epicsStdioRedirect.h"
|
||||
#include "epicsString.h"
|
||||
#include "dbDefs.h"
|
||||
#include "ellLib.h"
|
||||
#include "taskwd.h"
|
||||
#include "epicsMath.h"
|
||||
#include "epicsMutex.h"
|
||||
#include "epicsEvent.h"
|
||||
#include "epicsExit.h"
|
||||
@@ -105,13 +107,14 @@ static char *priorityName[NUM_CALLBACK_PRIORITIES] = {
|
||||
|
||||
/* EVENT */
|
||||
|
||||
#define MAX_EVENTS 256
|
||||
typedef struct event_scan_list {
|
||||
CALLBACK callback;
|
||||
scan_list scan_list;
|
||||
} event_scan_list;
|
||||
static event_scan_list *pevent_list[NUM_CALLBACK_PRIORITIES][MAX_EVENTS];
|
||||
|
||||
typedef struct event_list {
|
||||
CALLBACK callback[NUM_CALLBACK_PRIORITIES];
|
||||
scan_list scan_list[NUM_CALLBACK_PRIORITIES];
|
||||
struct event_list *next;
|
||||
char eventname[1]; /* actually arbitrary size */
|
||||
} event_list;
|
||||
static event_list * volatile pevent_list[256];
|
||||
static epicsMutexId event_lock;
|
||||
|
||||
/* IO_EVENT*/
|
||||
|
||||
@@ -219,35 +222,19 @@ void scanAdd(struct dbCommon *precord)
|
||||
recGblRecordError(-1, (void *)precord,
|
||||
"scanAdd detected illegal SCAN value");
|
||||
} else if (scan == menuScanEvent) {
|
||||
int evnt;
|
||||
char* eventname;
|
||||
int prio;
|
||||
event_scan_list *pesl;
|
||||
event_list *pel;
|
||||
|
||||
evnt = precord->evnt;
|
||||
if (evnt < 0 || evnt >= MAX_EVENTS) {
|
||||
recGblRecordError(S_db_badField, (void *)precord,
|
||||
"scanAdd detected illegal EVNT value");
|
||||
precord->scan = menuScanPassive;
|
||||
return;
|
||||
}
|
||||
eventname = precord->evnt;
|
||||
prio = precord->prio;
|
||||
if (prio < 0 || prio >= NUM_CALLBACK_PRIORITIES) {
|
||||
recGblRecordError(-1, (void *)precord,
|
||||
"scanAdd: illegal prio field");
|
||||
precord->scan = menuScanPassive;
|
||||
return;
|
||||
}
|
||||
pesl = pevent_list[prio][evnt];
|
||||
if (pesl == NULL) {
|
||||
pesl = dbCalloc(1, sizeof(event_scan_list));
|
||||
pevent_list[prio][evnt] = pesl;
|
||||
pesl->scan_list.lock = epicsMutexMustCreate();
|
||||
callbackSetCallback(eventCallback, &pesl->callback);
|
||||
callbackSetPriority(prio, &pesl->callback);
|
||||
callbackSetUser(pesl, &pesl->callback);
|
||||
ellInit(&pesl->scan_list.list);
|
||||
}
|
||||
addToList(precord, &pesl->scan_list);
|
||||
pel = eventNameToHandle(eventname);
|
||||
if (pel) addToList(precord, &pel->scan_list[prio]);
|
||||
} else if (scan == menuScanI_O_Intr) {
|
||||
io_scan_list *piosl = NULL;
|
||||
int prio;
|
||||
@@ -304,31 +291,18 @@ void scanDelete(struct dbCommon *precord)
|
||||
recGblRecordError(-1, (void *)precord,
|
||||
"scanDelete detected illegal SCAN value");
|
||||
} else if (scan == menuScanEvent) {
|
||||
int evnt;
|
||||
int prio;
|
||||
event_scan_list *pesl;
|
||||
event_list *pel;
|
||||
scan_list *psl = 0;
|
||||
|
||||
evnt = precord->evnt;
|
||||
if (evnt < 0 || evnt >= MAX_EVENTS) {
|
||||
recGblRecordError(S_db_badField, (void *)precord,
|
||||
"scanAdd detected illegal EVNT value");
|
||||
precord->scan = menuScanPassive;
|
||||
return;
|
||||
}
|
||||
prio = precord->prio;
|
||||
if (prio < 0 || prio >= NUM_CALLBACK_PRIORITIES) {
|
||||
recGblRecordError(-1, (void *)precord,
|
||||
"scanAdd: illegal prio field");
|
||||
precord->scan = menuScanPassive;
|
||||
"scanDelete detected illegal PRIO field");
|
||||
return;
|
||||
}
|
||||
pesl = pevent_list[prio][evnt];
|
||||
if (pesl) psl = &pesl->scan_list;
|
||||
if (!pesl || !psl)
|
||||
recGblRecordError(-1, (void *)precord,
|
||||
"scanDelete for bad evnt");
|
||||
else
|
||||
pel = eventNameToHandle(precord->evnt);
|
||||
if (pel && (psl = &pel->scan_list[prio]))
|
||||
deleteFromList(precord, psl);
|
||||
} else if (scan == menuScanI_O_Intr) {
|
||||
io_scan_list *piosl=NULL;
|
||||
@@ -410,21 +384,20 @@ int scanppl(double period) /* print periodic scan list(s) */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int scanpel(int event_number) /* print event list */
|
||||
int scanpel(const char* eventname) /* print event list */
|
||||
{
|
||||
char message[80];
|
||||
int prio, evnt;
|
||||
event_scan_list *pesl;
|
||||
|
||||
for (evnt = 0; evnt < MAX_EVENTS; evnt++) {
|
||||
if (event_number && evnt<event_number) continue;
|
||||
if (event_number && evnt>event_number) break;
|
||||
for (prio = 0; prio < NUM_CALLBACK_PRIORITIES; prio++) {
|
||||
pesl = pevent_list[prio][evnt];
|
||||
if (!pesl) continue;
|
||||
if (ellCount(&pesl->scan_list.list) == 0) continue;
|
||||
sprintf(message, "Event %d Priority %s", evnt, priorityName[prio]);
|
||||
printList(&pesl->scan_list, message);
|
||||
int prio;
|
||||
event_list *pel;
|
||||
|
||||
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, " Priority %s", priorityName[prio]);
|
||||
printList(&pel->scan_list[prio], message);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -450,39 +423,106 @@ int scanpiol(void) /* print io_event list */
|
||||
|
||||
static void eventCallback(CALLBACK *pcallback)
|
||||
{
|
||||
event_scan_list *pesl;
|
||||
scan_list *psl;
|
||||
|
||||
callbackGetUser(pesl, pcallback);
|
||||
scanList(&pesl->scan_list);
|
||||
callbackGetUser(psl, pcallback);
|
||||
scanList(psl);
|
||||
}
|
||||
|
||||
static void initEvent(void)
|
||||
{
|
||||
int evnt, prio;
|
||||
}
|
||||
|
||||
for (prio = 0; prio < NUM_CALLBACK_PRIORITIES; prio++) {
|
||||
for (evnt = 0; evnt < MAX_EVENTS; evnt++) {
|
||||
pevent_list[prio][evnt] = NULL;
|
||||
static void eventOnce(void *arg)
|
||||
{
|
||||
event_lock = epicsMutexMustCreate();
|
||||
}
|
||||
|
||||
event_list *eventNameToHandle(const char *eventname)
|
||||
{
|
||||
int prio;
|
||||
event_list *pel;
|
||||
static epicsThreadOnceId onceId = EPICS_THREAD_ONCE_INIT;
|
||||
double eventnumber = 0;
|
||||
size_t namelength;
|
||||
char* p;
|
||||
|
||||
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.
|
||||
*/
|
||||
eventnumber = strtod(eventname, &p);
|
||||
if (*p == 0)
|
||||
{
|
||||
if (!finite(eventnumber))
|
||||
return NULL; /* Inf and NaN are no events */
|
||||
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 */
|
||||
}
|
||||
|
||||
epicsThreadOnce(&onceId, eventOnce, NULL);
|
||||
epicsMutexMustLock(event_lock);
|
||||
for (pel = pevent_list[0]; pel; pel=pel->next) {
|
||||
if (strncmp(pel->eventname, eventname, namelength) == 0
|
||||
&& pel->eventname[namelength] == 0)
|
||||
break;
|
||||
}
|
||||
if (pel == NULL) {
|
||||
pel = dbCalloc(1, sizeof(event_list) + namelength);
|
||||
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]);
|
||||
callbackSetCallback(eventCallback, &pel->callback[prio]);
|
||||
pel->scan_list[prio].lock = epicsMutexMustCreate();
|
||||
ellInit(&pel->scan_list[prio].list);
|
||||
}
|
||||
pel->next=pevent_list[0];
|
||||
pevent_list[0]=pel;
|
||||
}
|
||||
epicsMutexUnlock(event_lock);
|
||||
return pel;
|
||||
}
|
||||
|
||||
void postEvent(event_list *pel)
|
||||
{
|
||||
int prio;
|
||||
|
||||
if (scanCtl != ctlRun) return;
|
||||
if (!pel) return;
|
||||
for (prio = 0; prio < NUM_CALLBACK_PRIORITIES; prio++) {
|
||||
if (ellCount(&pel->scan_list[prio].list) >0)
|
||||
callbackRequest(&pel->callback[prio]);
|
||||
}
|
||||
}
|
||||
|
||||
/* backward compatibility */
|
||||
void post_event(int event)
|
||||
{
|
||||
int prio;
|
||||
event_scan_list *pesl;
|
||||
|
||||
if (scanCtl != ctlRun) return;
|
||||
if (event < 0 || event >= MAX_EVENTS) {
|
||||
errMessage(-1, "illegal event passed to post_event");
|
||||
return;
|
||||
}
|
||||
for (prio=0; prio<NUM_CALLBACK_PRIORITIES; prio++) {
|
||||
pesl = pevent_list[prio][event];
|
||||
if (!pesl) continue;
|
||||
if (ellCount(&pesl->scan_list.list) >0)
|
||||
callbackRequest((void *)pesl);
|
||||
}
|
||||
if (event <= 0 || event > 255) return;
|
||||
postEvent(pevent_list[event]);
|
||||
}
|
||||
|
||||
void scanIoInit(IOSCANPVT *ppioscanpvt)
|
||||
|
||||
@@ -31,10 +31,13 @@ extern "C" {
|
||||
#define MAX_PHASE SHRT_MAX
|
||||
#define MIN_PHASE SHRT_MIN
|
||||
|
||||
#define HAVE_NAMED_SOFT_EVENTS
|
||||
|
||||
/*definitions for I/O Interrupt Scanning */
|
||||
struct io_scan_list;
|
||||
|
||||
typedef struct io_scan_list *IOSCANPVT;
|
||||
typedef struct event_list *EVENTPVT;
|
||||
|
||||
struct dbCommon;
|
||||
|
||||
@@ -42,6 +45,8 @@ epicsShareFunc long scanInit(void);
|
||||
epicsShareFunc void scanRun(void);
|
||||
epicsShareFunc void scanPause(void);
|
||||
|
||||
epicsShareFunc EVENTPVT eventNameToHandle(const char* event);
|
||||
epicsShareFunc void postEvent(EVENTPVT epvt);
|
||||
epicsShareFunc void post_event(int event);
|
||||
epicsShareFunc void scanAdd(struct dbCommon *);
|
||||
epicsShareFunc void scanDelete(struct dbCommon *);
|
||||
@@ -53,7 +58,7 @@ epicsShareFunc int scanOnceSetQueueSize(int size);
|
||||
epicsShareFunc int scanppl(double rate);
|
||||
|
||||
/*print event lists*/
|
||||
epicsShareFunc int scanpel(int event_number);
|
||||
epicsShareFunc int scanpel(const char *event_name);
|
||||
|
||||
/*print io_event list*/
|
||||
epicsShareFunc int scanpiol(void);
|
||||
|
||||
@@ -94,6 +94,7 @@ typedef struct dbInfoNode { /*non-field per-record information*/
|
||||
char *name;
|
||||
char *string;
|
||||
void *pointer;
|
||||
dbFldDes *pdbFldDes;
|
||||
}dbInfoNode;
|
||||
|
||||
#define DBRN_FLAGS_VISIBLE 1
|
||||
@@ -106,6 +107,7 @@ typedef struct dbRecordNode {
|
||||
char *recordname;
|
||||
ELLLIST infoList; /*LIST head of info nodes*/
|
||||
int flags;
|
||||
struct dbRecordNode *aliasedRecnode; /* NULL unless flags|DBRN_FLAGS_ISALIAS */
|
||||
}dbRecordNode;
|
||||
|
||||
/*dbRecordAttribute is for "psuedo" fields */
|
||||
|
||||
@@ -1548,7 +1548,7 @@ long epicsShareAPI dbCreateRecord(DBENTRY *pdbentry,const char *precordName)
|
||||
if((status = dbAllocRecord(pdbentry,precordName))) return(status);
|
||||
pNewRecNode->recordname = dbRecordName(pdbentry);
|
||||
ellInit(&pNewRecNode->infoList);
|
||||
/* install record node in list in sorted postion */
|
||||
/* install record node in list in sorted position */
|
||||
status = dbFirstRecord(pdbentry);
|
||||
while(status==0) {
|
||||
if(strcmp(precordName,dbGetRecordName(pdbentry)) < 0) break;
|
||||
@@ -1816,37 +1816,44 @@ long epicsShareAPI dbCreateAlias(DBENTRY *pdbentry, const char *alias)
|
||||
dbRecordNode *pnewnode;
|
||||
PVDENTRY *ppvd;
|
||||
ELLLIST *preclist = NULL;
|
||||
DBENTRY dbEntry;
|
||||
long status;
|
||||
|
||||
if (!precordType) return S_dbLib_recordTypeNotFound;
|
||||
/* alias of alias still references actual record */
|
||||
while(precnode && (precnode->flags&DBRN_FLAGS_ISALIAS))
|
||||
precnode = precnode->aliasedRecnode;
|
||||
if (!precnode) return S_dbLib_recNotFound;
|
||||
zeroDbentry(pdbentry);
|
||||
if (!dbFindRecord(pdbentry, alias)) return S_dbLib_recExists;
|
||||
zeroDbentry(pdbentry);
|
||||
pdbentry->precordType = precordType;
|
||||
/* use copy to avoid later info fields being bound to the alias */
|
||||
dbCopyEntryContents(pdbentry, &dbEntry);
|
||||
zeroDbentry(&dbEntry);
|
||||
if (!dbFindRecord(&dbEntry, alias)) return S_dbLib_recExists;
|
||||
zeroDbentry(&dbEntry);
|
||||
dbEntry.precordType = precordType;
|
||||
preclist = &precordType->recList;
|
||||
pnewnode = dbCalloc(1, sizeof(dbRecordNode));
|
||||
pnewnode->recordname = epicsStrDup(alias);
|
||||
pnewnode->precord = precnode->precord;
|
||||
pnewnode->aliasedRecnode = precnode;
|
||||
pnewnode->flags = DBRN_FLAGS_ISALIAS;
|
||||
if (!(precnode->flags & DBRN_FLAGS_ISALIAS))
|
||||
precnode->flags |= DBRN_FLAGS_HASALIAS;
|
||||
precnode->flags |= DBRN_FLAGS_HASALIAS;
|
||||
ellInit(&pnewnode->infoList);
|
||||
/* install record node in list in sorted postion */
|
||||
status = dbFirstRecord(pdbentry);
|
||||
/* install alias node in list in sorted position */
|
||||
status = dbFirstRecord(&dbEntry);
|
||||
while (!status) {
|
||||
if (strcmp(alias, dbGetRecordName(pdbentry)) < 0) break;
|
||||
status = dbNextRecord(pdbentry);
|
||||
if (strcmp(alias, dbGetRecordName(&dbEntry)) < 0) break;
|
||||
status = dbNextRecord(&dbEntry);
|
||||
}
|
||||
if (!status) {
|
||||
precnode = pdbentry->precnode;
|
||||
precnode = dbEntry.precnode;
|
||||
ellInsert(preclist, ellPrevious(&precnode->node), &pnewnode->node);
|
||||
} else {
|
||||
ellAdd(preclist, &pnewnode->node);
|
||||
}
|
||||
precordType->no_aliases++;
|
||||
pdbentry->precnode = pnewnode;
|
||||
ppvd = dbPvdAdd(pdbentry->pdbbase, precordType, pnewnode);
|
||||
dbEntry.precnode = pnewnode;
|
||||
ppvd = dbPvdAdd(dbEntry.pdbbase, precordType, pnewnode);
|
||||
dbFinishEntry(&dbEntry);
|
||||
if (!ppvd) {errMessage(-1,"Logic Err: Could not add to PVD");return(-1);}
|
||||
return 0;
|
||||
}
|
||||
@@ -2808,6 +2815,32 @@ long epicsShareAPI dbFindInfo(DBENTRY *pdbentry,const char *name)
|
||||
return (S_dbLib_infoNotFound);
|
||||
}
|
||||
|
||||
long dbFindInfoPart(DBENTRY *pdbentry, const char **ppname)
|
||||
{
|
||||
dbRecordNode *precnode = pdbentry->precnode;
|
||||
dbInfoNode *pinfo;
|
||||
const char *pname = *ppname;
|
||||
size_t len;
|
||||
|
||||
if (precnode->aliasedRecnode)
|
||||
precnode=precnode->aliasedRecnode;
|
||||
pinfo = (dbInfoNode *)ellFirst(&precnode->infoList);
|
||||
while (pinfo) {
|
||||
len = strlen(pinfo->name);
|
||||
if (!strncmp(pinfo->name, pname, len) &&
|
||||
(pname[len] == 0 || pname[len] == '$' || pname[len] == '{' || pname[len] == '['))
|
||||
{
|
||||
pdbentry->pinfonode = pinfo;
|
||||
pdbentry->pflddes = pinfo->pdbFldDes;
|
||||
pdbentry->pfield = pinfo->string;
|
||||
*ppname = &pname[len];
|
||||
return (0);
|
||||
}
|
||||
pinfo = (dbInfoNode *)ellNext(&pinfo->node);
|
||||
}
|
||||
return S_dbLib_fieldNotFound;
|
||||
}
|
||||
|
||||
long epicsShareAPI dbDeleteInfo(DBENTRY *pdbentry)
|
||||
{
|
||||
dbRecordNode *precnode = pdbentry->precnode;
|
||||
@@ -2846,6 +2879,7 @@ long epicsShareAPI dbPutInfoString(DBENTRY *pdbentry,const char *string)
|
||||
if (!newstring) return (S_dbLib_outMem);
|
||||
strcpy(newstring, string);
|
||||
pinfo->string = newstring;
|
||||
pinfo->pdbFldDes->size = strlen(newstring)+1;
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -2872,6 +2906,7 @@ const char * epicsShareAPI dbGetInfo(DBENTRY *pdbentry,const char *name)
|
||||
|
||||
long epicsShareAPI dbPutInfo(DBENTRY *pdbentry,const char *name,const char *string)
|
||||
{
|
||||
dbFldDes *pdbFldDes;
|
||||
dbInfoNode *pinfo;
|
||||
dbRecordNode *precnode = pdbentry->precnode;
|
||||
if (!precnode) return (S_dbLib_recNotFound);
|
||||
@@ -2896,6 +2931,20 @@ long epicsShareAPI dbPutInfo(DBENTRY *pdbentry,const char *name,const char *stri
|
||||
return (S_dbLib_outMem);
|
||||
}
|
||||
strcpy(pinfo->string, string);
|
||||
pdbFldDes = calloc(1,sizeof(dbFldDes));
|
||||
if (!pdbFldDes) {
|
||||
free(pinfo->string);
|
||||
free(pinfo->name);
|
||||
free(pinfo);
|
||||
return (S_dbLib_outMem);
|
||||
}
|
||||
pdbFldDes->name = pinfo->name;
|
||||
pdbFldDes->pdbRecordType = pdbentry->precordType;
|
||||
pdbFldDes->special = SPC_ATTRIBUTE;
|
||||
pdbFldDes->field_type = DBF_STRING;
|
||||
pdbFldDes->as_level = ASL1;
|
||||
pdbFldDes->size = strlen(string)+1;
|
||||
pinfo->pdbFldDes = pdbFldDes;
|
||||
ellAdd(&precnode->infoList,&pinfo->node);
|
||||
pdbentry->pinfonode = pinfo;
|
||||
return (0);
|
||||
|
||||
@@ -170,6 +170,8 @@ epicsShareFunc char * epicsShareAPI dbVerify(DBENTRY *pdbentry,
|
||||
epicsShareFunc char * epicsShareAPI dbGetRange(DBENTRY *pdbentry);
|
||||
epicsShareFunc int epicsShareAPI dbIsDefaultValue(DBENTRY *pdbentry);
|
||||
|
||||
epicsShareFunc long dbFindInfoPart(DBENTRY *pdbentry,
|
||||
const char **ppname);
|
||||
epicsShareFunc long epicsShareAPI dbFirstInfo(DBENTRY *pdbentry);
|
||||
epicsShareFunc long epicsShareAPI dbNextInfo(DBENTRY *pdbentry);
|
||||
epicsShareFunc long epicsShareAPI dbFindInfo(DBENTRY *pdbentry,
|
||||
|
||||
@@ -50,7 +50,7 @@ static long init_record(eventRecord *prec)
|
||||
/* INP must be CONSTANT, PV_LINK, DB_LINK or CA_LINK*/
|
||||
switch (prec->inp.type) {
|
||||
case CONSTANT:
|
||||
if (recGblInitConstantLink(&prec->inp, DBF_USHORT, &prec->val))
|
||||
if (recGblInitConstantLink(&prec->inp, DBF_STRING, &prec->val))
|
||||
prec->udf = FALSE;
|
||||
break;
|
||||
case PV_LINK:
|
||||
@@ -68,13 +68,20 @@ static long init_record(eventRecord *prec)
|
||||
static long read_event(eventRecord *prec)
|
||||
{
|
||||
long status;
|
||||
char newEvent[MAX_STRING_SIZE];
|
||||
|
||||
status = dbGetLink(&prec->inp, DBR_USHORT, &prec->val, 0, 0);
|
||||
if (!status) {
|
||||
prec->udf = FALSE;
|
||||
if (prec->tsel.type == CONSTANT &&
|
||||
prec->tse == epicsTimeEventDeviceTime)
|
||||
dbGetTimeStamp(&prec->inp, &prec->time);
|
||||
if (prec->inp.type != CONSTANT)
|
||||
{
|
||||
status = dbGetLinkValue(&prec->inp, DBR_STRING, newEvent, 0, 0);
|
||||
if (status) return status;
|
||||
if (strcmp(newEvent, prec->val) != 0) {
|
||||
strcpy(prec->val, newEvent);
|
||||
prec->epvt = eventNameToHandle(prec->val);
|
||||
}
|
||||
}
|
||||
return status;
|
||||
prec->udf = FALSE;
|
||||
if (prec->tsel.type == CONSTANT &&
|
||||
prec->tse == epicsTimeEventDeviceTime)
|
||||
dbGetTimeStamp(&prec->inp, &prec->time);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ epicsShareFunc long
|
||||
double *ptop; /* stack pointer */
|
||||
double top; /* value from top of stack */
|
||||
epicsInt32 itop; /* integer from top of stack */
|
||||
epicsUInt32 utop; /* unsigned integer from top of stack */
|
||||
int op;
|
||||
int nargs;
|
||||
|
||||
@@ -287,30 +286,36 @@ epicsShareFunc long
|
||||
*ptop = ! *ptop;
|
||||
break;
|
||||
|
||||
/* For bitwise operations on values with bit 31 set, double values
|
||||
* must first be cast to unsigned to correctly set that bit; the
|
||||
* double value must be negative in that case. The result must be
|
||||
* cast to a signed integer before converting to the double result.
|
||||
/* Be VERY careful converting double to int in case bit 31 is set!
|
||||
* Out-of-range errors give very different results on different sytems.
|
||||
* Convert negative doubles to signed and positive doubles to unsigned
|
||||
* first to avoid overflows if bit 32 is set.
|
||||
* The result is always signed, values with bit 31 set are negative
|
||||
* to avoid problems when writing the value to signed integer fields
|
||||
* like longout.VAL or ao.RVAL. However unsigned fields may give
|
||||
* problems on some architectures. (Fewer than giving problems with
|
||||
* signed integer. Maybe the conversion functions should handle
|
||||
* overflows better.)
|
||||
*/
|
||||
#define d2i(x) ((x)<0?(epicsInt32)(x):(epicsInt32)(epicsUInt32)(x))
|
||||
|
||||
case BIT_OR:
|
||||
utop = *ptop--;
|
||||
*ptop = (epicsInt32) ((epicsUInt32) *ptop | utop);
|
||||
top = *ptop--;
|
||||
*ptop = (double)(d2i(*ptop) | d2i(top));
|
||||
break;
|
||||
|
||||
case BIT_AND:
|
||||
utop = *ptop--;
|
||||
*ptop = (epicsInt32) ((epicsUInt32) *ptop & utop);
|
||||
top = *ptop--;
|
||||
*ptop = (double)(d2i(*ptop) & d2i(top));
|
||||
break;
|
||||
|
||||
case BIT_EXCL_OR:
|
||||
utop = *ptop--;
|
||||
*ptop = (epicsInt32) ((epicsUInt32) *ptop ^ utop);
|
||||
top = *ptop--;
|
||||
*ptop = (double)(d2i(*ptop) ^ d2i(top));
|
||||
break;
|
||||
|
||||
case BIT_NOT:
|
||||
utop = *ptop;
|
||||
*ptop = (epicsInt32) ~utop;
|
||||
*ptop = (double)~d2i(*ptop);
|
||||
break;
|
||||
|
||||
/* The shift operators use signed integers, so a right-shift will
|
||||
@@ -319,13 +324,13 @@ epicsShareFunc long
|
||||
*/
|
||||
|
||||
case RIGHT_SHIFT:
|
||||
utop = *ptop--;
|
||||
*ptop = ((epicsInt32) (epicsUInt32) *ptop) >> (utop & 31);
|
||||
top = *ptop--;
|
||||
*ptop = (double)(d2i(*ptop) >> (d2i(top) & 31));
|
||||
break;
|
||||
|
||||
case LEFT_SHIFT:
|
||||
utop = *ptop--;
|
||||
*ptop = ((epicsInt32) (epicsUInt32) *ptop) << (utop & 31);
|
||||
top = *ptop--;
|
||||
*ptop = (double)(d2i(*ptop) << (d2i(top) & 31));
|
||||
break;
|
||||
|
||||
case NOT_EQ:
|
||||
|
||||
@@ -421,10 +421,12 @@ epicsShareFunc long
|
||||
pstacktop--;
|
||||
}
|
||||
|
||||
if (cond_count != 0) {
|
||||
*perror = CALC_ERR_CONDITIONAL;
|
||||
goto bad;
|
||||
}
|
||||
/*
|
||||
* if (cond_count != 0) {
|
||||
* *perror = CALC_ERR_CONDITIONAL;
|
||||
* goto bad;
|
||||
* }
|
||||
*/
|
||||
if (runtime_depth > 1) {
|
||||
*perror = CALC_ERR_TOOMANY;
|
||||
goto bad;
|
||||
@@ -468,10 +470,12 @@ epicsShareFunc long
|
||||
}
|
||||
*pout = END_EXPRESSION;
|
||||
|
||||
if (cond_count != 0) {
|
||||
*perror = CALC_ERR_CONDITIONAL;
|
||||
goto bad;
|
||||
}
|
||||
/*
|
||||
* if (cond_count != 0) {
|
||||
* *perror = CALC_ERR_CONDITIONAL;
|
||||
* goto bad;
|
||||
* }
|
||||
*/
|
||||
if (operand_needed || runtime_depth != 1) {
|
||||
*perror = CALC_ERR_INCOMPLETE;
|
||||
goto bad;
|
||||
|
||||
@@ -281,6 +281,13 @@ void ellFree2 (ELLLIST *pList, FREEFUNC freeFunc)
|
||||
pList->count = 0;
|
||||
}
|
||||
|
||||
/* for backward compatibility provide a function ellFree() in addition to macro */
|
||||
#undef ellFree
|
||||
void ellFree (ELLLIST *pList)
|
||||
{
|
||||
ellFree2 (pList, free);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* This function verifies that the list is consistent.
|
||||
|
||||
@@ -197,6 +197,8 @@ static long init_record(calcoutRecord *prec, int pass)
|
||||
callbackSetUser(prec, &prpvt->checkLinkCb);
|
||||
prpvt->cbScheduled = 0;
|
||||
|
||||
prec->epvt = eventNameToHandle(prec->oevt);
|
||||
|
||||
if (pcalcoutDSET->init_record) pcalcoutDSET->init_record(prec);
|
||||
prec->pval = prec->val;
|
||||
prec->mlst = prec->val;
|
||||
@@ -361,6 +363,9 @@ static long special(DBADDR *paddr, int after)
|
||||
}
|
||||
db_post_events(prec, plinkValid, DBE_VALUE);
|
||||
return 0;
|
||||
case(calcoutRecordOEVT):
|
||||
prec->epvt = eventNameToHandle(prec->oevt);
|
||||
return 0;
|
||||
default:
|
||||
recGblDbaddrError(S_db_badChoice, paddr, "calc: special");
|
||||
return(S_db_badChoice);
|
||||
@@ -544,27 +549,21 @@ static void execOutput(calcoutRecord *prec)
|
||||
if (prec->nsev < INVALID_ALARM ) {
|
||||
/* Output the value */
|
||||
status = writeValue(prec);
|
||||
/* post event if output event != 0 */
|
||||
if (prec->oevt > 0) {
|
||||
post_event((int)prec->oevt);
|
||||
}
|
||||
/* post output event if set */
|
||||
if (prec->epvt) postEvent(prec->epvt);
|
||||
} else switch (prec->ivoa) {
|
||||
case menuIvoaContinue_normally:
|
||||
status = writeValue(prec);
|
||||
/* post event if output event != 0 */
|
||||
if (prec->oevt > 0) {
|
||||
post_event((int)prec->oevt);
|
||||
}
|
||||
/* post output event if set */
|
||||
if (prec->epvt) postEvent(prec->epvt);
|
||||
break;
|
||||
case menuIvoaDon_t_drive_outputs:
|
||||
break;
|
||||
case menuIvoaSet_output_to_IVOV:
|
||||
prec->oval = prec->ivov;
|
||||
status = writeValue(prec);
|
||||
/* post event if output event != 0 */
|
||||
if (prec->oevt > 0) {
|
||||
post_event((int)prec->oevt);
|
||||
}
|
||||
/* post output event if set */
|
||||
if (prec->epvt) postEvent(prec->epvt);
|
||||
break;
|
||||
default:
|
||||
status = -1;
|
||||
|
||||
@@ -255,10 +255,19 @@ recordtype(calcout) {
|
||||
prompt("OCAL Valid")
|
||||
interest(1)
|
||||
}
|
||||
field(OEVT,DBF_USHORT) {
|
||||
field(OEVT,DBF_STRING) {
|
||||
prompt("Event To Issue")
|
||||
promptgroup(GUI_CLOCK)
|
||||
special(SPC_MOD)
|
||||
asl(ASL0)
|
||||
size(40)
|
||||
}
|
||||
%#include "dbScan.h"
|
||||
field(EPVT, DBF_NOACCESS) {
|
||||
prompt("Event private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("EVENTPVT epvt")
|
||||
}
|
||||
field(IVOA,DBF_MENU) {
|
||||
prompt("INVALID output action")
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "special.h"
|
||||
#include "menuYesNo.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
@@ -42,7 +43,7 @@
|
||||
#define initialize NULL
|
||||
static long init_record(eventRecord *, int);
|
||||
static long process(eventRecord *);
|
||||
#define special NULL
|
||||
static long special(DBADDR *, int);
|
||||
static long get_value(eventRecord *, struct valueDes *);
|
||||
#define cvt_dbaddr NULL
|
||||
#define get_array_info NULL
|
||||
@@ -102,9 +103,11 @@ static long init_record(eventRecord *prec, int pass)
|
||||
}
|
||||
|
||||
if (prec->siol.type == CONSTANT) {
|
||||
recGblInitConstantLink(&prec->siol,DBF_USHORT,&prec->sval);
|
||||
recGblInitConstantLink(&prec->siol,DBF_STRING,&prec->sval);
|
||||
}
|
||||
|
||||
prec->epvt = eventNameToHandle(prec->val);
|
||||
|
||||
if( (pdset=(struct eventdset *)(prec->dset)) && (pdset->init_record) )
|
||||
status=(*pdset->init_record)(prec);
|
||||
return(status);
|
||||
@@ -122,7 +125,7 @@ static long process(eventRecord *prec)
|
||||
if ( !pact && prec->pact ) return(0);
|
||||
prec->pact = TRUE;
|
||||
|
||||
if(prec->val>0) post_event((int)prec->val);
|
||||
postEvent(prec->epvt);
|
||||
|
||||
recGblGetTimeStamp(prec);
|
||||
|
||||
@@ -136,10 +139,22 @@ static long process(eventRecord *prec)
|
||||
return(status);
|
||||
}
|
||||
|
||||
|
||||
static long special(DBADDR *paddr, int after)
|
||||
{
|
||||
eventRecord *prec = (eventRecord *)paddr->precord;
|
||||
|
||||
if (!after) return 0;
|
||||
if (dbGetFieldIndex(paddr) == eventRecordVAL) {
|
||||
prec->epvt = eventNameToHandle(prec->val);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static long get_value(eventRecord *prec, struct valueDes *pvdes)
|
||||
{
|
||||
pvdes->field_type = DBF_USHORT;
|
||||
pvdes->field_type = DBF_STRING;
|
||||
pvdes->no_elements=1;
|
||||
pvdes->pvalue = (void *)(&prec->val);
|
||||
return(0);
|
||||
@@ -176,10 +191,13 @@ static long readValue(eventRecord *prec)
|
||||
return(status);
|
||||
}
|
||||
if (prec->simm == menuYesNoYES){
|
||||
status=dbGetLink(&(prec->siol),DBR_USHORT,
|
||||
status=dbGetLink(&(prec->siol),DBR_STRING,
|
||||
&(prec->sval),0,0);
|
||||
if (status==0) {
|
||||
prec->val=prec->sval;
|
||||
if (strcmp(prec->sval, prec->val) != 0) {
|
||||
strcpy(prec->val, prec->sval);
|
||||
prec->epvt = eventNameToHandle(prec->val);
|
||||
}
|
||||
prec->udf=FALSE;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -9,10 +9,19 @@
|
||||
#*************************************************************************
|
||||
recordtype(event) {
|
||||
include "dbCommon.dbd"
|
||||
field(VAL,DBF_USHORT) {
|
||||
prompt("Event Number To Post")
|
||||
field(VAL,DBF_STRING) {
|
||||
prompt("Event Name To Post")
|
||||
promptgroup(GUI_INPUTS)
|
||||
special(SPC_MOD)
|
||||
asl(ASL0)
|
||||
size(40)
|
||||
}
|
||||
%#include "dbScan.h"
|
||||
field(EPVT, DBF_NOACCESS) {
|
||||
prompt("Event private")
|
||||
special(SPC_NOMOD)
|
||||
interest(4)
|
||||
extra("EVENTPVT epvt")
|
||||
}
|
||||
field(INP,DBF_INLINK) {
|
||||
prompt("Input Specification")
|
||||
@@ -24,8 +33,9 @@ recordtype(event) {
|
||||
promptgroup(GUI_INPUTS)
|
||||
interest(1)
|
||||
}
|
||||
field(SVAL,DBF_USHORT) {
|
||||
field(SVAL,DBF_STRING) {
|
||||
prompt("Simulation Value")
|
||||
size(40)
|
||||
}
|
||||
field(SIML,DBF_INLINK) {
|
||||
prompt("Sim Mode Location")
|
||||
|
||||
@@ -24,9 +24,11 @@ recordtype(sel) {
|
||||
prompt("Select Mechanism")
|
||||
promptgroup(GUI_INPUTS)
|
||||
menu(selSELM)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(SELN,DBF_USHORT) {
|
||||
prompt("Index value")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(PREC,DBF_SHORT) {
|
||||
prompt("Display Precision")
|
||||
|
||||
@@ -24,11 +24,13 @@ recordtype(seq) {
|
||||
promptgroup(GUI_INPUTS)
|
||||
interest(1)
|
||||
menu(seqSELM)
|
||||
pp(TRUE)
|
||||
}
|
||||
field(SELN,DBF_USHORT) {
|
||||
prompt("Link Selection")
|
||||
interest(1)
|
||||
initial("1")
|
||||
pp(TRUE)
|
||||
}
|
||||
field(SELL,DBF_INLINK) {
|
||||
prompt("Link Selection Loc")
|
||||
|
||||
@@ -14,6 +14,8 @@ USR_INCLUDES = -I../../ca
|
||||
|
||||
INC += rsrv.h
|
||||
INC += rsrvIocRegister.h
|
||||
# The following is used by iocmon
|
||||
INC += server.h
|
||||
|
||||
LIB_SRCS += caserverio.c
|
||||
LIB_SRCS += caservertask.c
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#include "dbEvent.h"
|
||||
#include "dbCommon.h"
|
||||
#include "epicsStdioRedirect.h"
|
||||
#include "epicsExit.h"
|
||||
#include "epicsString.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "rsrv.h"
|
||||
@@ -108,6 +110,15 @@ static void req_server (void *pParm)
|
||||
if ( status < 0 ) {
|
||||
if ( SOCKERRNO == SOCK_EADDRINUSE ||
|
||||
SOCKERRNO == SOCK_EACCES ) {
|
||||
#ifndef vxWorks
|
||||
const char* multiple_iocs = getenv("EPICS_ALLOW_MULTIPLE_IOCS");
|
||||
if (multiple_iocs && epicsStrCaseCmp(multiple_iocs, "NO") == 0)
|
||||
{
|
||||
errlogPrintf ( "CAS: Default server port %d unavailable.\n" ,ca_server_port);
|
||||
errlogPrintf ( "CAS: Probably already running an IOC on this computer.\n");
|
||||
epicsExit(1);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* enable assignment of a default port
|
||||
* (so the getsockname() call below will
|
||||
|
||||
Reference in New Issue
Block a user