Merge tag 'R7.0.6' into PSI-7.0

ANJ: Tagged for release

Conflicts:
	.ci
	configure/os/CONFIG_SITE.linux-x86.Common
	modules/libcom/src/misc/epicsString.h
	src/tools/makeTestfile.pl
This commit is contained in:
2021-07-08 19:00:08 +02:00
211 changed files with 4486 additions and 1645 deletions

2
.ci

Submodule .ci updated: 7d9d426629...d675de24e6

19
.gitattributes vendored
View File

@ -4,3 +4,22 @@
.appveyor/ export-ignore
.appveyor.yml export-ignore
README export-subst
#Which files need CRLF handling
# default to automatic
* text=auto
# batch script parser on windows requires CRLF
*.bat text eol=crlf
# extensions for scripts which may be executable via. "#!..." must have LF
*.pl text eol=lf
*.plt text eol=lf
*.sh text eol=lf
*.cmd text eol=lf
# .cmd in unexpanded templates
*.cmd@* text eol=lf
# executable scripts w/o extensions
modules/ca/src/client/S99caRepeater@ text eol=lf
modules/libcom/src/log/S99logServer@ text eol=lf
startup/EpicsHostArch text eol=lf

View File

@ -43,7 +43,9 @@ jobs:
BCFG: ${{ matrix.configuration }}
WINE: ${{ matrix.wine }}
RTEMS: ${{ matrix.rtems }}
RTEMS_TARGET: ${{ matrix.rtems_target }}
EXTRA: ${{ matrix.extra }}
TEST: ${{ matrix.test }}
strategy:
fail-fast: false
matrix:
@ -78,17 +80,70 @@ jobs:
extra: "CMD_CXXFLAGS=-std=c++11"
name: "Ub-20 clang-10 C++11"
- os: ubuntu-20.04
cmp: gcc
configuration: default
rtems: "5"
rtems_target: RTEMS-pc686-qemu
test: NO
name: "Ub-20 gcc-9 + RT-5.1 pc686"
- os: ubuntu-20.04
cmp: gcc
configuration: default
rtems: "5"
rtems_target: RTEMS-beatnik
test: NO
name: "Ub-20 gcc-9 + RT-5.1 beatnik"
# Only build one RTEMS target per CPU family
# unless it's running the tests
#
# - os: ubuntu-20.04
# cmp: gcc
# configuration: default
# rtems: "5"
# rtems_target: RTEMS-mvme3100
# test: NO
# name: "Ub-20 gcc-9 + RT-5.1 mvme3100"
#
# - os: ubuntu-20.04
# cmp: gcc
# configuration: default
# rtems: "5"
# rtems_target: RTEMS-qoriq_e500
# test: NO
# name: "Ub-20 gcc-9 + RT-5.1 qoriq_e500"
- os: ubuntu-20.04
cmp: gcc
configuration: default
rtems: "5"
rtems_target: RTEMS-xilinx_zynq_a9_qemu
test: NO
name: "Ub-20 gcc-9 + RT-5.1 xilinx_zynq_a9_qemu"
- os: ubuntu-20.04
cmp: gcc
configuration: default
rtems: "5"
rtems_target: RTEMS-uC5282
test: NO
name: "Ub-20 gcc-9 + RT-5.1 uC5282"
- os: ubuntu-20.04
cmp: gcc
configuration: default
rtems: "4.10"
name: "Ub-20 gcc-9 + RT-4.10"
rtems_target: RTEMS-pc386-qemu
- os: ubuntu-20.04
cmp: gcc
configuration: default
rtems: "4.9"
name: "Ub-20 gcc-9 + RT-4.9"
rtems_target: RTEMS-pc386-qemu
- os: ubuntu-16.04
cmp: gcc-4.8
@ -175,6 +230,7 @@ jobs:
with:
name: tapfiles ${{ matrix.name }}
path: '**/O.*/*.tap'
if-no-files-found: ignore
- name: Collect and show test results
if: ${{ always() }}
run: python .ci/cue.py -T 5M test-results

View File

@ -16,6 +16,10 @@ ifneq ($(wildcard $(TOP)/configure/CONFIG_BASE_VERSION),)
CONFIG = $(TOP)/configure
BASE_TOP=YES
else
ifneq ($(origin EPICS_BASE),file)
# Essential for the EPICS build system, see convertRelease.pl
$(error EPICS_BASE must be set in a configure/RELEASE file)
endif
CONFIG ?= $(EPICS_BASE)/configure
endif
@ -62,6 +66,9 @@ include $(CONFIG)/os/CONFIG.$(EPICS_HOST_ARCH).Common
RELEASE_TOPS := $(shell $(CONVERTRELEASE) -T $(TOP) releaseTops)
ifdef T_A
# Information from the target's compiler
#
-include $(EPICS_BASE)/cfg/TOOLCHAIN.$(EPICS_HOST_ARCH).$(T_A)
# Cross compile specific definitions
#

View File

@ -50,14 +50,13 @@ CODE_LDFLAGS += $(ASAN_LDFLAGS_$(ENABLE_ASAN))
PIPE_CFLAGS_YES_YES = -pipe
PIPE_CFLAGS = $(PIPE_CFLAGS_$(GCC_PIPE)_$(GNU))
PIPE_CXXFLAGS = $(PIPE_CFLAGS)
STATIC_LDFLAGS_YES = -static
STATIC_LDFLAGS_NO =
SHRLIB_CFLAGS = -fPIC
SHRLIB_LDFLAGS = -shared -fPIC
LOADABLE_SHRLIB_LDFLAGS = -shared -fPIC
SHRLIB_LDFLAGS = -shared -fPIC -Wl,-h$@
LOADABLE_SHRLIB_LDFLAGS = -shared -fPIC -Wl,-h$@
GNU_LDLIBS_YES = -lgcc

View File

@ -31,10 +31,12 @@ endif # BASE_TOP
# Where to find the installed build tools
# Windows does not like commands with relative paths starting ../
# so TOOLS must be an absolute path, although Perl scripts are OK.
# FIND_TOOL is for scripts run before the build reaches src/tools.
# FIND_TOOL is for scripts run before the build reaches src/tools
# and must also work in submodules when EPICS_BASE is not built.
TOOLS = $(abspath $(EPICS_BASE_HOST_BIN))
FIND_TOOL = $(firstword $(wildcard $(TOOLS)/$(1) $(EPICS_BASE)/src/tools/$(1)))
FIND_TOOL = $(firstword $(wildcard $(TOOLS)/$(1) \
$(TOP)/src/tools/$(1)) $(EPICS_BASE)/src/tools/$(1))
#---------------------------------------------------------------
# EPICS Base build tools and tool flags

View File

@ -48,15 +48,15 @@ EPICS_VERSION = 7
EPICS_REVISION = 0
# EPICS_MODIFICATION must be a number >=0 and <256
EPICS_MODIFICATION = 5
EPICS_MODIFICATION = 6
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
# Not included in the official EPICS version number if zero
EPICS_PATCH_LEVEL = 1
EPICS_PATCH_LEVEL = 0
# Immediately after an official release the EPICS_PATCH_LEVEL is incremented
# and the -DEV suffix is added (similar to the Maven -SNAPSHOT versions)
EPICS_DEV_SNAPSHOT=-DEV
EPICS_DEV_SNAPSHOT=
# No changes should be needed below here

View File

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

View File

