Compare commits

...

205 Commits

Author SHA1 Message Date
Andrew Johnson
7c90e6ed0b Reset version snapshot after tagging 2018-12-12 15:51:30 -06:00
Andrew Johnson
c5fd621337 Clear version snapshot for final release 2018-12-12 15:49:41 -06:00
Andrew Johnson
ea409e79be Link to Launchpad's milestone page for the bug list 2018-12-12 15:49:24 -06:00
Andrew Johnson
c59a18600a Add release notes for the QueueShow additions 2018-12-11 16:47:25 -06:00
Andrew Johnson
68f6f361e1 Merge 3.15 branch into 3.16 2018-12-10 10:47:57 -06:00
Andrew Johnson
84b7612036 Fix for lp: #1801145 recordtype defined after use in device
Add proper equals() method for DBD::Recfield and DBD::Recordtype.
In Parser::parse_recordtype() check for and re-use a declaration
(i.e. an empty recordtype object) when parsing a later definition
of the same recordtype.
2018-12-10 00:25:27 -06:00
Andrew Johnson
f3cf1df503 Merge 3.15 branch into 3.16 2018-12-07 14:07:57 -06:00
Andrew Johnson
9b385480d0 Rename new *QueuePrintStatus() and *QueueStatus iocsh commands to *Show
Also added symbol decorations for Windows builds.
2018-12-07 13:51:35 -06:00
Andrew Johnson
ec036cb26d Merged Martin Konrad's callbackQueueStatus branch into 3.16 2018-12-07 13:47:56 -06:00
Andrew Johnson
64d9d1a4c9 Fix field links to local menu anchors
Anchor IDs are different for XHTML vs HTML generation.
2018-12-07 13:16:06 -06:00
Andrew Johnson
e53244df1f Cherry-pick Dirk's dbState NULL checks from the 7.0 branch
Prevent segfaults in iocsh
2018-12-07 11:45:12 -06:00
Andrew Johnson
fe3d68b5f7 Merged 3.15 branch into 3.16 2018-12-06 17:32:43 -06:00
Andrew Johnson
49f5527cd7 iocsh: Add protection if realloc() fails 2018-12-06 16:35:30 -06:00
Andrew Johnson
ee90dffd40 Add flush to the iocsh errlog command 2018-12-06 16:33:20 -06:00
Andrew Johnson
6664ccfc64 Wiki to POD conversions for bi, bo, calc, calcout and dfanout
These still need going through to update and edit.
Conversions by Tony Pietryla, Argonne.
2018-12-05 16:55:13 -06:00
Andrew Johnson
444cac337c Add POD text for menuScan 2018-12-05 16:55:12 -06:00
Andrew Johnson
313afc4a4c Fix HTMLS generation from IOC menu*.dbd.pod files 2018-12-05 16:55:11 -06:00
Andrew Johnson
0fae0fcc17 Rename various dbd files to dbd.pod 2018-12-05 16:55:10 -06:00
Andrew Johnson
aab5693b45 Fix for CA link disconnect detection
dbCa's doLocked() method must run the callback even when the link
is disconnected to allow alarms to be triggered by softDev support.

Patch from Sebastian Marsching
Also removes testToDo from rec/test/regressTest.c

Fixes lp: #1798855
2018-12-05 00:59:36 -06:00
Martin Konrad
6f919c3991 Simpler implementation using spin lock rather than atomics 2018-12-04 12:00:26 -05:00
Martin Konrad
87761ebf29 Prevent data race between resetHighWaterMark() and put() 2018-12-03 15:59:14 -05:00
Martin Konrad
10d951e2d7 Fix incorrect value for highWaterMark in epicsRingBytes 2018-12-03 10:13:41 -05:00
Martin Konrad
d436561cb2 Add tests for highWaterMark feature 2018-12-03 10:13:41 -05:00
Ralph Lange
a43b805b65 ca/pcas: fix misleading error message (TCP name resolution) 2018-11-30 17:19:56 +01:00
Andrew Johnson
9e999d2bef Only create msi-copy for a Host build-arch 2018-11-27 14:11:11 -06:00
Martin Konrad
040f9013f4 Remove unneeded epicsAtomic from callbackQueueSize 2018-11-27 10:45:35 -05:00
Martin Konrad
0f16977caf Make code compatible with ISO C90 2018-11-27 10:30:35 -05:00
Andrew Johnson
694f045332 Merge Bruce Hill's allow-gt-256-time-events branch into 3.16 2018-11-26 16:29:51 -06:00
Andrew Johnson
daad9b1ba1 Merge updates from 3.15 into 3.16 2018-11-26 15:34:32 -06:00
Andrew Johnson
937878e0a9 Merge Bruce Hill's EPICS-and-CA-version-from-CA-tools branch into 3.15 2018-11-20 10:22:43 -06:00
Andrew Johnson
6e536e1ee0 Fix msi-copy target for cross-build host arch's 2018-11-19 17:59:27 -06:00
Andrew Johnson
6ea6c6ff66 VxWorks: Don't use GCC 2.x for dependency file generation 2018-11-06 13:02:36 -06:00
Andrew Johnson
168d430921 Unify shebang line in tap-to-junit-xml 2018-11-06 10:15:06 -06:00
Bruce Hill
9a8860b771 Expand tabs and revert #include lines to <> instead of quotes. 2018-11-05 18:44:46 -08:00
Michael Davidsaver
693c1020f2 Test if disconnected CA link alarms 2018-11-04 22:20:20 -08:00
Michael Davidsaver
63ddb2d4fc fix mingw build 2018-11-04 22:00:00 -08:00
Bruce Hill
3d8e2d933d Include epicsStdio.h so driver report output can be redirected from iocsh 2018-11-04 20:57:58 -08:00
Andrew Johnson
5f3f87a365 Merge Bruce Hill's MAKEFLAGS-to-MFLAGS branch into 3.15
Added a couple other places where this needed to happen too.
2018-11-02 18:14:39 -05:00
Andrew Johnson
072dbd53e7 Adjust clean-tests rule
Only delete test-result files that actually exist.
2018-11-02 17:47:13 -05:00
Bruce Hill
43322335df Add -V flag to ca client tools to show EPICS and CA versions. 2018-10-31 22:22:19 -07:00
Bruce Hill
fcb5675040 Added release notes re handling of event numbers >= NUM_TIME_EVENTS. 2018-10-31 20:35:52 -07:00
Bruce Hill
3d88c8495b Added comments re handling of event numbers >= NUM_TIME_EVENTS. 2018-10-31 20:30:58 -07:00
Bruce Hill
215c5d954b Modify generalTimeGetEventPriority() to allow eventNumber > 256.
eventNumbers between 0 and NUM_TIME_EVENTS will continue to get checked for advancing timestamps.
Support for eventNumbers > NUM_TIME_EVENTS will be up to the generalTime provider.
2018-10-31 20:20:32 -07:00
Martin Konrad
59ec8d897d Expose callback queue status
This allows tools like iocStats to monitor the queue status of
the callback queues. This fixes lp:1786540.
2018-10-26 18:49:34 -04:00
Andrew Johnson
94ebd0fe48 Set version to -DEV after -rc1 tagged 2018-10-25 14:54:56 -05:00
Andrew Johnson
8a7442e878 Set version to 3.16.2-rc1 2018-10-25 14:52:47 -05:00
Andrew Johnson
31870b4c41 Merge branch 'fix-make-question-mode' into 3.16 2018-10-25 14:38:44 -05:00
Andrew Johnson
ae38fb2c1c Improve output from genVersionHeader.pl
Especially the responses in 'make --question' mode.
2018-10-25 14:37:50 -05:00
Andrew Johnson
a3ace1f260 Merge branch 'dtypedset' into 3.16 2018-10-25 12:48:38 -05:00
Michael Davidsaver
728bb556cf yajlTest doesn't run w/ RTEMS+qemu 2018-10-25 11:39:53 -05:00
Andrew Johnson
b7afb287d5 Merge branch 'rtems-test' into 3.16 2018-10-25 11:39:17 -05:00
Michael Davidsaver
275d36b09d RTEMS use non-default osdEnv
putenv() seems unable to clear environment variables.
2018-10-25 11:30:34 -05:00
Andrew Johnson
a81c3503d2 Fix MUNCH_CMD for RTEMS-pc386 with parallel builds 2018-10-25 11:15:57 -05:00
Andrew Johnson
03b8257d71 Release Notes for the rtems-test branch 2018-10-24 16:04:02 -05:00
Andrew Johnson
46370302f6 Don't require older RTEMS arch's to set RTEMS_BSP
This uses the old rules for RTEMS target architecture names to
work out what the value of RTEMS_BSP should be if it isn't set.
Targets had to be named RTEMS-$(RTEMS_BSP) in previous releases.
With this change out-of-tree target configuration files should
still work, but they can't be used to create sub-architectures
without first setting RTEMS_BSP in their CONFIG.Common.<arch>
file.
2018-10-24 15:25:05 -05:00
Andrew Johnson
ab59c97f4b Minor Perl tidying up 2018-10-24 14:59:48 -05:00
Andrew Johnson
77bdea22f8 T_A can never contain spaces 2018-10-24 14:59:24 -05:00
Andrew Johnson
00ee7bf7d3 Add RTEMS-pc368-qemu target, use in Travis-CI builds 2018-10-24 14:27:15 -05:00
Andrew Johnson
3c607d9034 Require RTEMS_BSP to be set in CONFIG.Common.RTEMS-<arch>
This is needed to allow multiple targets to be built against
the same RTEMS BSP, allowing e.g. -qemu and -gesys targets.
2018-10-24 14:19:18 -05:00
Andrew Johnson
06f522b253 Make example get_ioint_info() routine static 2018-10-23 15:45:39 -05:00
Andrew Johnson
c6476fbbdc Declare IOSCANPVT in devSup.h only 2018-10-23 15:44:44 -05:00
Andrew Johnson
b336545853 Update Release Notes 2018-10-23 12:47:00 -05:00
Andrew Johnson
63994839d0 VxWorks build warning 2018-10-23 11:14:11 -05:00
Andrew Johnson
1564f87bd6 Add missing dependency for parallel builds in std/link/test 2018-10-23 11:14:10 -05:00
Andrew Johnson
6eb88b16a0 Fix show-makefiles rule for files containing colons 2018-10-23 11:08:35 -05:00
Michael Davidsaver
27ee078bc8 libCom/test cover IP_MULTICAST_TTL 2018-10-23 08:34:34 -07:00
Michael Davidsaver
a62c357e99 setsockopt size IP_MULTICAST_TTL 2018-10-23 08:19:48 -07:00
Andrew Johnson
ea0556e471 Improve devSup example 2018-10-22 16:00:16 -05:00
Andrew Johnson
891caa5933 Merge link-updates branch into 3.16 2018-10-19 16:23:58 -05:00
Andrew Johnson
b18478077a Correct mbbi/oDirect release note entry
Better wording from Dirk.

Fixes LP: #1777985
2018-10-19 14:44:52 -05:00
Andrew Johnson
dd78ab0888 Warn on multiple inclusion of RULES_BUILD
RULES_BUILD has long had a multi-inclusion guard, but I want to
be able to remove it. This commit cleans up the current place where
it was happening, and shows a warning if the guard gets triggered,
but it doesn't stop builds from working if it happens.
2018-10-19 14:32:26 -05:00
Andrew Johnson
f1e55ef240 Why was RULES_BUILD using -include for other Base RULES files? 2018-10-19 14:26:50 -05:00
Andrew Johnson
2c07e5fbb9 Unify header comments in configure/RULES files 2018-10-19 14:24:51 -05:00
Andrew Johnson
11ba48232c Add RULES_COMMON
This adds new make targets 'PRINT.<var-name>' and 'show-makefiles'
which are useful for debugging build problems.
2018-10-19 14:23:18 -05:00
Andrew Johnson
531ab6fc36 Merge up changes from 3.15 branch into 3.16 2018-10-19 11:49:57 -05:00
Andrew Johnson
e7e9e66651 Merge branch fix-missing-include-in-dbLock into 3.16 2018-10-18 15:32:51 -05:00
Andrew Johnson
453ad41c48 Merged prop-putf into 3.16 2018-10-18 15:26:02 -05:00
Martin Konrad
eed208afaa Fix shebang line of tap-to-junit-xml.pl
This fixes lp:1797634.
2018-10-12 17:09:26 -04:00
Ralph Lange
ae63854dff Set version to 3.15.6-DEV, prepare new release notes chapter 2018-10-11 15:33:31 +02:00
Ralph Lange
ce7943fb44 Update version to 3.15.6, remove "not released" from release notes 2018-10-11 15:24:36 +02:00
Ralph Lange
4e865a03d8 libCom/osi: fix epicsEnvUnset for WIN32 and solaris 2018-10-11 15:12:10 +02:00
Ralph Lange
9a4febd3bc Merge Dirk Zimoch's 'epicsEnvUnset' branch into 3.15 2018-10-11 11:42:19 +02:00
Andrew Johnson
dc5d373b57 Revert "configure: add vpath for CONFIG* and RULES* (look in SRC_DIRS)"
Unfortunately this causes really bad things to happen; the
configure/RULES file is getting overwritten by the contents of
src/libCom/as/RULES, so we need a different approach.

This reverts commit 47c361f135.
2018-10-10 13:04:54 -05:00
Ralph Lange
47c361f135 configure: add vpath for CONFIG* and RULES* (look in SRC_DIRS) 2018-10-10 17:10:14 +02:00
Ralph Lange
9943796f7f libCom/osi: fix recent epicsStdio.h change for gcc 2.x 2018-10-08 15:46:50 +02:00
3cb72ec209 Merge branch '3.15' into epicsEnvUnset
Conflicts:
	documentation/RELEASE_NOTES.html
2018-10-08 11:02:03 +02:00
701ef5b936 mention epicsEnvUnset in RELEASE_NOTES.html 2018-10-08 10:49:25 +02:00
c3995a9d63 added simple test case for epicsEnvUnset 2018-10-08 10:48:09 +02:00
ce3eadde34 add missing epicsEnvUnset to header 2018-10-08 10:37:34 +02:00
Andrew Johnson
62929fcbd1 Adjust the 'git archive' commands in Release Checklist
The tarfile should not include any files that were added to
support our development process and CI build agents. I have
even excluded .gitignore from previous releases.

