Compare commits
351 Commits
R7.0.1-rc1
...
3.16
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c90e6ed0b | ||
|
|
c5fd621337 | ||
|
|
ea409e79be | ||
|
|
c59a18600a | ||
|
|
68f6f361e1 | ||
|
|
84b7612036 | ||
|
|
f3cf1df503 | ||
|
|
9b385480d0 | ||
|
|
ec036cb26d | ||
|
|
64d9d1a4c9 | ||
|
|
e53244df1f | ||
|
|
fe3d68b5f7 | ||
|
|
49f5527cd7 | ||
|
|
ee90dffd40 | ||
|
|
6664ccfc64 | ||
|
|
444cac337c | ||
|
|
313afc4a4c | ||
|
|
0fae0fcc17 | ||
|
|
aab5693b45 | ||
|
|
6f919c3991 | ||
|
|
87761ebf29 | ||
|
|
10d951e2d7 | ||
|
|
d436561cb2 | ||
|
|
a43b805b65 | ||
|
|
9e999d2bef | ||
|
|
040f9013f4 | ||
|
|
0f16977caf | ||
|
|
694f045332 | ||
|
|
daad9b1ba1 | ||
|
|
937878e0a9 | ||
|
|
6e536e1ee0 | ||
|
|
6ea6c6ff66 | ||
|
|
168d430921 | ||
|
|
9a8860b771 | ||
|
|
693c1020f2 | ||
|
|
63ddb2d4fc | ||
|
|
3d8e2d933d | ||
|
|
5f3f87a365 | ||
|
|
072dbd53e7 | ||
|
|
43322335df | ||
|
|
fcb5675040 | ||
|
|
3d88c8495b | ||
|
|
215c5d954b | ||
|
|
59ec8d897d | ||
|
|
94ebd0fe48 | ||
|
|
8a7442e878 | ||
|
|
31870b4c41 | ||
|
|
ae38fb2c1c | ||
|
|
a3ace1f260 | ||
|
|
728bb556cf | ||
|
|
b7afb287d5 | ||
|
|
275d36b09d | ||
|
|
a81c3503d2 | ||
|
|
03b8257d71 | ||
|
|
46370302f6 | ||
|
|
ab59c97f4b | ||
|
|
77bdea22f8 | ||
|
|
00ee7bf7d3 | ||
|
|
3c607d9034 | ||
|
|
06f522b253 | ||
|
|
c6476fbbdc | ||
|
|
b336545853 | ||
|
|
63994839d0 | ||
|
|
1564f87bd6 | ||
|
|
6eb88b16a0 | ||
|
|
27ee078bc8 | ||
|
|
a62c357e99 | ||
|
|
ea0556e471 | ||
|
|
891caa5933 | ||
|
|
b18478077a | ||
|
|
dd78ab0888 | ||
|
|
f1e55ef240 | ||
|
|
2c07e5fbb9 | ||
|
|
11ba48232c | ||
|
|
531ab6fc36 | ||
|
|
e7e9e66651 | ||
|
|
453ad41c48 | ||
|
|
eed208afaa | ||
|
|
ae63854dff | ||
|
|
ce7943fb44 | ||
|
|
4e865a03d8 | ||
|
|
9a4febd3bc | ||
|
|
dc5d373b57 | ||
|
|
47c361f135 | ||
|
|
9943796f7f | ||
| 3cb72ec209 | |||
| 701ef5b936 | |||
| c3995a9d63 | |||
| ce3eadde34 | |||
|
|
62929fcbd1 | ||
|
|
456a68eb96 | ||
|
|
b319b4722f | ||
|
|
b4cc5fdf4b | ||
|
|
d35835659c | ||
| 65714033ea | |||
| 7151fbe498 | |||
|
|
cbb13bf6b1 | ||
|
|
150d764d28 | ||
|
|
7dd1ea4cab | ||
|
|
922ed30136 | ||
|
|
9f9f119e7e | ||
|
|
d8214a4531 | ||
|
|
120b100e7e | ||
|
|
949e9d788a | ||
|
|
27c6e6a385 | ||
|
|
4b59476170 | ||
|
|
526b565c6b | ||
|
|
1b7b2bcceb | ||
|
|
49c925d064 | ||
|
|
46b5d6006e | ||
|
|
6a2ed4b333 | ||
|
|
73b81ad139 | ||
|
|
7c00cc8045 | ||
|
|
b2bb14c654 | ||
|
|
ae5122759d | ||
|
|
d3bcf5737f | ||
|
|
6c5505ad3e | ||
|
|
4247d98b08 | ||
|
|
13735a8088 | ||
|
|
58d4242b68 | ||
|
|
8e42f516b0 | ||
|
|
9051cdbb34 | ||
|
|
8ffea9de27 | ||
|
|
2548a37267 | ||
|
|
592a83385d | ||
|
|
1ffd30c6d4 | ||
|
|
6e85a407da | ||
|
|
76a4a20698 | ||
|
|
7626856a20 | ||
|
|
1dc1b25aaa | ||
|
|
fb31dd784b | ||
|
|
fe7260e263 | ||
|
|
67e2b74758 | ||
|
|
c09b6e2f1b | ||
|
|
45be2306bd | ||
|
|
6027f906c3 | ||
|
|
ec351c5e2f | ||
| 89870e2817 | |||
| 4e9cf72d71 | |||
| 80869a0868 | |||
| 998fa984ba | |||
| 31844af88e | |||
| 8f161f9463 | |||
| e0399478ad | |||
|
|
2a2a1e54ac | ||
|
|
20d2cff501 | ||
|
|
860ce156a2 | ||
|
|
27431facb8 | ||
|
|
fe4b5d7d72 | ||
|
|
a447ed8bd0 | ||
|
|
7ef9ea7193 | ||
|
|
0f21196670 | ||
|
|
31fc35fbe8 | ||
|
|
f892731b3f | ||
|
|
d20ce9e6bc | ||
|
|
e82f59a2d7 | ||
|
|
6761726e95 | ||
|
|
4e24acebfe | ||
| ab493264b2 | |||
| 68779943eb | |||
| 7a5ff26984 | |||
| eae59183cc | |||
|
|
8144d2ea01 | ||
|
|
b32629c3bf | ||
|
|
220e404203 | ||
|
|
83b17d5061 | ||
|
|
65dec97f9e | ||
|
|
dcb494b494 | ||
|
|
8f55a1307d | ||
|
|
e459e8bdd4 | ||
|
|
b558bd9b16 | ||
|
|
3c16c3c0da | ||
|
|
7d28ae3732 | ||
|
|
a9d7f7be13 | ||
|
|
c0a7ab976c | ||
|
|
b029448059 | ||
|
|
3b77d9be8c | ||
|
|
6e3aa77c42 | ||
|
|
2fb46fc541 | ||
|
|
36f23f3aec | ||
|
|
ffe6fceffa | ||
|
|
bcfdc8d368 | ||
|
|
c6c25ab43d | ||
|
|
5796f717ef | ||
|
|
89b9e240b0 | ||
|
|
8cdcaf5a87 | ||
|
|
f2ceb3bbbf | ||
|
|
fd30989f63 | ||
|
|
55db6525ee | ||
|
|
fe1ec6ed31 | ||
|
|
8fb6c6d610 | ||
|
|
23c4eb42a3 | ||
|
|
6d7f70f200 | ||
|
|
67844bacc3 | ||
|
|
7e7d230d8c | ||
|
|
c0cbf8e985 | ||
|
|
498b248811 | ||
|
|
c1ece40f41 | ||
|
|
a732539eee | ||
|
|
3bc0805a89 | ||
|
|
c72e35c769 | ||
|
|
7e293e60a6 | ||
|
|
c80783dfa9 | ||
|
|
3b6a4ad5a6 | ||
| ccc8f75ec7 | |||
| d9742d5240 | |||
| 7aa2ae2094 | |||
| ab517a9392 | |||
| 4df39bb425 | |||
| 6ff271527b | |||
|
|
2d9c5e99a1 | ||
|
|
ca22d50831 | ||
|
|
3b89515664 | ||
|
|
1893cb4f54 | ||
|
|
2b1d5ae4e3 | ||
|
|
1ca8535266 | ||
|
|
c0cbbd8bee | ||
|
|
fef15d6c91 | ||
|
|
805e62b29c | ||
|
|
d94c8d1e37 | ||
|
|
a4fcd2296a | ||
|
|
4972803ce2 | ||
|
|
3b7e348a8c | ||
|
|
00a974ce52 | ||
|
|
490c504736 | ||
|
|
35ad28dde1 | ||
|
|
ba4c609506 | ||
|
|
49371cfe00 | ||
|
|
06ad4a0d70 | ||
|
|
a2ae07dfcd | ||
|
|
b539ced6d5 | ||
|
|
1b332361e7 | ||
|
|
5cb91d9f6d | ||
|
|
116c90c2ea | ||
|
|
3f3696fb91 | ||
|
|
57eea6a153 | ||
|
|
877d38e79a | ||
|
|
92f0f65d2c | ||
|
|
7cef334b64 | ||
|
|
b84ee89d87 | ||
|
|
b8a0792fae | ||
|
|
91ce807e8b | ||
|
|
c2c32e5876 | ||
|
|
ca2003bb63 | ||
|
|
3d88316eab | ||
|
|
b9443f8813 | ||
|
|
086bc961a4 | ||
|
|
58dc1ced9b | ||
|
|
d8802c8b24 | ||
|
|
b7d4609e57 | ||
|
|
7b5b23f6d3 | ||
|
|
c8a7e1597d | ||
|
|
0f7a7902e4 | ||
|
|
42403232e9 | ||
|
|
8333338f99 | ||
|
|
ceaff61c09 | ||
|
|
12bb8969ad | ||
|
|
ea408578e0 | ||
|
|
2307e94d1c | ||
|
|
05a3699b49 | ||
|
|
97ea68d40c | ||
|
|
f44da65942 | ||
|
|
be8f35d782 | ||
|
|
6cc623a7b4 | ||
| 2b4a9632b7 | |||
| 396cf4ee3f | |||
|
|
d7e416e76a | ||
|
|
c05101bb3f | ||
|
|
958c81db89 | ||
|
|
9020c2ce1a | ||
|
|
8f64af96fd | ||
|
|
54c47f02de | ||
|
|
d87ac0319b | ||
|
|
20404003bf | ||
|
|
1fa5d9d3b6 | ||
|
|
5e394e4928 | ||
|
|
c0d4835e66 | ||
|
|
8ae34ba01d | ||
|
|
98f656fc96 | ||
|
|
1458f8640e | ||
|
|
a9764c8f62 | ||
|
|
98d9ea4545 | ||
|
|
8eb4eec7d2 | ||
|
|
98930eebc4 | ||
| e50c468512 | |||
|
|
292141458c | ||
|
|
c18b6f2ccf | ||
|
|
e41f8bf518 | ||
|
|
ae548d3400 | ||
| 428a8f57e9 | |||
| 29795656e6 | |||
| b2d6b67b06 | |||
| 1e9826d187 | |||
| 0691fc5f57 | |||
| 8a3080c16f | |||
| d19afc73af | |||
| adf5375616 | |||
|
|
85c6e9bdfb | ||
|
|
550beeab9f | ||
|
|
bf91275200 | ||
|
|
ac4d5c95ac | ||
| 7d836d9554 | |||
| 51e492fbb1 | |||
|
|
cd8fd8a08f | ||
|
|
61296b8cff | ||
|
|
de442e9584 | ||
|
|
ac367398b3 | ||
|
|
713c2d5080 | ||
|
|
eef6f3afbb | ||
|
|
af07016464 | ||
|
|
734d16291f | ||
|
|
f1e5e9689b | ||
|
|
1454f42a27 | ||
|
|
506be838af | ||
|
|
ddbdcf9462 | ||
|
|
729e6fda4d | ||
|
|
0315e90e6e | ||
|
|
00f30ac53a | ||
|
|
66c6aaa44f | ||
|
|
c830a3a4ee | ||
|
|
1daab5fb35 | ||
|
|
f5cd555383 | ||
|
|
f527e5939e | ||
|
|
d41f2e6806 | ||
|
|
692b971e06 | ||
|
|
8766ce05aa | ||
|
|
84e0220852 | ||
|
|
8f62940265 | ||
|
|
8a1477ecab | ||
|
|
5c97e54cf7 | ||
|
|
3646493014 | ||
|
|
89cbb95c2c | ||
|
|
006ce1a240 | ||
|
|
276dee2c3e | ||
|
|
98a2871727 | ||
|
|
5ca1bb3bd5 | ||
|
|
f6be3c7f70 | ||
|
|
00924dcba0 | ||
|
|
8e2b782b7c | ||
|
|
3b0f34e0be | ||
|
|
e8b4f448ea | ||
|
|
d5f74fe006 | ||
|
|
6923ca9fda | ||
|
|
aace975de1 | ||
|
|
c8b60e0f1b | ||
|
|
1255cdc9ee | ||
|
|
12da38a7ca | ||
|
|
f78e1f39d7 | ||
|
|
684fe10d8c | ||
|
|
15b97f65cb | ||
|
|
c1b0c1bac1 |
@@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Checkout submodules on their appropriate branches
|
||||
#
|
||||
|
||||
git submodule foreach '\
|
||||
git checkout `git config -f $toplevel/.gitmodules submodule.$name.branch` && \
|
||||
git pull '
|
||||
@@ -1,97 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Make tar for git repo w/ one level of sub modules.
|
||||
#
|
||||
set -e
|
||||
|
||||
die() {
|
||||
echo "$1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
TOPREV="$1"
|
||||
FINALTAR="$2"
|
||||
PREFIX="$3"
|
||||
|
||||
if ! [ "$TOPREV" ]
|
||||
then
|
||||
cat <<EOF >&2
|
||||
usage: $0 [rev] [outfile.tar.gz] [prefix/]
|
||||
|
||||
"<rev>" may be any git revision spec. (tag, branch, or commit id).
|
||||
|
||||
Output file may be .tar.gz, .tar.bz2, or any extension supported by "tar -a".
|
||||
If output file name is omitted, then "<rev>.tar.gz" is the default.
|
||||
If prefix is omitted, then the default is "<rev>/".
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ "$FINALTAR" ] || FINALTAR="$TOPREV.tar.gz"
|
||||
[ "$PREFIX" ] || PREFIX="$TOPREV/"
|
||||
|
||||
case "$PREFIX" in
|
||||
*/) ;;
|
||||
*) die "Prefix must end with '/'";;
|
||||
esac
|
||||
|
||||
# temporary directory w/ automatic cleanup
|
||||
TDIR=`mktemp -d`
|
||||
trap 'rm -rf "$TDIR"' EXIT INT QUIT TERM
|
||||
|
||||
mkdir "$TDIR"/tar
|
||||
|
||||
echo "Exporting revision $TOPREV as $FINALTAR with prefix $PREFIX"
|
||||
|
||||
# Use git-archive to copy files at the given revision into our temp. dir.
|
||||
# Respects 'export-exclude' in .gitattributes files.
|
||||
|
||||
git archive --prefix=$PREFIX $TOPREV | tar -C "$TDIR"/tar -x
|
||||
|
||||
# use ls-tree instead of submodule-foreach to capture submodule revision associated with supermodule rev.
|
||||
#
|
||||
# sub-modules appear in tree as eg.:
|
||||
# 160000 commit c3a6cfcf0dad4a4eeecf59b474710d06ff3eb68a modules/ca
|
||||
git ls-tree -r $TOPREV | awk '/^[0-9]+ commit / {print $3, $4}' | \
|
||||
while read HASH MODDIR
|
||||
do
|
||||
echo "Visiting $HASH $MODDIR"
|
||||
git -C $MODDIR archive --prefix=${PREFIX}${MODDIR}/ $HASH | tar -C "$TDIR"/tar -x
|
||||
done
|
||||
|
||||
# make a list of files copied and filter out undesirables
|
||||
|
||||
(cd "$TDIR"/tar && find . -mindepth 1 -not -type d) > "$TDIR"/list.1
|
||||
|
||||
# Remove leading ./ from filenames
|
||||
sed -i -e 's|^\./||' "$TDIR"/list.1
|
||||
|
||||
# Exclude files
|
||||
sed \
|
||||
-e '/\/\.\?ci\//d' \
|
||||
-e '/\/jenkins\//d' \
|
||||
-e '/\/\.git/d' \
|
||||
-e '/\/\.project$/d' \
|
||||
-e '/\/\.travis\.yml$/d' \
|
||||
-e '/\/\.appveyor\.yml$/d' \
|
||||
"$TDIR"/list.1 > "$TDIR"/list.2
|
||||
|
||||
if ! diff -U 0 "$TDIR"/list.1 "$TDIR"/list.2
|
||||
then
|
||||
echo "Excluding the files shown above"
|
||||
fi
|
||||
|
||||
# Use the filtered list to build the final tar
|
||||
# The -a option chooses compression automatically based on output file name.
|
||||
|
||||
tar -C "$TDIR"/tar --files-from="$TDIR"/list.2 -caf "$FINALTAR"
|
||||
|
||||
echo "Wrote $FINALTAR"
|
||||
|
||||
tar -taf "$FINALTAR" > "$TDIR"/list.3
|
||||
|
||||
# make sure we haven't picked up anything extra
|
||||
if ! diff -u "$TDIR"/list.2 "$TDIR"/list.3
|
||||
then
|
||||
echo "Oops! Tarfile diff against plan shown above"
|
||||
fi
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e -x
|
||||
|
||||
die() {
|
||||
echo "$1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
CURDIR="$PWD"
|
||||
|
||||
QDIR="$HOME/.cache/qemu"
|
||||
|
||||
if [ -n "$RTEMS" -a "$TEST" = "YES" ]
|
||||
then
|
||||
git clone --quiet --branch vme --depth 10 https://github.com/mdavidsaver/qemu.git "$HOME/.build/qemu"
|
||||
cd "$HOME/.build/qemu"
|
||||
|
||||
HEAD=`git log -n1 --pretty=format:%H`
|
||||
echo "HEAD revision $HEAD"
|
||||
|
||||
[ -e "$HOME/.cache/qemu/built" ] && BUILT=`cat "$HOME/.cache/qemu/built"`
|
||||
echo "Cached revision $BUILT"
|
||||
|
||||
if [ "$HEAD" != "$BUILT" ]
|
||||
then
|
||||
echo "Building QEMU"
|
||||
git submodule --quiet update --init
|
||||
|
||||
install -d "$HOME/.build/qemu/build"
|
||||
cd "$HOME/.build/qemu/build"
|
||||
|
||||
"$HOME/.build/qemu/configure" --prefix="$HOME/.cache/qemu/usr" --target-list=i386-softmmu --disable-werror
|
||||
make -j2
|
||||
make install
|
||||
|
||||
echo "$HEAD" > "$HOME/.cache/qemu/built"
|
||||
fi
|
||||
fi
|
||||
|
||||
cd "$CURDIR"
|
||||
|
||||
cat <<EOF >> configure/CONFIG_SITE
|
||||
USR_CPPFLAGS += $USR_CPPFLAGS
|
||||
USR_CFLAGS += $USR_CFLAGS
|
||||
USR_CXXFLAGS += $USR_CXXFLAGS
|
||||
EOF
|
||||
4
.gitattributes
vendored
4
.gitattributes
vendored
@@ -1,4 +0,0 @@
|
||||
.ci/ export-ignore
|
||||
.appveyor.yml export-ignore
|
||||
.travis.yml export-ignore
|
||||
README export-subst
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -7,8 +7,6 @@
|
||||
/include/
|
||||
/templates/
|
||||
/configure/*.local
|
||||
/modules/RELEASE.local
|
||||
/modules/Makefile.local
|
||||
O.*/
|
||||
/QtC-*
|
||||
*.orig
|
||||
|
||||
36
.gitmodules
vendored
36
.gitmodules
vendored
@@ -1,36 +0,0 @@
|
||||
[submodule "modules/libcom"]
|
||||
path = modules/libcom
|
||||
url = ./
|
||||
branch = libcom/master
|
||||
[submodule "modules/database"]
|
||||
path = modules/database
|
||||
url = ./
|
||||
branch = database/master
|
||||
[submodule "modules/ca"]
|
||||
path = modules/ca
|
||||
url = ./
|
||||
branch = ca/master
|
||||
[submodule "modules/pvData"]
|
||||
path = modules/pvData
|
||||
url = https://github.com/epics-base/pvDataCPP
|
||||
branch = master
|
||||
[submodule "modules/pvAccess"]
|
||||
path = modules/pvAccess
|
||||
url = https://github.com/epics-base/pvAccessCPP
|
||||
branch = master
|
||||
[submodule "modules/normativeTypes"]
|
||||
path = modules/normativeTypes
|
||||
url = https://github.com/epics-base/normativeTypesCPP
|
||||
branch = master
|
||||
[submodule "modules/pvaClient"]
|
||||
path = modules/pvaClient
|
||||
url = https://github.com/epics-base/pvaClientCPP
|
||||
branch = master
|
||||
[submodule "modules/pvDatabase"]
|
||||
path = modules/pvDatabase
|
||||
url = https://github.com/epics-base/pvDatabaseCPP
|
||||
branch = master
|
||||
[submodule "modules/pva2pva"]
|
||||
path = modules/pva2pva
|
||||
url = https://github.com/epics-base/pva2pva
|
||||
branch = master
|
||||
25
.travis.yml
25
.travis.yml
@@ -3,6 +3,16 @@ dist: trusty
|
||||
language: c
|
||||
compiler:
|
||||
- gcc
|
||||
env:
|
||||
- CMPLR=gcc
|
||||
- CMPLR=gcc EXTRA=CMD_CXXFLAGS=-std=c++11
|
||||
- CMPLR=gcc STATIC=YES
|
||||
- CMPLR=clang
|
||||
- CMPLR=clang STATIC=YES
|
||||
- WINE=32 TEST=NO STATIC=YES
|
||||
- WINE=32 TEST=NO STATIC=NO
|
||||
- RTEMS=4.10 TEST=YES
|
||||
- RTEMS=4.9 TEST=YES
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
@@ -15,19 +25,8 @@ addons:
|
||||
- flex
|
||||
- texinfo
|
||||
- install-info
|
||||
- qemu-system-x86
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.cache
|
||||
install:
|
||||
- ./.ci/travis-prepare.sh
|
||||
script:
|
||||
- ./.ci/travis-build.sh
|
||||
env:
|
||||
- BRCORE=master BRLIBCOM=master BRCA=master
|
||||
- CMPLR=clang
|
||||
- USR_CXXFLAGS=-std=c++11
|
||||
- CMPLR=clang USR_CXXFLAGS=-std=c++11
|
||||
- WINE=32 TEST=NO STATIC=YES
|
||||
- WINE=32 TEST=NO STATIC=NO
|
||||
- RTEMS=4.10 TEST=NO
|
||||
- RTEMS=4.9 TEST=NO
|
||||
script: sh ci/travis-build.sh </dev/null
|
||||
|
||||
10
Makefile
10
Makefile
@@ -4,7 +4,7 @@
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
TOP = .
|
||||
@@ -14,12 +14,8 @@ include $(TOP)/configure/CONFIG
|
||||
TOOLS = $(TOP)/src/tools
|
||||
|
||||
DIRS += configure src
|
||||
|
||||
src_DEPEND_DIRS = configure
|
||||
|
||||
DIRS += test
|
||||
test_DEPEND_DIRS = src
|
||||
|
||||
DIRS += modules
|
||||
modules_DEPEND_DIRS = src
|
||||
|
||||
include $(TOP)/configure/RULES_TOP
|
||||
|
||||
|
||||
5
README
5
README
@@ -20,8 +20,5 @@ Additional information about EPICS including mailing list
|
||||
archives and subscription instructions, documentation and
|
||||
training materials, additional components, links to other
|
||||
websites etc. is available on the EPICS home page at
|
||||
http://www.aps.anl.gov/epics/
|
||||
https://epics.anl.gov/
|
||||
|
||||
$Format:%cD$
|
||||
$Format:%H$
|
||||
https://code.launchpad.net/epics-base
|
||||
|
||||
@@ -40,11 +40,12 @@ configuration:
|
||||
# Environment variables: compiler toolchain
|
||||
environment:
|
||||
matrix:
|
||||
- TOOLCHAIN: 9.0
|
||||
- TOOLCHAIN: 10.0
|
||||
- TOOLCHAIN: 11.0
|
||||
- TOOLCHAIN: 12.0
|
||||
- TOOLCHAIN: 14.0
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
TOOLCHAIN: 2017
|
||||
- TOOLCHAIN: cygwin
|
||||
- TOOLCHAIN: mingw
|
||||
|
||||
@@ -57,8 +58,6 @@ platform:
|
||||
matrix:
|
||||
exclude:
|
||||
# VS Express installs don't have the 64 bit compiler
|
||||
- platform: x64
|
||||
TOOLCHAIN: 9.0
|
||||
- platform: x64
|
||||
TOOLCHAIN: 10.0
|
||||
|
||||
@@ -67,13 +66,13 @@ matrix:
|
||||
#---------------------------------#
|
||||
|
||||
install:
|
||||
- cmd: .ci/appveyor-prepare.bat
|
||||
- cmd: ci/appveyor-prepare.bat
|
||||
|
||||
build_script:
|
||||
- cmd: .ci/appveyor-make.bat
|
||||
- cmd: ci/appveyor-make.bat
|
||||
|
||||
test_script:
|
||||
- cmd: .ci/appveyor-make.bat runtests
|
||||
- cmd: ci/appveyor-make.bat runtests
|
||||
|
||||
#---------------------------------#
|
||||
# notifications #
|
||||
@@ -1,6 +1,6 @@
|
||||
:: Universal build script for AppVeyor (https://ci.appveyor.com/)
|
||||
:: Environment:
|
||||
:: TOOLCHAIN - toolchain version [9.0/10.0/11.0/12.0/14.0/cygwin/mingw]
|
||||
:: TOOLCHAIN - toolchain version [10.0/11.0/12.0/14.0/2017/cygwin/mingw]
|
||||
:: CONFIGURATION - determines EPICS build [dynamic/static]
|
||||
:: PLATFORM - architecture [x86/x64]
|
||||
::
|
||||
@@ -57,10 +57,22 @@ if "%TOOLCHAIN%"=="mingw" (
|
||||
)
|
||||
|
||||
set "VSINSTALL=C:\Program Files (x86)\Microsoft Visual Studio %TOOLCHAIN%"
|
||||
if not exist "%VSINSTALL%\" set "VSINSTALL=C:\Program Files (x86)\Microsoft Visual Studio\%TOOLCHAIN%\Community"
|
||||
if not exist "%VSINSTALL%\" goto MSMissing
|
||||
|
||||
set "MAKE=C:\tools\make"
|
||||
|
||||
echo [INFO] APPVEYOR_BUILD_WORKER_IMAGE=%APPVEYOR_BUILD_WORKER_IMAGE%
|
||||
|
||||
if "%OS%"=="64BIT" (
|
||||
set EPICS_HOST_ARCH=windows-x64%ST%
|
||||
:: VS 2017
|
||||
if exist "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" (
|
||||
call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat"
|
||||
where cl
|
||||
if !ERRORLEVEL! NEQ 0 goto MSMissing
|
||||
goto MSFound
|
||||
)
|
||||
if exist "%VSINSTALL%\VC\vcvarsall.bat" (
|
||||
call "%VSINSTALL%\VC\vcvarsall.bat" amd64
|
||||
where cl
|
||||
@@ -79,12 +91,19 @@ if "%OS%"=="64BIT" (
|
||||
)
|
||||
) else (
|
||||
set EPICS_HOST_ARCH=win32-x86%ST%
|
||||
:: VS 2017
|
||||
if exist "%VSINSTALL%\VC\Auxiliary\Build\vcvars32.bat" (
|
||||
call "%VSINSTALL%\VC\Auxiliary\Build\vcvars32.bat"
|
||||
where cl
|
||||
if !ERRORLEVEL! NEQ 0 goto MSMissing
|
||||
goto MSFound
|
||||
)
|
||||
if exist "%VSINSTALL%\VC\vcvarsall.bat" (
|
||||
call "%VSINSTALL%\VC\vcvarsall.bat" x86
|
||||
where cl
|
||||
if !ERRORLEVEL! NEQ 0 goto MSMissing
|
||||
goto MSFound
|
||||
)
|
||||
)
|
||||
if exist "%VSINSTALL%\VC\bin\vcvars32.bat" (
|
||||
call "%VSINSTALL%\VC\bin\vcvars32.bat"
|
||||
where cl
|
||||
@@ -65,6 +65,6 @@ if "%TOOLCHAIN%"=="mingw" (
|
||||
)
|
||||
|
||||
echo [INFO] Installing Make 4.1
|
||||
@powershell -Command "(new-object net.webclient).DownloadFile('https://www.aps.anl.gov/epics/download/tools/make-4.1-win64.zip', 'C:\tools\make-4.1.zip')"
|
||||
curl -fsS --retry 3 -o C:\tools\make-4.1.zip https://epics.anl.gov/download/tools/make-4.1-win64.zip
|
||||
cd \tools
|
||||
"C:\Program Files\7-Zip\7z" e make-4.1.zip
|
||||
24
.ci/travis-build.sh → ci/travis-build.sh
Executable file → Normal file
24
.ci/travis-build.sh → ci/travis-build.sh
Executable file → Normal file
@@ -6,18 +6,9 @@ die() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
ticker() {
|
||||
while true
|
||||
do
|
||||
sleep 60
|
||||
date -R
|
||||
[ -r "$1" ] && tail -n10 "$1"
|
||||
done
|
||||
}
|
||||
|
||||
CACHEKEY=1
|
||||
|
||||
EPICS_HOST_ARCH=`sh startup/EpicsHostArch`
|
||||
EPICS_HOST_ARCH=`perl src/tools/EpicsHostArch.pl`
|
||||
|
||||
[ -e configure/os/CONFIG_SITE.Common.linux-x86 ] || die "Wrong location: $PWD"
|
||||
|
||||
@@ -62,29 +53,28 @@ if [ -n "$RTEMS" ]
|
||||
then
|
||||
echo "Cross RTEMS${RTEMS} for pc386"
|
||||
install -d /home/travis/.cache
|
||||
curl -L "https://github.com/mdavidsaver/rsb/releases/download/travis-20160306-2/rtems${RTEMS}-i386-trusty-20190306-2.tar.gz" \
|
||||
| tar -C /home/travis/.cache -xj
|
||||
curl -L "https://github.com/mdavidsaver/rsb/releases/download/20171203-${RTEMS}/i386-rtems${RTEMS}-trusty-20171203-${RTEMS}.tar.bz2" \
|
||||
| tar -C / -xmj
|
||||
|
||||
sed -i -e '/^RTEMS_VERSION/d' -e '/^RTEMS_BASE/d' configure/os/CONFIG_SITE.Common.RTEMS
|
||||
cat << EOF >> configure/os/CONFIG_SITE.Common.RTEMS
|
||||
RTEMS_VERSION=$RTEMS
|
||||
RTEMS_BASE=/home/travis/.cache/rtems${RTEMS}-i386
|
||||
RTEMS_BASE=/home/travis/.rtems
|
||||
EOF
|
||||
cat << EOF >> configure/CONFIG_SITE
|
||||
CROSS_COMPILER_TARGET_ARCHS+=RTEMS-pc386
|
||||
CROSS_COMPILER_TARGET_ARCHS += RTEMS-pc386-qemu
|
||||
CROSS_COMPILER_RUNTEST_ARCHS += RTEMS-pc386-qemu
|
||||
EOF
|
||||
|
||||
# find local qemu-system-i386
|
||||
export PATH="$HOME/.cache/qemu/usr/bin:$PATH"
|
||||
echo -n "Using QEMU: "
|
||||
type qemu-system-i386 || echo "Missing qemu"
|
||||
EXTRA=RTEMS_QEMU_FIXUPS=YES
|
||||
fi
|
||||
|
||||
make -j2 $EXTRA
|
||||
|
||||
if [ "$TEST" != "NO" ]
|
||||
then
|
||||
make -j2 tapfiles
|
||||
make tapfiles
|
||||
make -s test-results
|
||||
fi
|
||||
@@ -20,11 +20,15 @@ else
|
||||
endif
|
||||
|
||||
# Provide a default if the user hasn't set EPICS_HOST_ARCH
|
||||
ifeq ($(origin EPICS_HOST_ARCH), undefined)
|
||||
# NB: We use a simply expanded variable here for performance:
|
||||
EPICS_HOST_ARCH := $(shell $(CONFIG)/../startup/EpicsHostArch.pl)
|
||||
endif
|
||||
#
|
||||
ifeq ($(origin EPICS_HOST_ARCH), undefined)
|
||||
# Bootstrapping ...
|
||||
EHA := $(firstword $(wildcard $(EPICS_BASE)/lib/perl/EpicsHostArch.pl \
|
||||
$(TOP)/src/tools/EpicsHostArch.pl))
|
||||
# NB: We use a simply expanded variable here for performance:
|
||||
export EPICS_HOST_ARCH := $(shell perl $(EHA))
|
||||
EHA :=
|
||||
endif
|
||||
|
||||
-include $(CONFIG)/RELEASE
|
||||
-include $(CONFIG)/RELEASE.$(EPICS_HOST_ARCH)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
#---------------------------------------------------------------
|
||||
@@ -17,6 +17,17 @@ ifdef T_A
|
||||
EPICS_BASE_BIN = $(EPICS_BASE)/bin/$(T_A)
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# EPICS Base Ioc libraries
|
||||
|
||||
EPICS_BASE_IOC_LIBS += dbRecStd dbCore ca Com
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# EPICS Base Host libraries
|
||||
|
||||
EPICS_BASE_HOST_LIBS += cas gdd
|
||||
EPICS_BASE_HOST_LIBS += ca Com
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Version number for base shared libraries (and win32 products)
|
||||
|
||||
@@ -25,8 +36,18 @@ ifdef BASE_TOP
|
||||
SHRLIB_VERSION = $(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION)
|
||||
# Windows only allows 2 levels of version numbering
|
||||
PROD_VERSION = $(EPICS_VERSION).$(EPICS_REVISION)
|
||||
BASE_CPPFLAGS += -DUSE_TYPED_RSET
|
||||
endif # BASE_TOP
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Base c preprocessor flags
|
||||
|
||||
# osithread default stack
|
||||
OSITHREAD_USE_DEFAULT_STACK = NO
|
||||
OSITHREAD_DEFAULT_STACK_FLAGS_YES = -DOSITHREAD_USE_DEFAULT_STACK
|
||||
|
||||
BASE_CPPFLAGS += $(OSITHREAD_DEFAULT_STACK_FLAGS_$(OSITHREAD_USE_DEFAULT_STACK))
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Where to find the installed build tools
|
||||
# Windows does not like commands with relative paths starting ../
|
||||
@@ -38,11 +59,15 @@ FIND_TOOL = $(firstword $(wildcard $(TOOLS)/$(1) $(TOP)/src/tools/$(1)))
|
||||
#---------------------------------------------------------------
|
||||
# EPICS Base build tools and tool flags
|
||||
|
||||
PODTOHTML = $(PERL) $(TOOLS)/podToHtml.pl
|
||||
CONVERTRELEASE = $(PERL) $(call FIND_TOOL,convertRelease.pl)
|
||||
FULLPATHNAME = $(PERL) $(TOOLS)/fullPathName.pl
|
||||
TAPTOJUNIT = $(PERL) $(TOOLS)/tap-to-junit-xml.pl
|
||||
GENVERSIONHEADER = $(PERL) $(TOOLS)/genVersionHeader.pl $(QUIET_FLAG)
|
||||
MAKEBPT = $(TOOLS)/makeBpt$(HOSTEXE)
|
||||
DBEXPAND = $(PERL) $(TOOLS)/dbdExpand.pl
|
||||
DBTORECORDTYPEH = $(PERL) $(TOOLS)/dbdToRecordtypeH.pl
|
||||
DBTOMENUH = $(PERL) $(TOOLS)/dbdToMenuH.pl
|
||||
REGISTERRECORDDEVICEDRIVER = $(PERL) $(TOOLS)/registerRecordDeviceDriver.pl
|
||||
CONVERTRELEASE = $(PERL) $(call FIND_TOOL,convertRelease.pl)
|
||||
FULLPATHNAME = $(PERL) $(TOOLS)/fullPathName.pl
|
||||
TAPTOJUNIT = $(PERL) $(TOOLS)/tap-to-junit-xml.pl
|
||||
GENVERSIONHEADER = $(PERL) $(TOOLS)/genVersionHeader.pl $(QUIET_FLAG) $(QUESTION_FLAG)
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# tools for installing libraries and products
|
||||
@@ -51,6 +76,19 @@ INSTALL_PRODUCT = $(INSTALL)
|
||||
INSTALL_LIBRARY = $(INSTALL)
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# tools for making header dependencies and variable replacement
|
||||
MKMF = $(PERL) $(TOOLS)/mkmf.pl
|
||||
REPLACEVAR = $(PERL) $(TOOLS)/replaceVAR.pl
|
||||
# tools for making header dependancies and variable replacement
|
||||
MKMF = $(PERL) $(TOOLS)/mkmf.pl
|
||||
REPLACEVAR = $(PERL) $(TOOLS)/replaceVAR.pl
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Our versions of lex (flex) and yacc (antelope)
|
||||
EYACC = $(TOOLS)/antelope$(HOSTEXE)
|
||||
ELEX = $(TOOLS)/e_flex$(HOSTEXE) -S$(EPICS_BASE)/include/flex.skel.static
|
||||
|
||||
YACC = $(EYACC)
|
||||
LEX = $(ELEX)
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# The 3.15 version of msi supports new options
|
||||
|
||||
MSI3_15 = $(EPICS_BASE_HOST_BIN)/msi
|
||||
|
||||
@@ -29,29 +29,28 @@
|
||||
|
||||
BASE_3_14 = NO
|
||||
BASE_3_15 = NO
|
||||
BASE_3_16 = NO
|
||||
BASE_7_0 = YES
|
||||
BASE_3_16 = YES
|
||||
|
||||
# EPICS_VERSION must be a number >0 and <256
|
||||
EPICS_VERSION = 7
|
||||
EPICS_VERSION = 3
|
||||
|
||||
# EPICS_REVISION must be a number >=0 and <256
|
||||
EPICS_REVISION = 0
|
||||
EPICS_REVISION = 16
|
||||
|
||||
# EPICS_MODIFICATION must be a number >=0 and <256
|
||||
EPICS_MODIFICATION = 1
|
||||
EPICS_MODIFICATION = 2
|
||||
|
||||
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
|
||||
# Not included if zero
|
||||
EPICS_PATCH_LEVEL = 0
|
||||
|
||||
# This will end in -DEV between official releases
|
||||
#EPICS_DEV_SNAPSHOT=-DEV
|
||||
EPICS_DEV_SNAPSHOT=-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-pre1
|
||||
#EPICS_DEV_SNAPSHOT=-pre1-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-pre2
|
||||
#EPICS_DEV_SNAPSHOT=-pre2-DEV
|
||||
EPICS_DEV_SNAPSHOT=-rc1
|
||||
#EPICS_DEV_SNAPSHOT=-rc1
|
||||
#EPICS_DEV_SNAPSHOT=-rc1-DEV
|
||||
#EPICS_DEV_SNAPSHOT=-rc2
|
||||
#EPICS_DEV_SNAPSHOT=-rc2-DEV
|
||||
|
||||
@@ -76,10 +76,14 @@ COMMON_DIR = ../O.Common
|
||||
IOCS_APPL_TOP = $(shell $(FULLPATHNAME) $(INSTALL_LOCATION))
|
||||
|
||||
#-------------------------------------------------------
|
||||
# Make echo output - suppress echoing if make's '-s' flag is set
|
||||
# Silencing the build - suppress messages during 'make -s'
|
||||
NOP = :
|
||||
ECHO = @$(if $(findstring s,$(patsubst T_A=%,,$(MAKEFLAGS))),$(NOP),echo)
|
||||
QUIET_FLAG := $(if $(findstring s,$(MAKEFLAGS)),-q,)
|
||||
ECHO = @$(if $(findstring s,$(MFLAGS)),$(NOP),echo)
|
||||
QUIET_FLAG := $(if $(findstring s,$(MFLAGS)),-q,)
|
||||
|
||||
#-------------------------------------------------------
|
||||
# Convert 'make -q' flag into '-i' for genVersionHeader.pl
|
||||
QUESTION_FLAG := $(if $(findstring q,$(MFLAGS)),-i,)
|
||||
|
||||
#-------------------------------------------------------
|
||||
ifdef T_A
|
||||
@@ -89,7 +93,7 @@ INSTALL_SHRLIB = $(INSTALL_LOCATION_LIB)/$(T_A)
|
||||
INSTALL_TCLLIB = $(INSTALL_LOCATION_LIB)/$(T_A)
|
||||
INSTALL_BIN = $(INSTALL_LOCATION_BIN)/$(T_A)
|
||||
|
||||
#Directories for libraries
|
||||
# Directories for libraries
|
||||
SHRLIB_SEARCH_DIRS = $(INSTALL_LIB)
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
@@ -47,9 +47,6 @@ EPICS_CAS_SERVER_PORT=
|
||||
EPICS_CAS_INTF_ADDR_LIST=""
|
||||
EPICS_CAS_IGNORE_ADDR_LIST=""
|
||||
|
||||
# Servers to disable
|
||||
EPICS_IOC_IGNORE_SERVERS=""
|
||||
|
||||
# Log Server:
|
||||
# EPICS_IOC_LOG_PORT Log server port number etc.
|
||||
EPICS_IOC_LOG_PORT=7004
|
||||
|
||||
@@ -34,35 +34,30 @@
|
||||
# The future dates below assume the rules don't get changed;
|
||||
# see http://www.timeanddate.com/time/dst/2018.html to check.
|
||||
#
|
||||
# DST for 2017 US: Mar 12 - Nov 05
|
||||
# EU: Mar 26 - Oct 29
|
||||
EPICS_TIMEZONE = CUS::360:031202:110502
|
||||
#EPICS_TIMEZONE = MET::-60:032602:102902
|
||||
#
|
||||
# DST for 2018 US: Mar 11 - Nov 04
|
||||
# EU: Mar 25 - Oct 28
|
||||
#EPICS_TIMEZONE = CUS::360:031102:110402
|
||||
#EPICS_TIMEZONE = MET::-60:032502:102802
|
||||
EPICS_TIMEZONE = CUS::360:031102:110402
|
||||
#EPICS_TIMEZONE = MET::-60:032502:102803
|
||||
#
|
||||
# DST for 2019 US: Mar 10 - Nov 03
|
||||
# EU: Mar 31 - Oct 27
|
||||
#EPICS_TIMEZONE = CUS::360:031002:110302
|
||||
#EPICS_TIMEZONE = MET::-60:033102:102702
|
||||
#EPICS_TIMEZONE = MET::-60:033102:102703
|
||||
#
|
||||
# DST for 2020 US: Mar 08 - Nov 01
|
||||
# EU: Mar 29 - Oct 25
|
||||
#EPICS_TIMEZONE = CUS::360:030802:110102
|
||||
#EPICS_TIMEZONE = MET::-60:032902:102502
|
||||
#EPICS_TIMEZONE = MET::-60:032902:102503
|
||||
#
|
||||
# DST for 2021 US: Mar 14 - Nov 07
|
||||
# EU: Mar 28 - Oct 31
|
||||
#EPICS_TIMEZONE = CUS::360:031402:110702
|
||||
#EPICS_TIMEZONE = MET::-60:032802:103102
|
||||
#EPICS_TIMEZONE = MET::-60:032802:103103
|
||||
#
|
||||
# DST for 2022 US: Mar 13 - Nov 06
|
||||
# EU: Mar 27 - Oct 30
|
||||
#EPICS_TIMEZONE = CUS::360:031302:110602
|
||||
#EPICS_TIMEZONE = MET::-60:032702:103002
|
||||
#EPICS_TIMEZONE = MET::-60:032702:103003
|
||||
|
||||
# EPICS_TS_NTP_INET
|
||||
# NTP time server ip address for VxWorks and RTEMS.
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
# Copyright (c) 2006 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE Versions 3.13.7
|
||||
# and higher are distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
ifndef T_A
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
#RULES.Db
|
||||
|
||||
# RULES.Db
|
||||
|
||||
# Set db substitutions and template file suffixes
|
||||
SUBST_SUFFIX ?= .substitutions
|
||||
@@ -428,30 +429,30 @@ $(foreach file, $(DBD_INSTALLS), $(eval $(call DBD_INSTALLS_template, $(file))))
|
||||
#---------------------------------------------------------------
|
||||
# HTML files
|
||||
|
||||
$(COMMON_DIR)/%.html: %.dbd.pod
|
||||
$(COMMON_DIR)/%.html: %.dbd.pod $(TOOLS)/dbdToHtml.pl
|
||||
@$(RM) $(notdir $@)
|
||||
$(DBDTOHTML) $(DBDFLAGS) -o $(notdir $@) $<
|
||||
$(PERL) $(TOOLS)/dbdToHtml.pl $(DBDFLAGS) -o $(notdir $@) $<
|
||||
@$(MV) $(notdir $@) $@
|
||||
|
||||
$(COMMON_DIR)/%.html: %.pod
|
||||
$(COMMON_DIR)/%.html: %.pod $(TOOLS)/podToHtml.pl
|
||||
@$(RM) $(notdir $@)
|
||||
$(PODTOHTML) -o $(notdir $@) $<
|
||||
$(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $<
|
||||
@$(MV) $(notdir $@) $@
|
||||
|
||||
$(COMMON_DIR)/%.html: %.pm
|
||||
$(COMMON_DIR)/%.html: %.pm $(TOOLS)/podToHtml.pl
|
||||
@$(RM) $(notdir $@)
|
||||
$(PODTOHTML) -o $(notdir $@) $<
|
||||
$(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $<
|
||||
@$(MV) $(notdir $@) $@
|
||||
|
||||
$(COMMON_DIR)/%.html: ../%.pm
|
||||
$(COMMON_DIR)/%.html: ../%.pm $(TOOLS)/podToHtml.pl
|
||||
@$(RM) $(notdir $@)
|
||||
$(PODTOHTML) -s -o $(notdir $@) $<
|
||||
$(PERL) $(TOOLS)/podToHtml.pl -s -o $(notdir $@) $<
|
||||
@$(MKDIR) $(dir $@)
|
||||
@$(MV) $(notdir $@) $@
|
||||
|
||||
$(COMMON_DIR)/%.html: ../%.pl
|
||||
$(COMMON_DIR)/%.html: ../%.pl $(TOOLS)/podToHtml.pl
|
||||
@$(RM) $(notdir $@)
|
||||
$(PODTOHTML) -s -o $(notdir $@) $<
|
||||
$(PERL) $(TOOLS)/podToHtml.pl -s -o $(notdir $@) $<
|
||||
@$(MV) $(notdir $@) $@
|
||||
|
||||
.PRECIOUS: $(COMMON_DIR)/%.html %.html
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
#RULES.ioc
|
||||
|
||||
# RULES.ioc
|
||||
|
||||
include $(CONFIG)/RULES_DIRS
|
||||
|
||||
|
||||
@@ -90,6 +90,4 @@ realclean:
|
||||
.PHONY : $(BUILD_ARCHS) rebuild archsCommonClean
|
||||
.PHONY : $(ACTIONS) clean realclean archclean host all
|
||||
|
||||
# User specific rules
|
||||
#
|
||||
-include $(HOME)/configure/RULES_USER
|
||||
include $(CONFIG)/RULES_COMMON
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
# RULES_BUILD
|
||||
|
||||
# Rules for making things specified in a Makefile
|
||||
#
|
||||
# Rules for making things specified in Makefile
|
||||
#
|
||||
# we are in O.$(T_A), but most sources are elsewhere
|
||||
#
|
||||
# CWD is O.$(T_A), but most sources are elsewhere
|
||||
|
||||
ifndef BASE_RULES_BUILD
|
||||
BASE_RULES_BUILD=1
|
||||
@@ -42,6 +43,7 @@ LOADABLE_LIBRARY += $(LOADABLE_LIBRARY_HOST)
|
||||
OBJS += $(OBJS_HOST)
|
||||
PROD += $(PROD_HOST)
|
||||
SCRIPTS += $(SCRIPTS_HOST)
|
||||
TARGETS += $(TARGETS_HOST)
|
||||
TESTLIBRARY += $(TESTLIBRARY_HOST)
|
||||
TESTSCRIPTS += $(TESTSCRIPTS_HOST)
|
||||
TESTPROD += $(TESTPROD_HOST)
|
||||
@@ -53,6 +55,7 @@ LOADABLE_LIBRARY += $(LOADABLE_LIBRARY_IOC)
|
||||
OBJS += $(OBJS_IOC)
|
||||
PROD += $(PROD_IOC)
|
||||
SCRIPTS += $(SCRIPTS_IOC)
|
||||
TARGETS += $(TARGETS_IOC)
|
||||
TESTLIBRARY += $(TESTLIBRARY_IOC)
|
||||
TESTSCRIPTS += $(TESTSCRIPTS_IOC)
|
||||
TESTPROD += $(TESTPROD_IOC)
|
||||
@@ -79,9 +82,9 @@ else
|
||||
host:
|
||||
endif
|
||||
|
||||
-include $(CONFIG)/RULES_FILE_TYPE
|
||||
include $(CONFIG)/RULES_FILE_TYPE
|
||||
|
||||
-include $(CONFIG)/RULES.Db
|
||||
include $(CONFIG)/RULES.Db
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Include defines and rules for prod, library and test* targets
|
||||
@@ -102,6 +105,7 @@ endif
|
||||
# Products and Object libraries
|
||||
#
|
||||
PRODTARGETS += $(PRODNAME) $(MUNCHNAME) $(CTDT_SRCS) $(CTDT_OBJS) $(NMS)
|
||||
TESTPRODTARGETS += $(TESTPRODNAME) $(TESTMUNCHNAME)
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Test specifications and test result files
|
||||
@@ -140,7 +144,7 @@ rebuild: clean install
|
||||
|
||||
build: inc
|
||||
|
||||
build: $(OBJSNAME) $(LIBTARGETS) $(PRODTARGETS) $(TESTPRODNAME) \
|
||||
build: $(OBJSNAME) $(LIBTARGETS) $(PRODTARGETS) $(TESTPRODTARGETS) \
|
||||
$(TARGETS) $(TESTSCRIPTS) $(INSTALL_LIB_INSTALLS)
|
||||
|
||||
inc : $(COMMON_INC) $(INSTALL_INC) $(INSTALL_CONFIGS)
|
||||
@@ -158,20 +162,21 @@ clean: build_clean
|
||||
|
||||
build_clean:
|
||||
$(ECHO) "Cleaning"
|
||||
@$(RM) *.i *$(OBJ) *.a $(TESTPRODNAME) \
|
||||
@$(RM) *.i *$(OBJ) *.a \
|
||||
$(LIBNAME) $(TESTLIBNAME) $(SHRLIBNAME) $(TESTSHRLIBNAME) \
|
||||
$(DLLSTUB_LIBNAME) $(TESTDLLSTUB_LIBNAME) \
|
||||
$(LOADABLE_SHRLIBNAME) \
|
||||
$(INC) $(TARGETS) $(TDS) $(CLEANS) \
|
||||
*.out MakefileInclude *.manifest *.exp \
|
||||
$(COMMON_INC) $(HDEPENDS_FILES) $(PRODTARGETS) \
|
||||
$(COMMON_INC) $(HDEPENDS_FILES) $(PRODTARGETS) $(TESTPRODTARGETS) \
|
||||
$(TESTSCRIPTS) $(TAPFILES) $(JUNITFILES)
|
||||
ifdef RES
|
||||
@$(RM) *$(RES)
|
||||
endif
|
||||
|
||||
$(DIRECTORY_TARGETS) :
|
||||
$(MKDIR) $@
|
||||
# Sort mkdir targets to remove duplicates & make parents first
|
||||
$(DIRECTORY_TARGETS):
|
||||
$(MKDIR) $(sort $@)
|
||||
|
||||
# Install LIB_INSTALLS libraries before linking executables
|
||||
$(TESTPRODNAME) $(PRODNAME): | $(INSTALL_LIB_INSTALLS)
|
||||
@@ -183,7 +188,7 @@ endif
|
||||
|
||||
# RELEASE file consistency checking
|
||||
checkRelease:
|
||||
$(CONVERTRELEASE) checkRelease
|
||||
+$(CONVERTRELEASE) checkRelease
|
||||
warnRelease:
|
||||
-$(CONVERTRELEASE) checkRelease
|
||||
noCheckRelease:
|
||||
@@ -254,15 +259,13 @@ YACCOPT ?= $($*_YACCOPT)
|
||||
$(MV) $*.tab.c $*.c
|
||||
$(if $(findstring -d, $(YACCOPT)),$(MV) $*.tab.h $*.h,)
|
||||
|
||||
# must be a seperate rule since when not using '-d' the
|
||||
# must be a separate rule since when not using '-d' the
|
||||
# prefix for .h will be different then .c
|
||||
%.h : %.c %.y
|
||||
|
||||
%.c: %.l
|
||||
@$(RM) $*.yy.c
|
||||
$(LEX) $(LEXOPT) -t $< > $*.yy.c
|
||||
@$(RM) $@
|
||||
$(MV) $*.yy.c $@
|
||||
$(LEX) $(LEXOPT) -o$@ $<
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Libraries, shared/DLL and stubs
|
||||
@@ -321,6 +324,10 @@ $(MUNCHNAME): %$(MUNCH_SUFFIX): $(MUNCH_DEPENDS) %$(EXE)
|
||||
@$(RM) $@
|
||||
$(MUNCH_CMD)
|
||||
|
||||
$(TESTMUNCHNAME): %$(MUNCH_SUFFIX): $(MUNCH_DEPENDS) %$(EXE)
|
||||
@$(RM) $@
|
||||
$(MUNCH_CMD)
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# GeSys modules for RTEMS
|
||||
$(MODNAME): %$(MODEXT): %$(EXE)
|
||||
@@ -328,12 +335,6 @@ $(MODNAME): %$(MODEXT): %$(EXE)
|
||||
@$(RM) $@
|
||||
$(LINK.mod)
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Generate Perl include path module
|
||||
%ModuleDirs.pm: $(wildcard $(TOP)/configure/RELEASE*)
|
||||
@$(MKDIR) $(dir $@)
|
||||
$(CONVERTRELEASE) -T $(TOP) $@
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Automated testing
|
||||
|
||||
@@ -355,14 +356,17 @@ ifneq ($(TAPFILES),)
|
||||
ifdef RUNTESTS_ENABLED
|
||||
prove --failures --ext .tap --exec "$(CAT)" --color $(TAPFILES)
|
||||
endif
|
||||
|
||||
CURRENT_TAPFILES := $(wildcard $(TAPFILES))
|
||||
CURRENT_JUNITFILES := $(wildcard $(JUNITFILES))
|
||||
endif
|
||||
|
||||
clean-tests:
|
||||
ifneq ($(TAPFILES),)
|
||||
$(RM) $(TAPFILES)
|
||||
ifneq ($(CURRENT_TAPFILES),)
|
||||
$(RM) $(CURRENT_TAPFILES)
|
||||
endif
|
||||
ifneq ($(JUNITFILES),)
|
||||
$(RM) $(JUNITFILES)
|
||||
ifneq ($(CURRENT_JUNITFILES),)
|
||||
$(RM) $(CURRENT_JUNITFILES)
|
||||
endif
|
||||
|
||||
tapfiles: $(TESTSCRIPTS) $(TAPFILES)
|
||||
@@ -380,13 +384,13 @@ endif
|
||||
# If there's a perl test script (.plt) available, use it
|
||||
%.t: ../%.plt
|
||||
@$(RM) $@
|
||||
$(EXPAND_TOOL) -t $(INSTALL_LOCATION) -a $(T_A) $< $@
|
||||
$(CP) $< $@
|
||||
|
||||
# Test programs (.t files) must be written in Perl.
|
||||
# Generate a perl program to exec the real test binary.
|
||||
%.t: %$(EXE) $(TOOLS)/makeTestfile.pl
|
||||
@$(RM) $@
|
||||
$(PERL) $(TOOLS)/makeTestfile.pl $@ $<
|
||||
$(PERL) $(TOOLS)/makeTestfile.pl $(T_A) $(EPICS_HOST_ARCH) $@ $<
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Generate header with version number from VCS
|
||||
@@ -471,7 +475,6 @@ ifneq (,$(strip $(LOADABLE_SHRLIB_VERSION)))
|
||||
endif # LOADABLE_SHRLIB_VERSION
|
||||
endif # LOADABLE_SHRLIB_SUFFIX
|
||||
|
||||
ifneq ($(INSTALL_CONFIGS),)
|
||||
$(INSTALL_CONFIG)/%: %
|
||||
$(ECHO) "Installing config file $@"
|
||||
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
|
||||
@@ -479,7 +482,6 @@ $(INSTALL_CONFIG)/%: %
|
||||
$(INSTALL_CONFIG)/%: ../%
|
||||
$(ECHO) "Installing config file $@"
|
||||
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
|
||||
endif
|
||||
|
||||
$(INSTALL_INCLUDE)/% : $(COMMON_DIR)/%
|
||||
$(ECHO) "Installing generated generic include file $@"
|
||||
@@ -525,7 +527,7 @@ $(INSTALL_TEMPLATES_SUBDIR)/%: %
|
||||
$(ECHO) "Installing $@"
|
||||
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
|
||||
|
||||
-include $(CONFIG)/RULES_EXPAND
|
||||
include $(CONFIG)/RULES_EXPAND
|
||||
|
||||
.PRECIOUS: %.i %.o %.c %.nm %.cpp %.cc
|
||||
.PRECIOUS: $(COMMON_INC)
|
||||
@@ -534,5 +536,9 @@ $(INSTALL_TEMPLATES_SUBDIR)/%: %
|
||||
.PHONY: runtests tapfiles clean-tests test-results junitfiles
|
||||
.PHONY: checkRelease warnRelease noCheckRelease FORCE
|
||||
|
||||
include $(CONFIG)/RULES_COMMON
|
||||
|
||||
else
|
||||
$(warning RULES_BUILD included more than once. \
|
||||
Use 'make show-makefiles' to work out why.)
|
||||
endif # BASE_RULES_BUILD
|
||||
# EOF RULES_BUILD
|
||||
|
||||
35
configure/RULES_COMMON
Normal file
35
configure/RULES_COMMON
Normal file
@@ -0,0 +1,35 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2018 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
# These rules show the set of Makefiles, config files and
|
||||
# rules files loaded by GNUmake.
|
||||
|
||||
# Protect against filenames containing colons (Windows)
|
||||
SAFE_MAKEFILES = $(subst :,__colon__,$(MAKEFILE_LIST))
|
||||
SHOW_MAKEFILES = $(SAFE_MAKEFILES:%=show-makefile.%)
|
||||
show-makefiles: $(SHOW_MAKEFILES)
|
||||
|
||||
# The sort prevents warnings about duplicate targets:
|
||||
$(sort $(SHOW_MAKEFILES)): show-makefile.%:
|
||||
@echo " $(subst __colon__,:,$(@:show-makefile.%=%))"
|
||||
|
||||
.PHONY: show-makefiles show-makefile.%
|
||||
|
||||
# These rules support printing a Makefile variable values.
|
||||
# Many variables are only set inside an O.<arch> build directory.
|
||||
# make PRINT.T_A
|
||||
|
||||
PRINT_Var = $(@:PRINT.%=%)
|
||||
PRINT.%:
|
||||
@echo $(PRINT_Var) = '$($(PRINT_Var))'
|
||||
|
||||
.PHONY: PRINT PRINT.%
|
||||
|
||||
|
||||
# User specific rules
|
||||
#
|
||||
-include $(HOME)/configure/RULES_USER
|
||||
@@ -92,7 +92,4 @@ $(ARCHS) $(ACTIONS) $(actionArchTargets) :%: \
|
||||
.PHONY : $(dirActionArchTargets)
|
||||
.PHONY : $(actionArchTargets)
|
||||
|
||||
|
||||
# User specific rules
|
||||
#
|
||||
-include $(HOME)/configure/RULES_USER
|
||||
include $(CONFIG)/RULES_COMMON
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
# <top>/configure/RULES_EXPAND
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2011 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
# RULES_EXPAND
|
||||
|
||||
vpath %@ $(USR_VPATH) $(ALL_SRC_DIRS)
|
||||
|
||||
|
||||
@@ -7,9 +7,11 @@
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
# Include <top>/configure/RULES_BUILD from tops defined in RELEASE* files
|
||||
# Include <top>/configure/RULES_BUILD from tops defined in RELEASE* files,
|
||||
# excluding EPICS_BASE
|
||||
#
|
||||
RELEASE_RULES_BUILDS = $(foreach top, $(RELEASE_TOPS), \
|
||||
RELEASE_RULES_BUILDS = $(foreach top, \
|
||||
$(filter-out EPICS_BASE, $(RELEASE_TOPS)), \
|
||||
$(wildcard $($(top))/configure/RULES_BUILD))
|
||||
ifneq ($(RELEASE_RULES_BUILDS),)
|
||||
include $(RELEASE_RULES_BUILDS)
|
||||
@@ -23,7 +25,7 @@ ifneq ($(RELEASE_CFG_RULES),)
|
||||
include $(RELEASE_CFG_RULES)
|
||||
endif
|
||||
|
||||
# If this is not BASE then include <TOP>/configure/RULES_BUILD
|
||||
# If this is not BASE then include <top>/configure/RULES_BUILD
|
||||
#
|
||||
ifeq ($(wildcard $(TOP)/configure/CONFIG_BASE_VERSION),)
|
||||
TOP_RULES_BUILDS = $(wildcard $(TOP)/configure/RULES_BUILD)
|
||||
@@ -67,7 +69,3 @@ file_type_clean:
|
||||
@$(RM) $(foreach type, $(FILE_TYPE), $($(type)))
|
||||
|
||||
.PHONY : file_type_clean
|
||||
|
||||
# User specific rules
|
||||
#
|
||||
-include $(HOME)/configure/RULES_USER
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
# Copyright (c) 2006 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE Versions 3.13.7
|
||||
# and higher are distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
# Octave definitions and rules
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
# Copyright (c) 2011 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE Versions 3.13.7
|
||||
# and higher are distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
#
|
||||
# RULES_TARGET
|
||||
#
|
||||
# This file is to be maintained by the community.
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
# RULES_TARGET
|
||||
|
||||
define TARGET_template
|
||||
$(1)_$(2) += $$(if $$(strip $$($(1)_$(2)_$$(OS_CLASS))), \
|
||||
|
||||
@@ -21,9 +21,6 @@ realuninstall: uninstallDirs
|
||||
|
||||
UNINSTALL_DIRS += $(INSTALL_DBD) $(INSTALL_INCLUDE) $(INSTALL_DOC) \
|
||||
$(INSTALL_HTML) $(INSTALL_TEMPLATES) $(INSTALL_DB) $(DIRECTORY_TARGETS)
|
||||
ifneq ($(INSTALL_LOCATION),$(TOP))
|
||||
UNINSTALL_DIRS += $(INSTALL_CONFIG)
|
||||
endif
|
||||
uninstallDirs:
|
||||
$(RMDIR) $(UNINSTALL_DIRS)
|
||||
|
||||
|
||||
@@ -27,9 +27,13 @@ ifneq ($(CONFIG),$(TOP)/configure)
|
||||
-include $(TOP)/configure/CONFIG_SITE.Common.RTEMS
|
||||
endif
|
||||
|
||||
#--------------------------------------------------
|
||||
# Set RTEMS_BSP from T_A if not already done
|
||||
RTEMS_BSP ?= $(subst RTEMS-,,$(T_A))
|
||||
|
||||
#-------------------------------------------------------
|
||||
# Pick up the RTEMS tool/path definitions from the RTEMS BSP directory.
|
||||
include $(RTEMS_BASE)/$(RTEMS_TARGET_CPU)-rtems$(RTEMS_VERSION)/$(subst RTEMS-,,$(T_A))/Makefile.inc
|
||||
include $(RTEMS_BASE)/$(RTEMS_TARGET_CPU)-rtems$(RTEMS_VERSION)/$(RTEMS_BSP)/Makefile.inc
|
||||
include $(RTEMS_CUSTOM)
|
||||
include $(CONFIG.CC)
|
||||
|
||||
@@ -72,7 +76,7 @@ CPPFLAGS += $($(BUILD_CLASS)_CPPFLAGS) $(POSIX_CPPFLAGS) $(OPT_CPPFLAGS)\
|
||||
$(USR_CPPFLAGS) $(CMD_CPPFLAGS) $(ARCH_DEP_CPPFLAGS) $(OP_SYS_CPPFLAGS)\
|
||||
$(OP_SYS_INCLUDE_CPPFLAGS) $(CODE_CPPFLAGS)
|
||||
|
||||
ECHO = @$(if $(findstring s,$(patsubst T_A=%,,$(MAKEFLAGS))),$(NOP),echo)
|
||||
ECHO = @$(if $(findstring s,$(MFLAGS)),$(NOP),echo)
|
||||
|
||||
#--------------------------------------------------
|
||||
# Although RTEMS uses gcc, it wants to use gcc its own way
|
||||
@@ -136,6 +140,13 @@ MOD_LDFLAGS = $(OPT_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(POSIX_LDFLAGS) \
|
||||
LINK.mod = $(CCC) -o $@ $(PRODDIR_LDFLAGS) $(MOD_LDFLAGS)
|
||||
LINK.mod += $(PROD_LDFLAGS) $(PROD_LD_OBJS) $(PROD_LD_RESS) $(MOD_LDLIBS)
|
||||
|
||||
#--------------------------------------------------
|
||||
# Here munching means creating a bootable object binary
|
||||
ifdef MUNCH_SUFFIX
|
||||
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
TESTMUNCHNAME = $(TESTPRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
endif
|
||||
|
||||
#--------------------------------------------------
|
||||
# RTEMS has neither shared libraries nor dynamic loading
|
||||
STATIC_BUILD=YES
|
||||
|
||||
@@ -9,5 +9,6 @@
|
||||
#
|
||||
# All RTEMS targets use the same Makefile fragment
|
||||
#
|
||||
RTEMS_TARGET_CPU=arm
|
||||
RTEMS_BSP = at91rm9200ek
|
||||
RTEMS_TARGET_CPU = arm
|
||||
include $(CONFIG)/os/CONFIG.Common.RTEMS
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
# All RTEMS targets use the same Makefile fragment
|
||||
#
|
||||
EXE = .elf
|
||||
RTEMS_BSP = beatnik
|
||||
RTEMS_TARGET_CPU = powerpc
|
||||
GNU_TARGET = powerpc-rtems
|
||||
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
|
||||
@@ -15,7 +16,6 @@ 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
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
#
|
||||
# All RTEMS targets use the same Makefile fragment
|
||||
#
|
||||
RTEMS_TARGET_CPU=m68k
|
||||
RTEMS_BSP = gen68360
|
||||
RTEMS_TARGET_CPU = m68k
|
||||
include $(CONFIG)/os/CONFIG.Common.RTEMS
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
#
|
||||
# All RTEMS targets use the same Makefile fragment
|
||||
#
|
||||
RTEMS_TARGET_CPU=ppc
|
||||
RTEMS_BSP = mcp750
|
||||
RTEMS_TARGET_CPU = ppc
|
||||
include $(CONFIG)/os/CONFIG.Common.RTEMS
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
#
|
||||
# All RTEMS targets use the same Makefile fragment
|
||||
#
|
||||
RTEMS_TARGET_CPU=m68k
|
||||
RTEMS_BSP = mvme167
|
||||
RTEMS_TARGET_CPU = m68k
|
||||
include $(CONFIG)/os/CONFIG.Common.RTEMS
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
# All RTEMS targets use the same Makefile fragment
|
||||
#
|
||||
EXE = .elf
|
||||
RTEMS_BSP = mvme2100
|
||||
RTEMS_TARGET_CPU = powerpc
|
||||
GNU_TARGET = powerpc-rtems
|
||||
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
|
||||
@@ -13,7 +14,6 @@ ARCH_DEP_CFLAGS += -DHAVE_PPCBUG
|
||||
OP_SYS_LDLIBS += -lbspExt
|
||||
|
||||
MUNCH_SUFFIX = .boot
|
||||
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
define MUNCH_CMD
|
||||
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< rtems
|
||||
gzip -f9 rtems
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#
|
||||
# Author: Matt Rippa
|
||||
#
|
||||
RTEMS_BSP = mvme2700
|
||||
RTEMS_TARGET_CPU = powerpc
|
||||
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
|
||||
ARCH_DEP_CFLAGS += -DHAVE_PPCBUG
|
||||
ARCH_DEP_CFLAGS += -DNVRAM_INDIRECT
|
||||
|
||||
MUNCH_SUFFIX = .boot
|
||||
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
define MUNCH_CMD
|
||||
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< rtems
|
||||
gzip -f9 rtems
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
# All RTEMS targets use the same Makefile fragment
|
||||
#
|
||||
EXE = .elf
|
||||
RTEMS_BSP = mvme3100
|
||||
RTEMS_TARGET_CPU = powerpc
|
||||
GNU_TARGET = powerpc-rtems
|
||||
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
|
||||
@@ -15,7 +16,6 @@ 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
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
# All RTEMS targets use the same Makefile fragment
|
||||
#
|
||||
EXE = .elf
|
||||
RTEMS_BSP = mvme5500
|
||||
RTEMS_TARGET_CPU = powerpc
|
||||
GNU_TARGET = powerpc-rtems
|
||||
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
|
||||
@@ -16,7 +17,6 @@ ARCH_DEP_CFLAGS += -DBSP_NVRAM_BASE_ADDR=0xf1110000
|
||||
OP_SYS_LDLIBS += -lbspExt
|
||||
|
||||
MUNCH_SUFFIX = .boot
|
||||
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
define MUNCH_CMD
|
||||
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
|
||||
endef
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
#
|
||||
# All RTEMS targets use the same Makefile fragment
|
||||
#
|
||||
RTEMS_TARGET_CPU=i386
|
||||
RTEMS_BSP = pc386
|
||||
RTEMS_TARGET_CPU = i386
|
||||
|
||||
MUNCH_SUFFIX = .boot
|
||||
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
define MUNCH_CMD
|
||||
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< temp.bin
|
||||
$(RM) $*.bin
|
||||
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< $*.bin
|
||||
$(BIN2BOOT) $@ 0x00097E00 \
|
||||
$(PROJECT_RELEASE)/lib/start16.bin 0x00097C00 0 temp.bin 0x00100000 0
|
||||
rm -f temp.bin
|
||||
$(PROJECT_RELEASE)/lib/start16.bin 0x00097C00 0 $*.bin 0x00100000 0
|
||||
endef
|
||||
|
||||
include $(CONFIG)/os/CONFIG.Common.RTEMS
|
||||
|
||||
11
configure/os/CONFIG.Common.RTEMS-pc386-qemu
Normal file
11
configure/os/CONFIG.Common.RTEMS-pc386-qemu
Normal file
@@ -0,0 +1,11 @@
|
||||
# CONFIG.Common.RTEMS-pc386-qemu
|
||||
#
|
||||
# Definitions for the RTEMS-pc386-qemu target
|
||||
# Site-specific overrides go in CONFIG_SITE.Common.RTEMS-pc386-qemu
|
||||
#
|
||||
#-------------------------------------------------------
|
||||
|
||||
# Include definitions from RTEMS-pc386
|
||||
include $(CONFIG)/os/CONFIG.Common.RTEMS-pc386
|
||||
|
||||
RTEMS_QEMU_FIXUPS = YES
|
||||
@@ -5,5 +5,6 @@
|
||||
#
|
||||
# All RTEMS targets use the same Makefile fragment
|
||||
#
|
||||
RTEMS_TARGET_CPU=ppc
|
||||
RTEMS_BSP = psim
|
||||
RTEMS_TARGET_CPU = ppc
|
||||
include $(CONFIG)/os/CONFIG.Common.RTEMS
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
#
|
||||
# All RTEMS targets use the same Makefile fragment
|
||||
#
|
||||
RTEMS_BSP = uC5282
|
||||
RTEMS_TARGET_CPU = m68k
|
||||
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
|
||||
|
||||
MUNCH_SUFFIX = .boot
|
||||
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
|
||||
define MUNCH_CMD
|
||||
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< $@
|
||||
endef
|
||||
|
||||
@@ -146,8 +146,10 @@ SHRLIB_CFLAGS =
|
||||
SHRLIB_LDFLAGS =
|
||||
|
||||
#--------------------------------------------------
|
||||
# Earlier versions of gcc don't understand -MF
|
||||
HDEPENDS_COMPFLAGS = -MM > $@
|
||||
# Don't use gcc 2.x for dependency generation
|
||||
|
||||
HDEPENDS_METHOD_2 = MKMF
|
||||
HDEPENDS_METHOD = $(firstword $(HDEPENDS_METHOD_$(VX_GNU_MAJOR_VERSION)) COMP)
|
||||
|
||||
#--------------------------------------------------
|
||||
# osithead use default stack, YES or NO override
|
||||
@@ -170,6 +172,10 @@ COMPILE.ctdt = $(CC) -c $(CPPFLAGS) $(CFLAGS_ctdt) $(INCLUDES) $(SOURCE_FLAG)
|
||||
VXCPPFLAGS = $(filter-out $(OP_SYS_INCLUDE_CPPFLAGS),$(CPPFLAGS))
|
||||
PREPROCESS.cpp = $(CPP) $(VXCPPFLAGS) $(INCLUDES) $< > $@
|
||||
|
||||
#--------------------------------------------------
|
||||
# Use LEDLIB for command-line editing
|
||||
COMMANDLINE_LIBRARY = LEDLIB
|
||||
|
||||
#--------------------------------------------------
|
||||
# Allow site overrides
|
||||
-include $(CONFIG)/os/CONFIG_SITE.Common.vxWorksCommon
|
||||
|
||||
@@ -65,14 +65,14 @@ GNU = NO
|
||||
#
|
||||
# Darwin shared libraries
|
||||
#
|
||||
SHRLIB_LDFLAGS = -dynamiclib -flat_namespace -undefined suppress \
|
||||
SHRLIB_LDFLAGS = -dynamiclib -undefined dynamic_lookup \
|
||||
-install_name $(shell $(FULLPATHNAME) $(INSTALL_LIB))/$@ \
|
||||
$(addprefix -compatibility_version , $(SHRLIB_VERSION)) \
|
||||
$(addprefix -current_version , $(SHRLIB_VERSION))
|
||||
SHRLIB_SUFFIX_BASE = .dylib
|
||||
SHRLIB_SUFFIX = $(addprefix ., $(SHRLIB_VERSION))$(SHRLIB_SUFFIX_BASE)
|
||||
|
||||
LOADABLE_SHRLIB_LDFLAGS = -bundle -flat_namespace -undefined suppress
|
||||
LOADABLE_SHRLIB_LDFLAGS = -bundle -undefined dynamic_lookup
|
||||
|
||||
#
|
||||
# Position-independent code is the default on Darwin.
|
||||
|
||||
@@ -79,16 +79,20 @@ CPP = cl -nologo -C -E
|
||||
|
||||
# Configure OS vendor C++ compiler
|
||||
#
|
||||
# __STDC__=0 gives us both:
|
||||
# 1) define STDC for code (pretend ANSI conformance)
|
||||
# 2) set it to 0 to use MS C "extensions" (open for _open etc.)
|
||||
# because MS uses: if __STDC__ ... disable many nice things
|
||||
#
|
||||
# -EHsc - generate code for exceptions
|
||||
# -GR - generate code for run time type identification
|
||||
#
|
||||
CCC = cl -EHsc -GR
|
||||
CODE_CPPFLAGS += -nologo -D__STDC__=0
|
||||
|
||||
# Other compiler flags, used for CPP, C and C++
|
||||
#
|
||||
# -FC - Show absolute path of source file in diagnostics
|
||||
# -D__STDC__=0 gives us both:
|
||||
# 1) define STDC for code (pretend ANSI conformance)
|
||||
# 2) set it to 0 to use MS C "extensions" (open for _open etc.)
|
||||
# because MS uses: if __STDC__ ... disable many nice things
|
||||
#
|
||||
CODE_CPPFLAGS += -nologo -FC -D__STDC__=0
|
||||
CODE_CPPFLAGS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
|
||||
|
||||
|
||||
@@ -136,6 +140,16 @@ STATIC_LDLIBS_NO=
|
||||
STATIC_LDFLAGS=
|
||||
RANLIB=
|
||||
|
||||
#
|
||||
# option needed for parallel builds with Visual Studio 2015 onward
|
||||
#
|
||||
# -FS Force Synchronous PDB Writes
|
||||
ifneq ($(VisualStudioVersion),)
|
||||
OPT_CXXFLAGS_NO += -FS
|
||||
OPT_CFLAGS_NO += -FS
|
||||
endif
|
||||
|
||||
|
||||
#
|
||||
# add -profile here to run the ms profiler
|
||||
# -LTCG whole program optimization
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#
|
||||
# Site-specific overrides for RTEMS-pc386 target
|
||||
#
|
||||
9
configure/os/CONFIG_SITE.Common.RTEMS-pc386-qemu
Normal file
9
configure/os/CONFIG_SITE.Common.RTEMS-pc386-qemu
Normal file
@@ -0,0 +1,9 @@
|
||||
# CONFIG_SITE.Common.RTEMS-pc386-qemu
|
||||
#
|
||||
# Site-specific overrides for the RTEMS-pc386-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 += RTEMS-pc386-qemu
|
||||
@@ -4,17 +4,17 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<title>Known Problems in EPICS 7.0.1</title>
|
||||
<title>Known Problems in Base-3.16.1</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1 style="text-align: center">EPICS 7.0.1: Known Problems</h1>
|
||||
<h1 style="text-align: center">EPICS Base R3.16.1: Known Problems</h1>
|
||||
|
||||
<p>Any patch files linked below should be applied at the root of the
|
||||
base-7.0.1 tree. Download them, then use the GNU Patch program as
|
||||
base-3.16.1 tree. Download them, then use the GNU Patch program as
|
||||
follows:</p>
|
||||
|
||||
<blockquote><pre>% <b>cd <i>/path/to/</i>base-7.0.1</b>
|
||||
<blockquote><pre>% <b>cd <i>/path/to/</i>base-3.16.1</b>
|
||||
% <b>patch -p1 < <i>/path/to/</i>file.patch</b></pre></blockquote>
|
||||
|
||||
<p>The following problems were known by the developers at the time of this
|
||||
@@ -32,6 +32,10 @@ release:</p>
|
||||
about duplicate EPICS CA Address list entries. These warnings might be due
|
||||
to a bug in Cygwin; they are benign and can be ignored.</li>
|
||||
|
||||
<li>64-bit Windows builds of the CAS library may not work with some compilers.
|
||||
The code in <tt>src/legacy/gdd</tt> is incompatible with the LLP64 model
|
||||
that Windows uses for its 64-bit ABI.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -67,8 +67,9 @@
|
||||
Software requirements
|
||||
|
||||
GNU make
|
||||
You must use GNU make, gnumake, for any EPICS builds. Set your path so
|
||||
that a gnumake version 3.81 or later is available.
|
||||
You must use the GNU version of make for EPICS builds, and we now
|
||||
recommend version 4.1 or later (version 3.82 may work on Linux, but
|
||||
doesn't on Windows).
|
||||
|
||||
Perl
|
||||
You must have Perl version 5.8.1 or later installed. The EPICS
|
||||
@@ -99,20 +100,17 @@
|
||||
|
||||
RTEMS
|
||||
For RTEMS targets, you need RTEMS core and toolset version 4.9.2 or
|
||||
later.
|
||||
4.10. The newer 4.11 or 5.x releases are not supported yet.
|
||||
|
||||
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 libraries
|
||||
GNU readline or other OS-specific libraries can be used by the IOC shell
|
||||
to provide command line editing and history recall. The default setting
|
||||
is different for each OS. On Linux the default is to use READLINE since
|
||||
most distributions include it. On MacOS the default is also READLINE
|
||||
since Apple provides a compatible library, although it isn't GNU. On
|
||||
RTEMS we support GNU readline and Tecla, although the default is to use
|
||||
neither since these have to be added to the RTEMS installation
|
||||
separately. On vxWorks we support the built-in ledLib library.
|
||||
|
||||
Host system storage requirements
|
||||
|
||||
@@ -166,12 +164,11 @@
|
||||
|
||||
base/startup directory - contains scripts to set environment and path
|
||||
|
||||
EpicsHostArch C shell script to set EPICS_HOST_ARCH env variable
|
||||
EpicsHostArch.pl Perl script to set EPICS_HOST_ARCH env variable
|
||||
Site.profile bourne shell script to set path and env variables
|
||||
Site.cshrc c shell script to set path and env variables
|
||||
cygwin.bat WIN32 bat file to set cygwin path and env variables
|
||||
win32.bat WIN32 bat file to set path and env variables
|
||||
EpicsHostArch Shell script to set EPICS_HOST_ARCH env variable
|
||||
unix.csh C shell script to set path and env variables
|
||||
unix.sh Bourne shell script to set path and env variables
|
||||
win32.bat Bat file example to configure win32-x86 target
|
||||
windows.bat Bat file example to configure windows-x64 target
|
||||
|
||||
base/configure directory - contains build definitions and rules
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ of my Bash login script (~/.bash_login):
|
||||
#
|
||||
EPICS_BASE="${HOME}/src/EPICS/base"
|
||||
EPICS_EXTENSIONS="${HOME}/src/EPICS/extensions"
|
||||
<strong>.</strong> "${EPICS_BASE}"/startup/Site.profile
|
||||
<strong>.</strong> "${EPICS_BASE}"/startup/unix.sh
|
||||
</pre>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<BODY>
|
||||
<CENTER>
|
||||
<H1>Installation Instructions</H1>
|
||||
<H2>EPICS Base Release 7.0.1</H2><BR>
|
||||
<H2>EPICS Base Release 3.16.1</H2><BR>
|
||||
</CENTER>
|
||||
<HR>
|
||||
<H3> Table of Contents</H3>
|
||||
@@ -72,8 +72,8 @@
|
||||
<H3><A NAME="0_0_6"> Software requirements</A></H3>
|
||||
|
||||
<BLOCKQUOTE><B>GNU make</B><BR>
|
||||
You must use GNU make, gnumake, for any EPICS builds. Set your path
|
||||
so that a gnumake version 3.81 or later is available.
|
||||
You must use the GNU version of make for EPICS builds, and we now recommend
|
||||
version 4.1 or later (version 3.82 may work on Linux, but doesn't on Windows).
|
||||
|
||||
<P><B>Perl</B><BR>
|
||||
You must have Perl version 5.8.1 or later installed. The EPICS configuration
|
||||
@@ -98,25 +98,25 @@
|
||||
base/configure/os/CONFIG_SITE.Common.vxWorksCommon file or in one of its
|
||||
target-specific overrides.</P>
|
||||
|
||||
<P>Consult the <a href="http://www.aps.anl.gov/epics/base/vxWorks6.php">vxWorks
|
||||
<P>Consult the <a href="https://epics.anl.gov/base/vxWorks6.php">vxWorks
|
||||
6.x</a> EPICS web pages and the vxWorks documentation for information
|
||||
about configuring your vxWorks operating system for use with EPICS.</P>
|
||||
|
||||
<P><B>RTEMS</B><BR>
|
||||
For RTEMS targets, you need RTEMS core and toolset version 4.9.2 or later.</P>
|
||||
For RTEMS targets, you need RTEMS core and toolset version 4.9.2 or 4.10. The
|
||||
newer 4.11 or 5.x releases are not supported yet.</P>
|
||||
|
||||
<P><B>Command-line editing libraries</B><BR>
|
||||
|
||||
GNU readline or other OS-specific libraries can be used by the IOC shell to
|
||||
provide command line editing and history recall. The default setting is
|
||||
different for each OS. On Linux the default is to use READLINE since most
|
||||
distributions include it. On MacOS the default is also READLINE since Apple
|
||||
provides a compatible library, although it isn't GNU. On RTEMS we support GNU
|
||||
readline and Tecla, although the default is to use neither since these have to
|
||||
be added to the RTEMS installation separately. On vxWorks we support the
|
||||
built-in ledLib library.</P>
|
||||
|
||||
<P><B>GNU readline or Tecla library</B><BR>
|
||||
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.</P>
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<H3><A NAME="0_0_7"> Host system storage requirements</A></H3>
|
||||
@@ -128,7 +128,7 @@
|
||||
|
||||
<H3><A NAME="0_0_8"> Documentation</A></H3>
|
||||
<BLOCKQUOTE>EPICS documentation is available through the
|
||||
<a href="http://www.aps.anl.gov/epics/">EPICS website</a> at Argonne.
|
||||
<a href="https://epics.anl.gov/">EPICS website</a> at Argonne.
|
||||
<P>Release specific documentation can also be found in the base/documentation
|
||||
directory of the distribution.</BLOCKQUOTE>
|
||||
|
||||
@@ -176,12 +176,11 @@
|
||||
|
||||
<H4>base/startup directory - contains scripts to set environment and path</H4>
|
||||
<PRE>
|
||||
EpicsHostArch C shell script to set EPICS_HOST_ARCH env variable
|
||||
EpicsHostArch.pl Perl script to set EPICS_HOST_ARCH env variable
|
||||
Site.profile bourne shell script to set path and env variables
|
||||
Site.cshrc c shell script to set path and env variables
|
||||
cygwin.bat WIN32 bat file to set cygwin path and env variables
|
||||
win32.bat WIN32 bat file to set path and env variables
|
||||
EpicsHostArch Shell script to set EPICS_HOST_ARCH env variable
|
||||
unix.csh C shell script to set path and env variables
|
||||
unix.sh Bourne shell script to set path and env variables
|
||||
win32.bat Bat file example to configure win32-x86 target
|
||||
windows.bat Bat file example to configure windows-x64 target
|
||||
</PRE>
|
||||
|
||||
<H4>base/configure directory - contains build definitions and rules</H4>
|
||||
@@ -243,11 +242,11 @@ Files in the base/startup directory have been provided to
|
||||
help set required path and other environment variables.
|
||||
|
||||
<P><B>EPICS_HOST_ARCH</B><BR>
|
||||
Before you can build or use EPICS Base, the environment variable
|
||||
EPICS_HOST_ARCH should be defined. A perl script EpicsHostArch.pl in the
|
||||
Before you can build or use EPICS R3.15, 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 CPU architecture, e.g. linux-x86_64.
|
||||
followed by a dash and then your host architecture, e.g. solaris-sparc.
|
||||
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"
|
||||
@@ -269,7 +268,7 @@ Files in the base/startup directory have been provided to
|
||||
|
||||
<P><B>LD_LIBRARY_PATH</B><BR>
|
||||
|
||||
EPICS shared libraries and executables normally contain the full path
|
||||
R3.15 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
|
||||
@@ -343,7 +342,7 @@ Files in the base/startup directory have been provided to
|
||||
and then executed to try out this release of base.
|
||||
|
||||
<P>
|
||||
Instructions for building and executing the example IOC application
|
||||
Instructions for building and executing the 3.15 example application
|
||||
can be found in the section "Example Application" of Chapter 2,
|
||||
"Getting Started", in the "IOC Application Developer's Guide" for this
|
||||
release. The "Example IOC Application" section briefly explains how to
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|
||||
<title>EPICS 7.0 Release Notes</title>
|
||||
<title>EPICS Base R3.16.2 Release Notes</title>
|
||||
</head>
|
||||
|
||||
<body lang="en">
|
||||
<h1 align="center">EPICS Release 7.0.1</h1>
|
||||
<h1 align="center">EPICS Base Release 3.16.2</h1>
|
||||
|
||||
<h2 align="center">Changes made between 3.16.1 and 3.16.2</h2>
|
||||
|
||||
<!-- Insert new items immediately below this template ...
|
||||
|
||||
@@ -17,72 +19,224 @@
|
||||
|
||||
-->
|
||||
|
||||
<h3>Changed SIML failure behavior</h3>
|
||||
<h3>Launchpad Bugs</h3>
|
||||
|
||||
<p>A failure when fetching the simulation mode through <tt>SIML</tt> will not
|
||||
put the record into INVALID alarm state anymore. Instead, as long as the
|
||||
record's current alarm severity (<tt>SEVR</tt>)is NO_ALARM, its alarm status
|
||||
(<tt>STAT</tt>) will be set to LINK_ALARM without increasing the severity. This
|
||||
allows clients to get some notification of a failing or bad <tt>SIML</tt> link
|
||||
without otherwise affecting record processing.</p>
|
||||
<p>The list of tracked bugs fixed in this release can be found on the
|
||||
<a href="https://launchpad.net/epics-base/+milestone/3.16.2">Launchpad Milestone
|
||||
page for EPICS Base 3.16.2</a>.</p>
|
||||
|
||||
<h3>Status reporting for the callback and scanOnce task queues</h3>
|
||||
|
||||
<h3>dbVerify() has been restored to dbStaticLib</h3>
|
||||
<p>Two new iocsh commands and some associated underlying APIs have been added to
|
||||
show the state of the queues that feed the three callback tasks and the scanOnce
|
||||
task, including a high-water mark which can optionally be reset. The new iocsh
|
||||
commands are <tt>callbackQueueShow</tt> and <tt>scanOnceQueueShow</tt>; both
|
||||
take an optional integer argument which must be non-zero to reset the
|
||||
high-water mark.</p>
|
||||
|
||||
<p>This routine was removed in Base-3.16.1 but has been reimplemented in this
|
||||
release by special request. Note that the error message strings that it returns
|
||||
when verification fails have changed, but are still designed for display to the
|
||||
user.</p>
|
||||
<h3>Support for event codes greater than or equal to NUM_TIME_EVENTS</h3>
|
||||
|
||||
<p>Event numbers greater than or equal to NUM_TIME_EVENTS are now allowed if
|
||||
supported by the registered event time provider, which must provide its own
|
||||
advancing timestamp validation for such events.</p>
|
||||
|
||||
<h3>Simulation mode improvements</h3>
|
||||
<p>Time events numbered 0 through (NUM_TIME_EVENTS-1) are still validated by
|
||||
code in epicsGeneralTime.c that checks for advancing timestamps and enforces
|
||||
that restriction.</p>
|
||||
|
||||
<p>Records that support simulation mode have two new fields, <tt>SSCN</tt>
|
||||
(Simulation Scan Mode) and <tt>SDLY</tt> (Simulation Delay). <tt>SSCN</tt> is a
|
||||
menu field that provides an alternate value for the <tt>SCAN</tt> field to be
|
||||
used while the record is in simulation mode. This is especially useful for I/O
|
||||
scanned records, for which simulation mode was not working at all. Setting
|
||||
<tt>SDLY</tt> to a positive value makes the record process asynchronously in
|
||||
simulation mode, with the second stage processing happening after the specified
|
||||
time (in seconds).</p>
|
||||
<h3>Type-safe Device and Driver Support Tables</h3>
|
||||
|
||||
<p>Type-safe versions of the device and driver support structures <tt>dset</tt>
|
||||
and <tt>drvet</tt> have been added to the devSup.h and drvSup.h headers
|
||||
respectively. The original structure definitions have not been changed so
|
||||
existing support modules will still build normally, but older modules can be
|
||||
modified and new code written to be compatible with both.</p>
|
||||
|
||||
<h3>Extend the dbServer API with init/run/pause/stop methods</h3>
|
||||
<p>The old structure definitions will be replaced by the new ones if the macros
|
||||
<tt>USE_TYPED_DSET</tt> and/or <tt>USE_TYPED_DRVET</tt> are defined when the
|
||||
appropriate header is included. The best place to define these is in the
|
||||
Makefile, as with the <tt>USE_TYPED_RSET</tt> macro that was introduced in
|
||||
Base-3.16.1 and described below. See the comments in devSup.h for a brief usage
|
||||
example, or look at <a href="https://github.com/epics-modules/ipac/commit/a7e0ff4089b9aa39108bc8569e95ba7fcf07cee9">
|
||||
this commit</a> to the ipac module to see a module conversion.</p>
|
||||
|
||||
<p>This change permits IOCs to be built that omit the CA server (RSRV) by
|
||||
removing its registrar entry which is now provided in the new <tt>rsrv.dbd</tt>
|
||||
file. Other server layers can be built into the IOC (alongside RSRV or in place
|
||||
of it) by registering them in a similar manner. The dbServer API is documented
|
||||
with Doxygen comments in the header file.</p>
|
||||
<p>A helper function <tt>DBLINK* dbGetDevLink(dbCommon *prec)</tt> has also been
|
||||
added to devSup.h which fetches a pointer to the INP or OUT field of the
|
||||
record.</p>
|
||||
|
||||
<p>Specific IOC server layers can be disabled at runtime by adding their name to
|
||||
the environment variable EPICS_IOC_IGNORE_SERVERS (separated by spaces if more
|
||||
than one should be ignored).</p>
|
||||
<h3>RTEMS build configuration update, running tests under QEMU</h3>
|
||||
|
||||
<p>This release includes the ability to run the EPICS unit tests built for a
|
||||
special version of the RTEMS-pc386 target architecture on systems that have an
|
||||
appropriate QEMU emulator installed (<tt>qemu-system-i386</tt>). It is also now
|
||||
possible to create sub-architectures of RTEMS targets, whereas previously the
|
||||
EPICS target architecture name had to be <tt>RTEMS-$(RTEMS_BSP)</tt>.</p>
|
||||
|
||||
<h3>Grand source-code reorganization</h3>
|
||||
<p>The new target <tt>RTEMS-pc386-qemu</tt> builds binaries that can be run in
|
||||
the <tt>qemu-system-i386</tt> PC System emulator. This target is a derivative of
|
||||
the original <tt>RTEMS-pc386</tt> target but with additional software to build
|
||||
an in-memory file-system, and some minor modifications to allow the unit tests
|
||||
to work properly under QEMU. When this target is enabled, building any of the
|
||||
make targets that cause the built-in self-tests to be run (such as
|
||||
<tt>make runtests</tt>) will also run the tests for RTEMS using QEMU.</p>
|
||||
|
||||
<p>EPICS 7.0.1 contains the IOC Database, RSRV server and the Channel Access
|
||||
client code from EPICS Base 3.16.1 along with all the original record types and
|
||||
soft device support, but GDD and the Portable Channel Access Server have been
|
||||
unbundled and are now available separately. In their place we have brought in
|
||||
the more recently written EPICS V4 C++ libraries (collectively referred to as
|
||||
the PVA modules). The directory tree for EPICS is somewhat larger as a result,
|
||||
and the original structure of the Base directories has been split into 4
|
||||
separate Git repositories. External modules should build against this new
|
||||
structure with little or no changes needed, except that some allowance may be
|
||||
needed for the merging of the V4 modules.</p>
|
||||
<p>To allow the new 3-component RTEMS target name, the EPICS build system for
|
||||
RTEMS was modified to allow a <tt>configure/os/CONFIG.Common.<arch></tt>
|
||||
file to set the <tt>RTEMS_BSP</tt> variable to inform the build what RTEMS BSP
|
||||
to use. Previously this was inferred from the value of the <tt>T_A</tt> make
|
||||
variable, but that prevents having multiple EPICS targets that build against the
|
||||
same BSP. All the included RTEMS target configuration files have been updated;
|
||||
build configuration files for out-of-tree RTEMS targets will continue to work as
|
||||
the original rules are used to set <tt>RTEMS_BSP</tt> if it hasn't been set when
|
||||
needed.</p>
|
||||
|
||||
<p>There should be rather more description and documantation of these changes
|
||||
than is currently available, but as developers we generally much prefer to write
|
||||
code than documentation. Send questions to the tech-talk mailing list and we'll
|
||||
be happy to try and answer them!</p>
|
||||
<h3>Link type enhancements</h3>
|
||||
|
||||
<p>This release adds three new link types: "state", "debug" and "trace". The
|
||||
"state" link type gets and puts boolean values from/to the dbState library that
|
||||
was added in the 3.15.1 release. The "debug" link type sets the
|
||||
<code>jlink::debug</code> flag in its child link, while the "trace" link type
|
||||
also causes the arguments and return values for all calls to the child link's
|
||||
jlif and lset routines to be printed on stdout. The debug flag can no longer be
|
||||
set using an info tag. The addition of the "trace" link type has allowed over
|
||||
200 lines of conditional diagnostic printf() calls to be removed from the other
|
||||
link types.</p>
|
||||
|
||||
<h2 align="center">Changes from the 3.16 branch since 3.16.1</h2>
|
||||
<p>The "calc" link type can now be used for output links as well as input links.
|
||||
This allows modification of the output value and even combining it with values
|
||||
from other input links. See the separate JSON Link types document for
|
||||
details.</p>
|
||||
|
||||
<!-- Insert inherited items immediately below here ... -->
|
||||
<p>A new <code>start_child()</code> method was added to the end of the jlif
|
||||
interface table.</p>
|
||||
|
||||
<p>The <code>lset</code> methods have now been properly documented in the
|
||||
dbLink.h header file using Doxygen annotations, although we do not run Doxygen
|
||||
on the source tree yet to generate API documentation.</p>
|
||||
|
||||
<p>Link types that utilize child links must now indicate whether the child will
|
||||
be used for input, output or forward linking by the return value from its
|
||||
<code>parse_start_map()</code> method. The <code>jlif_key_result</code> enum now
|
||||
contains 3 values <code>jlif_key_child_inlink</code>,
|
||||
<code>jlif_key_child_outlink</code> and <code>jlif_key_child_fwdlink</code>
|
||||
instead of the single <code>jlif_key_child_link</code> that was previously used
|
||||
for this.</p>
|
||||
|
||||
<h3>GNUmake targets for debugging</h3>
|
||||
|
||||
<p>Some additional build rules have been added to help debug configuration
|
||||
problems with the build system. Run <tt>make show-makefiles</tt> to get a sorted
|
||||
list of all the files that the build system includes when building in the
|
||||
current directory.</p>
|
||||
|
||||
<p>A new pattern rule for <tt>PRINT.%</tt> can be used to show the value of any
|
||||
GNUmake variable for the current build directory (make sure you are in the right
|
||||
directory though, many variables are only set when inside the
|
||||
<tt>O.<i>arch</i></tt> build directory). For example <tt>make PRINT.T_A</tt>
|
||||
will display the build target architecture name from inside a
|
||||
<tt>O.<i>arch</i></tt> directory but the variable will be empty from an
|
||||
application top or src directory. <tt>make PRINT.EPICS_BASE</tt> will show the
|
||||
path to Base from any EPICS application directory though.</p>
|
||||
|
||||
<h3>Propagate PUTF across Asynchronous record processing</h3>
|
||||
|
||||
<p>The IOC contains a mechanism involving the PUTF and RPRO fields of each
|
||||
record to ensure that if a record is busy when it receives a put to one of its
|
||||
fields, the record will be processed again to ensure that the new field value
|
||||
has been correctly acted on. Until now that mechanism only worked if the put was
|
||||
to the asynchronous record itself, so puts that were chained from some other
|
||||
record via a DB link did not cause reprocessing.</p>
|
||||
|
||||
<p>In this release the mechanism has been extended to propagate the PUTF state
|
||||
across DB links until all downstream records have been reprocessed. Some
|
||||
additional information about the record state can be shown by setting the TPRO
|
||||
field of an upstream record, and even more trace data is displayed if the
|
||||
debugging variable <tt>dbAccessDebugPUTF</tt> is set in addition to TPRO.</p>
|
||||
|
||||
<h3>Finding info fields</h3>
|
||||
|
||||
<p>A new iocsh command <code>dbli</code> lists the info fields defined in the
|
||||
database, and can take a glob pattern to limit output to specific info names.
|
||||
The newly added dbStaticLib function <code>dbNextMatchingInfo()</code> iterates
|
||||
through the info fields defined in the current record, and is used to implement
|
||||
the new command.</p>
|
||||
|
||||
<h3>Output from <tt>dbpr</tt> command enhanced</h3>
|
||||
|
||||
<p>The "DataBase Print Record" command <tt>dbpr</tt> now generates slightly
|
||||
better output, with more field types having their own display methods. This
|
||||
release also includes additional protection against buffer overflows while
|
||||
printing long links in <tt>dbpr</tt>, and corrects the output of long strings
|
||||
from the <tt>dbgf</tt> command.</p>
|
||||
|
||||
<h3>Record types mbbiDirect and mbboDirect upgraded to 32 bit</h3>
|
||||
|
||||
<p>The VAL fields and related fields of these records are now <tt>DBF_LONG</tt>.
|
||||
(Not <tt>DBF_ULONG</tt> in order to prevent Channel Access from promoting them
|
||||
to <tt>DBF_DOUBLE</tt>.) Additional bit fields <tt>B10</tt>...<tt>B1F</tt> have
|
||||
been added.</p>
|
||||
|
||||
<p>Device support that accesses <tt>VAL</tt> or the bit fields directly (most
|
||||
don't) and aims for compatibility with old and new versions of these records
|
||||
should use at least 32 bit integer types to avoid bit loss. The number of bit
|
||||
fields can be calculated using <code>8 * sizeof(prec->val)</code>
|
||||
which is correct in both versions.</p>
|
||||
|
||||
<h3>Restore use of ledlib for VxWorks command editing</h3>
|
||||
|
||||
<p>The epicsReadline refactoring work described below unfortunately disabled the
|
||||
VxWorks implementation of the osdReadline.c API that uses ledlib for command
|
||||
editing and history. This functionality has now been restored, see Launchpad
|
||||
<a href="https://bugs.launchpad.net/bugs/1741578">bug #1741578</a>.</p>
|
||||
|
||||
<h3>Constant link types</h3>
|
||||
|
||||
<p>Constant links can now hold 64-bit integer values, either as scalars or
|
||||
arrays. Only base 10 is supported by the JSON parser though, the JSON standard
|
||||
doesn't allow for hexadecimal numbers.</p>
|
||||
|
||||
<h3>Upgraded the YAJL JSON Library</h3>
|
||||
|
||||
<p>The third-party YAJL library that has been included in libCom for several
|
||||
years has been upgraded to version 2.1.0 and several bugs fixed. This has an
|
||||
updated API, requiring any code that uses it to parse its own JSON files to be
|
||||
modified to match. The changes are mainly that it uses <tt>size_t</tt> instead
|
||||
<tt>unsigned int</tt> for string lengths, but it also uses <tt>long long</tt>
|
||||
instead of <tt>long</tt> for JSON integer values, which was the main motivation
|
||||
for the upgrade.</p>
|
||||
|
||||
<p>The self-tests that YAJL comes with have been imported and are now run as an
|
||||
EPICS Unit Test program, and the JSON syntax accepted by the parser was extended
|
||||
to permit trailing commas in both arrays and maps. The difference between the
|
||||
old and new YAJL APIs can be detected at compile time by looking for the macro
|
||||
<tt>EPICS_YAJL_VERSION</tt> which is defined in the yajl_common.h header file
|
||||
along with a brief description of the API changes.</p>
|
||||
|
||||
<h3>Timestamp support for the calc link type</h3>
|
||||
|
||||
<p>A new optional parameter can be given when specifying a calc JSON link. The
|
||||
<tt>time</tt> parameter is a string containing a single letter <tt>A..L</tt>
|
||||
that selects one of the input links to be used for the timestamp of calculation
|
||||
if requested. The timestamp will be fetched atomically with the value from the
|
||||
chosen input link (providing that input link type supports the readLocked()
|
||||
method).</p>
|
||||
|
||||
<h3>Silence errors from puts to constant link types</h3>
|
||||
|
||||
<p>A soft channel output record with the OUT link unset uses the CONSTANT link
|
||||
type. The new link type code was causing some soft channel device supports to
|
||||
return an error status from the write method of that link type, which would
|
||||
cause a ca_put() operation to such a record to generate an exception. This has
|
||||
been silenced by giving the constant link types a dummy putValue method. A new
|
||||
test program has been added to prevent regressions of this behaviour.</p>
|
||||
|
||||
<h3>RSRV expanding large buffer causes crash</h3>
|
||||
|
||||
<p>In the 3.16.1 release a crash can occur in the IOC's RSRV server when a large
|
||||
array is made even larger; the previous array buffer was not being released
|
||||
correctly. See Launchpad
|
||||
<a href="https://bugs.launchpad.net/epics-base/+bug/1706703">bug
|
||||
#1706703</a>.</p>
|
||||
|
||||
|
||||
<h2 align="center">Changes made between 3.16.0.1 and 3.16.1</h2>
|
||||
@@ -118,6 +272,27 @@ preprocessor macro):</p>
|
||||
#endif
|
||||
</pre></blockquote>
|
||||
|
||||
<p>If the code uses the old db_access.h types (probably because it's calling
|
||||
Channel Access APIs) then it will have to test against the EPICS version number
|
||||
instead, like this:</p>
|
||||
|
||||
<blockquote><pre>
|
||||
#include <epicsVersion.h>
|
||||
|
||||
#ifndef VERSION_INT
|
||||
# define VERSION_INT(V,R,M,P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P))
|
||||
#endif
|
||||
#ifndef EPICS_VERSION_INT
|
||||
# define EPICS_VERSION_INT VERSION_INT(EPICS_VERSION, EPICS_REVISION, EPICS_MODIFICATION, EPICS_PATCH_LEVEL)
|
||||
#endif
|
||||
|
||||
#if EPICS_VERSION_INT >= VERSION_INT(3,16,1,0)
|
||||
/* Code where Base has INT64 support */
|
||||
#else
|
||||
/* Code for older versions */
|
||||
#endif
|
||||
</pre></blockquote>
|
||||
|
||||
<p>Channel Access does not (and probably never will) directly support 64-bit
|
||||
integer types, so the new field types are presented to the CA server as
|
||||
<tt>DBF_DOUBLE</tt> values. This means that field values larger than 2^52
|
||||
@@ -285,15 +460,15 @@ to implement the link APIs, so will work properly after these conversions:</p>
|
||||
link type, i.e. change this code:
|
||||
|
||||
<pre>
|
||||
if (prec->siml.type == CONSTANT) {
|
||||
recGblInitConstantLink(&prec->siml, DBF_USHORT, &prec->simm);
|
||||
if (prec->siml.type == CONSTANT) {
|
||||
recGblInitConstantLink(&prec->siml, DBF_USHORT, &prec->simm);
|
||||
}
|
||||
</pre>
|
||||
|
||||
into this:
|
||||
|
||||
<pre>
|
||||
recGblInitConstantLink(&prec->siml, DBF_USHORT, &prec->simm);
|
||||
recGblInitConstantLink(&prec->siml, DBF_USHORT, &prec->simm);
|
||||
</pre>
|
||||
|
||||
Note that <tt>recGblInitConstantLink()</tt> still returns TRUE if the field was
|
||||
@@ -306,20 +481,20 @@ or undefined links, FALSE for links whose <tt>dbGetLink()</tt> routine may
|
||||
return different values on different calls. For example this:
|
||||
|
||||
<pre>
|
||||
if (prec->dol.type != CONSTANT)
|
||||
if (prec->dol.type != CONSTANT)
|
||||
</pre>
|
||||
|
||||
should become this:
|
||||
|
||||
<pre>
|
||||
if (!dbLinkIsConstant(&prec->dol))
|
||||
if (!dbLinkIsConstant(&prec->dol))
|
||||
</pre>
|
||||
|
||||
When the converted software is also required to build against older versions of
|
||||
Base, this macro definition may be useful:
|
||||
|
||||
<pre>
|
||||
#define dbLinkIsConstant(lnk) ((lnk)->type == CONSTANT)
|
||||
#define dbLinkIsConstant(lnk) ((lnk)->type == CONSTANT)
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
@@ -327,7 +502,7 @@ Base, this macro definition may be useful:
|
||||
link has been resolved as a CA link using code such as
|
||||
|
||||
<pre>
|
||||
if (prec->inp.type == CA_LINK)
|
||||
if (prec->inp.type == CA_LINK)
|
||||
</pre>
|
||||
|
||||
will still compile and run, but will only work properly with the old CA link
|
||||
@@ -337,7 +512,7 @@ examine or modify data inside the link. After conversion the above line would
|
||||
probably become:
|
||||
|
||||
<pre>
|
||||
if (dbLinkIsVolatile(&prec->inp))
|
||||
if (dbLinkIsVolatile(&prec->inp))
|
||||
</pre>
|
||||
|
||||
A volatile link is one like a Channel Access link which may disconnect and
|
||||
@@ -347,7 +522,7 @@ same state they started in. For compatibility when building against older
|
||||
versions of Base, this macro definition may be useful:
|
||||
|
||||
<pre>
|
||||
#define dbLinkIsVolatile(lnk) ((lnk)->type == CA_LINK)
|
||||
#define dbLinkIsVolatile(lnk) ((lnk)->type == CA_LINK)
|
||||
</pre>
|
||||
</li>
|
||||
|
||||
@@ -647,11 +822,62 @@ the stdout stream, making it hard to parse.</p>
|
||||
callback.h header and removed the need for dbScan.c to reach into the internals
|
||||
of its CALLBACK objects.</p>
|
||||
|
||||
|
||||
<h2 align="center">Changes from the 3.15 branch since 3.15.5</h2>
|
||||
<h2 align="center">Changes from the 3.15 branch since 3.15.6</h2>
|
||||
|
||||
<!-- Insert inherited items immediately below here ... -->
|
||||
|
||||
|
||||
<h2 align="center">Changes made between 3.15.5 and 3.15.6</h2>
|
||||
|
||||
<h3>Unsetting environment variables</h3>
|
||||
|
||||
<p>The new command <code>epicsEnvUnset <i>varname</i></code> can be used to
|
||||
unset an environment variable.</p>
|
||||
|
||||
<h3>Warning indicators in msi (and macLib) output</h3>
|
||||
|
||||
<p>The libCom macro expansion library has been modified so that when the
|
||||
SUPPRESS_WARNINGS flag is set it will no longer include any <tt>,undefined</tt>
|
||||
or <tt>,recursive</tt> indicators in its output when undefined or recursive
|
||||
macros are encountered. These indicators were harmless when the output was fed
|
||||
into an IOC along with a definition for the macro, but when the <tt>msi</tt>
|
||||
tool was used to generate other kinds of files they caused problems. If the
|
||||
<tt>msi -V</tt> flag is used the markers will still be present in the output
|
||||
whenever the appropriate condition is seen.</p>
|
||||
|
||||
<h3>Improvements to msi</h3>
|
||||
|
||||
<p>In addition to fixing its response to discovering parsing errors in its
|
||||
substitution input file (reported as Launchpad
|
||||
<a href="https://bugs.launchpad.net/epics-base/+bug/1503661">bug #1503661</a>)
|
||||
so it now deletes the incomplete output file, the msi program has been cleaned
|
||||
up a little bit internally.</p>
|
||||
|
||||
<h3>All array records now post monitors on their array-length fields</h3>
|
||||
|
||||
<p>The waveform record has been posting monitors on its NORD field since Base
|
||||
3.15.0.1; we finally got around to doing the equivalent in all the other
|
||||
built-in record types, which even required modifying device support in some
|
||||
cases. This fixes <a href="https://bugs.launchpad.net/epics-base/+bug/1730727">
|
||||
Launchpad bug #1730727</a>.</p>
|
||||
|
||||
<h3>HOWTO: Converting Wiki Record Reference to POD</h3>
|
||||
|
||||
<p>Some documentation has been added to the <tt>dbdToHtml.pl</tt> script
|
||||
explaining how Perl POD (Plain Old Documentation) markup can be added to
|
||||
<tt>.dbd</tt> files to generate HTML documentation for the record types. To see
|
||||
these instructions, run <tt>perl bin/<host>/dbdToHtml.pl -H</tt>
|
||||
or <tt>perldoc bin/<host>/dbdToHtml.pl</tt>.</p>
|
||||
|
||||
<h3>Fix problem with numeric soft events</h3>
|
||||
|
||||
<p>Changing from numeric to named soft events introduced an incompatibility
|
||||
when a numeric event 1-255 is converted from a DOUBLE, e.g. from a calc record.
|
||||
The <tt>post_event()</tt> API is not marked deprecated any more.
|
||||
|
||||
<p>Also <code>scanpel</code> has been modified to accept a glob pattern for
|
||||
event name filtering and to show events with no connected records as well.</p>
|
||||
|
||||
<h3>Add osiSockOptMcastLoop_t and osiSockTest</h3>
|
||||
|
||||
<p>Added a new OS-independent typedef for multicast socket options, and a test
|
||||
@@ -666,9 +892,115 @@ of having go modify or replace the original. A new .gitignore pattern
|
||||
tells git to ignore all configure/*.local files.</p>
|
||||
|
||||
|
||||
<h2 align="center">Changes from the 3.14 branch since 3.15.5</h2>
|
||||
<h2 align="center">Changes from the 3.14 branch between 3.15.5 and 3.15.6</h2>
|
||||
|
||||
<!-- Insert inherited items immediately below here ... -->
|
||||
<h3>Fix broken <tt>EPICS_IOC_LOG_FILE_LIMIT=0</tt> setting</h3>
|
||||
|
||||
<p>The Application Developers' Guide says this is allowed and disables the
|
||||
limit on the log-file, but it hasn't actually worked for some time (if ever).
|
||||
Note that the iocLogServer will be removed from newer Base release sometime
|
||||
soon as its functionality can be implemented by other dedicated log servers
|
||||
such as logstash or syslog-ng.</p>
|
||||
|
||||
<p>Fixes <a href="https://bugs.launchpad.net/bugs/1786858">lp:1786858</a>
|
||||
and part of <a href="https://bugs.launchpad.net/bugs/1786966">lp:1786966</a>.
|
||||
</p>
|
||||
|
||||
<h3>Cleanup of startup directory</h3>
|
||||
|
||||
<p>The files in the startup directory have not been maintained in recent years
|
||||
and have grown crufty (technical term). This release includes the following
|
||||
updates to these files:</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>The Perl <tt>EpicsHostArch.pl</tt> script has been rewritten, and support
|
||||
for a few previously missing host architectures has been added to it.</li>
|
||||
|
||||
<li>The <tt>EpicsHostArch.pl</tt> script has also been moved into the standard
|
||||
<tt>src/tools</tt> directory, from where it will be installed into
|
||||
<tt>lib/perl</tt>. In this new location it is no longer executable, so it must
|
||||
be run by the <tt>perl</tt> executable.</li>
|
||||
|
||||
<li>The build system has been adjusted to look for <tt>EpicsHostArch.pl</tt> in
|
||||
both places if the <tt>EPICS_HOST_ARCH</tt> environment variable has not been
|
||||
set at build-time.</li>
|
||||
|
||||
<li>Sites that used the original Perl script to set <tt>EPICS_HOST_ARCH</tt> as
|
||||
part of their standard environment will need to adjust their scripts when they
|
||||
upgrade to this release.</li>
|
||||
|
||||
<li>The <tt>EpicsHostArch</tt> shell script has been replaced with a wrapper
|
||||
routine that calls the Perl <tt>EpicsHostArch.pl</tt> script. Sites that rely on
|
||||
this script to set <tt>EPICS_HOST_ARCH</tt> should consider switching to the
|
||||
Perl script instead.</li>
|
||||
|
||||
<li>The <tt>Site.cshrc</tt> and <tt>Site.profile</tt> files have been renamed to
|
||||
<tt>unix.csh</tt> and <tt>unix.sh</tt>, respectively.</li>
|
||||
|
||||
<li>The existing <tt>win32.bat</tt> file has been cleaned up and a new
|
||||
<tt>windows.bat</tt> file added for 64-bit targets. The contents of these files
|
||||
should be seen as examples, don't uncomment or install parts for software that
|
||||
you don't explicitly know that you need.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<h3>Recent Apple XCode Build Issues</h3>
|
||||
|
||||
<p>The latest version of XCode will not compile calls to <tt>system()</tt> or
|
||||
<tt>clock_settime()</tt> for iOS targets. There were several places in Base
|
||||
where these were being compiled, although there were probably never called. The
|
||||
code has now been modified to permit iOS builds to complete again.</p>
|
||||
|
||||
<h3>Prevent illegal alarm severities</h3>
|
||||
|
||||
<p>A check has been added to <tt>recGblResetAlarms()</tt> that prevents records
|
||||
from getting an alarm severity higher than INVALID_ALARM. It is still possible
|
||||
for a field like HSV to get set to a value that is not a legal alarm severity,
|
||||
but the core IOC code should never copy such a value into a record's SEVR or
|
||||
ACKS fields. With this fix the record's alarm severity will be limited to
|
||||
INVALID_ALARM.</p>
|
||||
|
||||
<h3>Fixes for Launchpad bugs</h3>
|
||||
|
||||
<p>The following launchpad bugs have fixes included:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1786320">
|
||||
lp: #1786320</a>, dbCa subscribes twice to ENUM</li>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/541221">
|
||||
lp: #541221</a>, 'assert (pca->pgetNative)' failed in ../dbCa.c</li>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1747091">
|
||||
lp: #1747091</a>, epicsTimeGetEvent() / generalTime bug</li>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1743076">
|
||||
lp: #1743076</a>, Segfault in ca_attach_context() during exits</li>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1751380">
|
||||
lp: #1751380</a>, Deadlock in ca_clear_subscription()</li>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1597809">
|
||||
lp: #1597809</a>, Setting NAME field in DB file may break IOC</li>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1770292">
|
||||
lp: #1770292</a>, get_alarm_double() inconsistent across record types</li>
|
||||
<li><a href="https://bugs.launchpad.net/epics-base/+bug/1771298">
|
||||
lp: #1771298</a>, Conversion of NaN to integer relies on undefined
|
||||
behavior</li>
|
||||
</ul>
|
||||
|
||||
<h3>Updated VxWorks Timezone settings</h3>
|
||||
|
||||
<p>Removed the settings for 2017; fixed the hour of the change for MET.</p>
|
||||
|
||||
<h3>Fixed camonitor server side relative timestamps bug</h3>
|
||||
|
||||
<p>Initialize the first time-stamp from the first monitor, not the client-side
|
||||
current time in this configuration.</p>
|
||||
|
||||
<h3>Build changes for MSVC</h3>
|
||||
|
||||
<p>Windows builds using Visual Studio 2015 and later now use the <tt>-FS</tt>
|
||||
compiler option to allow parallel builds to work properly.</p>
|
||||
|
||||
<p>We now give the <tt>-FC</tt> option to tell the compiler to print absolute
|
||||
paths for source files in diagnostic messages.</p>
|
||||
|
||||
<h3>Extend maximum Posix epicsEventWaitWithTimeout() delay</h3>
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ the final release version.</p>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>Release Manager</td>
|
||||
<td>Tag the module in Git using these tag conventions:
|
||||
<td>Tag the module in Git, using these tag conventions:
|
||||
<ul>
|
||||
<li>
|
||||
<tt>R3.16.1-pre<i>n</i></tt>
|
||||
@@ -141,7 +141,7 @@ the final release version.</p>
|
||||
<tt>R3.16.1-rc<i>n</i></tt>
|
||||
— release candidate tag
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<blockquote><tt>
|
||||
cd base-3.16<br />
|
||||
git tag -m 'ANJ: Tagged for 3.16.1-rc1' R3.16.1-rc1
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
#*************************************************************************
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
TOP = ..
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
# Submodules for bundle build
|
||||
SUBMODULES += libcom
|
||||
|
||||
SUBMODULES += ca
|
||||
ca_DEPEND_DIRS = libcom
|
||||
|
||||
SUBMODULES += database
|
||||
database_DEPEND_DIRS = ca
|
||||
|
||||
SUBMODULES += pvData
|
||||
pvData_DEPEND_DIRS = libcom
|
||||
|
||||
SUBMODULES += pvAccess
|
||||
pvAccess_DEPEND_DIRS = pvData database
|
||||
|
||||
SUBMODULES += normativeTypes
|
||||
normativeTypes_DEPEND_DIRS = pvData
|
||||
|
||||
SUBMODULES += pvaClient
|
||||
pvaClient_DEPEND_DIRS = pvAccess normativeTypes
|
||||
|
||||
SUBMODULES += pvDatabase
|
||||
pvDatabase_DEPEND_DIRS = pvAccess
|
||||
|
||||
SUBMODULES += pva2pva
|
||||
pva2pva_DEPEND_DIRS = pvAccess
|
||||
|
||||
SUBMODULES += example
|
||||
example_DEPEND_DIRS = pva2pva pvaClient
|
||||
|
||||
# Allow sites to add extra submodules
|
||||
-include Makefile.local
|
||||
|
||||
# Add only checked-out submodules to DIRS
|
||||
DIRS += $(subst /Makefile,,$(wildcard $(addsuffix /Makefile, $(SUBMODULES))))
|
||||
|
||||
include $(TOP)/configure/RULES_DIRS
|
||||
|
||||
# Ensure that RELEASE.local exists before doing anything else
|
||||
all host $(DIRS) $(ARCHS) $(ACTIONS) $(dirActionTargets) $(dirArchTargets) \
|
||||
$(dirActionArchTargets) $(actionArchTargets): | RELEASE.local
|
||||
|
||||
RELEASE.local:
|
||||
@echo EPICS_BASE = $(abspath $(INSTALL_LOCATION))> $@
|
||||
realclean:
|
||||
$(RM) RELEASE.local
|
||||
Submodule modules/ca deleted from 5dfd1fc0f0
Submodule modules/database deleted from eac8865b7f
Submodule modules/libcom deleted from 3ca5c20907
Submodule modules/normativeTypes deleted from abd029aa71
Submodule modules/pvAccess deleted from 2ca5744bb9
Submodule modules/pvData deleted from b194bc05b1
Submodule modules/pvDatabase deleted from 63214b98f6
Submodule modules/pva2pva deleted from 0159cdb77d
Submodule modules/pvaClient deleted from a21e5b5913
61
src/Makefile
61
src/Makefile
@@ -12,10 +12,71 @@ include $(TOP)/configure/CONFIG
|
||||
|
||||
DIRS += tools
|
||||
|
||||
DIRS += tools/test
|
||||
tools/test_DEPEND_DIRS = tools
|
||||
|
||||
DIRS += template/base
|
||||
template/base_DEPEND_DIRS = tools
|
||||
|
||||
DIRS += template/ext
|
||||
template/ext_DEPEND_DIRS = tools
|
||||
|
||||
# Common
|
||||
|
||||
DIRS += libCom
|
||||
libCom_DEPEND_DIRS = tools
|
||||
|
||||
DIRS += libCom/RTEMS
|
||||
libCom/RTEMS_DEPEND_DIRS = libCom
|
||||
|
||||
DIRS += libCom/test
|
||||
libCom/test_DEPEND_DIRS = libCom/RTEMS
|
||||
|
||||
# Channel Access
|
||||
|
||||
DIRS += ca/client
|
||||
ca/client_DEPEND_DIRS = libCom
|
||||
|
||||
DIRS += ca/client/tools
|
||||
ca/client/tools_DEPEND_DIRS = ca/client
|
||||
|
||||
DIRS += ca/legacy/gdd
|
||||
ca/legacy/gdd_DEPEND_DIRS = ca/client
|
||||
|
||||
DIRS += ca/legacy/pcas
|
||||
ca/legacy/pcas_DEPEND_DIRS = ca/legacy/gdd
|
||||
|
||||
DIRS += ca/legacy/pcas/ex
|
||||
# needs ioc for dbStaticHost
|
||||
ca/legacy/pcas/ex_DEPEND_DIRS = ca/legacy/pcas libCom ioc
|
||||
|
||||
DIRS += ca/client/perl
|
||||
ca/client/perl_DEPEND_DIRS = ca/client
|
||||
|
||||
# PDB Core
|
||||
|
||||
DIRS += ioc
|
||||
ioc_DEPEND_DIRS = libCom ca/client
|
||||
|
||||
DIRS += ioc/db/test
|
||||
ioc/db/test_DEPEND_DIRS = ioc libCom/RTEMS
|
||||
|
||||
DIRS += ioc/dbtemplate/test
|
||||
ioc/dbtemplate/test_DEPEND_DIRS = ioc
|
||||
|
||||
# PDB Standard Record Definitions
|
||||
|
||||
DIRS += std
|
||||
std_DEPEND_DIRS = ioc libCom/RTEMS
|
||||
|
||||
DIRS += std/filters/test
|
||||
std/filters/test_DEPEND_DIRS = std
|
||||
|
||||
DIRS += std/link/test
|
||||
std/link/test_DEPEND_DIRS = std
|
||||
|
||||
DIRS += std/rec/test
|
||||
std/rec/test_DEPEND_DIRS = std
|
||||
|
||||
|
||||
include $(TOP)/configure/RULES_DIRS
|
||||
|
||||
308
src/ca/client/CASG.cpp
Normal file
308
src/ca/client/CASG.cpp
Normal file
@@ -0,0 +1,308 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
* Author: Jeffrey O. Hill
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
|
||||
|
||||
#include "errlog.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "iocinf.h"
|
||||
#include "syncGroup.h"
|
||||
#include "oldAccess.h"
|
||||
#include "cac.h"
|
||||
#include "sgAutoPtr.h"
|
||||
|
||||
CASG::CASG ( epicsGuard < epicsMutex > & guard, ca_client_context & cacIn ) :
|
||||
client ( cacIn ), magic ( CASG_MAGIC )
|
||||
{
|
||||
client.installCASG ( guard, *this );
|
||||
}
|
||||
|
||||
CASG::~CASG ()
|
||||
{
|
||||
}
|
||||
|
||||
void CASG::destructor (
|
||||
CallbackGuard & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
|
||||
if ( this->verify ( guard ) ) {
|
||||
this->reset ( cbGuard, guard );
|
||||
this->client.uninstallCASG ( guard, *this );
|
||||
this->magic = 0;
|
||||
}
|
||||
else {
|
||||
this->printFormated ( "cac: attempt to destroy invalid sync group ignored\n" );
|
||||
}
|
||||
this->~CASG ();
|
||||
}
|
||||
|
||||
bool CASG::verify ( epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
return ( this->magic == CASG_MAGIC );
|
||||
}
|
||||
|
||||
/*
|
||||
* CASG::block ()
|
||||
*/
|
||||
int CASG::block (
|
||||
epicsGuard < epicsMutex > * pcbGuard,
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
double timeout )
|
||||
{
|
||||
epicsTime cur_time;
|
||||
epicsTime beg_time;
|
||||
double delay;
|
||||
double remaining;
|
||||
int status;
|
||||
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
|
||||
// prevent recursion nightmares by disabling blocking
|
||||
// for IO from within a CA callback.
|
||||
if ( epicsThreadPrivateGet ( caClientCallbackThreadId ) ) {
|
||||
return ECA_EVDISALLOW;
|
||||
}
|
||||
|
||||
if ( timeout < 0.0 ) {
|
||||
return ECA_TIMEOUT;
|
||||
}
|
||||
|
||||
cur_time = epicsTime::getCurrent ();
|
||||
|
||||
this->client.flush ( guard );
|
||||
|
||||
beg_time = cur_time;
|
||||
delay = 0.0;
|
||||
|
||||
while ( 1 ) {
|
||||
if ( this->ioPendingList.count() == 0u ) {
|
||||
status = ECA_NORMAL;
|
||||
break;
|
||||
}
|
||||
|
||||
remaining = timeout - delay;
|
||||
if ( remaining <= CAC_SIGNIFICANT_DELAY ) {
|
||||
/*
|
||||
* Make sure that we take care of
|
||||
* recv backlog at least once
|
||||
*/
|
||||
status = ECA_TIMEOUT;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( pcbGuard ) {
|
||||
epicsGuardRelease < epicsMutex > unguard ( guard );
|
||||
{
|
||||
epicsGuardRelease < epicsMutex > uncbGuard ( *pcbGuard );
|
||||
this->sem.wait ( remaining );
|
||||
}
|
||||
}
|
||||
else {
|
||||
epicsGuardRelease < epicsMutex > unguard ( guard );
|
||||
this->sem.wait ( remaining );
|
||||
}
|
||||
|
||||
/*
|
||||
* force a time update
|
||||
*/
|
||||
cur_time = epicsTime::getCurrent ();
|
||||
|
||||
delay = cur_time - beg_time;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
void CASG::reset (
|
||||
CallbackGuard & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
this->destroyCompletedIO ( cbGuard, guard );
|
||||
this->destroyPendingIO ( cbGuard, guard );
|
||||
}
|
||||
|
||||
// lock must be applied
|
||||
void CASG::destroyCompletedIO (
|
||||
CallbackGuard & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
syncGroupNotify * pNotify;
|
||||
while ( ( pNotify = this->ioCompletedList.get () ) ) {
|
||||
pNotify->destroy ( cbGuard, guard );
|
||||
}
|
||||
}
|
||||
|
||||
void CASG::destroyPendingIO (
|
||||
CallbackGuard & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
while ( syncGroupNotify * pNotify = this->ioPendingList.first () ) {
|
||||
pNotify->cancel ( cbGuard, guard );
|
||||
// cancel must release the guard while
|
||||
// canceling put callbacks so we
|
||||
// must double check list membership
|
||||
if ( pNotify->ioPending ( guard ) ) {
|
||||
this->ioPendingList.remove ( *pNotify );
|
||||
}
|
||||
else {
|
||||
this->ioCompletedList.remove ( *pNotify );
|
||||
}
|
||||
pNotify->destroy ( cbGuard, guard );
|
||||
}
|
||||
}
|
||||
|
||||
void CASG::show ( unsigned level ) const
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->client.mutexRef () );
|
||||
this->show ( guard, level );
|
||||
}
|
||||
|
||||
void CASG::show (
|
||||
epicsGuard < epicsMutex > & guard, unsigned level ) const
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
::printf ( "Sync Group: id=%u, magic=%u, opPend=%u\n",
|
||||
this->getId (), this->magic, this->ioPendingList.count () );
|
||||
if ( level ) {
|
||||
::printf ( "\tPending" );
|
||||
tsDLIterConst < syncGroupNotify > notifyPending =
|
||||
this->ioPendingList.firstIter ();
|
||||
while ( notifyPending.valid () ) {
|
||||
notifyPending->show ( guard, level - 1u );
|
||||
notifyPending++;
|
||||
}
|
||||
::printf ( "\tCompleted" );
|
||||
tsDLIterConst < syncGroupNotify > notifyCompleted =
|
||||
this->ioCompletedList.firstIter ();
|
||||
while ( notifyCompleted.valid () ) {
|
||||
notifyCompleted->show ( guard, level - 1u );
|
||||
notifyCompleted++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CASG::ioComplete (
|
||||
CallbackGuard & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
this->destroyCompletedIO ( cbGuard, guard );
|
||||
return this->ioPendingList.count () == 0u;
|
||||
}
|
||||
|
||||
void CASG::put ( epicsGuard < epicsMutex > & guard, chid pChan,
|
||||
unsigned type, arrayElementCount count, const void * pValue )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
sgAutoPtr < syncGroupWriteNotify > pNotify ( guard, *this );
|
||||
pNotify = syncGroupWriteNotify::factory (
|
||||
this->freeListWriteOP, *this, & CASG :: recycleWriteNotifyIO, pChan );
|
||||
pNotify->begin ( guard, type, count, pValue );
|
||||
pNotify.release ();
|
||||
}
|
||||
|
||||
void CASG::get ( epicsGuard < epicsMutex > & guard, chid pChan,
|
||||
unsigned type, arrayElementCount count, void *pValue )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
sgAutoPtr < syncGroupReadNotify > pNotify ( guard, *this );
|
||||
pNotify = syncGroupReadNotify::factory (
|
||||
this->freeListReadOP, *this, & CASG :: recycleReadNotifyIO, pChan, pValue );
|
||||
pNotify->begin ( guard, type, count );
|
||||
pNotify.release ();
|
||||
}
|
||||
|
||||
void CASG::completionNotify (
|
||||
epicsGuard < epicsMutex > & guard, syncGroupNotify & notify )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
this->ioPendingList.remove ( notify );
|
||||
this->ioCompletedList.add ( notify );
|
||||
if ( this->ioPendingList.count () == 0u ) {
|
||||
this->sem.signal ();
|
||||
}
|
||||
}
|
||||
|
||||
void CASG :: recycleReadNotifyIO ( epicsGuard < epicsMutex > & guard,
|
||||
syncGroupReadNotify & io )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
this->freeListReadOP.release ( & io );
|
||||
}
|
||||
|
||||
void CASG :: recycleWriteNotifyIO ( epicsGuard < epicsMutex > & guard,
|
||||
syncGroupWriteNotify & io )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
this->freeListWriteOP.release ( & io );
|
||||
}
|
||||
|
||||
int CASG :: printFormated ( const char *pformat, ... )
|
||||
{
|
||||
va_list theArgs;
|
||||
int status;
|
||||
|
||||
va_start ( theArgs, pformat );
|
||||
|
||||
status = this->client.varArgsPrintFormated ( pformat, theArgs );
|
||||
|
||||
va_end ( theArgs );
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
void CASG::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
int status, const char * pContext,
|
||||
const char * pFileName, unsigned lineNo )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
if ( status != ECA_CHANDESTROY ) {
|
||||
this->client.exception (
|
||||
guard, status, pContext, pFileName, lineNo );
|
||||
}
|
||||
}
|
||||
|
||||
void CASG::exception (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
int status, const char * pContext,
|
||||
const char * pFileName, unsigned lineNo, oldChannelNotify & chan,
|
||||
unsigned type, arrayElementCount count, unsigned op )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->client.mutexRef() );
|
||||
if ( status != ECA_CHANDESTROY ) {
|
||||
this->client.exception (
|
||||
guard, status, pContext, pFileName,
|
||||
lineNo, chan, type, count, op );
|
||||
}
|
||||
}
|
||||
|
||||
void CASG::operator delete ( void * )
|
||||
{
|
||||
// Visual C++ .net appears to require operator delete if
|
||||
// placement operator delete is defined? I smell a ms rat
|
||||
// because if I declare placement new and delete, but
|
||||
// comment out the placement delete definition there are
|
||||
// no undefined symbols.
|
||||
errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked",
|
||||
__FILE__, __LINE__ );
|
||||
}
|
||||
4516
src/ca/client/CAref.html
Normal file
4516
src/ca/client/CAref.html
Normal file
File diff suppressed because it is too large
Load Diff
117
src/ca/client/Makefile
Normal file
117
src/ca/client/Makefile
Normal file
@@ -0,0 +1,117 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
TOP=../../..
|
||||
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
HTMLS += CAref.html
|
||||
|
||||
#
|
||||
# includes to install from this subproject
|
||||
#
|
||||
INC += cadef.h
|
||||
INC += caerr.h
|
||||
INC += caeventmask.h
|
||||
INC += caProto.h
|
||||
INC += db_access.h
|
||||
INC += addrList.h
|
||||
INC += cacIO.h
|
||||
INC += caDiagnostics.h
|
||||
|
||||
LIBSRCS += cac.cpp
|
||||
LIBSRCS += cacChannel.cpp
|
||||
LIBSRCS += cacChannelNotify.cpp
|
||||
LIBSRCS += cacContextNotify.cpp
|
||||
LIBSRCS += cacReadNotify.cpp
|
||||
LIBSRCS += cacWriteNotify.cpp
|
||||
LIBSRCS += cacStateNotify.cpp
|
||||
LIBSRCS += access.cpp
|
||||
LIBSRCS += iocinf.cpp
|
||||
LIBSRCS += convert.cpp
|
||||
LIBSRCS += test_event.cpp
|
||||
LIBSRCS += repeater.cpp
|
||||
LIBSRCS += searchTimer.cpp
|
||||
LIBSRCS += disconnectGovernorTimer.cpp
|
||||
LIBSRCS += repeaterSubscribeTimer.cpp
|
||||
LIBSRCS += baseNMIU.cpp
|
||||
LIBSRCS += nciu.cpp
|
||||
LIBSRCS += netiiu.cpp
|
||||
LIBSRCS += udpiiu.cpp
|
||||
LIBSRCS += tcpiiu.cpp
|
||||
LIBSRCS += noopiiu.cpp
|
||||
LIBSRCS += netReadNotifyIO.cpp
|
||||
LIBSRCS += netWriteNotifyIO.cpp
|
||||
LIBSRCS += netSubscription.cpp
|
||||
LIBSRCS += tcpSendWatchdog.cpp
|
||||
LIBSRCS += tcpRecvWatchdog.cpp
|
||||
LIBSRCS += bhe.cpp
|
||||
LIBSRCS += ca_client_context.cpp
|
||||
LIBSRCS += oldChannelNotify.cpp
|
||||
LIBSRCS += oldSubscription.cpp
|
||||
LIBSRCS += getCallback.cpp
|
||||
LIBSRCS += getCopy.cpp
|
||||
LIBSRCS += putCallback.cpp
|
||||
LIBSRCS += syncgrp.cpp
|
||||
LIBSRCS += CASG.cpp
|
||||
LIBSRCS += syncGroupNotify.cpp
|
||||
LIBSRCS += syncGroupReadNotify.cpp
|
||||
LIBSRCS += syncGroupWriteNotify.cpp
|
||||
LIBSRCS += localHostName.cpp
|
||||
LIBSRCS += comQueRecv.cpp
|
||||
LIBSRCS += comQueSend.cpp
|
||||
LIBSRCS += comBuf.cpp
|
||||
LIBSRCS += hostNameCache.cpp
|
||||
LIBSRCS += msgForMultiplyDefinedPV.cpp
|
||||
|
||||
LIBRARY=ca
|
||||
|
||||
ca_RCS = ca.rc
|
||||
|
||||
ca_LIBS = Com
|
||||
|
||||
ca_SYS_LIBS_WIN32 = ws2_32 advapi32 user32
|
||||
|
||||
# libs needed for PROD and TESTPRODUCT
|
||||
PROD_LIBS = ca Com
|
||||
# needed when its an object library build
|
||||
PROD_SYS_LIBS_WIN32 = ws2_32 advapi32 user32
|
||||
|
||||
PROD_DEFAULT += caRepeater catime acctst caConnTest casw caEventRate
|
||||
PROD_vxWorks = -nil-
|
||||
PROD_RTEMS = -nil-
|
||||
PROD_iOS = -nil-
|
||||
|
||||
OBJS_vxWorks = catime acctst caConnTest casw caEventRate acctstRegister
|
||||
|
||||
caRepeater_SRCS = caRepeater.cpp
|
||||
catime_SRCS = catimeMain.c catime.c
|
||||
acctst_SRCS = acctstMain.c acctst.c
|
||||
caEventRate_SRCS = caEventRateMain.cpp caEventRate.cpp
|
||||
casw_SRCS = casw.cpp
|
||||
caConnTest_SRCS = caConnTestMain.cpp caConnTest.cpp
|
||||
|
||||
casw_SYS_LIBS_solaris = socket
|
||||
|
||||
SCRIPTS_HOST = S99caRepeater
|
||||
SCRIPTS_Linux = caRepeater.service
|
||||
|
||||
EXPAND += S99caRepeater@
|
||||
EXPAND += caRepeater.service@
|
||||
EXPAND_VARS = INSTALL_BIN=$(abspath $(INSTALL_BIN))
|
||||
|
||||
SRC_DIRS += $(TOP)/src/ca/client/test
|
||||
PROD_HOST += ca_test
|
||||
ca_test_SRCS = ca_test_main.c ca_test.c
|
||||
ca_test_LIBS = ca Com
|
||||
ca_test_SYS_LIBS_WIN32 = ws2_32 advapi32 user32
|
||||
|
||||
OBJS_vxWorks += ca_test
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
28
src/ca/client/S99caRepeater@
Normal file
28
src/ca/client/S99caRepeater@
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# System-V init script for the EPICS CA Repeater.
|
||||
#
|
||||
|
||||
INSTALL_BIN=@INSTALL_BIN@
|
||||
|
||||
# To change the default values for the EPICS environment parameters,
|
||||
# uncomment and modify the relevant lines below. These are the only
|
||||
# EPICS environment variables that the CA Repeater makes use of.
|
||||
|
||||
# EPICS_CA_REPEATER_PORT="5065" export EPICS_CA_REPEATER_PORT
|
||||
|
||||
if [ $1 = "start" ]; then
|
||||
if [ -x $INSTALL_BIN/caRepeater ]; then
|
||||
echo "Starting EPICS CA Repeater "
|
||||
$INSTALL_BIN/caRepeater &
|
||||
fi
|
||||
else
|
||||
if [ $1 = "stop" ]; then
|
||||
pid=`ps -e | sed -ne '/caRepeat/s/^ *\([1-9][0-9]*\).*$/\1/p'`
|
||||
if [ "${pid}" != "" ]; then
|
||||
echo "Stopping EPICS CA Repeater "
|
||||
kill ${pid}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
39
src/ca/client/SearchDest.h
Normal file
39
src/ca/client/SearchDest.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#ifndef SearchDest_h
|
||||
#define SearchDest_h
|
||||
|
||||
#include <osiSock.h>
|
||||
#include <epicsTime.h>
|
||||
#include <tsDLList.h>
|
||||
#include "caProto.h"
|
||||
|
||||
class channelNode;
|
||||
class epicsMutex;
|
||||
template < class T > class epicsGuard;
|
||||
|
||||
struct SearchDest :
|
||||
public tsDLNode < SearchDest > {
|
||||
virtual ~SearchDest () {};
|
||||
struct Callback {
|
||||
virtual ~Callback () {};
|
||||
virtual void notify (
|
||||
const caHdr & msg, const void * pPayload,
|
||||
const osiSockAddr & addr, const epicsTime & ) = 0;
|
||||
virtual void show (
|
||||
epicsGuard < epicsMutex > &, unsigned level ) const = 0;
|
||||
};
|
||||
virtual void searchRequest ( epicsGuard < epicsMutex > &,
|
||||
const char * pbuf, size_t len ) = 0;
|
||||
virtual void show ( epicsGuard < epicsMutex > &, unsigned level ) const = 0;
|
||||
};
|
||||
|
||||
#endif // SearchDest_h
|
||||
1107
src/ca/client/access.cpp
Normal file
1107
src/ca/client/access.cpp
Normal file
File diff suppressed because it is too large
Load Diff
3555
src/ca/client/acctst.c
Normal file
3555
src/ca/client/acctst.c
Normal file
File diff suppressed because it is too large
Load Diff
70
src/ca/client/acctstMain.c
Normal file
70
src/ca/client/acctstMain.c
Normal file
@@ -0,0 +1,70 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "cadef.h"
|
||||
#include "caDiagnostics.h"
|
||||
|
||||
int main ( int argc, char **argv )
|
||||
{
|
||||
unsigned progressLoggingLevel;
|
||||
unsigned channelCount;
|
||||
unsigned repetitionCount;
|
||||
enum ca_preemptive_callback_select preempt;
|
||||
int aBoolean;
|
||||
|
||||
|
||||
if ( argc < 2 || argc > 6 ) {
|
||||
printf ("usage: %s <PV name> [progress logging level] [channel count] "
|
||||
"[repetition count] [enable preemptive callback]\n",
|
||||
argv[0] );
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( argc >= 3 ) {
|
||||
progressLoggingLevel = atoi ( argv[2] );
|
||||
}
|
||||
else {
|
||||
progressLoggingLevel = 0;
|
||||
}
|
||||
|
||||
if ( argc >= 4 ) {
|
||||
channelCount = atoi ( argv[3] );
|
||||
}
|
||||
else {
|
||||
channelCount = 20000;
|
||||
}
|
||||
|
||||
if ( argc >= 5 ) {
|
||||
repetitionCount = atoi ( argv[4] );
|
||||
}
|
||||
else {
|
||||
repetitionCount = 1;
|
||||
}
|
||||
|
||||
if ( argc >= 6 ) {
|
||||
aBoolean = atoi ( argv[5] );
|
||||
}
|
||||
else {
|
||||
aBoolean = 0;
|
||||
}
|
||||
if ( aBoolean ) {
|
||||
preempt = ca_enable_preemptive_callback;
|
||||
}
|
||||
else {
|
||||
preempt = ca_disable_preemptive_callback;
|
||||
}
|
||||
|
||||
acctst ( argv[1], progressLoggingLevel, channelCount, repetitionCount, preempt );
|
||||
|
||||
return 0;
|
||||
}
|
||||
69
src/ca/client/acctstRegister.cpp
Normal file
69
src/ca/client/acctstRegister.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
* CA client library diagnostics IOC shell registration
|
||||
* Authors:
|
||||
* Jeff Hill
|
||||
*/
|
||||
|
||||
#include <iocsh.h>
|
||||
#include "caDiagnostics.h"
|
||||
|
||||
/* Information needed by iocsh */
|
||||
static const iocshArg acctstArg0 = { "channel name", iocshArgString };
|
||||
static const iocshArg acctstArg1 = { "interest level", iocshArgInt };
|
||||
static const iocshArg acctstArg2 = { "channel count", iocshArgInt };
|
||||
static const iocshArg acctstArg3 = { "repetition count", iocshArgInt };
|
||||
static const iocshArg acctstArg4 = { "preemptive callback select", iocshArgInt };
|
||||
|
||||
static const iocshArg *acctstArgs[] =
|
||||
{
|
||||
&acctstArg0,
|
||||
&acctstArg1,
|
||||
&acctstArg2,
|
||||
&acctstArg3,
|
||||
&acctstArg4
|
||||
};
|
||||
static const iocshFuncDef acctstFuncDef = {"acctst", 5, acctstArgs};
|
||||
|
||||
|
||||
/* Wrapper called by iocsh, selects the argument types that print needs */
|
||||
static void acctstCallFunc(const iocshArgBuf *args) {
|
||||
if ( args[1].ival < 0 ) {
|
||||
printf ( "negative interest level not allowed\n" );
|
||||
return;
|
||||
}
|
||||
if ( args[2].ival < 0 ) {
|
||||
printf ( "negative channel count not allowed\n" );
|
||||
return;
|
||||
}
|
||||
if ( args[3].ival < 0 ) {
|
||||
printf ( "negative repetition count not allowed\n" );
|
||||
return;
|
||||
}
|
||||
acctst (
|
||||
args[0].sval, /* channel name */
|
||||
( unsigned ) args[1].ival, /* interest level */
|
||||
( unsigned ) args[2].ival, /* channel count */
|
||||
( unsigned ) args[3].ival, /* repetition count */
|
||||
( ca_preemptive_callback_select ) args[4].ival ); /* preemptive callback select */
|
||||
}
|
||||
|
||||
struct AutoInit {
|
||||
AutoInit ();
|
||||
};
|
||||
|
||||
AutoInit :: AutoInit ()
|
||||
{
|
||||
iocshRegister ( &acctstFuncDef, acctstCallFunc );
|
||||
}
|
||||
|
||||
AutoInit autoInit;
|
||||
|
||||
40
src/ca/client/addrList.h
Normal file
40
src/ca/client/addrList.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#ifndef addrListh
|
||||
#define addrListh
|
||||
|
||||
#include "shareLib.h"
|
||||
#include "envDefs.h"
|
||||
#include "osiSock.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
epicsShareFunc void epicsShareAPI configureChannelAccessAddressList
|
||||
( struct ELLLIST *pList, SOCKET sock, unsigned short port );
|
||||
|
||||
epicsShareFunc int epicsShareAPI addAddrToChannelAccessAddressList
|
||||
( struct ELLLIST *pList, const ENV_PARAM *pEnv,
|
||||
unsigned short port, int ignoreNonDefaultPort );
|
||||
|
||||
epicsShareFunc void epicsShareAPI printChannelAccessAddressList
|
||||
( const struct ELLLIST *pList );
|
||||
|
||||
epicsShareFunc void epicsShareAPI removeDuplicateAddresses
|
||||
( struct ELLLIST *pDestList, ELLLIST *pSrcList, int silent);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ifndef addrListh */
|
||||
|
||||
104
src/ca/client/autoPtrFreeList.h
Normal file
104
src/ca/client/autoPtrFreeList.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef autoPtrFreeListh
|
||||
#define autoPtrFreeListh
|
||||
|
||||
#ifdef epicsExportSharedSymbols
|
||||
# define autoPtrFreeListh_epicsExportSharedSymbols
|
||||
# undef epicsExportSharedSymbols
|
||||
#endif
|
||||
|
||||
#include "tsFreeList.h"
|
||||
#include "compilerDependencies.h"
|
||||
|
||||
#ifdef autoPtrFreeListh_epicsExportSharedSymbols
|
||||
# define epicsExportSharedSymbols
|
||||
#endif
|
||||
|
||||
template < class T, unsigned N = 0x400, class MUTEX = epicsMutex >
|
||||
class autoPtrFreeList {
|
||||
public:
|
||||
autoPtrFreeList ( tsFreeList < T, N, MUTEX > &, T * );
|
||||
~autoPtrFreeList ();
|
||||
T & operator * () const;
|
||||
T * operator -> () const;
|
||||
T * get () const;
|
||||
T * release ();
|
||||
private:
|
||||
T * p;
|
||||
tsFreeList < T, N, MUTEX > & freeList;
|
||||
// not implemented
|
||||
autoPtrFreeList & operator = ( const autoPtrFreeList & );
|
||||
autoPtrFreeList ( const autoPtrFreeList < T, N, MUTEX > & );
|
||||
};
|
||||
|
||||
template < class T, unsigned N, class MUTEX >
|
||||
inline autoPtrFreeList < T, N, MUTEX >::autoPtrFreeList (
|
||||
tsFreeList < T, N, MUTEX > & freeListIn, T * pIn ) :
|
||||
p ( pIn ), freeList ( freeListIn ) {}
|
||||
|
||||
template < class T, unsigned N, class MUTEX >
|
||||
inline autoPtrFreeList < T, N, MUTEX >::~autoPtrFreeList ()
|
||||
{
|
||||
if ( this->p ) {
|
||||
this->p->~T();
|
||||
// its probably a good idea to require that the class has placement delete
|
||||
// by calling it during cleanup if the compiler supports it
|
||||
# if defined ( CXX_PLACEMENT_DELETE )
|
||||
T::operator delete ( this->p, this->freeList );
|
||||
# else
|
||||
this->freeList.release ( this->p );
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
template < class T, unsigned N, class MUTEX >
|
||||
inline T & autoPtrFreeList < T, N, MUTEX >::operator * () const
|
||||
{
|
||||
return * this->p;
|
||||
}
|
||||
|
||||
template < class T, unsigned N, class MUTEX >
|
||||
inline T * autoPtrFreeList < T, N, MUTEX >::operator -> () const
|
||||
{
|
||||
return this->p;
|
||||
}
|
||||
|
||||
template < class T, unsigned N, class MUTEX >
|
||||
inline T * autoPtrFreeList < T, N, MUTEX >::get () const
|
||||
{
|
||||
return this->p;
|
||||
}
|
||||
|
||||
template < class T, unsigned N, class MUTEX >
|
||||
inline T * autoPtrFreeList < T, N, MUTEX >::release ()
|
||||
{
|
||||
T *pTmp = this->p;
|
||||
this->p = 0;
|
||||
return pTmp;
|
||||
}
|
||||
|
||||
#endif // #ifdef autoPtrFreeListh
|
||||
92
src/ca/client/autoPtrRecycle.h
Normal file
92
src/ca/client/autoPtrRecycle.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef autoPtrRecycleh
|
||||
#define autoPtrRecycleh
|
||||
|
||||
template < class T >
|
||||
class autoPtrRecycle {
|
||||
public:
|
||||
autoPtrRecycle (
|
||||
epicsGuard < epicsMutex > &, chronIntIdResTable < baseNMIU > &,
|
||||
cacRecycle &, T * );
|
||||
~autoPtrRecycle ();
|
||||
T & operator * () const;
|
||||
T * operator -> () const;
|
||||
T * get () const;
|
||||
T * release ();
|
||||
private:
|
||||
T * p;
|
||||
cacRecycle & r;
|
||||
chronIntIdResTable < baseNMIU > & ioTable;
|
||||
epicsGuard < epicsMutex > & guard;
|
||||
// not implemented
|
||||
autoPtrRecycle ( const autoPtrRecycle & );
|
||||
autoPtrRecycle & operator = ( const autoPtrRecycle & );
|
||||
};
|
||||
|
||||
template < class T >
|
||||
inline autoPtrRecycle<T>::autoPtrRecycle (
|
||||
epicsGuard < epicsMutex > & guardIn, chronIntIdResTable < baseNMIU > & tbl,
|
||||
cacRecycle & rIn, T * pIn ) :
|
||||
p ( pIn ), r ( rIn ), ioTable ( tbl ), guard ( guardIn ) {}
|
||||
|
||||
template < class T >
|
||||
inline autoPtrRecycle<T>::~autoPtrRecycle ()
|
||||
{
|
||||
if ( this->p ) {
|
||||
baseNMIU *pb = this->p;
|
||||
this->ioTable.remove ( *pb );
|
||||
pb->destroy ( this->guard, this->r );
|
||||
}
|
||||
}
|
||||
|
||||
template < class T >
|
||||
inline T & autoPtrRecycle<T>::operator * () const
|
||||
{
|
||||
return * this->p;
|
||||
}
|
||||
|
||||
template < class T >
|
||||
inline T * autoPtrRecycle<T>::operator -> () const
|
||||
{
|
||||
return this->p;
|
||||
}
|
||||
|
||||
template < class T >
|
||||
inline T * autoPtrRecycle<T>::get () const
|
||||
{
|
||||
return this->p;
|
||||
}
|
||||
|
||||
template < class T >
|
||||
inline T * autoPtrRecycle<T>::release ()
|
||||
{
|
||||
T *pTmp = this->p;
|
||||
this->p = 0;
|
||||
return pTmp;
|
||||
}
|
||||
|
||||
#endif // #ifdef autoPtrRecycleh
|
||||
39
src/ca/client/baseNMIU.cpp
Normal file
39
src/ca/client/baseNMIU.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, the Regents of the University of California.
|
||||
*
|
||||
* Author: Jeff Hill
|
||||
*/
|
||||
|
||||
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
|
||||
|
||||
#include "iocinf.h"
|
||||
#include "nciu.h"
|
||||
#include "netIO.h"
|
||||
|
||||
baseNMIU::~baseNMIU ()
|
||||
{
|
||||
}
|
||||
|
||||
void baseNMIU::forceSubscriptionUpdate (
|
||||
epicsGuard < epicsMutex > &, nciu & )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
358
src/ca/client/bhe.cpp
Normal file
358
src/ca/client/bhe.cpp
Normal file
@@ -0,0 +1,358 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
* Author: Jeff Hill
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <limits.h>
|
||||
#include <float.h>
|
||||
|
||||
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
|
||||
|
||||
#include "errlog.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "iocinf.h"
|
||||
#include "virtualCircuit.h"
|
||||
#include "bhe.h"
|
||||
|
||||
/*
|
||||
* set average to -1.0 so that when the next beacon
|
||||
* occurs we can distinguish between:
|
||||
* o new server
|
||||
* o existing server's beacon we are seeing
|
||||
* for the first time shortly after program
|
||||
* start up
|
||||
*
|
||||
* if creating this in response to a search reply
|
||||
* and not in response to a beacon then
|
||||
* we set the beacon time stamp to
|
||||
* zero (so we can correctly compute the period
|
||||
* between the 1st and 2nd beacons)
|
||||
*/
|
||||
bhe::bhe ( epicsMutex & mutexIn, const epicsTime & initialTimeStamp,
|
||||
unsigned initialBeaconNumber, const inetAddrID & addr ) :
|
||||
inetAddrID ( addr ), timeStamp ( initialTimeStamp ), averagePeriod ( - DBL_MAX ),
|
||||
mutex ( mutexIn ), pIIU ( 0 ), lastBeaconNumber ( initialBeaconNumber )
|
||||
{
|
||||
# ifdef DEBUG
|
||||
{
|
||||
char name[64];
|
||||
addr.name ( name, sizeof ( name ) );
|
||||
::printf ( "created beacon entry for %s\n", name );
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
bhe::~bhe ()
|
||||
{
|
||||
}
|
||||
|
||||
void bhe::beaconAnomalyNotify ( epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
if ( this->pIIU ) {
|
||||
this->pIIU->beaconAnomalyNotify ( guard );
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void bhe::logBeacon ( const char * pDiagnostic,
|
||||
const double & currentPeriod,
|
||||
const epicsTime & currentTime )
|
||||
{
|
||||
if ( this->pIIU ) {
|
||||
char name[64];
|
||||
this->name ( name, sizeof ( name ) );
|
||||
char date[64];
|
||||
currentTime.strftime ( date, sizeof ( date ),
|
||||
"%a %b %d %Y %H:%M:%S.%f");
|
||||
::printf ( "%s cp=%g ap=%g %s %s\n",
|
||||
pDiagnostic, currentPeriod,
|
||||
this->averagePeriod, name, date );
|
||||
}
|
||||
}
|
||||
#else
|
||||
inline void bhe::logBeacon ( const char * /* pDiagnostic */,
|
||||
const double & /* currentPeriod */,
|
||||
const epicsTime & /* currentTime */ )
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
void bhe::logBeaconDiscard ( unsigned beaconAdvance,
|
||||
const epicsTime & currentTime )
|
||||
{
|
||||
if ( this->pIIU ) {
|
||||
char name[64];
|
||||
this->name ( name, sizeof ( name ) );
|
||||
char date[64];
|
||||
currentTime.strftime ( date, sizeof ( date ),
|
||||
"%a %b %d %Y %H:%M:%S.%f");
|
||||
::printf ( "bb %u %s %s\n",
|
||||
beaconAdvance, name, date );
|
||||
}
|
||||
}
|
||||
#else
|
||||
void bhe::logBeaconDiscard ( unsigned /* beaconAdvance */,
|
||||
const epicsTime & /* currentTime */ )
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* update beacon period
|
||||
*
|
||||
* updates beacon period, and looks for beacon anomalies
|
||||
*/
|
||||
bool bhe::updatePeriod (
|
||||
epicsGuard < epicsMutex > & guard, const epicsTime & programBeginTime,
|
||||
const epicsTime & currentTime, ca_uint32_t beaconNumber,
|
||||
unsigned protocolRevision )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
|
||||
//
|
||||
// this block is enetered if the beacon was created as a side effect of
|
||||
// creating a connection and so we dont yet know the first beacon time
|
||||
// and sequence number
|
||||
//
|
||||
if ( this->timeStamp == epicsTime () ) {
|
||||
if ( CA_V410 ( protocolRevision ) ) {
|
||||
this->lastBeaconNumber = beaconNumber;
|
||||
}
|
||||
|
||||
this->beaconAnomalyNotify ( guard );
|
||||
|
||||
/*
|
||||
* this is the 1st beacon seen - the beacon time stamp
|
||||
* was not initialized during BHE create because
|
||||
* a TCP/IP connection created the beacon.
|
||||
* (nothing to do but set the beacon time stamp and return)
|
||||
*/
|
||||
this->timeStamp = currentTime;
|
||||
|
||||
logBeacon ( "fb", - DBL_MAX, currentTime );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// 1) detect beacon duplications due to redundant routes
|
||||
// 2) detect lost beacons due to input queue overrun or damage
|
||||
if ( CA_V410 ( protocolRevision ) ) {
|
||||
unsigned beaconSeqAdvance;
|
||||
if ( beaconNumber >= this->lastBeaconNumber ) {
|
||||
beaconSeqAdvance = beaconNumber - this->lastBeaconNumber;
|
||||
}
|
||||
else {
|
||||
beaconSeqAdvance = ( ca_uint32_max - this->lastBeaconNumber ) + beaconNumber;
|
||||
}
|
||||
this->lastBeaconNumber = beaconNumber;
|
||||
|
||||
// throw out sequence numbers just prior to, or the same as, the last one received
|
||||
// (this situation is probably caused by a temporary duplicate route )
|
||||
if ( beaconSeqAdvance == 0 || beaconSeqAdvance > ca_uint32_max - 256 ) {
|
||||
logBeaconDiscard ( beaconSeqAdvance, currentTime );
|
||||
return false;
|
||||
}
|
||||
|
||||
// throw out sequence numbers that jump forward by only a few numbers
|
||||
// (this situation is probably caused by a duplicate route
|
||||
// or a beacon due to input queue overun)
|
||||
if ( beaconSeqAdvance > 1 && beaconSeqAdvance < 4 ) {
|
||||
logBeaconDiscard ( beaconSeqAdvance, currentTime );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// compute the beacon period (if we have seen at least two beacons)
|
||||
bool netChange = false;
|
||||
double currentPeriod = currentTime - this->timeStamp;
|
||||
|
||||
if ( this->averagePeriod < 0.0 ) {
|
||||
double totalRunningTime;
|
||||
|
||||
this->beaconAnomalyNotify ( guard );
|
||||
|
||||
/*
|
||||
* this is the 2nd beacon seen. We cant tell about
|
||||
* the change in period at this point so we just
|
||||
* initialize the average period and return.
|
||||
*/
|
||||
this->averagePeriod = currentPeriod;
|
||||
|
||||
logBeacon ( "fp", currentPeriod, currentTime );
|
||||
|
||||
|
||||
/*
|
||||
* ignore beacons seen for the first time shortly after
|
||||
* init, but do not ignore beacons arriving with a short
|
||||
* period because the IOC was rebooted soon after the
|
||||
* client starts up.
|
||||
*/
|
||||
totalRunningTime = this->timeStamp - programBeginTime;
|
||||
if ( currentPeriod <= totalRunningTime ) {
|
||||
netChange = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
/*
|
||||
* Is this an IOC seen because of a restored
|
||||
* network segment?
|
||||
*
|
||||
* It may be possible to get false triggers here
|
||||
* if the client is busy, but this does not cause
|
||||
* problems because the echo response will tell us
|
||||
* that the server is available
|
||||
*/
|
||||
if ( currentPeriod >= this->averagePeriod * 1.25 ) {
|
||||
|
||||
/*
|
||||
* trigger on any missing beacon
|
||||
* if connected to this server
|
||||
*/
|
||||
this->beaconAnomalyNotify ( guard );
|
||||
|
||||
if ( currentPeriod >= this->averagePeriod * 3.25 ) {
|
||||
/*
|
||||
* trigger on any 3 contiguous missing beacons
|
||||
* if not connected to this server
|
||||
*/
|
||||
netChange = true;
|
||||
}
|
||||
logBeacon ( "bah", currentPeriod, currentTime );
|
||||
}
|
||||
|
||||
/*
|
||||
* Is this an IOC seen because of an IOC reboot
|
||||
* (beacon come at a higher rate just after the
|
||||
* IOC reboots). Lower tolarance here because we
|
||||
* dont have to worry about lost beacons.
|
||||
*
|
||||
* It may be possible to get false triggers here
|
||||
* if the client is busy, but this does not cause
|
||||
* problems because the echo response will tell us
|
||||
* that the server is available
|
||||
*/
|
||||
else if ( currentPeriod <= this->averagePeriod * 0.80 ) {
|
||||
this->beaconAnomalyNotify ( guard );
|
||||
netChange = true;
|
||||
logBeacon ( "bal", currentPeriod, currentTime );
|
||||
}
|
||||
else if ( this->pIIU ) {
|
||||
// update state of health for active virtual circuits
|
||||
// if the beacon looks ok
|
||||
this->pIIU->beaconArrivalNotify ( guard );
|
||||
logBeacon ( "vb", currentPeriod, currentTime );
|
||||
}
|
||||
|
||||
// update a running average period
|
||||
this->averagePeriod = currentPeriod * 0.125 +
|
||||
this->averagePeriod * 0.875;
|
||||
}
|
||||
|
||||
this->timeStamp = currentTime;
|
||||
|
||||
return netChange;
|
||||
}
|
||||
|
||||
void bhe::show ( unsigned level ) const
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
this->show ( guard, level );
|
||||
}
|
||||
|
||||
void bhe::show ( epicsGuard < epicsMutex > &, unsigned level ) const
|
||||
{
|
||||
char host [64];
|
||||
this->name ( host, sizeof ( host ) );
|
||||
if ( this->averagePeriod == -DBL_MAX ) {
|
||||
::printf ( "CA beacon hash entry for %s <no period estimate>\n",
|
||||
host );
|
||||
}
|
||||
else {
|
||||
::printf ( "CA beacon hash entry for %s with period estimate %f\n",
|
||||
host, this->averagePeriod );
|
||||
}
|
||||
if ( level > 0u ) {
|
||||
char date[64];
|
||||
this->timeStamp.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S");
|
||||
::printf ( "\tbeacon number %u, on %s\n",
|
||||
this->lastBeaconNumber, date );
|
||||
}
|
||||
}
|
||||
|
||||
double bhe::period ( epicsGuard < epicsMutex > & guard ) const
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
return this->averagePeriod;
|
||||
}
|
||||
|
||||
epicsTime bhe::updateTime ( epicsGuard < epicsMutex > & guard ) const
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
return this->timeStamp;
|
||||
}
|
||||
|
||||
void bhe::registerIIU (
|
||||
epicsGuard < epicsMutex > & guard, tcpiiu & iiu )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
this->pIIU = & iiu;
|
||||
}
|
||||
|
||||
void bhe::unregisterIIU (
|
||||
epicsGuard < epicsMutex > & guard, tcpiiu & iiu )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
if ( this->pIIU == & iiu ) {
|
||||
this->pIIU = 0;
|
||||
this->timeStamp = epicsTime();
|
||||
this->averagePeriod = - DBL_MAX;
|
||||
logBeacon ( "ui", this->averagePeriod, epicsTime::getCurrent () );
|
||||
}
|
||||
}
|
||||
|
||||
void bhe::operator delete ( void * )
|
||||
{
|
||||
// Visual C++ .net appears to require operator delete if
|
||||
// placement operator delete is defined? I smell a ms rat
|
||||
// because if I declare placement new and delete, but
|
||||
// comment out the placement delete definition there are
|
||||
// no undefined symbols.
|
||||
errlogPrintf ( "%s:%d this compiler is confused about placement delete - memory was probably leaked",
|
||||
__FILE__, __LINE__ );
|
||||
}
|
||||
|
||||
void * bheFreeStore::allocate ( size_t size )
|
||||
{
|
||||
return freeList.allocate ( size );
|
||||
}
|
||||
|
||||
void bheFreeStore::release ( void * pCadaver )
|
||||
{
|
||||
freeList.release ( pCadaver );
|
||||
}
|
||||
|
||||
bheMemoryManager::~bheMemoryManager () {}
|
||||
|
||||
|
||||
122
src/ca/client/bhe.h
Normal file
122
src/ca/client/bhe.h
Normal file
@@ -0,0 +1,122 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
* Author: Jeff Hill
|
||||
*/
|
||||
|
||||
#ifndef bheh
|
||||
#define bheh
|
||||
|
||||
#ifdef epicsExportSharedSymbols
|
||||
# define bhehEpicsExportSharedSymbols
|
||||
# undef epicsExportSharedSymbols
|
||||
#endif
|
||||
|
||||
#include "tsDLList.h"
|
||||
#include "tsFreeList.h"
|
||||
#include "epicsTime.h"
|
||||
#include "compilerDependencies.h"
|
||||
|
||||
#ifdef bhehEpicsExportSharedSymbols
|
||||
# define epicsExportSharedSymbols
|
||||
# include "shareLib.h"
|
||||
#endif
|
||||
|
||||
#include "inetAddrID.h"
|
||||
#include "caProto.h"
|
||||
|
||||
class tcpiiu;
|
||||
class bheMemoryManager;
|
||||
|
||||
// using a pure abstract wrapper class around the free list avoids
|
||||
// Tornado 2.0.1 GNU compiler bugs
|
||||
class epicsShareClass bheMemoryManager {
|
||||
public:
|
||||
virtual ~bheMemoryManager ();
|
||||
virtual void * allocate ( size_t ) = 0;
|
||||
virtual void release ( void * ) = 0;
|
||||
};
|
||||
|
||||
class bhe : public tsSLNode < bhe >, public inetAddrID {
|
||||
public:
|
||||
epicsShareFunc bhe (
|
||||
epicsMutex &, const epicsTime & initialTimeStamp,
|
||||
unsigned initialBeaconNumber, const inetAddrID & addr );
|
||||
epicsShareFunc ~bhe ();
|
||||
epicsShareFunc bool updatePeriod (
|
||||
epicsGuard < epicsMutex > &,
|
||||
const epicsTime & programBeginTime,
|
||||
const epicsTime & currentTime, ca_uint32_t beaconNumber,
|
||||
unsigned protocolRevision );
|
||||
epicsShareFunc double period ( epicsGuard < epicsMutex > & ) const;
|
||||
epicsShareFunc epicsTime updateTime ( epicsGuard < epicsMutex > & ) const;
|
||||
epicsShareFunc void show ( unsigned level ) const;
|
||||
epicsShareFunc void show ( epicsGuard < epicsMutex > &, unsigned /* level */ ) const;
|
||||
epicsShareFunc void registerIIU ( epicsGuard < epicsMutex > &, tcpiiu & );
|
||||
epicsShareFunc void unregisterIIU ( epicsGuard < epicsMutex > &, tcpiiu & );
|
||||
epicsShareFunc void * operator new ( size_t size, bheMemoryManager & );
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
epicsShareFunc void operator delete ( void *, bheMemoryManager & );
|
||||
#endif
|
||||
private:
|
||||
epicsTime timeStamp;
|
||||
double averagePeriod;
|
||||
epicsMutex & mutex;
|
||||
tcpiiu * pIIU;
|
||||
ca_uint32_t lastBeaconNumber;
|
||||
void beaconAnomalyNotify ( epicsGuard < epicsMutex > & );
|
||||
void logBeacon ( const char * pDiagnostic,
|
||||
const double & currentPeriod,
|
||||
const epicsTime & currentTime );
|
||||
void logBeaconDiscard ( unsigned beaconAdvance,
|
||||
const epicsTime & currentTime );
|
||||
bhe ( const bhe & );
|
||||
bhe & operator = ( const bhe & );
|
||||
epicsShareFunc void operator delete ( void * );
|
||||
};
|
||||
|
||||
// using a wrapper class around the free list avoids
|
||||
// Tornado 2.0.1 GNU compiler bugs
|
||||
class bheFreeStore : public bheMemoryManager {
|
||||
public:
|
||||
bheFreeStore () {}
|
||||
void * allocate ( size_t );
|
||||
void release ( void * );
|
||||
private:
|
||||
tsFreeList < bhe, 0x100 > freeList;
|
||||
bheFreeStore ( const bheFreeStore & );
|
||||
bheFreeStore & operator = ( const bheFreeStore & );
|
||||
};
|
||||
|
||||
inline void * bhe::operator new ( size_t size,
|
||||
bheMemoryManager & mgr )
|
||||
{
|
||||
return mgr.allocate ( size );
|
||||
}
|
||||
|
||||
#ifdef CXX_PLACEMENT_DELETE
|
||||
inline void bhe::operator delete ( void * pCadaver,
|
||||
bheMemoryManager & mgr )
|
||||
{
|
||||
mgr.release ( pCadaver );
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // ifdef bheh
|
||||
|
||||
|
||||
36
src/ca/client/ca.rc
Normal file
36
src/ca/client/ca.rc
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <winver.h>
|
||||
#include "epicsVersion.h"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION EPICS_VERSION,EPICS_REVISION,EPICS_MODIFICATION,EPICS_PATCH_LEVEL
|
||||
PRODUCTVERSION EPICS_VERSION,EPICS_REVISION,EPICS_MODIFICATION,EPICS_PATCH_LEVEL
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS VOS__WINDOWS32
|
||||
FILETYPE VFT_UNKNOWN
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments","Channel Access Library for EPICS\0"
|
||||
VALUE "CompanyName", "The EPICS collaboration\0"
|
||||
VALUE "FileDescription", "Channel Access Library\0"
|
||||
VALUE "FileVersion", EPICS_VERSION_STRING "\0"
|
||||
VALUE "InternalName", "ca\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) Univ. of California, Univ. of Chicago\0"
|
||||
VALUE "OriginalFilename", "ca.dll\0"
|
||||
VALUE "ProductName", "Experimental Physics and Industrial Control System (EPICS)\0"
|
||||
VALUE "ProductVersion", EPICS_VERSION_STRING "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
109
src/ca/client/caConnTest.cpp
Normal file
109
src/ca/client/caConnTest.cpp
Normal file
@@ -0,0 +1,109 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
|
||||
|
||||
#include "cadef.h"
|
||||
#include "epicsTime.h"
|
||||
|
||||
static unsigned channelCount = 0u;
|
||||
static unsigned connCount = 0u;
|
||||
static bool subsequentConnect = false;
|
||||
|
||||
epicsTime begin;
|
||||
|
||||
extern "C" void caConnTestConnHandler ( struct connection_handler_args args )
|
||||
{
|
||||
if ( args.op == CA_OP_CONN_UP ) {
|
||||
if ( connCount == 0u ) {
|
||||
if ( subsequentConnect ) {
|
||||
printf ("the first channel connected\n");
|
||||
begin = epicsTime::getCurrent ();
|
||||
}
|
||||
}
|
||||
connCount++;
|
||||
// printf ( "." );
|
||||
// fflush ( stdout );
|
||||
if ( connCount == channelCount ) {
|
||||
epicsTime current = epicsTime::getCurrent ();
|
||||
double delay = current - begin;
|
||||
printf ( "all channels connected after %f sec ( %f sec per channel)\n",
|
||||
delay, delay / channelCount );
|
||||
}
|
||||
}
|
||||
else if ( args.op == CA_OP_CONN_DOWN ) {
|
||||
if ( connCount == channelCount ) {
|
||||
printf ( "channels are disconnected\n" );
|
||||
subsequentConnect = true;
|
||||
}
|
||||
connCount--;
|
||||
if ( connCount == 0u ) {
|
||||
printf ( "all channels are disconnected\n" );
|
||||
}
|
||||
}
|
||||
else {
|
||||
assert ( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
void caConnTest ( const char *pNameIn, unsigned channelCountIn, double delayIn )
|
||||
{
|
||||
unsigned iteration = 0u;
|
||||
int status;
|
||||
unsigned i;
|
||||
chid *pChans;
|
||||
|
||||
channelCount = channelCountIn;
|
||||
|
||||
pChans = new chid [channelCount];
|
||||
|
||||
while ( 1 ) {
|
||||
connCount = 0u;
|
||||
subsequentConnect = false;
|
||||
begin = epicsTime::getCurrent ();
|
||||
|
||||
printf ( "initializing CA client library\n" );
|
||||
|
||||
status = ca_task_initialize();
|
||||
SEVCHK ( status, "CA init failed" );
|
||||
|
||||
printf ( "creating channels\n" );
|
||||
|
||||
for ( i = 0u; i < channelCount; i++ ) {
|
||||
status = ca_search_and_connect ( pNameIn,
|
||||
&pChans[i], caConnTestConnHandler, 0 );
|
||||
SEVCHK ( status, "CA search problems" );
|
||||
}
|
||||
|
||||
printf ( "all channels were created\n" );
|
||||
|
||||
ca_pend_event ( delayIn );
|
||||
|
||||
if ( iteration & 1 ) {
|
||||
for ( i = 0u; i < channelCount; i++ ) {
|
||||
status = ca_clear_channel ( pChans[i] );
|
||||
SEVCHK ( status, "ca_clear_channel() problems" );
|
||||
}
|
||||
printf ( "all channels were destroyed\n" );
|
||||
}
|
||||
|
||||
printf ( "shutting down CA client library\n" );
|
||||
|
||||
status = ca_task_exit ();
|
||||
SEVCHK ( status, "task exit problems" );
|
||||
|
||||
iteration++;
|
||||
}
|
||||
|
||||
//delete [] pChans;
|
||||
}
|
||||
45
src/ca/client/caConnTestMain.cpp
Normal file
45
src/ca/client/caConnTestMain.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <epicsStdlib.h>
|
||||
|
||||
#include "caDiagnostics.h"
|
||||
|
||||
int main ( int argc, char **argv )
|
||||
{
|
||||
double delay = 60.0 * 5.0;
|
||||
unsigned count = 2000;
|
||||
|
||||
if ( argc < 2 || argc > 4 ) {
|
||||
printf ( "usage: %s < channel name > [ < count > ] [ < delay sec > ]\n", argv[0] );
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( argc >= 3 ) {
|
||||
int nConverted = sscanf ( argv[2], "%u", &count );
|
||||
if ( nConverted != 1 ) {
|
||||
printf ( "conversion failed, changing channel count arg \"%s\" to %u\n",
|
||||
argv[1], count );
|
||||
}
|
||||
}
|
||||
|
||||
if ( argc >= 4 ) {
|
||||
int nConverted = epicsScanDouble( argv[3], &delay );
|
||||
if ( nConverted != 1 ) {
|
||||
printf ( "conversion failed, changing delay arg \"%s\" to %f\n",
|
||||
argv[2], delay );
|
||||
}
|
||||
}
|
||||
|
||||
caConnTest ( argv[1], count, delay );
|
||||
|
||||
return 0;
|
||||
}
|
||||
38
src/ca/client/caDiagnostics.h
Normal file
38
src/ca/client/caDiagnostics.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#ifndef caDiagnosticsh
|
||||
#define caDiagnosticsh
|
||||
|
||||
#include "cadef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum appendNumberFlag {appendNumber, dontAppendNumber};
|
||||
int catime ( const char *channelName, unsigned channelCount, enum appendNumberFlag appNF );
|
||||
|
||||
int acctst ( const char *pname, unsigned logggingInterestLevel,
|
||||
unsigned channelCount, unsigned repetitionCount,
|
||||
enum ca_preemptive_callback_select select );
|
||||
|
||||
#define CATIME_OK 0
|
||||
#define CATIME_ERROR -1
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
void caConnTest ( const char *pNameIn, unsigned channelCountIn, double delayIn );
|
||||
|
||||
#endif /* caDiagnosticsh */
|
||||
|
||||
|
||||
139
src/ca/client/caEventRate.cpp
Normal file
139
src/ca/client/caEventRate.cpp
Normal file
@@ -0,0 +1,139 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "cadef.h"
|
||||
#include "dbDefs.h"
|
||||
#include "epicsTime.h"
|
||||
#include "errlog.h"
|
||||
|
||||
/*
|
||||
* event_handler()
|
||||
*/
|
||||
extern "C" void eventCallBack ( struct event_handler_args args )
|
||||
{
|
||||
unsigned *pCount = static_cast < unsigned * > ( args.usr );
|
||||
(*pCount)++;
|
||||
}
|
||||
|
||||
/*
|
||||
* caEventRate ()
|
||||
*/
|
||||
void caEventRate ( const char *pName, unsigned count )
|
||||
{
|
||||
static const double initialSamplePeriod = 1.0;
|
||||
static const double maxSamplePeriod = 60.0 * 5.0;
|
||||
unsigned eventCount = 0u;
|
||||
|
||||
chid * pChidTable = new chid [ count ];
|
||||
|
||||
{
|
||||
printf ( "Connecting to CA Channel \"%s\" %u times.",
|
||||
pName, count );
|
||||
fflush ( stdout );
|
||||
|
||||
epicsTime begin = epicsTime::getCurrent ();
|
||||
for ( unsigned i = 0u; i < count; i++ ) {
|
||||
int status = ca_search ( pName, & pChidTable[i] );
|
||||
SEVCHK ( status, NULL );
|
||||
}
|
||||
|
||||
int status = ca_pend_io ( 10000.0 );
|
||||
if ( status != ECA_NORMAL ) {
|
||||
fprintf ( stderr, " not found.\n" );
|
||||
return;
|
||||
}
|
||||
epicsTime end = epicsTime::getCurrent ();
|
||||
|
||||
printf ( " done(%f sec).\n", end - begin );
|
||||
}
|
||||
|
||||
{
|
||||
printf ( "Subscribing %u times.", count );
|
||||
fflush ( stdout );
|
||||
|
||||
epicsTime begin = epicsTime::getCurrent ();
|
||||
for ( unsigned i = 0u; i < count; i++ ) {
|
||||
int addEventStatus = ca_add_event ( DBR_FLOAT,
|
||||
pChidTable[i], eventCallBack, &eventCount, NULL);
|
||||
SEVCHK ( addEventStatus, __FILE__ );
|
||||
}
|
||||
|
||||
int status = ca_flush_io ();
|
||||
SEVCHK ( status, __FILE__ );
|
||||
|
||||
epicsTime end = epicsTime::getCurrent ();
|
||||
|
||||
printf ( " done(%f sec).\n", end - begin );
|
||||
}
|
||||
|
||||
{
|
||||
printf ( "Waiting for initial value events." );
|
||||
fflush ( stdout );
|
||||
|
||||
// let the first one go by
|
||||
epicsTime begin = epicsTime::getCurrent ();
|
||||
while ( eventCount < count ) {
|
||||
int status = ca_pend_event ( 0.01 );
|
||||
if ( status != ECA_TIMEOUT ) {
|
||||
SEVCHK ( status, NULL );
|
||||
}
|
||||
}
|
||||
epicsTime end = epicsTime::getCurrent ();
|
||||
|
||||
printf ( " done(%f sec).\n", end - begin );
|
||||
}
|
||||
|
||||
double samplePeriod = initialSamplePeriod;
|
||||
double X = 0.0;
|
||||
double XX = 0.0;
|
||||
unsigned N = 0u;
|
||||
while ( true ) {
|
||||
unsigned nEvents, lastEventCount, curEventCount;
|
||||
|
||||
epicsTime beginPend = epicsTime::getCurrent ();
|
||||
lastEventCount = eventCount;
|
||||
int status = ca_pend_event ( samplePeriod );
|
||||
curEventCount = eventCount;
|
||||
epicsTime endPend = epicsTime::getCurrent ();
|
||||
if ( status != ECA_TIMEOUT ) {
|
||||
SEVCHK ( status, NULL );
|
||||
}
|
||||
|
||||
if ( curEventCount >= lastEventCount ) {
|
||||
nEvents = curEventCount - lastEventCount;
|
||||
}
|
||||
else {
|
||||
nEvents = ( UINT_MAX - lastEventCount ) + curEventCount + 1u;
|
||||
}
|
||||
|
||||
N++;
|
||||
|
||||
double period = endPend - beginPend;
|
||||
double Hz = nEvents / period;
|
||||
|
||||
X += Hz;
|
||||
XX += Hz * Hz;
|
||||
|
||||
double mean = X / N;
|
||||
double stdDev = sqrt ( XX / N - mean * mean );
|
||||
|
||||
printf ( "CA Event Rate (Hz): current %g mean %g std dev %g\n",
|
||||
Hz, mean, stdDev );
|
||||
|
||||
if ( samplePeriod < maxSamplePeriod ) {
|
||||
samplePeriod += samplePeriod;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
src/ca/client/caEventRateMain.cpp
Normal file
38
src/ca/client/caEventRateMain.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void caEventRate ( const char *pName, unsigned count );
|
||||
|
||||
int main ( int argc, char **argv )
|
||||
{
|
||||
if ( argc < 2 || argc > 3 ) {
|
||||
fprintf ( stderr, "usage: %s < PV name > [subscription count]\n", argv[0] );
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned count;
|
||||
if ( argc == 3 ) {
|
||||
int status = sscanf ( argv[2], " %u ", & count );
|
||||
if ( status != 1 ) {
|
||||
fprintf ( stderr, "expected unsigned integer 2nd argument\n" );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
count = 1;
|
||||
}
|
||||
|
||||
caEventRate ( argv[1], count );
|
||||
|
||||
return 0;
|
||||
}
|
||||
187
src/ca/client/caProto.h
Normal file
187
src/ca/client/caProto.h
Normal file
@@ -0,0 +1,187 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef __CAPROTO__
|
||||
#define __CAPROTO__
|
||||
|
||||
#define capStrOf(A) #A
|
||||
#define capStrOfX(A) capStrOf ( A )
|
||||
|
||||
/*
|
||||
* CA protocol revision
|
||||
* TCP/UDP port number (bumped each major protocol change)
|
||||
*/
|
||||
#define CA_MAJOR_PROTOCOL_REVISION 4
|
||||
#define CA_VERSION_STRING( MINOR_REVISION ) \
|
||||
( capStrOfX ( CA_MAJOR_PROTOCOL_REVISION ) "." capStrOfX ( MINOR_REVISION ) )
|
||||
#define CA_UKN_MINOR_VERSION 0u /* unknown minor version */
|
||||
#define CA_MINIMUM_SUPPORTED_VERSION 4u
|
||||
# define CA_VSUPPORTED(MINOR) ((MINOR)>=CA_MINIMUM_SUPPORTED_VERSION)
|
||||
# define CA_V41(MINOR) ((MINOR)>=1u)
|
||||
# define CA_V42(MINOR) ((MINOR)>=2u)
|
||||
# define CA_V43(MINOR) ((MINOR)>=3u)
|
||||
# define CA_V44(MINOR) ((MINOR)>=4u)
|
||||
# define CA_V45(MINOR) ((MINOR)>=5u)
|
||||
# define CA_V46(MINOR) ((MINOR)>=6u)
|
||||
# define CA_V47(MINOR) ((MINOR)>=7u)
|
||||
# define CA_V48(MINOR) ((MINOR)>=8u)
|
||||
# define CA_V49(MINOR) ((MINOR)>=9u) /* large arrays, dispatch priorities */
|
||||
# define CA_V410(MINOR) ((MINOR)>=10u) /* beacon counter */
|
||||
# define CA_V411(MINOR) ((MINOR)>=11u) /* sequence numbers in UDP version command */
|
||||
# define CA_V412(MINOR) ((MINOR)>=12u) /* TCP-based search requests */
|
||||
# define CA_V413(MINOR) ((MINOR)>=13u) /* Allow zero length in requests. */
|
||||
|
||||
/*
|
||||
* These port numbers are only used if the CA repeater and
|
||||
* CA server port numbers cant be obtained from the EPICS
|
||||
* environment variables "EPICS_CA_REPEATER_PORT" and
|
||||
* "EPICS_CA_SERVER_PORT"
|
||||
*/
|
||||
#define CA_PORT_BASE IPPORT_USERRESERVED + 56U
|
||||
#define CA_SERVER_PORT (CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u)
|
||||
#define CA_REPEATER_PORT (CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u+1u)
|
||||
|
||||
/*
|
||||
* 1500 (max of ethernet and 802.{2,3} MTU) - 20(IP) - 8(UDP)
|
||||
* (the MTU of Ethernet is currently independent of its speed varient)
|
||||
*/
|
||||
#define ETHERNET_MAX_UDP ( 1500u - 20u - 8u )
|
||||
#define MAX_UDP_RECV ( 0xffff + 16u ) /* allow large frames to be received in the future */
|
||||
#define MAX_UDP_SEND 1024u /* original MAX_UDP */
|
||||
#define MAX_TCP ( 1024 * 16u ) /* so waveforms fit */
|
||||
#define MAX_MSG_SIZE ( MAX_TCP ) /* the larger of tcp and udp max */
|
||||
|
||||
#define CA_PROTO_PRIORITY_MIN 0u
|
||||
#define CA_PROTO_PRIORITY_MAX 99u
|
||||
|
||||
/*
|
||||
* architecture independent types
|
||||
*
|
||||
* (so far this works on all archs we have ported to)
|
||||
*/
|
||||
typedef unsigned char ca_uint8_t;
|
||||
typedef unsigned short ca_uint16_t;
|
||||
typedef unsigned int ca_uint32_t;
|
||||
typedef float ca_float32_t;
|
||||
typedef ca_uint32_t caResId;
|
||||
|
||||
#define ca_uint32_max 0xffffffff
|
||||
|
||||
/* values for m_cmmd */
|
||||
#define CA_PROTO_VERSION 0u /* set minor version and priority (used to be NOOP cmd) */
|
||||
#define CA_PROTO_EVENT_ADD 1u /* add an event */
|
||||
#define CA_PROTO_EVENT_CANCEL 2u /* cancel an event */
|
||||
#define CA_PROTO_READ 3u /* read and return a channel value*/
|
||||
#define CA_PROTO_WRITE 4u /* write a channel value */
|
||||
#define CA_PROTO_SNAPSHOT 5u /* snapshot of the system */
|
||||
#define CA_PROTO_SEARCH 6u /* IOC channel search */
|
||||
#define CA_PROTO_BUILD 7u /* build - obsolete */
|
||||
#define CA_PROTO_EVENTS_OFF 8u /* flow control */
|
||||
#define CA_PROTO_EVENTS_ON 9u /* flow control */
|
||||
#define CA_PROTO_READ_SYNC 10u /* purge old reads */
|
||||
#define CA_PROTO_ERROR 11u /* an operation failed */
|
||||
#define CA_PROTO_CLEAR_CHANNEL 12u /* free chan resources */
|
||||
#define CA_PROTO_RSRV_IS_UP 13u /* CA server has joined the net */
|
||||
#define CA_PROTO_NOT_FOUND 14u /* channel not found */
|
||||
#define CA_PROTO_READ_NOTIFY 15u /* add a one shot event */
|
||||
#define CA_PROTO_READ_BUILD 16u /* read and build - obsolete */
|
||||
#define REPEATER_CONFIRM 17u /* registration confirmation */
|
||||
#define CA_PROTO_CREATE_CHAN 18u /* client creates channel in server */
|
||||
#define CA_PROTO_WRITE_NOTIFY 19u /* notify after write chan value */
|
||||
#define CA_PROTO_CLIENT_NAME 20u /* CA V4.1 identify client */
|
||||
#define CA_PROTO_HOST_NAME 21u /* CA V4.1 identify client */
|
||||
#define CA_PROTO_ACCESS_RIGHTS 22u /* CA V4.2 asynch access rights chg */
|
||||
#define CA_PROTO_ECHO 23u /* CA V4.3 connection verify */
|
||||
#define REPEATER_REGISTER 24u /* register for repeater fan out */
|
||||
#define CA_PROTO_SIGNAL 25u /* knock the server out of select */
|
||||
#define CA_PROTO_CREATE_CH_FAIL 26u /* unable to create chan resource in server */
|
||||
#define CA_PROTO_SERVER_DISCONN 27u /* server deletes PV (or channel) */
|
||||
|
||||
#define CA_PROTO_LAST_CMMD CA_PROTO_SERVER_DISCONN
|
||||
|
||||
/*
|
||||
* for use with search and not_found (if search fails and
|
||||
* its not a broadcast tell the client to look elesewhere)
|
||||
*/
|
||||
#define DOREPLY 10u
|
||||
#define DONTREPLY 5u
|
||||
|
||||
/*
|
||||
* for use with the m_dataType field in UDP messages emitted by servers
|
||||
*/
|
||||
#define sequenceNoIsValid 1
|
||||
|
||||
/* size of object in bytes rounded up to nearest oct word */
|
||||
#define OCT_ROUND(A) (((A)+7)/8)
|
||||
#define OCT_SIZEOF(A) (OCT_ROUND(sizeof(A)))
|
||||
|
||||
/* size of object in bytes rounded up to nearest long word */
|
||||
#define QUAD_ROUND(A) ((A)+3)/4)
|
||||
#define QUAD_SIZEOF(A) (QUAD_ROUND(sizeof(A)))
|
||||
|
||||
/* size of object in bytes rounded up to nearest short word */
|
||||
#define BI_ROUND(A) (((A)+1)/2)
|
||||
#define BI_SIZEOF(A) (BI_ROUND(sizeof(A)))
|
||||
|
||||
/*
|
||||
* For communicating access rights to the clients
|
||||
*
|
||||
* (placed in m_available hdr field of CA_PROTO_ACCESS_RIGHTS cmmd
|
||||
*/
|
||||
#define CA_PROTO_ACCESS_RIGHT_READ (1u<<0u)
|
||||
#define CA_PROTO_ACCESS_RIGHT_WRITE (1u<<1u)
|
||||
|
||||
/*
|
||||
* All structures passed in the protocol must have individual
|
||||
* fields aligned on natural boundaries.
|
||||
*
|
||||
* NOTE: all structures declared in this file must have a
|
||||
* byte count which is evenly divisible by 8 matching
|
||||
* the largest atomic data type in db_access.h.
|
||||
*/
|
||||
#define CA_MESSAGE_ALIGN(A) (OCT_ROUND(A)<<3u)
|
||||
|
||||
/*
|
||||
* the common part of each message sent/recv by the
|
||||
* CA server.
|
||||
*/
|
||||
typedef struct ca_hdr {
|
||||
ca_uint16_t m_cmmd; /* operation to be performed */
|
||||
ca_uint16_t m_postsize; /* size of payload */
|
||||
ca_uint16_t m_dataType; /* operation data type */
|
||||
ca_uint16_t m_count; /* operation data count */
|
||||
ca_uint32_t m_cid; /* channel identifier */
|
||||
ca_uint32_t m_available; /* protocol stub dependent */
|
||||
} caHdr;
|
||||
|
||||
/*
|
||||
* for monitor (event) message extension
|
||||
*/
|
||||
struct mon_info {
|
||||
ca_float32_t m_lval; /* low delta */
|
||||
ca_float32_t m_hval; /* high delta */
|
||||
ca_float32_t m_toval; /* period btween samples */
|
||||
ca_uint16_t m_mask; /* event select mask */
|
||||
ca_uint16_t m_pad; /* extend to 32 bits */
|
||||
};
|
||||
|
||||
/*
|
||||
* PV names greater than this length assumed to be invalid
|
||||
*/
|
||||
#define unreasonablePVNameSize 500u
|
||||
|
||||
#endif /* __CAPROTO__ */
|
||||
|
||||
42
src/ca/client/caRepeater.cpp
Normal file
42
src/ca/client/caRepeater.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
*
|
||||
* CA UDP repeater standalone executable
|
||||
*
|
||||
* Author: Jeff Hill
|
||||
* Date: 3-27-90
|
||||
*
|
||||
* PURPOSE:
|
||||
* Broadcasts fan out over the LAN, but old IP kernels do not allow
|
||||
* two processes on the same machine to get the same broadcast
|
||||
* (and modern IP kernels do not allow two processes on the same machine
|
||||
* to receive the same unicast).
|
||||
*
|
||||
* This code fans out UDP messages sent to the CA repeater port
|
||||
* to all CA client processes that have subscribed.
|
||||
*
|
||||
* NOTES:
|
||||
*
|
||||
* see repeater.c
|
||||
*
|
||||
*/
|
||||
|
||||
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
|
||||
|
||||
#include "epicsAssert.h"
|
||||
#include "udpiiu.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
ca_repeater ();
|
||||
return ( 0 );
|
||||
}
|
||||
|
||||
25
src/ca/client/caRepeater.service@
Normal file
25
src/ca/client/caRepeater.service@
Normal file
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# Linux systemd service file for the EPICS CA Repeater
|
||||
#
|
||||
# To install this file, as root:
|
||||
# cp caRepeater.service /etc/systemd/system
|
||||
# chmod 664 /etc/systemd/system/caRepeater.service
|
||||
# systemctl daemon-reload
|
||||
# systemctl enable caRepeater
|
||||
# systemctl start caRepeater
|
||||
#
|
||||
# To check the status:
|
||||
# systemctl status caRepeater
|
||||
|
||||
[Unit]
|
||||
Description=EPICS CA Repeater
|
||||
Requires=network.target
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=@INSTALL_BIN@/caRepeater
|
||||
Restart=always
|
||||
User=daemon
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
88
src/ca/client/caServerID.h
Normal file
88
src/ca/client/caServerID.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
* Author: Jeff Hill
|
||||
*/
|
||||
|
||||
#ifndef caServerIDh
|
||||
#define caServerIDh
|
||||
|
||||
#include "osiSock.h"
|
||||
#include "resourceLib.h"
|
||||
#include "caProto.h"
|
||||
|
||||
class caServerID {
|
||||
public:
|
||||
caServerID ( const struct sockaddr_in & addrIn, unsigned priority );
|
||||
bool operator == ( const caServerID & ) const;
|
||||
resTableIndex hash () const;
|
||||
osiSockAddr address () const;
|
||||
unsigned priority () const;
|
||||
private:
|
||||
struct sockaddr_in addr;
|
||||
ca_uint8_t pri;
|
||||
};
|
||||
|
||||
inline caServerID::caServerID (
|
||||
const struct sockaddr_in & addrIn, unsigned priorityIn ) :
|
||||
addr ( addrIn ), pri ( static_cast <ca_uint8_t> ( priorityIn ) )
|
||||
{
|
||||
assert ( priorityIn <= 0xff );
|
||||
}
|
||||
|
||||
inline bool caServerID::operator == ( const caServerID & rhs ) const
|
||||
{
|
||||
if ( this->addr.sin_addr.s_addr == rhs.addr.sin_addr.s_addr &&
|
||||
this->addr.sin_port == rhs.addr.sin_port &&
|
||||
this->pri == rhs.pri ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
inline resTableIndex caServerID::hash () const
|
||||
{
|
||||
// start with a very small server table to speed
|
||||
// up the flush traverse for the frequent case -
|
||||
// a small numbers of servers
|
||||
const unsigned caServerMinIndexBitWidth = 2u;
|
||||
const unsigned caServerMaxIndexBitWidth = 32u;
|
||||
|
||||
unsigned index;
|
||||
index = this->addr.sin_addr.s_addr;
|
||||
index ^= this->addr.sin_port;
|
||||
index ^= this->addr.sin_port >> 8u;
|
||||
index ^= this->pri;
|
||||
return integerHash ( caServerMinIndexBitWidth,
|
||||
caServerMaxIndexBitWidth, index );
|
||||
}
|
||||
|
||||
inline osiSockAddr caServerID::address () const
|
||||
{
|
||||
osiSockAddr tmp;
|
||||
tmp.ia = this->addr;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
inline unsigned caServerID::priority () const
|
||||
{
|
||||
return this->pri;
|
||||
}
|
||||
|
||||
#endif // ifdef caServerID
|
||||
|
||||
|
||||
811
src/ca/client/ca_client_context.cpp
Normal file
811
src/ca/client/ca_client_context.cpp
Normal file
@@ -0,0 +1,811 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(disable:4355)
|
||||
#endif
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string> // vxWorks 6.0 requires this include
|
||||
#include <stdio.h>
|
||||
|
||||
#include "epicsExit.h"
|
||||
#include "errlog.h"
|
||||
#include "locationException.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "iocinf.h"
|
||||
#include "oldAccess.h"
|
||||
#include "cac.h"
|
||||
|
||||
epicsShareDef epicsThreadPrivateId caClientCallbackThreadId;
|
||||
|
||||
static epicsThreadOnceId cacOnce = EPICS_THREAD_ONCE_INIT;
|
||||
|
||||
const unsigned ca_client_context :: flushBlockThreshold = 0x58000;
|
||||
|
||||
extern "C" void cacExitHandler ( void *)
|
||||
{
|
||||
epicsThreadPrivateDelete ( caClientCallbackThreadId );
|
||||
caClientCallbackThreadId = 0;
|
||||
delete ca_client_context::pDefaultServiceInstallMutex;
|
||||
}
|
||||
|
||||
// runs once only for each process
|
||||
extern "C" void cacOnceFunc ( void * )
|
||||
{
|
||||
caClientCallbackThreadId = epicsThreadPrivateCreate ();
|
||||
assert ( caClientCallbackThreadId );
|
||||
ca_client_context::pDefaultServiceInstallMutex = newEpicsMutex;
|
||||
epicsAtExit ( cacExitHandler,0 );
|
||||
}
|
||||
|
||||
extern epicsThreadPrivateId caClientContextId;
|
||||
|
||||
cacService * ca_client_context::pDefaultService = 0;
|
||||
epicsMutex * ca_client_context::pDefaultServiceInstallMutex;
|
||||
|
||||
ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) :
|
||||
createdByThread ( epicsThreadGetIdSelf () ),
|
||||
ca_exception_func ( 0 ), ca_exception_arg ( 0 ),
|
||||
pVPrintfFunc ( errlogVprintf ), fdRegFunc ( 0 ), fdRegArg ( 0 ),
|
||||
pndRecvCnt ( 0u ), ioSeqNo ( 0u ), callbackThreadsPending ( 0u ),
|
||||
localPort ( 0 ), fdRegFuncNeedsToBeCalled ( false ),
|
||||
noWakeupSincePend ( true )
|
||||
{
|
||||
static const unsigned short PORT_ANY = 0u;
|
||||
|
||||
if ( ! osiSockAttach () ) {
|
||||
throwWithLocation ( noSocket () );
|
||||
}
|
||||
|
||||
epicsThreadOnce ( & cacOnce, cacOnceFunc, 0 );
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( *ca_client_context::pDefaultServiceInstallMutex );
|
||||
if ( ca_client_context::pDefaultService ) {
|
||||
this->pServiceContext.reset (
|
||||
& ca_client_context::pDefaultService->contextCreate (
|
||||
this->mutex, this->cbMutex, *this ) );
|
||||
}
|
||||
else {
|
||||
this->pServiceContext.reset ( new cac ( this->mutex, this->cbMutex, *this ) );
|
||||
}
|
||||
}
|
||||
|
||||
this->sock = epicsSocketCreate ( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
|
||||
if ( this->sock == INVALID_SOCKET ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
this->printFormated (
|
||||
"ca_client_context: unable to create "
|
||||
"datagram socket because = \"%s\"\n",
|
||||
sockErrBuf );
|
||||
throwWithLocation ( noSocket () );
|
||||
}
|
||||
|
||||
{
|
||||
osiSockIoctl_t yes = true;
|
||||
int status = socket_ioctl ( this->sock,
|
||||
FIONBIO, & yes);
|
||||
if ( status < 0 ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
epicsSocketDestroy ( this->sock );
|
||||
this->printFormated (
|
||||
"%s: non blocking IO set fail because \"%s\"\n",
|
||||
__FILE__, sockErrBuf );
|
||||
throwWithLocation ( noSocket () );
|
||||
}
|
||||
}
|
||||
|
||||
// force a bind to an unconstrained address so we can obtain
|
||||
// the local port number below
|
||||
{
|
||||
osiSockAddr addr;
|
||||
memset ( (char *)&addr, 0 , sizeof ( addr ) );
|
||||
addr.ia.sin_family = AF_INET;
|
||||
addr.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
|
||||
addr.ia.sin_port = htons ( PORT_ANY );
|
||||
int status = bind (this->sock, &addr.sa, sizeof (addr) );
|
||||
if ( status < 0 ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
epicsSocketDestroy (this->sock);
|
||||
this->printFormated (
|
||||
"CAC: unable to bind to an unconstrained "
|
||||
"address because = \"%s\"\n",
|
||||
sockErrBuf );
|
||||
throwWithLocation ( noSocket () );
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
osiSockAddr tmpAddr;
|
||||
osiSocklen_t saddr_length = sizeof ( tmpAddr );
|
||||
int status = getsockname ( this->sock, & tmpAddr.sa, & saddr_length );
|
||||
if ( status < 0 ) {
|
||||
char sockErrBuf[64];
|
||||
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
|
||||
epicsSocketDestroy ( this->sock );
|
||||
this->printFormated ( "CAC: getsockname () error was \"%s\"\n", sockErrBuf );
|
||||
throwWithLocation ( noSocket () );
|
||||
}
|
||||
if ( tmpAddr.sa.sa_family != AF_INET) {
|
||||
epicsSocketDestroy ( this->sock );
|
||||
this->printFormated ( "CAC: UDP socket was not inet addr family\n" );
|
||||
throwWithLocation ( noSocket () );
|
||||
}
|
||||
this->localPort = htons ( tmpAddr.ia.sin_port );
|
||||
}
|
||||
|
||||
std::auto_ptr < CallbackGuard > pCBGuard;
|
||||
if ( ! enablePreemptiveCallback ) {
|
||||
pCBGuard.reset ( new CallbackGuard ( this->cbMutex ) );
|
||||
}
|
||||
|
||||
// multiple steps ensure exception safety
|
||||
this->pCallbackGuard = pCBGuard;
|
||||
}
|
||||
|
||||
ca_client_context::~ca_client_context ()
|
||||
{
|
||||
if ( this->fdRegFunc ) {
|
||||
( *this->fdRegFunc )
|
||||
( this->fdRegArg, this->sock, false );
|
||||
}
|
||||
epicsSocketDestroy ( this->sock );
|
||||
|
||||
osiSockRelease ();
|
||||
|
||||
// force a logical shutdown order
|
||||
// so that the cac class does not hang its
|
||||
// receive threads during their shutdown sequence
|
||||
// and so that classes using this classes mutex
|
||||
// are destroyed before the mutex is destroyed
|
||||
if ( this->pCallbackGuard.get() ) {
|
||||
epicsGuardRelease < epicsMutex > unguard ( *this->pCallbackGuard );
|
||||
this->pServiceContext.reset ( 0 );
|
||||
}
|
||||
else {
|
||||
this->pServiceContext.reset ( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
void ca_client_context::destroyGetCopy (
|
||||
epicsGuard < epicsMutex > & guard, getCopy & gc )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
gc.~getCopy ();
|
||||
this->getCopyFreeList.release ( & gc );
|
||||
}
|
||||
|
||||
void ca_client_context::destroyGetCallback (
|
||||
epicsGuard < epicsMutex > & guard, getCallback & gcb )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
gcb.~getCallback ();
|
||||
this->getCallbackFreeList.release ( & gcb );
|
||||
}
|
||||
|
||||
void ca_client_context::destroyPutCallback (
|
||||
epicsGuard < epicsMutex > & guard, putCallback & pcb )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
pcb.~putCallback ();
|
||||
this->putCallbackFreeList.release ( & pcb );
|
||||
}
|
||||
|
||||
void ca_client_context::destroySubscription (
|
||||
epicsGuard < epicsMutex > & guard, oldSubscription & os )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
os.~oldSubscription ();
|
||||
this->subscriptionFreeList.release ( & os );
|
||||
}
|
||||
|
||||
void ca_client_context::changeExceptionEvent (
|
||||
caExceptionHandler * pfunc, void * arg )
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
this->ca_exception_func = pfunc;
|
||||
this->ca_exception_arg = arg;
|
||||
// should block here until releated callback in progress completes
|
||||
}
|
||||
|
||||
void ca_client_context::replaceErrLogHandler (
|
||||
caPrintfFunc * ca_printf_func )
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
if ( ca_printf_func ) {
|
||||
this->pVPrintfFunc = ca_printf_func;
|
||||
}
|
||||
else {
|
||||
this->pVPrintfFunc = epicsVprintf;
|
||||
}
|
||||
// should block here until releated callback in progress completes
|
||||
}
|
||||
|
||||
void ca_client_context::registerForFileDescriptorCallBack (
|
||||
CAFDHANDLER *pFunc, void *pArg )
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
this->fdRegFunc = pFunc;
|
||||
this->fdRegArg = pArg;
|
||||
this->fdRegFuncNeedsToBeCalled = true;
|
||||
if ( pFunc ) {
|
||||
// the receive thread might already be blocking
|
||||
// w/o having sent the wakeup message
|
||||
this->_sendWakeupMsg ();
|
||||
}
|
||||
// should block here until releated callback in progress completes
|
||||
}
|
||||
|
||||
int ca_client_context :: printFormated (
|
||||
const char *pformat, ... ) const
|
||||
{
|
||||
va_list theArgs;
|
||||
int status;
|
||||
|
||||
va_start ( theArgs, pformat );
|
||||
|
||||
status = this->ca_client_context :: varArgsPrintFormated ( pformat, theArgs );
|
||||
|
||||
va_end ( theArgs );
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int ca_client_context :: varArgsPrintFormated (
|
||||
const char *pformat, va_list args ) const
|
||||
{
|
||||
caPrintfFunc * pFunc;
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
pFunc = this->pVPrintfFunc;
|
||||
}
|
||||
if ( pFunc ) {
|
||||
return ( *pFunc ) ( pformat, args );
|
||||
}
|
||||
else {
|
||||
return :: vfprintf ( stderr, pformat, args );
|
||||
}
|
||||
}
|
||||
|
||||
void ca_client_context::exception (
|
||||
epicsGuard < epicsMutex > & guard, int stat, const char * pCtx,
|
||||
const char * pFile, unsigned lineNo )
|
||||
{
|
||||
struct exception_handler_args args;
|
||||
caExceptionHandler * pFunc = this->ca_exception_func;
|
||||
void * pArg = this->ca_exception_arg;
|
||||
{
|
||||
epicsGuardRelease < epicsMutex > unguard ( guard );
|
||||
// NOOP if they disable exceptions
|
||||
if ( pFunc ) {
|
||||
args.chid = NULL;
|
||||
args.type = TYPENOTCONN;
|
||||
args.count = 0;
|
||||
args.addr = NULL;
|
||||
args.stat = stat;
|
||||
args.op = CA_OP_OTHER;
|
||||
args.ctx = pCtx;
|
||||
args.pFile = pFile;
|
||||
args.lineNo = lineNo;
|
||||
args.usr = pArg;
|
||||
( *pFunc ) ( args );
|
||||
}
|
||||
else {
|
||||
this->signal ( stat, pFile, lineNo, pCtx );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ca_client_context::exception (
|
||||
epicsGuard < epicsMutex > & guard, int status, const char * pContext,
|
||||
const char * pFileName, unsigned lineNo, oldChannelNotify & chan,
|
||||
unsigned type, arrayElementCount count, unsigned op )
|
||||
{
|
||||
struct exception_handler_args args;
|
||||
caExceptionHandler * pFunc = this->ca_exception_func;
|
||||
void * pArg = this->ca_exception_arg;
|
||||
{
|
||||
epicsGuardRelease < epicsMutex > unguard ( guard );
|
||||
// NOOP if they disable exceptions
|
||||
if ( pFunc ) {
|
||||
args.chid = &chan;
|
||||
args.type = type;
|
||||
args.count = count;
|
||||
args.addr = NULL;
|
||||
args.stat = status;
|
||||
args.op = op;
|
||||
args.ctx = pContext;
|
||||
args.pFile = pFileName;
|
||||
args.lineNo = lineNo;
|
||||
args.usr = pArg;
|
||||
( *pFunc ) ( args );
|
||||
}
|
||||
else {
|
||||
this->signal ( status, pFileName, lineNo,
|
||||
"op=%u, channel=%s, type=%s, count=%lu, ctx=\"%s\"",
|
||||
op, ca_name ( &chan ),
|
||||
dbr_type_to_text ( static_cast <int> ( type ) ),
|
||||
count, pContext );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ca_client_context::signal ( int ca_status, const char * pfilenm,
|
||||
int lineno, const char * pFormat, ... )
|
||||
{
|
||||
va_list theArgs;
|
||||
va_start ( theArgs, pFormat );
|
||||
this->vSignal ( ca_status, pfilenm, lineno, pFormat, theArgs);
|
||||
va_end ( theArgs );
|
||||
}
|
||||
|
||||
void ca_client_context :: vSignal (
|
||||
int ca_status, const char *pfilenm,
|
||||
int lineno, const char *pFormat, va_list args )
|
||||
{
|
||||
static const char *severity[] =
|
||||
{
|
||||
"Warning",
|
||||
"Success",
|
||||
"Error",
|
||||
"Info",
|
||||
"Fatal",
|
||||
"Fatal",
|
||||
"Fatal",
|
||||
"Fatal"
|
||||
};
|
||||
|
||||
this->printFormated ( "CA.Client.Exception...............................................\n" );
|
||||
|
||||
this->printFormated ( " %s: \"%s\"\n",
|
||||
severity[ CA_EXTRACT_SEVERITY ( ca_status ) ],
|
||||
ca_message ( ca_status ) );
|
||||
|
||||
if ( pFormat ) {
|
||||
this->printFormated ( " Context: \"" );
|
||||
this->varArgsPrintFormated ( pFormat, args );
|
||||
this->printFormated ( "\"\n" );
|
||||
}
|
||||
|
||||
if ( pfilenm ) {
|
||||
this->printFormated ( " Source File: %s line %d\n",
|
||||
pfilenm, lineno );
|
||||
}
|
||||
|
||||
epicsTime current = epicsTime::getCurrent ();
|
||||
char date[64];
|
||||
current.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S.%f");
|
||||
this->printFormated ( " Current Time: %s\n", date );
|
||||
|
||||
/*
|
||||
* Terminate execution if unsuccessful
|
||||
*/
|
||||
if( ! ( ca_status & CA_M_SUCCESS ) &&
|
||||
CA_EXTRACT_SEVERITY ( ca_status ) != CA_K_WARNING ){
|
||||
errlogFlush ();
|
||||
abort ();
|
||||
}
|
||||
|
||||
this->printFormated ( "..................................................................\n" );
|
||||
}
|
||||
|
||||
void ca_client_context::show ( unsigned level ) const
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
|
||||
::printf ( "ca_client_context at %p pndRecvCnt=%u ioSeqNo=%u\n",
|
||||
static_cast <const void *> ( this ),
|
||||
this->pndRecvCnt, this->ioSeqNo );
|
||||
|
||||
if ( level > 0u ) {
|
||||
this->pServiceContext->show ( guard, level - 1u );
|
||||
::printf ( "\tpreemptive callback is %s\n",
|
||||
this->pCallbackGuard.get() ? "disabled" : "enabled" );
|
||||
::printf ( "\tthere are %u unsatisfied IO operations blocking ca_pend_io()\n",
|
||||
this->pndRecvCnt );
|
||||
::printf ( "\tthe current io sequence number is %u\n",
|
||||
this->ioSeqNo );
|
||||
::printf ( "IO done event:\n");
|
||||
this->ioDone.show ( level - 1u );
|
||||
::printf ( "Synchronous group identifier hash table:\n" );
|
||||
this->sgTable.show ( level - 1u );
|
||||
}
|
||||
}
|
||||
|
||||
void ca_client_context::attachToClientCtx ()
|
||||
{
|
||||
assert ( ! epicsThreadPrivateGet ( caClientContextId ) );
|
||||
epicsThreadPrivateSet ( caClientContextId, this );
|
||||
}
|
||||
|
||||
void ca_client_context::incrementOutstandingIO (
|
||||
epicsGuard < epicsMutex > & guard, unsigned ioSeqNoIn )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
if ( this->ioSeqNo == ioSeqNoIn ) {
|
||||
assert ( this->pndRecvCnt < UINT_MAX );
|
||||
this->pndRecvCnt++;
|
||||
}
|
||||
}
|
||||
|
||||
void ca_client_context::decrementOutstandingIO (
|
||||
epicsGuard < epicsMutex > & guard, unsigned ioSeqNoIn )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
if ( this->ioSeqNo == ioSeqNoIn ) {
|
||||
assert ( this->pndRecvCnt > 0u );
|
||||
this->pndRecvCnt--;
|
||||
if ( this->pndRecvCnt == 0u ) {
|
||||
this->ioDone.signal ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// !!!! This routine is only visible in the old interface - or in a new ST interface.
|
||||
// !!!! In the old interface we restrict thread attach so that calls from threads
|
||||
// !!!! other than the initializing thread are not allowed if preemptive callback
|
||||
// !!!! is disabled. This prevents the preemptive callback lock from being released
|
||||
// !!!! by other threads than the one that locked it.
|
||||
//
|
||||
int ca_client_context::pendIO ( const double & timeout )
|
||||
{
|
||||
// prevent recursion nightmares by disabling calls to
|
||||
// pendIO () from within a CA callback.
|
||||
if ( epicsThreadPrivateGet ( caClientCallbackThreadId ) ) {
|
||||
return ECA_EVDISALLOW;
|
||||
}
|
||||
|
||||
int status = ECA_NORMAL;
|
||||
epicsTime beg_time = epicsTime::getCurrent ();
|
||||
double remaining = timeout;
|
||||
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
|
||||
this->flush ( guard );
|
||||
|
||||
while ( this->pndRecvCnt > 0 ) {
|
||||
if ( remaining < CAC_SIGNIFICANT_DELAY ) {
|
||||
status = ECA_TIMEOUT;
|
||||
break;
|
||||
}
|
||||
|
||||
{
|
||||
epicsGuardRelease < epicsMutex > unguard ( guard );
|
||||
this->blockForEventAndEnableCallbacks ( this->ioDone, remaining );
|
||||
}
|
||||
|
||||
double delay = epicsTime::getCurrent () - beg_time;
|
||||
if ( delay < timeout ) {
|
||||
remaining = timeout - delay;
|
||||
}
|
||||
else {
|
||||
remaining = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
this->ioSeqNo++;
|
||||
this->pndRecvCnt = 0u;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
// !!!! This routine is only visible in the old interface - or in a new ST interface.
|
||||
// !!!! In the old interface we restrict thread attach so that calls from threads
|
||||
// !!!! other than the initializing thread are not allowed if preemptive callback
|
||||
// !!!! is disabled. This prevents the preemptive callback lock from being released
|
||||
// !!!! by other threads than the one that locked it.
|
||||
//
|
||||
int ca_client_context::pendEvent ( const double & timeout )
|
||||
{
|
||||
// prevent recursion nightmares by disabling calls to
|
||||
// pendIO () from within a CA callback.
|
||||
if ( epicsThreadPrivateGet ( caClientCallbackThreadId ) ) {
|
||||
return ECA_EVDISALLOW;
|
||||
}
|
||||
|
||||
epicsTime current = epicsTime::getCurrent ();
|
||||
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
this->flush ( guard );
|
||||
}
|
||||
|
||||
// process at least once if preemptive callback is disabled
|
||||
if ( this->pCallbackGuard.get() ) {
|
||||
epicsGuardRelease < epicsMutex > cbUnguard ( *this->pCallbackGuard );
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
|
||||
//
|
||||
// This is needed because in non-preemptive callback mode
|
||||
// legacy applications that use file descriptor managers
|
||||
// will register for ca receive thread activity and keep
|
||||
// calling ca_pend_event until all of the socket data has
|
||||
// been read. We must guarantee that other threads get a
|
||||
// chance to run if there is data in any of the sockets.
|
||||
//
|
||||
if ( this->fdRegFunc ) {
|
||||
epicsGuardRelease < epicsMutex > unguard ( guard );
|
||||
|
||||
// remove short udp message sent to wake
|
||||
// up a file descriptor manager
|
||||
osiSockAddr tmpAddr;
|
||||
osiSocklen_t addrSize = sizeof ( tmpAddr.sa );
|
||||
char buf = 0;
|
||||
int status = 0;
|
||||
do {
|
||||
status = recvfrom ( this->sock, & buf, sizeof ( buf ),
|
||||
0, & tmpAddr.sa, & addrSize );
|
||||
} while ( status > 0 );
|
||||
}
|
||||
while ( this->callbackThreadsPending > 0 ) {
|
||||
epicsGuardRelease < epicsMutex > unguard ( guard );
|
||||
this->callbackThreadActivityComplete.wait ( 30.0 );
|
||||
}
|
||||
this->noWakeupSincePend = true;
|
||||
}
|
||||
|
||||
double elapsed = epicsTime::getCurrent() - current;
|
||||
double delay;
|
||||
|
||||
if ( timeout > elapsed ) {
|
||||
delay = timeout - elapsed;
|
||||
}
|
||||
else {
|
||||
delay = 0.0;
|
||||
}
|
||||
|
||||
if ( delay >= CAC_SIGNIFICANT_DELAY ) {
|
||||
if ( this->pCallbackGuard.get() ) {
|
||||
epicsGuardRelease < epicsMutex > unguard ( *this->pCallbackGuard );
|
||||
epicsThreadSleep ( delay );
|
||||
}
|
||||
else {
|
||||
epicsThreadSleep ( delay );
|
||||
}
|
||||
}
|
||||
|
||||
return ECA_TIMEOUT;
|
||||
}
|
||||
|
||||
void ca_client_context::blockForEventAndEnableCallbacks (
|
||||
epicsEvent & event, const double & timeout )
|
||||
{
|
||||
if ( this->pCallbackGuard.get() ) {
|
||||
epicsGuardRelease < epicsMutex > unguard ( *this->pCallbackGuard );
|
||||
event.wait ( timeout );
|
||||
}
|
||||
else {
|
||||
event.wait ( timeout );
|
||||
}
|
||||
}
|
||||
|
||||
void ca_client_context::callbackProcessingInitiateNotify ()
|
||||
{
|
||||
// if preemptive callback is enabled then this is a noop
|
||||
if ( this->pCallbackGuard.get() ) {
|
||||
bool sendNeeded = false;
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
this->callbackThreadsPending++;
|
||||
if ( this->fdRegFunc && this->noWakeupSincePend ) {
|
||||
this->noWakeupSincePend = false;
|
||||
sendNeeded = true;
|
||||
}
|
||||
}
|
||||
if ( sendNeeded ) {
|
||||
_sendWakeupMsg ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ca_client_context :: _sendWakeupMsg ()
|
||||
{
|
||||
// send short udp message to wake up a file descriptor manager
|
||||
// when a message arrives
|
||||
osiSockAddr tmpAddr;
|
||||
tmpAddr.ia.sin_family = AF_INET;
|
||||
tmpAddr.ia.sin_addr.s_addr = htonl ( INADDR_LOOPBACK );
|
||||
tmpAddr.ia.sin_port = htons ( this->localPort );
|
||||
char buf = 0;
|
||||
sendto ( this->sock, & buf, sizeof ( buf ),
|
||||
0, & tmpAddr.sa, sizeof ( tmpAddr.sa ) );
|
||||
}
|
||||
|
||||
void ca_client_context::callbackProcessingCompleteNotify ()
|
||||
{
|
||||
// if preemptive callback is enabled then this is a noop
|
||||
if ( this->pCallbackGuard.get() ) {
|
||||
bool signalNeeded = false;
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
if ( this->callbackThreadsPending <= 1 ) {
|
||||
if ( this->callbackThreadsPending == 1 ) {
|
||||
this->callbackThreadsPending = 0;
|
||||
signalNeeded = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
this->callbackThreadsPending--;
|
||||
}
|
||||
}
|
||||
if ( signalNeeded ) {
|
||||
this->callbackThreadActivityComplete.signal ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cacChannel & ca_client_context::createChannel (
|
||||
epicsGuard < epicsMutex > & guard, const char * pChannelName,
|
||||
cacChannelNotify & chan, cacChannel::priLev pri )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
return this->pServiceContext->createChannel (
|
||||
guard, pChannelName, chan, pri );
|
||||
}
|
||||
|
||||
void ca_client_context::flush ( epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
this->pServiceContext->flush ( guard );
|
||||
}
|
||||
|
||||
unsigned ca_client_context::circuitCount () const
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
return this->pServiceContext->circuitCount ( guard );
|
||||
}
|
||||
|
||||
unsigned ca_client_context::beaconAnomaliesSinceProgramStart () const
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
return this->pServiceContext->beaconAnomaliesSinceProgramStart ( guard );
|
||||
}
|
||||
|
||||
void ca_client_context::installCASG (
|
||||
epicsGuard < epicsMutex > & guard, CASG & sg )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
this->sgTable.idAssignAdd ( sg );
|
||||
}
|
||||
|
||||
void ca_client_context::uninstallCASG (
|
||||
epicsGuard < epicsMutex > & guard, CASG & sg )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
this->sgTable.remove ( sg );
|
||||
}
|
||||
|
||||
CASG * ca_client_context::lookupCASG (
|
||||
epicsGuard < epicsMutex > & guard, unsigned idIn )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
CASG * psg = this->sgTable.lookup ( idIn );
|
||||
if ( psg ) {
|
||||
if ( ! psg->verify ( guard ) ) {
|
||||
psg = 0;
|
||||
}
|
||||
}
|
||||
return psg;
|
||||
}
|
||||
|
||||
void ca_client_context::selfTest () const
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( this->mutex );
|
||||
this->sgTable.verify ();
|
||||
this->pServiceContext->selfTest ( guard );
|
||||
}
|
||||
|
||||
epicsMutex & ca_client_context::mutexRef () const
|
||||
{
|
||||
return this->mutex;
|
||||
}
|
||||
|
||||
cacContext & ca_client_context::createNetworkContext (
|
||||
epicsMutex & mutexIn, epicsMutex & cbMutexIn )
|
||||
{
|
||||
return * new cac ( mutexIn, cbMutexIn, *this );
|
||||
}
|
||||
|
||||
void ca_client_context::installDefaultService ( cacService & service )
|
||||
{
|
||||
epicsThreadOnce ( & cacOnce, cacOnceFunc, 0 );
|
||||
|
||||
epicsGuard < epicsMutex > guard ( *ca_client_context::pDefaultServiceInstallMutex );
|
||||
if ( ca_client_context::pDefaultService ) {
|
||||
throw std::logic_error
|
||||
( "CA in-memory service already installed and can't be replaced");
|
||||
}
|
||||
ca_client_context::pDefaultService = & service;
|
||||
}
|
||||
|
||||
void epicsShareAPI caInstallDefaultService ( cacService & service )
|
||||
{
|
||||
ca_client_context::installDefaultService ( service );
|
||||
}
|
||||
|
||||
epicsShareFunc int epicsShareAPI ca_clear_subscription ( evid pMon )
|
||||
{
|
||||
oldChannelNotify & chan = pMon->channel ();
|
||||
ca_client_context & cac = chan.getClientCtx ();
|
||||
// !!!! the order in which we take the mutex here prevents deadlocks
|
||||
{
|
||||
epicsGuard < epicsMutex > guard ( cac.mutex );
|
||||
try {
|
||||
// if this stalls out on a live circuit then an exception
|
||||
// can be forthcoming which we must ignore as the clear
|
||||
// request must always be successful
|
||||
chan.eliminateExcessiveSendBacklog ( guard );
|
||||
}
|
||||
catch ( cacChannel::notConnected & ) {
|
||||
// intentionally ignored
|
||||
}
|
||||
}
|
||||
if ( cac.pCallbackGuard.get() &&
|
||||
cac.createdByThread == epicsThreadGetIdSelf () ) {
|
||||
epicsGuard < epicsMutex > guard ( cac.mutex );
|
||||
pMon->cancel ( *cac.pCallbackGuard.get(), guard );
|
||||
}
|
||||
else {
|
||||
//
|
||||
// we will definately stall out here if all of the
|
||||
// following are true
|
||||
//
|
||||
// o user creates non-preemtive mode client library context
|
||||
// o user doesnt periodically call a ca function
|
||||
// o user calls this function from an auxiillary thread
|
||||
//
|
||||
CallbackGuard cbGuard ( cac.cbMutex );
|
||||
epicsGuard < epicsMutex > guard ( cac.mutex );
|
||||
pMon->cancel ( cbGuard, guard );
|
||||
}
|
||||
return ECA_NORMAL;
|
||||
}
|
||||
|
||||
void ca_client_context :: eliminateExcessiveSendBacklog (
|
||||
epicsGuard < epicsMutex > & guard, cacChannel & chan )
|
||||
{
|
||||
if ( chan.requestMessageBytesPending ( guard ) >
|
||||
ca_client_context :: flushBlockThreshold ) {
|
||||
if ( this->pCallbackGuard.get() &&
|
||||
this->createdByThread == epicsThreadGetIdSelf () ) {
|
||||
// we need to be very careful about lock hierarchy
|
||||
// inversion in this situation
|
||||
epicsGuardRelease < epicsMutex > unguard ( guard );
|
||||
{
|
||||
epicsGuardRelease < epicsMutex > cbunguard (
|
||||
* this->pCallbackGuard.get() );
|
||||
{
|
||||
epicsGuard < epicsMutex > nestedGuard ( this->mutex );
|
||||
chan.flush ( nestedGuard );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
chan.flush ( guard );
|
||||
}
|
||||
}
|
||||
}
|
||||
1336
src/ca/client/cac.cpp
Normal file
1336
src/ca/client/cac.cpp
Normal file
File diff suppressed because it is too large
Load Diff
435
src/ca/client/cac.h
Normal file
435
src/ca/client/cac.h
Normal file
@@ -0,0 +1,435 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author: Jeff Hill
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef cach
|
||||
#define cach
|
||||
|
||||
#ifdef epicsExportSharedSymbols
|
||||
# define cach_restore_epicsExportSharedSymbols
|
||||
# undef epicsExportSharedSymbols
|
||||
#endif
|
||||
|
||||
#include "compilerDependencies.h"
|
||||
#include "ipAddrToAsciiAsynchronous.h"
|
||||
#include "msgForMultiplyDefinedPV.h"
|
||||
#include "epicsTimer.h"
|
||||
#include "epicsEvent.h"
|
||||
#include "freeList.h"
|
||||
#include "localHostName.h"
|
||||
|
||||
#ifdef cach_restore_epicsExportSharedSymbols
|
||||
# define epicsExportSharedSymbols
|
||||
# include "shareLib.h"
|
||||
#endif
|
||||
|
||||
#include "nciu.h"
|
||||
#include "comBuf.h"
|
||||
#include "bhe.h"
|
||||
#include "cacIO.h"
|
||||
#include "netIO.h"
|
||||
#include "localHostName.h"
|
||||
#include "virtualCircuit.h"
|
||||
|
||||
class netWriteNotifyIO;
|
||||
class netReadNotifyIO;
|
||||
class netSubscription;
|
||||
class tcpiiu;
|
||||
|
||||
// used to control access to cac's recycle routines which
|
||||
// should only be indirectly invoked by CAC when its lock
|
||||
// is applied
|
||||
class cacRecycle {
|
||||
public:
|
||||
virtual void recycleReadNotifyIO (
|
||||
epicsGuard < epicsMutex > &, netReadNotifyIO &io ) = 0;
|
||||
virtual void recycleWriteNotifyIO (
|
||||
epicsGuard < epicsMutex > &, netWriteNotifyIO &io ) = 0;
|
||||
virtual void recycleSubscription (
|
||||
epicsGuard < epicsMutex > &, netSubscription &io ) = 0;
|
||||
protected:
|
||||
virtual ~cacRecycle() {}
|
||||
};
|
||||
|
||||
struct CASG;
|
||||
class inetAddrID;
|
||||
class caServerID;
|
||||
struct caHdrLargeArray;
|
||||
|
||||
class cacComBufMemoryManager : public comBufMemoryManager
|
||||
{
|
||||
public:
|
||||
cacComBufMemoryManager () {}
|
||||
void * allocate ( size_t );
|
||||
void release ( void * );
|
||||
private:
|
||||
tsFreeList < comBuf, 0x20 > freeList;
|
||||
cacComBufMemoryManager ( const cacComBufMemoryManager & );
|
||||
cacComBufMemoryManager & operator = ( const cacComBufMemoryManager & );
|
||||
};
|
||||
|
||||
class notifyGuard {
|
||||
public:
|
||||
notifyGuard ( cacContextNotify & );
|
||||
~notifyGuard ();
|
||||
private:
|
||||
cacContextNotify & notify;
|
||||
notifyGuard ( const notifyGuard & );
|
||||
notifyGuard & operator = ( const notifyGuard & );
|
||||
};
|
||||
|
||||
class callbackManager : public notifyGuard {
|
||||
public:
|
||||
callbackManager (
|
||||
cacContextNotify &,
|
||||
epicsMutex & callbackControl );
|
||||
epicsGuard < epicsMutex > cbGuard;
|
||||
};
|
||||
|
||||
class cac :
|
||||
public cacContext,
|
||||
private cacRecycle,
|
||||
private callbackForMultiplyDefinedPV
|
||||
{
|
||||
public:
|
||||
cac (
|
||||
epicsMutex & mutualExclusion,
|
||||
epicsMutex & callbackControl,
|
||||
cacContextNotify & );
|
||||
virtual ~cac ();
|
||||
|
||||
// beacon management
|
||||
void beaconNotify ( const inetAddrID & addr, const epicsTime & currentTime,
|
||||
ca_uint32_t beaconNumber, unsigned protocolRevision );
|
||||
unsigned beaconAnomaliesSinceProgramStart (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
|
||||
// IO management
|
||||
void flush ( epicsGuard < epicsMutex > & guard );
|
||||
bool executeResponse ( callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, caHdrLargeArray &, char *pMsgBody );
|
||||
|
||||
// channel routines
|
||||
void transferChanToVirtCircuit (
|
||||
unsigned cid, unsigned sid,
|
||||
ca_uint16_t typeCode, arrayElementCount count,
|
||||
unsigned minorVersionNumber, const osiSockAddr &,
|
||||
const epicsTime & currentTime );
|
||||
cacChannel & createChannel (
|
||||
epicsGuard < epicsMutex > & guard, const char * pChannelName,
|
||||
cacChannelNotify &, cacChannel::priLev );
|
||||
void destroyChannel (
|
||||
epicsGuard < epicsMutex > &, nciu & );
|
||||
void initiateConnect (
|
||||
epicsGuard < epicsMutex > &, nciu &, netiiu * & );
|
||||
nciu * lookupChannel (
|
||||
epicsGuard < epicsMutex > &, const cacChannel::ioid & );
|
||||
|
||||
// IO requests
|
||||
netWriteNotifyIO & writeNotifyRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &, privateInterfaceForIO &,
|
||||
unsigned type, arrayElementCount nElem, const void * pValue,
|
||||
cacWriteNotify & );
|
||||
netReadNotifyIO & readNotifyRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &, privateInterfaceForIO &,
|
||||
unsigned type, arrayElementCount nElem,
|
||||
cacReadNotify & );
|
||||
netSubscription & subscriptionRequest (
|
||||
epicsGuard < epicsMutex > &, nciu &, privateInterfaceForIO &,
|
||||
unsigned type, arrayElementCount nElem, unsigned mask,
|
||||
cacStateNotify &, bool channelIsInstalled );
|
||||
bool destroyIO (
|
||||
CallbackGuard & callbackGuard,
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard,
|
||||
const cacChannel::ioid & idIn,
|
||||
nciu & chan );
|
||||
void disconnectAllIO (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
nciu &, tsDLList < baseNMIU > & ioList );
|
||||
|
||||
void ioShow (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
const cacChannel::ioid &id, unsigned level ) const;
|
||||
|
||||
// exception generation
|
||||
void exception (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
int status, const char * pContext,
|
||||
const char * pFileName, unsigned lineNo );
|
||||
|
||||
// search destination management
|
||||
void registerSearchDest (
|
||||
epicsGuard < epicsMutex > &, SearchDest & req );
|
||||
bool findOrCreateVirtCircuit (
|
||||
epicsGuard < epicsMutex > &, const osiSockAddr &,
|
||||
unsigned, tcpiiu *&, unsigned, SearchDestTCP * pSearchDest = NULL );
|
||||
|
||||
// diagnostics
|
||||
unsigned circuitCount ( epicsGuard < epicsMutex > & ) const;
|
||||
void show ( epicsGuard < epicsMutex > &, unsigned level ) const;
|
||||
int printFormated (
|
||||
epicsGuard < epicsMutex > & callbackControl,
|
||||
const char *pformat, ... ) const;
|
||||
int varArgsPrintFormated (
|
||||
epicsGuard < epicsMutex > & callbackControl,
|
||||
const char *pformat, va_list args ) const;
|
||||
double connectionTimeout ( epicsGuard < epicsMutex > & );
|
||||
|
||||
unsigned maxContiguousFrames ( epicsGuard < epicsMutex > & ) const;
|
||||
|
||||
// misc
|
||||
const char * userNamePointer () const;
|
||||
unsigned getInitializingThreadsPriority () const;
|
||||
epicsMutex & mutexRef ();
|
||||
void attachToClientCtx ();
|
||||
void selfTest (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
double beaconPeriod (
|
||||
epicsGuard < epicsMutex > &,
|
||||
const nciu & chan ) const;
|
||||
static unsigned lowestPriorityLevelAbove ( unsigned priority );
|
||||
static unsigned highestPriorityLevelBelow ( unsigned priority );
|
||||
void destroyIIU ( tcpiiu & iiu );
|
||||
|
||||
const char * pLocalHostName ();
|
||||
|
||||
private:
|
||||
epicsSingleton < localHostName > :: reference _refLocalHostName;
|
||||
chronIntIdResTable < nciu > chanTable;
|
||||
//
|
||||
// !!!! There is at this point no good reason
|
||||
// !!!! to maintain one IO table for all types of
|
||||
// !!!! IO. It would probably be better to maintain
|
||||
// !!!! an independent table for each IO type. The
|
||||
// !!!! new adaptive sized hash table will not
|
||||
// !!!! waste memory. Making this change will
|
||||
// !!!! avoid virtual function overhead when
|
||||
// !!!! accessing the different types of IO. This
|
||||
// !!!! approach would also probably be safer in
|
||||
// !!!! terms of detecting damaged protocol.
|
||||
//
|
||||
chronIntIdResTable < baseNMIU > ioTable;
|
||||
resTable < bhe, inetAddrID > beaconTable;
|
||||
resTable < tcpiiu, caServerID > serverTable;
|
||||
tsDLList < tcpiiu > circuitList;
|
||||
tsDLList < SearchDest > searchDestList;
|
||||
tsDLList < msgForMultiplyDefinedPV > msgMultiPVList;
|
||||
tsFreeList
|
||||
< class tcpiiu, 32, epicsMutexNOOP >
|
||||
freeListVirtualCircuit;
|
||||
tsFreeList
|
||||
< class netReadNotifyIO, 1024, epicsMutexNOOP >
|
||||
freeListReadNotifyIO;
|
||||
tsFreeList
|
||||
< class netWriteNotifyIO, 1024, epicsMutexNOOP >
|
||||
freeListWriteNotifyIO;
|
||||
tsFreeList
|
||||
< class netSubscription, 1024, epicsMutexNOOP >
|
||||
freeListSubscription;
|
||||
tsFreeList
|
||||
< class nciu, 1024, epicsMutexNOOP >
|
||||
channelFreeList;
|
||||
tsFreeList
|
||||
< class msgForMultiplyDefinedPV, 16 >
|
||||
mdpvFreeList;
|
||||
cacComBufMemoryManager comBufMemMgr;
|
||||
bheFreeStore bheFreeList;
|
||||
epicsTime programBeginTime;
|
||||
double connTMO;
|
||||
// **** lock hierarchy ****
|
||||
// 1) callback lock must always be acquired before
|
||||
// the primary mutex if both locks are needed
|
||||
epicsMutex & mutex;
|
||||
epicsMutex & cbMutex;
|
||||
epicsEvent iiuUninstall;
|
||||
ipAddrToAsciiEngine & ipToAEngine;
|
||||
epicsTimerQueueActive & timerQueue;
|
||||
char * pUserName;
|
||||
class udpiiu * pudpiiu;
|
||||
void * tcpSmallRecvBufFreeList;
|
||||
void * tcpLargeRecvBufFreeList;
|
||||
cacContextNotify & notify;
|
||||
epicsThreadId initializingThreadsId;
|
||||
unsigned initializingThreadsPriority;
|
||||
unsigned maxRecvBytesTCP;
|
||||
unsigned maxContigFrames;
|
||||
unsigned beaconAnomalyCount;
|
||||
unsigned short _serverPort;
|
||||
unsigned iiuExistenceCount;
|
||||
bool cacShutdownInProgress;
|
||||
|
||||
void recycleReadNotifyIO (
|
||||
epicsGuard < epicsMutex > &, netReadNotifyIO &io );
|
||||
void recycleWriteNotifyIO (
|
||||
epicsGuard < epicsMutex > &, netWriteNotifyIO &io );
|
||||
void recycleSubscription (
|
||||
epicsGuard < epicsMutex > &, netSubscription &io );
|
||||
|
||||
void disconnectChannel (
|
||||
epicsGuard < epicsMutex > & cbGuard,
|
||||
epicsGuard < epicsMutex > & guard, nciu & chan );
|
||||
|
||||
void ioExceptionNotify ( unsigned id, int status,
|
||||
const char * pContext, unsigned type, arrayElementCount count );
|
||||
void ioExceptionNotifyAndUninstall ( unsigned id, int status,
|
||||
const char * pContext, unsigned type, arrayElementCount count );
|
||||
|
||||
void pvMultiplyDefinedNotify ( msgForMultiplyDefinedPV & mfmdpv,
|
||||
const char * pChannelName, const char * pAcc, const char * pRej );
|
||||
|
||||
// recv protocol stubs
|
||||
bool versionAction ( callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
|
||||
bool echoRespAction ( callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
|
||||
bool writeNotifyRespAction ( callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
|
||||
bool searchRespAction ( callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
|
||||
bool readNotifyRespAction ( callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
|
||||
bool eventRespAction ( callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
|
||||
bool readRespAction ( callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
|
||||
bool clearChannelRespAction ( callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
|
||||
bool exceptionRespAction ( callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
|
||||
bool accessRightsRespAction ( callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
|
||||
bool createChannelRespAction ( callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
|
||||
bool verifyAndDisconnectChan ( callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
|
||||
bool badTCPRespAction ( callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
|
||||
|
||||
typedef bool ( cac::*pProtoStubTCP ) (
|
||||
callbackManager &, tcpiiu &,
|
||||
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
|
||||
static const pProtoStubTCP tcpJumpTableCAC [];
|
||||
|
||||
bool defaultExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
|
||||
const char *pCtx, unsigned status );
|
||||
bool eventAddExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
|
||||
const char *pCtx, unsigned status );
|
||||
bool readExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
|
||||
const char *pCtx, unsigned status );
|
||||
bool writeExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
|
||||
const char *pCtx, unsigned status );
|
||||
bool clearChanExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
|
||||
const char *pCtx, unsigned status );
|
||||
bool readNotifyExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
|
||||
const char *pCtx, unsigned status );
|
||||
bool writeNotifyExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
|
||||
const char *pCtx, unsigned status );
|
||||
typedef bool ( cac::*pExcepProtoStubTCP ) (
|
||||
callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
|
||||
const char *pCtx, unsigned status );
|
||||
static const pExcepProtoStubTCP tcpExcepJumpTableCAC [];
|
||||
|
||||
cac ( const cac & );
|
||||
cac & operator = ( const cac & );
|
||||
|
||||
friend class tcpiiu;
|
||||
};
|
||||
|
||||
inline const char * cac::userNamePointer () const
|
||||
{
|
||||
return this->pUserName;
|
||||
}
|
||||
|
||||
inline unsigned cac::getInitializingThreadsPriority () const
|
||||
{
|
||||
return this->initializingThreadsPriority;
|
||||
}
|
||||
|
||||
inline epicsMutex & cac::mutexRef ()
|
||||
{
|
||||
return this->mutex;
|
||||
}
|
||||
|
||||
inline int cac :: varArgsPrintFormated (
|
||||
epicsGuard < epicsMutex > & callbackControl,
|
||||
const char *pformat, va_list args ) const
|
||||
{
|
||||
callbackControl.assertIdenticalMutex ( this->cbMutex );
|
||||
return this->notify.varArgsPrintFormated ( pformat, args );
|
||||
}
|
||||
|
||||
inline void cac::attachToClientCtx ()
|
||||
{
|
||||
this->notify.attachToClientCtx ();
|
||||
}
|
||||
|
||||
inline unsigned cac::beaconAnomaliesSinceProgramStart (
|
||||
epicsGuard < epicsMutex > & guard ) const
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
return this->beaconAnomalyCount;
|
||||
}
|
||||
|
||||
inline notifyGuard::notifyGuard ( cacContextNotify & notifyIn ) :
|
||||
notify ( notifyIn )
|
||||
{
|
||||
this->notify.callbackProcessingInitiateNotify ();
|
||||
}
|
||||
|
||||
inline notifyGuard::~notifyGuard ()
|
||||
{
|
||||
this->notify.callbackProcessingCompleteNotify ();
|
||||
}
|
||||
|
||||
inline callbackManager::callbackManager (
|
||||
cacContextNotify & notify, epicsMutex & callbackControl ) :
|
||||
notifyGuard ( notify ), cbGuard ( callbackControl )
|
||||
{
|
||||
}
|
||||
|
||||
inline nciu * cac::lookupChannel (
|
||||
epicsGuard < epicsMutex > & guard,
|
||||
const cacChannel::ioid & idIn )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
return this->chanTable.lookup ( idIn );
|
||||
}
|
||||
|
||||
inline const char * cac :: pLocalHostName ()
|
||||
{
|
||||
return _refLocalHostName->pointer ();
|
||||
}
|
||||
|
||||
inline unsigned cac ::
|
||||
maxContiguousFrames ( epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
return maxContigFrames;
|
||||
}
|
||||
|
||||
inline double cac ::
|
||||
connectionTimeout ( epicsGuard < epicsMutex > & guard )
|
||||
{
|
||||
guard.assertIdenticalMutex ( this->mutex );
|
||||
return this->connTMO;
|
||||
}
|
||||
|
||||
#endif // ifdef cach
|
||||
145
src/ca/client/cacChannel.cpp
Normal file
145
src/ca/client/cacChannel.cpp
Normal file
@@ -0,0 +1,145 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
* Author: Jeff Hill
|
||||
*/
|
||||
|
||||
#include <stdexcept>
|
||||
#include <float.h>
|
||||
|
||||
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
|
||||
|
||||
#include "errlog.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "iocinf.h"
|
||||
#include "localHostName.h"
|
||||
#include "cacIO.h"
|
||||
|
||||
class CACChannelPrivate {
|
||||
public:
|
||||
CACChannelPrivate ();
|
||||
unsigned getHostName ( char * pBuf, unsigned bufLength );
|
||||
const char * pHostName ();
|
||||
private:
|
||||
epicsSingleton < localHostName > :: reference
|
||||
_refLocalHostName;
|
||||
};
|
||||
|
||||
static epicsThreadOnceId cacChannelIdOnce = EPICS_THREAD_ONCE_INIT;
|
||||
|
||||
const cacChannel::priLev cacChannel::priorityMax = 99u;
|
||||
const cacChannel::priLev cacChannel::priorityMin = 0u;
|
||||
const cacChannel::priLev cacChannel::priorityDefault = priorityMin;
|
||||
const cacChannel::priLev cacChannel::priorityLinksDB = priorityMax;
|
||||
const cacChannel::priLev cacChannel::priorityArchive = ( priorityMax - priorityMin ) / 2;
|
||||
const cacChannel::priLev cacChannel::priorityOPI = priorityMin;
|
||||
|
||||
cacChannel::~cacChannel ()
|
||||
{
|
||||
}
|
||||
|
||||
caAccessRights cacChannel::accessRights (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
static caAccessRights ar ( true, true );
|
||||
return ar;
|
||||
}
|
||||
|
||||
unsigned cacChannel::searchAttempts (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
return 0u;
|
||||
}
|
||||
|
||||
double cacChannel::beaconPeriod (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
return - DBL_MAX;
|
||||
}
|
||||
|
||||
double cacChannel::receiveWatchdogDelay (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
return - DBL_MAX;
|
||||
}
|
||||
|
||||
bool cacChannel::ca_v42_ok (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cacChannel::connected (
|
||||
epicsGuard < epicsMutex > & ) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CACChannelPrivate ::
|
||||
CACChannelPrivate() :
|
||||
_refLocalHostName ( localHostNameCache.getReference () )
|
||||
{
|
||||
}
|
||||
|
||||
inline unsigned CACChannelPrivate ::
|
||||
getHostName ( char * pBuf, unsigned bufLength )
|
||||
{
|
||||
return _refLocalHostName->getName ( pBuf, bufLength );
|
||||
}
|
||||
|
||||
inline const char * CACChannelPrivate ::
|
||||
pHostName ()
|
||||
{
|
||||
return _refLocalHostName->pointer ();
|
||||
}
|
||||
|
||||
static CACChannelPrivate * pCACChannelPrivate = 0;
|
||||
|
||||
// runs once only for each process
|
||||
extern "C" void cacChannelSetup ( void * )
|
||||
{
|
||||
pCACChannelPrivate = new CACChannelPrivate ();
|
||||
}
|
||||
|
||||
// the default is to assume that it is a locally hosted channel
|
||||
unsigned cacChannel::getHostName (
|
||||
epicsGuard < epicsMutex > &,
|
||||
char * pBuf, unsigned bufLength ) const throw ()
|
||||
{
|
||||
if ( bufLength ) {
|
||||
epicsThreadOnce ( & cacChannelIdOnce, cacChannelSetup, 0);
|
||||
return pCACChannelPrivate->getHostName ( pBuf, bufLength );
|
||||
}
|
||||
return 0u;
|
||||
}
|
||||
|
||||
// the default is to assume that it is a locally hosted channel
|
||||
const char * cacChannel::pHostName (
|
||||
epicsGuard < epicsMutex > & ) const throw ()
|
||||
{
|
||||
epicsThreadOnce ( & cacChannelIdOnce, cacChannelSetup, 0);
|
||||
return pCACChannelPrivate->pHostName ();
|
||||
}
|
||||
|
||||
cacContext::~cacContext () {}
|
||||
|
||||
cacService::~cacService () {}
|
||||
|
||||
|
||||
34
src/ca/client/cacChannelNotify.cpp
Normal file
34
src/ca/client/cacChannelNotify.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#include "iocinf.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "cacIO.h"
|
||||
#undef epicsExportSharedSymbols
|
||||
|
||||
cacChannelNotify::~cacChannelNotify ()
|
||||
{
|
||||
}
|
||||
|
||||
43
src/ca/client/cacContextNotify.cpp
Normal file
43
src/ca/client/cacContextNotify.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
* Author: Jeff Hill
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "iocinf.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "cacIO.h"
|
||||
#undef epicsExportSharedSymbols
|
||||
|
||||
cacContextNotify::~cacContextNotify ()
|
||||
{
|
||||
}
|
||||
|
||||
void cacContextNotify::callbackProcessingInitiateNotify ()
|
||||
{
|
||||
}
|
||||
|
||||
void cacContextNotify::callbackProcessingCompleteNotify ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
392
src/ca/client/cacIO.h
Normal file
392
src/ca/client/cacIO.h
Normal file
@@ -0,0 +1,392 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/*
|
||||
*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
*
|
||||
* Author Jeffrey O. Hill
|
||||
* johill@lanl.gov
|
||||
* 505 665 1831
|
||||
*/
|
||||
|
||||
#ifndef cacIOh
|
||||
#define cacIOh
|
||||
|
||||
//
|
||||
// Open Issues
|
||||
// -----------
|
||||
//
|
||||
// 1) A status code from the old client side interface is passed
|
||||
// to the exception notify callback. Should we just pass a string?
|
||||
// If so, then how do they detect the type of error and recover.
|
||||
// Perhaps we should call a different vf for each type of exception.
|
||||
//
|
||||
// 2) Some exception types are present here but there is no common
|
||||
// exception base class in use.
|
||||
//
|
||||
// 3) Should I be passing the channel reference in cacChannelNotify?
|
||||
//
|
||||
// 4) Should the code for caAccessRights not be inline so that this
|
||||
// interface is version independent.
|
||||
//
|
||||
//
|
||||
|
||||
#include <new>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef epicsExportSharedSymbols
|
||||
# define cacIOh_restore_epicsExportSharedSymbols
|
||||
# undef epicsExportSharedSymbols
|
||||
#endif
|
||||
|
||||
#include "tsDLList.h"
|
||||
#include "epicsMutex.h"
|
||||
#include "epicsGuard.h"
|
||||
#include "epicsThread.h"
|
||||
|
||||
#ifdef cacIOh_restore_epicsExportSharedSymbols
|
||||
# define epicsExportSharedSymbols
|
||||
# include "shareLib.h"
|
||||
#endif
|
||||
|
||||
|
||||
class cacChannel;
|
||||
|
||||
typedef unsigned long arrayElementCount;
|
||||
|
||||
// 1) this should not be passing caerr.h status to the exception callback
|
||||
// 2) needless-to-say the data should be passed here using the new data access API
|
||||
class epicsShareClass cacWriteNotify {
|
||||
public:
|
||||
virtual ~cacWriteNotify () = 0;
|
||||
virtual void completion ( epicsGuard < epicsMutex > & ) = 0;
|
||||
// we should probably have a different vf for each type of exception ????
|
||||
virtual void exception (
|
||||
epicsGuard < epicsMutex > &,
|
||||
int status, const char * pContext,
|
||||
unsigned type, arrayElementCount count ) = 0;
|
||||
};
|
||||
|
||||
// 1) this should not be passing caerr.h status to the exception callback
|
||||
// 2) needless-to-say the data should be passed here using the new data access API
|
||||
class epicsShareClass cacReadNotify {
|
||||
public:
|
||||
virtual ~cacReadNotify () = 0;
|
||||
virtual void completion (
|
||||
epicsGuard < epicsMutex > &, unsigned type,
|
||||
arrayElementCount count, const void * pData ) = 0;
|
||||
// we should probably have a different vf for each type of exception ????
|
||||
virtual void exception (
|
||||
epicsGuard < epicsMutex > &, int status,
|
||||
const char * pContext, unsigned type,
|
||||
arrayElementCount count ) = 0;
|
||||
};
|
||||
|
||||
// 1) this should not be passing caerr.h status to the exception callback
|
||||
// 2) needless-to-say the data should be passed here using the new data access API
|
||||
class epicsShareClass cacStateNotify {
|
||||
public:
|
||||
virtual ~cacStateNotify () = 0;
|
||||
virtual void current (
|
||||
epicsGuard < epicsMutex > &, unsigned type,
|
||||
arrayElementCount count, const void * pData ) = 0;
|
||||
// we should probably have a different vf for each type of exception ????
|
||||
virtual void exception (
|
||||
epicsGuard < epicsMutex > &, int status,
|
||||
const char *pContext, unsigned type,
|
||||
arrayElementCount count ) = 0;
|
||||
};
|
||||
|
||||
class caAccessRights {
|
||||
public:
|
||||
caAccessRights (
|
||||
bool readPermit = false,
|
||||
bool writePermit = false,
|
||||
bool operatorConfirmationRequest = false);
|
||||
void setReadPermit ();
|
||||
void setWritePermit ();
|
||||
void setOperatorConfirmationRequest ();
|
||||
void clrReadPermit ();
|
||||
void clrWritePermit ();
|
||||
void clrOperatorConfirmationRequest ();
|
||||
bool readPermit () const;
|
||||
bool writePermit () const;
|
||||
bool operatorConfirmationRequest () const;
|
||||
private:
|
||||
bool f_readPermit:1;
|
||||
bool f_writePermit:1;
|
||||
bool f_operatorConfirmationRequest:1;
|
||||
};
|
||||
|
||||
class epicsShareClass cacChannelNotify {
|
||||
public:
|
||||
virtual ~cacChannelNotify () = 0;
|
||||
virtual void connectNotify ( epicsGuard < epicsMutex > & ) = 0;
|
||||
virtual void disconnectNotify ( epicsGuard < epicsMutex > & ) = 0;
|
||||
virtual void serviceShutdownNotify (
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard ) = 0;
|
||||
virtual void accessRightsNotify (
|
||||
epicsGuard < epicsMutex > &, const caAccessRights & ) = 0;
|
||||
virtual void exception (
|
||||
epicsGuard < epicsMutex > &, int status, const char *pContext ) = 0;
|
||||
// we should probably have a different vf for each type of exception ????
|
||||
virtual void readException (
|
||||
epicsGuard < epicsMutex > &, int status, const char *pContext,
|
||||
unsigned type, arrayElementCount count, void *pValue ) = 0;
|
||||
// we should probably have a different vf for each type of exception ????
|
||||
virtual void writeException (
|
||||
epicsGuard < epicsMutex > &, int status, const char * pContext,
|
||||
unsigned type, arrayElementCount count ) = 0;
|
||||
};
|
||||
|
||||
class CallbackGuard :
|
||||
public epicsGuard < epicsMutex > {
|
||||
public:
|
||||
CallbackGuard ( epicsMutex & mutex ) :
|
||||
epicsGuard < epicsMutex > ( mutex ) {}
|
||||
private:
|
||||
CallbackGuard ( const CallbackGuard & );
|
||||
CallbackGuard & operator = ( const CallbackGuard & );
|
||||
};
|
||||
|
||||
//
|
||||
// Notes
|
||||
// 1) This interface assumes that when a channel is deleted then all
|
||||
// attached IO is deleted. This is left over from the old interface,
|
||||
// but perhaps is a bad practice that should be eliminated? If so,
|
||||
// then the IO should not store or use a pointer to the channel.
|
||||
//
|
||||
class epicsShareClass cacChannel {
|
||||
public:
|
||||
typedef unsigned priLev;
|
||||
static const priLev priorityMax;
|
||||
static const priLev priorityMin;
|
||||
static const priLev priorityDefault;
|
||||
static const priLev priorityLinksDB;
|
||||
static const priLev priorityArchive;
|
||||
static const priLev priorityOPI;
|
||||
|
||||
typedef unsigned ioid;
|
||||
enum ioStatus { iosSynch, iosAsynch };
|
||||
|
||||
cacChannel ( cacChannelNotify & );
|
||||
virtual void destroy (
|
||||
CallbackGuard & callbackGuard,
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard ) = 0;
|
||||
cacChannelNotify & notify () const; // required ?????
|
||||
virtual unsigned getName (
|
||||
epicsGuard < epicsMutex > &,
|
||||
char * pBuf, unsigned bufLen ) const throw () = 0;
|
||||
// !! deprecated, avoid use !!
|
||||
virtual const char * pName (
|
||||
epicsGuard < epicsMutex > & guard ) const throw () = 0;
|
||||
virtual void show (
|
||||
epicsGuard < epicsMutex > &,
|
||||
unsigned level ) const = 0;
|
||||
virtual void initiateConnect (
|
||||
epicsGuard < epicsMutex > & ) = 0;
|
||||
virtual unsigned requestMessageBytesPending (
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard ) = 0;
|
||||
virtual void flush (
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard ) = 0;
|
||||
virtual ioStatus read (
|
||||
epicsGuard < epicsMutex > &,
|
||||
unsigned type, arrayElementCount count,
|
||||
cacReadNotify &, ioid * = 0 ) = 0;
|
||||
virtual void write (
|
||||
epicsGuard < epicsMutex > &,
|
||||
unsigned type, arrayElementCount count,
|
||||
const void *pValue ) = 0;
|
||||
virtual ioStatus write (
|
||||
epicsGuard < epicsMutex > &,
|
||||
unsigned type, arrayElementCount count,
|
||||
const void *pValue, cacWriteNotify &, ioid * = 0 ) = 0;
|
||||
virtual void subscribe (
|
||||
epicsGuard < epicsMutex > &, unsigned type,
|
||||
arrayElementCount count, unsigned mask, cacStateNotify &,
|
||||
ioid * = 0 ) = 0;
|
||||
// The primary mutex must be released when calling the user's
|
||||
// callback, and therefore a finite interval exists when we are
|
||||
// moving forward with the intent to call the users callback
|
||||
// but the users IO could be deleted during this interval.
|
||||
// To prevent the user's callback from being called after
|
||||
// destroying his IO we must past a guard for the callback
|
||||
// mutex here.
|
||||
virtual void ioCancel (
|
||||
CallbackGuard & callbackGuard,
|
||||
epicsGuard < epicsMutex > & mutualExclusionGuard,
|
||||
const ioid & ) = 0;
|
||||
virtual void ioShow (
|
||||
epicsGuard < epicsMutex > &,
|
||||
const ioid &, unsigned level ) const = 0;
|
||||
virtual short nativeType (
|
||||
epicsGuard < epicsMutex > & ) const = 0;
|
||||
virtual arrayElementCount nativeElementCount (
|
||||
epicsGuard < epicsMutex > & ) const = 0;
|
||||
virtual caAccessRights accessRights (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
virtual unsigned searchAttempts (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
virtual double beaconPeriod (
|
||||
epicsGuard < epicsMutex > & ) const; // negative DBL_MAX if UKN
|
||||
virtual double receiveWatchdogDelay (
|
||||
epicsGuard < epicsMutex > & ) const; // negative DBL_MAX if UKN
|
||||
virtual bool ca_v42_ok (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
virtual bool connected (
|
||||
epicsGuard < epicsMutex > & ) const;
|
||||
virtual unsigned getHostName (
|
||||
epicsGuard < epicsMutex > &,
|
||||
char * pBuf, unsigned bufLength ) const throw ();
|
||||
// !! deprecated, avoid use !!
|
||||
virtual const char * pHostName (
|
||||
epicsGuard < epicsMutex > & guard ) const throw ();
|
||||
|
||||
// exceptions
|
||||
class badString {};
|
||||
class badType {};
|
||||
class badPriority {};
|
||||
class outOfBounds {};
|
||||
class badEventSelection {};
|
||||
class noWriteAccess {};
|
||||
class noReadAccess {};
|
||||
class notConnected {};
|
||||
class unsupportedByService {};
|
||||
class msgBodyCacheTooSmall {}; // hopefully this one goes away in the future
|
||||
class requestTimedOut {};
|
||||
|
||||
protected:
|
||||
virtual ~cacChannel () = 0;
|
||||
|
||||
private:
|
||||
cacChannelNotify & callback;
|
||||
cacChannel ( const cacChannel & );
|
||||
cacChannel & operator = ( const cacChannel & );
|
||||
};
|
||||
|
||||
class epicsShareClass cacContext {
|
||||
public:
|
||||
virtual ~cacContext ();
|
||||
virtual cacChannel & createChannel (
|
||||
epicsGuard < epicsMutex > &,
|
||||
const char * pChannelName, cacChannelNotify &,
|
||||
cacChannel::priLev = cacChannel::priorityDefault ) = 0;
|
||||
virtual void flush (
|
||||
epicsGuard < epicsMutex > & ) = 0;
|
||||
virtual unsigned circuitCount (
|
||||
epicsGuard < epicsMutex > & ) const = 0;
|
||||
virtual void selfTest (
|
||||
epicsGuard < epicsMutex > & ) const = 0;
|
||||
virtual unsigned beaconAnomaliesSinceProgramStart (
|
||||
epicsGuard < epicsMutex > & ) const = 0;
|
||||
virtual void show (
|
||||
epicsGuard < epicsMutex > &, unsigned level ) const = 0;
|
||||
};
|
||||
|
||||
class epicsShareClass cacContextNotify {
|
||||
public:
|
||||
virtual ~cacContextNotify () = 0;
|
||||
virtual cacContext & createNetworkContext (
|
||||
epicsMutex & mutualExclusion, epicsMutex & callbackControl ) = 0;
|
||||
// we should probably have a different vf for each type of exception ????
|
||||
virtual void exception (
|
||||
epicsGuard < epicsMutex > &, int status, const char * pContext,
|
||||
const char * pFileName, unsigned lineNo ) = 0;
|
||||
// perhaps this should be phased out in deference to the exception mechanism
|
||||
virtual int varArgsPrintFormated ( const char * pformat, va_list args ) const = 0;
|
||||
// backwards compatibility (from here down)
|
||||
virtual void attachToClientCtx () = 0;
|
||||
virtual void callbackProcessingInitiateNotify () = 0;
|
||||
virtual void callbackProcessingCompleteNotify () = 0;
|
||||
};
|
||||
|
||||
// **** Lock Hierarchy ****
|
||||
// callbackControl must be taken before mutualExclusion if both are held at
|
||||
// the same time
|
||||
class epicsShareClass cacService {
|
||||
public:
|
||||
virtual ~cacService () = 0;
|
||||
virtual cacContext & contextCreate (
|
||||
epicsMutex & mutualExclusion,
|
||||
epicsMutex & callbackControl,
|
||||
cacContextNotify & ) = 0;
|
||||
};
|
||||
|
||||
epicsShareFunc void epicsShareAPI caInstallDefaultService ( cacService & service );
|
||||
|
||||
epicsShareExtern epicsThreadPrivateId caClientCallbackThreadId;
|
||||
|
||||
inline cacChannel::cacChannel ( cacChannelNotify & notify ) :
|
||||
callback ( notify )
|
||||
{
|
||||
}
|
||||
|
||||
inline cacChannelNotify & cacChannel::notify () const
|
||||
{
|
||||
return this->callback;
|
||||
}
|
||||
|
||||
inline caAccessRights::caAccessRights (
|
||||
bool readPermit, bool writePermit, bool operatorConfirmationRequest) :
|
||||
f_readPermit ( readPermit ), f_writePermit ( writePermit ),
|
||||
f_operatorConfirmationRequest ( operatorConfirmationRequest ) {}
|
||||
|
||||
inline void caAccessRights::setReadPermit ()
|
||||
{
|
||||
this->f_readPermit = true;
|
||||
}
|
||||
|
||||
inline void caAccessRights::setWritePermit ()
|
||||
{
|
||||
this->f_writePermit = true;
|
||||
}
|
||||
|
||||
inline void caAccessRights::setOperatorConfirmationRequest ()
|
||||
{
|
||||
this->f_operatorConfirmationRequest = true;
|
||||
}
|
||||
|
||||
inline void caAccessRights::clrReadPermit ()
|
||||
{
|
||||
this->f_readPermit = false;
|
||||
}
|
||||
|
||||
inline void caAccessRights::clrWritePermit ()
|
||||
{
|
||||
this->f_writePermit = false;
|
||||
}
|
||||
|
||||
inline void caAccessRights::clrOperatorConfirmationRequest ()
|
||||
{
|
||||
this->f_operatorConfirmationRequest = false;
|
||||
}
|
||||
|
||||
inline bool caAccessRights::readPermit () const
|
||||
{
|
||||
return this->f_readPermit;
|
||||
}
|
||||
|
||||
inline bool caAccessRights::writePermit () const
|
||||
{
|
||||
return this->f_writePermit;
|
||||
}
|
||||
|
||||
inline bool caAccessRights::operatorConfirmationRequest () const
|
||||
{
|
||||
return this->f_operatorConfirmationRequest;
|
||||
}
|
||||
|
||||
#endif // ifndef cacIOh
|
||||
30
src/ca/client/cacReadNotify.cpp
Normal file
30
src/ca/client/cacReadNotify.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
*
|
||||
* L O S A L A M O S
|
||||
* Los Alamos National Laboratory
|
||||
* Los Alamos, New Mexico 87545
|
||||
*
|
||||
* Copyright, 1986, The Regents of the University of California.
|
||||
*
|
||||
* Author: Jeff Hill
|
||||
*/
|
||||
|
||||
#include "iocinf.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "cacIO.h"
|
||||
#undef epicsExportSharedSymbols
|
||||
|
||||
cacReadNotify::~cacReadNotify ()
|
||||
{
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user