Compare commits

..

17 Commits

Author SHA1 Message Date
19c04ace1d remove strict aliasing warnings for vxWorks 6.3 and mvl40-xscale_be (Moxa) 2018-03-28 11:36:33 +02:00
538bc88760 where possible compile always with debug infos with gcc 2018-03-22 10:45:11 +01:00
0b6eb67137 merge updates from main branch 2018-03-21 11:51:56 +01:00
5c080a64f9 bind info to reacord instead of alias 2018-03-21 11:04:15 +01:00
3f1a366291 better fix for 32 bit calc 2018-03-02 13:32:25 +01:00
0d332dbb41 channel access to info fields 2018-03-02 13:31:18 +01:00
c1447d9cb4 handle changing datatype in camonitor reconnect 2018-02-28 17:06:24 +01:00
76ba742563 allow unterminated conditionals in CALC 2018-02-28 16:54:12 +01:00
6a75f3258b add EPICS_ALLOW_MULTIPLE_IOCS to prevent starting more than one IOC on one machine 2018-02-28 16:53:35 +01:00
a2bf0f3c66 backward compatibility function wrappers 2018-02-28 16:52:34 +01:00
d2c4fd85d7 named events 2018-02-28 16:51:09 +01:00
2772d57842 set PP on SELN and SELM fields 2018-02-28 16:42:33 +01:00
c9a8a551e8 remove strict alias warnings on more architectures 2018-02-28 16:18:31 +01:00
2718a0d706 install additional header files for caGateway 2018-02-22 17:17:34 +01:00
1b9a104215 install additional header file for iocStats 2018-02-22 17:16:55 +01:00
c6a9818539 Copy src and tar rule 2018-02-22 17:13:40 +01:00
f400e12743 PSI configuration 2018-02-22 17:11:56 +01:00
110 changed files with 1560 additions and 1050 deletions

View File

@@ -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

View File

@@ -17,7 +17,7 @@ ticker() {
CACHEKEY=1
EPICS_HOST_ARCH=`perl src/tools/EpicsHostArch.pl`
EPICS_HOST_ARCH=`sh startup/EpicsHostArch`
[ -e configure/os/CONFIG_SITE.Common.linux-x86 ] || die "Wrong location: $PWD"

View File

@@ -20,15 +20,11 @@ else
endif
# Provide a default if the user hasn't set EPICS_HOST_ARCH
#
ifeq ($(origin EPICS_HOST_ARCH), undefined)
# Bootstrapping ...
EHA := $(firstword $(wildcard $(EPICS_BASE)/lib/perl/EpicsHostArch.pl \
$(TOP)/src/tools/EpicsHostArch.pl))
# NB: We use a simply expanded variable here for performance:
export EPICS_HOST_ARCH := $(shell perl $(EHA))
EHA :=
EPICS_HOST_ARCH := $(shell $(CONFIG)/../startup/EpicsHostArch.pl)
endif
#
-include $(CONFIG)/os/CONFIG_COMPAT

View File

@@ -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))

View File

@@ -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

View File

@@ -28,10 +28,19 @@ EPICS_MODIFICATION = 12
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
# Not included if zero
EPICS_PATCH_LEVEL = 8
EPICS_PATCH_LEVEL = 7
# This will end in -DEV between official releases
EPICS_DEV_SNAPSHOT=
EPICS_DEV_SNAPSHOT=-DEV
#EPICS_DEV_SNAPSHOT=-pre1
#EPICS_DEV_SNAPSHOT=-pre1-DEV
#EPICS_DEV_SNAPSHOT=-pre2
#EPICS_DEV_SNAPSHOT=-pre2-DEV
#EPICS_DEV_SNAPSHOT=-rc1
#EPICS_DEV_SNAPSHOT=-rc1-DEV
#EPICS_DEV_SNAPSHOT=-rc2
#EPICS_DEV_SNAPSHOT=-rc2-DEV
#EPICS_DEV_SNAPSHOT=
# No changes should be needed below here

View File

@@ -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.

View File

@@ -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))

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,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

View 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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,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

View 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)

View 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 =

View 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

View File

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

View File

@@ -0,0 +1,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

View 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

View File

@@ -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

View 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)

View File

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

View File

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

View File

@@ -0,0 +1,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

View 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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -85,20 +85,16 @@ CPP = cl -nologo -C -E
# Configure OS vendor C++ compiler
#
# __STDC__=0 gives us both:
# 1) define STDC for code (pretend ANSI conformance)
# 2) set it to 0 to use MS C "extensions" (open for _open etc.)
# because MS uses: if __STDC__ ... disable many nice things
#
# -EHsc - generate code for exceptions
# -GR - generate code for run time type identification
#
CCC = cl -EHsc -GR
# Other compiler flags, used for CPP, C and C++
#
# -FC - Show absolute path of source file in diagnostics
# -D__STDC__=0 gives us both:
# 1) define STDC for code (pretend ANSI conformance)
# 2) set it to 0 to use MS C "extensions" (open for _open etc.)
# because MS uses: if __STDC__ ... disable many nice things
#
CODE_CPPFLAGS += -nologo -FC -D__STDC__=0
CODE_CPPFLAGS += -nologo -D__STDC__=0
CODE_CPPFLAGS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE

View File

@@ -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)

View 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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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

View File

@@ -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

View File

@@ -4,16 +4,27 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Known Problems in R3.14.12.8</title>
<title>Known Problems in R3.14.12.1</title>
</head>
<body>
<h1 style="text-align: center">EPICS Base R3.14.12.8: Known Problems</h1>
<h1 style="text-align: center">EPICS Base R3.14.12.1: Known Problems</h1>
<p>This was the last release in the Base-3.14 series, so we are no longer
tracking bugs in this branch. Please upgrade to one of the newer releases which
have incorporated many bug fixes and new features since they branched off the
Base-3.14 release series.</p>
<p>Any patch files linked below should be applied at the root of the
base-3.14.12.1 tree. Download them, then use the GNU Patch program as
follows:</p>
<blockquote><pre>% <b>cd <i>/path/to/</i>base-3.14.12.1</b>
% <b>patch -p0 &lt; <i>/path/to/</i>file.patch</b></pre></blockquote>
<p>The following significant problems have been reported with this
version of EPICS Base:</p>
<ul>
<li>None yet.</li>
</ul>
</body>
</html>

View File

