Compare commits

...

36 Commits

Author SHA1 Message Date
ca74f94faa bump rpm version
Some checks failed
Check EditorConfig / editorconfig (push) Failing after 2s
Base / Cross linux-aarch64 (push) Failing after 1s
Base / Cross linux-arm gnueabi (push) Failing after 2s
Base / Cross linux-arm gnueabihf (push) Failing after 1s
Base / CentOS-8 (push) Failing after 2s
Base / Fedora-33 (push) Failing after 1s
Base / Fedora-latest (push) Failing after 2s
Base / Rocky-9 (push) Failing after 1s
Base / Docker CentOS-7 (push) Failing after 7s
Base / Win2019 clang-cl (push) Has been cancelled
Base / Ub-22 clang C++11 (push) Has been cancelled
Base / MacOS clang (push) Has been cancelled
Base / Ub-22 clang (push) Has been cancelled
Base / Ub-24 gcc-13 c++20 Werror (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 beatnik (push) Has been cancelled
Base / Ub-22 gcc + RT-4.9 (push) Has been cancelled
Base / Ub-22 gcc C++11, static (push) Has been cancelled
Base / Ub-22 gcc + MinGW, static (push) Has been cancelled
Base / Win2019 MSC-19 (push) Has been cancelled
Base / Win2019 MSC-19, debug (push) Has been cancelled
Base / Ub-22 gcc + RT-4.10 (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 pc686 (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 uC5282 (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 xilinx_zynq_a9_qemu (push) Has been cancelled
Base / Win2022 mingw (push) Has been cancelled
Base / Ub-22 gcc + MinGW (push) Has been cancelled
Base / Ub-22 gcc unsigned char (push) Has been cancelled
Base / Win2019 MSC-19, static (push) Has been cancelled
2025-05-23 14:23:26 +02:00
8d46bd3a41 fix calc link documentation 2025-05-23 13:48:54 +02:00
226b752470 fix calc link range check 2025-05-23 12:11:20 +02:00
f7778539e8 make CALC/OCAL fields twice as long 2025-05-23 11:42:17 +02:00
45ea3d5664 extend calc records and expressions to inputs A-U 2025-05-22 16:34:16 +02:00
1804bcef7d bump rpm version
Some checks failed
Check EditorConfig / editorconfig (push) Failing after 2s
Base / Cross linux-aarch64 (push) Failing after 1s
Base / Cross linux-arm gnueabi (push) Failing after 2s
Base / Cross linux-arm gnueabihf (push) Failing after 1s
Base / CentOS-8 (push) Failing after 3s
Base / Fedora-33 (push) Failing after 1s
Base / Fedora-latest (push) Failing after 2s
Base / Rocky-9 (push) Failing after 4s
Base / Docker CentOS-7 (push) Failing after 7s
Base / Win2019 clang-cl (push) Has been cancelled
Base / Ub-22 clang C++11 (push) Has been cancelled
Base / MacOS clang (push) Has been cancelled
Base / Ub-22 clang (push) Has been cancelled
Base / Ub-24 gcc-13 c++20 Werror (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 beatnik (push) Has been cancelled
Base / Ub-22 gcc + RT-4.10 (push) Has been cancelled
Base / Ub-22 gcc + RT-4.9 (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 pc686 (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 uC5282 (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 xilinx_zynq_a9_qemu (push) Has been cancelled
Base / Win2022 mingw (push) Has been cancelled
Base / Ub-22 gcc + MinGW (push) Has been cancelled
Base / Ub-22 gcc unsigned char (push) Has been cancelled
Base / Ub-22 gcc C++11, static (push) Has been cancelled
Base / Ub-22 gcc + MinGW, static (push) Has been cancelled
Base / Win2019 MSC-19 (push) Has been cancelled
Base / Win2019 MSC-19, debug (push) Has been cancelled
Base / Win2019 MSC-19, static (push) Has been cancelled
2025-04-23 11:50:45 +02:00
990e08c737 fix commit f2a03e90 2025-04-23 11:49:51 +02:00
f501a2810e bump rpm version
Some checks failed
Check EditorConfig / editorconfig (push) Failing after 1s
Base / Cross linux-aarch64 (push) Failing after 2s
Base / Cross linux-arm gnueabi (push) Failing after 1s
Base / Cross linux-arm gnueabihf (push) Failing after 2s
Base / CentOS-8 (push) Failing after 1s
Base / Fedora-33 (push) Failing after 2s
Base / Fedora-latest (push) Failing after 1s
Base / Rocky-9 (push) Failing after 2s
Base / Docker CentOS-7 (push) Failing after 7s
Base / Ub-22 clang C++11 (push) Has been cancelled
Base / MacOS clang (push) Has been cancelled
Base / Ub-22 clang (push) Has been cancelled
Base / Ub-24 gcc-13 c++20 Werror (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 beatnik (push) Has been cancelled
Base / Ub-22 gcc + RT-4.10 (push) Has been cancelled
Base / Ub-22 gcc + RT-4.9 (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 xilinx_zynq_a9_qemu (push) Has been cancelled
Base / Win2022 mingw (push) Has been cancelled
Base / Ub-22 gcc + MinGW (push) Has been cancelled
Base / Ub-22 gcc C++11, static (push) Has been cancelled
Base / Ub-22 gcc + MinGW, static (push) Has been cancelled
Base / Win2019 MSC-19 (push) Has been cancelled
Base / Win2019 clang-cl (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 pc686 (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 uC5282 (push) Has been cancelled
Base / Ub-22 gcc unsigned char (push) Has been cancelled
Base / Win2019 MSC-19, debug (push) Has been cancelled
Base / Win2019 MSC-19, static (push) Has been cancelled
2025-03-21 15:16:25 +01:00
997746e5e2 fix epicsStrtod for 32 bit architectures 2025-03-21 15:16:25 +01:00
09f96d056a Merge branch '7.0' into PSI-7.0 2025-03-21 15:15:57 +01:00
84f49ad149 allow to run tests for cross linux versions
They need their own library versions, e.g. libreadline.so
2025-03-21 13:50:05 +01:00
db003e8a10 fix wrong usage of TARGET_xxx macros
They are for make targets, i.e. file dependent flags
not for target architecture dependent flags.
2025-03-21 13:49:05 +01:00
1732c9440a fix for mingw warning about order of header files 2025-03-21 13:49:05 +01:00
ff565267e5 support to run tests in wine and allow to add to WINE* variables 2025-03-21 13:49:04 +01:00
acf4c92697 fix epicsExport for volatile and const variables 2025-03-21 13:49:04 +01:00
93ba98cdca VxWorks does not mark abort() or exit() noreturn 2025-03-21 13:49:04 +01:00
f2a03e906b fix vxWorks softIoc build 2025-03-21 13:49:04 +01:00
Andrew Johnson
e4ebc01401 Fix EPICS::PodXHtml and generate section links
Some checks failed
Base / Ub-22 clang C++11 (push) Has been cancelled
Base / Ub-22 clang (push) Has been cancelled
Base / Ub-22 gcc + RT-4.9 (push) Has been cancelled
Base / MacOS clang (push) Has been cancelled
Base / Ub-24 gcc-13 c++20 Werror (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 beatnik (push) Has been cancelled
Base / Ub-22 gcc + RT-4.10 (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 pc686 (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 uC5282 (push) Has been cancelled
Base / Ub-22 gcc unsigned char (push) Has been cancelled
Base / Ub-22 gcc + MinGW, static (push) Has been cancelled
Base / Win2019 MSC-19 (push) Has been cancelled
Base / Win2019 MSC-19, debug (push) Has been cancelled
Base / Win2019 MSC-19, static (push) Has been cancelled
Base / Ub-22 gcc + RT-5.1 xilinx_zynq_a9_qemu (push) Has been cancelled
Base / Win2019 mingw (push) Has been cancelled
Base / Ub-22 gcc + MinGW (push) Has been cancelled
Base / Ub-22 gcc C++11, static (push) Has been cancelled
Check EditorConfig / editorconfig (push) Failing after 1s
Base / Cross linux-aarch64 (push) Failing after 2s
Base / Cross linux-arm gnueabi (push) Failing after 1s
Base / Cross linux-arm gnueabihf (push) Failing after 2s
Base / CentOS-8 (push) Failing after 2s
Base / Fedora-33 (push) Failing after 5s
Base / Fedora-latest (push) Failing after 4s
Base / Rocky-9 (push) Failing after 5s
CodeQL / Analyze (cpp) (push) Failing after 1s
Base / Docker CentOS-7 (push) Failing after 14s
Overrides an internal method in Pod::Simple::XHTML that
appends a section sign which links to this section.
2025-03-19 11:26:51 -05:00
Jeremy Lorelli
6ea6ae633b Define NOCRYPT, NOSOUND and NOKANJI before including windows.h 2025-03-19 11:19:45 -05:00
JJL772
9fac52fa58 Add a release note for the windows.h epicsAtomicOSD change 2025-03-19 11:19:45 -05:00
JJL772
fc5d3c9a5c Disable extraneous WIN32 declarations when including windows.h in epicsAtomicOSD.h 2025-03-19 11:19:45 -05:00
c75ad2673e no longer need extern "C" { } around epicsExport macros 2025-03-19 11:17:14 -05:00
b97a35fec8 Don't use __attribute__((noreturn)) on VxWorks
VxWorks does not mark abort() or exit() as noreturn.
Thus, functions declared noreturn which end in a call
to those functions cause a compiler warning on vxWorks.
2025-03-19 11:06:26 -05:00
Andrew Johnson
350570134e Changed dbServerStats() to count the server layers called 2025-03-19 11:03:46 -05:00
Andrew Johnson
72f3e75c8d Add summary stat's calculation 2025-03-19 11:03:46 -05:00
Andrew Johnson
90f97a7037 Release notes; HAS_DBSERVER_STATS in dbServer.h 2025-03-19 11:03:46 -05:00
Andrew Johnson
fd86f0ff04 Unit tests for dbServerStats() 2025-03-19 11:03:46 -05:00
Andrew Johnson
bcc6cb96ae Added dbServerStats() API for iocStats and similar 2025-03-19 11:03:46 -05:00
Michael Davidsaver
a4bc0db6e6 dbCa CP link updates set PUTF/RPRO 2025-03-19 10:59:28 -05:00
Michael Davidsaver
48ebe2c64e Avoid initMainThread() except on vxworks
Move isOkToBlock tracking to osdThread.
Targets except vxworks can store this flag in epicsThreadOSD.
Continue to use TLS w/ vxWorks.

Note that setting of isOkToBlock for "main" thread becomes lazy.
2025-03-19 10:53:42 -05:00
Michael Davidsaver
9f788996dc db: lock record for db_create_read_log() and dbChannelGetField()
since 27fe3e4468 db_create_read_log()
accesses record fields.

remove now redundant db_create_read_log() calls.
2025-03-19 10:51:08 -05:00
Michael Davidsaver
13d6ca598c initHookRegister() make idempotent and MustSucceed 2025-03-05 10:02:38 -06:00
ee1a49045a support CROSS_COMPILER_RUNTESTS_ARCHS other than RTEMS 2025-03-05 10:00:44 -06:00
Ralph Lange
78f263f359 Update GitHub Actions build configuration (#609)
* ci: bump GHA ubuntu jobs (22->24, 20->22)

* ci: add GHA job for CentOS-7 on self-managed Docker

* ci: add jobs for CentOS-8 and Rocky-9 on GHA-managed Docker
2025-03-05 09:55:32 -06:00
43e75e3901 decorate functions that do not return 2025-03-05 09:51:57 -06:00
Ralph Lange
131578124b ci: drop AppVeyor builds on VS2010/VS2012 2025-02-28 09:59:53 -06:00
62 changed files with 1053 additions and 370 deletions

View File

@@ -52,8 +52,6 @@ environment:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- CMP: vs2015
- CMP: vs2013
- CMP: vs2012
- CMP: vs2010
- CMP: gcc
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# TODO: static linking w/ readline isn't working. Bypass auto-detect
@@ -67,11 +65,6 @@ platform:
# Matrix configuration: exclude sets of jobs
matrix:
exclude:
# VS2012 and older installs don't have the 64 bit compiler
- platform: x64
CMP: vs2012
- platform: x64
CMP: vs2010
# Exclude more jobs to reduce build time
# Skip 32-bit for "middle-aged" compilers
- platform: x86

View File

@@ -59,8 +59,6 @@ environment:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- CMP: vs2015
- CMP: vs2013
- CMP: vs2012
- CMP: vs2010
- CMP: gcc
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# TODO: static linking w/ readline isn't working. Bypass auto-detect
@@ -74,11 +72,6 @@ platform:
# Matrix configuration: exclude sets of jobs
matrix:
exclude:
# VS2012 and older installs don't have the 64 bit compiler
- platform: x64
CMP: vs2012
- platform: x64
CMP: vs2010
# Exclude more jobs to reduce build time
# Skip 32-bit for "middle-aged" compilers
- platform: x86

View File

@@ -51,9 +51,9 @@ jobs:
matrix:
# Job names also name artifacts, character limitations apply
include:
- os: ubuntu-22.04
cmp: gcc-12
name: "Ub-22 gcc-12 c++20 Werror"
- os: ubuntu-24.04
cmp: gcc
name: "Ub-24 gcc-13 c++20 Werror"
# Turn all warnings into errors,
# except for those we could not fix (yet).
# Remove respective -Wno-error=... flag once it is fixed.
@@ -74,79 +74,79 @@ jobs:
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3'
CMD_LDFLAGS=-Wl,-z,relro"
- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: default
cross: "windows-x64-mingw"
name: "Ub-20 gcc + MinGW"
name: "Ub-22 gcc + MinGW"
- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: static
cross: "windows-x64-mingw"
name: "Ub-20 gcc + MinGW, static"
name: "Ub-22 gcc + MinGW, static"
- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: static
extra: "CMD_CXXFLAGS=-std=c++11"
name: "Ub-20 gcc C++11, static"
name: "Ub-22 gcc C++11, static"
- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: static
extra: "CMD_CFLAGS=-funsigned-char CMD_CXXFLAGS=-funsigned-char"
name: "Ub-20 gcc unsigned char"
name: "Ub-22 gcc unsigned char"
- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: clang
configuration: default
name: "Ub-20 clang"
name: "Ub-22 clang"
- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: clang
configuration: default
extra: "CMD_CXXFLAGS=-std=c++11"
name: "Ub-20 clang C++11"
name: "Ub-22 clang C++11"
- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: default
cross: "RTEMS-pc686-qemu@5"
name: "Ub-20 gcc + RT-5.1 pc686"
name: "Ub-22 gcc + RT-5.1 pc686"
- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: default
cross: "RTEMS-beatnik@5"
test: NO
name: "Ub-20 gcc + RT-5.1 beatnik"
name: "Ub-22 gcc + RT-5.1 beatnik"
- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: default
cross: "RTEMS-xilinx_zynq_a9_qemu@5"
test: NO
name: "Ub-20 gcc + RT-5.1 xilinx_zynq_a9_qemu"
name: "Ub-22 gcc + RT-5.1 xilinx_zynq_a9_qemu"
- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: default
cross: "RTEMS-uC5282@5"
test: NO
name: "Ub-20 gcc + RT-5.1 uC5282"
name: "Ub-22 gcc + RT-5.1 uC5282"
- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: default
name: "Ub-20 gcc + RT-4.10"
name: "Ub-22 gcc + RT-4.10"
cross: "RTEMS-pc386-qemu@4.10"
test: NO
- os: ubuntu-20.04
- os: ubuntu-22.04
cmp: gcc
configuration: default
name: "Ub-20 gcc + RT-4.9"
name: "Ub-22 gcc + RT-4.9"
cross: "RTEMS-pc386-qemu@4.9"
- os: macos-latest
@@ -246,10 +246,15 @@ jobs:
matrix:
# Job names also name artifacts, character limitations apply
include:
#- name: "CentOS-7"
# image: centos:7
# cmp: gcc
# configuration: default
- name: "CentOS-8"
image: centos:8
cmp: gcc
configuration: default
- name: "Rocky-9"
image: rockylinux:9
cmp: gcc
configuration: default
- name: "Fedora-33"
image: fedora:33
@@ -262,47 +267,29 @@ jobs:
configuration: default
steps:
- name: "Build newer Git"
# actions/checkout@v2 wants git >=2.18
# centos:7 has 1.8
if: matrix.image=='centos:7'
- name: "Fix repo URLs on CentOS-8"
# centos:8 is frozen, repos are in the vault
if: matrix.image=='centos:8'
run: |
yum -y install curl make gcc curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-ExtUtils-MakeMaker
curl https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.29.0.tar.gz | tar -xz
cd git-*
make -j2 prefix=/usr/local all
make prefix=/usr/local install
cd ..
rm -rf git-*
type -a git
git --version
sed -i -e "s|mirrorlist=|#mirrorlist=|" \
-e "s|#baseurl=http://mirror|baseurl=http://vault|" \
/etc/yum.repos.d/CentOS-Linux-{BaseOS,AppStream,Extras,Plus}.repo
- name: "Redhat setup"
run: |
dnfyum() {
dnf -y "$@" || yum -y "$@"
return $?
}
dnfyum install python3 gdb make perl gcc-c++ glibc-devel readline-devel ncurses-devel perl-devel perl-Test-Simple
git --version || dnfyum install git
# rather than just bite the bullet and link python3 -> python,
# people would rather just break all existing scripts...
[ -e /usr/bin/python ] || ln -sf python3 /usr/bin/python
python --version
dnf -y install python3 gdb make perl gcc-c++ glibc-devel readline-devel ncurses-devel perl-devel perl-Test-Simple
git --version || dnf -y install git
python3 --version
- uses: actions/checkout@v4
with:
submodules: true
- name: Automatic core dumper analysis
uses: mdavidsaver/ci-core-dumper@master
if: matrix.image!='centos:7'
- name: Automatic core dumper analysis
uses: mdavidsaver/ci-core-dumper@node16
if: matrix.image=='centos:7'
- name: Prepare and compile dependencies
run: python .ci/cue.py prepare
run: python3 .ci/cue.py prepare
- name: Build main module
run: python .ci/cue.py build
run: python3 .ci/cue.py build
- name: Run main module tests
run: python .ci/cue.py -T 20M test
run: python3 .ci/cue.py -T 20M test
- name: Upload tapfiles Artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
@@ -312,4 +299,55 @@ jobs:
if-no-files-found: ignore
- name: Collect and show test results
if: ${{ always() }}
run: python .ci/cue.py -T 5M test-results
run: python3 .ci/cue.py -T 5M test-results
build-docker:
name: Docker CentOS-7
runs-on: ubuntu-latest
env:
CMP: gcc
BCFG: default
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Run...
run: |
env > env.list
cat <<EOF > runit.sh
#!/bin/sh
set -e -x
cd /io
id
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
yum -y install epel-release
yum -y install \
curl make gcc curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-ExtUtils-MakeMaker \
python3 gdb make perl gcc-c++ glibc-devel readline-devel ncurses-devel perl-devel perl-Test-Simple \
libevent-devel sudo re2c
[ -e /usr/bin/python ] || ln -sf /usr/bin/python3 /usr/bin/python
# fake out cue.py
ln -s /bin/true /usr/bin/apt-get
# quiet warnings spam from perl
export LANG=C
python --version
python .ci/cue.py prepare
python .ci/cue.py build
python .ci/cue.py -T 15M test
python .ci/cue.py test-results
EOF
chmod +x runit.sh
docker run --rm --quiet \
--pull=always \
--env-file env.list \
-v `pwd`:/io \
centos:7 \
/io/runit.sh

View File

@@ -9,8 +9,8 @@ STD_CXXFLAGS = -std=c++20
# Fix bug in gcc-toolset-11 calling the old assembler
ifneq ($(filter %-11,$(TOOLSET)),)
TARGET_CPPFLAGS += $(TOOLSET_DIR:%=-B$(SYSROOT)%/bin)
TARGET_LDFLAGS += $(TOOLSET_DIR:%=-B$(SYSROOT)%/bin)
CPPFLAGS += $(TOOLSET_DIR:%=-B$(SYSROOT)%/bin)
LDFLAGS += $(TOOLSET_DIR:%=-B$(SYSROOT)%/bin)
endif
ifneq (($(TOOLSET)),)

View File

@@ -9,8 +9,8 @@ STD_CXXFLAGS = -std=c++20
# Fix bug in gcc-toolset-11 calling the old assembler
ifneq ($(filter %-11,$(TOOLSET)),)
TARGET_CPPFLAGS += $(TOOLSET_DIR:%=-B$(SYSROOT)%/bin)
TARGET_LDFLAGS += $(TOOLSET_DIR:%=-B$(SYSROOT)%/bin)
CPPFLAGS += $(TOOLSET_DIR:%=-B$(SYSROOT)%/bin)
LDFLAGS += $(TOOLSET_DIR:%=-B$(SYSROOT)%/bin)
endif
ifneq (($(TOOLSET)),)

View File

@@ -0,0 +1,4 @@
include $(CONFIG)/os/CONFIG.win32-x86.win32-x86
PATH := /opt/wine-msvc-2017/bin/x86:$(PATH)
export WINEPREFIX = $(HOME)/.wine32-$(EPICS_HOST_ARCH)

View File

@@ -4,8 +4,8 @@ VALID_BUILDS = Ioc Command
MSVC_VERSION ?= 2019
PATH := /opt/gfa-wine/bin:/opt/wine-msvc-$(MSVC_VERSION)/bin/x64:$(PATH)
export WINE ?= wine64
export WINEPREFIX = $(HOME)/.wine-$(EPICS_HOST_ARCH)
export WINEDEBUG=fixme-all
export WINEDLLOVERRIDES="mscoree,mshtml="
export WINE = wine64
export WINEPATH = $(realpath $(INSTALL_BIN))
export WINEDEBUG := err-all,warn-all,fixme-all$(WINEDEBUG:%=,%)
export WINEDLLOVERRIDES := mscoree,mshtml=$(WINEDLLOVERRIDES:%=,%)
export WINEPATH := $(WINEPATH:%=%;)$(abspath $(INSTALL_BIN))

View File

@@ -23,3 +23,6 @@ ARCH_DEP_LDFLAGS+=-Wl,-rpath-link,$(INSTALL_LIB)
# Our host versions work just fine.
AR = ar -rc
RANLIB = ranlib
# Allow to run cross-tests which expect different lib versions
export LD_PRELOAD=$(SYSROOT)/lib64/libreadline.so

View File

@@ -16,3 +16,6 @@ export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH:%=%:)$(TOOLSET_DIR:%=$(SYSROOT)%/usr
# The linker has problems to find indirectly referenced libraries
PROD_LDLIBS += $(LDLIBS)
# Allow to run cross-tests which expect different lib versions
export LD_PRELOAD=$(SYSROOT)/lib64/libreadline.so

View File

@@ -14,9 +14,12 @@ SYSROOT = /opt/RHEL8
# But linker gets confused with LD_LIBRARY_PATH.
# Thus only wrap the compiler.
WRAPPER = -wrapper env,LD_LIBRARY_PATH=$(TOOLSET_DIR:%=$(SYSROOT)%/usr/lib64:)/usr/lib64:$(SYSROOT)/usr/lib64
TARGET_CPPFLAGS += $(WRAPPER)
CPPFLAGS += $(WRAPPER)
# These programs as cross tools would also need LD_LIBRARY_PATH.
# But but our host versions work just fine.
AR = ar -rc
RANLIB = ranlib
# Allow to run cross-tests which expect different lib versions
export LD_PRELOAD=$(SYSROOT)/lib64/libreadline.so

View File

@@ -15,8 +15,8 @@ STD_CXXFLAGS = -std=c++11
TOOLSET_DIR = $(TOOLSET:%=$(TOOLSET_LOCATION)/%/root)
GNU_DIR = $(SYSROOT)$(TOOLSET_DIR)
TARGET_CPPFLAGS += $(SYSROOT:%=--sysroot=%)
TARGET_LDFLAGS += $(SYSROOT:%=--sysroot=%)
CPPFLAGS += $(SYSROOT:%=--sysroot=%)
LDFLAGS += $(SYSROOT:%=--sysroot=%)
# backward compatibility: Keep unversioned libs
# in order to prevent dynamic linking problems

View File

@@ -27,3 +27,6 @@ WIND_BASE = /opt/VxWorks/VxWorks$(VXWORKS_VERSION)
# For the license counter
export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH:%=%:)$(WIND_BASE)/lmapi-5.0/$(WIND_HOST_TYPE)/lib
softIoc_LDFLAGS += -whole-archive
softIocPVA_LDFLAGS += -whole-archive

View File

@@ -2,6 +2,8 @@ include $(CONFIG)/os/CONFIG_SITE.linux-x86_64.Common
# Improved error checking with clang
CROSS_COMPILER_TARGET_ARCHS += RHEL8-x86_64-clang
CROSS_COMPILER_RUNTEST_ARCHS += RHEL8-x86_64-clang
# Build for old RHEL7 64 bit
#CROSS_COMPILER_TARGET_ARCHS += RHEL7-x86_64
#CROSS_COMPILER_RUNTEST_ARCHS += RHEL7-x86_64

View File

@@ -2,9 +2,12 @@ include $(CONFIG)/os/CONFIG_SITE.linux-x86_64.Common
# Improved error checking with clang
CROSS_COMPILER_TARGET_ARCHS += RHEL9-x86_64-clang
CROSS_COMPILER_RUNTEST_ARCHS += RHEL9-x86_64-clang
# Build for old RHEL8 64 bit
CROSS_COMPILER_TARGET_ARCHS += RHEL8-x86_64
CROSS_COMPILER_RUNTEST_ARCHS += RHEL8-x86_64
# Build for old RHEL7 64 bit
# Build for even older RHEL7 64 bit
#CROSS_COMPILER_TARGET_ARCHS += RHEL7-x86_64
#CROSS_COMPILER_RUNTEST_ARCHS += RHEL7-x86_64

View File

@@ -6,3 +6,9 @@
# Inherit from the linux-x86 host architecture
include $(CONFIG)/os/CONFIG_SITE.linux-x86.win32-x86-mingw
MINGWLIBS ?= /usr/i686-w64-mingw32/sys-root/mingw/bin
export WINE ?= wine
export WINEPREFIX = $(HOME)/.wine32-$(EPICS_HOST_ARCH)
export WINEDEBUG := err-all,warn-all,fixme-all$(WINEDEBUG:%=,%)
export WINEDLLOVERRIDES := mscoree,mshtml=$(WINEDLLOVERRIDES:%=,%)
export WINEPATH := $(WINEPATH:%=%;)$(MINGWLIBS);$(abspath $(INSTALL_BIN))

View File

@@ -6,3 +6,9 @@
# Inherit from the linux-x86 host architecture
include $(CONFIG)/os/CONFIG_SITE.linux-x86.windows-x64-mingw
MINGWLIBS ?= /usr/x86_64-w64-mingw32/sys-root/mingw/bin
export WINE ?= wine64
export WINEPREFIX = $(HOME)/.wine-$(EPICS_HOST_ARCH)
export WINEDEBUG := err-all,warn-all,fixme-all$(WINEDEBUG:%=,%)
export WINEDLLOVERRIDES := mscoree,mshtml=$(WINEDLLOVERRIDES:%=,%)
export WINEPATH := $(WINEPATH:%=%;)$(MINGWLIBS);$(abspath $(INSTALL_BIN))

View File

@@ -18,13 +18,28 @@ __This version of EPICS has not been released yet.__
__Add new items below here__
=======
### Reduce symbol and macro pollution from epicsAtomic.h on WIN32
`epicsAtomic.h` no longer pulls in as many unneeded declarations and macros from
`windows.h`. Prior to this change, including `epicsAtomic.h` at the wrong time
could result in unexpected compiler errors. Due to the nature of `windows.h`,
some unneeded declarations are still pulled in, however the number is greatly reduced.
Code that needs these declarations should explicitly include `windows.h` before `epicsAtomic.h`.
### epicsExport simplifications
`epicsExportAddress()`, `epicsExportRegistrar()` and `epicsRegisterFunction()`
no loger require to be wrapped in `extern "C" { }` in C++ code.
no longer require to be wrapped in `extern "C" { }` in C++ code.
### Build system `$(PYTHON)` default changed
### New `dbServerStats()` API for iocStats
A new routine provides the ability to request channel and client counts from
named server layers that implement the `stats()` method, or to get a summary
of the counts from all registered server layers. A preprocessor macro
`HAS_DBSERVER_STATS` macro is defined in the `dbServer.h` header file to
simplify code that needs to support older versions of Base as well.
-----
## EPICS Release 7.0.9
@@ -44,12 +59,6 @@ record type by opening these files in a text editor intead of opening a browser
and loading the HTML versions or finding and opening the files from the EPICS
Documentation site.
### fdManager file descriptor limit removed
In order to support file descriptors above 1023, fdManager now uses
poll() instead of select() on all architectures that support it
(Linux, MacOS, Windows, newer RTEMS).
### Post monitors from compress record when it's reset
Writing into a compress record's `RES` field now posts a monitor event instead

View File

@@ -5,7 +5,7 @@
Name: epics-base-%{EpicsVersion}
Summary: EPICS Base %{EpicsVersion}
Version: 1
Release: 0%{?dist}
Release: 3%{?dist}
License: EPICS Open License
Group: Development/Languages
URL: https://git.psi.ch/epics_base/base-7.0

View File

@@ -115,10 +115,9 @@ static int dbca_chan_count;
* During link modification or IOC shutdown the pca->plink pointer (guarded by caLink.lock)
* is used as a flag to indicate that a link is no longer active.
*
* References to the struct caLink are owned by the dbCaTask, and any scanOnceCallback()
* which is in progress.
* References to the struct caLink are owned by the dbCaTask.
*
* The libca and scanOnceCallback callbacks take no action if pca->plink==NULL.
* The libca callbacks take no action if pca->plink==NULL.
*
* dbCaPutLinkCallback causes an additional complication because
* when dbCaRemoveLink is called the callback may not have occured.
@@ -788,38 +787,6 @@ static long doLocked(struct link *plink, dbLinkUserCallback rtn, void *priv)
return status;
}
static void scanComplete(void *raw, dbCommon *prec)
{
caLink *pca = raw;
epicsMutexMustLock(pca->lock);
if(!pca->plink) {
/* IOC shutdown or link re-targeted. Do nothing. */
} else if(pca->scanningOnce==0) {
errlogPrintf("dbCa.c complete callback w/ scanningOnce==0\n");
} else if(--pca->scanningOnce){
/* another scan is queued */
if(scanOnceCallback(prec, scanComplete, raw)) {
errlogPrintf("dbCa.c failed to re-queue scanOnce\n");
} else
caLinkInc(pca);
}
epicsMutexUnlock(pca->lock);
caLinkDec(pca);
}
/* must be called with pca->lock held */
static void scanLinkOnce(dbCommon *prec, caLink *pca) {
if(pca->scanningOnce==0) {
if(scanOnceCallback(prec, scanComplete, pca)) {
errlogPrintf("dbCa.c failed to queue scanOnce\n");
} else
caLinkInc(pca);
}
if(pca->scanningOnce<5)
pca->scanningOnce++;
/* else too many scans queued */
}
static lset dbCa_lset = {
0, 1, /* not Constant, Volatile */
NULL, dbCaRemoveLink,
@@ -856,7 +823,9 @@ static void connectionCallback(struct connection_handler_args arg)
if (precord &&
((ppv_link->pvlMask & pvlOptCP) ||
((ppv_link->pvlMask & pvlOptCPP) && precord->scan == 0)))
scanLinkOnce(precord, pca);
{
link_action |= CA_DBPROCESS;
}
goto done;
}
pca->hasReadAccess = ca_read_access(arg.chid);
@@ -988,7 +957,9 @@ static void eventCallback(struct event_handler_args arg)
if ((ppv_link->pvlMask & pvlOptCP) ||
((ppv_link->pvlMask & pvlOptCPP) && precord->scan == 0))
scanLinkOnce(precord, pca);
{
addAction(pca, CA_DBPROCESS);
}
}
done:
epicsMutexUnlock(pca->lock);
@@ -1061,7 +1032,9 @@ static void accessRightsCallback(struct access_rights_handler_args arg)
if (precord &&
((ppv_link->pvlMask & pvlOptCP) ||
((ppv_link->pvlMask & pvlOptCPP) && precord->scan == 0)))
scanLinkOnce(precord, pca);
{
addAction(pca, CA_DBPROCESS);
}
done:
epicsMutexUnlock(pca->lock);
}
@@ -1273,6 +1246,13 @@ static void dbCaTask(void *arg)
printLinks(pca);
}
}
if (link_action & CA_DBPROCESS) {
dbCommon *prec;
epicsMutexMustLock(pca->lock);
prec = pca->plink->precord;
epicsMutexUnlock(pca->lock);
db_process(prec);
}
}
SEVCHK(ca_flush_io(), "dbCaTask");
}

View File

@@ -31,6 +31,7 @@
#define CA_MONITOR_STRING 0x20
#define CA_GET_ATTRIBUTES 0x40
#define CA_SYNC 0x1000
#define CA_DBPROCESS 0x2000
/* write type */
#define CA_PUT 0x1
#define CA_PUT_CALLBACK 0x2

View File

@@ -635,9 +635,21 @@ long dbChannelGetField(dbChannel *chan, short dbrType, void *pbuffer,
{
dbCommon *precord = chan->addr.precord;
long status = 0;
unsigned char local_fl = 0;
dbScanLock(precord);
if (!pfl && (ellCount(&chan->pre_chain) || ellCount(&chan->post_chain))) {
pfl = db_create_read_log(chan);
if (pfl) {
local_fl = 1;
pfl = dbChannelRunPreChain(chan, pfl);
pfl = dbChannelRunPostChain(chan, pfl);
}
}
status = dbChannelGet(chan, dbrType, pbuffer, options, nRequest, pfl);
if (local_fl) {
db_delete_field_log(pfl);
}
dbScanUnlock(precord);
return status;
}

View File

@@ -511,6 +511,10 @@ DBCORE_API long dbChannelGet(dbChannel *chan, short type,
* \param[in,out] nRequest Pointer to the element count.
* \param[in] pfl Pointer to a db_field_log or NULL.
* \returns 0, or an error status value.
*
* \since UNRELEASED If pfl is NULL and chan has filters, db_create_read_log() will be called
* internally to create a temporary db_field_log which is passed to dbChannelGet()
* then deallocated.
*/
DBCORE_API long dbChannelGetField(dbChannel *chan, short type,
void *pbuffer, long *options, long *nRequest, void *pfl);

View File

@@ -127,6 +127,31 @@ int dbServerClient(char *pBuf, size_t bufSize)
return -1;
}
int dbServerStats(const char *name, unsigned *channels, unsigned *clients)
{
dbServer *psrv = (dbServer *)ellFirst(&serverList);
if (state != running || !psrv)
return -1;
unsigned tch = 0, tcl = 0, nmatch = 0;
for (; psrv; psrv = (dbServer *)ellNext(&psrv->node)) {
if (psrv->stats &&
(!name || strcmp(name, psrv->name) == 0)) {
unsigned lch = 0, lcl = 0;
psrv->stats(&lch, &lcl);
tch += lch;
tcl += lcl;
nmatch++;
if (name)
break; /* No duplicate names in serverList */
}
}
if (channels) *channels = tch;
if (clients) *clients = tcl;
return nmatch;
}
#define STARTSTOP(routine, method, newState) \
void routine(void) \
{ \

View File

@@ -17,9 +17,6 @@
* the dbServer interface provides allow the IOC to start, pause and stop
* the servers together, and to provide status and debugging information
* to the IOC user/developer through a common set of commands.
*
* @todo No API is provided yet for calling stats() methods.
* Nothing in the IOC calls dbStopServers(), not sure where it should go.
*/
#ifndef INC_dbServer_H
@@ -59,8 +56,8 @@ typedef struct dbServer {
/** @brief Get number of channels and clients currently connected.
*
* @param channels NULL or pointer for returning channel count.
* @param clients NULL or pointer for returning client count.
* @param channels @c NULL or pointer for returning channel count.
* @param clients @c NULL or pointer for returning client count.
*/
void (* stats) (unsigned *channels, unsigned *clients);
@@ -145,6 +142,30 @@ DBCORE_API void dbsr(unsigned level);
*/
DBCORE_API int dbServerClient(char *pBuf, size_t bufSize);
/** @brief CPP Macro indicating the dbServerStats() routine exists.
* @since UNRELEASED
*/
#define HAS_DBSERVER_STATS
/** @brief Fetch statistics from server layers.
*
* This is an API for iocStats and similar to fetch the number of channels
* and clients connected to the registered server layers.
* If the name given is NULL the statistics returned are the totals from
* all registered server layers, otherwise just from the named server.
* @param name Server name
* @param channels NULL, or where to return the channel count
* @param clients NULL or where to return the client count
* @returns -1 if the IOC isn't running or no servers are registered, without
* writing to the statistics variables. Otherwise it writes to the statistics
* variables and returns the number of dbServer::stats() methods called,
* 0 if a named server wasn't found or doesn't have a stats() method.
*
* @since UNRELEASED
*/
DBCORE_API int dbServerStats(const char *name, unsigned *channels,
unsigned *clients);
/** @brief Initialize all registered servers.
*
* Calls all dbServer::init() methods.

View File

@@ -202,7 +202,6 @@ void testdbGetFieldEqual(const char* pv, int dbrType, ...)
void testdbVGetFieldEqual(const char* pv, short dbrType, va_list ap)
{
dbChannel *chan = dbChannelCreate(pv);
db_field_log *pfl = NULL;
long nReq = 1;
union anybuf pod;
long status = S_dbLib_recNotFound;
@@ -212,18 +211,7 @@ void testdbVGetFieldEqual(const char* pv, short dbrType, va_list ap)
goto done;
}
if(ellCount(&chan->filters)) {
pfl = db_create_read_log(chan);
if (!pfl) {
testFail("can't db_create_read_log w/ %s", pv);
goto done;
}
pfl = dbChannelRunPreChain(chan, pfl);
pfl = dbChannelRunPostChain(chan, pfl);
}
status = dbChannelGetField(chan, dbrType, pod.bytes, NULL, &nReq, pfl);
status = dbChannelGetField(chan, dbrType, pod.bytes, NULL, &nReq, NULL);
if (status) {
testFail("dbGetField(\"%s\", %d, ...) -> %#lx (%s)", pv, dbrType, status, errSymMsg(status));
goto done;
@@ -261,7 +249,6 @@ void testdbVGetFieldEqual(const char* pv, short dbrType, va_list ap)
}
done:
db_delete_field_log(pfl);
if(chan)
dbChannelDelete(chan);
}
@@ -288,7 +275,6 @@ done:
void testdbGetArrFieldEqual(const char* pv, short dbfType, long nRequest, unsigned long cnt, const void *pbufraw)
{
dbChannel *chan = dbChannelCreate(pv);
db_field_log *pfl = NULL;
const long vSize = dbValueSize(dbfType);
const long nStore = vSize * nRequest;
long status = S_dbLib_recNotFound;
@@ -300,24 +286,13 @@ void testdbGetArrFieldEqual(const char* pv, short dbfType, long nRequest, unsign
goto done;
}
if(ellCount(&chan->filters)) {
pfl = db_create_read_log(chan);
if (!pfl) {
testFail("can't db_create_read_log w/ %s", pv);
goto done;
}
pfl = dbChannelRunPreChain(chan, pfl);
pfl = dbChannelRunPostChain(chan, pfl);
}
gbuf = gstore = malloc(nStore);
if(!gbuf && nStore!=0) { /* note that malloc(0) is allowed to return NULL on success */
testFail("Allocation failed esize=%ld total=%ld", vSize, nStore);
return;
}
status = dbChannelGetField(chan, dbfType, gbuf, NULL, &nRequest, pfl);
status = dbChannelGetField(chan, dbfType, gbuf, NULL, &nRequest, NULL);
if (status) {
testFail("dbGetField(\"%s\", %d, ...) -> %#lx", pv, dbfType, status);

View File

@@ -148,6 +148,7 @@ int dbChannel_get_count(
long options;
long i;
long zero = 0;
unsigned char local_fl = 0;
/* The order of the DBR* elements in the "newSt" structures below is
* very important and must correspond to the order of processing
@@ -156,6 +157,16 @@ int dbChannel_get_count(
dbScanLock(dbChannelRecord(chan));
/* If filters are involved in a read, create field log and run filters */
if (!pfl && (ellCount(&chan->pre_chain) || ellCount(&chan->post_chain))) {
pfl = db_create_read_log(chan);
if (pfl) {
local_fl = 1;
pfl = dbChannelRunPreChain(chan, pfl);
pfl = dbChannelRunPostChain(chan, pfl);
}
}
switch(buffer_type) {
case(oldDBR_STRING):
status = dbChannelGet(chan, DBR_STRING, pbuffer, &zero, nRequest, pfl);
@@ -800,6 +811,8 @@ int dbChannel_get_count(
dbScanUnlock(dbChannelRecord(chan));
if (local_fl) db_delete_field_log(pfl);
if (status) return -1;
return 0;
}
@@ -1029,3 +1042,17 @@ int db_put_process(processNotify *ppn, notifyPutType type,
ppn->status = notifyError;
return 1;
}
void db_process(struct dbCommon *prec)
{
if (prec->pact) {
if (dbAccessDebugPUTF && prec->tpro)
printf("%s: dbPutField to Active '%s', setting RPRO=1\n",
epicsThreadGetNameSelf(), prec->name);
prec->rpro = TRUE;
} else {
/* indicate that dbPutField called dbProcess */
prec->putf = TRUE;
(void)dbProcess(prec);
}
}

View File

@@ -22,6 +22,8 @@ extern "C" {
#include "dbCoreAPI.h"
struct dbCommon;
DBCORE_API extern struct dbBase *pdbbase;
DBCORE_API extern volatile int interruptAccept;
@@ -36,7 +38,9 @@ DBCORE_API int dbChannel_put(struct dbChannel *chan, int src_type,
const void *psrc, long no_elements);
DBCORE_API int dbChannel_get_count(struct dbChannel *chan,
int buffer_type, void *pbuffer, long *nRequest, void *pfl);
#ifdef EPICS_DBCA_PRIVATE_API
DBCORE_API void db_process(struct dbCommon *prec);
#endif
#ifdef __cplusplus
}

View File

@@ -540,7 +540,6 @@ static void read_reply ( void *pArg, struct dbChannel *dbch,
const int readAccess = asCheckGet ( pciu->asClientPVT );
int status;
int autosize;
int local_fl = 0;
long item_count;
ca_uint32_t payload_size;
dbAddr *paddr=&dbch->addr;
@@ -582,21 +581,9 @@ static void read_reply ( void *pArg, struct dbChannel *dbch,
return;
}
/* If filters are involved in a read, create field log and run filters */
if (!pfl && (ellCount(&dbch->pre_chain) || ellCount(&dbch->post_chain))) {
pfl = db_create_read_log(dbch);
if (pfl) {
local_fl = 1;
pfl = dbChannelRunPreChain(dbch, pfl);
pfl = dbChannelRunPostChain(dbch, pfl);
}
}
status = dbChannel_get_count ( dbch, pevext->msg.m_dataType,
pPayload, &item_count, pfl);
if (local_fl) db_delete_field_log(pfl);
if ( status < 0 ) {
/* Clients recv the status of the operation directly to the
* event/put/get callback. (from CA_V41())
@@ -663,7 +650,6 @@ static int read_action ( caHdrLargeArray *mp, void *pPayloadIn, struct client *p
ca_uint32_t payloadSize;
void *pPayload;
int status;
int local_fl = 0;
db_field_log *pfl = NULL;
if ( ! pciu ) {
@@ -702,21 +688,9 @@ static int read_action ( caHdrLargeArray *mp, void *pPayloadIn, struct client *p
return RSRV_OK;
}
/* If filters are involved in a read, create field log and run filters */
if (ellCount(&pciu->dbch->pre_chain) || ellCount(&pciu->dbch->post_chain)) {
pfl = db_create_read_log(pciu->dbch);
if (pfl) {
local_fl = 1;
pfl = dbChannelRunPreChain(pciu->dbch, pfl);
pfl = dbChannelRunPostChain(pciu->dbch, pfl);
}
}
status = dbChannel_get ( pciu->dbch, mp->m_dataType,
pPayload, mp->m_count, pfl );
if (local_fl) db_delete_field_log(pfl);
if ( status < 0 ) {
send_err ( mp, ECA_GETFAIL, pClient, RECORD_NAME ( pciu->dbch ) );
SEND_UNLOCK ( pClient );

View File

@@ -81,7 +81,7 @@ link(calc, lnkCalcIf)
=head3 Calculation Link C<"calc">
A calculation link is an input link that can evaluate mathematical expressions
on scalar (double-precision floating-point) values obtained from up to 12 child
on scalar (double-precision floating-point) values obtained from up to 21 child
input links, and returns a double-precision floating-point result. The
expression is evaluated by the EPICS Calc engine, and the result is returned as
the value of the link.
@@ -95,7 +95,7 @@ record will be placed in C<LINK/MAJOR> alarm. If not and the C<minor> expression
evaluates to non-zero the record will be placed in C<LINK/MINOR> alarm state.
A calculation link can also be an output link, with the scalar output value
being converted to a double and provided to the expression as C<VAL>. Up to 12
being converted to a double and provided to the expression as C<VAL>. Up to 21
additional input links can also be read and provided to the expression as above.
The result of the calculation is forwarded to a child output link specified in
the link's C<out> parameter.
@@ -127,7 +127,7 @@ An optional expression that returns non-zero to raise a minor alarm.
=item args
A JSON list of up to 12 input arguments for the expression, which are assigned
to the inputs C<A>, C<B>, C<C>, ... C<L>. Each input argument may be either a
to the inputs C<A>, C<B>, C<C>, ... C<U>. Each input argument may be either a
numeric literal or an embedded JSON link inside C<{}> braces. The same input
values are provided to the two alarm expressions as to the primary expression.
@@ -149,7 +149,7 @@ result should be displayed. Equivalent to the C<PREC> field of a record.
=item time
An optional string containing a single upper or lower-case letter C<A> ... C<L>
An optional string containing a single upper or lower-case letter C<A> ... C<U>
which must correspond to an input provided in the C<args> parameter. When the
record containing such a link has C<TSEL> set to -2 (epicsTimeEventDeviceTime)
the record's timestamp field C<TIME> will be read from the indicated input link

View File

@@ -177,7 +177,7 @@ static jlif_result lnkCalc_string(jlink *pjlink, const char *val, size_t len)
if (clink->pstate == ps_time) {
char tinp;
if (len != 1 || (tinp = toupper((int) val[0])) < 'A' || tinp > 'L') {
if (len != 1 || (tinp = toupper((int) val[0])) < 'A' || tinp >= 'A' + CALCPERFORM_NARGS) {
errlogPrintf("lnkCalc: Bad 'time' parameter \"%.*s\"\n", (int) len, val);
return jlif_stop;
}

View File

@@ -159,9 +159,9 @@ static long special(DBADDR *paddr, int after)
#define indexof(field) calcRecord##field
static long get_linkNumber(int fieldIndex) {
if (fieldIndex >= indexof(A) && fieldIndex <= indexof(L))
if (fieldIndex >= indexof(A) && fieldIndex < indexof(A) + CALCPERFORM_NARGS)
return fieldIndex - indexof(A);
if (fieldIndex >= indexof(LA) && fieldIndex <= indexof(LL))
if (fieldIndex >= indexof(LA) && fieldIndex < indexof(LA) + CALCPERFORM_NARGS)
return fieldIndex - indexof(LA);
return -1;
}

View File

@@ -34,8 +34,8 @@ These fields are described in L<Scan Fields|dbCommonRecord/Scan Fields>.
=head3 Read Parameters
The read parameters for the Calc record consist of 12 input links INPA,
INPB, ... INPL. The fields can be database links, channel access links, or
The read parameters for the Calc record consist of 21 input links INPA -
INPU. The fields can be database links, channel access links, or
constants. If they are links, they must specify another record's field or a
channel access link. If they are constants, they will be initialized with
the value they are configured with and can be changed via C<dbPuts>. They
@@ -45,7 +45,7 @@ See L<Address
Specification|https://docs.epics-controls.org/en/latest/guides/EPICS_Process_Database_Concepts.html#address-specification>
for information on how to specify database links.
=fields INPA, INPB, INPC, INPD, INPE, INPF, INPG, INPH, INPI, INPJ, INPK, INPL
=fields INPA - INPU
=head3 Expression
@@ -113,7 +113,7 @@ radians to degrees
The expression uses the values retrieved from the INPx links as operands,
though constants can be used as operands too. These values retrieved from
the input links are stored in the A-L fields. The values to be used in the
the input links are stored in the A-U fields. The values to be used in the
expression are simply referenced by the field letter. For instance, the
value obtained from INPA link is stored in the field A, and the value
obtained from INPB is stored in field B. The field names can be included in
@@ -121,7 +121,7 @@ the expression which will operate on their respective values, as in A+B.
Also, the RNDM nullary function can be included as an operand in the
expression in order to generate a random number between 0 and 1.
=fields A, B, C, D, E, F, G, H, I, J, K, L
=fields A - L
The keyword VAL returns the current contents of the VAL field (which can be
written to by a CA put, so it might I<not> be the result from the last time
@@ -492,12 +492,12 @@ modifiable at run-time. They are used to process the record.
The LALM field is used to implement the hysteresis factor for the alarm
limits.
The LA-LL fields are used to decide when to trigger monitors for the
The LA-LU fields are used to decide when to trigger monitors for the
corresponding fields. For instance, if LA does not equal the value A,
monitors for A are triggered. The MLST and ALST fields are used in the same
manner for the VAL field.
=fields LALM, ALST, MLST, LA, LB, LC, LD, LE, LF, LG, LH, LI, LJ, LK, LL
=fields LALM, ALST, MLST, LA - LU
=cut
@@ -512,7 +512,7 @@ manner for the VAL field.
promptgroup("30 - Action")
special(SPC_CALC)
pp(TRUE)
size(80)
size(160)
initial("0")
}
field(INPA,DBF_INLINK) {
@@ -575,6 +575,60 @@ manner for the VAL field.
promptgroup("42 - Input G-L")
interest(1)
}
field(INPM,DBF_INLINK) {
prompt("Input M")
special(SPC_MOD)
promptgroup("43 - Input M-R")
interest(1)
}
field(INPN,DBF_INLINK) {
prompt("Input N")
special(SPC_MOD)
promptgroup("43 - Input M-R")
interest(1)
}
field(INPO,DBF_INLINK) {
prompt("Input O")
special(SPC_MOD)
promptgroup("43 - Input M-R")
interest(1)
}
field(INPP,DBF_INLINK) {
prompt("Input P")
special(SPC_MOD)
promptgroup("43 - Input M-R")
interest(1)
}
field(INPQ,DBF_INLINK) {
prompt("Input Q")
special(SPC_MOD)
promptgroup("43 - Input M-R")
interest(1)
}
field(INPR,DBF_INLINK) {
prompt("Input R")
special(SPC_MOD)
promptgroup("43 - Input M-R")
interest(1)
}
field(INPS,DBF_INLINK) {
prompt("Input S")
special(SPC_MOD)
promptgroup("44 - Input S-U")
interest(1)
}
field(INPT,DBF_INLINK) {
prompt("Input T")
special(SPC_MOD)
promptgroup("44 - Input S-U")
interest(1)
}
field(INPU,DBF_INLINK) {
prompt("Input U")
special(SPC_MOD)
promptgroup("44 - Input S-U")
interest(1)
}
field(EGU,DBF_STRING) {
prompt("Engineering Units")
promptgroup("80 - Display")
@@ -733,6 +787,42 @@ manner for the VAL field.
prompt("Value of Input L")
pp(TRUE)
}
field(M,DBF_DOUBLE) {
prompt("Value of Input M")
pp(TRUE)
}
field(N,DBF_DOUBLE) {
prompt("Value of Input N")
pp(TRUE)
}
field(O,DBF_DOUBLE) {
prompt("Value of Input O")
pp(TRUE)
}
field(P,DBF_DOUBLE) {
prompt("Value of Input P")
pp(TRUE)
}
field(Q,DBF_DOUBLE) {
prompt("Value of Input Q")
pp(TRUE)
}
field(R,DBF_DOUBLE) {
prompt("Value of Input R")
pp(TRUE)
}
field(S,DBF_DOUBLE) {
prompt("Value of Input S")
pp(TRUE)
}
field(T,DBF_DOUBLE) {
prompt("Value of Input T")
pp(TRUE)
}
field(U,DBF_DOUBLE) {
prompt("Value of Input U")
pp(TRUE)
}
field(LA,DBF_DOUBLE) {
prompt("Prev Value of A")
special(SPC_NOMOD)
@@ -793,6 +883,51 @@ manner for the VAL field.
special(SPC_NOMOD)
interest(3)
}
field(LM,DBF_DOUBLE) {
prompt("Prev Value of M")
special(SPC_NOMOD)
interest(3)
}
field(LN,DBF_DOUBLE) {
prompt("Prev Value of N")
special(SPC_NOMOD)
interest(3)
}
field(LO,DBF_DOUBLE) {
prompt("Prev Value of O")
special(SPC_NOMOD)
interest(3)
}
field(LP,DBF_DOUBLE) {
prompt("Prev Value of P")
special(SPC_NOMOD)
interest(3)
}
field(LQ,DBF_DOUBLE) {
prompt("Prev Value of Q")
special(SPC_NOMOD)
interest(3)
}
field(LR,DBF_DOUBLE) {
prompt("Prev Value of R")
special(SPC_NOMOD)
interest(3)
}
field(LS,DBF_DOUBLE) {
prompt("Prev Value of S")
special(SPC_NOMOD)
interest(3)
}
field(LT,DBF_DOUBLE) {
prompt("Prev Value of T")
special(SPC_NOMOD)
interest(3)
}
field(LU,DBF_DOUBLE) {
prompt("Prev Value of U")
special(SPC_NOMOD)
interest(3)
}
field(LALM,DBF_DOUBLE) {
prompt("Last Value Alarmed")
special(SPC_NOMOD)
@@ -813,7 +948,7 @@ manner for the VAL field.
prompt("Reverse Polish Calc")
special(SPC_NOMOD)
interest(4)
extra("char rpcl[INFIX_TO_POSTFIX_SIZE(80)]")
extra("char rpcl[INFIX_TO_POSTFIX_SIZE(160)]")
}
=head2 Record Support
@@ -911,7 +1046,7 @@ Archive and values change monitors are invoked if ADEL and MDEL conditions
are met.
=item *
Monitors for A-L are checked whenever other monitors are invoked.
Monitors for A-U are checked whenever other monitors are invoked.
=item *
NSEV and NSTA are reset to 0.

View File

@@ -355,6 +355,15 @@ static long special(DBADDR *paddr, int after)
case(calcoutRecordINPJ):
case(calcoutRecordINPK):
case(calcoutRecordINPL):
case(calcoutRecordINPM):
case(calcoutRecordINPN):
case(calcoutRecordINPO):
case(calcoutRecordINPP):
case(calcoutRecordINPQ):
case(calcoutRecordINPR):
case(calcoutRecordINPS):
case(calcoutRecordINPT):
case(calcoutRecordINPU):
case(calcoutRecordOUT):
lnkIndex = fieldIndex - calcoutRecordINPA;
plink = &prec->inpa + lnkIndex;
@@ -406,9 +415,9 @@ static long special(DBADDR *paddr, int after)
#define indexof(field) calcoutRecord##field
static long get_linkNumber(int fieldIndex) {
if (fieldIndex >= indexof(A) && fieldIndex <= indexof(L))
if (fieldIndex >= indexof(A) && fieldIndex < indexof(A) + CALCPERFORM_NARGS)
return fieldIndex - indexof(A);
if (fieldIndex >= indexof(LA) && fieldIndex <= indexof(LL))
if (fieldIndex >= indexof(LA) && fieldIndex < indexof(LA) + CALCPERFORM_NARGS)
return fieldIndex - indexof(LA);
return -1;
}

View File

@@ -57,18 +57,18 @@ These fields are listed in L<Scan Fields|dbCommonRecord/Scan Fields>.
=head3 Read Parameters
The read parameters for the Calcout record consists of 12 input links INPA,
INPB, ... INPL. The fields can be database links, channel access links, or
The read parameters for the Calcout record consists of 21 input links INPA -
INPU. The fields can be database links, channel access links, or
constants. If they are links, they must specify another record's field. If
they are constants, they will be initialized with the value they are
configured with and can be changed via C<dbPuts>. These fields cannot be
hardware addresses. In addition, the Calcout record contains the INAV,
INBV, ... INLV fields which indicate the status of the link fields, for
hardware addresses. In addition, the Calcout record contains the INAV -
INUV fields which indicate the status of the link fields, for
example, whether or not the specified PV was found and a link to it
established. See L<Operator Display Parameters> for an explanation of these
fields.
=fields INPA, INPB, INPC, INPD, INPE, INPF, INPG, INPH, INPI, INPJ, INPK, INPL
=fields INPA - INPU
=head3 Expression
@@ -139,14 +139,14 @@ angle from radians to degrees
The expression can use the values retrieved from the INPx links as
operands, though constants can be used as operands too. These values
retrieved from the input links are stored in the A-L fields. The values to
retrieved from the input links are stored in the A-U fields. The values to
be used in the expression are simple references by the field letter. For
instance, the value obtained from the INPA link is stored in field A, and
the values obtained from the INPB link is stored in the field B. The names
can be included in the expression will operate on their respective values,
as in A+B.
=fields A, B, C, D, E, F, G, H, I, J, K, L
=fields A - U
The keyword VAL returns the current contents of the expression's result
field, i.e. the VAL field for the CALC expression and the OVAL field for
@@ -543,8 +543,8 @@ LOW, and LOLO fields. PREC controls the precision of the VAL field.
=head4 Menu calcoutINAV
The INAV-INLV fields indicate the status of the link to the PVs specified
in the INPA-INPL fields respectively. These fields can have four possible
The INAV-INUV fields indicate the status of the link to the PVs specified
in the INPA-INPU fields respectively. These fields can have four possible
values:
=menu calcoutINAV
@@ -568,7 +568,7 @@ C<Constant> -- the corresponding link field is a constant.
=back
The OUTV field indicates the status of the OUT link. If has the same
possible values as the INAV-INLV fields.
possible values as the INAV-INUV fields.
The CLCV and OLCV fields indicate the validity of the expression in the
CALC and OCAL fields respectively. If the expression in invalid, the field
@@ -579,7 +579,7 @@ The DLYA field is set to one during the delay specified in ODLY.
See L<Fields Common to All Record Types|dbCommonRecord/Operator Display
Parameters> for more on the record name (NAME) and description (DESC) fields.
=fields EGU, PREC, HOPR, LOPR, INAV, INBV, INCV, INDV, INEV, INFV, INGV, INHV, INIV, INJV, INKV, INLV, OUTV, CLCV, OCLV, DLYA, NAME, DESC
=fields EGU, PREC, HOPR, LOPR, INAV - INUV, OUTV, CLCV, OCLV, DLYA, NAME, DESC
=head3 Alarm Parameters
@@ -623,12 +623,12 @@ modifiable at run-time. They are used to process the record.
The LALM field is used to implement the hysteresis factor for the alarm
limits.
The LA-LL fields are used to decide when to trigger monitors for the
The LA-LU fields are used to decide when to trigger monitors for the
corresponding fields. For instance, if LA does not equal the value for A,
monitors for A are triggered. The MLST and ALST fields are used in the same
manner for the VAL field.
=fields LALM, ALST, MLST, LA, LB, LC, LD, LE, LF, LG, LH, LI, LJ, LK, LL
=fields LALM, ALST, MLST, LA - LU
=cut
@@ -660,7 +660,7 @@ manner for the VAL field.
promptgroup("30 - Action")
special(SPC_CALC)
pp(TRUE)
size(80)
size(160)
initial("0")
}
field(CLCV,DBF_LONG) {
@@ -739,6 +739,60 @@ manner for the VAL field.
promptgroup("42 - Input G-L")
interest(1)
}
field(INPM,DBF_INLINK) {
prompt("Input M")
special(SPC_MOD)
promptgroup("43 - Input M-R")
interest(1)
}
field(INPN,DBF_INLINK) {
prompt("Input N")
special(SPC_MOD)
promptgroup("43 - Input M-R")
interest(1)
}
field(INPO,DBF_INLINK) {
prompt("Input O")
special(SPC_MOD)
promptgroup("43 - Input M-R")
interest(1)
}
field(INPP,DBF_INLINK) {
prompt("Input P")
special(SPC_MOD)
promptgroup("43 - Input M-R")
interest(1)
}
field(INPQ,DBF_INLINK) {
prompt("Input Q")
special(SPC_MOD)
promptgroup("43 - Input M-R")
interest(1)
}
field(INPR,DBF_INLINK) {
prompt("Input R")
special(SPC_MOD)
promptgroup("43 - Input M-R")
interest(1)
}
field(INPS,DBF_INLINK) {
prompt("Input S")
special(SPC_MOD)
promptgroup("44 - Input S-U")
interest(1)
}
field(INPT,DBF_INLINK) {
prompt("Input T")
special(SPC_MOD)
promptgroup("44 - Input S-U")
interest(1)
}
field(INPU,DBF_INLINK) {
prompt("Input U")
special(SPC_MOD)
promptgroup("44 - Input S-U")
interest(1)
}
field(OUT,DBF_OUTLINK) {
prompt("Output Specification")
special(SPC_MOD)
@@ -829,6 +883,69 @@ manner for the VAL field.
menu(calcoutINAV)
initial("1")
}
field(INMV,DBF_MENU) {
prompt("INPM PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INNV,DBF_MENU) {
prompt("INPN PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INOV,DBF_MENU) {
prompt("INPO PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INPV,DBF_MENU) {
prompt("INPP PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INQV,DBF_MENU) {
prompt("INPQ PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INRV,DBF_MENU) {
prompt("INPR PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INSV,DBF_MENU) {
prompt("INPS PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INTV,DBF_MENU) {
prompt("INPT PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(INUV,DBF_MENU) {
prompt("INPU PV Status")
special(SPC_NOMOD)
interest(1)
menu(calcoutINAV)
initial("1")
}
field(OUTV,DBF_MENU) {
prompt("OUT PV Status")
special(SPC_NOMOD)
@@ -863,7 +980,7 @@ manner for the VAL field.
promptgroup("30 - Action")
special(SPC_CALC)
pp(TRUE)
size(80)
size(160)
initial("0")
}
field(OCLV,DBF_LONG) {
@@ -1043,6 +1160,42 @@ manner for the VAL field.
prompt("Value of Input L")
pp(TRUE)
}
field(M,DBF_DOUBLE) {
prompt("Value of Input M")
pp(TRUE)
}
field(N,DBF_DOUBLE) {
prompt("Value of Input N")
pp(TRUE)
}
field(O,DBF_DOUBLE) {
prompt("Value of Input O")
pp(TRUE)
}
field(P,DBF_DOUBLE) {
prompt("Value of Input P")
pp(TRUE)
}
field(Q,DBF_DOUBLE) {
prompt("Value of Input Q")
pp(TRUE)
}
field(R,DBF_DOUBLE) {
prompt("Value of Input R")
pp(TRUE)
}
field(S,DBF_DOUBLE) {
prompt("Value of Input S")
pp(TRUE)
}
field(T,DBF_DOUBLE) {
prompt("Value of Input T")
pp(TRUE)
}
field(U,DBF_DOUBLE) {
prompt("Value of Input U")
pp(TRUE)
}
field(OVAL,DBF_DOUBLE) {
prompt("Output Value")
asl(ASL0)
@@ -1107,6 +1260,51 @@ manner for the VAL field.
special(SPC_NOMOD)
interest(3)
}
field(LM,DBF_DOUBLE) {
prompt("Prev Value of M")
special(SPC_NOMOD)
interest(3)
}
field(LN,DBF_DOUBLE) {
prompt("Prev Value of N")
special(SPC_NOMOD)
interest(3)
}
field(LO,DBF_DOUBLE) {
prompt("Prev Value of O")
special(SPC_NOMOD)
interest(3)
}
field(LP,DBF_DOUBLE) {
prompt("Prev Value of P")
special(SPC_NOMOD)
interest(3)
}
field(LQ,DBF_DOUBLE) {
prompt("Prev Value of Q")
special(SPC_NOMOD)
interest(3)
}
field(LR,DBF_DOUBLE) {
prompt("Prev Value of R")
special(SPC_NOMOD)
interest(3)
}
field(LS,DBF_DOUBLE) {
prompt("Prev Value of S")
special(SPC_NOMOD)
interest(3)
}
field(LT,DBF_DOUBLE) {
prompt("Prev Value of T")
special(SPC_NOMOD)
interest(3)
}
field(LU,DBF_DOUBLE) {
prompt("Prev Value of U")
special(SPC_NOMOD)
interest(3)
}
field(POVL,DBF_DOUBLE) {
prompt("Prev Value of OVAL")
asl(ASL0)
@@ -1131,13 +1329,13 @@ manner for the VAL field.
prompt("Reverse Polish Calc")
special(SPC_NOMOD)
interest(4)
extra("char rpcl[INFIX_TO_POSTFIX_SIZE(80)]")
extra("char rpcl[INFIX_TO_POSTFIX_SIZE(160)]")
}
field(ORPC,DBF_NOACCESS) {
prompt("Reverse Polish OCalc")
special(SPC_NOMOD)
interest(4)
extra("char orpc[INFIX_TO_POSTFIX_SIZE(80)]")
extra("char orpc[INFIX_TO_POSTFIX_SIZE(160)]")
}
=head2 Record Support
@@ -1241,7 +1439,7 @@ Archive and value change monitors are invoked if ADEL and MDEL conditions
are met.
=item *
Monitors for A-L are checked whenever other monitors are invoked.
Monitors for A-U are checked whenever other monitors are invoked.
=item *
NSEV and NSTA are reset to 0

View File

@@ -222,11 +222,11 @@ sub rtypeToPod {
my ($rtyp, $dbd) = @_;
return map {
# Handle a 'fields' Pod directive
if (m/^ =fields \s+ (\w+ (?:\s* , \s* \w+ )* )/x) {
my @names = split /\s*,\s*/, $1;
if (m/^ =fields \s+ (\w+ (?:\s* [,-] \s* \w+ )* )/x) {
my @names = split /\s*,\s*|\s*(?=-)|(?<=-)\s*/, $1;
# Look up the named fields
my @fields = map {
my $field = $rtyp->field($_);
my $field = $_ eq '-' ? $_ : $rtyp->field($_);
die "Unknown field name '$_' in $infile POD\n"
unless $field;
$field;
@@ -256,6 +256,9 @@ sub rtypeToPod {
sub fieldTableRow {
my ($fld, $dbd) = @_;
if ($fld eq '-') {
return '<tr><td class="cell" colspan=8>&vellip;</td></tr>'."\n";
}
my $html = '<tr><td class="cell">';
$html .= $fld->name;
$html .= '</td><td class="cell">';

View File

@@ -149,33 +149,33 @@ close $out;
sub menuToMD {
my ($menu) = @_;
my $index = 0;
return "| Index | Identifier | Choice String |",
"| ----- | ---------- | ------------- |",
return "| Index | Identifier | Choice String |",
"| ----- | -------------------------------------- | ---------------------- |",
map({choiceTableRow($_, $index++)} $menu->choices);
}
sub choiceTableRow {
my ($ch, $index) = @_;
my ($id, $name) = @{$ch};
return "| $index | $id | $name |";
return sprintf("| %5d | %-*s | %-22s |", $index, 38-( () = $id =~ /_/g), $id, $name);
}
sub rtypeToMD {
my ($rtyp, $dbd) = @_;
return map {
# Handle a 'fields' Pod directive
if (m/^ =fields \s+ (\w+ (?:\s* , \s* \w+ )* )/x) {
my @names = split /\s*,\s*/, $1;
if (m/^ =fields \s+ (\w+ (?:\s* [,-] \s* \w+ )* )/x) {
my @names = split /\s*,\s*|\s*(?=-)|(?<=-)\s*/, $1;
# Look up the named fields
my @fields = map {
my $field = $rtyp->field($_);
my $field = $_ eq '-' ? $_ : $rtyp->field($_);
die "Unknown field name '$_' in $infile POD\n"
unless $field;
$field;
} @names;
# Generate Pod for the table
"| Field | Summary | Type | DCT | Default | Read | Write | CA PP |",
"| ----- | ------- | ---- | --- | ------- | ---- | ----- | ----- |",
"| Field | Summary | Type | DCT | Default | Read | Write | CA PP |",
"| ----- | -------------------------- | ------------- | --- | ------- | ---- | ----- | ----- |",
map({fieldTableRow($_, $dbd)} @fields);
}
# Handle a 'menu' Pod directive
@@ -195,12 +195,15 @@ sub rtypeToMD {
sub fieldTableRow {
my ($fld, $dbd) = @_;
if ($fld eq '-') {
return "| \x{22EE}".(" " x 83)."||||||||";
}
my @md;
push @md, $fld->name, $fld->attribute('prompt');
push @md, sprintf("%-5s", $fld->name), sprintf("%-26s", $fld->attribute('prompt'));
my $type = $fld->public_type;
if ($type eq 'STRING') {
$type .= ' [' . $fld->attribute('size') . ']';
$type .= sprintf("%-5s", ' [' . $fld->attribute('size') . ']');
} elsif ($type eq 'MENU') {
my $mn = $fld->attribute('menu');
my $menu = $dbd->menu($mn);
@@ -208,14 +211,16 @@ sub fieldTableRow {
my $url = $menu ? "/menu-$mnl" : "${mn}.md";
#just pass a L directive for the parser
$type .= " L<$mn|$url>";
} else {
$type = sprintf("%-13s", $type);
}
push @md, $type;
push @md, $fld->attribute('promptgroup') ? 'Yes' : 'No';
push @md, $fld->attribute('initial') || ' ';
push @md, $fld->readable;
push @md, $fld->writable;
push @md, $fld->attribute('pp') eq 'TRUE' ? 'Yes' : 'No';
push @md, sprintf("%-3s", $fld->attribute('promptgroup') ? 'Yes' : 'No');
push @md, sprintf("%7s", $fld->attribute('initial') || ' ');
push @md, sprintf("%-4s",$fld->readable);
push @md, sprintf("%-5s",$fld->writable);
push @md, sprintf("%-5s",$fld->attribute('pp') eq 'TRUE' ? 'Yes' : 'No');
return '| ' . join(' | ', @md) . ' |';
}

View File

@@ -130,9 +130,11 @@ static void check(short dbr_type) {
off = Offset; req = 10; \
memset(buf, 0, sizeof(buf)); \
(void) dbPutField(&offaddr, DBR_LONG, &off, 1); \
dbScanLock(dbChannelRecord(pch)); \
pfl = db_create_read_log(pch); \
testOk(pfl && pfl->type == dbfl_type_ref, "Valid pfl, type = ref"); \
testOk(!dbChannelGetField(pch, DBR_LONG, buf, NULL, &req, pfl), "Got Field value"); \
testOk(!dbChannelGet(pch, DBR_LONG, buf, NULL, &req, pfl), "Got Field value"); \
dbScanUnlock(dbChannelRecord(pch)); \
testOk(req == Size, "Got %ld elements (expected %d)", req, Size); \
if (!testOk(!memcmp(buf, Expected, sizeof(Expected)), "Data correct")) \
for (i=0; i<Size; i++) \
@@ -174,6 +176,7 @@ static void check(short dbr_type) {
off = Offset; req = 15; \
memset(buf, 0, sizeof(buf)); \
(void) dbPutField(&offaddr, DBR_LONG, &off, 1); \
dbScanLock(dbChannelRecord(pch)); \
pfl = db_create_read_log(pch); \
pfl->type = dbfl_type_ref; \
pfl->field_type = DBF_CHAR; \
@@ -181,7 +184,8 @@ static void check(short dbr_type) {
pfl->no_elements = 26; \
pfl->dtor = freeArray; \
pfl->u.r.field = epicsStrDup("abcdefghijklmnopqrsstuvwxyz"); \
testOk(!dbChannelGetField(pch, DBR_LONG, buf, NULL, &req, pfl), "Got Field value"); \
testOk(!dbChannelGet(pch, DBR_LONG, buf, NULL, &req, pfl), "Got Field value"); \
dbScanUnlock(dbChannelRecord(pch)); \
testOk(req == Size, "Got %ld elements (expected %d)", req, Size); \
if (!testOk(!memcmp(buf, Expected, sizeof(Expected)), "Data correct")) \
for (i=0; i<Size; i++) \

View File

@@ -40,6 +40,8 @@ void oneReport(unsigned level)
void oneStats(unsigned *channels, unsigned *clients)
{
oneState = STATS_CALLED;
if (channels) *channels = 2;
if (clients) *clients = 1;
}
int oneClient(char *pbuf, size_t len)
@@ -128,8 +130,9 @@ MAIN(dbServerTest)
char name[16];
char *theName = "The One";
int status;
unsigned ch=0, cl=0;
testPlan(25);
testPlan(35);
/* Prove that we handle substring names properly */
epicsEnvSet("EPICS_IOC_IGNORE_SERVERS", "none ones");
@@ -151,6 +154,9 @@ MAIN(dbServerTest)
testDiag("Registering dbServer 'disabled'");
testOk(dbRegisterServer(&disabled) == 0, "Registration accepted");
testOk(dbServerStats("one", &ch, &cl) == -1 && oneState == NOTHING_CALLED,
"dbServerStats returns error before IOC running");
testDiag("Changing server state");
dbInitServers();
testOk(oneState == INIT_CALLED, "dbInitServers");
@@ -163,8 +169,26 @@ MAIN(dbServerTest)
testDiag("Checking server methods called");
dbsr(0);
testOk(oneState == REPORT_CALLED, "dbsr called report()");
testOk(oneState == REPORT_CALLED, "dbsr called one::report()");
testDiag("Checking stats functionality");
testOk(dbServerStats("none", &ch, &cl) == 0, "Stats: unknown name ignored");
testOk(dbServerStats("one", &ch, &cl) == 1 && oneState == STATS_CALLED,
"dbServerStats('one') called one::stats()");
testOk(ch == 2 && cl == 1, "Stats: ch==%d, cl==%d (expected 2, 1)", ch, cl);
testOk(dbServerStats("no-routines", &ch, &cl) == 0,
"dbServerStats('no-routines') layer not counted");
testOk(ch == 0 && cl == 0, "Stats: ch==%d, cl==%d (expected 0, 0)", ch, cl);
ch = 10; cl = 10; oneState = NOTHING_CALLED;
testOk(dbServerStats(NULL, NULL, &cl) == 1 && oneState == STATS_CALLED,
"dbServerStats(NULL, &cl) called one::stats()");
testOk(dbServerStats(NULL, &ch, NULL) == 1 && oneState == STATS_CALLED,
"dbServerStats(NULL, &ch) called one::stats()");
testOk(ch == 2 && cl == 1, "Stats: ch==%d, cl==%d (expected 2, 1)", ch, cl);
testDiag("Checking client identification");
oneSim = NULL;
name[0] = 0;
status = dbServerClient(name, sizeof(name));
@@ -188,6 +212,9 @@ MAIN(dbServerTest)
status = dbServerClient(name, sizeof(name));
testOk(oneState != CLIENT_CALLED_KNOWN, "No call to client() when paused");
testOk(dbServerStats("one", &ch, &cl) == -1 && oneState != STATS_CALLED,
"No call to stats() when paused");
dbStopServers();
testOk(oneState == STOP_CALLED, "dbStopServers");
testOk(dbUnregisterServer(&toolate) != 0, "No unreg' if not reg'ed");

View File

@@ -221,28 +221,27 @@ testHarness_SRCS += linkFilterTest.c
TESTFILES += ../linkFilterTest.db
TESTS += linkFilterTest
# These are compile-time tests, no need to link or run
TARGETS += dbHeaderTest$(OBJ)
TARGET_SRCS += dbHeaderTest.cpp
TARGETS += dbHeaderTestxx$(OBJ)
TARGET_SRCS += dbHeaderTestxx.cpp
TARGETS += $(COMMON_DIR)/epicsExportTestIoc.dbd
DBDDEPENDS_FILES += epicsExportTestIoc.dbd$(DEP)
epicsExportTestIoc_DBD += base.dbd
epicsExportTestIoc_DBD += epicsExportTest.dbd
TESTFILES += $(COMMON_DIR)/epicsExportTestIoc.dbd ../epicsExportTest.db
TESTLIBRARY += epicsExportTestLib
epicsExportTestLib_SRCS += epicsExportTest.c
epicsExportTestLib_LIBS += dbCore Com
TESTPROD_HOST += epicsExportTest
TESTS += epicsExportTest
TARGETS += epicsExportTest$(OBJ)
epicsExportTest_SRCS += epicsExportTestMain.c
epicsExportTest_SRCS += epicsExportTestIoc_registerRecordDeviceDriver.cpp
epicsExportTest_LIBS = epicsExportTestLib
TESTLIBRARY += epicsExportTestxxLib
epicsExportTestxxLib_SRCS += epicsExportTestxx.cpp
epicsExportTestxxLib_LIBS += dbCore Com
TESTPROD_HOST += epicsExportTestxx
TESTS += epicsExportTestxx
TARGETS += epicsExportTestxx$(OBJ)
@@ -250,6 +249,12 @@ epicsExportTestxx_SRCS += epicsExportTestMain.c
epicsExportTestxx_SRCS += epicsExportTestIoc_registerRecordDeviceDriver.cpp
epicsExportTestxx_LIBS = epicsExportTestxxLib
# These are compile-time tests, no need to link or run
TARGETS += dbHeaderTest$(OBJ)
TARGET_SRCS += dbHeaderTest.cpp
TARGETS += dbHeaderTestxx$(OBJ)
TARGET_SRCS += dbHeaderTestxx.cpp
ifeq ($(T_A),$(EPICS_HOST_ARCH))
# Host-only tests of softIoc/softIocPVA, caget and pvget (if present)
# Unfortunately hangs too often on CI systems:

View File

@@ -27,6 +27,8 @@
#include <epicsExport.h>
int i1, i2;
volatile int v1=10, v2=20;
const int c1=100, c2=200;
static long myReadLongin(struct dbCommon* prec)
{
@@ -40,8 +42,8 @@ static long myReadLongin(struct dbCommon* prec)
return 0;
}
/* Also test cast from user-specific mydset to dset */
struct mydset {
/* Also test cast from user-specific const mydset to dset */
const struct mydset {
long number;
long (*report)(int);
long (*init)(int);
@@ -118,6 +120,8 @@ static long aSubProc2(aSubRecord* prec) {
/* Test without wrapping */
epicsExportAddress(int, i1);
epicsExportAddress(int, v1);
epicsExportAddress(int, c1);
epicsExportAddress(dset, dset1);
epicsExportRegistrar(registrar1);
epicsExportRegistrar(registrar3);
@@ -129,6 +133,8 @@ epicsRegisterFunction(aSubProc1);
extern "C" {
#endif
epicsExportAddress(int, i2);
epicsExportAddress(int, v2);
epicsExportAddress(int, c2);
epicsExportAddress(dset, dset2);
epicsExportRegistrar(registrar2);
epicsExportRegistrar(registrar4);

View File

@@ -1,5 +1,9 @@
variable(i1,int)
variable(i2,int)
variable(v1,int)
variable(v2,int)
variable(c1,int)
variable(c2,int)
device(longin, CONSTANT, dset1, "dset1")
device(longin, CONSTANT, dset2, "dset2")
registrar(registrar1)

View File

@@ -16,16 +16,38 @@
#include <iocsh.h>
#include <epicsExport.h>
void epicsExportTestIoc_registerRecordDeviceDriver(struct dbBase *);
#ifdef __cplusplus
extern "C"
#endif
int epicsExportTestIoc_registerRecordDeviceDriver(struct dbBase *);
static int* testVarEquals(const char* name, int expected)
{
const iocshVarDef *var;
int *p;
var = iocshFindVariable(name);
if (!var) {
testFail("Cannot access variable %s", name);
return NULL;
}
if (var->type != iocshArgInt) {
testFail("Variable %s has wrong type", name);
return NULL;
}
p = (int*)(var->pval);
testOk(*p == expected, "Variable %s == %d", name, expected);
return p;
}
MAIN(epicsExportTest)
{
const iocshVarDef *var_i1, *var_i2;
int *p1, *p2;
testPlan(26);
testPlan(31);
testdbPrepare();
testdbReadDatabase("epicsExportTestIoc.dbd", 0, 0);
epicsExportTestIoc_registerRecordDeviceDriver(pdbbase);
testOk(epicsExportTestIoc_registerRecordDeviceDriver(pdbbase)==0, "registerRecordDeviceDriver");
testDiag("Testing if dsets and functions are found");
testdbReadDatabase("epicsExportTest.db", 0, 0);
@@ -52,22 +74,21 @@ MAIN(epicsExportTest)
testdbGetFieldEqual("asub2.B", DBF_LONG, 4);
testDiag("Testing if variable access works");
var_i1 = iocshFindVariable("i1");
var_i2 = iocshFindVariable("i2");
if (var_i1 && var_i2 && var_i1->type == iocshArgInt && var_i2->type == iocshArgInt) {
int *pi1 = (int*)(var_i1->pval);
int *pi2 = (int*)(var_i2->pval);
p1 = testVarEquals("i1", 2);
p2 = testVarEquals("i2", 2);
testVarEquals("v1", 10);
testVarEquals("v2", 20);
testVarEquals("c1", 100);
testVarEquals("c2", 200);
testOk(*pi1==2, "Variable i1 counted registrars: %d == 2", *pi1);
testOk(*pi2==2, "Variable i2 counted registrars: %d == 2", *pi2);
if (p1 && p2) {
testDiag("Testing if variables are accessible from iocsh");
testOk(iocshCmd("var i1,4") == 0, "Setting i1 = 4 in iocsh");
testOk(iocshCmd("var i2,5") == 0, "Setting i2 = 5 in iocsh");
testOk(*pi1==4, "Variable i1: %d == 4", *pi1);
testOk(*pi2==5, "Variable i2: %d == 5", *pi2);
} else {
testFail("Cannot access variables i1, i2");
testOk(*p1==4, "Variable i1 == 4");
testOk(*p2==5, "Variable i2 == 5");
}
testIocShutdownOk();
testdbCleanup();
return testDone();

View File

@@ -18,7 +18,7 @@ stringchar [^"\n\\]
name [a-zA-Z0-9_\-+:.\[\]<>;]
digit [0-9]
punctuation [(){},]
link [A-L]
link [A-U]
%{
static ASINPUTFUNCPTR *my_yyinput;

View File

@@ -86,6 +86,15 @@ LIBCOM_API long
case FETCH_J:
case FETCH_K:
case FETCH_L:
case FETCH_M:
case FETCH_N:
case FETCH_O:
case FETCH_P:
case FETCH_Q:
case FETCH_R:
case FETCH_S:
case FETCH_T:
case FETCH_U:
*++ptop = parg[op - FETCH_A];
break;
@@ -101,6 +110,15 @@ LIBCOM_API long
case STORE_J:
case STORE_K:
case STORE_L:
case STORE_M:
case STORE_N:
case STORE_O:
case STORE_P:
case STORE_Q:
case STORE_R:
case STORE_S:
case STORE_T:
case STORE_U:
parg[op - STORE_A] = *ptop--;
break;
@@ -441,6 +459,15 @@ calcArgUsage(const char *pinst, unsigned long *pinputs, unsigned long *pstores)
case FETCH_J:
case FETCH_K:
case FETCH_L:
case FETCH_M:
case FETCH_N:
case FETCH_O:
case FETCH_P:
case FETCH_Q:
case FETCH_R:
case FETCH_S:
case FETCH_T:
case FETCH_U:
/* Don't claim to use an arg we already stored to */
inputs |= (1 << (op - FETCH_A)) & ~stores;
break;
@@ -457,6 +484,15 @@ calcArgUsage(const char *pinst, unsigned long *pinputs, unsigned long *pstores)
case STORE_J:
case STORE_K:
case STORE_L:
case STORE_M:
case STORE_N:
case STORE_O:
case STORE_P:
case STORE_Q:
case STORE_R:
case STORE_S:
case STORE_T:
case STORE_U:
stores |= (1 << (op - STORE_A));
break;

View File

@@ -117,20 +117,29 @@ static const ELEMENT operands[] = {
{"LN", 7, 8, 0, UNARY_OPERATOR, LOG_E},
{"LOG", 7, 8, 0, UNARY_OPERATOR, LOG_10},
{"LOGE", 7, 8, 0, UNARY_OPERATOR, LOG_E},
{"M", 0, 0, 1, OPERAND, FETCH_M},
{"MAX", 7, 8, 0, VARARG_OPERATOR,MAX},
{"MIN", 7, 8, 0, VARARG_OPERATOR,MIN},
{"N", 0, 0, 1, OPERAND, FETCH_N},
{"NINT", 7, 8, 0, UNARY_OPERATOR, NINT},
{"NAN", 0, 0, 1, LITERAL_OPERAND,LITERAL_DOUBLE},
{"NOT", 7, 8, 0, UNARY_OPERATOR, BIT_NOT},
{"O", 0, 0, 1, OPERAND, FETCH_O},
{"P", 0, 0, 1, OPERAND, FETCH_P},
{"PI", 0, 0, 1, OPERAND, CONST_PI},
{"Q", 0, 0, 1, OPERAND, FETCH_Q},
{"R", 0, 0, 1, OPERAND, FETCH_R},
{"R2D", 0, 0, 1, OPERAND, CONST_R2D},
{"RNDM", 0, 0, 1, OPERAND, RANDOM},
{"S", 0, 0, 1, OPERAND, FETCH_S},
{"SIN", 7, 8, 0, UNARY_OPERATOR, SIN},
{"SINH", 7, 8, 0, UNARY_OPERATOR, SINH},
{"SQR", 7, 8, 0, UNARY_OPERATOR, SQU_RT},
{"SQRT", 7, 8, 0, UNARY_OPERATOR, SQU_RT},
{"T", 0, 0, 1, OPERAND, FETCH_T},
{"TAN", 7, 8, 0, UNARY_OPERATOR, TAN},
{"TANH", 7, 8, 0, UNARY_OPERATOR, TANH},
{"U", 0, 0, 1, OPERAND, FETCH_U},
{"VAL", 0, 0, 1, OPERAND, FETCH_VAL},
{"~", 7, 8, 0, UNARY_OPERATOR, BIT_NOT},
};
@@ -287,7 +296,7 @@ LIBCOM_API long
case STORE_OPERATOR:
if (pout == pdest || pstacktop > stack ||
*--pout < FETCH_A || *pout > FETCH_L) {
*--pout < FETCH_A || *pout >= FETCH_A + CALCPERFORM_NARGS) {
*perror = CALC_ERR_BAD_ASSIGNMENT;
goto bad;
}
@@ -549,9 +558,13 @@ LIBCOM_API void
"LITERAL_DOUBLE", "LITERAL_INT", "VAL",
"FETCH_A", "FETCH_B", "FETCH_C", "FETCH_D", "FETCH_E", "FETCH_F",
"FETCH_G", "FETCH_H", "FETCH_I", "FETCH_J", "FETCH_K", "FETCH_L",
"FETCH_M", "FETCH_N", "FETCH_O", "FETCH_P", "FETCH_Q", "FETCH_R",
"FETCH_S", "FETCH_T", "FETCH_U",
/* Assignment */
"STORE_A", "STORE_B", "STORE_C", "STORE_D", "STORE_E", "STORE_F",
"STORE_G", "STORE_H", "STORE_I", "STORE_J", "STORE_K", "STORE_L",
"STORE_M", "STORE_N", "STORE_O", "STORE_P", "STORE_Q", "STORE_R",
"STORE_S", "STORE_T", "STORE_U",
/* Trigonometry Constants */
"CONST_PI",
"CONST_D2R",

View File

@@ -22,8 +22,8 @@
#include "libComAPI.h"
/** \brief Number of input arguments to a calc expression (A-L) */
#define CALCPERFORM_NARGS 12
/** \brief Number of input arguments to a calc expression (A-U) */
#define CALCPERFORM_NARGS 21
/** \brief Size of the internal partial result stack */
#define CALCPERFORM_STACK 80
@@ -63,7 +63,7 @@
*
* This is not a hard limit, just the default size for the database
*/
#define MAX_INFIX_SIZE 100
#define MAX_INFIX_SIZE 160
/**
* \brief Size of a "standard" postfix buffer.
*
@@ -163,11 +163,11 @@ extern "C" {
*
* -# ***Variables***
* Variables are used to provide inputs to an expression, and are named
* using the single letters A through L inclusive or the keyword VAL which
* using the single letters A through U inclusive or the keyword VAL which
* refers to the previous result of this calculation. The software that
* makes use of the expression evaluation code should document how the
* individual variables are given values; for the calc record type the input
* links INPA through INPL can be used to obtain these from other record fields,
* links INPA through INPU can be used to obtain these from other record fields,
* and VAL refers to the the VAL field (which can be overwritten from outside
* the record via Channel Access or a database link).
*
@@ -310,7 +310,7 @@ LIBCOM_API long
*
* Evaluates the postfix expression against a set ot input values.
*
* \param parg Pointer to an array of double values for the arguments A-L
* \param parg Pointer to an array of double values for the arguments A-U
* that can appear in the expression. Note that the argument values may be
* modified if the expression uses the assignment operator.
* \param presult Where to put the calculated result, which may be a NaN or Infinity.
@@ -331,8 +331,8 @@ LIBCOM_API long
* for either of these pointers is legal if only the other is needed.
*
* The least significant bit (bit 0) of the bitmap at \c *pinputs will be set
* if the expression depends on the argument A, and so on through bit 11 for
* the argument L. An argument that is not used until after a value has been
* if the expression depends on the argument A, and so on through bit 20 for
* the argument U. An argument that is not used until after a value has been
* assigned to it will not be set in the pinputs bitmap, thus the bits can
* be used to determine whether a value needs to be supplied for their
* associated argument or not for the purposes of evaluating the expression.

View File

@@ -13,7 +13,7 @@
*/
/* Notes:
* 1. The FETCH_A through FETCH_L and STORE_A through STORE_L opcodes must
* 1. The FETCH_A through FETCH_U and STORE_A through STORE_U opcodes must
* be contiguous.
* 2. The LITERAL opcodes are followed by a binary representation of their
* values, but these are not aligned properly.
@@ -34,9 +34,13 @@ typedef enum {
LITERAL_DOUBLE, LITERAL_INT, FETCH_VAL,
FETCH_A, FETCH_B, FETCH_C, FETCH_D, FETCH_E, FETCH_F,
FETCH_G, FETCH_H, FETCH_I, FETCH_J, FETCH_K, FETCH_L,
FETCH_M, FETCH_N, FETCH_O, FETCH_P, FETCH_Q, FETCH_R,
FETCH_S, FETCH_T, FETCH_U,
/* Assignment */
STORE_A, STORE_B, STORE_C, STORE_D, STORE_E, STORE_F,
STORE_G, STORE_H, STORE_I, STORE_J, STORE_K, STORE_L,
STORE_M, STORE_N, STORE_O, STORE_P, STORE_Q, STORE_R,
STORE_S, STORE_T, STORE_U,
/* Trigonometry Constants */
CONST_PI,
CONST_D2R,

View File

@@ -21,6 +21,7 @@
#include "ellLib.h"
#include "epicsMutex.h"
#include "epicsThread.h"
#include "cantProceed.h"
#include "initHooks.h"
@@ -52,19 +53,26 @@ static void initHookInit(void)
int initHookRegister(initHookFunction func)
{
initHookLink *newHook;
ELLNODE *cur;
if (!func) return 0;
initHookInit();
newHook = (initHookLink *)malloc(sizeof(initHookLink));
if (!newHook) {
printf("Cannot malloc a new initHookLink\n");
return -1;
epicsMutexMustLock(listLock);
for(cur = ellFirst(&functionList); cur; cur = ellNext(cur)) {
const initHookLink *fn = CONTAINER(cur, initHookLink, node);
if(fn->func==func) {
/* silently ignore duplicate */
epicsMutexUnlock(listLock);
return 0;
}
}
newHook = (initHookLink *)mallocMustSucceed(sizeof(initHookLink), "initHookRegister");
newHook->func = func;
epicsMutexMustLock(listLock);
ellAdd(&functionList, &newHook->node);
epicsMutexUnlock(listLock);
return 0;

View File

@@ -163,7 +163,11 @@ typedef void (*initHookFunction)(initHookState state);
*
* Registers \p func for initHook notifications
* \param func Pointer to application's notification function.
* \return 0 if Ok, -1 on error (memory allocation failure).
* \return Always zero. (before UNRELEASED could return -1 on allocation failure)
*
* \since UNRELEASED initHookRegister is idempotent.
* Previously, repeated registrations would result
* in duplicate calls to the hook function.
*/
LIBCOM_API int initHookRegister(initHookFunction func);

View File

@@ -41,6 +41,10 @@ extern "C" {
typedef void (*REGISTRAR)(void);
#ifdef __cplusplus
}
#endif
#define EPICS_EXPORT_POBJ(typ, obj) pvar_ ## typ ## _ ## obj
#define EPICS_EXPORT_PFUNC(fun) EPICS_EXPORT_POBJ(func, fun)
@@ -79,7 +83,7 @@ typedef void (*REGISTRAR)(void);
#ifdef __cplusplus
#define epicsExportAddress(typ, obj) \
extern "C" { epicsShareExtern typ *EPICS_EXPORT_POBJ(typ,obj); } \
epicsShareDef typ *EPICS_EXPORT_POBJ(typ, obj) = reinterpret_cast<typ *>(&obj)
epicsShareDef typ *EPICS_EXPORT_POBJ(typ, obj) = (typ *) (char *) &obj
#else
#define epicsExportAddress(typ, obj) \
epicsShareExtern typ *EPICS_EXPORT_POBJ(typ,obj); \
@@ -136,8 +140,4 @@ typedef void (*REGISTRAR)(void);
epicsExportRegistrar(register_func_ ## fun)
#endif
#ifdef __cplusplus
}
#endif
#endif /* INC_epicsExport_H */

View File

@@ -362,9 +362,9 @@ epicsStrtod(const char *str, char **endp)
if (epicsStrnCaseCmp("0x", cp, 2) == 0) {
if (negative)
return strtol(str, endp, 16);
return strtoll(str, endp, 16);
else
return strtoul(str, endp, 16);
return strtoull(str, endp, 16);
}
if (!isalpha((int)*cp)) {
res = strtod(str, endp);

View File

@@ -21,11 +21,7 @@
# error compiler/gcc/compilerSpecific.h is only for use with the gnu compiler
#endif
#if __GNUC__ > 2
# define EPICS_ALWAYS_INLINE __inline__ __attribute__((always_inline))
#else
# define EPICS_ALWAYS_INLINE __inline__
#endif
#define EPICS_ALWAYS_INLINE __inline__ __attribute__((always_inline))
/* Expands to a 'const char*' which describes the name of the current function scope */
#define EPICS_FUNCTION __PRETTY_FUNCTION__
@@ -42,9 +38,7 @@
/*
* CXX_PLACEMENT_DELETE - defined if compiler supports placement delete
*/
#if __GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 96 )
# define CXX_PLACEMENT_DELETE
#endif
#define CXX_PLACEMENT_DELETE
#endif /* __cplusplus */
@@ -56,9 +50,7 @@
/*
* Deprecation marker
*/
#if (__GNUC__ > 2)
# define EPICS_DEPRECATED __attribute__((deprecated))
#endif
#define EPICS_DEPRECATED __attribute__((deprecated))
/*
* Unused marker
@@ -68,6 +60,9 @@
/*
* No return marker
*/
#ifndef vxWorks
// VxWorks does not mark abort() or exit() noreturn!
#define EPICS_NORETURN __attribute__((noreturn))
#endif
#endif /* ifndef compilerSpecific_h */

View File

@@ -339,32 +339,6 @@ void epicsThread :: show ( unsigned level ) const throw ()
}
extern "C" {
static epicsThreadOnceId okToBlockOnce = EPICS_THREAD_ONCE_INIT;
epicsThreadPrivateId okToBlockPrivate;
static const int okToBlockNo = 0;
static const int okToBlockYes = 1;
static void epicsThreadOnceIdInit(void *)
{
okToBlockPrivate = epicsThreadPrivateCreate();
}
int epicsStdCall epicsThreadIsOkToBlock(void)
{
const int *pokToBlock;
epicsThreadOnce(&okToBlockOnce, epicsThreadOnceIdInit, NULL);
pokToBlock = (int *) epicsThreadPrivateGet(okToBlockPrivate);
return (pokToBlock ? *pokToBlock : 0);
}
void epicsStdCall epicsThreadSetOkToBlock(int isOkToBlock)
{
const int *pokToBlock;
epicsThreadOnce(&okToBlockOnce, epicsThreadOnceIdInit, NULL);
pokToBlock = (isOkToBlock) ? &okToBlockYes : &okToBlockNo;
epicsThreadPrivateSet(okToBlockPrivate, (void *)pokToBlock);
}
epicsThreadId epicsStdCall epicsThreadMustCreate (
const char *name, unsigned int priority, unsigned int stackSize,
EPICSTHREADFUNC funptr,void *parm)
@@ -375,12 +349,3 @@ extern "C" {
return id;
}
} // extern "C"
static epicsThreadId initMainThread(void) {
epicsThreadId main = epicsThreadGetIdSelf();
epicsThreadSetOkToBlock(1);
return main;
}
// Ensure the main thread gets a unique ID and allows blocking I/O
epicsThreadId epicsThreadMainId = initMainThread();

View File

@@ -37,6 +37,7 @@ typedef struct epicsThreadOSD {
int isRealTimeScheduled;
int isOnThreadList;
int isRunning;
int isOkToBlock;
unsigned int osiPriority;
int joinable;
char name[1]; /* actually larger */

View File

@@ -55,6 +55,7 @@ struct taskVar {
int refcnt;
int joinable;
int isRunning;
int isOkToBlock;
EPICSTHREADFUNC funptr;
void *parm;
unsigned int threadVariableCapacity;
@@ -219,7 +220,7 @@ void epicsThreadExitMain (void)
static rtems_status_code
setThreadInfo(rtems_id tid, const char *name, EPICSTHREADFUNC funptr,
void *parm, int joinable)
void *parm, int joinable, int isOkToBlock)
{
struct taskVar *v;
uint32_t note;
@@ -235,6 +236,7 @@ setThreadInfo(rtems_id tid, const char *name, EPICSTHREADFUNC funptr,
v->threadVariableCapacity = 0;
v->threadVariables = NULL;
v->isRunning = 1;
v->isOkToBlock = isOkToBlock;
if (joinable) {
char c[3] = {0,0,0};
strncpy(c, v->name, 3);
@@ -284,7 +286,7 @@ epicsThreadInit (void)
epicsMutexOsdPrepare(&taskVarMutex);
epicsMutexOsdPrepare(&onceMutex);
rtems_task_ident (RTEMS_SELF, 0, &tid);
if(setThreadInfo (tid, "_main_", NULL, NULL, 0) != RTEMS_SUCCESSFUL)
if(setThreadInfo (tid, "_main_", NULL, NULL, 0, 1) != RTEMS_SUCCESSFUL)
cantProceed("epicsThreadInit() unable to setup _main_");
osdThreadHooksRunMain((epicsThreadId)tid);
initialized = 1;
@@ -338,7 +340,7 @@ epicsThreadCreateOpt (
name, rtems_status_text(sc));
return 0;
}
sc = setThreadInfo (tid, name, funptr, parm, opts->joinable);
sc = setThreadInfo (tid, name, funptr, parm, opts->joinable, 0);
if (sc != RTEMS_SUCCESSFUL) {
errlogPrintf ("epicsThreadCreate create failure during setup for %s: %s\n",
name, rtems_status_text(sc));
@@ -870,3 +872,27 @@ LIBCOM_API int epicsThreadGetCPUs(void)
return 1;
#endif
}
int epicsStdCall epicsThreadIsOkToBlock(void)
{
uint32_t note = 0;
struct taskVar *v;
rtems_task_get_note (RTEMS_SELF, RTEMS_NOTEPAD_TASKVAR, &note);
v = (void *)note;
return v && v->isOkToBlock;
}
void epicsStdCall epicsThreadSetOkToBlock(int isOkToBlock)
{
uint32_t note = 0;
struct taskVar *v;
rtems_task_get_note (RTEMS_SELF, RTEMS_NOTEPAD_TASKVAR, &note);
v = (void *)note;
if(v)
v->isOkToBlock = !!isOkToBlock;
}

View File

@@ -19,27 +19,68 @@
#define EPICS_ATOMIC_OS_NAME "WIN32"
#ifdef VC_EXTRALEAN
# define VC_EXTRALEAN_DETECTED_epicsAtomicOSD_h
#else
# define VC_EXTRALEAN
#endif
/* Disable extra declarations that we don't need here (i.e. winsock1, rpc, etc.) */
#pragma push_macro("WIN32_LEAN_AND_MEAN")
#undef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#ifdef STRICT
# define STRICT_DETECTED_epicsAtomicOSD_h
#else
# define STRICT
#endif
#pragma push_macro("STRICT")
#undef STRICT
#define STRICT
/* Disable min/max macros from windows.h. These macros can cause issues with headers such as <algorithm> that declare or use std::min/max */
#pragma push_macro("NOMINMAX")
#undef NOMINMAX
#define NOMINMAX
/* Disable 'service controller' includes */
#pragma push_macro("NOSERVICE")
#undef NOSERVICE
#define NOSERVICE
/* Disable 'input management engine' includes */
#pragma push_macro("NOIME")
#undef NOIME
#define NOIME
/* Disable 'modem configuration extensions' includes */
#pragma push_macro("NOMCX")
#undef NOMCX
#define NOMCX
/* Disable GDI includes */
#pragma push_macro("NOGDI")
#undef NOGDI
#define NOGDI
/* Disable crypto stuff */
#pragma push_macro("NOCRYPT")
#undef NOCRYPT
#define NOCRYPT
/* Disable sound driver routines */
#pragma push_macro("NOSOUND")
#undef NOSOUND
#define NOSOUND
/* Disable Kanji writing system support */
#pragma push_macro("NOKANJI")
#undef NOKANJI
#define NOKANJI
#include "windows.h"
#ifndef VC_EXTRALEAN_DETECTED_epicsAtomicOSD_h
# undef VC_EXTRALEAN
#endif
#ifndef STRICT_DETECTED_epicsAtomicOSD_h
# undef STRICT
#endif
/* Restore previous macro values */
#pragma pop_macro("WIN32_LEAN_AND_MEAN")
#pragma pop_macro("STRICT")
#pragma pop_macro("NOMINMAX")
#pragma pop_macro("NOSERVICE")
#pragma pop_macro("NOIME")
#pragma pop_macro("NOMCX")
#pragma pop_macro("NOGDI")
#pragma pop_macro("NOCRYPT")
#pragma pop_macro("NOSOUND")
#pragma pop_macro("NOKANJI")
#if defined ( _WIN64 )
# define MS_ATOMIC_64

View File

@@ -103,6 +103,7 @@ typedef struct epicsThreadOSD {
char isSuspended;
int joinable;
int isRunning;
int isOkToBlock;
HANDLE timer; /* waitable timer */
} win32ThreadParam;
@@ -586,6 +587,7 @@ static win32ThreadParam * epicsThreadImplicitCreate ( void )
pParm->handle = handle;
pParm->id = id;
pParm->isOkToBlock = 1;
win32ThreadPriority = GetThreadPriority ( pParm->handle );
assert ( win32ThreadPriority != THREAD_PRIORITY_ERROR_RETURN );
pParm->epicsPriority = epicsThreadGetOsiPriorityValue ( win32ThreadPriority );
@@ -1224,3 +1226,17 @@ void testPriorityMapping ()
return 0;
}
#endif
int epicsStdCall epicsThreadIsOkToBlock(void)
{
struct epicsThreadOSD *pthreadInfo = epicsThreadGetIdSelf();
return(pthreadInfo->isOkToBlock);
}
void epicsStdCall epicsThreadSetOkToBlock(int isOkToBlock)
{
struct epicsThreadOSD *pthreadInfo = epicsThreadGetIdSelf();
pthreadInfo->isOkToBlock = !!isOkToBlock;
}

View File

@@ -665,6 +665,7 @@ static epicsThreadOSD *createImplicit(void)
assert(pthreadInfo);
pthreadInfo->tid = tid;
pthreadInfo->osiPriority = 0;
pthreadInfo->isOkToBlock = 1;
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && _POSIX_THREAD_PRIORITY_SCHEDULING > 0
if(pthread_getschedparam(tid,&pthreadInfo->schedPolicy,&pthreadInfo->schedParam) == 0) {
@@ -1095,3 +1096,17 @@ LIBCOM_API int epicsThreadGetCPUs(void)
#endif
return 1;
}
int epicsStdCall epicsThreadIsOkToBlock(void)
{
epicsThreadOSD *pthreadInfo = epicsThreadGetIdSelf();
return(pthreadInfo->isOkToBlock);
}
void epicsStdCall epicsThreadSetOkToBlock(int isOkToBlock)
{
epicsThreadOSD *pthreadInfo = epicsThreadGetIdSelf();
pthreadInfo->isOkToBlock = !!isOkToBlock;
}

View File

@@ -35,6 +35,7 @@ typedef struct epicsThreadOSD {
int isRealTimeScheduled;
int isOnThreadList;
int isRunning;
int isOkToBlock;
unsigned int osiPriority;
int joinable;
char name[1]; /* actually larger */

View File

@@ -132,7 +132,8 @@ static void epicsThreadInit(void)
taskIdListSize = ID_LIST_CHUNK;
atRebootRegister();
ALLOT_JOIN(0);
done = 1;
done = 1; /* avoids recursive call */
epicsThreadSetOkToBlock(1);
}
lock = 0;
}
@@ -582,3 +583,30 @@ LIBCOM_API int epicsThreadGetCPUs(void)
{
return 1;
}
static epicsThreadOnceId okToBlockOnce = EPICS_THREAD_ONCE_INIT;
static epicsThreadPrivateId okToBlockPrivate;
static const int okToBlockNo = 0;
static const int okToBlockYes = 1;
static void epicsThreadOnceIdInit(void *not_used)
{
okToBlockPrivate = epicsThreadPrivateCreate();
}
int epicsStdCall epicsThreadIsOkToBlock(void)
{
const int *pokToBlock;
epicsThreadOnce(&okToBlockOnce, epicsThreadOnceIdInit, NULL);
pokToBlock = (int *) epicsThreadPrivateGet(okToBlockPrivate);
return (pokToBlock ? *pokToBlock : 0);
}
void epicsStdCall epicsThreadSetOkToBlock(int isOkToBlock)
{
const int *pokToBlock;
epicsThreadOnce(&okToBlockOnce, epicsThreadOnceIdInit, NULL);
pokToBlock = (isOkToBlock) ? &okToBlockYes : &okToBlockNo;
epicsThreadPrivateSet(okToBlockPrivate, (void *)pokToBlock);
}

View File

@@ -7,8 +7,8 @@ use base 'Pod::Simple::XHTML';
BEGIN {
if ($Pod::Simple::XHTML::VERSION < '3.16') {
# encode_entities() wasn't a method, add it
our *encode_entities = sub {
# Add encode_entities() as a method
sub encode_entities {
my ($self, $str) = @_;
my %entities = (
q{>} => 'gt',
@@ -37,4 +37,23 @@ sub resolve_pod_page_link {
return $ret;
}
sub _end_head {
my $h = delete $_[0]{in_head};
my $add = $_[0]->html_h_level;
$add = 1 unless defined $add;
$h += $add - 1;
my $id = $_[0]->idify($_[0]{htext});
my $text = $_[0]{scratch};
my $hid = qq{<h$h id="$id">};
my $link = qq{ <a class='sect' href="#$id">&sect;</a>};
$_[0]{'scratch'} = $_[0]->backlink && ($h - $add == 0)
# backlinks enabled && =head1
? qq{$hid<a href="#_podtop_">$text</a> $link</h$h>}
: qq{$hid$text $link</h$h>};
$_[0]->emit;
push @{ $_[0]{'to_index'} }, [$h, $id, delete $_[0]{'htext'}];
}
1;

View File

@@ -69,6 +69,11 @@ A[href="#POD_ERRORS"] {
color: #FF0000;
}
A.sect {
color: #99ccff;
vertical-align: super;
}
TD {
margin: 0;
padding: 0;