@ -71,6 +71,8 @@ INSTALL_DBD = $(INSTALL_LOCATION)/dbd
INSTALL_DB = $(INSTALL_LOCATION)/db
INSTALL_CONFIG = $(INSTALL_LOCATION)/configure
FINAL_LOCATION = $(shell $(PERL) $(TOOLS)/fullPathName.pl $(INSTALL_LOCATION))
# Directory for OS independant build created files
COMMON_DIR = ../O.Common
@ -142,9 +144,10 @@ BUILDLIB_SUFFIX = $(BUILDLIB_SUFFIX_$(SHARED_LIBRARIES))
#--------------------------------------------------
# vpath directories
POSIX_YES = os/posix
OS_IMPL_DIRS = $(if $(OS_API),os/$(OS_CLASS)-$(OS_API),) os/$(OS_CLASS)
GENERIC_SRC_DIRS = .. $(SRC_DIRS)
OS_SRC_DIRS += . $(foreach dir, .. $(SRC_DIRS), \
$(addprefix $(dir)/, os/$(OS_CLASS) $(POSIX_$(POSIX)) os/default ))
$(addprefix $(dir)/, $(OS_IMPL_DIRS) $(POSIX_$(POSIX)) os/default ))
CMPLR_SRC_DIRS += . $(foreach dir, .. $(SRC_DIRS), \
$(addprefix $(dir)/, compiler/$(CMPLR_CLASS) compiler/default ))
ALL_SRC_DIRS = $(CMPLR_SRC_DIRS) $(OS_SRC_DIRS) $(GENERIC_SRC_DIRS)
@ -257,7 +260,7 @@ OPT_CXXFLAGS = $(OPT_CXXFLAGS_$($(BUILD_CLASS)_OPT))
# Static build flags
STATIC_CFLAGS = $(STATIC_CFLAGS_$(STATIC_BUILD))
STATIC_CXXCFLAGS = $(STATIC_CXXFLAGS_$(STATIC_BUILD))
STATIC_CXXFLAGS = $(STATIC_CXXFLAGS_$(STATIC_BUILD))
STATIC_LDFLAGS = $(STATIC_LDFLAGS_$(STATIC_BUILD))
STATIC_LDLIBS = $(STATIC_LDLIBS_$(STATIC_BUILD))
@ -294,7 +297,7 @@ CFLAGS = $($(BUILD_CLASS)_CFLAGS) $(POSIX_CFLAGS) $(OPT_CFLAGS)\
CXXFLAGS = $($(BUILD_CLASS)_CXXFLAGS) $(POSIX_CXXFLAGS) $(OPT_CXXFLAGS)\
$(DEBUG_CXXFLAGS) $(PIPE_CFLAGS) $(WARN_CXXFLAGS) $(TARGET_CXXFLAGS)\
$(USR_CXXFLAGS) $(CMD_CXXFLAGS) $(ARCH_DEP_CXXFLAGS) $(CODE_CXXFLAGS)\
$(STATIC_CXXCFLAGS) $(OP_SYS_CXXFLAGS) $(LIBRARY_SRC_CFLAGS)
$(STATIC_CXXFLAGS) $(OP_SYS_CXXFLAGS) $(LIBRARY_SRC_CFLAGS)
LDFLAGS = $(OPT_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(CMD_LDFLAGS)\
$(POSIX_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(DEBUG_LDFLAGS) $(OP_SYS_LDFLAGS)\

View File

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

View File

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

View File

@ -17,9 +17,8 @@
# Currently Supporting:
# cygwin-x86 (cygwin compiler used for host builds)
# cygwin-x86_64 (cygwin compiler used for host builds)
# darwin-ppc (PowerPC based Apple running OSX)
# darwin-ppcx86 (Universal binaries for both CPUs)
# darwin-x86 (Intel based Apple running OSX)
# darwin-aarch64 (M1 based Apple using CLANG compiler)
# darwin-x86 (Intel based Apple using CLANG compiler)
# freebsd-x86 (GNU compiler used for host builds)
# freebsd-x86_64 (GNU compiler used for host builds)
# linux-aarch64 (GNU compiler used for host builds)
@ -62,16 +61,8 @@
# ios-arm (darwin-x86 host)
# ios-386 (darwin-x86 host)
# linux-386 (linux-x86 host)
# linux-486 (linux-x86 host)
# linux-586 (linux-x86 host)
# linux-686 (linux-x86 host)
# linux-arm (linux-x86 or -x86_64 host)
# linux-aarch64 (linux-x86_64 host)
# linux-athlon (linux-x86 host)
# linux-cris (Axis GNU crosscompiler on linux-x86 host)
# linux-cris_v10 (Axis GNU crosscompiler on linux-x86 host)
# linux-cris_v32 (Axis GNU crosscompiler on linux-x86 host)
# linux-microblaze
# linux-xscale_be
# vxWorks-486
@ -85,18 +76,20 @@
# vxWorks-ppc604_altivec
# vxWorks-mpc8540
# vxWorks-mpc8548
# RTEMS-at91rm9200ek
# RTEMS-beagleboneblack
# RTEMS-beatnik
# RTEMS-gen68360
# RTEMS-mcp750
# RTEMS-mvme167
# RTEMS-mvme2100
# RTEMS-mvme2700
# RTEMS-mvme3100
# RTEMS-mvme5500
# RTEMS-pc386
# RTEMS-psim
# RTEMS-pc386 (RTEMS 4)
# RTEMS-pc386-qemu (RTEMS 4)
# RTEMS-pc686 (RTEMS 5)
# RTEMS-pc686-qemu (RTEMS 5)
# RTEMS-qoriq_e500
# RTEMS-uC5282
# RTEMS-xilinx-zynq-a9_qemu
# RTEMS-xilinx_zynq_zedboard
# win32-x86-mingw (linux-x86 or -x86_64 host)
#
@ -104,7 +97,6 @@
# Definitions in configure/os/CONFIG_SITE.<host>.Common
# may override this setting.
CROSS_COMPILER_TARGET_ARCHS=
#CROSS_COMPILER_TARGET_ARCHS=vxWorks-ppc32
# If only some of your host architectures can compile the
# above CROSS_COMPILER_TARGET_ARCHS specify those host
@ -151,6 +143,14 @@ CROSS_WARN=YES
# different location then uncomment and set this.
#INSTALL_LOCATION=<fullpathname>
# The location from which files placed in INSTALL_LOCATION will actually run.
# This path is compiled into executables, and so should be an absolute.
# May be used to achieve the effect of autotools. eg.
# ./configure --prefix=<FINAL_LOCATION>
# make DESTDIR=<INSTALL_LOCATION>
# Defaults to the absolute expansion of $(INSTALL_LOCATION)
#FINAL_LOCATION=
# Use POSIX thread priority scheduling (if available).
# Must be either YES or NO
USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES

View File

@ -15,7 +15,8 @@ include $(TOP)/configure/CONFIG
TOOLS = $(TOP)/src/tools
CONFIGS += $(subst ../,,$(wildcard ../CONFIG*))
CONFIGS += $(subst ../,,$(wildcard ../os/CONFIG*))
CONFIGS += $(subst ../,,$(wildcard ../os/CONFIG.*))
CONFIGS += $(subst ../,,$(wildcard ../os/CONFIG_SITE.*))
CONFIGS += $(subst ../,,$(wildcard ../RELEASE*))
CONFIGS += $(subst ../,,$(wildcard ../RULES*))
@ -29,5 +30,9 @@ CFG += CONFIG_CA_VERSION
CFG += CONFIG_DATABASE_MODULE
CFG += CONFIG_DATABASE_VERSION
CFG += TOOLCHAIN.$(EPICS_HOST_ARCH).$(T_A)
include $(TOP)/configure/RULES
TOOLCHAIN.$(EPICS_HOST_ARCH).$(T_A): toolchain.c
$(PREPROCESS.cpp)

View File

@ -28,12 +28,13 @@ ifneq ($(CONFIG),$(TOP)/configure)
endif
#--------------------------------------------------
# Set RTEMS_BSP from T_A if not already done
# Set RTEMS_BSP and GNU_TARGET if not already done
RTEMS_BSP ?= $(subst RTEMS-,,$(T_A))
GNU_TARGET ?= $(RTEMS_TARGET_CPU)-rtems
#-------------------------------------------------------
# Pick up the RTEMS tool/path definitions from the RTEMS BSP directory.
include $(RTEMS_BASE)/$(RTEMS_TARGET_CPU)-rtems$(RTEMS_VERSION)/$(RTEMS_BSP)/Makefile.inc
include $(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/$(RTEMS_BSP)/Makefile.inc
include $(RTEMS_CUSTOM)
include $(CONFIG.CC)
@ -41,7 +42,7 @@ include $(CONFIG.CC)
# RTEMS cross-development tools
CC = $(RTEMS_TOOLS)/bin/$(CC_FOR_TARGET) $(GCCSPECS) -fasm
CCC = $(RTEMS_TOOLS)/bin/$(CXX)
CPP = $(RTEMS_TOOLS)/bin/$(CC_FOR_TARGET) -x c -E
CPP = $(RTEMS_TOOLS)/bin/$(CC_FOR_TARGET) -x c -E $(GCCSPECS)
AR = $(RTEMS_TOOLS)/bin/$(AR_FOR_TARGET)
LD = $(RTEMS_TOOLS)/bin/$(LD_FOR_TARGET) -r
@ -62,7 +63,7 @@ CFLAGS = $($(BUILD_CLASS)_CFLAGS) $(POSIX_CFLAGS) $(OPT_CFLAGS)\
CXXFLAGS = $($(BUILD_CLASS)_CXXFLAGS) $(POSIX_CXXFLAGS) $(OPT_CXXFLAGS)\
$(DEBUG_CXXFLAGS) $(PIPE_CFLAGS) $(WARN_CXXFLAGS) $(TARGET_CXXFLAGS)\
$(USR_CXXFLAGS) $(CMD_CXXFLAGS) $(ARCH_DEP_CXXFLAGS) $(CODE_CXXFLAGS)\
$(STATIC_CXXCFLAGS) $(OP_SYS_CXXFLAGS) $(LIBRARY_SRC_CFLAGS)
$(STATIC_CXXFLAGS) $(OP_SYS_CXXFLAGS) $(LIBRARY_SRC_CFLAGS)
LDFLAGS = $(OPT_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(CMD_LDFLAGS)\
$(POSIX_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(DEBUG_LDFLAGS) $(OP_SYS_LDFLAGS)\
@ -95,20 +96,39 @@ MODEXT=.obj
OS_CLASS = RTEMS
#--------------------------------------------------
# Operating system flags
OP_SYS_LDLIBS += -lrtemsCom -lc -lrtemscpu -lCom -lnfs -lm
OP_SYS_LDFLAGS += $(CPU_CFLAGS) -u Init \
# Operating system compile & link flags
OP_SYS_CFLAGS += -D__LINUX_ERRNO_EXTENSIONS__
OP_SYS_CFLAGS_NET_yes = -DRTEMS_LEGACY_STACK
OP_SYS_CFLAGS += $(OP_SYS_CFLAGS_NET_$(RTEMS_HAS_NETWORKING))
ifeq ($(RTEMS_HAS_POSIX_API),yes)
POSIX_CPPFLAGS = -D_GNU_SOURCE -D_DEFAULT_SOURCE
endif
OP_SYS_LDLIBS_posix_NET_yes = -ltftpfs -lnfs -lz -ltelnetd
OP_SYS_LDLIBS_posix_NET_no = -ltftpfs -lbsd -lz
OP_SYS_LDLIBS_score_NET_yes = -lnfs
OP_SYS_LDLIBS_score_NET_no = -lnfs
OP_SYS_LDLIBS += -lrtemsCom -lCom
OP_SYS_LDLIBS += $(OP_SYS_LDLIBS_$(OS_API)_NET_$(RTEMS_HAS_NETWORKING))
OP_SYS_LDLIBS += -lrtemscpu -lc -lm
OP_SYS_LDFLAGS_posix = -u POSIX_Init
OP_SYS_LDFLAGS_score = -u Init \
$(PROJECT_RELEASE)/lib/no-dpmem.rel \
$(PROJECT_RELEASE)/lib/no-mp.rel \
$(PROJECT_RELEASE)/lib/no-part.rel \
$(PROJECT_RELEASE)/lib/no-signal.rel \
$(PROJECT_RELEASE)/lib/no-rtmon.rel
OP_SYS_LDFLAGS += $(CPU_CFLAGS) $(OP_SYS_LDFLAGS_$(OS_API))
# Settings for GeSys
MOD_SYS_LDFLAGS += $(CPU_CFLAGS) -Wl,-r -nostdlib
# Do not link against libraries which are part of the Generic Image
GESYS_LIBS += -lgcc
GESYS_LIBS += -lc -lm -lrtemscpu -lrtemsbsp -lrtems++ -lbspExt
GESYS_LIBS += -lc -lm -lrtemscpu -lrtemsbsp -lrtems++
GESYS_LIBS += -lcexp -ltecla_r -lspencer_regexp -lpmelf -lpmbfd
GESYS_LIBS += -lnfs -ltelnetd -lrtems-gdb-stub

View File

@ -1,14 +0,0 @@
#
# CONFIG.Common.RTEMS-at91rm9200ek
# Author: Ralf Hartmann
# BESSY
# Ralf.Hartmann@bessy.de
#
# Atmel AT91RM9200-EK evaluation kit
# using the AT91RM9200 ARM9-based 32-bit RISC microcontroller
#
# All RTEMS targets use the same Makefile fragment
#
RTEMS_BSP = at91rm9200ek
RTEMS_TARGET_CPU = arm
include $(CONFIG)/os/CONFIG.Common.RTEMS

View File

@ -0,0 +1,18 @@
#
# CONFIG.Common.RTEMS-beaglebineblack
# Author: Heinz Junkes <junkes@fhi-berlin.mpg.de>
#
# All RTEMS targets use the same Makefile fragment
#
#EXE = .elf
RTEMS_BSP = beagleboneblack
RTEMS_TARGET_CPU = arm
GNU_TARGET = arm-rtems
OP_SYS_LDLIBS += -Wl,--gc-sections
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/beagleboneblack/lib/
include $(CONFIG)/os/CONFIG.Common.RTEMS

View File

@ -8,14 +8,16 @@ EXE = .elf
RTEMS_BSP = beatnik
RTEMS_TARGET_CPU = powerpc
GNU_TARGET = powerpc-rtems
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
# optimization trouble in postfix.c
ARCH_DEP_CFLAGS += -DRTEMS_HAS_ALTIVEC
#will use bootp
#ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
ARCH_DEP_CFLAGS += -DHAVE_MOTLOAD
ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048
ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120
OP_SYS_LDLIBS += -lbspExt
MUNCH_SUFFIX = .boot
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
endef

View File

@ -1,10 +0,0 @@
#
# Author: W. Eric Norum
# Canadian Light Source
# eric@cls.usask.ca
#
# All RTEMS targets use the same Makefile fragment
#
RTEMS_BSP = gen68360
RTEMS_TARGET_CPU = m68k
include $(CONFIG)/os/CONFIG.Common.RTEMS

View File

@ -1,10 +0,0 @@
#
# Author: W. Eric Norum
# Canadian Light Source
# eric@cls.usask.ca
#
# All RTEMS targets use the same Makefile fragment
#
RTEMS_BSP = mcp750
RTEMS_TARGET_CPU = ppc
include $(CONFIG)/os/CONFIG.Common.RTEMS

View File

@ -1,10 +0,0 @@
#
# Author: W. Eric Norum
# Canadian Light Source
# eric@cls.usask.ca
#
# All RTEMS targets use the same Makefile fragment
#
RTEMS_BSP = mvme167
RTEMS_TARGET_CPU = m68k
include $(CONFIG)/os/CONFIG.Common.RTEMS

View File

@ -11,8 +11,6 @@ GNU_TARGET = powerpc-rtems
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
ARCH_DEP_CFLAGS += -DHAVE_PPCBUG
OP_SYS_LDLIBS += -lbspExt
MUNCH_SUFFIX = .boot
define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< rtems
@ -21,6 +19,7 @@ define MUNCH_CMD
$(PROJECT_RELEASE)/lib/bootloader.o \
--just-symbols=$< \
-b binary rtems.gz \
--no-warn-mismatch \
-T $(PROJECT_RELEASE)/lib/ppcboot.lds \
-Map $<.map
rm -f rtems.gz

View File

@ -1,7 +1,7 @@
#
# Author: Matt Rippa
#
RTEMS_BSP = mvme2700
RTEMS_BSP = mvme2307
RTEMS_TARGET_CPU = powerpc
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
ARCH_DEP_CFLAGS += -DHAVE_PPCBUG
@ -15,11 +15,10 @@ define MUNCH_CMD
$(PROJECT_RELEASE)/lib/bootloader.o \
--just-symbols=$< \
-b binary rtems.gz \
--no-warn-mismatch \
-T $(PROJECT_RELEASE)/lib/ppcboot.lds \
-Map $<.map
rm -f rtems.gz
endef
OP_SYS_LDLIBS += -lbspExt
include $(CONFIG)/os/CONFIG.Common.RTEMS

View File

@ -13,8 +13,6 @@ ARCH_DEP_CFLAGS += -DHAVE_MOTLOAD
ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048
ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120
OP_SYS_LDLIBS += -lbspExt
MUNCH_SUFFIX = .boot
define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@

View File

@ -14,13 +14,9 @@ ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048
ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120
ARCH_DEP_CFLAGS += -DBSP_NVRAM_BASE_ADDR=0xf1110000
OP_SYS_LDLIBS += -lbspExt
MUNCH_SUFFIX = .boot
define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
endef
OP_SYS_LDLIBS += -lbspExt
include $(CONFIG)/os/CONFIG.Common.RTEMS

View File

@ -1,12 +1,13 @@
# CONFIG.Common.RTEMS-pc386
#
# Author: W. Eric Norum
# Canadian Light Source
# eric@cls.usask.ca
#
# All RTEMS targets use the same Makefile fragment
# Definitions for the RTEMS-pc386 target, RTEMS 4.x only
# Site-specific overrides go in CONFIG_SITE.Common.RTEMS-pc386
#
#-------------------------------------------------------
RTEMS_BSP = pc386
RTEMS_TARGET_CPU = i386
GNU_TARGET = i386-rtems
MUNCH_SUFFIX = .boot
define MUNCH_CMD
@ -22,3 +23,10 @@ include $(CONFIG)/os/CONFIG.Common.RTEMS
# Put text segment where it will work with etherboot
#
OP_SYS_LDFLAGS += -Wl,-Ttext,0x100000
# This check must appear after the above include
ifeq ($(RTEMS_VERSION),5)
$(info *** This target is not compatible with the configured RTEMS version.)
$(info *** Build the RTEMS-pc686 (-qemu) target for RTEMS 5.x)
$(error Can't continue)
endif

View File

@ -6,6 +6,7 @@
#-------------------------------------------------------
# Include definitions from RTEMS-pc386
# For Tests overwrite it with pc686
include $(CONFIG)/os/CONFIG.Common.RTEMS-pc386
RTEMS_QEMU_FIXUPS = YES

View File

@ -0,0 +1,39 @@
# CONFIG.Common.RTEMS-pc686
#
# Definitions for the RTEMS-pc686 target, RTEMS 5.x only
# Site-specific overrides go in CONFIG_SITE.Common.RTEMS-pc686
#
#-------------------------------------------------------
#
# Author: W. Eric Norum
# Canadian Light Source
# eric@cls.usask.ca
#
# All RTEMS targets use the same Makefile fragment
#
RTEMS_BSP = pc686
RTEMS_TARGET_CPU = i386
GNU_TARGET = i386-rtems
MUNCH_SUFFIX = .boot
define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< $@
endef
OP_SYS_LDLIBS += -Wl,--gc-sections
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/pc686/lib/
include $(CONFIG)/os/CONFIG.Common.RTEMS
#
# Put text segment where it will work with etherboot
#
OP_SYS_LDFLAGS += -Wl,-Ttext,0x100000
# This check must appear after the above include
ifneq ($(RTEMS_VERSION),5)
$(info *** This target is not compatible with the configured RTEMS version.)
$(info *** Build the RTEMS-pc386 (-qemu) target for RTEMS 4.x)
$(error Can't continue)
endif

View File

@ -0,0 +1,11 @@
# CONFIG.Common.RTEMS-pc686-qemu
#
# Definitions for the RTEMS-pc686-qemu target
# Site-specific overrides go in CONFIG_SITE.Common.RTEMS-pc686-qemu
#
#-------------------------------------------------------
# Include definitions from RTEMS-pc686
include $(CONFIG)/os/CONFIG.Common.RTEMS-pc686
RTEMS_QEMU_FIXUPS = YES

View File

@ -1,10 +0,0 @@
#
# Author: W. Eric Norum
# University of Saskatchewan
# eric.norum@usask.ca
#
# All RTEMS targets use the same Makefile fragment
#
RTEMS_BSP = psim
RTEMS_TARGET_CPU = ppc
include $(CONFIG)/os/CONFIG.Common.RTEMS

View File

@ -0,0 +1,48 @@
#
# CONFIG.Common.RTEMS-qoriq_e500
# Author: Heinz Junkes <junkes@fhi-berlin.mpg.de>
#
# All RTEMS targets use the same Makefile fragment
#
EXE = .elf
RTEMS_BSP = qoriq_e500
RTEMS_TARGET_CPU = powerpc
GNU_TARGET = powerpc-rtems
# optimization trouble in postfix.c
ARCH_DEP_CFLAGS += -DRTEMS_HAS_ALTIVEC
#will use bootp
#ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
#ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048
#ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120
#netbsdlib
#ARCH_DEP_CFLAGS += -I$(RTEMS_BASE)/powerpc-rtems5/qoriq_e500/lib/include
#OP_SYS_LDLIBS += -lbspExt #does not use posix stuff ... want to ignore
OP_SYS_LDLIBS += -Wl,--gc-sections
#ARCH_DEP_LDFLAGS = -mcpu=8540 -meabi -msdata=sysv -mstrict-align -mspe -mabi=spe -mfloat-gprs=double
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/powerpc-rtems5/qoriq_e500/lib
MUNCH_SUFFIX = .img
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
gzip -9 -f $@
$(RTEMS_TOOLS)/bin/mkimage.py -A ppc -O linux -T kernel -a 0x4000 -e 0x4000 -n $* -d $@.gz $*.img
endef
include $(CONFIG)/os/CONFIG.Common.RTEMS
RTEMSSYMS=$(PRODNAME:%$(EXE)=%.sym)
RTEMSIMGS=$(PRODNAME:%$(EXE)=%.bin)
INSTALL_RTEMSSYMS=$(RTEMSSYMS:%=$(INSTALL_BIN)/%)
INSTALL_RTEMSIMGS=$(RTEMSIMGS:%=$(INSTALL_BIN)/%)
%.sym: %$(EXE)
$(XSYMS) $^ $@
%.bin: %$(EXE)
$(OBJCOPY) -Obinary $^ $@
#PRODTARGETS+=$(INSTALL_RTEMSSYMS) $(INSTALL_RTEMSIMGS)

View File

@ -9,6 +9,10 @@ RTEMS_BSP = uC5282
RTEMS_TARGET_CPU = m68k
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
# Hopefully a temporary fix:
ARCH_DEP_CXXFLAGS_5 = -std=c++98
ARCH_DEP_CXXFLAGS += $(ARCH_DEP_CXXFLAGS_$(RTEMS_VERSION))
MUNCH_SUFFIX = .boot
define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< $@

View File

@ -0,0 +1,20 @@
#
# CONFIG.Common.RTEMS-xilinx_zynq_a9_qemu
# Author: Heinz Junkes <junkes@fhi-berlin.mpg.de>
#
# All RTEMS targets use the same Makefile fragment
#
#EXE = .elf
RTEMS_BSP = xilinx_zynq_a9_qemu
RTEMS_TARGET_CPU = arm
GNU_TARGET = arm-rtems
#use dhcp/bootp
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
OP_SYS_LDLIBS += -Wl,--gc-sections
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/xilinx_zynq_a9_qemu/lib/
include $(CONFIG)/os/CONFIG.Common.RTEMS

View File

@ -0,0 +1,19 @@
#
# CONFIG.Common.RTEMS-xilinx_zynq_zedboard
# Author: Heinz Junkes <junkes@fhi-berlin.mpg.de>
#
# All RTEMS targets use the same Makefile fragment
#
#EXE = .elf
RTEMS_BSP = xilinx_zynq_zedboard
RTEMS_TARGET_CPU = arm
GNU_TARGET = arm-rtems
OP_SYS_LDLIBS += -Wl,--gc-sections
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/xilinx_zynq_zedboard/lib/
include $(CONFIG)/os/CONFIG.Common.RTEMS

View File

@ -1,14 +0,0 @@
# CONFIG.Common.darwin-ppc
#
# This file is maintained by the build community.
#
# Definitions for darwin-ppc target builds
# Sites may override these definitions in CONFIG_SITE.Common.darwin-ppc
#-------------------------------------------------------
#
# To build universal binaries, configure ARCH_CLASS
# in the file CONFIG_SITE.Common.darwin-ppc
# Include definitions common to all Darwin targets
include $(CONFIG)/os/CONFIG.darwinCommon.darwinCommon

View File

@ -1,14 +0,0 @@
# CONFIG.Common.darwin-ppcx86
#
# This file is maintained by the build community.
#
# Definitions for Darwin universal PowerPC + x86 target builds
# Sites may override these definitions in CONFIG_SITE.Common.darwin-ppcx86
#-------------------------------------------------------
#
# To build universal binaries, configure ARCH_CLASS
# in the file CONFIG_SITE.Common.darwin-ppcx86
# Include definitions common to all Darwin targets
include $(CONFIG)/os/CONFIG.darwinCommon.darwinCommon

View File

@ -1,21 +0,0 @@
# CONFIG.Common.linux-386
#
# This file is maintained by the build community.
#
# Definitions for linux-386 target builds
# Sites may override these definitions in CONFIG_SITE.Common.linux-386
#-------------------------------------------------------
# Include definitions common to all linux x86 targets
include $(CONFIG)/os/CONFIG.Common.linux-x86
ARCH_DEP_CFLAGS = -march=i386
ifeq ($(BUILD_CLASS),CROSS)
VALID_BUILDS = Ioc Command
endif
# If your crosscompiler name has a GNU target prefix like <gnutarget>-gcc,
# e.g. i386-pc-linux-gnu-gcc, put a GNU_TARGET definition in
# CONFIG_SITE.<host>.linux-386 file, e.g. GNU_TARGET=i386-pc-linux-gnu

View File

@ -1,19 +0,0 @@
# CONFIG.Common.linux-486
#
# Definitions for linux-486 target builds
# Sites may override these definitions in CONFIG_SITE.Common.linux-486
#-------------------------------------------------------
# Include definitions common to all linux x86 targets
include $(CONFIG)/os/CONFIG.Common.linux-x86
ARCH_DEP_CFLAGS = -march=i486
ifeq ($(BUILD_CLASS),CROSS)
VALID_BUILDS = Ioc Command
endif
# If your crosscompiler name has a GNU target prefix like <gnutarget>-gcc,
# e.g. i486-pc-linux-gnu-gcc, put a GNU_TARGET definition in
# CONFIG_SITE.<host>.linux-486 file, e.g. GNU_TARGET=i486-pc-linux-gnu

View File

@ -1,21 +0,0 @@
# CONFIG.Common.linux-586
#
# Definitions for linux-586 target builds
# Sites may override these definitions in CONFIG_SITE.Common.linux-586
#-------------------------------------------------------
# Include definitions common to all linux x86 targets
include $(CONFIG)/os/CONFIG.Common.linux-x86
# i586 is equivalent to pentium
ARCH_DEP_CFLAGS = -march=i586
ifeq ($(BUILD_CLASS),CROSS)
VALID_BUILDS = Ioc Command
endif
# If your crosscompiler name has a GNU target prefix like <gnutarget>-gcc,
# e.g. i586-pc-linux-gnu-gcc, put a GNU_TARGET definition in
# CONFIG_SITE.<host>.linux-586 file, e.g. GNU_TARGET=i586-pc-linux-gnu

View File

@ -1,20 +0,0 @@
# CONFIG.Common.linux-686
#
# Definitions for linux-686 target builds
# Sites may override these definitions in CONFIG_SITE.Common.linux-686
#-------------------------------------------------------
# Include definitions common to all linux x86 targets
include $(CONFIG)/os/CONFIG.Common.linux-x86
# i686 is euivalent to pentiumpro
ARCH_DEP_CFLAGS = -march=i686
ifeq ($(BUILD_CLASS),CROSS)
VALID_BUILDS = Ioc Command
endif
# If your crosscompiler name has a GNU target prefix like <gnutarget>-gcc,
# e.g. i686-pc-linux-gnu-gcc, put a GNU_TARGET definition in
# CONFIG_SITE.<host>.linux-686 file, e.g. GNU_TARGET=i686-pc-linux-gnu

View File

@ -1,19 +0,0 @@
# CONFIG.Common.linux-athlon
#
# Definitions for linux-athlon target builds
# Sites may override these definitions in CONFIG_SITE.Common.linux-athlon
#-------------------------------------------------------
# Include definitions common to all linux x86 targets
include $(CONFIG)/os/CONFIG.Common.linux-x86
ARCH_DEP_CFLAGS += -march=athlon-mp -mfpmath=sse
ifeq ($(BUILD_CLASS),CROSS)
VALID_BUILDS = Ioc Command
endif
# If your crosscompiler name has a GNU target prefix like <gnutarget>-gcc,
# e.g. athlon-pc-linux-gnu-gcc, put a GNU_TARGET definition in
# CONFIG_SITE.<host>.linux-athlon file, e.g. GNU_TARGET=athlon-pc-linux-gnu

View File

@ -1,58 +0,0 @@
# CONFIG.Common.linux-cris
#
# Author: Peter Zumbruch
# GSI
# P.Zumbruch@gsi.de
#
# Definitions for linux-cris target builds
# Sites may override these definitions in CONFIG_SITE.Common.linux-cris
#-------------------------------------------------------
# Include definitions common to all linux targets
include $(CONFIG)/os/CONFIG.Common.linuxCommon
ARCH_CLASS = cris
ifeq ($(BUILD_CLASS),CROSS)
GNU_TARGET = cris-axis-linux-gnu
# prefix of compiler tools
CMPLR_SUFFIX =
CMPLR_PREFIX = $(addsuffix -,$(GNU_TARGET))
# CROSS_TOP_DIR
# usually AXIS_TOP_DIR is defined via
# the init_env script of the SDK provided by Axis
#
## AXIS_TOP_DIR defined? Make missing mandatory variable visible
AXIS_TOP_DIR?=UNDEFINED_ENV__AXIS_TOP_DIR
AXIS_SDK_DIR?=$(AXIS_TOP_DIR)
# CROSS_INCLUDES
AXIS_SDK_TARGET_INCLUDE_DIR = $(AXIS_SDK_DIR)/target/$(GNU_TARGET)/include
AXIS_SDK_TARGET_INCLUDE_DIR +=$(AXIS_SDK_DIR)/target/$(GNU_TARGET)/usr/include
CROSS_INCLUDES = $(addprefix -isystem ,$(AXIS_SDK_TARGET_INCLUDE_DIR))
# CROSS_LDFLAGS
AXIS_SDK_TARGET_LIB_DIR = $(AXIS_SDK_DIR)/target/$(GNU_TARGET)/lib
AXIS_SDK_TARGET_LIB_DIR += $(AXIS_SDK_DIR)/target/$(GNU_TARGET)/usr/lib
CROSS_LDFLAGS = $(addprefix -L,$(AXIS_SDK_TARGET_LIB_DIR))
-include $(CONFIG)/os/CONFIG_SITE.Common.linux-cris
ifeq ($(EPICS_HOST_ARCH), linux-x86)
-include $(CONFIG)/os/CONFIG.linux-x86.linux-cris
-include $(CONFIG)/os/CONFIG_SITE.linux-x86.linux-cris
endif
endif
SHARED_LIBRARIES=NO
STATIC_BUILD=YES
ARCH_DEP_CFLAGS += -mno-mul-bug-workaround
OP_SYS_CFLAGS += -mlinux
ARCH_DEP_CPPFLAGS += -D_cris_ -mlinux
#uncomment CRIS_COMPILER_DEBUG for debugging cris-compiled code
#CRIS_COMPILER_DEBUG

View File

@ -1,8 +0,0 @@
# CONFIG.darwin-ppc.Common
#
# Definitions for darwin-ppc host builds
# Sites may override these definitions in CONFIG_SITE.darwin-ppc.Common
#-------------------------------------------------------
#Include definitions common to unix hosts
include $(CONFIG)/os/CONFIG.UnixCommon.Common

View File

@ -1,13 +0,0 @@
# CONFIG.darwin-ppc.darwin-ppc-debug
#
# Definitions for darwin-ppc host - darwin-ppc-debug target build with debug compiler flags
# Sites may override these definitions in CONFIG_SITE.darwin-ppc.darwin-ppc-debug
#-------------------------------------------------------
-include $(CONFIG)/os/CONFIG.Common.darwin-ppc
-include $(CONFIG)/os/CONFIG.darwin-ppc.darwin-ppc
-include $(CONFIG)/os/CONFIG_SITE.Common.darwin-ppc
-include $(CONFIG)/os/CONFIG_SITE.darwin-ppc.darwin-ppc
BUILD_CLASS=HOST
HOST_OPT = NO

View File

@ -1,8 +0,0 @@
# CONFIG.darwin-ppcx86.Common
#
# Definitions for Darwin universal PowerPC + x86 host builds
# Sites may override these definitions in CONFIG_SITE.darwin-ppcx86.Common
#-------------------------------------------------------
#Include definitions common to unix hosts
include $(CONFIG)/os/CONFIG.UnixCommon.Common

View File

@ -3,6 +3,6 @@
# Definitions for darwin-x86 host builds
# Sites may override these definitions in CONFIG_SITE.darwin-x86.Common
#-------------------------------------------------------
#support for IPv6 etc.
#Include definitions common to unix hosts
include $(CONFIG)/os/CONFIG.UnixCommon.Common

View File

@ -30,6 +30,7 @@ ARCH_DEP_LDFLAGS += $(ARCH_DEP_FLAGS)
#
# Special flags for Darwin
# No common blocks (as required when using shared libraries)
# OS provides socket address length
#
OP_SYS_CFLAGS += -fno-common

View File

@ -1,10 +0,0 @@
# CONFIG.linux-386.Common
#
# Definitions for linux-386 host builds
# Sites may override these definitions in CONFIG_SITE.linux-386.Common
#-------------------------------------------------------
#Include definitions common to unix hosts
include $(CONFIG)/os/CONFIG.UnixCommon.Common
WIND_HOST_TYPE = x86-linux2

View File

@ -1,8 +0,0 @@
# CONFIG.linux-386.linux-386
#
# Definitions for linux-386 host - linux-386 target builds
# Sites may override these definitions in CONFIG_SITE.linux-386.linux-386
#-------------------------------------------------------
# Include linux-x86 compiler definitions
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86

View File

@ -1,10 +0,0 @@
# CONFIG.linux-486.Common
#
# Definitions for linux-486 host builds
# Sites may override these definitions in CONFIG_SITE.linux-486.Common
#-------------------------------------------------------
#Include definitions common to unix hosts
include $(CONFIG)/os/CONFIG.UnixCommon.Common
WIND_HOST_TYPE = x86-linux2

View File

@ -1,9 +0,0 @@
# CONFIG.linux-486.linux-486
#
# Definitions for linux-486 host - linux-486 target builds
# Sites may override these definitions in CONFIG_SITE.linux-486.linux-486
#-------------------------------------------------------
# Include linux-x86 compiler definitions
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86

View File

@ -1,10 +0,0 @@
# CONFIG.linux-586.Common
#
# Definitions for linux-586 host builds
# Sites may override these definitions in CONFIG_SITE.linux-586.Common
#-------------------------------------------------------
#Include definitions common to unix hosts
include $(CONFIG)/os/CONFIG.UnixCommon.Common
WIND_HOST_TYPE = x86-linux2

View File

@ -1,9 +0,0 @@
# CONFIG.linux-586.linux-586
#
# Definitions for linux-586 host - linux-586 target builds
# Sites may override these definitions in CONFIG_SITE.linux-586.linux-586
#-------------------------------------------------------
# Include linux-x86 compiler definitions
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86

View File

@ -1,10 +0,0 @@
# CONFIG.linux-686.Common
#
# Definitions for linux-686 host builds
# Sites may override these definitions in CONFIG_SITE.linux-686.Common
#-------------------------------------------------------
#Include definitions common to unix hosts
include $(CONFIG)/os/CONFIG.UnixCommon.Common
WIND_HOST_TYPE = x86-linux2

View File

@ -1,9 +0,0 @@
# CONFIG.linux-686.linux-686
#
# Definitions for linux-686 host - linux-686 target builds
# Sites may override these definitions in CONFIG_SITE.linux-686.linux-686
#-------------------------------------------------------
# Include linux-x86 compiler definitions
include $(CONFIG)/os/CONFIG.linux-x86.linux-x86

View File

@ -1,38 +0,0 @@
# CONFIG.linux-x86.linux-cris
#
# Author: Peter Zumbruch
# GSI
# P.Zumbruch@gsi.de
#
# Definitions for linux-x86 host - linux-cris target builds
# Sites may override these definitions in CONFIG_SITE.linux-x86.linux-cris
#-------------------------------------------------------
GNU_DIR = $(CRIS_CROSS_COMPILER)
#STATIC_...
STATIC_LDFLAGS_YES= -Wl,-Bstatic
## debian-gcc Bug#438641
GNU_LDLIBS_YES =
STATIC_LDFLAGS_YES += -static-libgcc
# if not in debug mode strip all symbols
ifndef CRIS_COMPILER_DEBUG
STATIC_LDFLAGS_YES += -Wl,--strip-all
endif
ifeq ($(GNU),YES)
STATIC_LDFLAGS_NO = -lgcc
else
STATIC_LDFLAGS_NO =
endif
STATIC_LDLIBS_YES=
STATIC_LDLIBS_NO=
OPT_CXXFLAGS_YES = -Os
ifeq ($(STATIC_BUILD), YES)
$(shell echo yes)
endif

View File

@ -1,20 +0,0 @@
# CONFIG.linux-x86.linux-cris_v10
#
# Author: Peter Zumbruch
# GSI
# P.Zumbruch@gsi.de
#
# Definitions for linux-x86 host - linux-cris_v10 target builds
# Sites may override these definitions in CONFIG_SITE.linux-x86.linux-cris_v10
#-------------------------------------------------------
# Include definitions common to all linux-cris targets
include $(CONFIG)/os/CONFIG.Common.linux-cris
GNU_TARGET = cris-axis-linux-gnu
ARCH_DEP_CFLAGS += -march=v10
# if you are using different places for cris_v10 cris_v32
# you have to define for each architecture
# AXIS_SDK_DIR=<AXIS_TOP_DIR_v10>

View File

@ -1,20 +0,0 @@
# CONFIG.linux-x86.linux-cris_v32
#
# Author: Peter Zumbruch
# GSI
# P.Zumbruch@gsi.de
#
# Definitions for linux-x86 host - linux-cris_v32 target builds
# Sites may override these definitions in CONFIG_SITE.linux-x86.linux-cris_v32
#-------------------------------------------------------
# Include definitions common to all linux-cris targets
include $(CONFIG)/os/CONFIG.Common.linux-cris
GNU_TARGET = crisv32-axis-linux-gnu
ARCH_DEP_CFLAGS += -march=v32
# if you are using different places for cris_v10 cris_v32
# you have to define for each architecture
# AXIS_SDK_DIR=<AXIS_TOP_DIR_v32>

View File

@ -11,6 +11,3 @@ STATIC_LDFLAGS_YES= -Wl,-Bstatic
STATIC_LDFLAGS_NO=
STATIC_LDLIBS_YES= -Wl,-Bdynamic
STATIC_LDLIBS_NO=
SHRLIB_LDFLAGS += -Wl,-h$@
LOADABLE_SHRLIB_LDFLAGS += -Wl,-h$@

View File

@ -18,6 +18,6 @@ STATIC_LDLIBS_NO=
OP_SYS_LDFLAGS += -z ignore -z combreloc -z lazyload
SHRLIB_LDFLAGS += -Wl,-z,defs -Wl,-z,text -Wl,-h,$@
LOADABLE_SHRLIB_LDFLAGS += -Wl,-z,text -Wl,-h,$@
SHRLIB_LDFLAGS += -Wl,-z,defs -Wl,-z,text
LOADABLE_SHRLIB_LDFLAGS += -Wl,-z,text
GNU_LDLIBS_YES += -lc

View File

@ -49,9 +49,9 @@ OPT_CFLAGS_YES_NO = -Ox -Oy-
OPT_CFLAGS_YES = $(OPT_CFLAGS_YES_$(OPT_WHOLE_PROGRAM))
#
# -Zi generate program database for debugging information
# -Z7 generate C7 compatible debugging information (inside .obj)
# -RTCsu enable run-time error checks
OPT_CFLAGS_NO = -Zi -RTCsu
OPT_CFLAGS_NO = -Z7 -RTCsu
# specify object file name and location
OBJ_CFLAG = -Fo
@ -119,9 +119,9 @@ OPT_CXXFLAGS_YES_NO = -Ox -Oy-
OPT_CXXFLAGS_YES = $(OPT_CXXFLAGS_YES_$(OPT_WHOLE_PROGRAM))
#
# -Zi generate program database for debugging information
# -Z7 generate C7 compatible debugging information (inside .obj)
# -RTCsu enable run-time error checks
OPT_CXXFLAGS_NO = -RTCsu -Zi
OPT_CXXFLAGS_NO = -RTCsu -Z7
# specify object file name and location
OBJ_CXXFLAG = -Fo
@ -143,20 +143,6 @@ STATIC_LDLIBS_NO=
STATIC_LDFLAGS=
RANLIB=
#
# option needed for parallel builds with Visual Studio 2013 onward
# VS2012 and above have VisualStudioVersion, so just need to exclude 2012 (11.0)
# -FS Force Synchronous PDB Writes
#
ifneq ($(VisualStudioVersion),)
ifneq ($(VisualStudioVersion),11.0)
OPT_CXXFLAGS_NO += -FS
OPT_CFLAGS_NO += -FS
endif
endif
#
# add -profile here to run the ms profiler
# -LTCG whole program optimization
# -incremental:no full linking

View File

@ -3,11 +3,26 @@
# Site-specific information for all RTEMS targets
#-------------------------------------------------------
# Where to find RTEMS
# Where to find RTEMS, and what version is it
#
# RTEMS_BASE must point to the specific installation of RTEMS to
# build the target code with.
# RTEMS_VERSION is used in the path to the toolsets inside that
# installation. For RTEMS 5 only the major version number is
# used, but for RTEMS 4.10.2 say all 3 components are required.
#
# FHI:
#RTEMS_VERSION = 5
#RTEMS_BASE = /home/h1/DBG/rtems
#RTEMS_BASE = /home/ad/MVME6100/rtems/$(RTEMS_VERSION)
#RTEMS_BASE = /opt/RTEMS/qoriq/rtems/$(RTEMS_VERSION)
# APS:
RTEMS_VERSION = 4.10.2
RTEMS_BASE = /usr/local/vw/rtems/rtems-$(RTEMS_VERSION)
#RTEMS_VERSION = 4.10.2
#RTEMS_BASE = /usr/local/vw/rtems/rtems-4.10.2
#RTEMS_VERSION = 5
#RTEMS_BASE = /usr/local/vw/rtems/rtems-5.1
# Cross-compile toolchain in $(RTEMS_TOOLS)/bin
#

View File

@ -6,4 +6,4 @@
# If you're building this architecture you _probably_ want to
# run the tests for it under QEMU, but if not you can turn
# them off here by commenting out this line:
CROSS_COMPILER_RUNTEST_ARCHS += RTEMS-pc386-qemu
CROSS_COMPILER_RUNTEST_ARCHS += $(T_A)

View File

@ -0,0 +1,9 @@
# CONFIG_SITE.Common.RTEMS-pc686-qemu
#
# Site-specific overrides for the RTEMS-pc686-qemu target
#
# If you're building this architecture you _probably_ want to
# run the tests for it under QEMU, but if not you can turn
# them off here by commenting out this line:
CROSS_COMPILER_RUNTEST_ARCHS += $(T_A)

View File

@ -1,12 +0,0 @@
# CONFIG_SITE.Common.darwin-ppc
#
# Site override definitions for darwin-ppc target builds
#-------------------------------------------------------
# Select which CPU architectures to include in your universal binaries:
# ppc
# ppc64 - Not tested
ARCH_CLASS = ppc
#ARCH_CLASS = ppc64
#ARCH_CLASS = ppc ppc64

View File

@ -1,20 +0,0 @@
# CONFIG_SITE.Common.darwin-ppcx86
#
# Site override definitions for darwin-ppcx86 target builds
#----------------------------------------------------------
# Select which CPU architectures to include in your universal binaries:
# ppc
# i386
# ppc64 - Not tested
# x86_64 - Needs MacOS 10.4 with Universal SDK, or 10.5 or later.
ARCH_CLASS = ppc i386
#ARCH_CLASS = ppc x86_64
#ARCH_CLASS = ppc i386 x86_64
#ARCH_CLASS = ppc64 i386
#ARCH_CLASS = ppc64 x86_64
#ARCH_CLASS = ppc64 i386 x86_64
#ARCH_CLASS = ppc ppc64 i386
#ARCH_CLASS = ppc ppc64 x86_64
#ARCH_CLASS = ppc ppc64 i386 x86_64

View File

@ -4,14 +4,12 @@
#-------------------------------------------------------
# Select which CPU architecture(s) to include in your MacOS binaries:
# i386, x86_64, or both (fat binaries).
# x86_64 only, or arm64 as well (fat binaries).
#ARCH_CLASS = i386
ARCH_CLASS = x86_64
#ARCH_CLASS = i386 x86_64
#ARCH_CLASS = arm64 x86_64
#
# Uncomment the following 3 lines to build with Apple's GCC instead of CLANG.
# Uncomment the following 3 lines to build with GCC instead of CLANG.
#
#CMPLR_CLASS = gcc
#CC = gcc

View File

@ -1,34 +0,0 @@
# CONFIG_SITE.Common.linux-cris
#
# Site-specific settings for the linux-cris target
# NOTE: In most cases if SHARED_LIBRARIES is set to YES the
# shared libraries will be found automatically. However if the .so
# files are installed at a different path to their compile-time path
# then in order to be found at runtime do one of these:
# a) LD_LIBRARY_PATH must include the full absolute pathname to
# $(INSTALL_LOCATION)/lib/$(EPICS_HOST_ARCH) when invoking base
# executables.
# b) Add the runtime path to SHRLIB_DEPLIB_DIRS and PROD_DEPLIB_DIRS, which
# will add the named directory to the list contained in the executables.
# c) Add the runtime path to /etc/ld.so.conf and run ldconfig
# to inform the system of the shared library location.
# Use GNU Readline if the header file is installed
COMMANDLINE_LIBRARY = $(strip $(if $(wildcard \
$(GNU_DIR)/include/readline/readline.h), READLINE, EPICS))
# If libreadline needs additional libraries to be linked with it, try
# uncommenting each of the lines below in turn, starting with the top
# one and working downwards, until the build succeeds. Do a 'make rebuild'
# from the top of the Base tree after changing this setting.
# Needs -lncurses:
#COMMANDLINE_LIBRARY = READLINE_NCURSES
# Needs -lcurses:
#COMMANDLINE_LIBRARY = READLINE_CURSES
# Readline is broken or you don't want use it:
#COMMANDLINE_LIBRARY = EPICS

View File

@ -1,4 +0,0 @@
# CONFIG_SITE.darwin-ppc.Common
#
# Site override definitions for darwin-ppc host builds
#-------------------------------------------------------

View File

@ -1,4 +0,0 @@
# CONFIG_SITE.darwin-ppcx86.Common
#
# Site override definitions for darwin-ppcx86 host builds
#-------------------------------------------------------

View File

@ -1,3 +1,11 @@
# CONFIG_SITE.linux-x86.Common
#
# Site override definitions for linux-x86 host builds
#-------------------------------------------------------
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-ppc32
#CROSS_COMPILER_TARGET_ARCHS = RTEMS-mvme2100 RTEMS-pc386-qemu
INSTALL_LOCATION=/usr/local/epics/base-$(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION)
GNU_HOST_ARCH=i686

View File

@ -1,14 +0,0 @@
# CONFIG_SITE.linux-x86.linux-cris
#
# Author: Peter Zumbruch
# GSI
# P.Zumbruch@gsi.de
#
# Site specific definitions for linux-x86 host - linux-cris target builds
#-------------------------------------------------------
# define site specific location of cris cross compiler's gnu directory
# but without bin sub directory, this will be added automatically.
CRIS_CROSS_COMPILER ?= UNDEFINED_ENV__CRIS_CROSS_COMPILER

37
configure/toolchain.c Normal file
View File

@ -0,0 +1,37 @@
#ifdef _COMMENT_
/* Extract compiler pre-defined macros as Make variables
*
* Expanded as $(INSTALL_CFG)/TOOLCHAIN.$(EPICS_HOST_ARCH).$(T_A)
*
* Must be careful not to #include any C definitions
* into what is really a Makefile snippet
*
* cf. https://sourceforge.net/p/predef/wiki/Home/
*/
/* GCC preprocessor drops C comments from output.
* MSVC preprocessor emits C comments in output
*/
#endif
#if defined(__GNUC__) && !defined(__clang__)
GCC_MAJOR = __GNUC__
GCC_MINOR = __GNUC_MINOR__
GCC_PATCH = __GNUC_PATCHLEVEL__
#elif defined(__clang__)
CLANG_MAJOR = __clang_major__
CLANG_MINOR = __clang_minor__
CLANG_PATCH = __clang_patchlevel__
#elif defined(_MSC_VER)
MSVC_VER = _MSC_VER
#endif
#ifdef __rtems__
#include <rtems/score/cpuopts.h>
# if __RTEMS_MAJOR__>=5
OS_API = posix
# else
OS_API = score
# endif
#endif

View File

@ -1,67 +0,0 @@
cross compiling EPICS and
building IOC Applications for cris architectures
(linux-cris_v10, linux-cris_v32)
======================================================================
Please mail questions, comments, corrections, etc. ...
to P.Zumbruch@gsi.de
November 2007
Tools needed
------------
o Axis SDK
- Overview:
http://developer.axis.com/wiki/doku.php?id=axis:sdk
- Download:
http://www.axis.com/products/dev_sdk/download_dist.php
- Install HOWTO:
http://developer.axis.com/wiki/doku.php?id=axis:software_distribution_install_howto
o Axis GNU gcc release for cross compiling
- Download:
http://www.axis.com/products/dev_sdk/download_compiler.php
- Install HOWTO:
http://developer.axis.com/wiki/doku.php?id=axis:compiler_install
Environment
-----------
o CRIS_CROSS_COMPILER
- path to top directory of cris cross compiler,
where binaries are in sub directory bin/
- if not set, the make process will stop at place
UNDEFINED_ENV__CRIS_CROSS_COMPILER
o AXIS_TOP_DIR?=UNDEFINED_ENV__AXIS_TOP_DIR
- path to axis SDK top directory
- if not set compile and link commands will contain references to
UNDEFINED_ENV__AXIS_TOP_DIR
- to set the necessary variables, execute
. ./init_env
in the top directory of the SDK provided here.
o CRIS_COMPILER_DEBUG
- if defined symbols won't be stripped,
resulting in comparably large files
Building
--------
o Edit the CONFIG_SITE files
- CONFIG_SITE.linux-x86.Common:
for CROSS_COMPILER_TARGET_ARCHS += linux-cris_v10
for CROSS_COMPILER_TARGET_ARCHS += linux-cris_v32
- optionally CONFIG_SITE.linux-x86.linux-cris
for setting CRIS_CROSS_COMPILER
- optionally create CONFIG_SITE.linux-x86.linux-cris_v10
- optionally create CONFIG_SITE.linux-x86.linux-cris_v32
o "make".
Shared Libraries
----------------
Generating shared libraries is not supported.
Please feel free to contact me if you
encounter serious problems.
Peter

View File

@ -1,184 +0,0 @@
<html>
<head>
<title>Installation notes for EPICS on Mac OS X (Darwin)</title>
</head>
<body>
<h1>Building EPICS base</h1>
<ul>
<li>
To build base:
<ol>
<li>
Set the EPICS_HOST_ARCH environment variable to darwin-ppc, darwin-x86 or darwin-ppcx86.
The scripts in the
base/startup directory can automate this. For example, here's part
of my Bash login script (~/.bash_login):
<pre>
#
# EPICS
#
EPICS_BASE="${HOME}/src/EPICS/base"
EPICS_EXTENSIONS="${HOME}/src/EPICS/extensions"
<strong>.</strong> "${EPICS_BASE}"/startup/unix.sh
</pre>
</li>
<li>
<code>cd</code> to the EPICS base top-level source directory.
</li>
<li>
Uncomment the appropriate line in the relevent
EPICS_BASE/configure/os/CONFIG_SITE.Common.darwin-xxx file for your EPICS_HOST_ARCH value.
Newer versions of OS X (e.g. Snow Leopard) may include only 64 bit versions of some OS libraries,
so should only have the x86_64 ARCH_CLASS.
</li>
<li>
Run <code>make</code>.
</li>
</ol>
</li>
<li>
As distributed, EPICS on Mac OS X uses the readline command line input
routines. IOC applications are more pleasant to interact with if
either the readline or libtecla library is used. The easiest
way to get either or both of these libraries on to your system is to
download and install them using the either the DarwinPorts
distribution or the Fink package manager. If you don't want to install
the readline library, set the COMMANDLINE_LIBRARY variable in one of
the CONFIG_SITE files to EPICS.
<p>
Information on DarwinPorts is available from
<a href="http://www.opendarwin.org/projects/darwinports/">the DarwinPorts
project page</a>.
DarwinPorts binary packages are available from
<a href="http://packages.opendarwin.org/">here</a>.
<p>
Fink may be downloaded from
<a href="http://fink.sourceforge.net/">the Source Forge</a>.
</li>
<li>
If broadcasts are not seen locally, try adding "localhost" (127.0.0.1)
to the EPICS_CA_ADDR_LIST.
</li>
</ul>
<h1>Building EPICS extensions</h1>
<p>
Many extensions build and run properly on OS X. To build and run medm, first
obtain the X11 run-time and developer packages from Apple and the OpenMotif3
package from Fink.
<h1>Objective-C and AppleScript</h1>
<p>
Code written in Objective-C can be included in host or IOC applications.
Here are a couple of short Objective-C examples which can be used to send
AppleScript events to other applications on the OS X machine.
<pre>
/*
* exampleAppleScriptRecord.m
*
* Simple Objective-C/AppleScript subroutine record
*
* To use this record in an application:
*
* 1) Make the following changes to the application Makefile:
* - Add exampleAppleScriptRecord.m to the application SRCS.
* - Add -framework Foundation to the application LDFLAGS.
* 2) Add the following line to the application database description:
* registrar(registerExampleAppleScript)
* 3) Add a record to the application database:
* record(sub,"setVolume")
* {
* field(SNAM,"exampleAppleScriptProcess")
* }
*/
#import &lt;Foundation/Foundation.h&gt;
#include &lt;registryFunction.h&gt;
#include &lt;subRecord.h&gt;
#include &lt;alarm.h&gt;
#include &lt;errlog.h&gt;
#include &lt;recGbl.h&gt;
#include &lt;epicsExport.h&gt;
/*
* Shim between EPICS and NSAppleScript class.
*/
static long
exampleAppleScriptProcess(struct subRecord *psub)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDictionary *err;
NSAppleScript *nsa;
nsa = [[NSAppleScript alloc] initWithSource:[NSString stringWithFormat:
@"tell application \"Finder\" to set volume %g\n", psub-&gt;a]];
if ([nsa executeAndReturnError:&amp;err] == nil) {
errlogPrintf("Failed to run AppleScript: %s\n",
[[err objectForKey:NSAppleScriptErrorMessage] cString]);
recGblSetSevr(psub, SOFT_ALARM, INVALID_ALARM);
}
[nsa release];
[pool release];
return 0;
}
static registryFunctionRef subRef[] = {
{"exampleAppleScriptProcess",(REGISTRYFUNCTION)exampleAppleScriptProcess}
};
static void registerExampleAppleScript(void)
{
registryFunctionRefAdd(subRef,NELEMENTS(subRef));
}
epicsExportRegistrar(registerExampleAppleScript);
==============================================================================
/*
* runAppleScript.m
*
* Simple Objective-C/AppleScript shim to allow EPICS application to
* send arbitrary AppleScript messages to other applications.
*
* To use this subroutine in an application make the following
* changes to the application Makefile:
* - Add runAppleScript.m to the application SRCS.
* - Add -framework Foundation to the application LDFLAGS.
*/
#import &lt;Foundation/Foundation.h&gt;
#include &lt;errlog.h&gt;
int
runAppleScript(const char *format, ...)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *script;
NSMutableDictionary *err;
NSAppleScript *nsa;
va_list args;
int ret = 0;
va_start(args, format);
script = [[NSString alloc] initWithFormat:
[NSString stringWithCString:format] arguments:args];
va_end(args);
err = [NSMutableDictionary dictionaryWithCapacity:10];
nsa = [[NSAppleScript alloc] initWithSource:script];
if ([nsa executeAndReturnError:&amp;err] == nil) {
errlogPrintf("Failed to run AppleScript: %s\n",
[[err objectForKey:NSAppleScriptErrorMessage] cString]);
ret = -1;
}
[script release];
[nsa release];
[pool release];
return ret;
}
</pre>
</body>
</html>

View File

@ -6,22 +6,23 @@
### Table of Contents
- [What is EPICS base?](#0_0_1)
- [What is new in this release?](#0_0_2)
- [Copyright](#0_0_3)
- [Supported platforms](#0_0_4)
- [Supported compilers](#0_0_5)
- [Software requirements](#0_0_6)
- [Documentation](#0_0_8)
- [Directory Structure](#0_0_10)
- [Build related components](#0_0_11)
- [Building EPICS base (Unix and Win32)](#0_0_12)
- [Example application and extension](#0_0_13)
- [Multiple host platforms](#0_0_14)
- [What is EPICS base?](#what-is-epics-base?)
- [What is new in this release?](#what-is-new-in-this-release?)
- [Copyright](#copyright)
- [Supported platforms](#supported-platforms)
- [Supported compilers](#supported-compilers)
- [Software requirements](#software-requirements)
- [Host system storage requirements](#host-system-storage-requirements)
- [Documentation](#documentation)
- [Directory Structure](#directory-structure)
- [Site-specific build configuration](#site-specific-build-configuration)
- [Building EPICS base](#building-epics-base)
- [Example application and extension](#example-application-and-extension)
- [Multiple host platforms](#multiple-host-platforms)
-----
### <span id="0_0_1">What is EPICS base?</span>
### What is EPICS base?
The Experimental Physics and Industrial Control Systems (EPICS) is an
extensible set of software components and tools with which application
@ -33,17 +34,17 @@ function. EPICS base allows an arbitrary number of target systems,
IOCs (input/output controllers), and host systems, OPIs (operator
interfaces) of various types.
### <span id="0_0_2">What is new in this release?</span>
### What is new in this release?
Please check the `RELEASE_NOTES` file in the distribution for
Please check the `documentation/RELEASE_NOTES.md` file for
description of changes and release migration details.
### <span id="0_0_3">Copyright Licenses</span>
### Copyright
Please review the LICENSE file included in the distribution for legal
terms of usage.
Please review the `LICENSE` file included in the distribution for
legal terms of usage.
### <span id="0_0_4">Supported platforms</span>
### Supported platforms
The list of platforms supported by this version of EPICS base is given
in the `configure/CONFIG_SITE` file. If you are trying to build EPICS
@ -54,7 +55,7 @@ base/configure/os/directory. You can start by copying existing
configuration files in the configure/os directory and then make
changes for your new platforms.
### <span id="0_0_5">Supported compilers</span>
### Supported compilers
This version of EPICS base has been built and tested using the host
vendor's C and C++ compilers, as well as the GNU gcc and g++
@ -63,27 +64,33 @@ targets. You may need the C and C++ compilers to be in your search
path to do EPICS builds; check the definitions of CC and CCC in
`base/configure/os/CONFIG.<host>.<host>` if you have problems.
### <span id="0_0_6">Software requirements</span>
### Software requirements
**GNU make**
You must use GNU make, gnumake, for any EPICS builds. Set your path so
that a gnumake version 4.1 or later is available.
#### GNU make
You must use the GNU version of `make` for EPICS builds. Set your path
so that version 4.1 or later is available. The macOS version of `make`
is older but does still work.
#### Perl
**Perl**
You must have Perl version 5.10 or later installed. The EPICS
configuration files do not specify the perl full pathname, so the perl
executable must be found through your normal search path.
**Unzip and tar (Winzip on WIN32 systems)**
#### Unzip and tar (Winzip on WIN32 systems)
You must have tools available to unzip and untar the EPICS base
distribution file.
**Target systems**
#### Target systems
EPICS supports IOCs running on embedded platforms such as VxWorks and
RTEMS built using a cross-compiler, and also supports soft IOCs
running as processes on the host platform.
**vxWorks**
#### vxWorks
You must have vxWorks 6.8 or later installed if any of your target
systems are vxWorks systems; the C++ compiler from older versions cannot
compile recently developed code. The vxWorks installation provides the
@ -96,73 +103,84 @@ Consult the [vxWorks 6.x](https://epics.anl.gov/base/vxWorks6.php) EPICS
web pages about and the vxWorks documentation for information about
configuring your vxWorks operating system for use with EPICS.
**RTEMS**
#### RTEMS
For RTEMS targets, you need RTEMS core and toolset version 4.9.x or
4.10.x (4.11 or 5.x are not yet supported).
4.10.x. RTEMS 5 is experimental in EPICS 7.0.6.
**GNU readline or Tecla library**
GNU readline and Tecla libraries can be used by the IOC shell to
provide command line editing and command line history recall and edit.
GNU readline (or Tecla library) must be installed on your target
system when `COMMANDLINE_LIBRARY` is set to READLINE (or TECLA) for
that target. EPICS (EPICS shell) is the default specified in
`CONFIG_COMMON`. A READLINE override is defined for linux-x86 in the
EPICS distribution. Comment out `COMMANDLINE_LIBRARY=READLINE` in
`configure/os/CONFIG_SITE.Common.linux-x86` if readline is not
installed on linux-x86. Command-line editing and history will then be
those supplied by the os. On vxWorks the ledLib command-line input
library is used instead.
#### Command Line Editing
### <span id="0_0_8">Documentation</span>
GNU readline and other similar libraries can be used by the IOC shell
to provide command line editing and command line history recall. The
GNU readline development package (or Apple's emulator on macOS) must
be installed for a target when its build configuration variable
`COMMANDLINE_LIBRARY` is set to `READLINE`. The default specified in
`CONFIG_COMMON` is `EPICS`, but most linux target builds can detect if
readline is available and will then use it. RTEMS targets may be
configured to use `LIBTECLA` if available, and on vxWorks the OS's
ledLib line-editing library is normally used.
EPICS documentation is available through the [EPICS
website](https://epics.anl.gov/) at Argonne.
### Host system storage requirements
The compressed tar file is approximately 3 MB in size. The
distribution source tree takes up approximately 21 MB. A 64-bit host
architecture may need around 610 MB to compile, while cross-compiled
targets are somewhat smaller.
### Documentation
EPICS documentation is available through the [EPICS website](https://epics.anl.gov/) at Argonne.
Release specific documentation can also be found in the
base/documentation directory of the distribution.
`base/documentation` directory of the distribution.
### <span id="0_0_10">Directory Structure</span>
### Directory Structure
#### Distribution directory structure:
#### Distribution directory structure
```
base Root directory of the base distribution
base/configure Operating system independent build config files
base/configure/os Operating system dependent build config files
base Root directory of the distribution
base/configure Build rules and OS-independent config files
base/configure/os OS-dependent build config files
base/documentation Distribution documentation
base/src Source code in various subdirectories
base/startup Scripts for setting up path and environment
```
#### Install directories created by the build:
#### Directories created by the build
These are created in the root directory of the installation (`base`
above) or under the directory pointed to by the `INSTALL_LOCATION`
configuration variable if that has been set.
```
bin Installed scripts and executables in subdirs
cfg Installed build configuration files
db Installed data bases
dbd Installed data base definitions
doc Installed documentation files
db Installed database files
dbd Installed database definition files
html Installed html documentation
include Installed header files
include/os Installed os specific header files in subdirs
include/os Installed OS-specific header files in subdirs
include/compiler Installed compiler-specific header files
lib Installed libraries in arch subdirectories
lib/perl Installed perl modules
templates Installed templates
```
### <span id="0_0_11">Build related components</span>
#### `base/documentation` Directory
#### base/documentation directory - contains setup, build, and install documents
This contains documents on how to setup, build, and install EPICS.
```
README.md Instructions for setup and building epics base
README.darwin.html Installation notes for Mac OS X (Darwin)
RELEASE_NOTES.html Notes on release changes
README.md This file
RELEASE_NOTES.md Notes on release changes
KnownProblems.html List of known problems and workarounds
```
#### base/startup directory - contains scripts to set environment and path
#### `base/startup` Directory
This contains several example scripts that show how to set up the
build environment and PATH for using EPICS. Sites would usually copy and/or modify these files as appropriate for their environment; they are not used by the build system at all.
```
EpicsHostArch Shell script to set EPICS_HOST_ARCH env variable
@ -172,10 +190,13 @@ base/documentation directory of the distribution.
windows.bat Bat file example to configure windows-x64 target
```
#### base/configure directory - contains build definitions and rules
#### `base/configure` directory
This contains build-system files providing definitions and rules
required by GNU Make to build EPICS. Users should only need to modify the `CONFIG_SITE` files to configure the EPICS build.
```
CONFIG Includes configure files and allows variable overrides
CONFIG Main entry point for building EPICS
CONFIG.CrossCommon Cross build definitions
CONFIG.gnuCommon Gnu compiler build definitions for all archs
CONFIG_ADDONS Definitions for <osclass> and DEFAULT options
@ -198,25 +219,30 @@ base/documentation directory of the distribution.
RULES_EXPAND
RULES_FILE_TYPE
RULES_TARGET
RULES_TOP Rules specific to a <top> dir (uninstall and tar)
RULES_TOP Rules specific to a <top> dir only
Sample.Makefile Sample makefile with comments
```
#### base/configure/os directory - contains os-arch specific definitions
#### `base/configure/os` Directory
Files in here provide definitions that are shared by or specific to particular host and/or target architectures. Users should only need to modify the `CONFIG_SITE` files in this directory to configure the EPICS build.
```
CONFIG.<host>.<target> Specific host-target build definitions
CONFIG.Common.<target> Specific target definitions for all hosts
CONFIG.<host>.Common Specific host definitions for all targets
CONFIG.UnixCommon.Common Definitions for Unix hosts and all targets
CONFIG.Common.UnixCommon Definitions for Unix targets and all hosts
CONFIG.Common.vxWorksCommon Specific host definitions for all vx targets
CONFIG_SITE.<host>.<target> Site specific host-target definitions
CONFIG_SITE.Common.<target> Site specific target defs for all hosts
CONFIG_SITE.<host>.Common Site specific host defs for all targets
CONFIG.<host>.<target> Definitions for a specific host-target combination
CONFIG.Common.<target> Definitions for a specific target, any host
CONFIG.<host>.Common Definitions for a specific host, any target
CONFIG.UnixCommon.Common Definitions for Unix hosts, any target
CONFIG.Common.UnixCommon Definitions for Unix targets, any host
CONFIG.Common.RTEMS Definitions for all RTEMS targets, any host
CONFIG.Common.vxWorksCommon Definitions for all vxWorks targets, any host
CONFIG_SITE.<host>.<target> Local settings for a specific host-target combination
CONFIG_SITE.Common.<target> Local settings for a specific target, any host
CONFIG_SITE.<host>.Common Local settings for a specific host, any target
CONFIG_SITE.Common.RTEMS Local settings for all RTEMS targets, any host
CONFIG_SITE.Common.vxWorksCommon Local settings for all vxWorks targets, any host
```
### <span id="0_0_12">Building EPICS base (Unix and Win32)</span>
### Building EPICS base
#### Unpack file
@ -228,74 +254,79 @@ systems.
Files in the base/startup directory have been provided to help set
required path and other environment variables.
* `EPICS_HOST_ARCH`
Before you can build or use this EPICS base, the environment variable
`EPICS_HOST_ARCH` must be defined. A perl script EpicsHostArch.pl in
the base/startup directory has been provided to help set
`EPICS_HOST_ARCH.` You should have `EPICS_HOST_ARCH` set to your
host operating system followed by a dash and then your host
architecture, e.g. linux-x86_64. If you are not using the OS
vendor's c/c++ compiler for host builds, you will need another dash
followed by the alternate compiler name (e.g. "-gnu" for GNU c/c++
compilers on a solaris host or "-mingw" for MinGW c/c++ compilers on
Windows). See `configure/CONFIG_SITE` for a list of supported
`EPICS_HOST_ARCH` values.
* **`EPICS_HOST_ARCH`**
* `PATH`
As already mentioned, you must have the perl executable and you may
need C and C++ compilers in your search path. For building base you
also must have echo in your search path. For Unix host builds you
also need ln, cpp, cp, rm, mv, and mkdir in your search path and
/bin/chmod must exist. On some Unix systems you may also need ar and
ranlib in your path, and the C compiler may require as and ld in
your path. On solaris systems you need uname in your path.
Some host builds of EPICS require that the environment variable
`EPICS_HOST_ARCH` be defined. The perl script `EpicsHostArch.pl` in the
`base/startup` directory prints the value which the build will use if
the variable is not set before the build starts. Architecture names
start with the operating system followed by a dash and the host CPU
architecture, e.g. `linux-x86_64`. Some architecture names have another
dash followed by another keyword, for example when building for Windows
but using the MinGW compiler the name must be `windows-x64-mingw`. See
`configure/CONFIG_SITE` for a list of supported host architecture names.
* `LD_LIBRARY_PATH`
EPICS shared libraries and executables normally contain the full
path to any libraries they require. However, if you move the EPICS
files or directories from their build-time location then in order
for the shared libraries to be found at runtime `LD_LIBRARY_PATH`
must include the full pathname to
`$(INSTALL_LOCATION)/lib/$(EPICS_HOST_ARCH)` when invoking
executables, or some equivalent OS-specific mechanism (such as
/etc/ld.so.conf on Linux) must be used. Shared libraries are now
built by default on all Unix type hosts.
* **`PATH`**
As already mentioned, you must have the `perl` executable and you may
need C and C++ compilers in your search path. When building base you
must have `echo` in your search path. For Unix host builds you will
also need `cp`, `rm`, `mv`, and `mkdir` in your search path. Some Unix
systems may also need `ar` and `ranlib`, and the C/C++ compilers may
require `as` and `ld` in your path. On Solaris systems you need
`uname` in your path.
#### Do site-specific build configuration
* **`LD_LIBRARY_PATH`**
EPICS shared libraries and executables normally contain the full path
to any libraries they require, so setting this variable is not usually
necessary. However, if you move the EPICS installation to a new
location after building it then in order for the shared libraries to
be found at runtime it may need to be set, or some equivalent
OS-specific mechanism such as `/etc/ld.so.conf` on Linux must be used.
Shared libraries are now built by default on all Unix type hosts.
**Site configuration**
To configure EPICS, you may want to modify the default definitions
in the following files:
### Site-specific build configuration
#### Site configuration
To configure EPICS, you may want to modify some values set in the
following files:
>>>>>>> mirror/3.15
```
configure/CONFIG_SITE Build choices. Specify target archs.
configure/CONFIG_SITE Build settings. Specify target archs.
configure/CONFIG_SITE_ENV Environment variable defaults
configure/RELEASE TORNADO2 full path location
```
**Host configuration**
To configure each host system, you may override the default
definitions by adding a new file in the configure/os directory with
override definitions. The new file should have the same name as the
distribution file to be overridden except with CONFIG in the name
changed to `CONFIG_SITE`.
#### Host configuration
To configure each host system, you can override the default
definitions by adding a new settings file (or editing an existing
settings file) in the `configure/os` directory with your override
definitions. The settings file has the same name as the definitions
file to be overridden except with `CONFIG` in the name changed to
`CONFIG_SITE`.
```
configure/os/CONFIG.<host>.<host> Host build settings
configure/os/CONFIG.<host>.Common Host common build settings
configure/os/CONFIG.<host>.<host> Host self-build definitions
configure/os/CONFIG.<host>.Common Host common build definitions
configure/os/CONFIG_SITE.<host>.<host> Host self-build overrides
configure/os/CONFIG_SITE.<host>.Common Host common build overrides
```
**Target configuration**
#### Target configuration
To configure each target system, you may override the default
definitions by adding a new file in the configure/os directory with
override definitions. The new file should have the same name as the
distribution file to be overridden except with CONFIG in the name
replaced by `CONFIG_SITE`. This step is necessary even if the host
system is the only target system.
definitions by adding a new settings file (or editing an existing
settings file) in the `configure/os` directory with your override
definitions. The settings file has the same name as the definitions
file to be overridden except with `CONFIG` in the name changed to
`CONFIG_SITE`.
```
configure/os/CONFIG.Common.<target> Target common settings
configure/os/CONFIG.<host>.<target> Host-target settings
configure/os/CONFIG.Common.<target> Target common definitions
configure/os/CONFIG.<host>.<target> Host-target definitions
configure/os/CONFIG_SITE.Common.<target> Target common overrides
configure/os/CONFIG_SITE.<host>.<target> Host-target overrides
```
#### Build EPICS base
@ -305,24 +336,29 @@ by issuing the following commands in the distribution's root
directory (base):
```
gnumake clean uninstall
gnumake
make distclean
make
```
The command "gnumake clean uninstall" will remove all files and
directories generated by a previous build. The command "gnumake"
The command `make distclean` will remove all files and
directories generated by a previous build. The command `make`
will build and install everything for the configured host and
targets.
It is recommended that you do a "gnumake clean uninstall" at the
It is recommended that you do a `make distclean` at the
root directory of an EPICS directory structure before each complete
rebuild to ensure that all components will be rebuilt.
### <span id="0_0_13">Example application and extension</span>
In some cases GNU Make may have been installed as `gmake` or
`gnumake`, in which case the above commands will have to be adjusted
to match.
A perl tool, makeBaseApp.pl is included in the distribution file. This
script will create a sample application that can be built and then
executed to try out this release of base.
### Example application and extension
A perl tool `makeBaseApp.pl` and several template applications are
included in the distribution. This script instantiates the selected
template into an empty directory to provide an example application
that can be built and then executed to try out this release of base.
Instructions for building and executing the EPICS example application
can be found in the section "Example Application" of Chapter 2,
@ -335,26 +371,30 @@ application as a host-based IOC, you will be able to quickly implement
a complete EPICS system and be able to run channel access clients on
the host system.
A perl script, makeBaseExt.pl, is included in the distribution file.
This script will create a sample extension that can be built and
executed. The makeBaseApp.pl and makeBaseExt.pl scripts are installed
into the install location `bin/<hostarch>` directory during the base
build.
Another perl script `makeBaseExt.pl` is also included in the
distribution file for creating an extensions tree and sample
application that can also be built and executed. Both these scripts
are installed into the install location `bin/<hostarch>` directory
during the base build.
### <span id="0_0_14">Multiple host platforms</span>
### Multiple host platforms
You can build using a single EPICS directory structure on multiple
host systems and for multiple cross target systems. The intermediate
and binary files generated by the build will be created in separate
subdirectories and installed into the appropriate separate host/target
install directories. EPICS executables and perl scripts are installed
into the `$(INSTALL_LOCATION)/bin/<arch>` directories. Libraries are
installed into $`(INSTALL_LOCATION)/lib/<arch>`. The default
definition for `$(INSTALL_LOCATION)` is `$(TOP)` which is the root
directory in the distribution directory structure, base. Created
object files are stored in `O.<arch>` source subdirectories, This
allows objects for multiple cross target architectures to be
maintained at the same time. To build EPICS base for a specific
install directories.
EPICS executables and perl scripts are installed into the
`$(INSTALL_LOCATION)/bin/<arch>` directories. Libraries are installed
into $`(INSTALL_LOCATION)/lib/<arch>`. The default definition for
`$(INSTALL_LOCATION)` is `$(TOP)` which is the root directory in the
distribution directory structure, `base`. Intermediate object files
are stored in `O.<arch>` source subdirectories during the build
process, to allow objects for multiple cross target architectures
to be maintained at the same time.
To build EPICS base for a specific
host/target combination you must have the proper host/target C/C++
cross compiler and target header files and the base/configure/os
directory must have the appropriate configure files.

View File

@ -2,20 +2,136 @@
These release notes describe changes that have been made since the previous
release of this series of EPICS Base. **Note that changes which were merged up
from commits to new releases in an older Base series are not described at the
top of this file but have entries that appear lower down, under the series to
which they were originally committed.** Thus it is important to read more than
just the first section to understand everything that has changed in each
release.
from commits to the 3.15 branch are not described at the top of this file but
lower down, under the 3.15 release to which they were originally committed.**
Thus it is important to read more than just the first section to understand
everything that has changed in each release.
The PVA submodules each have their own individual sets of release notes which
should also be read to understand what has changed since earlier releases.
**This version of EPICS has not been released yet.**
## Changes made on the 7.0 branch since 7.0.5
## EPICS Release 7.0.6
<!-- Insert new items immediately below here ... -->
### Support for obsolete architectures removed
These target architectures have been removed:
+ darwin-ppc, darwin-ppcx86
+ linux-386, linux-486, linux-586, linux-686, linux-athlon (cross-build)
+ linux-cris, linux-cris_v10, linux-cris_v32 (cross-build)
+ RTEMS-at91rm9200ek, RTEMS-gen68360, RTEMS-mcp750, RTEMS-mvme167,
RTEMS-psim (cross-build)
### Experimental Support for RTEMS 5
The new major release of the RTEMS real-time OS contains many changes
including the ability to support SMP systems. This release of EPICS
can still be built with RTEMS 4.9.x or 4.10.x and should work just
the same as earlier releases, although due to code having moved around
we recommend thorough testing before this release is first used in
production systems.
This release of EPICS comes with support for several new RTEMS targets
running on RTEMS 5:
- RTEMS-beagleboneblack
- RTEMS-pc686
- RTEMS-qoriq_e500 (MVME2500)
- RTEMS-xilinx_zynq_a9_qemu
- RTEMS-xilinx_zynq_zedboard
The EPICS support for RTEMS 4 has always relied on RTEMS-specific
kernel APIs which cannot be used on an SMP system, so a new port was
created to use the Posix real-time APIs that are now recommended for
RTEMS 5. Note that a single installation of EPICS cannot build both
RTEMS 4 and RTEMS 5 targets, if you need to support targets running
on both versions you must use a separate installation, and be sure
to run `make distclean` if switching a single source tree from one
to the other (both header files and dependency files are different
between the two and must be cleaned out).
The configuration variable RTEMS_VERSION in the EPICS config file
`configure/os/CONFIG_SITE.Common.RTEMS` must be set to the full 3-
part version number for RTEMS 4 releases, e.g. `4.9.1`, `4.10.2`
but for RTEMS 5.1 and later it must only contain the major version
number e.g. `5`.
Some RTEMS BSPs can be built and may work with the newer libbsd
network stack which RTEMS is moving over to, but most of the MVME
boards (and the uC5282) still require the legacy network stack.
The dependency on bspExt has been removed, EPICS now provides its
own routine for VMEbus probing (or uses one built into the BSP).
Anyone using this release on RTEMS is advised to discuss problems
building or running it on either the tech-talk or core-talk email
lists so the core developers can help with and find out about any
problems with the old or new port.
Known Issues:
- MVME2100 and MVME2700 need changes to the RTEMS 5 BSP to build.
- VMEBus support is not yet available for the MVME2500 BSP.
- There are some known issues with floating point on MVME2500,
probably related to its newer e500 FPU.
- Changed network driver for beatnik to work with libbsd. Some
issues with DHCP, but network stack usable. Can load env from
NVRAM.
### `epicsEnvShow` accepts a glob pattern
The optional argument to epicsEnvShow can now be a glob pattern.
### New function `epicsStrnGlobMatch()`
The function `epicsStrnGlobMatch(char* str, size_t len, char* pattern)`
works exactly the same as `epicsStrGlobMatch()` but takes an additional
length arguments which limits the number of characters of `str` to match.
### Automatic fallback to thread when unable to exec caRepeater
A process using libca which does not find an existing caRepeater process
will attempt to start one by running the caRepeater executable.
This is not always possible, usually when caRepeater is not in `$PATH`.
Now, instead of printing a warning, an internal caRepeater thread
will be started (as is done be RTEMS and vxWorks targets).
If this fallback occurs, the lifetime of the caRepeater thread
may be shorter than the lifetime of a separate caRepeater process
would have been.
It remains the recommended practice to explicitly start a caRepeater
instance. Examples of both systemd (`caRepeater.service`) and sysv
(`S99caRepeater`) scripts may be found under `bin/`.
### Glob pattern allowed in `var` command
When used with one argument, the `var` command can be used with a glob pattern
for printing matching variables.
### Formalize/fix `FINAL_LOCATION`
The `FINAL_LOCATION` make variable has for some time been an undocumented
means of performing a staged build. This is a build which "installs" to
a temporary location, which will later be moved to a final location.
This has now been added to `configure/CONFIG_SITE`.
Usage analogous to the autotools recipe
```sh
./configure --prefix=/usr/lib/epics
make install DESTDIR=/tmp/build
```
would be
```sh
make INSTALL_LOCATION=/tmp/build FINAL_LOCATION=/usr/lib/epics
```
`FINAL_LOCATION` is now correctly used in systemd and sysv init scripts
`caRepeater.service`, `S99caRepeater`, and `S99logServer`.
### epicsEnvShow accepts glob pattern
@ -49,6 +165,116 @@ checking for and initializing the link in their `special()` routine.
IOC shell will now ensure `${PWD}` is set on startup,
and updated by the `cd` iocsh function.
### Add Alarm Message and Time Tag Fields
Two new fields have been added to `dbCommon` so will be present in all
records: `AMSG` and `UTAG`.
#### `AMSG`
`AMSG` can hold an arbitrary 40-character string, providing additional
information about the alarm condition indicated in `STAT` and `SEVR`. With no
alarm it will hold an empty string. The new `recGblSetSevrMsg()` function can
be used in place of `recGblSetSevr()` to signal an alarm while providing a
message.
For example, a device support's `read_bi()` routine for a hypothetical
multi-channel ethernet attached device might flag a communication error
between the IOC and controller, or an error involving a certain channel like
this:
```c
static long read_bi(biRecord* prec) {
...
if (!priv->connected) {
recGblSetSevrMsg(prec, COMM_ALARM, INVALID_ALARM,
"No controller connected");
return S_dev_noDevice;
}
if (!priv->err) {
recGblSetSevrMsg(prec, READ_ALARM, INVALID_ALARM,
"Channel %u disconnexted", priv->chan);
return S_dev_noDevice;
}
return status;
}
```
#### `UTAG`
`UTAG` holds an `epicsUInt64` value which is semantically part of the record's
timestamp (`TIME`). The value defaults to zero if not explicitly set. Device
support or an event time provider which supports this feature may write a tag
value directly to the `dbCommon::utag` field.
`TSEL` links will copy both `TIME` and `UTAG` between records if the link type
supports this (CA links do not).
A `utag` server side channel filter has been added which can be configured to
filter out monitor updates which don't pass the test `(UTAG & M) == V` where
`M` and `V` are client specified integers. For example running the command
`camonitor BPM0:X.{utag:{M:1,V:1}}` will only show updates for which
`(UTAG & 1) == 1` i.e. the least significant bit of the `UTAG` field is set.
This feature is intended for use by intelligent devices which can provide
contextual information along with a value/alarm/time. For example, a beam
diagnostic device which is aware of whether a beam signal should be present
(eg. from a global timing system).
#### Link Support
Two new optional methods have been added to the Link Support Entry Table
(`struct lset`): `lset::getAlarmMsg()` and `lset::getTimeStampTag()`. See
comments in dbLink.h for details on implementing these.
Two new accessor functions have also been added which call these methods:
`dbGetAlarmMsg()` and `dbGetTimeStampTag()`.
#### Compatibility
User code wishing to call these interfaces while maintaining compatibility with older
versions of Base may add some of the following macro definitions, and ensure
that the variables referenced by output pointers are initialized.
```c
#ifndef HAS_ALARM_MESSAGE
# define recGblSetSevrMsg(REC, STAT, SEVR, ...) recGblSetSevr(REC, STAT, SEVR)
#endif
#ifndef dbGetAlarmMsg
# define dbGetAlarmMsg(LINK, STAT, SEVR, BUF, BUFLEN) dbGetAlarm(LINK, STAT, SEVR)
#endif
#ifndef dbGetTimeStampTag
# define dbGetTimeStampTag(LINK, STAMP, TAG) dbGetTimeStamp(LINK, STAMP)
#endif
```
### Timeouts for Unit Test Programs
The unit test programs that are run by the `make runtests` or `make tapfiles`
commands get executed by a `.t` wrapper script which is normally generated by
the EPICS `makeTestfile.pl` program. Those generated wrapper scripts now
impose a time-limit on the test program they execute, and will kill it if it
runs for longer than 500 seconds (8 minutes 20) without exiting. That
time-limit can be changed for any such test by modifying the Makefile which
creates and runs the `.t` wrapper script.
Setting the environment variable `EPICS_UNITTEST_TIMEOUT` to the desired
number of seconds while the Makefile is generating the test script changes the
timeout in that script. For example:
```
TESTSCRIPTS_HOST += hourLongTest.t
hourLongTest.t: export EPICS_UNITTEST_TIMEOUT=3600
```
When selecting such a timeout remember that different Continuous Integration
systems such as GitHub Actions and Appveyor run on processors with different
speeds, so allow enough head-room for slower systems to complete the test.
Test programs written directly in Perl as a `.plt` script should implement a
similar timeout for themselves. The "netget" test in Base does this in a way
that works on Windows as well as Unix-like hosts.
### Timeouts for Unit Test Programs
@ -1747,7 +1973,36 @@ header and removed the need for dbScan.c to reach into the internals of its
# Changes incorporated from the 3.15 branch
## Changes made on the 3.15 branch since 3.15.8
## Changes from the 3.15 branch since 3.15.9
## Changes made between 3.15.8 and 3.15.9
### Use waitable timers on Microsoft Windows
The `epicsEventWaitWithTimeout()` and `epicsThreadSleep()` functions have
been changed to use waitable timers. On Windows 10 version 1803 or higher
they will use high resolution timers for more consistent timing.
See [this Google Groups thread](https://groups.google.com/a/chromium.org/g/scheduler-dev/c/0GlSPYreJeY)
for a comparison of the performance of different timers.
### Build target for documentation
The build target `inc` now works again after a very long hiatus. It now
generates and installs just the dbd, header and html files, without compiling
any C/C++ code. This can be used to speed up CI jobs that only generate
documentation.
### Bug fixes
- The error status returned by a record support's `special()` method is now propagated out of the `dbPut()` routine again (broken since 3.15.0).
- [gh: #80](https://github.com/epics-base/epics-base/issues/80), VS-2015 and
later have working strtod()
- [lp: #1776141](https://bugs.launchpad.net/epics-base/+bug/1776141), Catch
buffer overflow from long link strings
- [lp: #1899697](https://bugs.launchpad.net/epics-base/+bug/1899697), Records
in wrong PHAS order
### Change to the `junitfiles` self-test build target
@ -1755,7 +2010,9 @@ The names of the generated junit xml test output files have been changed
from `<testname>.xml` to `<testname>-results.xml`, to allow better
distinction from other xml files. (I.e., for easy wildcard matching.)
-----
### Fixes and code cleanups
Issues reported by various static code checkers.
## Changes made between 3.15.7 and 3.15.8

View File

@ -113,7 +113,7 @@ SCRIPTS_Linux = caRepeater.service
EXPAND += S99caRepeater@
EXPAND += caRepeater.service@
EXPAND_VARS = INSTALL_BIN=$(abspath $(INSTALL_BIN))
EXPAND_VARS = INSTALL_BIN=$(FINAL_LOCATION)/bin/$(T_A)
SRC_DIRS += $(CURDIR)/test
PROD_HOST += ca_test

View File

@ -17,6 +17,9 @@
#ifndef INC_caProto_H
#define INC_caProto_H
// Pick up definition of IPPORT_USERRESERVED
#include <osiSock.h>
#define capStrOf(A) #A
#define capStrOfX(A) capStrOf ( A )

View File

@ -90,7 +90,7 @@ int main(int argc, char* argv[])
(void)detachinout;
#endif
chdir ( "/" );
(void)! chdir ( "/" );
ca_repeater ();
return ( 0 );
}

View File

@ -629,8 +629,8 @@ void epicsStdCall caStartRepeaterIfNotInstalled ( unsigned repeaterPort )
* repeater's port)
*/
osiSpawnDetachedProcessReturn osptr =
osiSpawnDetachedProcess ( "CA Repeater", "caRepeater" );
if ( osptr == osiSpawnDetachedProcessNoSupport ) {
osiSpawnDetachedProcess ( "!CA Repeater", "caRepeater" );
if ( osptr != osiSpawnDetachedProcessSuccess ) {
epicsThreadId tid;
tid = epicsThreadCreate ( "CAC-repeater", epicsThreadPriorityLow,
@ -639,9 +639,6 @@ void epicsStdCall caStartRepeaterIfNotInstalled ( unsigned repeaterPort )
fprintf ( stderr, "caStartRepeaterIfNotInstalled : unable to create CA repeater daemon thread\n" );
}
}
else if ( osptr == osiSpawnDetachedProcessFail ) {
fprintf ( stderr, "caStartRepeaterIfNotInstalled (): unable to start CA repeater daemon detached process\n" );
}
}
}

View File

@ -606,12 +606,12 @@ void CA_put(SV *ca_ref, SV *val, ...) {
}
} else {
union {
void *dbr;
dbr_char_t *dbr_char;
dbr_long_t *dbr_long;
dbr_double_t *dbr_double;
char *dbr_string;
void *dbr;
} p;
} p = {0};
int i;
chtype type = best_type(pch);
@ -699,12 +699,12 @@ void CA_put_callback(SV *ca_ref, SV *sub, SV *val, ...) {
}
} else {
union {
void *dbr;
dbr_char_t *dbr_char;
dbr_long_t *dbr_long;
dbr_double_t *dbr_double;
char *dbr_string;
void *dbr;
} p;
} p = {0};
int i;
chtype type = best_type(pch);

View File

@ -360,6 +360,16 @@ static void getOptions(DBADDR *paddr, char **poriginal, long *options,
*pushort++ = pcommon->ackt;
pbuffer = (char *)pushort;
}
if( (*options) & DBR_AMSG ) {
if (!pfl) {
STATIC_ASSERT(sizeof(pcommon->amsg)==sizeof(pfl->amsg));
strncpy(pbuffer, pcommon->amsg, sizeof(pcommon->amsg)-1);
} else {
strncpy(pbuffer, pfl->amsg,sizeof(pfl->amsg)-1);
}
pbuffer[sizeof(pcommon->amsg)-1] = '\0';
pbuffer += sizeof(pcommon->amsg);
}
if( (*options) & DBR_UNITS ) {
memset(pbuffer,'\0',dbr_units_size);
if( prset && prset->get_units ){
@ -392,6 +402,15 @@ static void getOptions(DBADDR *paddr, char **poriginal, long *options,
}
pbuffer = (char *)ptime;
}
if( (*options) & DBR_UTAG ) {
epicsUInt64 *ptag = (epicsUInt64*)pbuffer;
if (!pfl) {
*ptag++ = pcommon->utag;
} else {
*ptag++ = pfl->utag;
}
pbuffer = (char *)ptag;
}
if( (*options) & DBR_ENUM_STRS )
get_enum_strs(paddr, &pbuffer, prset, options);
if( (*options) & (DBR_GR_LONG|DBR_GR_DOUBLE ))
@ -523,7 +542,7 @@ long dbProcess(dbCommon *precord)
(precord->lcnt++ < MAX_LOCK) ||
(precord->sevr >= INVALID_ALARM)) goto all_done;
recGblSetSevr(precord, SCAN_ALARM, INVALID_ALARM);
recGblSetSevrMsg(precord, SCAN_ALARM, INVALID_ALARM, "Async in progress");
monitor_mask = recGblResetAlarms(precord);
monitor_mask |= DBE_VALUE|DBE_LOG;
pdbFldDes = pdbRecordType->papFldDes[pdbRecordType->indvalFlddes];
@ -1385,7 +1404,8 @@ long dbPut(DBADDR *paddr, short dbrType,
/* Always do special processing if needed */
if (special) {
long status2 = dbPutSpecial(paddr, 1);
if (status2) goto done;
if (status2)
status = status2;
}
if (status) goto done;

View File

@ -33,16 +33,18 @@ DBCORE_API extern int dbAccessDebugPUTF;
/* The database field and request types are defined in dbFldTypes.h*/
/* Data Base Request Options */
#define DBR_STATUS 0x00000001
#define DBR_UNITS 0x00000002
#define DBR_PRECISION 0x00000004
#define DBR_TIME 0x00000008
#define DBR_ENUM_STRS 0x00000010
#define DBR_GR_LONG 0x00000020
#define DBR_GR_DOUBLE 0x00000040
#define DBR_CTRL_LONG 0x00000080
#define DBR_CTRL_DOUBLE 0x00000100
#define DBR_AL_LONG 0x00000200
#define DBR_AL_DOUBLE 0x00000400
#define DBR_AMSG 0x00000002
#define DBR_UNITS 0x00000004
#define DBR_PRECISION 0x00000008
#define DBR_TIME 0x00000010
#define DBR_UTAG 0x00000020
#define DBR_ENUM_STRS 0x00000040
#define DBR_GR_LONG 0x00000080
#define DBR_GR_DOUBLE 0x00000100
#define DBR_CTRL_LONG 0x00000200
#define DBR_CTRL_DOUBLE 0x00000400
#define DBR_AL_LONG 0x00000800
#define DBR_AL_DOUBLE 0x00001000
/**********************************************************************
* The next page contains macros for defining requests.
@ -100,6 +102,9 @@ DBCORE_API extern int dbAccessDebugPUTF;
epicsUInt16 severity; /* alarm severity*/\
epicsUInt16 acks; /* alarm ack severity*/\
epicsUInt16 ackt; /* Acknowledge transient alarms?*/
#define DB_AMSG_SIZE 40
#define DBRamsg \
char amsg[DB_AMSG_SIZE];
#define DB_UNITS_SIZE 16
#define DBRunits \
char units[DB_UNITS_SIZE]; /* units */
@ -113,6 +118,8 @@ DBCORE_API extern int dbAccessDebugPUTF;
* maintain 8-byte alignment. */
#define DBRtime \
epicsTimeStamp time; /* time stamp*/
#define DBRutag \
epicsUTag utag;
#define DBRenumStrs \
epicsUInt32 no_str; /* number of strings*/\
epicsInt32 padenumStrs; /*padding to force 8 byte align*/\

View File

@ -279,6 +279,11 @@ support routines which write to the VAL field are responsible for setting UDF.
special(SPC_NOMOD)
menu(menuAlarmSevr)
}
field(AMSG,DBF_STRING) {
prompt("Alarm Message")
special(SPC_NOMOD)
size(40)
}
field(NSTA,DBF_MENU) {
prompt("New Alarm Status")
special(SPC_NOMOD)
@ -291,6 +296,11 @@ support routines which write to the VAL field are responsible for setting UDF.
interest(2)
menu(menuAlarmSevr)
}
field(NAMSG,DBF_STRING) {
prompt("New Alarm Message")
special(SPC_NOMOD)
size(40)
}
field(ACKS,DBF_MENU) {
prompt("Alarm Ack Severity")
special(SPC_NOMOD)
@ -514,6 +524,11 @@ field which is then used to acquire a timestamp.
interest(2)
extra("epicsTimeStamp time")
}
field(UTAG,DBF_UINT64) {
prompt("Time Tag")
special(SPC_NOMOD)
interest(3)
}
field(FLNK,DBF_FWDLINK) {
prompt("Forward Process Link")
promptgroup("20 - Scan")

View File

@ -337,8 +337,8 @@ static long dbDbGetUnits(const struct link *plink, char *units, int unitsSize)
return 0;
}
static long dbDbGetAlarm(const struct link *plink, epicsEnum16 *status,
epicsEnum16 *severity)
static long dbDbGetAlarmMsg(const struct link *plink, epicsEnum16 *status,
epicsEnum16 *severity, char *msgbuf, size_t msgbuflen)
{
dbChannel *chan = linkChannel(plink);
dbCommon *precord = dbChannelRecord(chan);
@ -346,14 +346,20 @@ static long dbDbGetAlarm(const struct link *plink, epicsEnum16 *status,
*status = precord->stat;
if (severity)
*severity = precord->sevr;
if (msgbuf && msgbuflen) {
strncpy(msgbuf, precord->amsg, msgbuflen-1);
msgbuf[msgbuflen-1] = '\0';
}
return 0;
}
static long dbDbGetTimeStamp(const struct link *plink, epicsTimeStamp *pstamp)
static long dbDbGetTimeStampTag(const struct link *plink, epicsTimeStamp *pstamp, epicsUTag *ptag)
{
dbChannel *chan = linkChannel(plink);
dbCommon *precord = dbChannelRecord(chan);
*pstamp = precord->time;
if(ptag)
*ptag = precord->utag;
return 0;
}
@ -401,9 +407,11 @@ static lset dbDb_lset = {
dbDbGetValue,
dbDbGetControlLimits, dbDbGetGraphicLimits, dbDbGetAlarmLimits,
dbDbGetPrecision, dbDbGetUnits,
dbDbGetAlarm, dbDbGetTimeStamp,
NULL, NULL,
dbDbPutValue, NULL,
dbDbScanFwdLink, doLocked
dbDbScanFwdLink, doLocked,
dbDbGetAlarmMsg,
dbDbGetTimeStampTag,
};

View File

@ -84,6 +84,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 */
@ -122,6 +123,8 @@ static char *EVENT_PEND_NAME = "eventTask";
static struct evSubscrip canceledEvent;
static epicsMutexId stopSync;
static unsigned short ringSpace ( const struct event_que *pevq )
{
if ( pevq->evque[pevq->putix] == EVENTQEMPTY ) {
@ -260,6 +263,10 @@ int dbel ( const char *pname, unsigned level )
*/
void db_init_event_freelists (void)
{
if (!stopSync) {
stopSync = epicsMutexMustCreate();
}
if (!dbevEventUserFreeList) {
freeListInitPvt(&dbevEventUserFreeList,
sizeof(struct event_user),8);
@ -299,6 +306,9 @@ dbEventCtx db_init_events (void)
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)
@ -313,6 +323,9 @@ dbEventCtx db_init_events (void)
evUser->lock = epicsMutexCreate();
if (!evUser->lock)
goto fail;
evUser->pexitsem = epicsEventCreate(epicsEventEmpty);
if (!evUser->pexitsem)
goto fail;
evUser->flowCtrlMode = FALSE;
evUser->extraLaborBusy = FALSE;
@ -327,6 +340,8 @@ fail:
epicsEventDestroy (evUser->ppendsem);
if(evUser->pflush_sem)
epicsEventDestroy (evUser->pflush_sem);
if(evUser->pexitsem)
epicsEventDestroy (evUser->pexitsem);
freeListFree(dbevEventUserFreeList,evUser);
return NULL;
}
@ -347,6 +362,7 @@ DBCORE_API void db_cleanup_events(void)
dbevFieldLogFreeList = NULL;
}
/* intentionally leak stopSync to avoid possible shutdown races */
/*
* DB_CLOSE_EVENTS()
*
@ -368,15 +384,31 @@ void 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);
if(evUser->taskid)
/* wait for task to exit */
epicsEventMustWait(evUser->pexitsem);
epicsThreadMustJoin(evUser->taskid);
/* evUser has been deleted by the worker */
epicsMutexMustLock ( evUser->lock );
}
epicsMutexUnlock ( evUser->lock );
epicsMutexMustLock (stopSync);
epicsEventDestroy(evUser->pexitsem);
epicsEventDestroy(evUser->ppendsem);
epicsEventDestroy(evUser->pflush_sem);
epicsMutexDestroy(evUser->lock);
epicsMutexUnlock (stopSync);
freeListFree(dbevEventUserFreeList, evUser);
}
/*
@ -675,7 +707,10 @@ static db_field_log* db_create_field_log (struct dbChannel *chan, int use_val)
struct dbCommon *prec = dbChannelRecord(chan);
pLog->stat = prec->stat;
pLog->sevr = prec->sevr;
strncpy(pLog->amsg, prec->amsg, sizeof(pLog->amsg)-1);
pLog->amsg[sizeof(pLog->amsg)-1] = '\0';
pLog->time = prec->time;
pLog->utag = prec->utag;
pLog->field_type = dbChannelFieldType(chan);
pLog->field_size = dbChannelFieldSize(chan);
pLog->no_elements = dbChannelElements(chan);
@ -1060,18 +1095,17 @@ static void event_task (void *pParm)
}
}
epicsEventDestroy(evUser->ppendsem);
epicsEventDestroy(evUser->pflush_sem);
epicsMutexDestroy(evUser->lock);
if (dbevEventUserFreeList)
freeListFree(dbevEventUserFreeList, evUser);
else
fprintf(stderr, "%s exiting but dbevEventUserFreeList already NULL\n",
__FUNCTION__);
taskwdRemove(epicsThreadGetIdSelf());
/* use stopSync to ensure pexitsem is not destroy'd
* until epicsEventSignal() has returned.
*/
epicsMutexMustLock (stopSync);
epicsEventSignal(evUser->pexitsem);
epicsMutexUnlock(stopSync);
return;
}
@ -1111,6 +1145,7 @@ int db_start_events (
epicsMutexUnlock ( evUser->lock );
return DB_EVENT_ERROR;
}
evUser->pendexit = FALSE;
epicsMutexUnlock ( evUser->lock );
return DB_EVENT_OK;
}

View File

@ -313,10 +313,16 @@ long dbTryGetLink(struct link *plink, short dbrType, void *pbuffer,
return plset->getValue(plink, dbrType, pbuffer, pnRequest);
}
static
void setLinkAlarm(struct link* plink)
{
recGblSetSevrMsg(plink->precord, LINK_ALARM, INVALID_ALARM,
"field %s", dbLinkFieldName(plink));
}
long dbGetLink(struct link *plink, short dbrType, void *pbuffer,
long *poptions, long *pnRequest)
{
struct dbCommon *precord = plink->precord;
long status;
if (poptions && *poptions) {
@ -328,7 +334,7 @@ long dbGetLink(struct link *plink, short dbrType, void *pbuffer,
if (status == S_db_noLSET)
return -1;
if (status)
recGblSetSevr(precord, LINK_ALARM, INVALID_ALARM);
setLinkAlarm(plink);
return status;
}
@ -386,23 +392,41 @@ long dbGetUnits(const struct link *plink, char *units, int unitsSize)
long dbGetAlarm(const struct link *plink, epicsEnum16 *status,
epicsEnum16 *severity)
{
return dbGetAlarmMsg(plink, status, severity, NULL, 0);
}
long dbGetAlarmMsg(const struct link *plink, epicsEnum16 *status,
epicsEnum16 *severity, char *msgbuf, size_t msgbuflen)
{
lset *plset = plink->lset;
if (!plset || !plset->getAlarm)
return S_db_noLSET;
if (plset && plset->getAlarmMsg) {
return plset->getAlarmMsg(plink, status, severity, msgbuf, msgbuflen);
} else if(plset && plset->getAlarm) {
return plset->getAlarm(plink, status, severity);
} else {
return S_db_noLSET;
}
}
long dbGetTimeStamp(const struct link *plink, epicsTimeStamp *pstamp)
{
return dbGetTimeStampTag(plink, pstamp, NULL);
}
long dbGetTimeStampTag(const struct link *plink,
epicsTimeStamp *pstamp, epicsUTag *ptag)
{
lset *plset = plink->lset;
if (!plset || !plset->getTimeStamp)
return S_db_noLSET;
if (plset && plset->getTimeStampTag) {
return plset->getTimeStampTag(plink, pstamp, ptag);
} else if(plset && plset->getTimeStamp) {
return plset->getTimeStamp(plink, pstamp);
} else {
return S_db_noLSET;
}
}
long dbPutLink(struct link *plink, short dbrType, const void *pbuffer,
@ -416,9 +440,7 @@ long dbPutLink(struct link *plink, short dbrType, const void *pbuffer,
status = plset->putValue(plink, dbrType, pbuffer, nRequest);
if (status) {
struct dbCommon *precord = plink->precord;
recGblSetSevr(precord, LINK_ALARM, INVALID_ALARM);
setLinkAlarm(plink);
}
return status;
}
@ -443,9 +465,7 @@ long dbPutLinkAsync(struct link *plink, short dbrType, const void *pbuffer,
status = plset->putAsync(plink, dbrType, pbuffer, nRequest);
if (status) {
struct dbCommon *precord = plink->precord;
recGblSetSevr(precord, LINK_ALARM, INVALID_ALARM);
setLinkAlarm(plink);
}
return status;
}

View File

@ -361,6 +361,29 @@ typedef struct lset {
* @returns status value
*/
long (*doLocked)(struct link *plink, dbLinkUserCallback rtn, void *priv);
/** @brief Extended version of getAlarm
*
* Equivalent of getAlarm() and also copy out alarm message string.
* The msgbuf argument may be NULL and/or msgbuflen==0, in which case
* the effect must be the same as a call to getAlarm().
*
* Implementations must write a trailing nil to msgbuf whenever
* @code msgbuf!=NULL && msgbuflen>0 @endcode .
*
* @since 7.0.6
*/
long (*getAlarmMsg)(const struct link *plink, epicsEnum16 *status,
epicsEnum16 *severity, char *msgbuf, size_t msgbuflen);
/** @brief Extended version of getTimeStamp
*
* Equivalent of getTimeStamp() and also copy out time tag.
* ptag may be NULL.
*
* @since Added after 7.0.6
*/
long (*getTimeStampTag)(const struct link *plink, epicsTimeStamp *pstamp, epicsUTag *ptag);
} lset;
#define dbGetSevr(link, sevr) \
@ -402,8 +425,20 @@ DBCORE_API long dbGetUnits(const struct link *plink, char *units,
int unitsSize);
DBCORE_API long dbGetAlarm(const struct link *plink, epicsEnum16 *status,
epicsEnum16 *severity);
/** Get link alarm and message string.
* To ensure the complete message string is copied, ensure @code msgbuflen >= sizeof (dbCommon::amsg) @endcode .
* A trailing nil will be added whenever @code msgbuflen > 0 @endcode .
* @since 7.0.6
*/
DBCORE_API long dbGetAlarmMsg(const struct link *plink, epicsEnum16 *status,
epicsEnum16 *severity, char *msgbuf, size_t msgbuflen);
#define dbGetAlarmMsg(LINK, STAT, SEVR, BUF, BUFLEN) dbGetAlarmMsg(LINK, STAT, SEVR, BUF, BUFLEN)
DBCORE_API long dbGetTimeStamp(const struct link *plink,
epicsTimeStamp *pstamp);
/** @since 7.0.6 */
DBCORE_API long dbGetTimeStampTag(const struct link *plink,
epicsTimeStamp *pstamp, epicsUTag *ptag);
#define dbGetTimeStampTag(LINK, STAMP, TAG) dbGetTimeStampTag(LINK, STAMP, TAG)
DBCORE_API long dbPutLink(struct link *plink, short dbrType,
const void *pbuffer, long nRequest);
DBCORE_API void dbLinkAsyncComplete(struct link *plink);

View File

@ -266,7 +266,7 @@ done:
void testdbPutArrFieldOk(const char* pv, short dbrType, unsigned long count, const void *pbuf)
{
dbChannel *chan = dbChannelCreate(pv);
long status;
long status = -1;
if(!chan || (status=dbChannelOpen(chan))) {
testFail("Channel error (%p, %ld) : %s", chan, status, pv);
@ -289,7 +289,7 @@ void testdbGetArrFieldEqual(const char* pv, short dbfType, long nRequest, unsign
const long vSize = dbValueSize(dbfType);
const long nStore = vSize * nRequest;
long status = S_dbLib_recNotFound;
char *gbuf, *gstore;
char *gbuf, *gstore = NULL;
const char *pbuf = pbufraw;
if(!chan || (status=dbChannelOpen(chan))) {

View File

@ -113,8 +113,10 @@ typedef struct db_field_log {
unsigned char mask; /* DBE_* mask */
/* the following are used for value and reference types */
epicsTimeStamp time; /* Time stamp */
epicsUTag utag;
unsigned short stat; /* Alarm Status */
unsigned short sevr; /* Alarm Severity */
char amsg[40];
short field_type; /* DBF type of data */
short field_size; /* Size of a single element */
long no_elements; /* No of valid array elements */

View File

@ -24,6 +24,7 @@
#include "epicsMath.h"
#include "epicsPrint.h"
#include "epicsStdlib.h"
#include "epicsStdio.h"
#include "epicsTime.h"
#include "errlog.h"
@ -184,6 +185,11 @@ unsigned short recGblResetAlarms(void *precord)
if (new_sevr > INVALID_ALARM)
new_sevr = INVALID_ALARM;
if(strcmp(pdbc->namsg, pdbc->amsg)!=0) {
strcpy(pdbc->amsg, pdbc->namsg);
stat_mask = DBE_ALARM;
}
pdbc->stat = new_stat;
pdbc->sevr = new_sevr;
pdbc->nsta = 0;
@ -198,6 +204,7 @@ unsigned short recGblResetAlarms(void *precord)
}
if (stat_mask) {
db_post_events(pdbc, &pdbc->stat, stat_mask);
db_post_events(pdbc, &pdbc->amsg, stat_mask);
val_mask = DBE_ALARM;
if (!pdbc->ackt || new_sevr >= pdbc->acks) {
@ -211,18 +218,44 @@ unsigned short recGblResetAlarms(void *precord)
}
return val_mask;
}
int recGblSetSevrMsg(void *precord, epicsEnum16 new_stat,
epicsEnum16 new_sevr,
const char *msg, ...)
{
int ret;
va_list args;
va_start(args, msg);
ret = recGblSetSevrVMsg(precord, new_stat, new_sevr, msg, args);
va_end(args);
return ret;
}
int recGblSetSevr(void *precord, epicsEnum16 new_stat, epicsEnum16 new_sevr)
int recGblSetSevrVMsg(void *precord, epicsEnum16 new_stat,
epicsEnum16 new_sevr,
const char *msg, va_list args)
{
struct dbCommon *prec = precord;
if (prec->nsev < new_sevr) {
prec->nsta = new_stat;
prec->nsev = new_sevr;
if(msg) {
epicsVsnprintf(prec->namsg, sizeof(prec->namsg)-1, msg, args);
prec->namsg[sizeof(prec->namsg)-1] = '\0';
} else {
prec->namsg[0] = '\0';
}
prec->namsg[sizeof(prec->namsg)-1] = '\0';
return TRUE;
}
return FALSE;
}
int recGblSetSevr(void *precord, epicsEnum16 new_stat, epicsEnum16 new_sevr)
{
return recGblSetSevrMsg(precord, new_stat, new_sevr, NULL);
}
void recGblInheritSevr(int msMode, void *precord, epicsEnum16 stat,
epicsEnum16 sevr)
{
@ -271,7 +304,7 @@ void recGblGetTimeStampSimm(void *pvoid, const epicsEnum16 simm, struct link *si
if (!dbLinkIsConstant(plink)) {
if (plink->flags & DBLINK_FLAG_TSELisTIME) {
if (dbGetTimeStamp(plink, &prec->time))
if (dbGetTimeStampTag(plink, &prec->time, &prec->utag))
errlogPrintf("recGblGetTimeStamp: dbGetTimeStamp failed for %s.TSEL\n",
prec->name);
return;

View File

@ -15,6 +15,9 @@
#ifndef INCrecGblh
#define INCrecGblh 1
#include <stdarg.h>
#include "compilerDependencies.h"
#include "epicsTypes.h"
#include "dbCoreAPI.h"
@ -22,6 +25,14 @@
extern "C" {
#endif
/** Feature test macro for alarm message (AMSG) field and support
*
* Covers addition of dbCommon::amsg, recGblSetSevrMsg(), lset::getAlarmMsg()
*
* @since 7.0.6
*/
#define HAS_ALARM_MESSAGE 1
/*************************************************************************/
/* Structures needed for args */
@ -62,6 +73,12 @@ DBCORE_API int recGblSetSevr(void *precord, epicsEnum16 new_stat,
epicsEnum16 new_sevr);
DBCORE_API void recGblInheritSevr(int msMode, void *precord, epicsEnum16 stat,
epicsEnum16 sevr);
DBCORE_API int recGblSetSevrMsg(void *precord, epicsEnum16 new_stat,
epicsEnum16 new_sevr,
const char *msg, ...) EPICS_PRINTF_STYLE(4,5);
DBCORE_API int recGblSetSevrVMsg(void *precord, epicsEnum16 new_stat,
epicsEnum16 new_sevr,
const char *msg, va_list args);
DBCORE_API void recGblFwdLink(void *precord);
DBCORE_API void recGblGetTimeStamp(void *precord);
DBCORE_API void recGblGetTimeStampSimm(void *prec, const epicsEnum16 simm, struct link *siol);

View File

@ -63,7 +63,7 @@ static long read_lsi(lsiRecord *prec)
prec->val[0] = 0;
prec->len = 1;
prec->udf = TRUE;
recGblSetSevr(prec, UDF_ALARM, prec->udfs);
recGblSetSevrMsg(prec, UDF_ALARM, prec->udfs, "No such ENV");
}
return 0;
@ -114,7 +114,7 @@ static long read_stringin(stringinRecord *prec)
else {
prec->val[0] = 0;
prec->udf = TRUE;
recGblSetSevr(prec, UDF_ALARM, prec->udfs);
recGblSetSevrMsg(prec, UDF_ALARM, prec->udfs, "No such ENV");
}
return 0;

View File

@ -16,6 +16,7 @@ dbRecStd_SRCS += dbnd.c
dbRecStd_SRCS += arr.c
dbRecStd_SRCS += sync.c
dbRecStd_SRCS += decimate.c
dbRecStd_SRCS += utag.c
HTMLS += filters.html

View File

@ -16,6 +16,8 @@ The following filters are available in this release:
=item * L<Decimation|/"Decimation Filter dec">
=item * L<UTag|/"UTag Filter utag">
=back
=head2 Using Filters
@ -285,3 +287,26 @@ once every minute:
...
=cut
registrar(utagInitialize)
=head3 UTag Filter C<"utag">
This filter applies a test UTAG&M==V to the value taken from the UTAG record field
and drops those updates which evaluate as false.
=head4 Parameters
=over
=item Mask C<"M">
Bit mask.
=item Value C<"V">
Required value.
=back
=cut

View File

@ -0,0 +1,99 @@
/*************************************************************************\
* Copyright (c) 2020 Michael Davidsaver
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include <stdlib.h>
#include <caeventmask.h>
#include <chfPlugin.h>
#include <dbCommon.h>
#include <epicsStdio.h>
#include <epicsExport.h>
typedef struct {
epicsInt32 mask, value;
int first;
} utagPvt;
static const
chfPluginArgDef opts[] = {
chfInt32(utagPvt, mask, "M", 0, 1),
chfInt32(utagPvt, value, "V", 0, 1),
chfPluginArgEnd
};
static void * allocPvt(void)
{
utagPvt *pvt;
pvt = calloc(1, sizeof(utagPvt));
pvt->mask = 0xffffffff;
return pvt;
}
static void freePvt(void *pvt)
{
free(pvt);
}
static int parse_ok(void *raw)
{
utagPvt *pvt = (utagPvt*)raw;
pvt->first = 1;
return 0;
}
static db_field_log* filter(void* raw, dbChannel *chan, db_field_log *pfl)
{
utagPvt *pvt = (utagPvt*)raw;
epicsUTag utag = pfl->utag;
int drop = (utag&pvt->mask)!=pvt->value;
if(pfl->ctx!=dbfl_context_event || pfl->mask&DBE_PROPERTY) {
/* never drop for reads, or property events */
} else if(pvt->first) {
/* never drop first */
pvt->first = 0;
} else if(drop) {
db_delete_field_log(pfl);
pfl = NULL;
}
return pfl;
}
static void channelRegisterPre(dbChannel *chan, void *pvt,
chPostEventFunc **cb_out, void **arg_out, db_field_log *probe)
{
*cb_out = filter;
*arg_out = pvt;
}
static void channel_report(dbChannel *chan, void *raw, int level, const unsigned short indent)
{
utagPvt *pvt = (utagPvt*)raw;
printf("%*sutag : mask=0x%08x value=0x%08x\n", indent, "", (epicsUInt32)pvt->mask, (epicsUInt32)pvt->value);
}
static const
chfPluginIf pif = {
allocPvt,
freePvt,
NULL, /* parse_error */
parse_ok, /* parse_ok */
NULL, /* channel_open */
channelRegisterPre,
NULL, /* channelRegisterPost */
channel_report,
NULL, /* channel_close */
};
static
void utagInitialize(void)
{
chfPluginRegister("utag", &pif, opts);
}
epicsExportRegistrar(utagInitialize);

View File

@ -53,6 +53,7 @@ typedef struct calc_link {
} pstate;
epicsEnum16 stat;
epicsEnum16 sevr;
char amsg[DB_AMSG_SIZE];
short prec;
char *expr;
char *major;
@ -66,6 +67,7 @@ typedef struct calc_link {
struct link out;
double arg[CALCPERFORM_NARGS];
epicsTimeStamp time;
epicsUTag utag;
double val;
} calc_link;
@ -385,9 +387,10 @@ static void lnkCalc_report(const jlink *pjlink, int level, int indent)
if (level > 0) {
if (clink->sevr)
printf("%*s Alarm: %s, %s\n", indent, "",
printf("%*s Alarm: %s, %s, \"%s\"\n", indent, "",
epicsAlarmSeverityStrings[clink->sevr],
epicsAlarmConditionStrings[clink->stat]);
epicsAlarmConditionStrings[clink->stat],
clink->amsg);
if (clink->post_major)
printf("%*s Major expression: \"%s\"\n", indent, "",
@ -532,6 +535,7 @@ static long lnkCalc_getElements(const struct link *plink, long *nelements)
struct lcvt {
double *pval;
epicsTimeStamp *ptime;
epicsUTag *ptag;
};
static long readLocked(struct link *pinp, void *vvt)
@ -541,7 +545,7 @@ static long readLocked(struct link *pinp, void *vvt)
long status = dbGetLink(pinp, DBR_DOUBLE, pvt->pval, NULL, &nReq);
if (!status && pvt->ptime)
dbGetTimeStamp(pinp, pvt->ptime);
dbGetTimeStampTag(pinp, pvt->ptime, pvt->ptag);
return status;
}
@ -567,7 +571,7 @@ static long lnkCalc_getValue(struct link *plink, short dbrType, void *pbuffer,
long nReq = 1;
if (i == clink->tinp) {
struct lcvt vt = {&clink->arg[i], &clink->time};
struct lcvt vt = {&clink->arg[i], &clink->time, &clink->utag};
status = dbLinkDoLocked(child, readLocked, &vt);
if (status == S_db_noLSET)
@ -576,6 +580,7 @@ static long lnkCalc_getValue(struct link *plink, short dbrType, void *pbuffer,
if (dbLinkIsConstant(&prec->tsel) &&
prec->tse == epicsTimeEventDeviceTime) {
prec->time = clink->time;
prec->utag = clink->utag;
}
}
else
@ -583,6 +588,7 @@ static long lnkCalc_getValue(struct link *plink, short dbrType, void *pbuffer,
}
clink->stat = 0;
clink->sevr = 0;
clink->amsg[0] = '\0';
if (clink->post_expr) {
status = calcPerform(clink->arg, &clink->val, clink->post_expr);
@ -604,7 +610,8 @@ static long lnkCalc_getValue(struct link *plink, short dbrType, void *pbuffer,
if (!status && alval) {
clink->stat = LINK_ALARM;
clink->sevr = MAJOR_ALARM;
recGblSetSevr(prec, clink->stat, clink->sevr);
strcpy(clink->amsg, "post_major error");
recGblSetSevrMsg(prec, clink->stat, clink->sevr, "post_major error");
}
}
@ -615,7 +622,8 @@ static long lnkCalc_getValue(struct link *plink, short dbrType, void *pbuffer,
if (!status && alval) {
clink->stat = LINK_ALARM;
clink->sevr = MINOR_ALARM;
recGblSetSevr(prec, clink->stat, clink->sevr);
strcpy(clink->amsg, "post_minor error");
recGblSetSevrMsg(prec, clink->stat, clink->sevr, "post_minor error");
}
}
@ -643,7 +651,7 @@ static long lnkCalc_putValue(struct link *plink, short dbrType,
long nReq = 1;
if (i == clink->tinp) {
struct lcvt vt = {&clink->arg[i], &clink->time};
struct lcvt vt = {&clink->arg[i], &clink->time, &clink->utag};
status = dbLinkDoLocked(child, readLocked, &vt);
if (status == S_db_noLSET)
@ -652,6 +660,7 @@ static long lnkCalc_putValue(struct link *plink, short dbrType,
if (dbLinkIsConstant(&prec->tsel) &&
prec->tse == epicsTimeEventDeviceTime) {
prec->time = clink->time;
prec->utag = clink->utag;
}
}
else
@ -659,6 +668,7 @@ static long lnkCalc_putValue(struct link *plink, short dbrType,
}
clink->stat = 0;
clink->sevr = 0;
clink->amsg[0] = '\0';
/* Get the value being output as VAL */
status = conv(pbuffer, &clink->val, NULL);
@ -673,7 +683,8 @@ static long lnkCalc_putValue(struct link *plink, short dbrType,
if (!status && alval) {
clink->stat = LINK_ALARM;
clink->sevr = MAJOR_ALARM;
recGblSetSevr(prec, clink->stat, clink->sevr);
strcpy(clink->amsg, "post_major error");
recGblSetSevrMsg(prec, clink->stat, clink->sevr, "post_major error");
}
}
@ -684,7 +695,8 @@ static long lnkCalc_putValue(struct link *plink, short dbrType,
if (!status && alval) {
clink->stat = LINK_ALARM;
clink->sevr = MINOR_ALARM;
recGblSetSevr(prec, clink->stat, clink->sevr);
strcpy(clink->amsg, "post_major error");
recGblSetSevrMsg(prec, clink->stat, clink->sevr, "post_minor error");
}
}
@ -718,8 +730,8 @@ static long lnkCalc_getUnits(const struct link *plink, char *units, int len)
return 0;
}
static long lnkCalc_getAlarm(const struct link *plink, epicsEnum16 *status,
epicsEnum16 *severity)
static long lnkCalc_getAlarmMsg(const struct link *plink, epicsEnum16 *status,
epicsEnum16 *severity, char *msgbuf, size_t msgbuflen)
{
calc_link *clink = CONTAINER(plink->value.json.jlink,
struct calc_link, jlink);
@ -728,17 +740,23 @@ static long lnkCalc_getAlarm(const struct link *plink, epicsEnum16 *status,
*status = clink->stat;
if (severity)
*severity = clink->sevr;
if (msgbuf && msgbuflen) {
strncpy(msgbuf, clink->amsg, msgbuflen-1);
msgbuf[msgbuflen-1] = '\0';
}
return 0;
}
static long lnkCalc_getTimestamp(const struct link *plink, epicsTimeStamp *pstamp)
static long lnkCalc_getTimestampTag(const struct link *plink, epicsTimeStamp *pstamp, epicsUTag *ptag)
{
calc_link *clink = CONTAINER(plink->value.json.jlink,
struct calc_link, jlink);
if (clink->tinp >= 0) {
*pstamp = clink->time;
if(ptag)
*ptag = clink->utag;
return 0;
}
@ -761,9 +779,11 @@ static lset lnkCalc_lset = {
lnkCalc_getValue,
NULL, NULL, NULL,
lnkCalc_getPrecision, lnkCalc_getUnits,
lnkCalc_getAlarm, lnkCalc_getTimestamp,
NULL, NULL,
lnkCalc_putValue, NULL,
NULL, doLocked
NULL, doLocked,
lnkCalc_getAlarmMsg,
lnkCalc_getTimestampTag,
};
static jlif lnkCalcIf = {

View File

@ -432,7 +432,7 @@ static void convert(aiRecord *prec)
default: /* must use breakpoint table */
if (cvtRawToEngBpt(&val,prec->linr,prec->init,(void *)&prec->pbrk,&prec->lbrk)!=0) {
recGblSetSevr(prec,SOFT_ALARM,MAJOR_ALARM);
recGblSetSevrMsg(prec,SOFT_ALARM,MAJOR_ALARM, "BPT Error");
}
}

View File

@ -236,7 +236,7 @@ static long process(struct dbCommon *pcommon)
}
if (fetch_values(prec) == 0) {
if (calcPerform(&prec->a, &prec->val, prec->rpcl)) {
recGblSetSevr(prec, CALC_ALARM, INVALID_ALARM);
recGblSetSevrMsg(prec, CALC_ALARM, INVALID_ALARM, "calcPerform");
} else {
prec->udf = isnan(prec->val);
}
@ -610,7 +610,7 @@ static void execOutput(calcoutRecord *prec)
break;
case calcoutDOPT_Use_OVAL:
if (calcPerform(&prec->a, &prec->oval, prec->orpc)) {
recGblSetSevr(prec, CALC_ALARM, INVALID_ALARM);
recGblSetSevrMsg(prec, CALC_ALARM, INVALID_ALARM, "OCAL calcPerform");
} else {
prec->udf = isnan(prec->oval);
}
@ -770,7 +770,7 @@ static long writeValue(calcoutRecord *prec)
if (!pcalcoutDSET || !pcalcoutDSET->write) {
errlogPrintf("%s DSET write does not exist\n", prec->name);
recGblSetSevr(prec, SOFT_ALARM, INVALID_ALARM);
recGblSetSevrMsg(prec, SOFT_ALARM, INVALID_ALARM, "DSET write does not exist");
prec->pact = TRUE;
return(-1);
}

View File

@ -28,7 +28,5 @@ softIoc_LIBS = $(EPICS_BASE_IOC_LIBS)
DB += softIocExit.db
FINAL_LOCATION ?= $(shell $(PERL) $(TOOLS)/fullPathName.pl $(INSTALL_LOCATION))
CLEANS += epicsInstallDir.h

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