I had already done this in 3.16, and 7.0 has a script for
generating the tarfile.
2018-10-05 17:43:33 -05:00
Ralph Lange
456a68eb96 Version number update to 3.15.6-rc1-DEV 2018-10-05 17:05:23 +02:00
Ralph Lange
b319b4722f Update version to 3.15.6-rc1 2018-10-05 15:21:58 +02:00
Ralph Lange
b4cc5fdf4b doc: update release checklist 2018-10-05 15:21:57 +02:00
Ralph Lange
d35835659c libCom/osi: Add epicsStdio functions to std namespace; allow to skip macro magic
(fixes lp:1786927)
2018-10-05 10:54:10 +02:00
65714033ea remove compiler warning 2018-10-03 15:29:30 +02:00
7151fbe498 implement epicsEnvUnset 2018-10-03 15:18:59 +02:00
Andrew Johnson
cbb13bf6b1 Darwin: Don't link using -flat_namespace 2018-09-18 10:22:29 -05:00
Andrew Johnson
150d764d28 Merge 3.14.12.8 (+ the Travis fix) into 3.15 2018-09-17 16:15:55 -05:00
Andrew Johnson
7dd1ea4cab GNU Make 3.81 (as used on Travis) doesn't have 'undefine' 2018-09-17 10:24:51 -05:00
Andrew Johnson
922ed30136 Set EPICS_DEV_SNAPSHOT for the final 3.14.12.8 release 2018-09-14 13:44:05 -05:00
Andrew Johnson
9f9f119e7e Release notes about iocLogServer 2018-09-14 13:21:06 -05:00
Andrew Johnson
d8214a4531 Merge Martin Konrad's fix-logserver-file-limit branch into 3.14 2018-09-14 12:24:14 -05:00
Andrew Johnson
120b100e7e startup: Fix EHA argument quoting per J. Lewis Muir 2018-09-14 12:15:29 -05:00
Andrew Johnson
949e9d788a Make startup/EpicsHostArch script executable 2018-09-14 11:23:14 -05:00
Martin Konrad
27c6e6a385 Make EpicsHostArch compatible with sh 2018-09-14 09:12:10 -04:00
Andrew Johnson
4b59476170 Merge branch 'tidy-startup' into 3.14 2018-09-13 16:49:21 -05:00
Andrew Johnson
526b565c6b configure/CONFIG: Undefine EHA after use 2018-09-10 18:19:03 -05:00
Andrew Johnson
1b7b2bcceb Update README's list of files 2018-09-10 18:16:16 -05:00
Andrew Johnson
49c925d064 Fix shebang line in makeInstallDir.pl 2018-09-10 16:08:19 -05:00
Martin Konrad
46b5d6006e Fix "make --question" mode
Fix for lp:1669891
2018-09-07 18:02:02 -04:00
Ralph Lange
6a2ed4b333 libcom/osi/windows: log errors using fprintf() instead of pop-up
(fixes lp:1785712)
2018-09-05 21:47:25 +02:00
Michael Davidsaver
73b81ad139 db/test: Check that junk before '@' fails w/ INST_IO
It will actually parse, but later fail in dbCanSetLink().
2018-09-05 12:22:00 +02:00
Michael Davidsaver
7c00cc8045 ioc/dbStatic: HW links allow optional '@'
For HW link types other than INST_IO, allow
trailing '@' to be omitted.
2018-09-05 12:21:53 +02:00
Michael Davidsaver
b2bb14c654 ioc/db/test: dbParseLink test handle NULL 2018-09-05 12:21:48 +02:00
Michael Davidsaver
ae5122759d travis-ci: install qemu 2018-09-05 09:04:14 +02:00
Andrew Johnson
d3bcf5737f Latest Xcode also doesn't like compiling system() for iOS 2018-08-17 14:57:22 -05:00
Andrew Johnson
6c5505ad3e osiClockTime again: Don't compile ClockTimeSync() on iOS either 2018-08-17 13:48:00 -05:00
Andrew Johnson
4247d98b08 Add fix to Release Notes 2018-08-17 13:25:18 -05:00
Andrew Johnson
13735a8088 Fix for lp: #1786320
A dbCa link that reads an enum as a string subscribes to the link target
twice, once as DBR_TIME_ENUM and again as DBR_TIME_STRING. This change
prevents ENUM updates from triggering CP/CPP record processing if there
is also a STRING subscription for this link.
2018-08-17 13:18:47 -05:00
Andrew Johnson
58d4242b68 osiClockTime: Only call clock_setting() on embedded OSs
An update to Apple's XCode broke the iOS build because they have
added Posix CLOCK_REALTIME support since this code was written and
now if you compile a call to clock_settime() it stops the build.
2018-08-17 13:09:33 -05:00
Martin Konrad
8e42f516b0 iocLogserver: allow log file limit to be disabled
According to the Application Developer's Guide setting the environment
variable EPICS_IOC_LOG_FILE_LIMIT=0 should disable the limit on the
file size.
2018-08-13 18:16:26 -04:00
Andrew Johnson
9051cdbb34 Added a simpler startup/EpicsHostArch for backwards-compatibility
Many downstream modules seem to be using the EpicsHostArch script in
their CI build scripts and would break if we remove that. I created
a new version that finds and execs the Perl script directly.

Also reworded and expanded the Release Notes about the EpicsHostArch
scripts.
2018-08-10 15:20:29 -05:00
Andrew Johnson
8ffea9de27 Remove macLib warning indicators
Only add ',undefined' tags to macLib output when we aren't
suppressing warnings, e.g. using msi's -V flag.
2018-08-10 14:12:19 -05:00
Andrew Johnson
2548a37267 Update/clean up EpicsHostArch.pl 2018-08-08 16:53:32 -05:00
Martin Konrad
592a83385d Add missing incude in dbLock.h
Fixes lp:1784631.
2018-08-07 12:06:20 -04:00
Andrew Johnson
6e85a407da Release notes for PUTF/RPRO update 2018-08-02 17:00:57 -05:00
Andrew Johnson
76a4a20698 Improved and extended the PUTF/RPRO tests
Added as a unit test, although we might need additional work if we see
the race conditions that are still possible in the code.
2018-08-02 17:00:27 -05:00
Andrew Johnson
7626856a20 Move dbScanPassive() into dbDbLink.c, create processTarget()
Also adds dbAccessDebugPUTF variable, and removes the need for a
private API flag.
2018-08-02 16:57:53 -05:00
Andrew Johnson
1dc1b25aaa caget.pl: Add missing acks and ackt metadata to display output 2018-07-31 17:58:38 -05:00
Andrew Johnson
fb31dd784b recGbl: Prevent record alarm severities > INVALID_ALARM 2018-07-31 16:30:11 -05:00
Andrew Johnson
fe7260e263 msi: Source code reformatting, typo fixes, unify messages
Added lots of debug tracing macros.
Release notes.
2018-07-25 00:47:18 -05:00
Andrew Johnson
67e2b74758 Fix for lp: #1503661
Delete output file if parse errors found in substitution file
2018-07-25 00:31:48 -05:00
Andrew Johnson
c09b6e2f1b libCom: Add and use a -o<filename> option to e_flex
Note that like the -S option the filename must follow immediately in
the same command-line argument with no space.
2018-07-21 01:47:33 -05:00
Andrew Johnson
45be2306bd Add missing includes for db_post_events() 2018-07-21 01:04:05 -05:00
Andrew Johnson
6027f906c3 Merge documentation changes from 3.14 into 3.15 2018-07-20 23:29:47 -05:00
Andrew Johnson
ec351c5e2f Fix for lp: #1730727
Post monitors on all array-length record fields (often NORD)
when their values get changed.
2018-07-20 23:10:34 -05:00
89870e2817 Remove trailing space in license of startup/unix.* 2018-07-20 17:47:39 -05:00
4e9cf72d71 Remove execute file mode bit on EpicsHostArch.pl 2018-07-20 17:45:47 -05:00
80869a0868 Rewrite startup/windows.bat
Remove extraneous things unrelated to EPICS Base.

Make it behave consistently with the other startup scripts.

Make it easy to configure both for a human and a program.
2018-07-20 17:43:01 -05:00
998fa984ba Rewrite startup/win32.bat
Remove extraneous things unrelated to EPICS Base.

Make it behave consistently with the other startup scripts.

Make it easy to configure both for a human and a program.
2018-07-20 17:39:29 -05:00
31844af88e Rewrite startup/unix.csh
Remove extraneous things unrelated to EPICS Base.

Make it behave consistently with the other startup scripts.

Make it easy to configure both for a human and a program.
2018-07-20 17:29:47 -05:00
8f161f9463 Rewrite startup/unix.sh
Remove extraneous things unrelated to EPICS Base.

Make it behave consistently with the other startup scripts.

Make it easy to configure both for a human and a program.
2018-07-20 17:18:22 -05:00
e0399478ad Remove startup/cygwin.bat
Cygwin is no longer supported for Microsoft API builds, so remove it.
2018-07-20 17:14:43 -05:00
Andrew Johnson
2a2a1e54ac Post-tag version number update 2018-07-19 12:35:40 -05:00
Andrew Johnson
20d2cff501 Update version number to 3.14.12.8-rc1 2018-07-19 12:31:52 -05:00
Andrew Johnson
860ce156a2 Documentation updates for 3.14.12.8 2018-07-19 12:20:41 -05:00
ab493264b2 Make EpicsHostArch.pl print newline
Print a newline after the EPICS host architecture spec.  This is typical
for a UNIX-like program (e.g., date).
2018-06-26 17:56:58 -05:00
68779943eb Remove execute file mode bit 2018-06-26 16:34:04 -05:00
7a5ff26984 Remove EpicsHostArch 2018-06-26 16:20:07 -05:00
eae59183cc Rename Site.{cshrc,profile} to unix.{csh,sh} 2018-06-26 16:09:04 -05:00
Andrew Johnson
b32629c3bf Start release notes for tidy-startup branch. 2018-06-26 11:23:35 -05:00
Andrew Johnson
220e404203 Move EpicsHostArch.pl into src/tools, install to lib/perl 2018-06-26 11:23:15 -05:00
Michael Davidsaver
83b17d5061 travis-ci: remove unused 2018-06-23 08:40:12 -07:00
Michael Davidsaver
65dec97f9e use new RTEMS build 2018-06-23 08:40:12 -07:00
Michael Davidsaver
dcb494b494 rtemsttest generalize condition for individual tests 2018-06-23 08:40:12 -07:00
Andrew Johnson
8f55a1307d startup: Update win*.bat files 2018-06-22 14:54:06 -05:00
Andrew Johnson
c0a7ab976c Fix warnings from clang 2018-06-04 15:27:01 -05:00
Andrew Johnson
b029448059 Added lnkCalcTest 2018-06-03 12:35:56 -05:00
Andrew Johnson
3b77d9be8c lnkStateTest: Show status value in test output 2018-06-03 12:34:19 -05:00
Andrew Johnson
6e3aa77c42 lnkCalc fix: Don't evaluate minor expression when major returned true 2018-06-03 11:18:40 -05:00
Andrew Johnson
2fb46fc541 lnkDebug: Fix typo in getAlarm range checks 2018-06-03 11:03:20 -05:00
Andrew Johnson
36f23f3aec lnkDebug fix: Initialize child link's precord pointer 2018-06-03 10:46:29 -05:00
Andrew Johnson
ffe6fceffa dbJLink: Some extra checks at parse/init time 2018-06-03 10:01:33 -05:00
Andrew Johnson
bcfdc8d368 lnkStateTest: set testPlan 2018-06-02 23:59:14 -05:00
Andrew Johnson
c6c25ab43d New src/std/link/test directory with tests for the state link type 2018-06-02 23:28:20 -05:00
Andrew Johnson
5796f717ef Update Release Notes with link-updates changes 2018-06-02 00:40:41 -05:00
Andrew Johnson
89b9e240b0 Link types: Remove debug tracing now provided by debug link type 2018-06-01 23:43:39 -05:00
Andrew Johnson
8cdcaf5a87 dbJLink: Restore the jlink::debug flag, add debug and trace link types 2018-06-01 23:32:48 -05:00
Andrew Johnson
f2ceb3bbbf dbJLink: Add jlif result enum state name strings 2018-06-01 23:26:53 -05:00
Andrew Johnson
fd30989f63 Add jlif::start_child() method 2018-06-01 23:23:54 -05:00
Andrew Johnson
3b89515664 dbJLink: Pass the correct dbfType to child links
API change for link types that support child links, they must now
indicate whether a child link is an input, output or forward link
by the return value from their parse_start_map() method. The original
jlif_key_child_link enumeration has been replaced by 3 new values:
jlif_key_child_inlink, jlif_key_child_outlink and jlif_key_child_fwdlink

Previously we were passing the dbfType of the record link field to all
child links within it, which was wrong.
2018-05-14 23:43:13 -05:00
Michael Davidsaver
1893cb4f54 add USE_TYPED_DRVET and USE_TYPED_DSET options 2018-05-14 19:51:27 -07:00
Michael Davidsaver
2b1d5ae4e3 add release note 2018-05-14 19:41:12 -07:00
Michael Davidsaver
1ca8535266 std/rec/test: test
# Conflicts:
#	src/std/rec/test/linkInitTest.c
2018-05-14 19:40:27 -07:00
Michael Davidsaver
c0cbbd8bee ioc/dbStatic: add dbGetDevLink() 2018-05-14 19:39:26 -07:00
Michael Davidsaver
fef15d6c91 ioc/dbStatic: add typed_drvet 2018-05-14 19:39:26 -07:00
Michael Davidsaver
805e62b29c ioc/dbStatic: add typed_dset 2018-05-14 19:39:26 -07:00
Michael Davidsaver
d94c8d1e37 start asyncproctest 2018-05-14 19:08:14 -07:00
Michael Davidsaver
a4fcd2296a propagate PUTF through DB_LINK and use to RPRO async
For async records to be usable in user triggered
(eg. via RSRV) scan chains, queuing must be handled
properly in the event that a second dbPutField()
is made before the scan chain has completed
(eg. a double click on an OPI).

We change the meaning of PUTF so that it is
propagated through DB links to indicate the
pass through the scan chain directly triggered
by a dbPutField().

propagation is broken if a busy async record
is found, and that record is instead scheduled
to re-process on completion.
2018-05-14 19:05:01 -07:00
Andrew Johnson
877d38e79a Added Doxygen annotations for the Link Support API
Haven't actually tried processing them yet though.
2018-05-02 00:06:12 -05:00
Andrew Johnson
7cef334b64 Added C++ extern "C" wrapper to dbState.h 2018-04-25 21:42:44 -05:00
Bruce Hill
b84ee89d87 Fix ECHO definition to not match variables in MAKEFLAGS by using MFLAGS instead.
Prior ECHO definition strips T_A=XXX command line variable definitions
from MAKEFLAGS but doesn't strip other variable definitions such as
INSTALL_LOCATION.  As a result, if you "make INSTALL_LOCATION=XXX"
the ECHO definition erroneously matches if your install location
contains 's'.   Changing the ECHO definition to MFLAGS avoids
all command line variable definitions.
2018-04-16 19:11:40 -07:00
Andrew Johnson
c2c32e5876 lnkState: Mark as non-volatile, remove lset::isConnected() method 2018-03-31 15:48:58 +01:00
Andrew Johnson
ca2003bb63 dbLink: Clarify meaning of lset isConstant and isVolatile flags
Modify dbIsLinkConnected() to check lset->isVolatile first.
2018-03-31 15:42:35 +01:00
Andrew Johnson
97ea68d40c Added DBF_OUTLINK support to lnkCalc
New out key specifying a child link to put the calculated result to.
2018-03-09 22:42:59 -06:00
Andrew Johnson
8f64af96fd Remove final traces of link debug info tags 2018-03-05 21:41:03 -06:00
Andrew Johnson
54c47f02de Export dbJLinkDebug as a shell variable 2018-03-05 21:34:03 -06:00
Andrew Johnson
d87ac0319b Replace the base:jlinkDebug info-item with a global variable
The info item only works in dbPutString() which means dbLoadRecords()
but not dbPutField().
2018-03-05 21:34:03 -06:00
Andrew Johnson
20404003bf More timestamp support for lnkCalc
Link now remembers the last timestamp read if a timestamp input
was nominated, and implements getTimestamp() to return this.
Also displays the timestamp value in the report output.
2018-03-05 20:55:57 -06:00
Andrew Johnson
1fa5d9d3b6 Cleanup warnings in lnkConst.c 2018-03-05 20:55:57 -06:00
Andrew Johnson
5e394e4928 dbJLink: Handle NULL returned by jlif::alloc() better
It might not mean out-of-memory, adjust error message.
Add OOM and dbfType error checks to all jlif::alloc() routines.

Change all IFDEBUG() in JLink types to use exported global variables.
This allows debug messages to be output from the jlif::alloc()
routines, since the jlink field isn't set when they're called.
2018-03-05 20:55:57 -06:00
Andrew Johnson
c0d4835e66 lnkState: Add support for inverting the flag data
Determine the truthiness of put data in its original data type.
Adjust the link documentation to cover these changes.
2018-03-05 20:55:56 -06:00
Andrew Johnson
8ae34ba01d Add a "state" link type using the dbState API
Includes documentation in links.dbd.pod
2018-03-05 20:55:56 -06:00
Andrew Johnson
98f656fc96 Remove duplicate variables from lnkCalc.c 2018-03-05 20:55:56 -06:00
Michael Davidsaver
e8b4f448ea travis-ci: run tests with RTEMS pc386/qemu 2017-10-22 19:11:01 -05:00
Michael Davidsaver
d5f74fe006 rtems tests for pc386 2017-10-22 19:11:01 -05:00
Michael Davidsaver
6923ca9fda RTEMS: conditional fixups for pc386 2017-10-22 19:11:00 -05:00
Michael Davidsaver
aace975de1 RTEMS: probe for PCI varient of NE2000 NIC
Provided by QEMU
2017-10-22 19:10:35 -05:00
Michael Davidsaver
c8b60e0f1b db/test: dbStressLock skip for RTEMS
This test assumes that several threads with
equal priority will all run eventually.
This isn't true an UP target without
time sliced scheduling (eg. RTEMS).
2017-09-27 16:30:31 -05:00
Michael Davidsaver
1255cdc9ee libCom/test: only run epicsUnitTest for host arch
custom .plt won't use WINE or QEMU when necessary.
2017-09-27 16:21:44 -05:00
Michael Davidsaver
12da38a7ca build/run RTEMS-pc386 tests individually
Build and run individual test executable in addition
to the test harness.
Individual tests run with 'make runtests'.

omit epicsUnitTestTest as it has a custom .plt
2017-09-27 16:21:44 -05:00
Michael Davidsaver
f78e1f39d7 RTEMS: build self contained test harness
Test data stub as a separate file to allow
linking into test harness and individual tests.
2017-09-27 16:21:44 -05:00
Michael Davidsaver
684fe10d8c RTEMS: Add epicsMemFs and hook for app specific FS setup
Default falls back to network FS.