@@ -221,11 +221,14 @@
base/startup directory - contains scripts to set environment and path
EpicsHostArch Shell script to set EPICS_HOST_ARCH env variable
unix.csh C shell script to set path and env variables
unix.sh Bourne shell script to set path and env variables
win32.bat Bat file example to configure win32-x86 target
windows.bat Bat file example to configure windows-x64 target
EpicsHostArch C shell script to set EPICS_HOST_ARCH env variable
EpicsHostArch.pl Perl script to set EPICS_HOST_ARCH env variable
Site.profile bourne shell script to set path and env variables
Site.cshrc c shell script to set path and env variables
borland.bat WIN32 bat file to set borland path and env variables
cygwin.bat WIN32 bat file to set cygwin path and env variables
win32.bat WIN32 bat file to set path and env variables
win32-debug.bat WIN32 debug bat file to set debug path and env variables
base/configure directory - contains build definitions and rules

View File

@@ -21,7 +21,7 @@ of my Bash login script (~/.bash_login):
#
EPICS_BASE="${HOME}/src/EPICS/base"
EPICS_EXTENSIONS="${HOME}/src/EPICS/extensions"
<strong>.</strong> "${EPICS_BASE}"/startup/unix.sh
<strong>.</strong> "${EPICS_BASE}"/startup/Site.profile
</pre>
</li>
<li>

View File

@@ -230,11 +230,14 @@
<H4>base/startup directory - contains scripts to set environment and path</H4>
<PRE>
EpicsHostArch Shell script to set EPICS_HOST_ARCH env variable
unix.csh C shell script to set path and env variables
unix.sh Bourne shell script to set path and env variables
win32.bat Bat file example to configure win32-x86 target
windows.bat Bat file example to configure windows-x64 target
EpicsHostArch C shell script to set EPICS_HOST_ARCH env variable
EpicsHostArch.pl Perl script to set EPICS_HOST_ARCH env variable
Site.profile bourne shell script to set path and env variables
Site.cshrc c shell script to set path and env variables
borland.bat WIN32 bat file to set borland path and env variables
cygwin.bat WIN32 bat file to set cygwin path and env variables
win32.bat WIN32 bat file to set path and env variables
win32-debug.bat WIN32 debug bat file to set debug path and env variables
</PRE>
<H4>base/configure directory - contains build definitions and rules</H4>

View File

@@ -3,134 +3,16 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>EPICS Base R3.14.12.8 Release Notes</title>
<title>EPICS Base R3.14.12.7 Release Notes</title>
</head>
<body lang="en">
<h1 align="center">EPICS Base Release 3.14.12.8</h1>
<p>This is the final release in the Base-3.14 series, please upgrade to the
Base-3.15 series or to EPICS 7.</p>
<h2 align="center">Changes between 3.14.12.7 and 3.14.12.8</h2>
<!-- Insert new items immediately below here ... -->
<h3>Fix broken <tt>EPICS_IOC_LOG_FILE_LIMIT=0</tt> setting</h3>
<p>The Application Developers' Guide says this is allowed and disables the
limit on the log-file, but it hasn't actually worked for some time (if ever).
Note that the iocLogServer will be removed from newer Base release sometime
soon as its functionality can be implemented by other dedicated log servers
such as logstash or syslog-ng.</p>
<p>Fixes <a href="https://bugs.launchpad.net/bugs/1786858">lp:1786858</a>
and part of <a href="https://bugs.launchpad.net/bugs/1786966">lp:1786966</a>.
</p>
<h3>Cleanup of startup directory</h3>
<p>The files in the startup directory have not been maintained in recent years
and have grown crufty (technical term). This release includes the following
updates to these files:</p>
<ul>
<li>The Perl <tt>EpicsHostArch.pl</tt> script has been rewritten, and support
for a few previously missing host architectures has been added to it.</li>
<li>The <tt>EpicsHostArch.pl</tt> script has also been moved into the standard
<tt>src/tools</tt> directory, from where it will be installed into
<tt>lib/perl</tt>. In this new location it is no longer executable, so it must
be run by the <tt>perl</tt> executable.</li>
<li>The build system has been adjusted to look for <tt>EpicsHostArch.pl</tt> in
both places if the <tt>EPICS_HOST_ARCH</tt> environment variable has not been
set at build-time.</li>
<li>Sites that used the original Perl script to set <tt>EPICS_HOST_ARCH</tt> as
part of their standard environment will need to adjust their scripts when they
upgrade to this release.</li>
<li>The <tt>EpicsHostArch</tt> shell script has been replaced with a wrapper
routine that calls the Perl <tt>EpicsHostArch.pl</tt> script. Sites that rely on
this script to set <tt>EPICS_HOST_ARCH</tt> should consider switching to the
Perl script instead.</li>
<li>The <tt>Site.cshrc</tt> and <tt>Site.profile</tt> files have been renamed to
<tt>unix.csh</tt> and <tt>unix.sh</tt>, respectively.</li>
<li>The existing <tt>win32.bat</tt> file has been cleaned up and a new
<tt>windows.bat</tt> file added for 64-bit targets. The contents of these files
should be seen as examples, don't uncomment or install parts for software that
you don't explicitly know that you need.</li>
</ul>
<h3>Recent Apple XCode Build Issues</h3>
<p>The latest version of XCode will not compile calls to <tt>system()</tt> or
<tt>clock_settime()</tt> for iOS targets. There were several places in Base
where these were being compiled, although there were probably never called. The
code has now been modified to permit iOS builds to complete again.</p>
<h3>Prevent illegal alarm severities</h3>
<p>A check has been added to <tt>recGblResetAlarms()</tt> that prevents records
from getting an alarm severity higher than INVALID_ALARM. It is still possible
for a field like HSV to get set to a value that is not a legal alarm severity,
but the core IOC code should never copy such a value into a record's SEVR or
ACKS fields. With this fix the record's alarm severity will be limited to
INVALID_ALARM.</p>
<h3>Fixes for Launchpad bugs</h3>
<p>The following launchpad bugs have fixes included:</p>
<ul>
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1786320">
lp: #1786320</a>, dbCa subscribes twice to ENUM</li>
<li><a href="https://bugs.launchpad.net/epics-base/+bug/541221">
lp: #541221</a>, 'assert (pca->pgetNative)' failed in ../dbCa.c</li>
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1747091">
lp: #1747091</a>, epicsTimeGetEvent() / generalTime bug</li>
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1743076">
lp: #1743076</a>, Segfault in ca_attach_context() during exits</li>
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1751380">
lp: #1751380</a>, Deadlock in ca_clear_subscription()</li>
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1597809">
lp: #1597809</a>, Setting NAME field in DB file may break IOC</li>
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1770292">
lp: #1770292</a>, get_alarm_double() inconsistent across record types</li>
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1771298">
lp: #1771298</a>, Conversion of NaN to integer relies on undefined
behavior</li>
</ul>
<h3>Updated VxWorks Timezone settings</h3>
<p>Removed the settings for 2017; fixed the hour of the change for MET.</p>
<h3>Back-port podToHtml.pl and Rules from Base-3.15</h3>
<p>This script permits Base to be built with Perl installations that do not
provide the podchecker and pod2html scripts (e.g. Fedora 27).</p>
<h3>Fixed camonitor server side relative timestamps bug</h3>
<p>Initialize the first time-stamp from the first monitor, not the client-side
current time in this configuration.</p>
<h3>Build changes for MSVC</h3>
<p>Windows builds using Visual Studio 2015 and later now use the <tt>-FS</tt>
compiler option to allow parallel builds to work properly.</p>
<p>We now give the <tt>-FC</tt> option to tell the compiler to print absolute
paths for source files in diagnostic messages.</p>
<h1 align="center">EPICS Base Release 3.14.12.7</h1>
<h2 align="center">Changes between 3.14.12.6 and 3.14.12.7</h2>
<!-- Insert new items immediately below here ... -->
<h3>Extend maximum Posix epicsEventWaitWithTimeout() delay</h3>
<p>The Posix implementation of epicsEventWaitWithTimeout() was limiting the
@@ -1533,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