Compile in a set of files as a epicsMemFS structure.
epicsMemFsLoad() creates a set of files based on this.
2017-09-27 16:21:44 -05:00
Michael Davidsaver
15b97f65cb src/tools: teach makeTestfile about WINE and QEMU
Teach makeTestfile host to run test for some cross built
targets.
2017-09-27 16:21:44 -05:00
Michael Davidsaver
c1b0c1bac1 libCom/misc: testMain for RTEMS give weak alias for main()
Allows tests to be linked separately or in a common test harness
2017-09-27 16:09:49 -05:00
200 changed files with 9724 additions and 3010 deletions

View File

@@ -11,8 +11,8 @@ env:
- CMPLR=clang STATIC=YES
- WINE=32 TEST=NO STATIC=YES
- WINE=32 TEST=NO STATIC=NO
- RTEMS=4.10 TEST=NO
- RTEMS=4.9 TEST=NO
- RTEMS=4.10 TEST=YES
- RTEMS=4.9 TEST=YES
addons:
apt:
packages:
@@ -25,8 +25,8 @@ addons:
- flex
- texinfo
- install-info
- qemu-system-x86
cache:
directories:
- $HOME/.cache
install: sh ci/travis-prepare.sh </dev/null
script: sh ci/travis-build.sh </dev/null

View 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,23 +53,22 @@ 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

View File

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

View File

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

View File

@@ -67,7 +67,7 @@ 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)
GENVERSIONHEADER = $(PERL) $(TOOLS)/genVersionHeader.pl $(QUIET_FLAG) $(QUESTION_FLAG)
#---------------------------------------------------------------
# tools for installing libraries and products

View File

@@ -38,7 +38,7 @@ EPICS_VERSION = 3
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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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
@@ -185,7 +188,7 @@ endif
# RELEASE file consistency checking
checkRelease:
$(CONVERTRELEASE) checkRelease
+$(CONVERTRELEASE) checkRelease
warnRelease:
-$(CONVERTRELEASE) checkRelease
noCheckRelease:
@@ -256,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
@@ -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)
@@ -386,7 +390,7 @@ endif
# 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
@@ -523,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)
@@ -532,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
View 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

View File

@@ -92,7 +92,4 @@ $(ARCHS) $(ACTIONS) $(actionArchTargets) :%: \
.PHONY : $(dirActionArchTargets)
.PHONY : $(actionArchTargets)
# User specific rules
#
-include $(HOME)/configure/RULES_USER
include $(CONFIG)/RULES_COMMON

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,7 @@
#
# Author: Matt Rippa
#
RTEMS_BSP = mvme2700
RTEMS_TARGET_CPU = powerpc
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
ARCH_DEP_CFLAGS += -DHAVE_PPCBUG

View File

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

View File

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

View File

@@ -5,14 +5,15 @@
#
# All RTEMS targets use the same Makefile fragment
#
RTEMS_TARGET_CPU=i386
RTEMS_BSP = pc386
RTEMS_TARGET_CPU = i386
MUNCH_SUFFIX = .boot
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

View 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

View File

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

View File

@@ -5,6 +5,7 @@
#
# All RTEMS targets use the same Makefile fragment
#
RTEMS_BSP = uC5282
RTEMS_TARGET_CPU = m68k
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL

View File

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

View File

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

View File

@@ -1,3 +0,0 @@
#
# Site-specific overrides for RTEMS-pc386 target
#

View 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

View File

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

View File

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

View File

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

View File

@@ -19,6 +19,140 @@
-->
<h3>Launchpad Bugs</h3>
<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>
<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>
<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>
<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>
<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>
<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>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>
<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>
<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&nbsp;runtests</tt>) will also run the tests for RTEMS using QEMU.</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.&lt;arch&gt;</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>
<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>
<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>
<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
@@ -35,15 +169,18 @@ 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 extended to 32 bit</h3>
<h3>Record types mbbiDirect and mbboDirect upgraded to 32 bit</h3>
<p>The VAL fields of mbbiDirect and mbboDirect records have
been extended from <tt>DBF_USHORT</tt> (16 bit) to <tt>DBF_LONG</tt> (32 bit).
New bit fields <tt>B10</tt>...<tt>B1F</tt> have been added.</p>
<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 which accesses the bit fields can test if the macro
<tt>mbbiDirectRecord1BF</tt> or <tt>mbboDirectRecord1BF</tt> is
defined. Device support which only accesses RVAL needs no modification.</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&nbsp;*&nbsp;sizeof(prec->val)</code>
which is correct in both versions.</p>
<h3>Restore use of ledlib for VxWorks command editing</h3>
@@ -685,11 +822,45 @@ 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
@@ -721,15 +892,84 @@ 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">

View File

@@ -131,7 +131,7 @@ the final release version.</p>
<tr>
<td>&nbsp;</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>
&mdash; 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

View File

@@ -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 the file LICENSE that is included with this distribution.
# in the file LICENSE that is included with this distribution.
#*************************************************************************
TOP = ..
@@ -72,9 +72,11 @@ 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

View File

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

View File