View File

@@ -1009,7 +1009,7 @@ d:/user/R3.14.clean/epics/base/lib/WIN32-x86/</code></p>
<h2><a name="CommandUtils">Command Line Utilities</a></h2>
<h3><a name="acctst">acctst</a></h3>
<pre>acctst &lt;PV name&gt; [progress logging level] [channel duplication count]
<pre>acctst &lt;PV name&gt; [progress logging level] [channel duplication count]
[test repetition count] [enable preemptive callback]</pre>
<h4>Description</h4>
@@ -2079,7 +2079,7 @@ example, be beneficial when tuning an archiver installation.</p>
<p>Significant performance gains can be realized when the CA client library
doesn't wait for a response to return from the server after each request. All
requests which require interaction with a CA server are accumulated (buffered)
and not forwarded to the IOC until one of <code>ca_flush_io()</code>,
and not forwarded to the IOC until one of <code>ca_flush_io()</code>,
<code>ca_pend_io()</code>, <code>ca_pend_event()</code>, or
<code>ca_sg_block()</code> are called allowing several operations to be
efficiently sent over the network together. Any process variable values written
@@ -2103,16 +2103,16 @@ shouldn't test the success of a CA function call by checking to see if the
returned value is zero as is the UNIX convention. Below are several methods to
test CA function returns. See <a href="#ca_signal"><code>ca_signal()</code> and
<code>SEVCHK()</code></a> for more information on this topic.</p>
<pre>status = ca_XXXX();
SEVCHK( status, "ca_XXXX() returned failure status");
<pre>status = ca_XXXX();
SEVCHK( status, "ca_XXXX() returned failure status");
if ( status &amp; CA_M_SUCCESS ) {
printf ( "The requested ca_XXXX() operation didn't complete successfully");
}
if ( status &amp; CA_M_SUCCESS ) {
printf ( "The requested ca_XXXX() operation didn't complete successfully");
}
if ( status != ECA_NORMAL ) {
if ( status != ECA_NORMAL ) {
printf("The requested ca_XXXX() operation didn't complete successfully because \"%s\"\n",
ca_message ( status ) );
ca_message ( status ) );
}</pre>
<h3><a name="Channel">Channel Access Data Types</a></h3>
@@ -2285,7 +2285,7 @@ int main ( int argc, char ** argv )
unsigned nBytes;
unsigned elementCount;
char timeString[32];
unsigned i;
unsigned i;
chid chan;
double sum;
int status;
@@ -2328,7 +2328,7 @@ int main ( int argc, char ** argv )
epicsTimeToStrftime ( timeString, sizeof ( timeString ),
"%a %b %d %Y %H:%M:%S.%f", &amp; pTD-&gt;stamp );
printf ( "The sum of elements in %s at %s was %f\n",
printf ( "The sum of elements in %s at %s was %f\n",
argv[1], timeString, sum );
ca_clear_channel ( chan );
@@ -2359,7 +2359,7 @@ executing within the user's callback function.</p>
<pre>typedef struct event_handler_args {
void *usr; /* user argument supplied with request */
chanId chid; /* channel id */
long type; /* the type of the item returned */
long type; /* the type of the item returned */
long count; /* the element count of the item returned */
const void *dbr; /* a pointer to the item returned */
int status; /* ECA_XXX status of the requested op from the server */
@@ -2382,7 +2382,7 @@ attached to the request, an exception handler is executed in the client. The
default exception handler prints a message on the console and exits if the
exception condition is severe. Certain internal exceptions within the CA client
library, and failures detected by the SEVCHK macro may also cause the exception
handler to be invoked. To modify this behavior see
handler to be invoked. To modify this behavior see
<code><a href="#ca_add_exception_event">ca_add_exception_event</a>()</code>.</p>
<h3><a name="Server">Server and Client Share the Same Address Space on The Same
@@ -2674,14 +2674,6 @@ automatically released by the system when the process exits and
vxWorks or RTEMS no cleanup occurs unless the application calls
<code>ca_context_destroy()</code>.</p>
<p>Note: This operation blocks until any user callbacks for any channel
created in the current context have run to completion. If callbacks take a
lock (mutex) then it is the user's responsibility to ensure that this lock
is not held when <code>ca_clear_context()</code> is called, otherwise a
deadlock may ensue. (See also
<code><a href="#ca_clear_channel">ca_clear_channel</a>()</code> and
<code><a href="#ca_clear_event">ca_clear_subscription</a>()</code>.)</p>
<h4>Returns</h4>
<p>ECA_NORMAL - Normal successful completion</p>
@@ -2827,12 +2819,6 @@ efficiently sent over the network in one message.</p>
clearing a channel does shutdown and reclaim any channel state change event
subscriptions (monitors) registered with the channel.</p>
<p>Note: This operation blocks until any user callbacks for this channel
have run to completion. If callbacks take a lock (mutex) then it is the
user's responsibility to ensure that this lock is not held when
<code>ca_clear_channel()</code> is called, otherwise a deadlock may ensue.
(See also <code><a href="#ca_clear_event">ca_clear_subscription</a>()</code>.)</p>
<h4>Arguments</h4>
<dl>
<dt><code>CHID</code></dt>
@@ -2847,16 +2833,16 @@ user's responsibility to ensure that this lock is not held when
<h3><code><a name="ca_put">ca_put()</a></code></h3>
<pre>#include &lt;cadef.h&gt;
int ca_put ( chtype TYPE,
chid CHID, void *PVALUE );
int ca_array_put ( chtype TYPE, unsigned long COUNT,
int ca_put ( chtype TYPE,
chid CHID, void *PVALUE );
int ca_array_put ( chtype TYPE, unsigned long COUNT,
chid CHID, const void *PVALUE);
typedef void ( caEventCallBackFunc ) (struct event_handler_args);
int ca_put_callback ( chtype TYPE,
chid CHID, const void *PVALUE,
caEventCallBackFunc PFUNC, void *USERARG );
int ca_array_put_callback ( chtype TYPE, unsigned long COUNT,
chid CHID, const void *PVALUE,
int ca_put_callback ( chtype TYPE,
chid CHID, const void *PVALUE,
caEventCallBackFunc PFUNC, void *USERARG );
int ca_array_put_callback ( chtype TYPE, unsigned long COUNT,
chid CHID, const void *PVALUE,
caEventCallBackFunc PFUNC, void *USERARG );</pre>
<h4>Description</h4>
@@ -3083,7 +3069,7 @@ when a CA get request is initiated.</p>
typedef void ( caEventCallBackFunc ) (struct event_handler_args);
int ca_create_subscription ( chtype TYPE, unsigned long COUNT,
chid CHID, unsigned long MASK,
caEventCallBackFunc USERFUNC, void *USERARG,
caEventCallBackFunc USERFUNC, void *USERARG,
evid *PEVID );</pre>
<h4>Description</h4>
@@ -3167,7 +3153,7 @@ indicating the current state of the channel.</p>
<dt><code>MASK</code></dt>
<dd>A mask with bits set for each of the event trigger types requested. The
event trigger mask must be a <em>bitwise or</em> of one or more of the
following constants.
following constants.
<ul>
<li>DBE_VALUE - Trigger events when the channel value exceeds the
monitor dead band</li>
@@ -3214,13 +3200,6 @@ and not forwarded to the server until one of <code>ca_flush_io()</code>, <code>c
<code>ca_pend_event()</code>, or <code>ca_sg_block()</code> are called. This allows several requests to be
efficiently sent together in one message.</p>
<p>Note: This operation blocks until any user callbacks for this channel
have run to completion. If callbacks take a lock (mutex) then it is the
user's responsibility to ensure that this lock is not held when
<code>ca_clear_subscription()</code> is called, otherwise a deadlock may
ensue. (See also <code><a
href="#ca_clear_channel">ca_clear_channel</a>()</code>.)</p>
<h4>Arguments</h4>
<dl>
<dt>EVID</dt>
@@ -3385,7 +3364,7 @@ becomes full.</p>
<h3><code><a name="ca_signal">ca_signal()</a></code></h3>
<pre>#include &lt;cadef.h&gt;
int ca_signal ( long CA_STATUS, const char * CONTEXT_STRING );
int ca_signal ( long CA_STATUS, const char * CONTEXT_STRING );
void SEVCHK( CA_STATUS, CONTEXT_STRING );</pre>
<h4>Description</h4>
@@ -3402,7 +3381,7 @@ recommended error handler for simple applications which do not wish to write
code testing the status returned from each channel access call.</p>
<h4>Examples</h4>
<pre>status = ca_context_create (...);
<pre>status = ca_context_create (...);
SEVCHK ( status, "Unable to create a CA client context" );</pre>
<p>If the application only wishes to print the message associated with an error
@@ -3426,7 +3405,7 @@ this purpose.</p>
<h3><code><a
name="ca_add_exception_event">ca_add_exception_event()</a></code></h3>
<pre>#include &lt;cadef.h&gt;
<pre>#include &lt;cadef.h&gt;
typedef void (*pCallback) ( struct exception_handler_args HANDLERARGS );
int ca_add_exception_event ( pCallback USERFUNC, void *USERARG );</pre>
@@ -3635,7 +3614,7 @@ specified channel.</p>
<dt><code>PFUNC</code></dt>
<dd>Pointer to a user supplied callback function. A null pointer uninstalls
the current handler. The following arguments are passed <em>by value</em>
to the supplied callback handler.
to the supplied callback handler.
<pre>typedef struct ca_access_rights {
unsigned read_access:1;
unsigned write_access:1;
@@ -3975,8 +3954,8 @@ type.</p>
prints diagnostics to standard out.</p>
<h4>Examples</h4>
<pre>void ca_test_event ();
status = ca_create_subscription ( type, chid, ca_test_event, NULL, NULL );
<pre>void ca_test_event ();
status = ca_create_subscription ( type, chid, ca_test_event, NULL, NULL );
SEVCHK ( status, .... );</pre>
<h4>See Also</h4>
@@ -4010,8 +3989,8 @@ outstanding within them at any given time.</p>
</dl>
<h4>Examples</h4>
<pre>CA_SYNC_GID gid;
status = ca_sg_create ( &amp;gid );
<pre>CA_SYNC_GID gid;
status = ca_sg_create ( &amp;gid );
SEVCHK ( status, Sync group create failed );</pre>
<h4>Returns</h4>
@@ -4049,8 +4028,8 @@ int ca_sg_delete ( CA_SYNC_GID GID );</pre>
</dl>
<h4>Examples</h4>
<pre>CA_SYNC_GID gid;
status = ca_sg_delete ( gid );
<pre>CA_SYNC_GID gid;
status = ca_sg_delete ( gid );
SEVCHK ( status, Sync group delete failed );</pre>
<h4>Returns</h4>
@@ -4161,7 +4140,7 @@ will not block unless additional subsequent requests are made.</p>
</dl>
<h4>Examples</h4>
<pre>CA_SYNC_GID gid;
<pre>CA_SYNC_GID gid;
status = ca_sg_reset(gid);</pre>
<h4>Returns</h4>
@@ -4174,7 +4153,7 @@ status = ca_sg_reset(gid);</pre>
<pre>#include &lt;cadef.h&gt;
int ca_sg_put ( CA_SYNC_GID GID, chtype TYPE,
chid CHID, void *PVALUE );
int ca_sg_array_put ( CA_SYNC_GID GID, chtype TYPE,
int ca_sg_array_put ( CA_SYNC_GID GID, chtype TYPE,
unsigned long COUNT, chid CHID, void *PVALUE );</pre>
<p>Write a value, or array of values, to a channel and increment the outstanding
@@ -4315,7 +4294,7 @@ reissued.</p>
<h3><code><a name="ca_client_status">ca_client_status()</a></code></h3>
<pre>int ca_client_status ( unsigned level );
int ca_context_status ( struct ca_client_context *CONTEXT,
int ca_context_status ( struct ca_client_context *CONTEXT,
unsigned LEVEL );</pre>
<h4>Description</h4>

View File

@@ -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 );

View File

@@ -140,10 +140,6 @@ sub display {
printf " Lo ctrl limit: %g\n", $data->{lower_ctrl_limit};
printf " Hi ctrl limit: %g\n", $data->{upper_ctrl_limit};
}
if (exists $data->{ackt}) {
printf " Ack transients: %s\n", $data->{ackt} ? 'YES' : 'NO';
printf " Ack severity: %s\n", $data->{acks};
}
} else {
my $value = format_number($data, $type);
if ($opt_t) {

View File

@@ -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

View File

@@ -646,11 +646,6 @@ caStatus casDGClient::processDG ()
if ( status != S_cas_success ) {
break;
}
if ( this->in.bytesPresent () > 0 && dgInBytesConsumed == 0 && status == S_cas_success ) {
this->in.removeMsg ( this->in.bytesPresent() );
}
}
return status;
}

View File

@@ -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;

View File

@@ -78,6 +78,7 @@ typedef struct
epicsTimeStamp tsPreviousS;
char firstStampPrinted;
char onceConnected;
evid evid;
} pv;

View File

@@ -297,10 +297,10 @@ static void get_alarm(DBADDR *paddr, char **ppbuffer,
if (*options & DBR_AL_LONG) {
struct dbr_alLong *pal = (struct dbr_alLong*) pbuffer;
pal->upper_alarm_limit = finite(ald.upper_alarm_limit) ? (epicsInt32) ald.upper_alarm_limit : 0;
pal->upper_warning_limit = finite(ald.upper_warning_limit) ? (epicsInt32) ald.upper_warning_limit : 0;
pal->lower_warning_limit = finite(ald.lower_warning_limit) ? (epicsInt32) ald.lower_warning_limit : 0;
pal->lower_alarm_limit = finite(ald.lower_alarm_limit) ? (epicsInt32) ald.lower_alarm_limit : 0;
pal->upper_alarm_limit = (epicsInt32) ald.upper_alarm_limit;
pal->upper_warning_limit = (epicsInt32) ald.upper_warning_limit;
pal->lower_warning_limit = (epicsInt32) ald.lower_warning_limit;
pal->lower_alarm_limit = (epicsInt32) ald.lower_alarm_limit;
if (no_data)
*options ^= DBR_AL_LONG; /*Turn off option*/
@@ -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;

View File

@@ -591,16 +591,11 @@ static void connectionCallback(struct connection_handler_args arg)
if (pca->gotFirstConnection) {
if (pca->nelements != ca_element_count(arg.chid) ||
pca->dbrType != ca_field_type(arg.chid)) {
/* Size or type changed, clear everything and let the next call
to dbCaGetLink() and/or dbCaPutLink() reset everything */
if (pca->evidNative) {
ca_clear_event(pca->evidNative);
pca->evidNative = 0;
}
if (pca->evidString) {
ca_clear_event(pca->evidString);
pca->evidString = 0;
}
/* BUG: We have no way to clear any old subscription with the
* originally chosen data type/size. That will continue
* to send us data and will result in an assert() fail.
*/
/* Let next dbCaGetLink and/or dbCaPutLink determine options */
plink->value.pv_link.pvlMask &=
~(pvlOptInpNative | pvlOptInpString |
pvlOptOutNative | pvlOptOutString);
@@ -648,7 +643,6 @@ static void eventCallback(struct event_handler_args arg)
struct dbr_time_double *pdbr_time_double;
dbCaCallback monitor = 0;
void *userPvt = 0;
int doScan = 1;
assert(pca);
epicsMutexMustLock(pca->lock);
@@ -677,13 +671,10 @@ static void eventCallback(struct event_handler_args arg)
memcpy(pca->pgetString, dbr_value_ptr(arg.dbr, arg.type), size);
pca->gotInString = TRUE;
} else switch (arg.type){
case DBR_TIME_ENUM:
/* Disable the record scan if we also have a string monitor */
doScan = !(plink->value.pv_link.pvlMask & pvlOptInpString);
/* fall through */
case DBR_TIME_STRING:
case DBR_TIME_SHORT:
case DBR_TIME_FLOAT:
case DBR_TIME_ENUM:
case DBR_TIME_CHAR:
case DBR_TIME_LONG:
case DBR_TIME_DOUBLE:
@@ -699,7 +690,7 @@ static void eventCallback(struct event_handler_args arg)
pca->sevr = pdbr_time_double->severity;
pca->stat = pdbr_time_double->status;
memcpy(&pca->timeStamp, &pdbr_time_double->stamp, sizeof(epicsTimeStamp));
if (doScan && precord) {
if (precord) {
struct pv_link *ppv_link = &plink->value.pv_link;
if ((ppv_link->pvlMask & pvlOptCP) ||
@@ -978,8 +969,7 @@ static void dbCaTask(void *arg)
status = ca_add_array_event(
ca_field_type(pca->chid)+DBR_TIME_STRING,
ca_element_count(pca->chid),
pca->chid, eventCallback, pca, 0.0, 0.0, 0.0,
&pca->evidNative);
pca->chid, eventCallback, pca, 0.0, 0.0, 0.0, 0);
if (status != ECA_NORMAL) {
errlogPrintf("dbCaTask ca_add_array_event %s\n",
ca_message(status));
@@ -991,8 +981,7 @@ static void dbCaTask(void *arg)
pca->pgetString = dbCalloc(1, MAX_STRING_SIZE);
epicsMutexUnlock(pca->lock);
status = ca_add_array_event(DBR_TIME_STRING, 1,
pca->chid, eventCallback, pca, 0.0, 0.0, 0.0,
&pca->evidString);
pca->chid, eventCallback, pca, 0.0, 0.0, 0.0, 0);
if (status != ECA_NORMAL) {
errlogPrintf("dbCaTask ca_add_array_event %s\n",
ca_message(status));

View File

@@ -73,8 +73,6 @@ typedef struct caLink
char *pgetString;
void *pputNative;
char *pputString;
evid evidNative;
evid evidString;
char gotInNative;
char gotInString;
char gotOutNative;

View File

@@ -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) {

View File

@@ -90,8 +90,7 @@ struct event_user {
epicsMutexId lock;
epicsEventId ppendsem; /* Wait while empty */
epicsEventId pflush_sem; /* wait for flush */
epicsEventId pexitsem; /* wait for event task to join */
EXTRALABORFUNC *extralabor_sub;/* off load to event task */
void *extralabor_arg;/* parameter to above */
@@ -135,9 +134,7 @@ static char *EVENT_PEND_NAME = "eventTask";
static struct evSubscrip canceledEvent;
static epicsMutexId stopSync;
static unsigned short ringSpace ( const struct event_que *pevq )
static unsigned short ringSpace ( const struct event_que *pevq )
{
if ( pevq->evque[pevq->putix] == EVENTQEMPTY ) {
if ( pevq->getix > pevq->putix ) {
@@ -277,11 +274,7 @@ int epicsShareAPI dbel ( const char *pname, unsigned level )
dbEventCtx epicsShareAPI db_init_events (void)
{
struct event_user * evUser;
if (!stopSync) {
stopSync = epicsMutexMustCreate();
}
if (!dbevEventUserFreeList) {
freeListInitPvt(&dbevEventUserFreeList,
sizeof(struct event_user),8);
@@ -300,49 +293,38 @@ dbEventCtx epicsShareAPI db_init_events (void)
if (!evUser) {
return NULL;
}
/* Flag will be cleared when event task starts */
evUser->pendexit = TRUE;
evUser->firstque.evUser = evUser;
evUser->firstque.writelock = epicsMutexCreate();
if (!evUser->firstque.writelock)
goto fail;
if (!evUser->firstque.writelock) {
return NULL;
}
evUser->ppendsem = epicsEventCreate(epicsEventEmpty);
if (!evUser->ppendsem)
goto fail;
if (!evUser->ppendsem) {
epicsMutexDestroy (evUser->firstque.writelock);
return NULL;
}
evUser->pflush_sem = epicsEventCreate(epicsEventEmpty);
if (!evUser->pflush_sem)
goto fail;
if (!evUser->pflush_sem) {
epicsMutexDestroy (evUser->firstque.writelock);
epicsEventDestroy (evUser->ppendsem);
return NULL;
}
evUser->lock = epicsMutexCreate();
if (!evUser->lock)
goto fail;
evUser->pexitsem = epicsEventCreate(epicsEventEmpty);
if (!evUser->pexitsem)
goto fail;
if (!evUser->lock) {
epicsMutexDestroy (evUser->firstque.writelock);
epicsEventDestroy (evUser->pflush_sem);
epicsEventDestroy (evUser->ppendsem);
return NULL;
}
evUser->flowCtrlMode = FALSE;
evUser->extraLaborBusy = FALSE;
evUser->pSuicideEvent = NULL;
return (dbEventCtx) evUser;
fail:
if(evUser->lock)
epicsMutexDestroy (evUser->lock);
if(evUser->firstque.writelock)
epicsMutexDestroy (evUser->firstque.writelock);
if(evUser->ppendsem)
epicsEventDestroy (evUser->ppendsem);
if(evUser->pflush_sem)
epicsEventDestroy (evUser->pflush_sem);
if(evUser->pexitsem)
epicsEventDestroy (evUser->pexitsem);
freeListFree(dbevEventUserFreeList,evUser);
return NULL;
}
/* intentionally leak stopSync to avoid possible shutdown races */
/*
* DB_CLOSE_EVENTS()
*
@@ -364,30 +346,10 @@ void epicsShareAPI db_close_events (dbEventCtx ctx)
* hazardous to the system's health.
*/
epicsMutexMustLock ( evUser->lock );
if(!evUser->pendexit) { /* event task running */
evUser->pendexit = TRUE;
epicsMutexUnlock ( evUser->lock );
/* notify the waiting task */
epicsEventSignal(evUser->ppendsem);
/* wait for task to exit */
epicsEventMustWait(evUser->pexitsem);
epicsMutexMustLock ( evUser->lock );
}
evUser->pendexit = TRUE;
epicsMutexUnlock ( evUser->lock );
epicsMutexMustLock (stopSync);
epicsEventDestroy(evUser->pexitsem);
epicsEventDestroy(evUser->ppendsem);
epicsEventDestroy(evUser->pflush_sem);
epicsMutexDestroy(evUser->lock);
epicsMutexUnlock (stopSync);
freeListFree(dbevEventUserFreeList, evUser);
/* notify the waiting task */
epicsEventSignal(evUser->ppendsem);
}
/*
@@ -1015,17 +977,14 @@ static void event_task (void *pParm)
}
}
epicsEventDestroy(evUser->ppendsem);
epicsEventDestroy(evUser->pflush_sem);
epicsMutexDestroy(evUser->lock);
freeListFree(dbevEventUserFreeList, evUser);
taskwdRemove(epicsThreadGetIdSelf());
/* use stopSync to ensure pexitsem is not destroy'd
* until epicsEventSignal() has returned.
*/
epicsMutexMustLock (stopSync);
epicsEventSignal(evUser->pexitsem);
epicsMutexUnlock(stopSync);
return;
}
@@ -1049,6 +1008,7 @@ int epicsShareAPI db_start_events (
return DB_EVENT_OK;
}
evUser->pendexit = FALSE;
evUser->init_func = init_func;
evUser->init_func_arg = init_func_arg;
if (!taskname) {
@@ -1062,7 +1022,6 @@ int epicsShareAPI db_start_events (
epicsMutexUnlock ( evUser->lock );
return DB_EVENT_ERROR;
}
evUser->pendexit = FALSE;
epicsMutexUnlock ( evUser->lock );
return DB_EVENT_OK;
}

View File

@@ -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);

View File

@@ -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)

View File

@@ -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);

View File

@@ -19,7 +19,6 @@
#include <limits.h>
#include "dbDefs.h"
#include "alarm.h"
#include "epicsMath.h"
#include "epicsTime.h"
#include "epicsPrint.h"
@@ -223,9 +222,6 @@ unsigned short epicsShareAPI recGblResetAlarms(void *precord)
epicsEnum16 val_mask = 0;
epicsEnum16 stat_mask = 0;
if (new_sevr > INVALID_ALARM)
new_sevr = INVALID_ALARM;
pdbc->stat = new_stat;
pdbc->sevr = new_sevr;
pdbc->nsta = 0;

View File

@@ -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 */

View File

@@ -960,29 +960,23 @@ static void dbRecordHead(char *recordType, char *name, int visible)
static void dbRecordField(char *name,char *value)
{
DBENTRY *pdbentry;
tempListNode *ptempListNode;
long status;
DBENTRY *pdbentry;
tempListNode *ptempListNode;
long status;
if (duplicate) return;
if(duplicate) return;
ptempListNode = (tempListNode *)ellFirst(&tempList);
pdbentry = ptempListNode->item;
status = dbFindField(pdbentry,name);
if (status) {
epicsPrintf("Record \"%s\" does not have a field \"%s\"\n",
dbGetRecordName(pdbentry), name);
yyerror(NULL);
return;
}
if (pdbentry->indfield == 0) {
epicsPrintf("Can't set \"NAME\" field of record \"%s\"\n",
dbGetRecordName(pdbentry));
yyerror(NULL);
return;
if(status) {
epicsPrintf("Record \"%s\" does not have a field \"%s\"\n",
dbGetRecordName(pdbentry), name);
yyerror(NULL);
return;
}
dbTranslateEscape(value, value); /* yuck: in-place, but safe */
status = dbPutString(pdbentry,value);
if (status) {
if(status) {
epicsPrintf("Can't set \"%s.%s\" to \"%s\"\n",
dbGetRecordName(pdbentry), name, value);
yyerror(NULL);
@@ -992,33 +986,33 @@ static void dbRecordField(char *name,char *value)
static void dbRecordInfo(char *name, char *value)
{
DBENTRY *pdbentry;
tempListNode *ptempListNode;
long status;
DBENTRY *pdbentry;
tempListNode *ptempListNode;
long status;
if (duplicate) return;
if(duplicate) return;
ptempListNode = (tempListNode *)ellFirst(&tempList);
pdbentry = ptempListNode->item;
status = dbPutInfo(pdbentry,name,value);
if (status) {
epicsPrintf("Can't set \"%s\" info \"%s\" to \"%s\"\n",
if(status) {
epicsPrintf("Can't set \"%s\" info \"%s\" to \"%s\"\n",
dbGetRecordName(pdbentry), name, value);
yyerror(NULL);
return;
yyerror(NULL);
return;
}
}
static void dbRecordAlias(char *name)
{
DBENTRY *pdbentry;
tempListNode *ptempListNode;
long status;
DBENTRY *pdbentry;
tempListNode *ptempListNode;
long status;
if (duplicate) return;
if(duplicate) return;
ptempListNode = (tempListNode *)ellFirst(&tempList);
pdbentry = ptempListNode->item;
status = dbCreateAlias(pdbentry, name);
if (status) {
if(status) {
epicsPrintf("Can't create alias \"%s\" for \"%s\"\n",
name, dbGetRecordName(pdbentry));
yyerror(NULL);
@@ -1028,16 +1022,15 @@ static void dbRecordAlias(char *name)
static void dbAlias(char *name, char *alias)
{
DBENTRY dbEntry;
DBENTRY *pdbEntry = &dbEntry;
DBENTRY dbEntry;
DBENTRY *pdbEntry = &dbEntry;
dbInitEntry(pdbbase, pdbEntry);
if (dbFindRecord(pdbEntry, name)) {
epicsPrintf("Alias \"%s\" refers to unknown record \"%s\"\n",
alias, name);
yyerror(NULL);
}
else if (dbCreateAlias(pdbEntry, alias)) {
} else if (dbCreateAlias(pdbEntry, alias)) {
epicsPrintf("Can't create alias \"%s\" referring to \"%s\"\n",
alias, name);
yyerror(NULL);
@@ -1047,14 +1040,14 @@ static void dbAlias(char *name, char *alias)
static void dbRecordBody(void)
{
DBENTRY *pdbentry;
DBENTRY *pdbentry;
if (duplicate) {
duplicate = FALSE;
return;
if(duplicate) {
duplicate = FALSE;
return;
}
pdbentry = (DBENTRY *)popFirstTemp();
if (ellCount(&tempList))
yyerrorAbort("dbRecordBody: tempList not empty");
if(ellCount(&tempList))
yyerrorAbort("dbRecordBody: tempList not empty");
dbFreeEntry(pdbentry);
}

View File

@@ -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);

View File

@@ -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,

View File

@@ -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;
}

View File

@@ -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:

View File

@@ -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;

View File

@@ -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.

View File

@@ -48,10 +48,8 @@ static epicsThreadOnceId onceId = EPICS_THREAD_ONCE_INIT;
/* Forward references */
static int ClockTimeGetCurrent(epicsTimeStamp *pDest);
#if defined(vxWorks) || defined(__rtems__)
static void ClockTimeSync(void *dummy);
#endif
/* ClockTime_Report iocsh command */
static const iocshArg ReportArg0 = { "interest_level", iocshArgArgv};
@@ -79,14 +77,12 @@ static void ClockTime_InitOnce(void *psync)
ClockTimePvt.lock = epicsMutexCreate();
ClockTimePvt.ClockTimeSyncInterval = 1.0; /* First sync */
#if defined(vxWorks) || defined(__rtems__)
if (ClockTimePvt.synchronize) {
/* Start the sync thread */
epicsThreadCreate("ClockTimeSync", epicsThreadPriorityHigh,
epicsThreadGetStackSize(epicsThreadStackSmall),
ClockTimeSync, NULL);
}
#endif
epicsAtExit(ClockTime_Shutdown, NULL);
@@ -117,7 +113,6 @@ void ClockTime_Shutdown(void *dummy)
/* Synchronization thread */
#if defined(vxWorks) || defined(__rtems__)
static void ClockTimeSync(void *dummy)
{
taskwdInsert(0, NULL, NULL);
@@ -153,7 +148,6 @@ static void ClockTimeSync(void *dummy)
ClockTimePvt.synchronized = 0;
taskwdRemove(0);
}
#endif
/* Time Provider Routine */
@@ -165,7 +159,6 @@ static int ClockTimeGetCurrent(epicsTimeStamp *pDest)
/* If a Hi-Res clock is available and works, use it */
#ifdef CLOCK_REALTIME_HR
clock_gettime(CLOCK_REALTIME_HR, &clockNow) &&
/* Note: Uses the lo-res clock below if the above call fails */
#endif
clock_gettime(CLOCK_REALTIME, &clockNow);
@@ -173,15 +166,9 @@ static int ClockTimeGetCurrent(epicsTimeStamp *pDest)
clockNow.tv_sec < POSIX_TIME_AT_EPICS_EPOCH) {
clockNow.tv_sec = POSIX_TIME_AT_EPICS_EPOCH + 86400;
clockNow.tv_nsec = 0;
#if defined(vxWorks) || defined(__rtems__)
clock_settime(CLOCK_REALTIME, &clockNow);
errlogPrintf("WARNING: OS Clock time was read before being set.\n"
"Using 1990-01-02 00:00:00.000000 UTC\n");
#else
errlogPrintf("WARNING: OS Clock pre-dates the EPICS epoch!\n"
"Using 1990-01-02 00:00:00.000000 UTC\n");
#endif
}
epicsTimeFromTimespec(pDest, &clockNow);

View File

@@ -198,8 +198,8 @@ static long get_alarm_double(DBADDR *paddr,struct dbr_alDouble *pad)
static void checkAlarms(xxxRecord *prec)
{
double val, hyst, lalm;
float hihi, high, low, lolo;
double val;
float hyst, lalm, hihi, high, low, lolo;
unsigned short hhsv, llsv, hsv, lsv;
if(prec->udf == TRUE ){

View File

@@ -26,7 +26,6 @@ LIB_SRCS += miscIocRegister.c
LIB_SRCS += dlload.c
LIB_SRCS += iocshRegisterCommon.c
miscIocRegister_CFLAGS_iOS = -DSYSTEM_UNAVAILABLE
LIBRARY_IOC = miscIoc

View File

@@ -66,12 +66,10 @@ void epicsShareAPI miscIocRegister(void)
/* system -- escape to system command interpreter.
*
* Disabled by default for security reasons, not available on all OSs.
* To enable this command, add
* Disabled by default, for security reasons. To enable this command, add
* registrar(iocshSystemCommand)
* to an application dbd file, or include system.dbd
* to an application dbd file.
*/
#ifndef SYSTEM_UNAVAILABLE
static const iocshArg systemArg0 = { "command string",iocshArgString};
static const iocshArg * const systemArgs[] = {&systemArg0};
static const iocshFuncDef systemFuncDef = {"system",1,systemArgs};
@@ -79,15 +77,12 @@ static void systemCallFunc(const iocshArgBuf *args)
{
system(args[0].sval);
}
#endif
static void iocshSystemCommand(void)
{
#ifndef SYSTEM_UNAVAILABLE
if (system(NULL))
iocshRegister(&systemFuncDef, systemCallFunc);
else
#endif
errlogPrintf ("Can't register 'system' command -- no command interpreter available.\n");
}
epicsExportRegistrar(iocshSystemCommand);

View File

@@ -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;

View File

@@ -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")

View File

@@ -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 {

View File

@@ -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")

View File

@@ -21,7 +21,6 @@
#include "dbDefs.h"
#include "epicsPrint.h"
#include "epicsMath.h"
#include "alarm.h"
#include "dbAccess.h"
#include "dbEvent.h"
@@ -202,10 +201,10 @@ static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
longinRecord *prec=(longinRecord *)paddr->precord;
if(paddr->pfield==(void *)&prec->val){
pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
pad->upper_warning_limit = prec->hsv ? prec->high : epicsNAN;
pad->lower_warning_limit = prec->lsv ? prec->low : epicsNAN;
pad->lower_alarm_limit = prec->llsv ? prec->lolo : epicsNAN;
pad->upper_alarm_limit = prec->hihi;
pad->upper_warning_limit = prec->high;
pad->lower_warning_limit = prec->low;
pad->lower_alarm_limit = prec->lolo;
} else recGblGetAlarmDouble(paddr,pad);
return(0);
}

View File

@@ -19,7 +19,6 @@
#include "dbDefs.h"
#include "epicsPrint.h"
#include "epicsMath.h"
#include "alarm.h"
#include "dbAccess.h"
#include "dbEvent.h"
@@ -243,10 +242,10 @@ static long get_alarm_double(DBADDR *paddr,struct dbr_alDouble *pad)
int fieldIndex = dbGetFieldIndex(paddr);
if(fieldIndex == longoutRecordVAL) {
pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
pad->upper_warning_limit = prec->hsv ? prec->high : epicsNAN;
pad->lower_warning_limit = prec->lsv ? prec->low : epicsNAN;
pad->lower_alarm_limit = prec->llsv ? prec->lolo : epicsNAN;
pad->upper_alarm_limit = prec->hihi;
pad->upper_warning_limit = prec->high;
pad->lower_warning_limit = prec->low;
pad->lower_alarm_limit = prec->lolo;
} else recGblGetAlarmDouble(paddr,pad);
return(0);
}

View File

@@ -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")

View File

@@ -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")

View File

@@ -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

View File

@@ -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

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env perl
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell;
#*************************************************************************
# Copyright (c) 2010 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.

View File

@@ -1,55 +0,0 @@
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2018 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
# Returns an architecture name for EPICS_HOST_ARCH that should be
# appropriate for the CPU that this version of Perl was built for.
# Any arguments to the program will be appended with separator '-'
# to allow flags like -gnu -debug and/or -static to be added.
# Before Base has been built, use a command like this:
# bash$ export EPICS_HOST_ARCH=`perl src/tools/EpicsHostArch.pl`
#
# If Base is already built, use
# tcsh% setenv EPICS_HOST_ARCH `perl base/lib/perl/EpicsHostArch.pl`
# If your architecture is not recognized by this script, please send
# the output from running 'perl --version' to the EPICS tech-talk
# mailing list to have it added.
use strict;
use Config;
use POSIX;
print join('-', HostArch(), @ARGV), "\n";
sub HostArch {
my $arch = $Config{archname};
for ($arch) {
return 'linux-x86_64' if m/^x86_64-linux/;
return 'linux-x86' if m/^i[3-6]86-linux/;
return 'linux-arm' if m/^arm-linux/;
return 'windows-x64' if m/^MSWin32-x64/;
return 'win32-x86' if m/^MSWin32-x86/;
return "cygwin-x86_64" if m/^x86_64-cygwin/;
return "cygwin-x86" if m/^i[3-6]86-cygwin/;
return 'solaris-sparc' if m/^sun4-solaris/;
return 'solaris-x86' if m/^i86pc-solaris/;
my ($kernel, $hostname, $release, $version, $cpu) = uname;
if (m/^darwin/) {
for ($cpu) {
return 'darwin-x86' if m/^(i386|x86_64)/;
return 'darwin-ppc' if m/Power Macintosh/;
}
die "$0: macOS CPU type '$cpu' not recognized\n";
}
die "$0: Architecture '$arch' not recognized\n";
}
}

View File

@@ -16,9 +16,6 @@ PERL_MODULES += EPICS/Path.pm
PERL_MODULES += EPICS/Release.pm
PERL_MODULES += EPICS/Getopts.pm
# This goes into lib/perl, not bin/<host>
PERL_MODULES += EpicsHostArch.pl
PERL_SCRIPTS += convertRelease.pl
PERL_SCRIPTS += cvsclean.pl
PERL_SCRIPTS += dos2unix.pl

View File

@@ -21,7 +21,8 @@ use Getopt::Std;
use EPICS::Path;
use EPICS::Release;
our ($arch, $top, $iocroot, $root);
use vars qw($arch $top $iocroot $root);
our ($opt_a, $opt_t, $opt_T);
$Getopt::Std::OUTPUT_HELP_VERSION = 1;

Some files were not shown because too many files have changed in this diff Show More