@@ -34,6 +34,7 @@
#include <alarm.h>
#include <cadef.h>
#include <epicsGetopt.h>
#include "epicsVersion.h"
#include "tool_lib.h"
@@ -55,6 +56,7 @@ static void usage (void)
{
fprintf (stderr, "\nUsage: caget [options] <PV name> ...\n\n"
" -h: Help: Print this message\n"
" -V: Version: Show EPICS and CA versions\n"
"Channel Access options:\n"
" -w <sec>: Wait time, specifies CA timeout, default is %f second(s)\n"
" -c: Asynchronous get (use ca_get_callback and wait for completion)\n"
@@ -389,11 +391,14 @@ int main (int argc, char *argv[])
LINE_BUFFER(stdout); /* Configure stdout buffering */
while ((opt = getopt(argc, argv, ":taicnhsSe:f:g:l:#:d:0:w:p:F:")) != -1) {
while ((opt = getopt(argc, argv, ":taicnhsSVe:f:g:l:#:d:0:w:p:F:")) != -1) {
switch (opt) {
case 'h': /* Print usage */
usage();
return 0;
case 'V':
printf( "\nEPICS Version %s, CA Protocol version %s\n", EPICS_VERSION_STRING, ca_version() );
return 0;
case 't': /* Terse output mode */
complainIfNotPlainAndSet(&format, terse);
break;

View File

@@ -23,6 +23,7 @@
#include <stdio.h>
#include <epicsStdlib.h>
#include "epicsVersion.h"
#include <cadef.h>
#include <epicsGetopt.h>
@@ -36,12 +37,14 @@ void usage (void)
{
fprintf (stderr, "\nUsage: cainfo [options] <PV name> ...\n\n"
" -h: Help: Print this message\n"
" -V: Version: Show EPICS and CA versions\n"
"Channel Access options:\n"
" -w <sec>: Wait time, specifies CA timeout, default is %f second(s)\n"
" -s <level>: Call ca_client_status with the specified interest level\n"
" -p <prio>: CA priority (0-%u, default 0=lowest)\n"
"\nExample: cainfo my_channel another_channel\n\n"
, DEFAULT_TIMEOUT, CA_PRIORITY_MAX);
fprintf (stderr, "\nEPICS Version %s, CA Protocol version %s\n", EPICS_VERSION_STRING, ca_version() );
}
@@ -137,11 +140,14 @@ int main (int argc, char *argv[])
LINE_BUFFER(stdout); /* Configure stdout buffering */
while ((opt = getopt(argc, argv, ":nhw:s:p:")) != -1) {
while ((opt = getopt(argc, argv, ":nhVw:s:p:")) != -1) {
switch (opt) {
case 'h': /* Print usage */
usage();
return 0;
case 'V':
printf( "\nEPICS Version %s, CA Protocol version %s\n", EPICS_VERSION_STRING, ca_version() );
return 0;
case 'w': /* Set CA timeout value */
if(epicsScanDouble(optarg, &caTimeout) != 1)
{

View File

@@ -26,6 +26,7 @@
#include <stdio.h>
#include <epicsStdlib.h>
#include <string.h>
#include "epicsVersion.h"
#include <cadef.h>
#include <epicsGetopt.h>
@@ -44,7 +45,8 @@ void usage (void)
{
fprintf (stderr, "\nUsage: camonitor [options] <PV name> ...\n"
"\n"
" -h: Help; Print this message\n"
" -h: Help: Print this message\n"
" -V: Version: Show EPICS and CA versions\n"
"Channel Access options:\n"
" -w <sec>: Wait time, specifies CA timeout, default is %f second(s)\n"
" -m <msk>: Specify CA event mask to use. <msk> is any combination of\n"
@@ -209,11 +211,14 @@ int main (int argc, char *argv[])
LINE_BUFFER(stdout); /* Configure stdout buffering */
while ((opt = getopt(argc, argv, ":nhm:sSe:f:g:l:#:0:w:t:p:F:")) != -1) {
while ((opt = getopt(argc, argv, ":nhVm:sSe:f:g:l:#:0:w:t:p:F:")) != -1) {
switch (opt) {
case 'h': /* Print usage */
usage();
return 0;
case 'V':
printf( "\nEPICS Version %s, CA Protocol version %s\n", EPICS_VERSION_STRING, ca_version() );
return 0;
case 'n': /* Print ENUM as index numbers */
enumAsNr=1;
break;

View File

@@ -37,6 +37,7 @@
#include <epicsGetopt.h>
#include <epicsEvent.h>
#include <epicsString.h>
#include "epicsVersion.h"
#include "tool_lib.h"
@@ -59,6 +60,7 @@ void usage (void)
fprintf (stderr, "\nUsage: caput [options] <PV name> <PV value> ...\n"
" caput -a [options] <PV name> <no of values> <PV value> ...\n\n"
" -h: Help: Print this message\n"
" -V: Version: Show EPICS and CA versions\n"
"Channel Access options:\n"
" -w <sec>: Wait time, specifies CA timeout, default is %f second(s)\n"
" -c: Asynchronous put (use ca_put_callback and wait for completion)\n"
@@ -281,11 +283,14 @@ int main (int argc, char *argv[])
LINE_BUFFER(stdout); /* Configure stdout buffering */
putenv("POSIXLY_CORRECT="); /* Behave correct on GNU getopt systems */
while ((opt = getopt(argc, argv, ":cnlhatsS#:w:p:F:")) != -1) {
while ((opt = getopt(argc, argv, ":cnlhatsVS#:w:p:F:")) != -1) {
switch (opt) {
case 'h': /* Print usage */
usage();
return 0;
case 'V':
printf( "\nEPICS Version %s, CA Protocol version %s\n", EPICS_VERSION_STRING, ca_version() );
return 0;
case 'n': /* Force interpret ENUM as index number */
enumAsNr = 1;
enumAsString = 0;

View File

@@ -193,7 +193,7 @@ udpiiu::udpiiu (
#ifdef IP_MULTICAST_TTL
{
int ttl;
osiSockOptMcastTTL_t ttl;
long val;
if(envGetLongConfigParam(&EPICS_CA_MCAST_TTL, &val))
val =1;

View File

@@ -1401,7 +1401,7 @@ caStatus casStrmClient :: searchAction ( epicsGuard < casClientMutex > & guard )
if ( pChanName[0] == '\0' ) {
caServerI::dumpMsg ( this->pHostName, "?", mp, this->ctx.getData(),
"zero length PV name in UDP search request?\n" );
"zero length PV name in TCP search request?\n" );
return S_cas_success;
}
@@ -1411,7 +1411,7 @@ caStatus casStrmClient :: searchAction ( epicsGuard < casClientMutex > & guard )
for ( unsigned i = mp->m_postsize-1; pChanName[i] != '\0'; i-- ) {
if ( i <= 1 ) {
caServerI::dumpMsg ( pHostName, "?", mp, this->ctx.getData(),
"unterminated PV name in UDP search request?\n" );
"unterminated PV name in TCP search request?\n" );
return S_cas_success;
}
}

View File

@@ -62,7 +62,7 @@ DBDINC += menuScan
DBDINC += dbCommon
dbMenusPod = $(notdir $(wildcard ../db/menu*.dbd.pod))
HTMLS += $(patsubst %.dbd.pod,%.html,$(menusPod))
HTMLS += $(patsubst %.dbd.pod,%.html,$(dbMenusPod))
dbCore_SRCS += dbLock.c
dbCore_SRCS += dbAccess.c

View File

@@ -54,6 +54,7 @@ typedef struct cbQueueSet {
epicsEventId semWakeUp;
epicsRingPointerId queue;
int queueOverflow;
int queueOverflows;
int shutdown;
int threadsConfigured;
int threadsRunning;
@@ -103,6 +104,51 @@ int callbackSetQueueSize(int size)
return 0;
}
int callbackQueueStatus(const int reset, callbackQueueStats *result)
{
int ret;
if (!callbackIsInit) return -1;
if (result) {
int prio;
result->size = callbackQueueSize;
for(prio = 0; prio < NUM_CALLBACK_PRIORITIES; prio++) {
epicsRingPointerId qId = callbackQueue[prio].queue;
result->numUsed[prio] = epicsRingPointerGetUsed(qId);
result->maxUsed[prio] = epicsRingPointerGetHighWaterMark(qId);
result->numOverflow[prio] = epicsAtomicGetIntT(&callbackQueue[prio].queueOverflows);
}
ret = 0;
} else {
ret = -2;
}
if (reset) {
int prio;
for(prio = 0; prio < NUM_CALLBACK_PRIORITIES; prio++) {
epicsRingPointerResetHighWaterMark(callbackQueue[prio].queue);
}
}
return ret;
}
void callbackQueueShow(const int reset)
{
callbackQueueStats stats;
if (callbackQueueStatus(reset, &stats) == -1) {
fprintf(stderr, "Callback system not initialized, yet. Please run "
"iocInit before using this command.\n");
} else {
int prio;
printf("PRIORITY HIGH-WATER MARK ITEMS IN Q Q SIZE %% USED Q OVERFLOWS\n");
for (prio = 0; prio < NUM_CALLBACK_PRIORITIES; prio++) {
double qusage = 100.0 * stats.numUsed[prio] / stats.size;
printf("%8s %15d %10d %6d %6.1f %11d\n",
threadNamePrefix[prio], stats.maxUsed[prio],
stats.numUsed[prio], stats.size, qusage,
stats.numOverflow[prio]);
}
}
}
int callbackParallelThreads(int count, const char *prio)
{
if (callbackIsInit) {
@@ -290,6 +336,7 @@ int callbackRequest(CALLBACK *pcallback)
if (!pushOK) {
epicsInterruptContextMessage(fullMessage[priority]);
mySet->queueOverflow = TRUE;
epicsAtomicIncrIntT(&mySet->queueOverflows);
return S_db_bufFull;
}
epicsEventSignal(mySet->semWakeUp);

View File

@@ -48,6 +48,13 @@ typedef epicsCallback CALLBACK;
typedef void (*CALLBACKFUNC)(struct callbackPvt*);
typedef struct callbackQueueStats {
int size;
int numUsed[NUM_CALLBACK_PRIORITIES];
int maxUsed[NUM_CALLBACK_PRIORITIES];
int numOverflow[NUM_CALLBACK_PRIORITIES];
} callbackQueueStats;
#define callbackSetCallback(PFUN, PCALLBACK) \
( (PCALLBACK)->callback = (PFUN) )
#define callbackSetPriority(PRIORITY, PCALLBACK) \
@@ -73,6 +80,8 @@ epicsShareFunc void callbackCancelDelayed(CALLBACK *pcallback);
epicsShareFunc void callbackRequestProcessCallbackDelayed(
CALLBACK *pCallback, int Priority, void *pRec, double seconds);
epicsShareFunc int callbackSetQueueSize(int size);
epicsShareFunc int callbackQueueStatus(const int reset, callbackQueueStats *result);
epicsShareFunc void callbackQueueShow(const int reset);
epicsShareFunc int callbackParallelThreads(int count, const char *prio);
#ifdef __cplusplus

View File

@@ -34,7 +34,7 @@
#include "errlog.h"
#include "errMdef.h"
#define epicsExportSharedSymbols
#include "epicsExport.h" /* #define epicsExportSharedSymbols */
#include "caeventmask.h"
#include "callback.h"
#include "dbAccessDefs.h"
@@ -65,6 +65,9 @@
epicsShareDef struct dbBase *pdbbase = 0;
epicsShareDef volatile int interruptAccept=FALSE;
epicsShareDef int dbAccessDebugPUTF = 0;
epicsExportAddress(int, dbAccessDebugPUTF);
/* Hook Routines */
epicsShareDef DB_LOAD_RECORDS_HOOK_ROUTINE dbLoadRecordsHook = NULL;
@@ -446,22 +449,6 @@ int dbGetFieldIndex(const struct dbAddr *paddr)
return paddr->pfldDes->indRecordType;
}
/*
* Process a record if its scan field is passive.
* Will notify if processing is complete by callback.
* (only if you are interested in completion)
*/
long dbScanPassive(dbCommon *pfrom, dbCommon *pto)
{
/* if not passive just return success */
if (pto->scan != 0)
return 0;
if (pfrom && pfrom->ppn)
dbNotifyAdd(pfrom,pto);
return dbProcess(pto);
}
/*
* Process the record.
* 1. Check for breakpoints.
@@ -527,7 +514,8 @@ long dbProcess(dbCommon *precord)
unsigned short monitor_mask;
if (*ptrace)
printf("%s: Active %s\n", context, precord->name);
printf("%s: dbProcess of Active '%s' with RPRO=%d\n",
context, precord->name, precord->rpro);
/* raise scan alarm after MAX_LOCK times */
if ((precord->stat == SCAN_ALARM) ||
@@ -556,7 +544,8 @@ long dbProcess(dbCommon *precord)
/* if disabled check disable alarm severity and return success */
if (precord->disa == precord->disv) {
if (*ptrace)
printf("%s: Disabled %s\n", context, precord->name);
printf("%s: dbProcess of Disabled '%s'\n",
context, precord->name);
/*take care of caching and notifyCompletion*/
precord->rpro = FALSE;
@@ -593,7 +582,7 @@ long dbProcess(dbCommon *precord)
}
if (*ptrace)
printf("%s: Process %s\n", context, precord->name);
printf("%s: dbProcess of '%s'\n", context, precord->name);
/* process record */
status = prset->process(precord);
@@ -713,6 +702,18 @@ void dbInitEntryFromRecord(struct dbCommon *prec, DBENTRY *pdbentry)
pdbentry->precnode = ppvt->recnode;
}
struct link* dbGetDevLink(struct dbCommon* prec)
{
DBLINK *plink = 0;
DBENTRY entry;
dbInitEntryFromRecord(prec, &entry);
if(dbFindField(&entry, "INP")==0 || dbFindField(&entry, "OUT")==0) {
plink = (DBLINK*)entry.pfield;
}
dbFinishEntry(&entry);
return plink;
}
long dbValueSize(short dbr_type)
{
/* sizes for value associated with each DBR request type */
@@ -1040,7 +1041,7 @@ static long dbPutFieldLink(DBADDR *paddr,
return S_db_badDbrtype;
}
status = dbParseLink(pstring, pfldDes->field_type, &link_info, 0);
status = dbParseLink(pstring, pfldDes->field_type, &link_info);
if (status)
return status;
@@ -1213,8 +1214,8 @@ long dbPutField(DBADDR *paddr, short dbrType,
precord->scan == 0 &&
dbrType < DBR_PUT_ACKT)) {
if (precord->pact) {
if (precord->tpro)
printf("%s: Active %s\n",
if (dbAccessDebugPUTF && precord->tpro)
printf("%s: dbPutField to Active '%s', setting RPRO=1\n",
epicsThreadGetNameSelf(), precord->name);
precord->rpro = TRUE;
} else {
@@ -1347,4 +1348,3 @@ done:
paddr->pfield = pfieldsave;
return status;
}

View File

@@ -34,6 +34,7 @@ extern "C" {
epicsShareExtern struct dbBase *pdbbase;
epicsShareExtern volatile int interruptAccept;
epicsShareExtern int dbAccessDebugPUTF;
/* The database field and request types are defined in dbFldTypes.h*/
/* Data Base Request Options */

View File

@@ -703,7 +703,12 @@ static long doLocked(struct link *plink, dbLinkUserCallback rtn, void *priv)
caLink *pca;
long status;
pcaGetCheck
assert(plink);
if (plink->type != CA_LINK) return -1;
pca = (caLink *)plink->value.pv_link.pvt;
assert(pca);
epicsMutexMustLock(pca->lock);
assert(pca->plink);
status = rtn(plink, priv);
epicsMutexUnlock(pca->lock);
return status;
@@ -842,6 +847,7 @@ static void eventCallback(struct event_handler_args arg)
struct dbr_time_double *pdbr_time_double;
dbCaCallback monitor = 0;
void *userPvt = 0;
int doScan = 1;
assert(pca);
epicsMutexMustLock(pca->lock);
@@ -872,10 +878,13 @@ static void eventCallback(struct event_handler_args arg)
memcpy(pca->pgetString, dbr_value_ptr(arg.dbr, arg.type), size);
pca->gotInString = TRUE;
} else switch (arg.type){
case DBR_TIME_ENUM:
/* Disable the record scan if we also have a string monitor */
doScan = !(plink->value.pv_link.pvlMask & pvlOptInpString);
/* fall through */
case DBR_TIME_STRING:
case DBR_TIME_SHORT:
case DBR_TIME_FLOAT:
case DBR_TIME_ENUM:
case DBR_TIME_CHAR:
case DBR_TIME_LONG:
case DBR_TIME_DOUBLE:
@@ -893,7 +902,7 @@ static void eventCallback(struct event_handler_args arg)
pca->sevr = pdbr_time_double->severity;
pca->stat = pdbr_time_double->status;
memcpy(&pca->timeStamp, &pdbr_time_double->stamp, sizeof(epicsTimeStamp));
if (precord) {
if (doScan && precord) {
struct pv_link *ppv_link = &plink->value.pv_link;
if ((ppv_link->pvlMask & pvlOptCP) ||

View File

@@ -20,6 +20,7 @@
#include "cantProceed.h"
#include "epicsAssert.h"
#include "epicsString.h"
#include "epicsStdio.h"
#include "errlog.h"
#include "freeList.h"
#include "gpHash.h"

View File

@@ -12,6 +12,29 @@
* Current Author: Andrew Johnson
*/
/* The PUTF and RPRO fields in dbCommon are flags that indicate when a record
* is being processed as a result of an external put (i.e. some server process
* calling dbPutField()), ensuring that the record and its successors will
* eventually get processed even if they happen to be busy at the time of the
* put. From Base-3.16.2 and 7.0.2 the code ensures that all records downstream
* from the original are processed even if a busy asynchronous device appears
* in the processing chain (this breaks the chain in older versions).
*
* PUTF - This field is set in dbPutField() prior to it calling dbProcess().
* It is normally cleared at the end of processing in recGblFwdLink().
* It may also be cleared in dbProcess() if DISA==DISV (scan disabled),
* or by the processTarget() function below.
*
* If PUTF is TRUE before a call to dbProcess(prec), then after it returns
* either PACT is TRUE, or PUTF will be FALSE.
*
* RPRO - This field is set by dbPutField() or by the processTarget() function
* below when a record to be processed is found to be busy (PACT==1).
* It is normally cleared in recGblFwdLink() when the record is queued
* for re-processing, or in dbProcess() if DISA==DISV (scan disabled).
*/
#include <stddef.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -43,17 +66,22 @@
#include "dbNotify.h"
#include "dbScan.h"
#include "dbStaticLib.h"
#include "dbServer.h"
#include "devSup.h"
#include "link.h"
#include "recGbl.h"
#include "recSup.h"
#include "special.h"
#include "dbDbLink.h"
/***************************** Database Links *****************************/
/* Forward definition */
/* Forward definitions */
static lset dbDb_lset;
static long processTarget(dbCommon *psrc, dbCommon *pdst);
long dbDbInitLink(struct link *plink, short dbfType)
{
DBADDR dbaddr;
@@ -138,11 +166,7 @@ static long dbDbGetValue(struct link *plink, short dbrType, void *pbuffer,
/* scan passive records if link is process passive */
if (ppv_link->pvlMask & pvlOptPP) {
unsigned char pact = precord->pact;
precord->pact = TRUE;
status = dbScanPassive(precord, paddr->precord);
precord->pact = pact;
if (status)
return status;
}
@@ -311,22 +335,10 @@ static long dbDbPutValue(struct link *plink, short dbrType,
return status;
if (paddr->pfield == (void *) &pdest->proc ||
(ppv_link->pvlMask & pvlOptPP && pdest->scan == 0)) {
/* if dbPutField caused asyn record to process */
/* ask for reprocessing*/
if (pdest->putf) {
pdest->rpro = TRUE;
} else { /* process dest record with source's PACT true */
unsigned char pact;
if (psrce && psrce->ppn)
dbNotifyAdd(psrce, pdest);
pact = psrce->pact;
psrce->pact = TRUE;
status = dbProcess(pdest);
psrce->pact = pact;
}
(ppv_link->pvlMask & pvlOptPP && pdest->scan == 0)) {
status = processTarget(psrce, pdest);
}
return status;
}
@@ -356,3 +368,75 @@ static lset dbDb_lset = {
dbDbPutValue, NULL,
dbDbScanFwdLink, doLocked
};
/*
* Process a record if its scan field is passive.
*/
long dbScanPassive(dbCommon *pfrom, dbCommon *pto)
{
/* if not passive we're done */
if (pto->scan != 0)
return 0;
return processTarget(pfrom, pto);
}
static long processTarget(dbCommon *psrc, dbCommon *pdst)
{
char context[40] = "";
int trace = dbAccessDebugPUTF && *dbLockSetAddrTrace(psrc);
long status;
epicsUInt8 pact = psrc->pact;
psrc->pact = TRUE;
if (psrc && psrc->ppn)
dbNotifyAdd(psrc, pdst);
if (trace && dbServerClient(context, sizeof(context))) {
/* No client, use thread name */
strncpy(context, epicsThreadGetNameSelf(), sizeof(context));
context[sizeof(context) - 1] = 0;
}
if (!pdst->pact) {
/* Normal propagation of PUTF from src to dst */
if (trace)
printf("%s: '%s' -> '%s' with PUTF=%u\n",
context, psrc->name, pdst->name, psrc->putf);
if (pdst->putf)
errlogPrintf("Warning: '%s.PUTF' found true with PACT false\n",
pdst->name);
pdst->putf = psrc->putf;
}
else if (psrc->putf) {
/* The dst record is busy (awaiting async reprocessing) and
* we were originally triggered by a call to dbPutField(),
* so we mark the dst record for reprocessing once the async
* completion is over.
*/
if (trace)
printf("%s: '%s' -> Active '%s', setting RPRO=1\n",
context, psrc->name, pdst->name);
pdst->putf = FALSE;
pdst->rpro = TRUE;
}
else {
/* The dst record is busy, but we weren't triggered by a call
* to dbPutField(). Do nothing.
*/
if (trace)
printf("%s: '%s' -> Active '%s', done\n",
context, psrc->name, pdst->name);
}
status = dbProcess(pdst);
psrc->pact = pact;
return status;
}

View File

@@ -296,6 +296,17 @@ static void scanOnceSetQueueSizeCallFunc(const iocshArgBuf *args)
scanOnceSetQueueSize(args[0].ival);
}
/* scanOnceQueueShow */
static const iocshArg scanOnceQueueShowArg0 = { "reset",iocshArgInt};
static const iocshArg * const scanOnceQueueShowArgs[1] =
{&scanOnceQueueShowArg0};
static const iocshFuncDef scanOnceQueueShowFuncDef =
{"scanOnceQueueShow",1,scanOnceQueueShowArgs};
static void scanOnceQueueShowCallFunc(const iocshArgBuf *args)
{
scanOnceQueueShow(args[0].ival);
}
/* scanppl */
static const iocshArg scanpplArg0 = { "rate",iocshArgDouble};
static const iocshArg * const scanpplArgs[1] = {&scanpplArg0};
@@ -335,6 +346,17 @@ static void callbackSetQueueSizeCallFunc(const iocshArgBuf *args)
callbackSetQueueSize(args[0].ival);
}
/* callbackQueueShow */
static const iocshArg callbackQueueShowArg0 = { "reset", iocshArgInt};
static const iocshArg * const callbackQueueShowArgs[1] =
{&callbackQueueShowArg0};
static const iocshFuncDef callbackQueueShowFuncDef =
{"callbackQueueShow",1,callbackQueueShowArgs};
static void callbackQueueShowCallFunc(const iocshArgBuf *args)
{
callbackQueueShow(args[0].ival);
}
/* callbackParallelThreads */
static const iocshArg callbackParallelThreadsArg0 = { "no of threads", iocshArgInt};
static const iocshArg callbackParallelThreadsArg1 = { "priority", iocshArgString};
@@ -441,12 +463,14 @@ void dbIocRegister(void)
iocshRegister(&dbLockShowLockedFuncDef,dbLockShowLockedCallFunc);
iocshRegister(&scanOnceSetQueueSizeFuncDef,scanOnceSetQueueSizeCallFunc);
iocshRegister(&scanOnceQueueShowFuncDef,scanOnceQueueShowCallFunc);
iocshRegister(&scanpplFuncDef,scanpplCallFunc);
iocshRegister(&scanpelFuncDef,scanpelCallFunc);
iocshRegister(&postEventFuncDef,postEventCallFunc);
iocshRegister(&scanpiolFuncDef,scanpiolCallFunc);
iocshRegister(&callbackSetQueueSizeFuncDef,callbackSetQueueSizeCallFunc);
iocshRegister(&callbackQueueShowFuncDef,callbackQueueShowCallFunc);
iocshRegister(&callbackParallelThreadsFuncDef,callbackParallelThreadsCallFunc);
/* Needed before callback system is initialized */

View File

@@ -2,7 +2,7 @@
* Copyright (c) 2016 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbJLink.c */
@@ -25,19 +25,33 @@
#include "dbLock.h"
#include "dbStaticLib.h"
#include "link.h"
#include "epicsExport.h"
#define IFDEBUG(n) if(parser->parse_debug)
epicsShareDef int dbJLinkDebug = 0;
epicsExportAddress(int, dbJLinkDebug);
#define IFDEBUG(n) if (dbJLinkDebug >= (n))
typedef struct parseContext {
jlink *pjlink;
jlink *product;
short dbfType;
short jsonDepth;
unsigned key_is_link:1;
unsigned parse_debug:1;
unsigned lset_debug:1;
} parseContext;
epicsShareDef const char *jlif_result_name[2] = {
"jlif_stop",
"jlif_continue",
};
epicsShareDef const char *jlif_key_result_name[5] = {
"jlif_key_stop",
"jlif_key_continue",
"jlif_key_child_inlink",
"jlif_key_child_outlink",
"jlif_key_child_fwdlink"
};
#define CALL_OR_STOP(routine) !(routine) ? jlif_stop : (routine)
static int dbjl_return(parseContext *parser, jlif_result result) {
@@ -45,8 +59,8 @@ static int dbjl_return(parseContext *parser, jlif_result result) {
IFDEBUG(10) {
printf("dbjl_return(%s@%p, %d)\t", pjlink ? pjlink->pif->name : "", pjlink, result);
printf(" jsonDepth=%d, parseDepth=%d, key_is_link=%d\n",
parser->jsonDepth, pjlink ? pjlink->parseDepth : 0, parser->key_is_link);
printf(" jsonDepth=%d, parseDepth=%d, dbfType=%d\n",
parser->jsonDepth, pjlink ? pjlink->parseDepth : 0, parser->dbfType);
}
if (result == jlif_stop && pjlink) {
@@ -59,6 +73,9 @@ static int dbjl_return(parseContext *parser, jlif_result result) {
pjlink->pif->free_jlink(pjlink);
}
IFDEBUG(10)
printf(" returning %d %s\n", result,
result == jlif_stop ? "*** STOP ***" : "Continue");
return result;
}
@@ -68,8 +85,8 @@ static int dbjl_value(parseContext *parser, jlif_result result) {
IFDEBUG(10) {
printf("dbjl_value(%s@%p, %d)\t", pjlink ? pjlink->pif->name : "", pjlink, result);
printf(" jsonDepth=%d, parseDepth=%d, key_is_link=%d\n",
parser->jsonDepth, pjlink ? pjlink->parseDepth : 0, parser->key_is_link);
printf(" jsonDepth=%d, parseDepth=%d, dbfType=%d\n",
parser->jsonDepth, pjlink ? pjlink->parseDepth : 0, parser->dbfType);
}
if (result == jlif_stop || pjlink->parseDepth > 0)
@@ -81,7 +98,6 @@ static int dbjl_value(parseContext *parser, jlif_result result) {
} else if (parent->pif->end_child) {
parent->pif->end_child(parent, pjlink);
}
pjlink->debug = 0;
parser->pjlink = parent;
@@ -159,29 +175,46 @@ static int dbjl_start_map(void *ctx) {
if (!pjlink) {
IFDEBUG(10) {
printf("dbjl_start_map(NULL)\t");
printf(" jsonDepth=%d, parseDepth=00, key_is_link=%d\n",
parser->jsonDepth, parser->key_is_link);
printf(" jsonDepth=%d, parseDepth=00, dbfType=%d\n",
parser->jsonDepth, parser->dbfType);
}
assert(parser->jsonDepth == 0);
parser->jsonDepth++;
parser->key_is_link = 1;
return jlif_continue; /* Opening '{' */
}
IFDEBUG(10) {
printf("dbjl_start_map(%s@%p)\t", pjlink ? pjlink->pif->name : "", pjlink);
printf(" jsonDepth=%d, parseDepth=%d, key_is_link=%d\n",
parser->jsonDepth, pjlink ? pjlink->parseDepth : 0, parser->key_is_link);
printf(" jsonDepth=%d, parseDepth=%d, dbfType=%d\n",
parser->jsonDepth, pjlink ? pjlink->parseDepth : 0, parser->dbfType);
}
pjlink->parseDepth++;
parser->jsonDepth++;
result = CALL_OR_STOP(pjlink->pif->parse_start_map)(pjlink);
if (result == jlif_key_child_link) {
parser->key_is_link = 1;
switch (result) {
case jlif_key_child_inlink:
parser->dbfType = DBF_INLINK;
result = jlif_continue;
break;
case jlif_key_child_outlink:
parser->dbfType = DBF_OUTLINK;
result = jlif_continue;
break;
case jlif_key_child_fwdlink:
parser->dbfType = DBF_FWDLINK;
result = jlif_continue;
break;
case jlif_key_stop:
case jlif_key_continue:
break;
default:
errlogPrintf("dbJLinkInit: Bad return %d from '%s'::parse_start_map()\n",
result, pjlink->pif->name);
result = jlif_stop;
break;
}
IFDEBUG(10)
@@ -196,8 +229,9 @@ static int dbjl_map_key(void *ctx, const unsigned char *key, size_t len) {
char *link_name;
linkSup *linkSup;
jlif *pjlif;
jlink *child;
if (!parser->key_is_link) {
if (parser->dbfType == 0) {
if (!pjlink) {
errlogPrintf("dbJLinkInit: Illegal second link key '%.*s'\n",
(int) len, key);
@@ -207,8 +241,8 @@ static int dbjl_map_key(void *ctx, const unsigned char *key, size_t len) {
IFDEBUG(10) {
printf("dbjl_map_key(%s@%p, \"%.*s\")\t",
pjlink->pif->name, pjlink, (int) len, key);
printf(" jsonDepth=%d, parseDepth=%d, key_is_link=%d\n",
parser->jsonDepth, pjlink ? pjlink->parseDepth : 0, parser->key_is_link);
printf(" jsonDepth=%d, parseDepth=%d, dbfType=%d\n",
parser->jsonDepth, pjlink ? pjlink->parseDepth : 0, parser->dbfType);
}
assert(pjlink->parseDepth > 0);
@@ -219,8 +253,8 @@ static int dbjl_map_key(void *ctx, const unsigned char *key, size_t len) {
IFDEBUG(10) {
printf("dbjl_map_key(NULL, \"%.*s\")\t", (int) len, key);
printf(" jsonDepth=%d, parseDepth=00, key_is_link=%d\n",
parser->jsonDepth, parser->key_is_link);
printf(" jsonDepth=%d, parseDepth=00, dbfType=%d\n",
parser->jsonDepth, parser->dbfType);
}
link_name = dbmfStrndup((const char *) key, len);
@@ -241,27 +275,35 @@ static int dbjl_map_key(void *ctx, const unsigned char *key, size_t len) {
return dbjl_return(parser, jlif_stop);
}
dbmfFree(link_name);
pjlink = pjlif->alloc_jlink(parser->dbfType);
if (!pjlink) {
errlogPrintf("dbJLinkInit: Out of memory\n");
child = pjlif->alloc_jlink(parser->dbfType);
if (!child) {
errlogPrintf("dbJLinkInit: Link type '%s' allocation failed. \n",
link_name);
dbmfFree(link_name);
return dbjl_return(parser, jlif_stop);
}
pjlink->pif = pjlif;
pjlink->parent = NULL;
pjlink->parseDepth = 0;
pjlink->debug = !!parser->lset_debug;
child->pif = pjlif;
child->parseDepth = 0;
child->debug = 0;
if (parser->pjlink) {
/* We're starting a child link, save its parent */
pjlink->parent = parser->pjlink;
child->parent = pjlink;
if (pjlink->pif->start_child)
pjlink->pif->start_child(pjlink, child);
}
parser->pjlink = pjlink;
parser->key_is_link = 0;
else
child->parent = NULL;
parser->pjlink = child;
parser->dbfType = 0;
dbmfFree(link_name);
IFDEBUG(8)
printf("dbjl_map_key: New %s@%p\n", pjlink ? pjlink->pif->name : "", pjlink);
printf("dbjl_map_key: New %s@%p\n", child ? child->pif->name : "", child);
return jlif_continue;
}
@@ -274,9 +316,9 @@ static int dbjl_end_map(void *ctx) {
IFDEBUG(10) {
printf("dbjl_end_map(%s@%p)\t",
pjlink ? pjlink->pif->name : "NULL", pjlink);
printf(" jsonDepth=%d, parseDepth=%d, key_is_link=%d\n",
printf(" jsonDepth=%d, parseDepth=%d, dbfType=%d\n",
parser->jsonDepth, pjlink ? pjlink->parseDepth : 0,
parser->key_is_link);
parser->dbfType);
}
parser->jsonDepth--;
@@ -298,8 +340,8 @@ static int dbjl_start_array(void *ctx) {
IFDEBUG(10) {
printf("dbjl_start_array(%s@%p)\t", pjlink ? pjlink->pif->name : "", pjlink);
printf(" jsonDepth=%d, parseDepth=%d, key_is_link=%d\n",
parser->jsonDepth, pjlink ? pjlink->parseDepth : 0, parser->key_is_link);
printf(" jsonDepth=%d, parseDepth=%d, dbfType=%d\n",
parser->jsonDepth, pjlink ? pjlink->parseDepth : 0, parser->dbfType);
}
assert(pjlink);
@@ -316,8 +358,8 @@ static int dbjl_end_array(void *ctx) {
IFDEBUG(10) {
printf("dbjl_end_array(%s@%p)\t", pjlink ? pjlink->pif->name : "", pjlink);
printf(" jsonDepth=%d, parseDepth=%d, key_is_link=%d\n",
parser->jsonDepth, pjlink ? pjlink->parseDepth : 0, parser->key_is_link);
printf(" jsonDepth=%d, parseDepth=%d, dbfType=%d\n",
parser->jsonDepth, pjlink ? pjlink->parseDepth : 0, parser->dbfType);
}
assert(pjlink);
@@ -335,7 +377,7 @@ static yajl_callbacks dbjl_callbacks = {
};
long dbJLinkParse(const char *json, size_t jlen, short dbfType,
jlink **ppjlink, unsigned opts)
jlink **ppjlink)
{
parseContext context, *parser = &context;
yajl_alloc_funcs dbjl_allocs;
@@ -347,17 +389,14 @@ long dbJLinkParse(const char *json, size_t jlen, short dbfType,
parser->product = NULL;
parser->dbfType = dbfType;
parser->jsonDepth = 0;
parser->key_is_link = 0;
parser->parse_debug = !!(opts&LINK_DEBUG_JPARSE);
parser->lset_debug = !!(opts&LINK_DEBUG_LSET);
IFDEBUG(10)
printf("dbJLinkInit(\"%.*s\", %d, %p)\n",
(int) jlen, json, dbfType, ppjlink);
IFDEBUG(10)
printf("dbJLinkInit: jsonDepth=%d, key_is_link=%d\n",
parser->jsonDepth, parser->key_is_link);
printf("dbJLinkInit: jsonDepth=%d, dbfType=%d\n",
parser->jsonDepth, parser->dbfType);
yajl_set_default_alloc_funcs(&dbjl_allocs);
yh = yajl_alloc(&dbjl_callbacks, &dbjl_allocs, parser);
@@ -365,8 +404,14 @@ long dbJLinkParse(const char *json, size_t jlen, short dbfType,
return S_db_noMemory;
ys = yajl_parse(yh, (const unsigned char *) json, jlen);
if (ys == yajl_status_ok)
IFDEBUG(10)
printf("dbJLinkInit: yajl_parse() returned %d\n", ys);
if (ys == yajl_status_ok) {
ys = yajl_complete_parse(yh);
IFDEBUG(10)
printf("dbJLinkInit: yajl_complete_parse() returned %d\n", ys);
}
switch (ys) {
unsigned char *err;
@@ -378,6 +423,9 @@ long dbJLinkParse(const char *json, size_t jlen, short dbfType,
break;
case yajl_status_error:
IFDEBUG(10)
printf(" jsonDepth=%d, product=%p, pjlink=%p\n",
parser->jsonDepth, parser->product, parser->pjlink);
err = yajl_get_error(yh, 1, (const unsigned char *) json, jlen);
errlogPrintf("dbJLinkInit: %s\n", err);
yajl_free_error(yh, err);
@@ -389,18 +437,24 @@ long dbJLinkParse(const char *json, size_t jlen, short dbfType,
}
yajl_free(yh);
IFDEBUG(10)
printf("dbJLinkInit: returning status=0x%lx\n\n",
status);
return status;
}
long dbJLinkInit(struct link *plink)
{
jlink *pjlink;
assert(plink);
pjlink = plink->value.json.jlink;
if (pjlink)
plink->lset = pjlink->pif->get_lset(pjlink);
if (plink->type == JSON_LINK) {
jlink *pjlink = plink->value.json.jlink;
if (pjlink)
plink->lset = pjlink->pif->get_lset(pjlink);
}
dbLinkOpen(plink);
return 0;

View File

@@ -2,7 +2,7 @@
* Copyright (c) 2016 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbJLink.h */
@@ -21,12 +21,16 @@ typedef enum {
jlif_continue = 1
} jlif_result;
epicsShareExtern const char *jlif_result_name[2];
typedef enum {
jlif_key_stop = jlif_stop,
jlif_key_continue = jlif_continue,
jlif_key_child_link
jlif_key_child_inlink, jlif_key_child_outlink, jlif_key_child_fwdlink
} jlif_key_result;
epicsShareExtern const char *jlif_key_result_name[5];
struct link;
struct lset;
struct jlif;
@@ -35,7 +39,7 @@ typedef struct jlink {
struct jlif *pif; /* Link methods */
struct jlink *parent; /* NULL for top-level links */
int parseDepth; /* Used by parser, unused afterwards */
unsigned debug:1; /* set by caller of jlif operations to request debug output to console */
unsigned debug:1; /* Set to request debug output to console */
/* Link types extend or embed this structure for private storage */
} jlink;
@@ -72,8 +76,9 @@ typedef struct jlif {
/* Optional, parser saw a string value */
jlif_key_result (*parse_start_map)(jlink *);
/* Optional, parser saw an open-brace '{'. Return jlif_key_child_link
* to expect a child link next (extra key/value pairs may follow).
/* Optional, parser saw an open-brace '{'. Return jlif_key_child_inlink,
* jlif_key_child_outlink, or jlif_key_child_fwdlink to expect a child
* link next (extra key/value pairs may follow)
*/
jlif_result (*parse_map_key)(jlink *, const char *key, size_t len);
@@ -90,7 +95,8 @@ typedef struct jlif {
void (*end_child)(jlink *parent, jlink *child);
/* Optional, called with pointer to the new child link after
* parse_start_map() returned jlif_key_child_link */
* the child link has finished parsing successfully
*/
struct lset* (*get_lset)(const jlink *);
/* Required, return lset for this link instance */
@@ -98,7 +104,7 @@ typedef struct jlif {
void (*report)(const jlink *, int level, int indent);
/* Optional, print status information about this link instance, then
* if (level > 0) print a link identifier (at indent+2) and call
* dbJLinkReport(child, level-1, indent+4)
* dbJLinkReport(child, level-1, indent+4)
* for each child.
*/
@@ -107,13 +113,19 @@ typedef struct jlif {
* Stop immediately and return status if non-zero.
*/
void (*start_child)(jlink *parent, jlink *child);
/* Optional, called with pointer to the new child link after
* parse_start_map() returned a jlif_key_child_link value and
* the child link has been allocated (but not parsed yet)
*/
/* Link types must NOT extend this table with their own routines,
* this space is reserved for extensions to the jlink interface.
*/
} jlif;
epicsShareFunc long dbJLinkParse(const char *json, size_t len, short dbfType,
jlink **ppjlink, unsigned opts);
jlink **ppjlink);
epicsShareFunc long dbJLinkInit(struct link *plink);
epicsShareFunc void dbJLinkFree(jlink *);
@@ -130,4 +142,3 @@ epicsShareFunc long dbJLinkMapAll(char *recname, jlink_map_fn rtn, void *ctx);
#endif
#endif /* INC_dbJLink_H */

View File

@@ -265,8 +265,19 @@ int dbIsLinkConnected(const struct link *plink)
{
lset *plset = plink->lset;
if (!plset || !plset->isConnected)
if (!plset)
return FALSE;
if (!plset->isVolatile)
return TRUE;
if (!plset->isConnected) {
struct dbCommon *precord = plink->precord;
errlogPrintf("dbLink: Link type for '%s.%s' is volatile but has no"
" lset::isConnected() method\n",
precord->name, dbLinkFieldName(plink));
return FALSE;
}
return plset->isConnected(plink);
}

View File

@@ -27,54 +27,337 @@ extern "C" {
struct dbLocker;
/** @file dbLink.h
* @brief Link Support API
*
* Link support run-time API, all link types provide an lset which is used by
* the IOC database to control and operate the link. This file also declares the
* dbLink routines that IOC, record and device code can call to perform link
* operations.
*/
/** @brief callback routine for locked link operations
*
* Called by the lset::doLocked method to permit multiple link operations
* while the link instance is locked.
*
* @param plink the link
* @param priv context for the callback routine
*/
typedef long (*dbLinkUserCallback)(struct link *plink, void *priv);
/** @brief Link Support Entry Table
*
* This structure provides information about and methods for an individual link
* type. A pointer to this structure is included in every link's lset field, and
* is used to perform operations on the link. For JSON links the pointer is
* obtained by calling pjlink->pif->get_lset() at link initialization time,
* immediately before calling dbLinkOpen() to activate the link.
*/
typedef struct lset {
/* Characteristics of the link type */
/** @brief link constancy
*
* 1 means this is a constant link type whose value doesn't change.
* The link's value will be obtained using one of the methods loadScalar,
* loadLS or loadArray.
*/
const unsigned isConstant:1;
/** @brief link volatility
*
* 0 means the link is always connected.
*/
const unsigned isVolatile:1;
/* Activation */
/** @brief activate link
*
* Optional, called whenever a JSON link is initialized or added at runtime.
*
* @param plink the link
*/
void (*openLink)(struct link *plink);
/* Destructor */
/** @brief deactivate link
*
* Optional, called whenever a link address is changed at runtime, or the
* IOC is shutting down.
*
* @param locker
* @param plink the link
*/
void (*removeLink)(struct dbLocker *locker, struct link *plink);
/* Const init, data type hinting */
/* Constant link initialization and data type hinting */
/** @brief load constant scalar from link type
*
* Usually called during IOC initialization, constant link types must copy a
* scalar value of the indicated data type to the buffer provided and return
* 0. A non-constant link type can use this method call as an early hint
* that subsequent calls to dbGetLink() will request scalar data of the
* indicated type, although the type might change.
*
* @param plink the link
* @param dbrType data type code
* @param pbuffer where to put the value
* @returns 0 if a value was loaded, non-zero otherwise
*/
long (*loadScalar)(struct link *plink, short dbrType, void *pbuffer);
/** @brief load constant long string from link type
*
* Usually called during IOC initialization, constant link types must copy a
* nil-terminated string up to size characters long to the buffer provided,
* and write the length of that string to the plen location. A non-constant
* link type can use this as an early hint that subsequent calls to
* dbGetLink() will request long string data, although this might change.
*
* @param plink the link
* @param pbuffer where to put the string
* @param size length of pbuffer in chars
* @param plen set to number of chars written
* @returns status value
*/
long (*loadLS)(struct link *plink, char *pbuffer, epicsUInt32 size,
epicsUInt32 *plen);
/** @brief load constant array from link type
*
* Usually called during IOC initialization, constant link types must copy
* an array value of the indicated data type to the buffer provided, update
* the pnRequest location to indicate how many elements were loaded, and
* return 0. A non-constant link type can use this method call as an early
* hint that subsequent calls to dbGetLink() will request array data of the
* indicated type and max size, although the request might change.
*
* @param plink the link
* @param dbrType data type code
* @param pbuffer where to put the value
* @param pnRequest Max elements on entry, actual on exit
* @returns 0 if elements were loaded, non-zero otherwise
*/
long (*loadArray)(struct link *plink, short dbrType, void *pbuffer,
long *pnRequest);
/* Metadata */
/** @brief return link connection status
*
* Return an indication whether this link is connected or not. This routine
* is polled by the calcout and some external record types. Not required for
* non-volatile link types, which are by definition always connected.
*
* @param plink the link
* @returns 1 if connected, 0 if disconnected
*/
int (*isConnected)(const struct link *plink);
/** @brief get data type of link destination
*
* Called on both input and output links by long string support code to
* decide whether to use DBR_CHAR/DBR_UCHAR or DBR_STRING for a subsequent
* dbPutLink() or dbGetLink() call. Optional, but if not provided long
* strings cannot be transported over this link type, and no warning or
* error will appear to explain why. Not required for constant link types.
*
* @param plink the link
* @returns DBF_* type code, or -1 on error/disconnected link
*/
int (*getDBFtype)(const struct link *plink);
long (*getElements)(const struct link *plink, long *nelements);
/* Get data */
/** @brief get array size of an input link
*
* Called on input links by the compress record type for memory allocation
* purposes, before using the dbGetLink() routine to fetch the actual
* array data.
*
* @param plink the link
* @param pnElements where to put the answer
* @returns status value
*/
long (*getElements)(const struct link *plink, long *pnElements);
/** @brief get value from an input link
*
* Called to fetch data from the link, which must be converted into the
* given data type and placed in the buffer indicated. The actual number of
* elements retrieved should be updated in the pnRequest location. If this
* method returns an error status value, the link's record will be placed
* into an Invalid severity / Link Alarm state by the dbGetLink() routine
* that calls this method.
*
* @param plink the link
* @param dbrType data type code
* @param pbuffer where to put the value
* @param pnRequest max elements on entry, actual on exit
* @returns status value
*/
long (*getValue)(struct link *plink, short dbrType, void *pbuffer,
long *pnRequest);
/** @brief get the control range for an output link
*
* Called to fetch the control range for the link target, as a pair of
* double values for the lowest and highest values that the target will
* accept. This method is not used at all by the IOC or built-in record
* types, although external record types may require it.
*
* @param plink the link
* @param lo lowest accepted value
* @param hi highest accepted value
* @returns status value
*/
long (*getControlLimits)(const struct link *plink, double *lo, double *hi);
/** @brief get the display range from an input link
*
* Called to fetch the display range for an input link target, as a pair of
* double values for the lowest and highest values that the PV expects to
* return. This method is used by several built-in record types to obtain
* the display range for their generic input links.
*
* @param plink the link
* @param lo lowest accepted value
* @param hi highest accepted value
* @returns status value
*/
long (*getGraphicLimits)(const struct link *plink, double *lo, double *hi);
/** @brief get the alarm limits from an input link
*
* Called to fetch the alarm limits for an input link target, as four
* double values for the warning and alarm levels that the PV checks its
* value against. This method is used by several built-in record types to
* obtain the alarm limits for their generic input links.
*
* @param plink the link
* @param lolo low alarm value
* @param lo low warning value
* @param hi high warning value
* @param hihi high alarm value
* @returns status value
*/
long (*getAlarmLimits)(const struct link *plink, double *lolo, double *lo,
double *hi, double *hihi);
/** @brief get the precision from an input link
*
* Called to fetch the precision for an input link target. This method is
* used by several built-in record types to obtain the precision for their
* generic input links.
*
* @param plink the link
* @param precision where to put the answer
* @returns status value
*/
long (*getPrecision)(const struct link *plink, short *precision);
/** @brief get the units string from an input link
*
* Called to fetch the units string for an input link target. This method is
* used by several built-in record types to obtain the units string for
* their generic input links.
*
* @param plink the link
* @param units where to put the answer
* @param unitsSize buffer size for the answer
* @returns status value
*/
long (*getUnits)(const struct link *plink, char *units, int unitsSize);
/** @brief get the alarm condition from an input link
*
* Called to fetch the alarm status and severity for an input link target.
* Either status or severity pointers may be NULL when that value is not
* needed by the calling code. This method is used by several built-in
* record types to obtain the alarm condition for their generic input links.
*
* @param plink the link
* @param status where to put the alarm status (or NULL)
* @param severity where to put the severity (or NULL)
* @returns status value
*/
long (*getAlarm)(const struct link *plink, epicsEnum16 *status,
epicsEnum16 *severity);
/** @brief get the time-stamp from an input link
*
* Called to fetch the time-stamp for an input link target. This method is
* used by many built-in device supports to obtain the precision for their
* generic input links.
*
* @param plink the link
* @param pstamp where to put the answer
* @returns status value
*/
long (*getTimeStamp)(const struct link *plink, epicsTimeStamp *pstamp);
/* Put data */
/** @brief put a value to an output link
*
* Called to send nRequest elements of type dbrType found at pbuffer to an
* output link target.
*
* @param plink the link
* @param dbrType data type code
* @param pbuffer where to put the value
* @param nRequest number of elements to send
* @returns status value
*/
long (*putValue)(struct link *plink, short dbrType,
const void *pbuffer, long nRequest);
/** @brief put a value to an output link with asynchronous completion
*
* Called to send nRequest elements of type dbrType found at pbuffer to an
* output link target. If the return status is zero, the link type will
* later indicate the put has completed by calling dbLinkAsyncComplete()
* from a background thread, which will be used to continue the record
* process operation from where it left off.
*
* @param plink the link
* @param dbrType data type code
* @param pbuffer where to put the value
* @param nRequest number of elements to send
* @returns status value
*/
long (*putAsync)(struct link *plink, short dbrType,
const void *pbuffer, long nRequest);
/* Process */
/** @brief trigger processing of a forward link
*
* Called to trigger processing of the record pointed to by a forward link.
* This routine is optional, but if not provided no warning message will be
* shown when called by dbScanFwdLink(). JSON link types that do not support
* this operation should return NULL from their jlif::alloc_jlink() method
* if it gets called with a dbfType of DBF_FWDLINK.
*
* @param plink the link
*/
void (*scanForward)(struct link *plink);
/* Atomicity */
/** @brief execute a callback routine with link locked
*
* Called on an input link when multiple link attributes need to be fetched
* in an atomic fashion. The link type must call the callback routine and
* prevent any background I/O from updating any cached link data until that
* routine returns. This method is used by most input device support to
* fetch the timestamp along with the value when the record's TSE field is
* set to epicsTimeEventDeviceTime.
*
* @param plink the link
* @param rtn routine to execute
* @returns status value
*/
long (*doLocked)(struct link *plink, dbLinkUserCallback rtn, void *priv);
} lset;
@@ -99,9 +382,10 @@ epicsShareFunc long dbLoadLink(struct link *plink, short dbrType,
epicsShareFunc long dbLoadLinkArray(struct link *, short dbrType, void *pbuffer,
long *pnRequest);
epicsShareFunc long dbGetNelements(const struct link *plink, long *nelements);
epicsShareFunc long dbGetNelements(const struct link *plink, long *pnElements);
epicsShareFunc int dbIsLinkConnected(const struct link *plink); /* 0 or 1 */
epicsShareFunc int dbGetLinkDBFtype(const struct link *plink);
epicsShareFunc long dbGetLink(struct link *, short dbrType, void *pbuffer,
long *options, long *nRequest);
epicsShareFunc long dbGetControlLimits(const struct link *plink, double *low,

View File

@@ -13,6 +13,8 @@
#ifndef INCdbLockh
#define INCdbLockh
#include <stddef.h>
#include "ellLib.h"
#include "shareLib.h"

View File

@@ -24,6 +24,7 @@
#include "cantProceed.h"
#include "dbDefs.h"
#include "ellLib.h"
#include "epicsAtomic.h"
#include "epicsEvent.h"
#include "epicsMutex.h"
#include "epicsPrint.h"
@@ -63,6 +64,7 @@ static volatile enum ctl scanCtl;
static int onceQueueSize = 1000;
static epicsEventId onceSem;
static epicsRingBytesId onceQ;
static int onceQOverruns = 0;
static epicsThreadId onceTaskId;
static void *exitOnce;
@@ -676,6 +678,7 @@ int scanOnceCallback(struct dbCommon *precord, once_complete cb, void *usr)
if (!pushOK) {
if (newOverflow) errlogPrintf("scanOnce: Ring buffer overflow\n");
newOverflow = FALSE;
epicsAtomicIncrIntT(&onceQOverruns);
} else {
newOverflow = TRUE;
}
@@ -722,6 +725,40 @@ int scanOnceSetQueueSize(int size)
return 0;
}
int scanOnceQueueStatus(const int reset, scanOnceQueueStats *result)
{
int ret;
if (!onceQ) return -1;
if (result) {
result->size = epicsRingBytesSize(onceQ) / sizeof(onceEntry);
result->numUsed = epicsRingBytesUsedBytes(onceQ) / sizeof(onceEntry);
result->maxUsed = epicsRingBytesHighWaterMark(onceQ) / sizeof(onceEntry);
result->numOverflow = epicsAtomicGetIntT(&onceQOverruns);
ret = 0;
} else {
ret = -2;
}
if (reset) {
epicsRingBytesResetHighWaterMark(onceQ);
}
return ret;
}
void scanOnceQueueShow(const int reset)
{
scanOnceQueueStats stats;
if (scanOnceQueueStatus(reset, &stats) == -1) {
fprintf(stderr, "scanOnce system not initialized, yet. Please run "
"iocInit before using this command.\n");
} else {
double qusage = 100.0 * stats.numUsed / stats.size;
printf("PRIORITY HIGH-WATER MARK ITEMS IN Q Q SIZE %% USED Q OVERFLOWS\n");
printf("%8s %15d %10d %6d %6.1f %11d\n", "scanOnce", stats.maxUsed,
stats.numUsed, stats.size, qusage,
epicsAtomicGetIntT(&onceQOverruns));
}
}
static void initOnce(void)
{
if ((onceQ = epicsRingBytesLockedCreate(sizeof(onceEntry)*onceQueueSize)) == NULL) {

View File

@@ -19,6 +19,7 @@
#include "menuScan.h"
#include "shareLib.h"
#include "compilerDependencies.h"
#include "devSup.h"
#ifdef __cplusplus
extern "C" {
@@ -33,9 +34,7 @@ extern "C" {
#define MIN_PHASE SHRT_MIN
/*definitions for I/O Interrupt Scanning */
struct ioscan_head;
typedef struct ioscan_head *IOSCANPVT;
/* IOSCANPVT now defined in devSup.h */
typedef struct event_list *EVENTPVT;
struct dbCommon;
@@ -43,6 +42,13 @@ struct dbCommon;
typedef void (*io_scan_complete)(void *usr, IOSCANPVT, int prio);
typedef void (*once_complete)(void *usr, struct dbCommon*);
typedef struct scanOnceQueueStats {
int size;
int numUsed;
int maxUsed;
int numOverflow;
} scanOnceQueueStats;
epicsShareFunc long scanInit(void);
epicsShareFunc void scanRun(void);
epicsShareFunc void scanPause(void);
@@ -58,6 +64,8 @@ epicsShareFunc double scanPeriod(int scan);
epicsShareFunc int scanOnce(struct dbCommon *);
epicsShareFunc int scanOnceCallback(struct dbCommon *, once_complete cb, void *usr);
epicsShareFunc int scanOnceSetQueueSize(int size);
epicsShareFunc int scanOnceQueueStatus(const int reset, scanOnceQueueStats *result);
epicsShareFunc void scanOnceQueueShow(const int reset);
/*print periodic lists*/
epicsShareFunc int scanppl(double rate);

View File

@@ -37,6 +37,9 @@ dbStateId dbStateFind(const char *name)
ELLNODE *node;
dbStateId id;
if (!name)
return NULL;
for (node = ellFirst(&states); node; node = ellNext(node)) {
id = CONTAINER(node, dbState, node);
if (strcmp(id->name, name) == 0)
@@ -49,6 +52,9 @@ dbStateId dbStateCreate(const char *name)
{
dbStateId id;
if (!name)
return NULL;
if ((id = dbStateFind(name)))
return id;

View File

@@ -15,6 +15,10 @@
#include "shareLib.h"
#ifdef __cplusplus
extern "C" {
#endif
/** @file dbState.h
* @brief Generic IOC state facility
*
@@ -89,4 +93,9 @@ epicsShareFunc void dbStateShow(dbStateId id, unsigned int level);
*/
epicsShareFunc void dbStateShowAll(unsigned int level);
#ifdef __cplusplus
}
#endif
#endif // INCdbStateH

View File

@@ -1,11 +1,48 @@
#*************************************************************************
# Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
# Copyright (c) 2018 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 file LICENSE that is included with this distribution.
#*************************************************************************
=head1 Menu menuScan
This menu is used for the C<SCAN> field of all record types.
The set of periodic scan rates may be modified for an individual IOC by
copying the F<menuScan.dbd> file from Base into the IOC's source
directory and changing it to contain the desired scan rates.
The scan periods are extracted from the choice strings at runtime, which
must be expressed as a number with any of the following units appended:
=over 4
second
seconds
minute
minutes
hour
hours
Hertz
Hz
=back
At IOC start-up a separate scan thread will be created for each period,
with thread priority increasing further down the list, so faster periods
should appear after slower ones.
Scan rates that cannot be achieved will generate a warning message from
the C<iocInit> command.
=menu menuScan
=cut
menu(menuScan) {
choice(menuScanPassive,"Passive")
choice(menuScanEvent,"Event")

View File

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

View File

@@ -175,6 +175,8 @@ testHarness_SRCS += epicsRunDbTests.c
dbTestHarness_SRCS += $(testHarness_SRCS)
dbTestHarness_SRCS_RTEMS += rtemsTestHarness.c
PROD_SRCS_RTEMS += rtemsTestData.c
PROD_vxWorks = dbTestHarness
PROD_RTEMS = dbTestHarness
@@ -182,6 +184,10 @@ TESTSPEC_vxWorks = dbTestHarness.munch; epicsRunDbTests
TESTSPEC_RTEMS = dbTestHarness.boot; epicsRunDbTests
TESTSCRIPTS_HOST += $(TESTS:%=%.t)
ifneq ($(filter $(T_A),$(CROSS_COMPILER_RUNTEST_ARCHS)),)
TESTPROD_RTEMS = $(TESTPROD_HOST)
TESTSCRIPTS_RTEMS += $(TESTS:%=%.t)
endif
include $(TOP)/configure/RULES
@@ -193,3 +199,5 @@ devx$(DEP): $(COMMON_DIR)/xRecord.h
scanIoTest$(DEP): $(COMMON_DIR)/xRecord.h
xRecord$(DEP): $(COMMON_DIR)/xRecord.h
rtemsTestData.c : $(TESTFILES) $(TOOLS)/epicsMakeMemFs.pl
$(PERL) $(TOOLS)/epicsMakeMemFs.pl $@ epicsRtemsFSImage $(TESTFILES)

View File

@@ -14,3 +14,8 @@ record(x, "eINST_IO") {
field(DTYP, "Unit Test INST_IO")
field(INP, "hello")
}
record(x, "eINST_IO2") {
field(DTYP, "Unit Test INST_IO")
field(INP, "RL @no")
}

View File

@@ -60,7 +60,9 @@ static const struct testParseDataT {
TEST_PV_LINK(" world MSICP", "world", pvlOptMSI|pvlOptCP),
{"#C14 S145 @testing", {VME_IO, "testing", 0, "CS", {14, 145}}},
{"#C14 S145", {VME_IO, "", 0, "CS", {14, 145}}},
{"#B11 C12 N13 A14 F15 @cparam", {CAMAC_IO, "cparam", 0, "BCNAF", {11, 12, 13, 14, 15}}},
{"#B11 C12 N13 A14 F15", {CAMAC_IO, "", 0, "BCNAF", {11, 12, 13, 14, 15}}},
{" #B111 C112 N113 @cparam", {CAMAC_IO, "cparam", 0, "BCN", {111, 112, 113}}},
{" @hello world ", {INST_IO, "hello world", 0, "", /*{}*/}},
{" {\"x\":true} ", {JSON_LINK, "{\"x\":true}", 0, "", /*{}*/}},
@@ -87,11 +89,15 @@ static void testLinkParse(void)
for (;td->str; td++) {
int i, N;
testDiag("Parsing \"%s\"", td->str);
testOk(dbParseLink(td->str, DBF_INLINK, &info, 0) == 0, "Parser returned OK");
testOk(dbParseLink(td->str, DBF_INLINK, &info) == 0, "Parser returned OK");
if (!testOk(info.ltype == td->info.ltype, "Link type value"))
testDiag("Expected %d, got %d", td->info.ltype, info.ltype);
if (td->info.target)
if (td->info.target && info.target)
testStrcmp(0, info.target, td->info.target);
else if(!!td->info.target ^ !!info.target)
testFail("info target NULL mis-match %s %s", info.target, td->info.target);
else
testPass("info target NULL as expected");
if (info.ltype == td->info.ltype) {
switch (info.ltype) {
case PV_LINK:
@@ -125,7 +131,6 @@ static const char *testParseFailData[] = {
"#A0 B @",
"#A0 B C @",
"#R1 M2 D3 E4 @oops", /* RF_IO has no parm */
"#C1 S2", /* VME_IO needs parm */
NULL
};
@@ -147,7 +152,7 @@ static void testLinkFailParse(void)
eltc(1);
for(;*td; td++) {
testOk(dbParseLink(*td, DBF_INLINK, &info, 0) == S_dbLib_badField,
testOk(dbParseLink(*td, DBF_INLINK, &info) == S_dbLib_badField,
"dbParseLink correctly rejected \"%s\"", *td);
}
@@ -480,6 +485,13 @@ static void testLinkInitFail(void)
testOk1(plink->type == INST_IO);
testOk1(plink->value.instio.string != NULL);
testdbGetFieldEqual("eINST_IO2.INP", DBR_STRING, "@");
prec = (xRecord *) testdbRecordPtr("eINST_IO2");
plink = &prec->inp;
testOk1(plink->type == INST_IO);
testOk1(plink->value.instio.string != NULL);
testIocShutdownOk();
testdbCleanup();
@@ -684,7 +696,7 @@ void testTSEL(void)
MAIN(dbPutLinkTest)
{
testPlan(320);
testPlan(337);
testLinkParse();
testLinkFailParse();
testCADBSet();

View File

@@ -228,6 +228,11 @@ MAIN(dbStressTest)
testPlan(80+nworkers*3);
#if defined(__rtems__)
testSkip(80+nworkers*3, "Test assumes time sliced preempting scheduling");
return testDone();
#endif
priv = callocMustSucceed(nworkers, sizeof(*priv), "no memory");
testDiag("lock set stress test");

View File

@@ -246,7 +246,8 @@ static jlif jlifZ = {
NULL, /* end child */
&z_lset,
NULL, /* report */
NULL /* map child */
NULL, /* map child */
NULL /* start child */
};
epicsExportAddress(jlif, jlifZ);

View File

@@ -2,7 +2,7 @@
* Copyright (c) 2016 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* xLink.c */
@@ -82,7 +82,6 @@ static jlif xlinkIf = {
NULL, NULL, NULL,
NULL, NULL,
NULL, xlink_get_lset,
NULL, NULL
NULL, NULL, NULL
};
epicsExportAddress(jlif, xlinkIf);

View File

@@ -2241,7 +2241,7 @@ long dbInitRecordLinks(dbRecordType *rtyp, struct dbCommon *prec)
if(!plink->text)
continue;
if(dbParseLink(plink->text, pflddes->field_type, &link_info, 0)!=0) {
if(dbParseLink(plink->text, pflddes->field_type, &link_info)!=0) {
/* This was already parsed once when ->text was set.
* Any syntax error messages were printed at that time.
*/
@@ -2270,7 +2270,7 @@ void dbFreeLinkInfo(dbLinkInfo *pinfo)
pinfo->target = NULL;
}
long dbParseLink(const char *str, short ftype, dbLinkInfo *pinfo, unsigned opts)
long dbParseLink(const char *str, short ftype, dbLinkInfo *pinfo)
{
char *pstr;
size_t len;
@@ -2306,7 +2306,7 @@ long dbParseLink(const char *str, short ftype, dbLinkInfo *pinfo, unsigned opts)
/* Check for braces => JSON */
if (*str == '{' && str[len-1] == '}') {
if (dbJLinkParse(str, len, ftype, &pinfo->jlink, opts))
if (dbJLinkParse(str, len, ftype, &pinfo->jlink))
goto fail;
pinfo->ltype = JSON_LINK;
@@ -2353,9 +2353,13 @@ long dbParseLink(const char *str, short ftype, dbLinkInfo *pinfo, unsigned opts)
else if (strcmp(pinfo->hwid, "VS")==0) pinfo->ltype = VXI_IO;
else goto fail;
if (parm && pinfo->ltype != RF_IO) {
/* move parm string to beginning of buffer */
memmove(pinfo->target, parm, len + 1);
if (pinfo->ltype != RF_IO) {
if (!parm) {
pinfo->target[0] = '\0';
} else {
/* move parm string to beginning of buffer */
memmove(pinfo->target, parm, len + 1);
}
} else if (!parm && pinfo->ltype == RF_IO) {
/* RF_IO, the string isn't needed at all */
free(pinfo->target);
@@ -2641,21 +2645,8 @@ long dbPutString(DBENTRY *pdbentry,const char *pstring)
case DBF_FWDLINK: {
dbLinkInfo link_info;
DBLINK *plink = (DBLINK *)pfield;
DBENTRY infoentry;
unsigned opts = 0;
if(pdbentry->precnode && ellCount(&pdbentry->precnode->infoList)) {
dbCopyEntryContents(pdbentry, &infoentry);
if(dbFindInfo(&infoentry, "base:lsetDebug")==0 && epicsStrCaseCmp(dbGetInfoString(&infoentry), "YES")==0)
opts |= LINK_DEBUG_LSET;
if(dbFindInfo(&infoentry, "base:jlinkDebug")==0 && epicsStrCaseCmp(dbGetInfoString(&infoentry), "YES")==0)
opts |= LINK_DEBUG_JPARSE;
dbFinishEntry(&infoentry);
}
status = dbParseLink(pstring, pflddes->field_type, &link_info, opts);
status = dbParseLink(pstring, pflddes->field_type, &link_info);
if (status) break;
if (plink->type==CONSTANT && plink->value.constantStr==NULL) {

View File

@@ -5,7 +5,7 @@
* 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.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbStaticPvt.h */
/*
@@ -59,13 +59,10 @@ typedef struct dbLinkInfo {
long dbInitRecordLinks(dbRecordType *rtyp, struct dbCommon *prec);
#define LINK_DEBUG_LSET 1
#define LINK_DEBUG_JPARSE 2
/* Parse link string. no record locks needed.
* on success caller must free pinfo->target
*/
epicsShareFunc long dbParseLink(const char *str, short ftype, dbLinkInfo *pinfo, unsigned opts);
epicsShareFunc long dbParseLink(const char *str, short ftype, dbLinkInfo *pinfo);
/* Check if link type allow the parsed link value pinfo
* to be assigned to the given link.
* Record containing plink must be locked.

View File

@@ -6,7 +6,11 @@
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* devSup.h Device Support */
/** @file devSup.h
*
* @brief Device support routines
*/
/*
* Author: Marty Kraimer
* Date: 6-1-90
@@ -21,6 +25,111 @@
/* structures defined elsewhere */
struct dbCommon;
struct devSup;
typedef struct ioscan_head *IOSCANPVT;
struct link; /* aka DBLINK */
/** Type safe version of 'struct dset'
*
* Recommended usage:
*
* In Makefile:
@code
USR_CFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET
@endcode
*
* In C source file:
@code
#include <devSup.h>
#include <dbScan.h> // For IOCSCANPVT
...
#include <epicsExport.h> // defines epicsExportSharedSymbols
...
static long init_record(dbCommon *prec);
static long get_iointr_info(int detach, dbCommon *prec, IOCSCANPVT* pscan);
static long longin_read(longinRecord *prec);
const struct {
dset common;
long (*read)(longinRecord *prec);
} devLiDevName = {
{
5, // 4 from dset + 1 from longinRecord
NULL,
NULL,
&init_record,
&get_iointr_info
},
&longin_read
};
epicsExportAddress(dset, devLiDevName);
@endcode
*/
typedef struct typed_dset {
/** Number of function pointers which follow.
* The value depends on the recordtype, but must be >=4 */
long number;
/** Called from dbior() */
long (*report)(int lvl);
/** Called twice during iocInit().
* First with @a after = 0 before init_record() or array field allocation.
* Again with @a after = 1 after init_record() has finished.
*/
long (*init)(int after);
/** Called once per record instance */
long (*init_record)(struct dbCommon *prec);
/** Called when SCAN="I/O Intr" on startup, or after SCAN is changed.
*
* Caller must assign the third arguement (IOCSCANPVT*). eg.
@code
struct mpvt {
IOSCANPVT drvlist;
};
...
// init_record() routine calls
scanIoInit(&pvt->drvlist);
...
static long get_ioint_info(int detach, struct dbCommon *prec, IOCSCANPVT* pscan) {
if(prec->dpvt)
*pscan = &((mypvt*)prec->dpvt)->drvlist;
@endcode
*
* When a particular record instance can/will only used a single scan list,
* the @a detach argument can be ignored.
*
* If this is not the case, then the following should be noted.
* + get_ioint_info() is called with @a detach = 0 to fetch the scan list to
* which this record will be added.
* + get_ioint_info() is called later with @a detach = 1 to fetch the scan
* list from which this record should be removed.
* + Calls will be balanced, so a call with @a detach = 0 will be followed
* by one with @a detach = 1.
*
* @note get_ioint_info() will be called during IOC shutdown if the
* dsxt::del_record() extended callback is defined. (from 3.15.0.1)
*/
long (*get_ioint_info)(int detach, struct dbCommon *prec, IOSCANPVT* pscan);
/* Any further functions are specified by the record type. */
} typed_dset;
/** Device support extension table.
*
* Optional routines to allow run-time address modifications to be communicated
* to device support, which must register a struct dsxt by calling devExtend()
* from its init() routine.
*/
typedef struct dsxt {
/** Optional, called to offer device support a new record to control.
*
* Routine may return a non-zero error code to refuse record.
*/
long (*add_record)(struct dbCommon *precord);
/** Optional, called to remove record from device support control.
*
* Routine return a non-zero error code to refuse record removal.
*/
long (*del_record)(struct dbCommon *precord);
/* Only future Base releases may extend this table. */
} dsxt;
#ifdef __cplusplus
extern "C" {
@@ -29,6 +138,8 @@ extern "C" {
typedef long (*DEVSUPFUN)(); /* ptr to device support function*/
#endif
#ifndef USE_TYPED_DSET
typedef struct dset { /* device support entry table */
long number; /*number of support routines*/
DEVSUPFUN report; /*print report*/
@@ -38,11 +149,15 @@ typedef struct dset { /* device support entry table */
/*other functions are record dependent*/
} dset;
typedef struct dsxt { /* device support extension table */
long (*add_record)(struct dbCommon *precord);
long (*del_record)(struct dbCommon *precord);
/* Recordtypes are *not* allowed to extend this table */
} dsxt;
#else
typedef typed_dset dset;
#endif /* USE_TYPED_DSET */
/** Fetch INP or OUT link (or NULL if record type has neither).
*
* Recommended for use in device support init_record()
*/
epicsShareFunc struct link* dbGetDevLink(struct dbCommon* prec);
epicsShareExtern dsxt devSoft_DSXT; /* Allow anything table */

View File

@@ -6,7 +6,10 @@
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* drvSup.h Driver Support */
/** @file drvSup.h
*
* @brief Driver support routines.
*/
/*
* Author: Marty Kraimer
@@ -18,16 +21,38 @@
#include "errMdef.h"
typedef long (*DRVSUPFUN) (); /* ptr to driver support function*/
/** Driver entry table */
typedef struct typed_drvet {
/** Number of function pointers which follow. Must be >=2 */
long number;
/** Called from dbior() */
long (*report)(int lvl);
/** Called during iocInit() */
long (*init)(void);
/* Any further functions are driver-specific */
} typed_drvet;
#ifdef USE_TYPED_DRVET
typedef typed_drvet drvet;
#else
/* These interfaces may eventually get deprecated */
typedef long (*DRVSUPFUN) (); /* ptr to driver support function */
typedef struct drvet { /* driver entry table */
long number; /* number of support routines */
DRVSUPFUN report; /* print report */
DRVSUPFUN init; /* init support */
/* Any further functions are driver-specific */
} drvet;
typedef struct drvet { /* driver entry table */
long number; /*number of support routines*/
DRVSUPFUN report; /*print report*/
DRVSUPFUN init; /*init support*/
/*other functions are device dependent*/
}drvet;
#define DRVETNUMBER ( (sizeof(struct drvet) -sizeof(long))/sizeof(DRVSUPFUN) )
#endif /* USE_TYPED_DRVET */
#define S_drv_noDrvSup (M_drvSup| 1) /*SDR_DRVSUP: Driver support missing*/
#define S_drv_noDrvet (M_drvSup| 3) /*Missing driver support entry table*/

File diff suppressed because it is too large Load Diff

View File

@@ -34,10 +34,10 @@ be written to stdout unless the -o option is given.</p>
<dl>
<dt><tt>-V</tt></dt>
<dd>Verbose warnings; if this parameter is specified then any undefined
macro discovered in the template file which does not have an associated
default value is considered an error. An error message is generated, and
when msi terminates it will do so with an exit status of 2.</dd>
<dd>Verbose warnings; if this parameter is specified then any undefined or
recursive macros discovered in the template will be considered an error and
will be marked in the output file. An error message will be shown, and when
msi terminates it will do so with an exit status of 2.</dd>
<dt><tt>-g</tt></dt>
<dd>When this flag is given all macros defined in a substitution file will

View File

@@ -17,8 +17,9 @@ TESTS += msi
TESTSCRIPTS_HOST += $(TESTS:%=%.t)
TARGETS_HOST += msi-copy$(EXE)
TARGETS += $(TARGETS_$(BUILD_CLASS))
ifneq (,$(findstring $(T_A),$(EPICS_HOST_ARCH) $(CROSS_COMPILER_RUNTEST_ARCHS)))
TARGETS_HOST += msi-copy$(EXE)
endif
include $(TOP)/configure/RULES

View File

@@ -31,18 +31,18 @@ ok(msi('-S ../t5-substitute.txt ../t5-template.txt'), slurp('../t5-result.txt'))
# Substitution file, pattern format
ok(msi('-S../t6-substitute.txt ../t6-template.txt'), slurp('../t6-result.txt'));
# Output option -o
# Output option -o and verbose option -V
my $out = 't7-output.txt';
my $count = 5; # Try up to 5 times...
my $result;
do {
unlink $out;
msi("-I.. -o $out ../t1-template.txt");
msi("-I.. -V -o $out ../t1-template.txt");
$result = slurp($out);
print "# msi output file empty, retrying\n"
if $result eq '';
} while ($result eq '') && (--$count > 0);
ok($result, slurp('../t1-result.txt'));
ok($result, slurp('../t7-result.txt'));
# Dependency generation, include/substitute model
ok(msi('-I.. -D -o t8.txt ../t1-template.txt'), slurp('../t8-result.txt'));

View File

@@ -1,6 +1,6 @@
This is t1-template.txt
With $(a,undefined) & $(b,undefined):
With $(a) & $(b):
This is t1-include.txt
a = default value used when a is undefined
b = default value used when b is undefined

View File

@@ -1,6 +1,6 @@
a = va1-a b = def-b c = def-c d = $(d,undefined)
a = va2-a b = va2-b c = def-c d = $(d,undefined)
a = va3-a b = va3-b c = va3-c d = $(d,undefined)
a = va4-a b = va4-b c = def-c d = $(d,undefined)
a = va5-a b = def-b c = def-c d = $(d,undefined)
a = pt3-a b = pt3-b c = pt3-c d = $(d,undefined)
a = va1-a b = def-b c = def-c d = $(d)
a = va2-a b = va2-b c = def-c d = $(d)
a = va3-a b = va3-b c = va3-c d = $(d)
a = va4-a b = va4-b c = def-c d = $(d)
a = va5-a b = def-b c = def-c d = $(d)
a = pt3-a b = pt3-b c = pt3-c d = $(d)

View File

@@ -1,28 +1,28 @@
a = gb1-a b = gb1-b c = def-c d = $(d,undefined)
a = va1-a b = gb1-b c = def-c d = $(d,undefined)
a = va2-a b = va2-b c = def-c d = $(d,undefined)
a = va3-a b = va3-b c = va3-c d = $(d,undefined)
a = va4-a b = va4-b c = def-c d = $(d,undefined)
a = va5-a b = gb1-b c = def-c d = $(d,undefined)
a = gb1-a b = gb1-b c = def-c d = $(d,undefined)
a = gb2-a b = gb2-b c = def-c d = $(d,undefined)
a = va1-a b = gb2-b c = def-c d = $(d,undefined)
a = va2-a b = va2-b c = def-c d = $(d,undefined)
a = va3-a b = va3-b c = va3-c d = $(d,undefined)
a = va4-a b = va4-b c = def-c d = $(d,undefined)
a = va5-a b = gb2-b c = def-c d = $(d,undefined)
a = gb2-a b = gb2-b c = def-c d = $(d,undefined)
a = gb3-a b = gb3-b c = def-c d = $(d,undefined)
a = pt1-a b = gb3-b c = def-c d = $(d,undefined)
a = pt2-a b = pt2-b c = def-c d = $(d,undefined)
a = pt3-a b = pt3-b c = pt3-c d = $(d,undefined)
a = pt4-a b = pt4-b c = def-c d = $(d,undefined)
a = pt5-a b = gb3-b c = def-c d = $(d,undefined)
a = gb3-a b = gb3-b c = def-c d = $(d,undefined)
a = gb4-a b = gb4-b c = def-c d = $(d,undefined)
a = pt1-a b = gb4-b c = def-c d = $(d,undefined)
a = pt2-a b = pt2-b c = def-c d = $(d,undefined)
a = pt3-a b = pt3-b c = pt3-c d = $(d,undefined)
a = pt4-a b = pt4-b c = def-c d = $(d,undefined)
a = pt5-a b = gb4-b c = def-c d = $(d,undefined)
a = gb4-a b = gb4-b c = def-c d = $(d,undefined)
a = gb1-a b = gb1-b c = def-c d = $(d)
a = va1-a b = gb1-b c = def-c d = $(d)
a = va2-a b = va2-b c = def-c d = $(d)
a = va3-a b = va3-b c = va3-c d = $(d)
a = va4-a b = va4-b c = def-c d = $(d)
a = va5-a b = gb1-b c = def-c d = $(d)
a = gb1-a b = gb1-b c = def-c d = $(d)
a = gb2-a b = gb2-b c = def-c d = $(d)
a = va1-a b = gb2-b c = def-c d = $(d)
a = va2-a b = va2-b c = def-c d = $(d)
a = va3-a b = va3-b c = va3-c d = $(d)
a = va4-a b = va4-b c = def-c d = $(d)
a = va5-a b = gb2-b c = def-c d = $(d)
a = gb2-a b = gb2-b c = def-c d = $(d)
a = gb3-a b = gb3-b c = def-c d = $(d)
a = pt1-a b = gb3-b c = def-c d = $(d)
a = pt2-a b = pt2-b c = def-c d = $(d)
a = pt3-a b = pt3-b c = pt3-c d = $(d)
a = pt4-a b = pt4-b c = def-c d = $(d)
a = pt5-a b = gb3-b c = def-c d = $(d)
a = gb3-a b = gb3-b c = def-c d = $(d)
a = gb4-a b = gb4-b c = def-c d = $(d)
a = pt1-a b = gb4-b c = def-c d = $(d)
a = pt2-a b = pt2-b c = def-c d = $(d)
a = pt3-a b = pt3-b c = pt3-c d = $(d)
a = pt4-a b = pt4-b c = def-c d = $(d)
a = pt5-a b = gb4-b c = def-c d = $(d)
a = gb4-a b = gb4-b c = def-c d = $(d)

View File

@@ -1,6 +1,6 @@
a = va1-a b = def-b c = def-c d = $(d,undefined)
a = va2-a b = va2-b c = def-c d = $(d,undefined)
a = va3-a b = va3-b c = va3-c d = $(d,undefined)
a = va4-a b = va4-b c = va3-c d = $(d,undefined)
a = va5-a b = va4-b c = va3-c d = $(d,undefined)
a = pt3-a b = pt3-b c = pt3-c d = $(d,undefined)
a = va1-a b = def-b c = def-c d = $(d)
a = va2-a b = va2-b c = def-c d = $(d)
a = va3-a b = va3-b c = va3-c d = $(d)
a = va4-a b = va4-b c = va3-c d = $(d)
a = va5-a b = va4-b c = va3-c d = $(d)
a = pt3-a b = pt3-b c = pt3-c d = $(d)

View File

@@ -2,19 +2,19 @@
a = 111
b = 222
c = xx
d = $(d,undefined)
d = $(d)
# comment line
a = aaa
b = bbb
c = ccc
d = $(d,undefined)
d = $(d)
# comment line
a = AA
b = BB
c = xx
d = $(d,undefined)
d = $(d)
# comment line
a = aaa
b = bbb
c = yy
d = $(d,undefined)
d = $(d)

View File

@@ -2,19 +2,19 @@
a = 111
b = 222
c = xx
d = $(d,undefined)
d = $(d)
# comment line
a = aaa
b = bbb
c = ccc
d = $(d,undefined)
d = $(d)
# comment line
a = AA
b = BB
c = xx
d = $(d,undefined)
d = $(d)
# comment line
a = aaa
b = bbb
c = yy
d = $(d,undefined)
d = $(d)

View File

@@ -0,0 +1,21 @@
This is t1-template.txt
With $(a,undefined) & $(b,undefined):
This is t1-include.txt
a = default value used when a is undefined
b = default value used when b is undefined
End of t1-include.txt
On defining a=aaa & b=bbb:
This is t1-include.txt again
a = aaa
b = bbb
End of t1-include.txt
On setting a="aa":
This is t1-include.txt again
a = "aa"
b = bbb
End of t1-include.txt
End of t1-template.txt

View File

@@ -26,3 +26,4 @@ dbCore_SRCS += miscIocRegister.c
dbCore_SRCS += dlload.c
dbCore_SRCS += iocshRegisterCommon.c
miscIocRegister_CFLAGS_iOS = -DSYSTEM_UNAVAILABLE

View File

@@ -12,6 +12,9 @@ variable(asCaDebug,int)
# CA server debug flag (very verbose) range[0,5]
variable(CASDEBUG,int)
# Link parsing debug
variable(dbJLinkDebug,int)
# Static database access variables
variable(dbRecordsOnceOnly,int)
variable(dbRecordsAbcSorted,int)
@@ -19,8 +22,12 @@ variable(dbBptNotMonotonic,int)
variable(dbQuietMacroWarnings,int)
variable(dbConvertStrict,int)
# PUTF/RPRO tracing; set TPRO on records to trace
variable(dbAccessDebugPUTF,int)
# dbLoadTemplate settings
variable(dbTemplateMaxVars,int)
# Default number of parallel callback threads
variable(callbackParallelThreadsDefault,int)

View File

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

View File

@@ -324,7 +324,7 @@ void rsrv_build_addr_lists(void)
#ifdef IP_MULTICAST_TTL
{
int ttl;
osiSockOptMcastTTL_t ttl;
long val;
if(envGetLongConfigParam(&EPICS_CA_MCAST_TTL, &val))
val =1;

View File

@@ -10,7 +10,11 @@ TOP=../../..
include $(TOP)/configure/CONFIG
INC += epicsRtemsInitHooks.h
INC += epicsMemFs.h
ifeq ($(RTEMS_QEMU_FIXUPS),YES)
rtems_init_CPPFLAGS += -DQEMU_FIXUPS
endif
rtemsCom_SRCS += rtems_init.c
rtemsCom_SRCS += rtems_config.c
rtemsCom_SRCS += rtems_netconfig.c
@@ -18,6 +22,11 @@ rtemsCom_SRCS += rtems_util.c
rtemsCom_SRCS += setBootConfigFromNVRAM.c
rtemsCom_SRCS += epicsRtemsInitHookPre.c
rtemsCom_SRCS += epicsRtemsInitHookPost.c
rtemsCom_SRCS += epicsMemFs.c
ifeq ($(RTEMS_BSP),pc386)
rtemsCom_SRCS += ne2kpci.c
endif
LIBRARY_RTEMS = rtemsCom

View File

@@ -0,0 +1,110 @@
/*************************************************************************\
* Copyright (c) 2014 Brookhaven National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include "epicsMemFs.h"
#ifndef PATH_MAX
# define PATH_MAX 100
#endif
int epicsMemFsLoad(const epicsMemFS *fs)
{
char initdir[PATH_MAX];
const epicsMemFile * const *fileptr = fs->files;
if(getcwd(initdir, sizeof(initdir)-1)==NULL) {
perror("getcwd");
return errno;
}
initdir[sizeof(initdir)-1] = '\0';
for(;*fileptr; fileptr++) {
const epicsMemFile *curfile = *fileptr;
int fd;
ssize_t ret;
size_t sofar;
const char * const *dir = curfile->directory;
/* jump back to the root each time,
* slow but simple.
*/
if(chdir(initdir)) {
perror("chdir");
return errno;
}
printf("-> /");
/* traverse directory tree, creating as necessary */
for(;*dir; dir++) {
int ret;
if(**dir=='.') continue; /* ignore '.' and '..' */
printf("%s/", *dir);
ret = chdir(*dir);
if(ret==-1 && errno==ENOENT) {
/* this directory doesn't exist */
if(mkdir(*dir,0744)==-1) {
printf("\n");
perror("mkdir");
return errno;
}
if(chdir(*dir)==-1) {
printf("\n");
perror("chdir2");
return errno;
}
} else if(ret==-1) {
printf("\n");
perror("chdir1");
return errno;
}
}
/* no file name creates an empty directory */
if(!curfile->name) {
printf("\n");
continue;
}
printf("%s", curfile->name);
/* create or overwrite */
fd = open(curfile->name, O_WRONLY|O_CREAT|O_TRUNC, 0644);
if(fd==-1) {
printf("\n");
perror("open");
return errno;
}
sofar = 0;
while(sofar<curfile->size) {
ret = write(fd, curfile->data+sofar, curfile->size-sofar);
if(ret<=0) {
printf("\n");
perror("write");
return errno;
}
sofar += ret;
}
close(fd);
printf(" - ok\n");
}
if(chdir(initdir))
perror("chdir");
return 0;
}

View File

@@ -0,0 +1,24 @@
/*************************************************************************\
* Copyright (c) 2014 Brookhaven National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef EPICSMEMFS_H
#define EPICSMEMFS_H
#include <stdlib.h>
typedef struct {
const char * const *directory; /* NULL terminated list of directories */
const char *name; /* file name */
const char *data; /* file contents */
size_t size; /* size of file contents in bytes */
} epicsMemFile;
typedef struct {
const epicsMemFile * const *files;
} epicsMemFS;
int epicsMemFsLoad(const epicsMemFS *fs);
#endif // EPICSMEMFS_H

View File

@@ -21,3 +21,5 @@ extern char *env_nfsMountPoint;
*/
int epicsRtemsInitPreSetBootConfigFromNVRAM(struct rtems_bsdnet_config *config);
int epicsRtemsInitPostSetBootConfigFromNVRAM(struct rtems_bsdnet_config *config);
/* Return 0 if local file system was setup, or non-zero (will fall back to network */
int epicsRtemsMountLocalFilesystem(char **argv);

View File

@@ -0,0 +1,58 @@
/*************************************************************************\
* Copyright (c) 2015 Brookhaven Science Associates, as Operator of
* Brookhaven National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Wrapper around the ISA ne2000 driver to support detection of the PCI variant.
* Can be used with the ne2k_pci device provided by QEMU.
*
* eg. "qemu-system-i386 ... -net nic,model=ne2k_pci"
*/
#include <stdio.h>
#include <inttypes.h>
#include <bsp.h>
#include <rtems/pci.h>
#include <rtems/rtems_bsdnet.h>
/* The plain ISA driver attach()
* which doesn't (can't?) do any test to see if
* the HW is really present
*/
extern int
rtems_ne_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach);
int
rtems_ne2kpci_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
{
uint8_t irq;
uint32_t bar0;
int B, D, F, ret;
printk("Probing for NE2000 on PCI (aka. Realtek 8029)\n");
if(pci_find_device(PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8029, 0, &B, &D, &F))
{
printk("Not found\n");
return 0;
}
printk("Found %d:%d.%d\n", B, D, F);
ret = pci_read_config_dword(B, D, F, PCI_BASE_ADDRESS_0, &bar0);
ret|= pci_read_config_byte(B, D, F, PCI_INTERRUPT_LINE, &irq);
if(ret || (bar0&PCI_BASE_ADDRESS_SPACE)!=PCI_BASE_ADDRESS_SPACE_IO)
{
printk("Failed reading card config\n");
return 0;
}
config->irno = irq;
config->port = bar0&PCI_BASE_ADDRESS_IO_MASK;
printk("Using port=0x%x irq=%u\n", (unsigned)config->port, config->irno);
return rtems_ne_driver_attach(config, attach);
}

View File

@@ -33,6 +33,7 @@
#include <librtemsNfs.h>
#include <bsp.h>
#include "epicsVersion.h"
#include "epicsThread.h"
#include "epicsTime.h"
#include "epicsExit.h"
@@ -42,9 +43,12 @@
#include "osiUnistd.h"
#include "iocsh.h"
#include "osdTime.h"
#include "epicsMemFs.h"
#include "epicsRtemsInitHooks.h"
#define RTEMS_VERSION_INT VERSION_INT(__RTEMS_MAJOR__, __RTEMS_MINOR__, 0, 0)
/*
* Prototypes for some functions not in header files
*/
@@ -138,6 +142,31 @@ mustMalloc(int size, const char *msg)
# include <rtems/tftp.h>
#endif
const epicsMemFS *epicsRtemsFSImage __attribute__((weak));
const epicsMemFS *epicsRtemsFSImage = (void*)&epicsRtemsFSImage;
/* hook to allow app specific FS setup */
int
epicsRtemsMountLocalFilesystem(char **argv) __attribute__((weak));
int
epicsRtemsMountLocalFilesystem(char **argv)
{
if(epicsRtemsFSImage==(void*)&epicsRtemsFSImage)
return -1; /* no FS image provided. */
else if(epicsRtemsFSImage==NULL)
return 0; /* no FS image provided, but none is needed. */
else {
printf("***** Using compiled in file data *****\n");
if (epicsMemFsLoad(epicsRtemsFSImage) != 0) {
printf("Can't unpack tar filesystem\n");
return -1;
} else {
argv[1] = "/";
return 0;
}
}
}
static int
initialize_local_filesystem(char **argv)
{
@@ -146,7 +175,9 @@ initialize_local_filesystem(char **argv)
extern char _FlashSize[] __attribute__((weak));
argv[0] = rtems_bsdnet_bootp_boot_file_name;
if (_FlashSize && (_DownloadLocation || _FlashBase)) {
if (epicsRtemsMountLocalFilesystem(argv)==0) {
return 1; /* FS setup successful */
} else if (_FlashSize && (_DownloadLocation || _FlashBase)) {
extern char _edata[];
size_t flashIndex = _edata - _DownloadLocation;
char *header = _FlashBase + flashIndex;
@@ -596,6 +627,7 @@ Init (rtems_task_argument ignored)
}
printf("\n***** Initializing network *****\n");
rtems_bsdnet_initialize_network();
printf("\n***** Setting up file system *****\n");
initialize_remote_filesystem(argv, initialize_local_filesystem(argv));
fixup_hosts();
@@ -666,3 +698,37 @@ Init (rtems_task_argument ignored)
epicsThreadSleep(1.0);
epicsExit(result);
}
#if defined(QEMU_FIXUPS)
/* Override some hooks (weak symbols)
* if BSP defaults aren't configured for running tests.
*/
/* Ensure that stdio goes to serial (so it can be captured) */
#if defined(__i386__) && !USE_COM1_AS_CONSOLE
#include <uart.h>
extern int BSPPrintkPort;
void bsp_predriver_hook(void)
{
BSPConsolePort = BSP_CONSOLE_PORT_COM1;
BSPPrintkPort = BSP_CONSOLE_PORT_COM1;
}
#endif
/* reboot immediately when done. */
#if defined(__i386__) && BSP_PRESS_KEY_FOR_RESET
void bsp_cleanup(void)
{
#if RTEMS_VERSION_INT>=VERSION_INT(4,10,0,0)
void bsp_reset();
bsp_reset();
#else
rtemsReboot();
#endif
}
#endif
#endif /* QEMU_FIXUPS */
int cexpdebug __attribute__((weak));

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