Compare commits

...

718 Commits

Author SHA1 Message Date
Andrew Johnson
ed37ace27e R3.15.1 2014-12-01 15:07:38 -06:00
Andrew Johnson
bc15875bfb Merge changes from 3.14 branch, revno 12507 2014-12-01 12:29:30 -06:00
Andrew Johnson
69eaaa17ba Fix xsubpp for RHEL 7 and derivatives.
It got moved. This might not be the final fix for those using an
add-on version of Perl though...
2014-12-01 12:12:09 -06:00
Andrew Johnson
30b789aa49 Fix epicsStrnEscapedFromRaw() and epicsStrnRawFromEscaped()
Major rewrites; the original epicsStrnRawFromEscaped() could read
beyond the end of the input buffer if the input count ended in the
middle of an octal or hex escape sequence. Zero termination did not
always match the return count, and hex escapes were always 2 digits,
contrary to the C standard.

New versions don't use epicsSnprintf() or sscanf() for hex and octal
conversions, so should be slightly faster.

Added 81 new tests to check the above issues.
2014-12-01 11:34:58 -06:00
Ralph Lange
1a94ea1045 libCom/osi: fix - do not set the main thread's Linux name to _main_ (linux) 2014-12-01 13:48:10 +01:00
Andrew Johnson
f1dec35c5c Update KnownProblems list 2014-11-19 16:00:31 -06:00
Andrew Johnson
6e8a3fcd6d Set version snapshot to -rc1-DEV 2014-11-19 15:35:12 -06:00
Andrew Johnson
ec35ef7136 Update version numbers for 3.15.1-rc1 2014-11-19 15:34:02 -06:00
Andrew Johnson
fce8377156 Merge change from 3.14 branch
Up to revno 12506
2014-11-19 15:18:11 -06:00
Andrew Johnson
5c4def1632 Build issues for iOS 2014-11-19 13:57:55 -06:00
Andrew Johnson
bdc57ecb2b Build issues for MinWG 2014-11-19 13:16:56 -06:00
Andrew Johnson
fd3bf215c5 Added missing tests to epicsRunDbTests.c 2014-11-19 10:22:39 -06:00
Ralph Lange
ba922d2bfa ioc/db: fix segfault in dbcaStats when disconnected CA links are present 2014-11-19 15:11:36 +01:00
Ralph Lange
cd8e08651b ioc/db/test: add a test for dbcaStats (detects bug lp:1394212) 2014-11-19 15:08:48 +01:00
Ralph Lange
0627aa5712 std/rec/test: extend arrayOpTest to cover an array of size 1 (detects bug lp:1389298) 2014-11-19 09:59:34 +01:00
Andrew Johnson
adc6219c2a scanIoTest: Extend time for callback threads to run.
Needed for VxWorks 5.5.2 on 68K
2014-11-18 18:10:19 -06:00
Andrew Johnson
a99f1d238e Cleaned up VxWorks 6.9 symLib warnings
VxWorks 6.9 deprecated several symFindBy...() routines, which
result in warning messages at build-time. I rewrote the code
that uses these to use the newer API on VxWorks 6.9.

Also deprecated the two epicsDynLink.h symFindByNameEPICS()
and symFindByNameAndTypeEPICS() routines; epicsFindSymbol() in
epicsFindSymbol.h is now available on most platforms instead.
2014-11-18 17:46:41 -06:00
Andrew Johnson
09797ee7ca Fix ringPointerTest thread priority issue on VxWorks
Picked a priority somewhere in the middle and switch to
that for the two test subroutines that care.
2014-11-18 17:30:43 -06:00
Andrew Johnson
01c0275876 Build stability fixes
Change menuGlobal.dbd and stdRecords.dbd to be generated
as a list of unexpanded include statements, not expanded
out as they have been recently on this branch. This means
any .dbd.pod files in those lists don't have to have been
filtered to remove the POD statements which significantly
simplifies the dependency graph. I had experienced build
loops at times, which this change should prevent.
2014-11-18 14:01:46 -06:00
Michael Davidsaver
d7269f9d80 Revert "dbBkpt: atexit" 2014-11-18 14:56:45 -05:00
Michael Davidsaver
58cd1d0a71 errlog: Don't free globals.
Since the pvtData.atExit flag doesn't prevent all
concurrent use of the pvtData struct we can't safely
free it.
2014-11-18 14:48:15 -05:00
Michael Davidsaver
e4954ba26a dbLock: remove dbLockExit()
No benefit to freeing global locks in unittests,
and this could cause problems with normal IOC
shutdown.
2014-11-18 14:48:15 -05:00
Andrew Johnson
60a5c476b3 Fix single-element array problem
An array field with a maximum size of 1 element would not be
treated as an array, so the record's rset::get_array_info()
routine wasn't being called. Fixed in dbAccess for both
dbGet() and dbPut() operations, and in dbEvent for monitors.

Fixes lp:1389298
2014-11-18 11:10:01 -06:00
Michael Davidsaver
9e63a51707 pcas: avoid reinterpret_cast with sockaddr
Avoid warning about breaking aliasing rules
2014-11-18 11:48:53 -05:00
Michael Davidsaver
93149071b7 dbNotify: shutdown with exitDatabase
Can't cleanup dbNotify while rsrv or scan tasks
are running as there may be operations in progress.
2014-11-18 11:25:15 -05:00
Michael Davidsaver
9c2a62ea96 dbChannel: shutdown from exitDatabase()
Can't cleanup dbChannel while rsrv or scan tasks
remain running.
2014-11-18 11:25:15 -05:00
Andrew Johnson
ae7b8c7aa3 configure: Windows-x64 architecture fixes
* Removed /favor:blend from ARCH_DEP_CPPFLAGS
  It is the default anyway, and including it stops the
  MS Express compilers from building 64-bit executables.
* Added a CONFIG_SITE.Common.windows-x64-static file.
  The MSVS 2010 linker crashes when when generating code
  for this target with HOST_OPT = YES, so make it NO.
2014-11-18 09:51:28 -06:00
Ralph Lange
ac2ff29abb libCom/log: make iocLog client unregister its listener from errlog on shutdown 2014-11-18 15:23:14 +01:00
Michael Davidsaver
f9d0fd351d libCom/test: fix ringPointerTest compile issues on vxWorks and MSVC
Remove C GNU-isms
1) mixing code/variable defs
2) arithmetic on void*
2014-11-17 18:55:47 -05:00
Michael Davidsaver
66fbbbb19a libCom/test: re-write ringPointerTest 2014-11-17 16:51:57 -05:00
Andrew Johnson
89777707c4 cap5: Minor build change on Darwin 2014-11-17 10:56:28 -06:00
Andrew Johnson
4c66f7f2d9 configure: Removed obselete 3.13 compatibility build rule 2014-11-13 17:02:10 -06:00
Michael Davidsaver
924350b362 epicsExit: add epicsExitLater() to trigger process exit without blocking 2014-11-13 11:58:35 -05:00
Michael Davidsaver
d35780888a iocInit: only teardown from iocBuildIsolated()
iocShutdown() should only stop threads and cleanup
if the IOC was started with iocBuildIsolated().
If iocBuild() is used then only close CA links
as was done previously.

This is needed as some device support calls epicsExit()
(while holding a record lock).  This make it impossible
to run the full iocShutdown without deadlocking
in scan/callback shutdown, or segfaulting
in doFreeRecord() or dbLockCleanupRecords()
2014-11-13 11:58:35 -05:00
Andrew Johnson
f7cc0e2d09 Various build system issues
* Removed broken Windows source browser rules and 'browse' targets
* Fixed parallel build issue for Make > 3.81
* Other tidying-up in RULES_ARCHS
* Fix the RTEMS override of the ECHO variable
2014-11-12 16:36:39 -06:00
Andrew Johnson
5554dfd66d Make shared library version numbers use 3 components 2014-11-11 12:57:00 -06:00
Andrew Johnson
69daab81d5 Fix tests after menuScan changes 2014-11-10 17:27:38 -06:00
Andrew Johnson
3aa5d2adee ioc/db menu fixes
* Move including menuScan.dbd from menuGlobal.dbd to base.dbd.
  Menus included in menuGlobal.dbd can't be overridden at build
  time since it gets fully expanded before installation.
* Convert .dbd.pod files before generating menuGlobal.dbd.d
* Remove menuCompress.dbd, nothing in Base uses it any more.
  The compress record has its own compressALG menu
2014-11-10 16:15:52 -06:00
Andrew Johnson
574bac67b4 CAref reformatting/prettification from 3.14 2014-11-08 10:22:03 -06:00
Andrew Johnson
3d03822043 CAref reformatting/prettification 2014-11-08 10:19:59 -06:00
Andrew Johnson
6f7fc7bf8e Merged changes from 3.14 branch
Up to revno 12504.
2014-11-07 15:57:13 -06:00
Andrew Johnson
702edbf4af Merged Lewis Muir's CAref typo fixes 2014-11-07 15:35:30 -06:00
J. Lewis Muir
0d0ac88242 doc: Fix typos in CA reference manual 2014-11-07 14:56:41 -06:00
Andrew Johnson
2ab2470317 Fix epicsStrtod() implementation to detect overflow
The VxWorks version of strtod() that we use returns Inf
instead of setting errno on overflow.
2014-11-07 13:25:16 -06:00
Andrew Johnson
53d9a07f64 Fix buffer overflow in epicsStrnRawFromEscaped
lp:1388313
2014-11-05 10:06:02 -06:00
Andrew Johnson
eae4f60e57 cap5: Fix replace_access_rights_event() channel method 2014-11-04 15:10:50 -06:00
Andrew Johnson
a05856375a Update EPICS_TIMEZONE data in CONFIG_SITE_ENV 2014-11-04 14:55:25 -06:00
Andrew Johnson
05d3bb63aa configure: Added missing menu%.h.d rule
Janet had to remove '..' from the vpaths because it was letting
the build look into the TOP/.. directory, which was causing
major issues. She added back rules for COMMON_DIR and .. but
missed this one.
2014-11-03 17:02:42 -06:00
Andrew Johnson
743e3bd387 cap5: Add replace_access_rights_event() channel method 2014-11-02 23:11:44 -06:00
Andrew Johnson
79b70d651c Flag epicsBoolean with EPICS_DEPRECATED 2014-10-31 17:26:48 -05:00
Andrew Johnson
9d5bffca94 libCom/flex: Default skeleton should be filename only 2014-10-31 16:58:03 -05:00
Andrew Johnson
64bf84169c dbStatic: Added hook routine for dbLoadRecords()
Requested by Tim Mooney for use by Autosave.
See the Release Notes for documentation.

This commit also corrects the decorations for recGblAlarmHook.
2014-10-31 16:18:25 -05:00
Andrew Johnson
647bd334ae iocsh: Protect echo and cd from NULL arguments 2014-10-31 12:19:09 -05:00
Andrew Johnson
09ff608ca9 libCom: Fix use-after-free bug in macCore.c 2014-10-30 17:55:12 -05:00
Andrew Johnson
6c14dc194c Replace the epicsBoolean type in epicsTypes.h 2014-10-30 14:40:19 -05:00
Andrew Johnson
9f163ef8d9 Merged J Lewis Muir's typo-fix branch 2014-10-28 16:20:51 -05:00
J. Lewis Muir
f0156119be cap5: Fix doc typos 2014-10-22 11:03:40 -05:00
Andrew Johnson
f808e4309d cap5 Fixes
1. Support subscribing for DBR_GR_ENUM or DBR_CTRL_ENUM
2. Fix doc example on how to combine timestamp parts
2014-10-17 15:19:00 -05:00
Andrew Johnson
f59123bd3c Added Windows-x64-debug cross-build config file 2014-10-17 11:48:18 -05:00
Ralph Lange
49a9d64946 catools: better out-of-bounds handling when printing enums as DBR_GR/DBR_CTRL 2014-10-09 14:12:39 +02:00
Andrew Johnson
c5740c0dd0 Add relPaths.sh target to convertRelease.pl
This is a /bin/sh syntax version of the dllPath.bat file,
needed to run IOCs under Cygwin when SHARED_LIBRARIES=YES.
2014-10-08 14:18:08 -05:00
Andrew Johnson
3eb6a66f3c Fix build warnings 2014-10-07 15:59:20 -05:00
Andrew Johnson
986f7abb08 Set version snapshot back to -DEV 2014-10-07 01:50:24 -05:00
Andrew Johnson
6e5b47d6da Update version number to 3.15.0.2 2014-10-07 01:31:33 -05:00
Andrew Johnson
bd120c774d Various fixes
* VxWorks 5.5.2 doesn't like C++-style variable declarations in C code
* Older MS compiler doesn't have strto[u]ll
* Wrote release note entry for iocshLoad command.
2014-10-07 00:41:39 -05:00
Andrew Johnson
0a9c5d456b Merged iocshCmd-with-macros branch 2014-10-06 23:39:23 -05:00
Andrew Johnson
e66b691549 Add support for iOS 8 target 2014-10-06 20:36:50 -05:00
Andrew Johnson
97e445f78d Merged epicsInt64-library-support branch 2014-10-06 20:28:35 -05:00
Andrew Johnson
b74eb61949 Merged dbca-test branch 2014-10-06 18:04:33 -05:00
Andrew Johnson
f0193d27f3 Clean up warning from clang/MacOS 2014-10-06 18:03:00 -05:00
Andrew Johnson
7b23f50f9d Fix Windows builds.
db_access.h defines things in the CA library, not db...
2014-10-06 16:31:28 -05:00
Andrew Johnson
78a9dd7bc5 Fixes for building on Solaris
The SunPro C++ compiler doesn't like osdElfFindAddr, so I converted
it back to C, but then I had to make the osdFindAddr files C to match.
Now elfRead() can't use a static initializer to get the program start
time, so I added a public routine to osiClockTime.c to return that.
Also fixed various indentations in Till's code.
2014-10-06 13:53:21 -05:00
Andrew Johnson
3d6fba6802 dbdToHtml fix to support Perl 5.8 2014-10-06 13:26:37 -05:00
Andrew Johnson
2d0ea1e3bb Better Makefile for makeBaseApp top dir 2014-10-06 13:25:41 -05:00
Andrew Johnson
9cebc2993b Fix epicsExportSharedSymbols for MinGW build
Include files now in sorted order within each block.
2014-10-06 00:57:02 -05:00
Andrew Johnson
2ce5d61c38 Perl script fixes.
This commit should fix the Cygwin build issue, and the
stylesheet link problems.
2014-10-03 18:06:47 -05:00
Andrew Johnson
a4298bec56 Merged dbd2html branch 2014-10-03 14:23:04 -05:00
Andrew Johnson
ec7b0d5737 Merged the loadable-support branch 2014-10-02 16:53:15 -05:00
Andrew Johnson
70feb515c3 Merged parallel-cbthreads-3 branch 2014-10-02 15:07:07 -05:00
Andrew Johnson
565f0e3725 Merged simple-filter-conf branch 2014-10-01 18:11:28 -05:00
Michael Davidsaver
c0a4ebebff callback: workers wake up peer if necessary. 2014-10-01 18:38:14 -04:00
Michael Davidsaver
c2631cdc8a callback: don't track busy workers
wakeup unconditionally.  Perhaps inefficient, but simple.
2014-10-01 18:35:42 -04:00
Andrew Johnson
f9628646d1 Make IOSCANPVT a single structure
Not an array of 3 io_scan_list objects.
2014-09-30 16:22:03 -05:00
Andrew Johnson
c9f7a32c82 Mark callbackParallelThreadsDefault properly
The definition gets epicsShareDef and may provide a value.
Additional declarations get epicsShareExtern.
2014-09-30 16:10:24 -05:00
Andrew Johnson
04848e0766 Fix problems in callbackParallelThreads() 2014-09-30 13:00:39 -05:00
Andrew Johnson
4c761eeba0 Fixes for VxWorks & RTEMS builds
* C++ comments are not legal in C code
* Declare scanIoTest() in epicsRunDbTests.c
2014-09-30 12:36:32 -05:00
Ralph Lange
7ecbe87047 ioc/db: add test for allocPvt() returning NULL to chfPluginTest 2014-09-30 16:20:16 +02:00
Ralph Lange
6b71e5bfe5 std/filters: add minimal error handling when using freeListCalloc() in arr plugin 2014-09-30 16:19:13 +02:00
Ralph Lange
1c317adbda ioc/db: add tests for strict tagged plugin options, fix 'required' algorithm 2014-09-30 11:48:41 +02:00
Ralph Lange
9b73fd1730 std/filters: make shorthand notation more prominent in filter documentation 2014-09-30 11:46:17 +02:00
Andrew Johnson
27a8818ea8 Silence unused variable warning 2014-09-29 12:35:22 -05:00
Ralph Lange
f84b736022 ioc/db: back to old signalling policy - wake up worker thread as long as there are any sleeping 2014-09-29 10:59:00 +02:00
Andrew Johnson
0888992863 Fix MinGW cross-build from Linux 2014-09-28 23:28:29 -05:00
Michael Davidsaver
76dc827e29 libCom/test: link w/ winsock to get htons/htonl 2014-09-26 18:55:26 -04:00
Andrew Johnson
b06ea01a18 Fix Windows build issue in epicsMMIODef.h 2014-09-26 16:40:44 -05:00
Andrew Johnson
a9e048b483 Fix gdd dependency issue from MacOS X 2014-09-26 15:31:20 -05:00
Andrew Johnson
5ae6dd3a7c Merged devlib2mmio branch 2014-09-26 14:28:28 -05:00
Andrew Johnson
abc3417623 Merged stacktrace-1 branch 2014-09-26 12:46:16 -05:00
Andrew Johnson
fcbb159766 Fix gdd dependency warnings 2014-09-26 10:40:50 -05:00
Andrew Johnson
fccbccbc09 Merged dbServer-api branch 2014-09-26 10:21:40 -05:00
Andrew Johnson
60459effaa Merged the gen-pkg-config branch 2014-09-26 10:13:01 -05:00
Andrew Johnson
abff9a6954 Improve epicsSockResolveTest tests. 2014-09-26 10:11:47 -05:00
Andrew Johnson
8fde7fb4f3 Merged changes from 3.14 branch
Fixed issues building on Solaris.

Up to revno 12497.
2014-09-25 16:34:12 -05:00
Andrew Johnson
c078a9cef8 Replaced split with a single regex 2014-09-25 16:24:23 -05:00
Michael Davidsaver
7a3e52b647 comment in configure/RULES_EXPAND 2014-09-25 16:49:44 -04:00
Michael Davidsaver
3fe84c5ace src/tools: export additional variables to pkg-config
No need for new names/capitalization
2014-09-25 16:49:40 -04:00
Michael Davidsaver
5e9b225a2e src/tools: ensure epics-base.pc is generated only for EPICS_HOST_ARCH 2014-09-25 14:04:10 -04:00
Michael Davidsaver
2f577c136c expandVars.pl: correctly handle macro values containing '='. 2014-09-25 13:24:41 -04:00
Michael Davidsaver
b1918c1e31 allow expandVars for all targets 2014-09-25 11:50:13 -04:00
Andrew Johnson
e1eac6657d confiugre: Update the vxWorks Intel build configurations
Wind River changed from cc386 to ccpentium many years ago.
2014-09-24 16:53:44 -05:00
Andrew Johnson
d73b4eb470 Fix epicsSockResolveTest, host is now a real TLD 2014-09-23 15:31:53 -05:00
Andrew Johnson
82f24149d9 Improve error handling of dbdExpand.pl 2014-09-23 15:11:40 -05:00
Andrew Johnson
32ca04dda8 Make stdRecords.dbd depend on rec/Makefile 2014-09-23 15:10:49 -05:00
Andrew Johnson
c8a7179ab8 Added dbd dependency. 2014-09-23 15:09:26 -05:00
Andrew Johnson
a721794da7 Missed installing asSub.dbd 2014-09-23 15:07:55 -05:00
Andrew Johnson
5bee899f25 Merged Janet's dbdcat branch 2014-09-22 16:12:57 -05:00
Andrew Johnson
22db10da16 std: Reintroduce manually-created base.dbd file
The auto-generated base.dbd file has all the includes fully
expaded out before installation, which prevents IOC applications
from being able to replace manuScan.dbd and menuconvert.dbd
2014-09-22 16:09:46 -05:00
Andrew Johnson
92f5e5775d Restructured patch.
* Move the construction of the .pc files into src/tools
* Make more use of the built-in rules for variable substitution
* Make PKGCONFIG an Makefile variable for installing .pc files
* Use EPICS_PATCH_LEVEL for the final digit in the version number
2014-09-19 16:37:56 -05:00
Keenan Lang
bd3a030da8 remove unneeded forward declaration 2014-09-19 13:24:15 -05:00
Keenan Lang
688e821f3a remove macEnvExpandTest from epicsRunLibComTests.c 2014-09-19 13:21:43 -05:00
Till Straumann
a018720511 - use time() instead of clock_gettime();
- when comparing modification to program start time use >= instead of >
2014-09-19 10:17:28 -07:00
Ralph Lange
e7d186eaf8 ioc/db: use dbFindMenu() in callback.c 2014-09-19 13:09:52 +02:00
Ralph Lange
1a8620f03e documentation: add parallel callback threads to RELEASE_NOTES 2014-09-19 10:13:29 +02:00
Till Straumann
f278ba656b - fixed c++ warnings 2014-09-18 14:06:04 -07:00
Till Straumann
d925772857 - fixed c++ warnings 2014-09-18 14:05:32 -07:00
Till Straumann
bbfb69ed8d - implemented suggestion by Michael Davidsaver: when reading ELF files
check modifification time against program start time and warn if the
   file was modified more recently since it could be out of date.
2014-09-18 12:19:47 -07:00
Till Straumann
012ee68199 - made osdBackTrace/osdFindAddr c++ sources to be more flexible for
implementations. Fixed compiler warnings (c++ more picky than cc).
2014-09-18 12:18:48 -07:00
Ralph Lange
6225602777 ioc/db/test: fix dbPutLinkTest.c to compile on Windows 2014-09-18 10:51:09 +02:00
Keenan Lang
79cb473b6a tests all pass now. 2014-09-17 17:22:04 -05:00
Andrew Johnson
02afb98f38 Reject NULL callback functions in ca_array_*_callback
Fixes lp:1369626
2014-09-17 10:21:07 -05:00
Andrew Johnson
6e3e14448a Increase context string to 40 characters. 2014-09-17 10:12:40 -05:00
Michael Davidsaver
b3c1fef110 cleanup callback and callback*Test 2014-09-16 18:55:27 -04:00
Keenan Lang
73b09f4976 Adding scoping test, combining some aspects of macEnvTest to allow removal of that test. 2014-09-16 13:55:40 -05:00
Keenan Lang
4cd8a41ce5 Updated macDefExpandTest to keep from dereferencing NULL 2014-09-15 16:59:11 -05:00
Michael Davidsaver
3bb8536494 dbAccess: dbPut() handle changing BPTR
Forgot to update dbPut(), oops...
2014-09-15 11:42:38 -04:00
Michael Davidsaver
6d678eca60 std/rec/test: test dbGet() and dbPut() for array field
test with waveform record to check that DBADDR
modifications aren't seen by the caller.
2014-09-15 11:42:38 -04:00
Andrew Johnson
42f0b9be21 Posix: Fix how we check POSIX features
Darwin defines some macros as -1, which means unsupported.
2014-09-11 17:08:49 -05:00
Janet Anderson
840669563c Updated concatenated database definition files 2014-09-11 15:18:57 -05:00
Janet Anderson
81fdbdebd9 Added dummy for solaris build. 2014-09-11 09:10:44 -05:00
Till Straumann
f1bb532307 - simplified some code
- epicsStackTrace.c provides generic epicsStackTraceGetFeatures() testing
   the 'epicsBackTrace()' functionality. Call out to epicsFindAddrGetFeatures()
   to inquire about symbol lookup support.
2014-09-10 12:04:36 -07:00
Till Straumann
0252dd1905 - simplified code
- provide epicsFindAddrGetFeatures() instead of epicsStackTraceGetFeatures()
2014-09-10 12:03:50 -07:00
Till Straumann
a2339b9219 - WIN32 can now use default osdFindAddr (until symbol lookup is implemented) 2014-09-10 12:03:04 -07:00
Till Straumann
cc04994d12 - updated copyright info
- let epicsFindAddr clear out returned symbol info
 - provide epicsFindAddrGetFeatures instead of epicsStackTraceGetFeatures
2014-09-10 12:01:50 -07:00
Till Straumann
fad25a3b11 - cleanup
- reduced epicsStackTraceGetFeatures to epicsFindAddrGetFeatures
2014-09-10 12:00:51 -07:00
Till Straumann
438863ebd9 - updated copyright info 2014-09-10 12:00:08 -07:00
Andrew Johnson
431e87f95c libCom/posix: Drop SCHED_FIFO before exec() in child process
osiSpawnDetachedProcess() switches to SCHED_OTHER after fork() so
the new program will not be real-time unless is requests it itself.
Only happens when USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES
2014-09-09 18:06:09 -05:00
Janet Anderson
069a40ac46 Concatenated database definition files 2014-09-09 15:58:04 -05:00
Janet Anderson
09e2926c7b Added concatenated database definition files 2014-09-09 13:29:16 -05:00
strauman
6890166376 - renamed:
src/libCom/osi/os/posix/osdBackTrace.c => src/libCom/osi/os/posix/osdExecinfoBackTrace.c
  src/libCom/osi/os/posix/osdFindAddr.c => src/libCom/osi/os/posix/osdElfFindAddr.c

  not all 'posix' platforms can use the above versions (since the used APIs are not really POSIX)
  but a subset can. The platforms which can use either version #include it from 'their'
  osdBackTrace.c/osdFindAddr.c.
2014-09-08 23:28:30 -07:00
Till Straumann
51f5a2fc99 - fixed illegal void* pointer arithmetic by casting to char* 2014-09-08 23:09:18 -07:00
Till Straumann
252af56144 - renamed symbol that clashed on solaris 2014-09-08 23:08:33 -07:00
Till Straumann
278a8dac05 - solaris implementation of epicsBackTrace() via walkcontext() 2014-09-08 23:07:51 -07:00
Till Straumann
0b76aa2de1 - turn off frame-pointer optimization (otherwise stack trace capture
does not work).
2014-09-08 22:31:47 -07:00
Till Straumann
8477dec61f - added windows versions of osdBackTrace.c, osdFindAddr.c; the latter
does not implement addr->symbol conversion yet.
2014-09-08 22:31:11 -07:00
Till Straumann
8931954d28 - fixed illegal void* pointer arithmetic (by casting to char*) 2014-09-08 22:30:34 -07:00
Till Straumann
954ba66027 - fixed illegal void* pointer arithmetic by casting to char*
- removed more unused stuff
2014-09-08 22:29:46 -07:00
Till Straumann
4e1677a38f - (hopefully) correct usage of sharedLib.h... 2014-09-08 22:28:41 -07:00
strauman
e349b3ab94 - first stab at breaking stack trace facility into separate files 2014-09-08 19:41:06 -07:00
Andrew Johnson
3f88273d0f Linux builds: Define _GNU_SOURCE and _DEFAULT_SOURCE
These replace the mixture of macros used to pick the features
presented by the standard system header files on Linux.

Updated the section of the CA reference manual that showed some
example compile lines to correct for 3.15 build changes.

Removed unused code & out-of-date comments.
2014-09-08 17:57:18 -05:00
Till Straumann
fa41fcbe40 - use unistd's _POSIX_MAPPED_FILES to determine if a system has mmap. 2014-09-08 08:10:16 -07:00
Till Straumann
9dd130afb6 - forget about backtrace_symbols() -- always use 'dladdr'. (The former
is non-standard either and AFAIK always based on the latter.) Always
   using dladdr allows us to precisely control the printout formatting
   and keep it consistent.
2014-09-05 15:29:32 -07:00
Till Straumann
423709b795 - call first epicsStackTraceRecurseGbl() through function pointer -- clang
(darwin) had optimized it away.
2014-09-05 11:17:17 -07:00
Till Straumann
fd9fed2262 - canonicalized printout formatting
- added EPICS_STACKTRACE_DYN_SYMBOL
 - added USE_DLADDR branch (which is a 'super' of USE_ELF, i.e., the latter
   depends on the former)
2014-09-04 10:59:39 -07:00
Till Straumann
68429f03f2 - added EPICS_STACKTRACE_DYN_SYMBOL 2014-09-04 10:58:27 -07:00
Andrew Johnson
7a9407d7ab libCom: Clean up MS compiler warnings.
This doesn't fix the Microsoft link failure though, that may
need an upgrade of MS Visual Studio on our Hudson Windows VM.
2014-09-04 11:07:59 -05:00
Andrew Johnson
c8e18c1b4d ioc/db/test: Fix dependency problems.
dbLockTest.c never actually uses xRecord.h, while
dbPutLinkTest needed a depedency rule for it.
2014-09-03 22:59:34 -05:00
Till Straumann
fab9ef6147 - added test case for library symbols
- replaced TABs by spaces
2014-09-03 13:23:23 -07:00
Till Straumann
4352a1df59 - replaced TABs by four blanks 2014-09-03 09:39:15 -07:00
Till Straumann
f399b354e6 - replaced TABs by four blanks 2014-09-03 08:13:15 -07:00
Keenan Lang
6d4e284ab1 Added note to fixme comment to state that a function is relying on its current setup. 2014-09-02 17:21:42 -05:00
Keenan Lang
85936ff34c Darwin's osdEnv.c was updated while I was working on this, changed my updated version to match. 2014-09-02 16:55:32 -05:00
Keenan Lang
ee197893e7 removing some extra whitespace to cleanup the diff 2014-09-02 16:44:47 -05:00
Keenan Lang
64a98452e3 epicsEnvSet clears macros before setting environment variable to ensure intuitive use of the function in nested iocsh calls. While adding this functionality, fixed a latent bug in macPutValue where if you tried to NULL a macro with the same name as an environment variable, you would go into an infinite loop. 2014-09-02 16:35:32 -05:00
Ralph Lange
4081935904 std/filters: fix bug in Makefile (showed up on Windows, not on Linux) 2014-08-29 16:33:47 -07:00
Ralph Lange
f88cc071fc configure, ioc/db: remove clutter left by rebase, add rule for pm to html generation (include pm in ..) 2014-08-29 16:33:11 -07:00
Ralph Lange
127af22c34 configure: improve log output for generated html 2014-08-29 16:30:27 -07:00
Michael Davidsaver
7f7e63fee1 dbScan.c: clarify ioeventCallback 2014-08-29 15:43:16 -07:00
Till Straumann
16bef44e5d - print header message 2014-08-29 15:03:56 -07:00
Till Straumann
f2626442b6 - removed message; if there is no support remain silent 2014-08-29 15:03:04 -07:00
Till Straumann
32c6888e1b - removed message about a stack trace going to be printed 2014-08-29 15:02:20 -07:00
Till Straumann
0d323db997 - removed obsolete rule (used during development) 2014-08-29 15:00:54 -07:00
Andrew Johnson
8604d4643a Merged Murali's memlock_all branch. 2014-08-29 10:58:55 -07:00
Ralph Lange
1bb4293967 src/tools: Set right margin to 0 in style sheet used for html docs created from pod 2014-08-28 15:42:46 -07:00
Ralph Lange
eb91f6701c src/std/filters: Complete documentation for standard filters 2014-08-28 15:41:40 -07:00
Till Straumann
079357c242 - let default (no-op) version of stack trace print informative message
that stack traces are not supported.
2014-08-28 15:10:12 -07:00
Andrew Johnson
267ed50dc7 Allow unknown field attributes in record.dbd files
They will be noisy, but are retained in regenerated output and
won't stop the build from proceeding.
2014-08-28 14:12:28 -07:00
Ralph Lange
51c7dea070 ioc/db: make sure each priority gets at least one thread. 2014-08-28 12:30:07 -07:00
Till Straumann
768c2c02e7 - paranoia test; errlogFlush; fixed debug messages
1) Added a paranoia test to make sure an ill-formatted
      ELF string table is not overrun if there is no NULL
      char found.

   2) Added errlogFlush() before and after stack dump (suggestion
      by Michael Davidsaver, thanks).

   3) Fixed (out of sync) debug messages.
2014-08-28 11:43:46 -07:00
Till Straumann
47408ed14c - indentation 2014-08-28 11:43:18 -07:00
Ralph Lange
648bf6a808 std/filters: add tagged configuration options to dbnd and sync plugins 2014-08-28 11:24:48 -07:00
Ralph Lange
17da152e22 ioc/db/test: add test for tagged plugin configuration 2014-08-28 11:24:09 -07:00
Ralph Lange
bc1cd15852 ioc/db: add optional "tagged" plugin configuration (sets integer tag and any value in one step) 2014-08-28 11:23:22 -07:00
Till Straumann
5a06c118c8 - added unit test for epicsStackTrace 2014-08-28 10:50:03 -07:00
Till Straumann
ccb5be72dd - consistent naming: 'StackTrace' everywhere... 2014-08-28 10:49:22 -07:00
Till Straumann
8b2b03482f - consistent naming: 'StackTrace' everywhere. 2014-08-28 10:47:59 -07:00
Andrew Johnson
7629cf818a Add epicsScanLLong and epicsScanULLong macros and tests. 2014-08-27 23:29:19 -07:00
Andrew Johnson
bdd495acae Document the 64-bit integer types and support routines. 2014-08-27 22:35:21 -07:00
Andrew Johnson
b0cdaddebc Added 64bit and long long epicsParse* functions 2014-08-27 22:21:30 -07:00
Andrew Johnson
9471488796 Add strtoll() and strtoull() for VxWorks
These are not yet provided even in VxWorks 6.9.
2014-08-27 22:11:08 -07:00
Till Straumann
4459ca0ad8 - merged stacktrace onto current 3.15 tip (Thanks Andrew for his help) 2014-08-27 14:34:05 -07:00
Murali Shankar
67ed5d1f21 Added documentation for memlock_all to the release notes 2014-08-27 12:15:04 -07:00
Keenan Lang
9d0be21cc1 MAC_HANDLE's in iocshBody weren't being created with environment variables. 2014-08-27 13:31:16 -05:00
Keenan Lang
b2c2d9b7d6 Tests changed to accomodate macDefExpand's different args 2014-08-27 13:17:15 -05:00
Keenan Lang
4497e8d5f4 Updated macLibREADME 2014-08-27 11:41:27 -05:00
Keenan Lang
2d3db2036b Updated iocshBody to keep track of macro context to allow scoping of macro variables from iocshRun/Load 2014-08-27 11:33:14 -05:00
Murali Shankar
1b7c161f7f On POSIX systems, an IOC application's ability to meet timing deadlines is often
dependent on its ability to lock  part  or  all  of  the process's virtual
address space into RAM, preventing that memory from being paged to the swap
area.  This patch will attempt to lock the process's virtual address space into
RAM if the process has the ability to run threads with different priorities. If
unsuccessful, it prints an message to stderr.  

In Linux, one can grant a process the ability to run threads with different
priorities by using a command like ulimit -r unlimited. To use the FIFO
scheduler, use a command like so - chrt -f 1 softIoc -d test.db

In Linux, one can grant a process the ability to lock memory by using a command
like ulimit -l unlimited. Alternatively, these limits can be configured on a per
user/per group basis by using /etc/security/limits.conf or its equivalent.

In Linux, a child process created via fork inherits its parent's resource
limits.  Thus, it is probably a good idea to start the caRepeater before
starting the IOC.
2014-08-26 17:29:27 -07:00
Ralph Lange
f40c25723d libCom/osi: Fix for MinGW32 builds on Windows 2014-08-26 17:14:35 -07:00
Andrew Johnson
0d33e8a872 epicsStdio.c allow stderr from inside epicsThreadInit()
Circular initialization problem that Murali discovered when you
try to fprintf(stderr) from the posix/osdThread.c once() routine.
This change lets the stderr stream through in that case.
2014-08-26 16:40:02 -07:00
Andrew Johnson
83d22ce164 libCom: Darwin has setenv(), use it. 2014-08-26 14:51:18 -07:00
Ralph Lange
08bf6a1081 ioc/db: fix bug in callback thread initialization 2014-08-26 11:58:42 -07:00
Ralph Lange
862abba4cb ioc/db: fix bug in callback.c 2014-08-26 10:58:59 -07:00
Ralph Lange
bd0c759af3 ioc/db: change call back queue wakeup algorithm (only wake when threads are sleeping and enough work in the queue) 2014-08-26 10:36:32 -07:00
Ralph Lange
15415b5590 Merge from parallel-cbthreads-2: return value for callbackRequest, add tests 2014-08-25 14:40:37 -07:00
Andrew Johnson
2aea693faf Merged Jeff's 3.15_libcom_from_cvs_trunk branch. 2014-08-25 16:27:18 -05:00
Ralph Lange
ca8eda8090 Merge (cherry-pick) original parts from parallel-cbthreads branch 2014-08-25 13:40:18 -07:00
Keenan Lang
00bb3d1e67 iocshLoad now works as iocsh with no parameters 2014-08-22 14:25:41 -05:00
Keenan Lang
1ad6ff03b3 Changed iocshLoadFile to iocshLoad and added iocshRun as the macro version of iocshCmd 2014-08-22 11:50:24 -05:00
Keenan Lang
4f1f7dd83b Updated macLib documentation 2014-08-21 17:13:00 -05:00
Keenan Lang
8750ff8807 macDefExpand test file 2014-08-21 16:55:26 -05:00
Keenan Lang
28a01eb572 Added macDefExpand tests to libCom Test Harness 2014-08-21 16:54:39 -05:00
Keenan Lang
dfe6515809 offset by a space 2014-08-21 16:12:11 -05:00
Keenan Lang
76bd45cb45 Reverted calls that didn't need to use macDefExpand to single parameter 2014-08-21 16:09:21 -05:00
Keenan Lang
6d3b70251c Returned macEnvExpand to original parameters, added macDefExpand 2014-08-21 16:05:55 -05:00
Keenan Lang
6d38cc1f76 Returned iocshCmd to it's original function signature, added iocshLoadFile instead 2014-08-21 15:19:50 -05:00
Keenan Lang
77f1fc0504 Missed a few whitespace 2014-08-20 17:01:36 -05:00
Keenan Lang
6ebbf0dd8c Whitespace changes snuck in due to editor 2014-08-20 16:58:50 -05:00
Keenan Lang
8d33108dd8 changed msi.c's use of macEnvExpand to have NULL macros 2014-08-20 13:28:55 -05:00
Keenan Lang
5798574d62 dbLexRoutines calls macEnvExpand as well, doesn't need macros, so added NULL's 2014-08-19 16:50:49 -05:00
Keenan Lang
0cb495bdb3 Sidestepping testing in macEnvExpandTest 2014-08-19 16:44:15 -05:00
Keenan Lang
69c7f0b065 Changing macEnvExpand to accomodate macro definitions 2014-08-19 16:40:51 -05:00
Keenan Lang
ab94bb46f2 Changing iocshCmd to idealized syntax 2014-08-19 16:34:41 -05:00
Michael Davidsaver
7f5fc4356b generate pkg-config files 2014-08-19 11:16:01 -04:00
Andrew Johnson
9079c8aa53 Reverted changes to epicsTime.h and epicsThread.h 2014-08-18 22:55:07 -05:00
Andrew Johnson
c85bd908a3 makeBaseApp tempplate: OPT settings
Eric suggested mentioning the HOST_OPT and CROSS_OPT settings
in the application template's configure/CONFIG_SITE file.
2014-08-18 16:16:02 -05:00
Andrew Johnson
5e0bf53fec epicsTypes.h: Don't use C99 types
The __STDC_VERSION__ >= 199901L test never succeeds
in C++, and there were issues with the epicsInt8
definition anyway (int8_t is signed, but char might
not be).

I also removed the epicsBoolean enum which we never use.
2014-08-15 12:24:31 -05:00
Michael Davidsaver
b7e46b8b02 rsrv: better error msg when listen() fails 2014-08-13 14:26:03 -04:00
Andrew Johnson
cafebf2428 Merged Ralph's fix-nan-inf-updates branch.
Added a few cosmetic changes en route.
2014-08-05 15:51:52 -05:00
Andrew Johnson
547a9b3ebc Tweak some dependency rules for correctness 2014-08-05 14:03:37 -05:00
Ralph Lange
e6a883bc5f std/rec/test: explicitly register test subroutine for subroutine record (fix build on MinGW) 2014-08-05 14:29:14 +02:00
Ralph Lange
fdb21252b0 ioc/db (recGblCheckDeadband): avoid signbit() which does not exist on older MSVC installations 2014-08-05 11:20:23 +02:00
Ralph Lange
130d98463c ioc/db (recGblCheckDeadband): pull most common case to front 2014-08-05 11:17:29 +02:00
Ralph Lange
ded1f3572d ioc/db: force isnan()/isinf() to be 1 (instead of non-zero) 2014-08-05 10:42:25 +02:00
Andrew Johnson
cc656981c0 MSI testing
When testing the msi program, don't rely on EPICS_HOST_ARCH
to find the binary executable as we may be running the tests
on a cross-arch such as linux-x86-debug.
2014-08-04 15:39:02 -05:00
Michael Davidsaver
fb3314ea45 analogMonitorTest: char array too small 2014-08-04 13:43:37 -04:00
Michael Davidsaver
73a64bc89f quiet some warnings
unused variable iseq
undefined struct dbBase
2014-08-04 13:28:47 -04:00
Michael Davidsaver
96b082d3e4 fix makefile typo 2014-08-04 12:26:31 -04:00
Andrew Johnson
aedea0da37 default/osdSpin.c add missing #include "cantProceed.h"
Also adjusted some error messages for common style.
2014-08-02 23:15:43 -05:00
Andrew Johnson
b7f8f17227 blockingSockTest: Undo member renames using m_ prefix
Using the m_ prefix to denote class data members is dangerous in
code that has to compile on VxWorks 5.5 (which 3.15 does) because
the net/mbuf.h header contains the following macro definitions:

#define m_next          mBlkHdr.mNext
#define m_len           mBlkHdr.mLen
#define m_data          mBlkHdr.mData
#define m_type          mBlkHdr.mType
#define m_flags         mBlkHdr.mFlags
#define m_nextpkt       mBlkHdr.mNextPkt
#define m_act           m_nextpkt
#define m_pkthdr        mBlkPktHdr
#define m_ext           pClBlk
#define m_extBuf        m_ext->clNode.pClBuf
#define m_extFreeRtn    m_ext->pClFreeRtn
#define m_extSize       m_ext->clSize
#define m_extRefCnt     m_ext->clRefCnt
#define m_extArg1       m_ext->clFreeArg1
#define m_extArg2       m_ext->clFreeArg2
#define m_extArg3       m_ext->clFreeArg3
#define  m_copy(m, o, l)        m_copym((m), (o), (l), M_DONTWAIT)
#define  m_copym(m, o, l, w)    netMblkChainDup(_pNetDpool, (m), (o), (l), (w))
#define  m_freem(m)             netMblkClChainFree(m)
#define  m_free(m)              netMblkClFree(m)    
#define m_mbufs         mNum
#define m_drops         mDrops
#define m_wait          mWait
#define m_drain         mDrain
#define m_mtypes        mTypes

While the names in the original change all appear to be safe, I
don't want us to start using this convention because we will then
have to police commits more closely or risk build failures in the
future when someone who doesn't know about or remember the issue
can't or doesn't try building their code against VxWorks 5.5.

I don't particularly like the this-> convention to mark member
names either, but until the VxWorks 5.5 support requirement goes
away the m_ convention is worse. Another common convention of
using a leading underscore is not safe either, those names are
reserved for the C/C++ implementation.
2014-08-02 14:02:43 -05:00
Andrew Johnson
8d5cdc3747 Fix typo in macro name
Not that it really matters since only VxWorks and RTEMS actually
compile this file and they don't have shared libraries...
2014-08-02 13:13:49 -05:00
Andrew Johnson
f1a59aa64a Use epicsUInt types, stdint.h is not found on all platforms 2014-08-02 13:09:07 -05:00
Andrew Johnson
6767f5089f threadPool: Replaced errno.h status values with S_pool_* ones
ETIMEDOUT is not provided on MinGW.
2014-08-01 17:55:53 -05:00
Andrew Johnson
59a0fa9364 Fix vxWorks again, passes the tests on all my CPUs now. 2014-08-01 16:06:17 -05:00
Ralph Lange
a5fe64a8ad dev, rec: Fix smoothing for NaN/+inf/-inf values in ai record and soft support 2014-08-01 17:20:55 +02:00
Andrew Johnson
fcd0a4c75d Fixes for VxWorks implementation. 2014-07-31 15:43:35 -05:00
Michael Davidsaver
d05f2e6062 dbPutLinkTest: check HW link parsing 2014-07-31 16:22:02 -04:00
Michael Davidsaver
e09066cfab dbPutLinkTest: check parsing of CA_LINK 2014-07-31 16:22:01 -04:00
Michael Davidsaver
40838579af iocShutdown: cleanup links 2014-07-31 16:22:01 -04:00
Michael Davidsaver
9f53417a8d add dbCaLinkInitIsolated()
Initialize dbCa workList lock so that CA_LINK
creation in test code doesn't crash.
Once created links will never connect.

clean up workList for unittest when dbCaShutdown
is called state is already exit.
2014-07-31 16:22:01 -04:00
Michael Davidsaver
29490f24c7 dbFreeLinkContents: missing case for RF_IO 2014-07-31 16:22:01 -04:00
Andrew Johnson
ab78480d54 Merged spinlockfix branch.
Some last-minute fixes for VxWorks build warnings.
2014-07-31 12:45:40 -05:00
Andrew Johnson
63d2d8de33 Merged cas-intf-addr-list branch. 2014-07-31 11:34:10 -05:00
Andrew Johnson
68bcc77885 Merged alarm-strings branch. 2014-07-31 10:17:24 -05:00
Andrew Johnson
b0a330f22a Document changes. 2014-07-30 18:03:34 -05:00
Ralph Lange
01dcbed948 ioc/db/test: add test for recGblCheckDeadband() 2014-07-30 13:36:26 +02:00
Ralph Lange
edafb56273 std/filters: make dbnd filter use recGblCheckDeadband() 2014-07-30 10:37:10 +02:00
Ralph Lange
f354f880cc std/rec: make all analog type records use new recGblCheckDeadband() 2014-07-30 10:36:24 +02:00
Ralph Lange
6f41e11804 ioc/db: add recGblCheckDeadband() to recGbl library 2014-07-30 10:35:03 +02:00
Andrew Johnson
64c45961ff configure: Fix missing dependency files
Dependency files were not being created for sources that
were only listed in x_SRCS_class variables, because the
code that added those to the x_SRCS var was running after
we had already loaded the dependency files.
2014-07-29 18:16:53 -05:00
Andrew Johnson
b3afbea7cf Merged Michael's thread-pool branch.
Made various formatting changes, and fixed one problem in the
test program which failed a test on UP machines.
2014-07-29 16:05:24 -05:00
Andrew Johnson
41502f9525 db: Remove status message from dbpf
The status returned from dbPutField() can now include errors from
the record processing such as a link alarm, so it doesn't mean
what it used to and printing the error might be wrong.
Now we just return the status value.
2014-07-29 12:46:38 -05:00
Michael Davidsaver
716f2679a7 thread pool: don't use reserved names
Avoid global symbols with leading underscore
2014-07-29 12:21:07 -04:00
Michael Davidsaver
b1a8b2f20e thread pool: switch thread counts to unsigned int
size_t is considered overly optimistic
2014-07-29 12:18:19 -04:00
Michael Davidsaver
6fee83900e don't include errCommon.h
doesn't exist anymore
2014-07-29 12:06:24 -04:00
Michael Davidsaver
6d11cba513 add missing TESTFILES 2014-07-29 10:32:47 -04:00
Ralph Lange
c8946b4fc2 std/rec: fix inf handling in select record 2014-07-29 15:19:12 +02:00
Ralph Lange
633ef60514 std/rec: fix NaN/inf bug in deadband algorithm of analog records 2014-07-29 15:16:37 +02:00
Ralph Lange
d86723d62a std/rec/test: add test for deadband mechanism of analog record types 2014-07-29 15:13:10 +02:00
Michael Davidsaver
e2461e97ff dbLockTest: test creation of DB links 2014-07-28 14:33:17 -04:00
Andrew Johnson
75da9fd454 Moved dlopen version of osdFindSymbol.c into posix
It was identical in solaris, Darwin and Linux, and had
not been included for cygwin so this reduces duplication.
2014-07-28 12:27:02 -05:00
Andrew Johnson
152e8865cc Cleaned up exampleApp Makefiles 2014-07-28 11:38:30 -05:00
Ralph Lange
69e8c4b48e std/rec: Improve subRecord error messages 2014-07-28 16:19:42 +02:00
Andrew Johnson
5708855c36 Release Notes for loading support.
To Do:
 * Test that -l the flag to registerRecordDeviceDriver.pl works
   as expected on Windows.
 * Modify example template, or create a new template.
 * Work out if/how this affects VxWorks, can we generate a munch
   file that works the same way as a shared library?
 * Test on all arch's, especially Darwin & Windows.
2014-07-28 00:52:34 -05:00
Andrew Johnson
4b1fd8cba0 Modify registerRecordDeviceDriver for loadable support
Don't generate code to register record types that have only
been declared, i.e. that have no fields defined in them.
This allows libraries to created which only contain device
support without the record types that they support. The
library must have a DBD file that may declare the record
types (to avoid generating a warning) and also contains any
other device(), variable(), function() and registrar()
entries for software included in the library.

Adds -l flag to the registerRecordDeviceDriver program,
which results in epicsExportSharedSymbols being defined
and shareLib.h being reloaded so the generated output file
can be linked into the library that it is registering.
This aspect has not been tested on Windows DLLs yet.
2014-07-28 00:18:37 -05:00
Andrew Johnson
163cf7971d Errors from the DBD Parser should stop dbdExpand
Such errors used to be just warnings, now they stop the output
file being generated unless the -D flag was given.
2014-07-28 00:16:16 -05:00
Andrew Johnson
a2d511b6e9 DBD parser accepts record type declarations
Record types are the only DBD entries for which the parser
will not accept redefinitions. This change lets it accept
a record type declaration any number of times. However once
a record type declaration has been parsed the full record
type definition cannot be loaded, an error will be raised
if the full definition is seen. The parser will still not
accept a full record type definition more than once either,
any later copies of the record type must be declarations.
2014-07-27 23:55:47 -05:00
Andrew Johnson
8eed4cdd88 Perl DBD Parser: Autovivify record types in device() entries
If a record type named in a device() entry does not exist when
the device is seen, the DBD parser will now print a warning
and create an empty record type with that name to hold the
device entry information.
This will allow support modules to be built into libraries that
include their own registerRecordDeviceDriver code, which was
apparently possible with 3.14 although not officially supported.
To avoid the warning message, the DBD file can declare each
record type before the device statement that uses it.

A record type declaration looks like this:
    recordtype(ao) {}
    device(ao, ....)
An IOC will accept and ignore a record type declaration, but it
must have loaded the full record type definition first.
2014-07-27 23:37:58 -05:00
Andrew Johnson
ee40ee789c dbStatic: Allow empty recordtype bodies in DBD files
A record type with an empty body is a declaration. The IOC will
accept one of these in a DBD file as long as it has already
loaded the full record type definition.
This will allow device support to provide a DBD file that declares
each record type it uses before giving the related device() entry.
Later commits will explain why.
2014-07-27 23:26:01 -05:00
Andrew Johnson
c710a3a898 dbStatic/dbLexRoutines.c fix error message 2014-07-27 15:41:49 -05:00
Andrew Johnson
2de36d3273 Fix lock-set initialization properly. 2014-07-25 17:59:59 -05:00
Michael Davidsaver
c4a1208d6e epicsSpinTest: add to libCom test harness 2014-07-25 18:17:27 -04:00
Michael Davidsaver
9cb65e5408 epicsSpinTest: plug some leaks 2014-07-25 18:17:02 -04:00
Andrew Johnson
2a9d05248f Fix epicsSpinTest.c spinThread tests
Runs many more rounds, without blocking with the lock held.
2014-07-25 16:21:03 -05:00
Andrew Johnson
752549d1c8 Fix epicsAtomic headers when used from C code
Several C++ and C99-isms crept in.
2014-07-25 15:05:58 -05:00
Michael Davidsaver
8fec9d6e00 epicsSpin: try lock return non-blocking
Avoid cantProceed() in try lock, even for undefined behavior.
2014-07-25 15:12:02 -04:00
Michael Davidsaver
5824f98972 epicsSpinTest: fix verifyTryLock()
avoid sleeping with a spinlock held.
Now test only works on SMP systems.
2014-07-25 15:11:54 -04:00
Michael Davidsaver
9d03275c53 iocInit: ensure dbLock cleanup after iocShutdown cleanup
by making dbLock init before initDatabase()
2014-07-25 13:49:55 -04:00
Michael Davidsaver
b5fe4abfa8 switch to use sysInWord and friends 2014-07-25 11:15:27 -04:00
Michael Davidsaver
95b916ecd4 thread pool: mark epicsJobCreate() as safe for job functions
Also, use epicsJobMove() to avoid some redundant code
2014-07-25 10:16:20 -04:00
Michael Davidsaver
cbfbce54f9 thread pool: epicsThreadPoolWait return ETIMEOUT 2014-07-25 09:59:46 -04:00
Michael Davidsaver
b3a1fe9c6b thread pool: fix return of epicsJobUnqueue()
Return 0 on success (was queued, now is not),
1 if not queued initially, and EINVAL
if orphaned.
2014-07-24 18:56:27 -04:00
Michael Davidsaver
83dfc7980d thread pool: handle failure to create worker
epicsJobQueue() returns EAGAIN when the first worker
can't be lazily created.

Failure to create workers beyond the first is
silently ignored.
2014-07-24 18:50:19 -04:00
Michael Davidsaver
69d1063067 thread pool: epicsJobQueue return EPERM
When pool control prevents operation
2014-07-24 18:19:33 -04:00
Andrew Johnson
9b6e270b97 Final spinlock tidying-up
* Abort epicsSpinTest() if epicsSpinCreate() returns NULL
* Adjust RELEASE_NOTES that describe the implementations.
2014-07-24 16:33:35 -05:00
Michael Davidsaver
fc4119094f thread pool: epicsThreadPoolGetShared accepts NULL as defaults 2014-07-24 14:44:28 -04:00
Michael Davidsaver
fd2edfe94c release notes 2014-07-24 14:22:52 -04:00
Michael Davidsaver
01a50b5165 thread pool test 2014-07-24 14:22:52 -04:00
Michael Davidsaver
658bd0b570 thread pool implementation 2014-07-24 14:22:52 -04:00
Michael Davidsaver
a8fd14aae1 Thread pool API 2014-07-24 14:22:52 -04:00
Michael Davidsaver
87a6688c17 epicsSpin: remove redundant cantProceed() messages 2014-07-24 10:23:55 -04:00
Ralph Lange
ae518f6e3e ioc/db/test: Fix Windows build 2014-07-24 14:06:11 +02:00
Michael Davidsaver
3ba5bf943e epicsSpin: better error messages when mis-use is detected 2014-07-23 18:40:08 -04:00
Andrew Johnson
846ef343e3 Merged ioc-shutdown2 branch. 2014-07-23 16:59:12 -05:00
Andrew Johnson
6bdb8f911a Suppress errlog output of expected warning messages. 2014-07-23 16:18:32 -05:00
Michael Davidsaver
0bf17be9e3 mmio: vxWorks m68k use default, add weak symbols for old versions 2014-07-16 15:12:56 -04:00
Michael Davidsaver
0bcfbd0ffc remove unused 2014-07-14 18:16:30 -04:00
Michael Davidsaver
34f0374ca5 dbLock: yet another fix to dbLockCleanupRecords()
track the lockRecord allocation
2014-07-14 17:57:17 -04:00
Michael Davidsaver
3755b9eaad dbLock: free lockSets 2014-07-11 18:49:41 -04:00
Michael Davidsaver
edf1ad0362 dbLock: another fix to dbLockCleanupRecords() 2014-07-11 18:49:41 -04:00
Michael Davidsaver
bb51281d9c dbPutLinkTest: set # of tests 2014-07-11 16:59:22 -04:00
Michael Davidsaver
fd7a934ce3 dbPutLinkTest: test link string parsing
Test parsing to CONTANT and DB_LINK.
dbCa isn't initialized, so no test for CA_LINK.
2014-07-11 16:51:32 -04:00
Michael Davidsaver
f14bfaab24 dbUnitTest: add testdbGetFieldEqual() 2014-07-11 16:47:55 -04:00
Michael Davidsaver
a218bfd75c dbLock: fix dbLockCleanupRecords
all lockRecord s allocated in one block.  oops.
2014-07-11 16:27:41 -04:00
Michael Davidsaver
3f11fd1665 dbUnitTest: replace testdbPutField()
add testdbPutFieldOk() and testdbPutFieldFail()
which include calls to testPass() or testFail()

Leave testdbVPutField() as a building block.
2014-07-11 10:30:31 -04:00
Michael Davidsaver
ebc3834661 dbUnitTest: testIocInitOk/testIocShutdownOk testAbort() on failure 2014-07-11 10:28:54 -04:00
Michael Davidsaver
f85c3249ab dbUnitTest: rename 2014-07-10 18:23:49 -04:00
Andrew Johnson
3ff49fc9b2 Fixed build errors, remove dependency on std.
Build errors: Include guard missing from epicsUnitTest.h;
    dbShutdownTest.c was calling the non-universal strcasecmp()
    instead of epicsStrCaseCmp().

ioc/db/test no longer depends on std. I modified
    xRecord to make it a working record type, and simplified the
    other test programs so they all use the same new expanded
    dbd file rather than each making their own. I also added
    dbShutdownTest() to epicsRunDbTests().
2014-07-10 14:27:44 -05:00
Andrew Johnson
2bf6d88607 templates: Quote path names in st.cmd files, permits spaces
Request from Eric Norum.
2014-07-01 10:55:52 -05:00
Andrew Johnson
3c91c17369 Changes for newer version of Pod::Simple::HTML 2014-06-23 22:14:35 -06:00
Andrew Johnson
5b9bee82a5 Document the sync filter.
Also, use enum values where we have them.
2014-06-23 22:11:52 -06:00
Michael Davidsaver
a9d4204d43 dbLock: free LSET 2014-06-23 16:28:28 -04:00
Michael Davidsaver
0c73bb9448 dbChannel: atexit 2014-06-23 16:28:27 -04:00
Michael Davidsaver
c8d9d5e952 dbLock: atexit 2014-06-23 16:28:27 -04:00
Michael Davidsaver
c838d5d870 dbBkpt: atexit 2014-06-23 16:28:26 -04:00
Michael Davidsaver
ddaa6e4eb6 dbNotify: cleanup atexit 2014-06-23 16:28:26 -04:00
Andrew Johnson
60a0c7f181 Make epicsExit subsystem reusable.
Calling epicsAtExit() after epicsExitCallAtExits() now
recreates the per-process list and registers the routine.
2014-06-23 16:28:25 -04:00
Michael Davidsaver
80dd66a58d add dbUnitTest.h
hide boilerplate of tests using the PDB
2014-06-23 16:28:25 -04:00
Michael Davidsaver
1ae2ab1de6 dbShutdownTest 2014-06-23 16:28:24 -04:00
Michael Davidsaver
5caaf2d13c cleanup initHook 2014-06-23 16:28:23 -04:00
Michael Davidsaver
3ca42fc838 cleanup iocsh 2014-06-23 16:28:22 -04:00
Michael Davidsaver
ad2bb0725d asShutdown 2014-06-23 16:28:22 -04:00
Ralph Lange
2d4e143987 db/callback: add callbackShutdown() to API, add shutdown handling 2014-06-23 16:28:21 -04:00
Ralph Lange
e83bc13a5e db/dbCa: add dbCaShutdown() to API, complete shutdown handling 2014-06-23 16:28:21 -04:00
Ralph Lange
23e22313f1 db/dbScan: add scanShutdown() to API, complete shutdown handling 2014-06-23 16:28:21 -04:00
Michael Davidsaver
564a527489 misc/iocInit: add iocBuildNoCA() and iocShutdown() to API, split up
iocBuild in three phases
2014-06-23 16:28:20 -04:00
Michael Davidsaver
8a42190e39 ensure the errlog is started with iocInit 2014-06-23 16:28:20 -04:00
Michael Davidsaver
f405b444a3 errlog: nicer exit handler name 2014-06-23 16:28:19 -04:00
Michael Davidsaver
a28a561d8a epicsExit: optional debug printing
Add a flag to cause a string to be printed
before each handler is run to show the order.
2014-06-23 16:28:18 -04:00
Ralph Lange
8ab1f34df4 std/filters: make arrTest run location more flexible 2014-06-21 16:22:09 +02:00
Andrew Johnson
c91fe7b7d7 Fix issues found by Clang
These were int => size_t changes that shouldn't have been made
because the value of the variable can be negative.
2014-07-12 01:09:36 -05:00
Andrew Johnson
05367f1b33 Cleanup dbConvert
Windows warnings removed from testdbConvert by Michael
Major reformatting of dbConvert.c
2014-07-08 14:40:15 -05:00
Andrew Johnson
09b93f10f7 Fixed dbConvert-memmove problems
Test program crashed on Windows-x64.
Some dbConvert.c routines used sizeof([unsigned ]long)
instead of sizeof(epics[U]Int32).
2014-07-08 12:32:11 -05:00
Andrew Johnson
659916cb16 Fix Windows build - no math with void* pointers 2014-06-16 09:57:02 -05:00
Andrew Johnson
f3ff337a41 Merged Michael's dbConvert-memmove branch. 2014-06-13 15:42:36 -05:00
Michael Davidsaver
77ffc94677 out of caution use memmove instead of memcpy 2014-06-13 15:37:13 -04:00
Michael Davidsaver
ec576dd088 benchmark dbConvert 2014-06-13 15:37:12 -04:00
Michael Davidsaver
fe61d46153 add testdbConvert 2014-06-13 15:37:11 -04:00
Michael Davidsaver
1a0ba81d0d dbConvert: optimize copy w/o convert
Use memcpy() where input and output memory representations
are the exactly the same (integer and floating point types).

Assumes 2s complement integer types and that signed and
unsigned types have the same representation.
2014-06-13 15:37:11 -04:00
Michael Davidsaver
0e28ff55c6 add include 2014-06-13 15:37:10 -04:00
Andrew Johnson
3cf2d9057f Allow appended .db files to omit record type
This .db file syntax is now legal, provided the
named record already exists:

  record("*", "named") {
    field(VAL, 10)
  }
2014-06-12 14:47:42 -05:00
Jeff Hill johill@lanl.gov
e374ee4658 patched this code to force alignment of the if request structure, which appears to be required to avoid exceptions on RTEMS with cpu architectures that detect use of misaligned addresses 2014-06-10 22:37:21 -06:00
Jeff Hill johill@lanl.gov
ba6a32fefb protect against situations where the server name isnt specified at all in bootp/dhcp 2014-06-10 16:18:26 -06:00
Jeff Hill johill@lanl.gov
aff46bd19a allow the NFS mount path to be embedded in the bootp server name parameter, and therefore different from the NFS mount point 2014-06-05 08:19:09 -06:00
Jeff Hill johill@lanl.gov
39b068cf0a RTEMS support for Altera Nios2 arch 2014-06-05 08:09:33 -06:00
Ralph Lange
41bd895cd5 ioc: Fix more MSVC 12.0 warnings 2014-06-04 21:18:43 +02:00
Ralph Lange
32c2775940 ioc/dbStatic: fix bug introduced in revision 12486 2014-06-04 17:07:16 +02:00
Ralph Lange
5754dc136e src/ioc: fix numerous warnings appearing on MSVC 12.0 / Windows (64bit) 2014-06-04 15:56:51 +02:00
Ralph Lange
f8b746287e ioc/db/test: make chfPluginTest more flexible wrt %e formatting of double 2014-06-04 11:55:40 +02:00
Ralph Lange
e7416ce144 ioc/db: fix issue with compiler differences between MSVC and GNU (enum signedness) 2014-06-04 11:53:32 +02:00
Andrew Johnson
9e1ebf8d0f Clean up build warnings from Darwin (clang). 2014-05-30 12:36:50 -05:00
Andrew Johnson
42a3b4fbfd Add a ca: prefix to RSRV's identity string 2014-05-29 17:36:04 -05:00
Andrew Johnson
511b2e4f5c Document briefly. 2014-05-29 17:34:23 -05:00
Andrew Johnson
dbe2a890ec db: Use dbServer API
Setting TPRO now prints user@hostname instead of the thread
name when a record is processed as a result of a caput.

Also added the dbsr command, which currently just calls casr but
will call all registered server report routines (e.g. pvaSrv).
2014-05-29 17:11:31 -05:00
Andrew Johnson
fc8ad6b9ec rsrv: Register with dbServer API. 2014-05-29 17:10:26 -05:00
Andrew Johnson
8857d0bb4e Add dbServer files. 2014-05-29 17:09:08 -05:00
Andrew Johnson
c980613bd8 db/dbChannel: Rename dbr_final_type -> final_dbr_type 2014-05-29 12:31:47 -05:00
Michael Davidsaver
80b64d6a30 spinlocks update
add epicsSpinMustCreate()

Fix spinlock on RTEMS and vxWorks
UP systems to disable task preemption.

Don't use posix spinlocks when
thread priorities are used.
2014-05-23 15:14:49 -04:00
Ralph Lange
271e1811e3 ioc/dbStatic: make offset in field description an unsigned short, add cast to code generator
fixes ~2600 compiler warnings (on windows-x64)
2014-05-22 16:18:02 +02:00
Andrew Johnson
7dd5e217f6 Merged Ralph's get-cpus branch. 2014-05-19 09:44:05 -05:00
Andrew Johnson
ea1ebd0a7c Fix some HTML character escapes. 2014-05-19 09:26:24 -05:00
Ralph Lange
722d5eeba7 libCom/osi: use epicsThreadGetCPUs implementation from thread-pool branch (posix, WIN32) 2014-05-18 17:24:38 +02:00
Ralph Lange
286bfc5215 .bzrignore: add QtCreator project files 2014-05-18 14:28:39 +02:00
Andrew Johnson
6e01fd9c3d docs/cap5: Adjust link to CA Ref manual. 2014-04-30 12:07:30 -05:00
Andrew Johnson
2b7781c8d9 Support for Solaris 11 on x86 and SPARC.
Thanks to Bob Soliday for the necessary changes.
2014-04-25 16:51:28 -05:00
Andrew Johnson
9170d79ffe libCom/test: isinf() and isnan() want doubles
This apparently becomes important in a newer GCC version.
2014-04-25 14:08:25 -05:00
Janet Anderson
3019a5fb07 mkmf.pl needs -I prefix on include directories. 2014-04-14 15:09:59 -05:00
Janet Anderson
2efb1d0373 mkmf.pl needs -I prefix on include directories. 2014-04-14 15:00:37 -05:00
Andrew Johnson
ca9ef80760 configure: Cancel GNUMake built-in compiler rules
Their rules don't have our _INC dependencies, and were
being used in the gdd build (with no -I paths).
2014-04-10 12:35:47 -05:00
Andrew Johnson
475296ad49 Modify inc dependencies
Using inc causes a rebuild every time; replace it with
the list of include files that the compiler might use.
Also adjust gdd build to avoid a circular dependency.
2014-04-09 16:54:26 -05:00
Andrew Johnson
e2e40a4b9f configure: Add inc dependency to compile rules
The inc step must have been completed before we run
the C/C++ compilers to build any object files.
2014-04-07 12:38:03 -05:00
Andrew Johnson
f24dafa1e0 libCom: Adjust the Posix epicsMutexOSD structure
Make pthread_mutex_t lock the first member of the
parent structure, so it's easy to convert between them.
2014-04-01 11:09:36 -05:00
Andrew Johnson
312fdee91d cap5: Fix fisibility of boot_Cap5
Old method doesn't work any more, not sure what changed.
2014-03-18 14:18:08 -05:00
Andrew Johnson
a3b5ced30b CAref: Clean up HTML anchors
Only need to set name attribute on anchors, not id too.
Having both causes linklint warnings.
2014-03-14 15:43:29 -05:00
Andrew Johnson
4b18edc586 Merged changes from 3.14 branch.
Up to revno 12479.
2014-03-13 15:04:31 -05:00
Andrew Johnson
e63f14bc95 configure: Fix for Ben's INC_osclass issue
Janet developed the fix, I documented it.
2014-03-12 16:42:18 -05:00
Andrew Johnson
b1ece5d8d2 cap5: Added CA->version function
Documented.
2014-03-11 17:46:14 -05:00
Andrew Johnson
894771e789 docs: Update Release Notes. 2014-03-11 17:14:30 -05:00
Andrew Johnson
f5b9db9583 libCom: Fix epicsString.h comparison functions
The string comparison functions epicsStrCaseCmp() and
epicsStrnCaseCmp() were returning incorrect results
when the strings did not match.

These functions now match their BSD equivalents, and
have working tests to confirm their operation.
2014-03-11 17:12:41 -05:00
Andrew Johnson
7b9b2b19d3 Document changes. 2014-03-06 16:02:20 -06:00
Andrew Johnson
56cc1a638a rsrv: Use casIntfAddrList in cast_server
Remove re-parsing of EPICS_CA[S]_SERVER_PORT params.
Bind the UDP socket to the first address in the list.
2014-03-06 16:00:02 -06:00
Andrew Johnson
b6defc6a7f rsrv: Use EPICS_CAS_INTF_ADDR_LIST in req_server
Parse EPICS_CAS_INTF_ADDR_LIST into new ELLLIST casIntfAddrList.
Display warning if contains more than one entry.
Bind the TCP socket to the first address in this list.
2014-03-06 15:55:13 -06:00
Janet Anderson
4e1a5eefff Set BUILD_CLASS to HOST. 2014-03-04 09:21:35 -06:00
Janet Anderson
0ba29b2eff Set BUILD_CLASS to HOST. 2014-03-04 09:12:25 -06:00
Janet Anderson
5ad46f557c Added static cross builds for win32-x86 and windows-x64. 2014-03-03 16:34:06 -06:00
Janet Anderson
d90f4d7976 Added static build config files for win32-x86 and windows-x64. 2014-03-03 13:31:14 -06:00
Andrew Johnson
5bdd9ddca6 Windows: Fix static builds on MinGW
Xiaoqiang Wang proposed some fixes that allow static builds on
the MinGW targets to succeed. Some additional changes made to
blockingSockTest.cpp also clean that up.
2014-02-25 15:56:13 -06:00
Janet Anderson
7eba398792 If T_A not defined, define DEP and look for template files in the . dir. 2014-02-24 13:01:23 -06:00
Andrew Johnson
0dc2746d68 libCom: Added echo command to iocsh 2014-02-21 15:49:15 -06:00
Andrew Johnson
1a70f1e347 libCom: Added macro EPICS_UNUSED to compilerDependencies.h
Stop unnecessary warnings.
2014-02-20 18:05:42 -06:00
Andrew Johnson
3fd8d4515c libCom/test: Finish converting blockingSockTest to epicsUnitTest
Don't call assert() from a test program,
it stops the tests from running if the assert fails.
2014-02-20 16:36:58 -06:00
Janet Anderson
b24d7c6da6 Allow user specified db substitution file suffix. 2014-02-20 15:03:23 -06:00
Andrew Johnson
84426ea334 templates: Unify PV name prefixes, remove "Host"
The difference between host IOCs and embedded ones does not
justify having a different prefix.
2014-02-18 18:32:29 -06:00
Eric Norum
52f654a5a3 templates: Make st.cmd templates safe against spaces in TOP. 2014-02-18 18:21:15 -06:00
Janet Anderson
83fa03dd40 Allow user specified substitution file suffix (from Dirk Zimoch) 2014-02-17 10:20:00 -06:00
Andrew Johnson
a591857c30 configure: Fixes to iOS build rules
From Tom Pelaia, these should now allow compiles for the
x86-based simulator as well as for ARM-based devices.
2014-02-17 10:12:53 -06:00
Ralph Lange
6ad30c92bb ca/legacy/pcas: fix compiler warnings (different signedness in comparison) 2014-02-16 19:29:58 +01:00
a3354f5db9 libCom: NTP Time Provider adjusts to OS tick rate changes
Allow the NTP Time provider (used on VxWorks and RTEMS only)
to adapt to changes in the OS clock tick rate after the provider
has been initialized.

Changing the tick rate after iocInit() is not advisable,
other software might still misbehave if initialized before
an OS tick rate change.
2014-02-13 10:09:12 -06:00
Andrew Johnson
0b374ef8a6 doc: Add newEpicsMutex to Release Notes. 2014-02-13 09:59:10 -06:00
Andrew Johnson
6ad61aea32 Fix missing spaces in ADDR_LIST formats. 2014-02-11 17:44:14 -06:00
Andrew Johnson
e1e389a2dd Low-memory behaviour fixes.
Fix unchecked buffer allocation in dbChannel.c
Replace calls to epicsStrDup() with checked malloc() for
things that happen often after iocInit.

Michael Davidsaver pointed out this issue.
2014-02-07 17:19:28 -06:00
Andrew Johnson
502366fdc3 epicsMutex C++ API: New constructor and newEpicsMutex macro
The new constructor accepts source file & line number.
The macro passes these in.
2014-02-07 14:13:12 -06:00
Andrew Johnson
b32127c5de libCom: Fix epicsTime::strftime() roll-over bug
Fractional seconds could round-up to .000 without
incrementing the integer seconds.
We can't actually do the latter, so we prevent the
roll-over and clamp at all 9's instead.
Idea from Eric Norum.
2014-01-29 16:52:22 -06:00
Andrew Johnson
3f0e633fd1 dbStatic: Clean up warning on darwin 2013-12-20 09:59:49 -06:00
Andrew Johnson
d35447fa0d configure: 3.14 merge broke darwin builds, fixing... 2013-12-20 09:57:39 -06:00
Andrew Johnson
0c52d41e95 db/test: Tell Win32 to only print 2-digit exponents
By default the MS libraries print 3-digit exponents,
whereas the ANSI standard is for 2-digits.
2013-12-17 17:41:13 -06:00
Andrew Johnson
dbb8d232ee libCom/test: Losen the timer error threshold.
Windows was consistently failing the fastest timer tests.
2013-12-17 17:13:27 -06:00
unknown
b93601bc22 libCom/test: epicsStrGlobMatch() tests 2013-12-17 16:37:46 -06:00
Andrew Johnson
9e37ab649b libCom: Clear up warnings from VxWorks 6.9. 2013-12-17 14:19:18 -06:00
Andrew Johnson
0a2020e2fc Merged changes from 3.14 branch
Up to 3.14.12.4 release.
2013-12-17 12:54:04 -06:00
Andrew Johnson
bfde24907c doc: Prepare release notes for 3.14.12.5
In case there ever is one.
2013-12-16 17:29:30 -06:00
Janet Anderson
da6228f135 Set snapshot to 3.14.12.4-DEV 2013-12-16 16:16:34 -06:00
Janet Anderson
3009091875 Creating R3.14.12.3 2013-12-16 15:51:45 -06:00
Janet Anderson
6a0d5e0e87 Changed EPICS to Release 3.14.12.4 2013-12-16 15:48:54 -06:00
Andrew Johnson
97636a45e0 libCom: Remove epicsShareAPI from epicsExit APIs
Passing epicsExitCallAtExits into atexit() was generating
a warning about passing in a __stdcall routine pointer.
2013-12-16 14:52:29 -06:00
Andrew Johnson
a50c66b6ff libCom/test: Added epicsEnvTest.c
VxWorks 6.x can make environment variables private to each
thread, which doesn't work too well.
A test failure on VxWorks explains how to change the image
configuration to fix this.
2013-12-16 12:48:25 -06:00
Andrew Johnson
88ae947c84 configure: Refined how/when we pull in <top>/cfg files
Only read CONFIG* and RULES* files,
and only do so in build dirs, i.e. when T_A is defined.
2013-12-13 16:04:01 -06:00
Andrew Johnson
22540ac743 docs: Release note update.
Credit Peter Heesterman with windows build updates.
2013-12-11 18:11:51 -06:00
Andrew Johnson
197e992241 Fixed iocsh stream redirection for several commands
Eric provided the fixes to iocsh (empty commands would not reset
redirected streams), I fixed various commands.
2013-12-11 17:50:29 -06:00
Andrew Johnson
b0cf5c256a startup: Add cygwin-x86_64 to EpicsHostArch.pl script 2013-12-10 16:28:08 -06:00
Andrew Johnson
76e967c960 dbStatic: Fixed crash loading record of unknown type
Fixed segfault when dbLoadRecords tried to load a record of a
type that was not defined in its DBD files.
2013-12-04 17:37:42 -06:00
Andrew Johnson
25f70a1bd7 Merged Michael's postdbeprop branch. 2013-12-04 12:58:31 -06:00
Andrew Johnson
4ac35ab85c docs: iPhone Simulator builds broken by Xcode 5
From Mark Engbretson, no known solution yet.
2013-12-04 10:37:44 -06:00
Janet Anderson
4209abe2cf Set snapshot to 3.14.12.4-rc1-DEV 2013-12-02 14:12:45 -06:00
Janet Anderson
90d1d9568c Creating 3.14.12.4-rc1 2013-12-02 13:56:17 -06:00
Janet Anderson
082df89090 Creating 3.14.12.4-rc1 2013-12-02 13:54:20 -06:00
Andrew Johnson
78a4e462d5 libCom: Recognize hex literals in epicsStrtod()
Allows Windows and VxWorks to accept hex integers as a double.
2013-12-02 11:12:19 -06:00
Michael Davidsaver
841d66993a test epicsMMIO.h
Check byte order swapping.
2013-11-30 16:40:07 -05:00
Michael Davidsaver
d24ed309e9 fix copyright header 2013-11-30 15:31:59 -05:00
Michael Davidsaver
7adb9c3881 update release notes 2013-11-30 15:29:10 -05:00
Michael Davidsaver
55c89335fd update release notes 2013-11-30 14:47:01 -05:00
Andrew Johnson
aab841e279 configure: Added 'host' make target.
Builds only the current host architecture, so this is
equivalent to the target install.$EPISC_HOST_ARCH
2013-11-22 11:44:42 -06:00
Jeff Hill
b38e48642e probably fixed PPC build (its not easy to test this here) 2013-11-20 17:55:44 -07:00
Andrew Johnson
bd82554299 Set snapshot to 3.14.12.4-pre1-DEV 2013-11-20 18:03:16 -06:00
Andrew Johnson
1a3e7414b3 Creating 3.14.12.4-pre1 2013-11-20 18:02:28 -06:00
Andrew Johnson
773eb1b33d Clean up array subscript has type ‘char’ warnings. 2013-11-20 17:28:41 -06:00
Andrew Johnson
9ab6f89604 Clean up epicsExport.h includes
Mostly in record and device support, this commit puts
the include in the right place and moves some other
includes around to get the order right.
2013-11-20 16:21:10 -06:00
Jeff Hill
0a86ec01fa o fixed spelling in comments
o fixed warnings during MSVC based build
2013-11-20 10:51:14 -07:00
Andrew Johnson
570993e32b configure: New targets cygwin-x86_64 and windows-x64-mingw 2013-11-19 18:50:49 -06:00
Andrew Johnson
93be1400c1 Fixed various 64-bit windows build issues. 2013-11-19 18:42:45 -06:00
Andrew Johnson
176ee926ad cygwin: Fixed SocketSystemCallInterruptMechanism
Cygwin changed it back again.
2013-11-19 18:41:03 -06:00
Andrew Johnson
2d52067484 libCom: Clean up build warnings from Visual Studio. 2013-11-19 15:26:22 -06:00
Andrew Johnson
4d64941bd2 libCom: truncateFile size arg should be unsigned long
It gets compared against LONG_MAX and cast to a long, so now
we have architectures where int != long we must distinguish them
2013-11-15 17:24:33 -06:00
Andrew Johnson
66209118f6 libCom/macLib: Don't use unsigned chars in macParseDefns()
These pointers are really pointing to standard chars.
2013-11-13 12:39:23 -06:00
Andrew Johnson
f146f9ea6e Move the string array declarations into alarm.h
This also removes all internal use of alarmString.h which
is now deprecated again (see 3.14.5, Jan 2004).
2013-11-12 16:18:17 -06:00
Jeff Hill
280ff742c5 fix for mingw gcc V3 build 2013-11-07 18:56:17 -07:00
Jeff Hill
6f67091628 fixed ms compiler build 2013-11-07 17:37:17 -07:00
Andrew Johnson
d6dab34ae9 Merged changes from Jeff Hill's ca-ref-man-maint branch.
This contains only text changes to the CA reference manual.
2013-11-07 17:57:09 -06:00
Jeff Hill
36d801682b oops, variable used to be unsigned; changed to signed constant 2013-11-07 14:59:30 -07:00
Jeff Hill
4d54b91a3a o fixed compile errors in, and proper diagnostic from, casPVI.cc
o suprressed some compile time warnings in bucketLib.c
o cleaned up cxx templates README
o removed use of tsMinMax from libCom in favor of the standard library 
     (calls to  tsMinMax still exist in other components in base, but they are being removed)
o removed sharable library export of certain private member functions from class fdManager
o fixed aToIPAddr to correctly lookup all of the different IP addresses string types on all OS types
    independent of the OS interfae variations
o removed use of inet_aton from vxWorks implementation of hostToIPAddr
   o this function is for converting a host name to an ip address _only_
   o the aToIPAddr wrapper is supposed to do the dotted ip ascii string to ip address structure 
   conversion independent of OS spoecific interface variations, when it works correctly
o fixed some spelling issues in comments
o added additional optimizations for processors w/o floating point ALU to addNanoSec in epicsTime
o removed tabs and junk comments from win32 osdProcess.c
o moved PLL update in win32 osdTime.c from timer to a dedicated thread
o added missing epicsExportShared symbols define to osiNTPTime.c
o fixed server ctor should not modify arguments of its caller in blockingSockTest
o removed sunpro specific ifdef nolomger needed from epicsTimeTest.cpp
2013-11-07 10:26:03 -07:00
Andrew Johnson
bf3bdec7b3 rec: Mark various *SV fields prop(YES)
Alarm limits may change to/from NaN when these fields are modified.
2013-11-06 09:48:27 -06:00
Andrew Johnson
052f0992d2 dbStatic: Add property metadata to dump outputs
Both dbWriteRecordTypeFP() and dbDumpField() now show the
value of the prop() field attribute.
2013-11-06 09:28:49 -06:00
Michael Davidsaver
6a6e527fc1 post DBE_PROPERTY from dbPut()
All writes to a prop(YES) field result
in a monitor, even when the field value
doesn't change.
2013-11-04 13:39:17 -05:00
Michael Davidsaver
3cccdd8134 add prop(YES) to standard recordtypes 2013-11-04 13:39:17 -05:00
Michael Davidsaver
034388f009 recognize and store field attribute "prop()" 2013-11-04 13:39:16 -05:00
Michael Davidsaver
3d8bf34177 fix indent 2013-11-04 13:39:12 -05:00
Andrew Johnson
4b44881744 db: Fixed bogus dbScan overrun warnings
Penalizing the 0.1 second scan thread by 0.1 seconds
guarantees another overrun in most cases...
Warning message improved.

Also added a release note for Jeff's CAS commit.
2013-10-17 17:21:26 -05:00
Jeff Hill
42f4c3a0a5 fixed potential memory leak 2013-10-17 09:23:47 -06:00
Janet Anderson
16c252d8aa Fixed comments 2013-10-15 11:32:31 -05:00
Janet Anderson
ed5adebd47 Modified suffix for TESTSHRLIBNAME 2013-10-15 09:10:16 -05:00
Andrew Johnson
da80d11db9 softIoc: Generate base.dbd
Includes new dependency rules for parallel builds.
2013-10-14 12:45:08 -05:00
Andrew Johnson
91ef05b5dc tools: Improve dbdExpand.pl error/warning message
Missing files used to result in an empty output file.
Now it warns instead of dying, and suggests adding a
dependency to the Makefile.
2013-10-14 12:43:26 -05:00
Andrew Johnson
34267b31b7 softIoc: Parallel build dependency 2013-10-11 15:15:17 -07:00
Andrew Johnson
be516ddac0 std/rec: Fix clang compiler warning. 2013-10-11 14:00:36 -07:00
Andrew Johnson
1b51a4796d Merged printf-record branch
Adds three new record types: printf, lsi and lso.
Provides device support for all three.
2013-10-03 14:04:03 -07:00
Andrew Johnson
61cc341132 Various POD updates & experiments. 2013-09-30 17:48:06 -05:00
Andrew Johnson
38037f0873 Use Pod::Simple::XHTML if available. 2013-09-30 17:44:45 -05:00
Andrew Johnson
2ad468dd38 CAref: Fix returns from ca_attach_context()
ECA_NORMAL was missing, ECA_ISATTACHED given twice.
2013-09-27 09:59:34 -05:00
Andrew Johnson
2bf4b36639 configure: Support Apple Xcode 5.0 and iOS 7.0
Not tested on the 64-bit ARMv8 architecture, although it should be
compatible (confirmation would be welcome).
2013-09-24 15:30:26 -05:00
Andrew Johnson
72d65c60a4 epicsErrlogTest: Shorten output lines
Shorten test output from long messages.
2013-09-20 13:44:28 -05:00
Andrew Johnson
b58380fc69 configure: Add vpath for .hpp files
Even Linux systems are using this for C++ headers now,
they're not just for Windows.
2013-09-19 13:02:36 -05:00
Andrew Johnson
6814b09fad docs: Release Notes update
... for several recent commits.
2013-09-13 17:30:38 -05:00
Andrew Johnson
2d3a828acd Fixed read-back of TSEL link
Reading back a .TSEL field that was originally pointed to
another record's .TIME field was exposing internal details
that didn't need to be made visible. This commit hides the
.TIME => .VAL change completely, and allows a .TSEL link
field to be saved and restored properly using autosave.
2013-09-13 11:57:18 -05:00
Andrew Johnson
4ae048572a Added dbTemplateMaxVars variable
Allows users to configure dbLoadTemplate command to accept more than
100 variables or a larger string buffer for variables.
2013-09-13 11:36:52 -05:00
Andrew Johnson
ec0f64140a configure: IOS version bump to 6.1 2013-08-30 12:52:10 -05:00
Andrew Johnson
e49210a3ea configure: IOS version bump to 6.1 2013-08-30 12:50:34 -05:00
Andrew Johnson
c61d0b43bb configure: Fix ios HDEPENDS_METHOD
It changed on 3.14, but 3.15 needs a different seting.
2013-08-30 12:34:15 -05:00
Andrew Johnson
d25eff3af7 configure: Darwin build settings
Modify comments and defaults for darwin builds.
Changing to use gcc wasn't working.
2013-08-30 11:51:51 -05:00
Michael Davidsaver
01041abd32 rtems: mmio for m68k 2013-08-23 18:14:56 -04:00
Andrew Johnson
2ecf8803c3 Move alarm string arrays into libCom
Using idea from Peter Heesterman:
 * Instanciate the alarm strings once in libCom
 * Remove the epicsAlarmGlobal macro
 * Make sure the decorations are right
2013-08-20 16:59:28 -05:00
Andrew Johnson
01f0fdbf1e More file permission fixes. 2013-08-19 15:46:51 -05:00
Andrew Johnson
3219ea0608 Fixed file permissions. 2013-08-19 13:30:19 -05:00
Ralph Lange
fb983fe382 CAref: typos, replace ..._event() calls with ..._subscription() (by J. Lewis Muir) 2013-08-16 17:00:13 +02:00
Andrew Johnson
ffa96d36e1 db: dbpf can now put strings to UCHAR arrays
Also improved the dbpf error message on value conversion failures.
Source code reformatting inside dbTest.c as well.
2013-08-01 18:10:18 -05:00
Janet Anderson
859024d155 Stopped install of test libraries and removed version number in test library name. 2013-07-26 14:37:55 -05:00
Janet Anderson
515f882c7b Added OPT_CXXFLAGS_YES += -g 2013-07-25 10:49:26 -05:00
Janet Anderson
a9a3298d51 Added OPT_CXXFLAGS_YES += -g 2013-07-25 10:44:41 -05:00
Janet Anderson
d3b6d01807 Added WIN32 system library for epicsSockResolveTest 2013-07-17 15:55:49 -05:00
Andrew Johnson
8a28858ada Merged changes from 3.14 branch. 2013-07-10 16:18:18 -05:00
Andrew Johnson
f2891d72e5 ca: Add missing template instances for VxWorks 5.5.x 2013-07-10 14:55:34 -05:00
Andrew Johnson
75a5f19d2e IOCS_APPL_TOP must be absolute path
Fix a recently introduced problem where cdCommands and envParams
had TOP as a relative path (which actually worked by chance).
Also fixed a problem with convertRelease hanging when the -t
argument matched the absolute path to TOP.
2013-07-10 14:13:31 -05:00
Andrew Johnson
98deef5004 configure: Added FULLPATHNAME tool variable
Changed os/CONFIG files where we use the fullPathName.pl script.
2013-07-10 14:07:51 -05:00
Janet Anderson
cec9bd3aa9 Remove .. from vpath. Add rules with .. prerequisite. 2013-07-08 15:17:46 -05:00
Andrew Johnson
c187d8c13a CAref: typo's, added missing ca_put_callback 2013-07-05 13:26:26 -05:00
Andrew Johnson
c96db4c877 libCom: Replaced errlogRemoveListener()
New version errlogRemoveListeners() is safer.
2013-06-28 12:35:43 -05:00
Andrew Johnson
1289f99e30 rec: Additional dependencies for parallel builds. 2013-06-21 10:36:26 -05:00
Andrew Johnson
ec9568d096 std: Don't try and use removed RULES file... 2013-06-18 11:39:19 -05:00
Andrew Johnson
a9be8957bc rec: Remove now unnecessary RULES file 2013-06-18 11:19:34 -05:00
Andrew Johnson
4564346722 Release notes for previous commit. 2013-06-18 10:03:37 -05:00
Andrew Johnson
9d9f345278 configure: Removed generation of xxxInclude.dbd files
Rules now expand the source DBD files directly in to the target.
Also removed the makeIncludeDbd.pl script which is no longer needed.
2013-06-18 10:01:37 -05:00
Andrew Johnson
c4d6e2a61e dbStatic: Improve dbDumpDevice
Make it also display the function pointers in the dset and dsxt
for each device support it reports on.
2013-06-14 13:55:22 -05:00
Andrew Johnson
2be5e15346 Merged changes from 3.14 branch
Up to revno 12420 inclusive.
2013-06-07 18:08:38 -05:00
Andrew Johnson
ef5d88d3e5 libCom: Back-ported aToIPAddr fix from 3.15 branch.
Cherry-picked 3.15 revno 12398 with some changes.
2013-06-07 17:03:55 -05:00
Andrew Johnson
93449dccb8 ca: Fix acctst.c for older C compilers
All declarations must still precede other statements within a block...
2013-06-07 16:08:57 -05:00
Andrew Johnson
863e8fdd3b libCom: Fix VxWorks localtime_r() and gmtime_r() wrappers
Wind River changed the return value between VxWorks 6.8 and 6.9.
2013-06-07 14:35:45 -05:00
Andrew Johnson
2eb48f43eb Merged my udf-severity branch. 2013-05-30 15:00:37 -05:00
Andrew Johnson
d36f6aa84f ca: Fix acctst.c for older C compilers
All declarations must still precede other statements within a block...
2013-05-30 12:25:37 -05:00
Andrew Johnson
ee9c0ba409 ca: Minor reference manual tweaks. 2013-05-28 15:07:33 -05:00
Andrew Johnson
7f82c2f32e libCom: Added osi/os/WIN32/osdFindSymbol.c
Implemented by Dirk Zimoch.
2013-05-28 14:16:22 -05:00
Andrew Johnson
7addfc8ddd libCom/test: Make epicsUnitTestTest.plt more Perlish
Use Perl's __DATA__ stream for the expected data string.
2013-05-24 15:33:56 -05:00
Jeff Hill johill@lanl.gov
e0bc071de3 merged in fix for https://bugs.launchpad.net/epics-base/+bug/1179642
also merged in removal of c++ support for old HPUX compiler
2013-05-16 12:33:31 -06:00
Jeff Hill johill@lanl.gov
5e5ea11658 fix for https://bugs.launchpad.net/epics-base/+bug/1179642 2013-05-16 11:17:47 -06:00
Jeff Hill johill@lanl.gov
de2495d276 fixed test name in output 2013-05-15 14:18:11 -06:00
Jeff Hill johill@lanl.gov
fedaf622ac improved multiSubscrDestroyNoLateCallbackTest quality by temporarily raing the priority of the main thread in the ca context 2013-05-15 12:05:58 -06:00
Jeff Hill johill@lanl.gov
711e82b1a6 fixed the test name of multiSubscrDestroyNoLateCallbackTest 2013-05-15 10:37:17 -06:00
Jeff Hill johill@lanl.gov
deb1fe8c7c removed deadlock potential from test code 2013-05-15 10:24:18 -06:00
Jeff Hill johill@lanl.gov
8db3d7391b improved the quality of the multiSubscrDestroyLateNoCallbackTest 2013-05-15 09:51:48 -06:00
Jeff Hill johill@lanl.gov
4780fb2fe5 fixed credit line comment 2013-05-14 17:15:30 -06:00
Jeff Hill johill@lanl.gov
6ee8a39047 regression test for https://bugs.launchpad.net/epics-base/+bug/1179642 2013-05-14 17:08:41 -06:00
Andrew Johnson
7ff7c37dc7 msi: Flush errlog before exiting
macLib sends its errors to errlog.

Reported by Bruce Hill, SLAC.
2013-05-13 12:10:08 -05:00
Andrew Johnson
a4fed4fe1a msi: Undefined macros under -V should exit(2)
Also cleaned up double negative in internal var name.
2013-05-13 10:10:31 -05:00
Michael Davidsaver
6347b1daf9 add MMIO API
From devLib2
adds calls to handle 8, 16, and 32 bit
Memory Mapped I/O reads and writes.

Adds X_iowriteY() and X_ioreadY().

where X is nat (native), be, or le.
Y is 16 or 32.

Also adds ioread8() and iowrite8().
2013-05-10 16:22:16 -04:00
Andrew Johnson
593e313fab dbStatic: More commands accept "" or "*" to mean 'all'
dbDumpRecordType, dbDumpMenu and dbDumpRecord commands improved.
2013-05-09 15:48:49 -05:00
Andrew Johnson
34744264e1 libCom: Fix win32 handle leak
Closing an epicsThread would leak one Win32 handle.
Reported by Giles Knap, Diamond.
2013-05-06 17:29:10 -05:00
Andrew Johnson
5ac686fafd tools: Munch support for module destructors
Added in VxWorks 6.9
2013-04-25 17:00:36 -05:00
Andrew Johnson
7e347b2de9 libCom: Fix sysAtReboot registration on vxWorks 6.8+
Removed C++ static constructor, do it from epicsThreadInit()
2013-04-24 12:52:05 -05:00
Andrew Johnson
8d7a241d04 dbScan: Allow periodic scan unit strings to differ in case.
Use epicsStrCaseCmp() instead of strcmp().
2013-04-23 10:38:57 -05:00
Andrew Johnson
5bc15b72a1 libCom: Add some missing #include guards.
There are still quite a few missing in libCom/osi/os/*
2013-04-11 12:56:56 -05:00
Andrew Johnson
880db9d4af configure: Set IOCS_APPL_TOP from INSTALL_LOCATION
Fixes lp:1165257
2013-04-09 12:39:26 -05:00
Andrew Johnson
97c6d1a903 Add podToHtml.pl script
New rules to use this for .pod and .pm conversions
Replace use of pod2html in ca/client/perl
2013-04-05 13:13:52 -05:00
Andrew Johnson
04ccf9db0d Consistency for extended device support
Call scanDelete() before pdsxt->del_record()
when closing down an IOC.
2013-04-04 14:59:56 -05:00
Andrew Johnson
fabc8d06a9 Move db_post_events(waveform, NORD) into recordType.
Dirk pointed out that existing device support authors aren't
going to add this themselves; it's much better if the record
does it all for itself.
2013-04-04 14:18:35 -05:00
Andrew Johnson
f661299a81 Added new 'tapfiles' build target.
There's a plugin for Jenkins which should be able to read the .tap
output files and generate pretty test status pages from them.
I haven't actually tried using it yet though...
2013-04-04 11:25:53 -05:00
Andrew Johnson
2c8eb630cb Merged Michael Davidsaver's array-opt branch 2013-04-02 17:01:53 -05:00
Michael Davidsaver
fb21c7c6e7 update release notes 2013-04-02 17:07:54 -04:00
Michael Davidsaver
738c135ed8 Don't need void* cast
Implicit case from void** to void*
is allowed.
2013-04-02 17:07:53 -04:00
Andrew Johnson
58c031238b configure: Modify help rule to use $(DIVIDER)
... in case someone changes it.
2013-04-01 10:03:38 -05:00
Andrew Johnson
b27439ce7b Only try to generate .html files where the .dbd.pod exists 2013-03-31 00:49:19 -05:00
Andrew Johnson
53c5aaa9ee Introduce the .dbd.pod extension
Rules to convert to .html and .dbd
Rename existing files
Fix various build rules to match.
2013-03-31 00:38:20 -05:00
Andrew Johnson
880d714a0f tools/DBD: Include cdefs in DBD format output. 2013-03-30 23:49:18 -05:00
Ralph Lange
ddadd9b62e ioc/db/test: add test for parallel callback threads 2013-03-29 17:28:26 +01:00
Ralph Lange
c1318e7d55 ioc/db: add support for parallel callback threads
- use thread safe (spinlocked) callback queues
- add callbackParallelThreads() configuration call (with iocShell binding)
- add callbackParallelThreadsDefault variable, preset to number of CPUs
- remove calls to epicsInterruptLock()
2013-03-29 17:27:56 +01:00
Ralph Lange
8abb1ed255 libCom/test: add test for thread safe (spinlocked) ringPointer buffer 2013-03-29 17:24:11 +01:00
Ralph Lange
d6f5b50550 libCom/ring: add thread safe versions of ring buffers (using spinlocks) 2013-03-29 17:23:24 +01:00
Andrew Johnson
f824246baa Add configuration for vxWorks 6.9 builds. 2013-03-29 11:17:09 -05:00
Ralph Lange
3718cfa673 ioc/db/test: add timing statistics to callbackTest 2013-03-29 11:59:30 +01:00
Andrew Johnson
f9a0c82a63 libCom/osi: Resolve bcopyLongs() conflict on vxWorks 6.9 2013-03-28 17:17:41 -05:00
Ralph Lange
90b9965caf libCom/osi: add epicsThreadGetCPUs()
* Implementation for posix and WIN32 tries to get the CPUs available for this process,
   rather than the complete number of CPUs in the system.
 * For the time being, vxWorks returns 1. (This will have to change for vxWorks SMP.)
2013-03-28 15:03:29 +01:00
Ralph Lange
64a2e4e19b libCom/osi: Make EPICS ID in epicsThreadShow 2 characters wider (for 64bit) 2013-03-27 10:56:34 +01:00
Andrew Johnson
a4edc46a5f dbStatic: Allow empty DB & DBD files
They used to cause a Syntax error with a bad context string.
2013-03-20 16:53:10 -05:00
Andrew Johnson
4f9928bc3c Merged changes from 3.14 branch
Up to revno 12404.
2013-03-15 15:23:55 -05:00
Andrew Johnson
738b8ca55f libCom: Add a High-Resolution Time Provider on MacOS
Since Apple don't support clock_gettime(CLOCK_REALTIME) I added a
new time provider that uses the Mach kernel Clock service to get
nanosecond resolution time.
2013-03-13 14:48:34 -05:00
Andrew Johnson
82560b552e libCom/osi: Fix for cygwin
Needed shareLib stuff.
2013-02-18 13:11:36 -06:00
Andrew Johnson
3196844602 Remove another Borland on Linux remnant. 2013-02-14 15:56:22 -06:00
Andrew Johnson
76911e4ae9 configure: Fix the earlier DLLSTUBS change
Turn on static library dependencies again in RULES_TARGET.
2013-02-13 17:09:54 -06:00
Andrew Johnson
c29a8bd268 configure: Clean up command echoing in build rules 2013-02-12 15:36:55 -06:00
Andrew Johnson
d85d1f0e56 Merged Ralph's spinlocks branch.
Added an RTEMS implementation which locks interrupts,
and some Release Notes mentioning the new API.
2013-02-12 12:13:01 -06:00
Andrew Johnson
c5602af1b4 Fix DLLSTUB dependency generation. 2013-02-11 18:12:40 -06:00
Andrew Johnson
c767958539 gdd: Build tweaks
Remove obselete HPUX warning flags
Disable strict-aliasing to suppress warnings (RTEMS, Linux)
2013-02-11 17:49:05 -06:00
Andrew Johnson
7264146fd1 configure: MinGW is not a Posix architecture. 2013-02-11 14:16:07 -06:00
Andrew Johnson
34e24699e6 configure: Fix DEPLIBS search order for Windows DLLs
Must search for the DLLSTUB library before the SHRLIB one.
This commit also cleans up some comments about MSVC settings.
2013-02-11 14:10:27 -06:00
Janet Anderson
f2c9ddc412 Removed OBJLIBNAME references. obj libs for R3.13 vx compatibility only. 2013-02-05 15:54:08 -06:00
Andrew Johnson
8400e74606 Fix epicsRingPointerGetSize()
Definition name didn't match declaration.

Fixes lp:1109785 reported by Martin Konrad.
2013-01-29 18:02:51 -06:00
Michael Davidsaver
1b0ff46d33 Allow BPTR replacement in aai and aao 2013-01-23 10:38:32 -05:00
Michael Davidsaver
92d52cc415 Allow waveformRecord to replace BPTR 2013-01-23 10:38:31 -05:00
Michael Davidsaver
4f6040d35b get_array_info() can modifiy DBADDR::pfield
Allow the record support function get_array_info()
to modify its first argument to provide a different
pointer from which values should be read.

Remember the original and restore it afterwards.
2013-01-23 10:38:30 -05:00
Andrew Johnson
451c4cc854 Unify #! line for Perl scripts
/usr/bin/env exists on all current workstation OSs.
2013-01-23 07:29:07 -06:00
Andrew Johnson
038a1140f4 Fix drift in periodic scan times.
Method from Eric Norum, with warnings added by me.

Fixes lp:597054
2013-01-09 18:12:30 -06:00
Andrew Johnson
d63dffcd34 libCom/test: epicsSockResolveTest build fix
Add socket libraries for Win32 & Solaris.
2013-01-04 12:22:02 -06:00
Michael Davidsaver
f5b7693a58 libCom: aToIPAddr() finds numeric hostnames
Hostnames that begin with one or more digits were not being looked up
by name, causing problems at BNL.
This commit also changes the vxWorks implementation of hostToIPAddr()
to use inet_aton() instead of inet_addr().
2013-01-04 09:33:13 -06:00
Andrew Johnson
3fb529373f Clear RTEMS build warning
shutdown is also a system identifier.
2013-01-03 15:27:23 -06:00
Andrew Johnson
af2693241f Merged changes from 3.14 branch
Up to revno 12398, i.e. the R3.14.12.3 release.
2012-12-18 15:44:35 -06:00
Jeff Hill
89d000be08 fixed problems with ca clear channel protocol during reload of the access security file.
See https://bugs.launchpad.net/epics-base/+bug/1091401.
2012-12-18 14:32:12 -07:00
Andrew Johnson
615fd741b9 rec: Fix precision where link not set
Don't just force the precision to 15 if an INPx link is not set,
default to PREC field instead.
2012-12-18 14:13:23 -06:00
Janet Anderson
a0798939b3 R3.14.13.3-DEV 2012-12-17 14:24:23 -06:00
Janet Anderson
a5999242b0 Creating R3.14.12.3 2012-12-17 14:13:19 -06:00
Janet Anderson
9e484306d6 Creating R3.14.12.3 2012-12-17 14:11:47 -06:00
Andrew Johnson
835199a45d RTEMS: Bump the version number
Also show the other COMMANDLINE_LIBRARY choices.
2012-12-13 15:52:06 -06:00
Andrew Johnson
0df6f849d6 Document another Launchpad bug fix from Jeff 2012-12-13 15:50:44 -06:00
Jeff Hill
75e32c9086 fix for https://bugs.launchpad.net/epics-base/+bug/1090009 2012-12-13 09:35:18 -07:00
Andrew Johnson
04ff9eb8a1 rec: mbbiDirect and mbboDirect refactoring
This includes changes to functionality, documented.
2012-12-11 18:25:01 -06:00
Andrew Johnson
475fc8e122 rec: Code format cleanup to mbbi, mbbo records
No intentional changes to functionality.
2012-12-11 18:23:17 -06:00
Ralph Lange
b7018dd16d ca: Fix bug in "Firewalls" section of Channel Access reference manual 2012-12-11 23:38:42 +01:00
Andrew Johnson
afb182a3cd configure: New REGRDDFLAGS variable
Allows registerRecordDeviceDriver.pl to be run with different
command flags than the dbdToX.pl scripts.
2012-12-10 14:51:12 -06:00
Andrew Johnson
79b499d4c5 Releas notes for UDFS. 2012-12-10 09:36:55 -06:00
Andrew Johnson
5a498e26a1 Added Undefined Severity field UDFS
With this, records can be configured to have a lower
alarm severity when they are undefined.
Sets initial severity at iocInit too.
2012-12-10 09:25:58 -06:00
Andrew Johnson
85ed3b9f4e rec: Delete ununsed fields from mbbxDirect record types
LALM was being initialized but is not otherwise used.
2012-12-07 22:15:48 -06:00
Andrew Johnson
319ed9b394 rec: Delete ununsed fields from mbbxDirect record types
SDEF removed from mbbiDirect
LALM removed from both mbbiDirect and mbboDirect
2012-12-07 17:20:38 -06:00
Michael Davidsaver
79bc3f2265 Make blockingSockTest use a free port number
Instead of using the CA server port 5064 which is often
in use, have the listening socket pick a free port.
2012-12-06 14:31:50 -06:00
Janet Anderson
3498a6d4e0 Update readline libraries and dont have readline the default 2012-12-05 15:02:26 -06:00
Janet Anderson
f90f021309 Added SHRLIB_PERMISSIONS 2012-12-05 14:34:18 -06:00
Andrew Johnson
c1203076f2 Release Notes update
Mark Rivers asked for documentation on the new
workstation OS stack sizes.
2012-12-04 11:15:41 -06:00
Andrew Johnson
753622315c Set snapshot to 3.14.12.3-rc1-DEV 2012-12-03 16:41:53 -06:00
Andrew Johnson
910ab38af6 Creating 3.14.12.3-rc1 2012-12-03 16:39:27 -06:00
Andrew Johnson
0e990bbe0c Update release notes. 2012-12-03 13:34:27 -06:00
Andrew Johnson
ef5688f8de libCom: Accept hex literals in CALC expressions
Code back-ported from the 3.15 branch.
2012-12-03 12:58:26 -06:00
Andrew Johnson
d622bbad05 Fix compiler warnings on linux-x86 2012-12-03 12:48:11 -06:00
Janet Anderson
416cf68fd1 Make target not first prerequisite depend on Makefile. 2012-12-03 09:33:08 -06:00
Andrew Johnson
cbde3ea9fd cas: Added propertyEventMask support
Allows server tools to send DBE_PROPERTY events to clients.
New functionality not tested, but fairly trivial and doesn't
break existing server tools.
2012-11-30 17:42:47 -06:00
Andrew Johnson
fc12c72809 Device support for new long string out record type 2012-11-30 16:51:37 -06:00
Andrew Johnson
b64bc41d6b Add new long string output record type. 2012-11-30 16:50:31 -06:00
Andrew Johnson
080e362743 Cleanup. 2012-11-30 16:49:31 -06:00
Andrew Johnson
01819b0b02 Use new helper. 2012-11-30 16:48:58 -06:00
Andrew Johnson
f2716f88f3 stdRecords.dbd depends on rec/Makefile 2012-11-30 16:47:11 -06:00
Andrew Johnson
d741c10635 Another helper, dbLoadLinkLS
Replaces recGblInitConstantLink(..., DBF_STRING, ...)
2012-11-30 16:43:16 -06:00
Andrew Johnson
6f9c2db8a8 libCom: Revert 12374 which breaks MSVC++ builds
Both the Microsoft 2008 and 2010 compilers fail with this change.
2012-11-30 13:32:25 -06:00
Andrew Johnson
e01a428059 Added new Long String Input record type "lsi"
With Soft Channel device support.
2012-11-29 13:45:13 -06:00
Andrew Johnson
77c837bcbe printf record: Fix bug in minimum buffer size logic. 2012-11-29 13:41:46 -06:00
Andrew Johnson
02348e770b Use new helper function. 2012-11-29 13:40:42 -06:00
Andrew Johnson
d27747a7f3 Added helper functions dbGetLinkLS() and dbPutLinkLS() 2012-11-29 13:21:11 -06:00
Andrew Johnson
2e4f6443e0 dbNameToAddr() changes for long string support
Modified dbNameToAddr() to match how dbChannelOpen() calls
prset->cvt_dbaddr() before handling the '$' field modifier.
This lets DB links and the dbgf/dbpf commands work with '$'.

Elsewhere changed array handling to check fldDes->special
for SPC_DBADDR instead of paddr->special to allow long string
records cvt_dbaddr() routines to change paddr->special
without breaking the array handling stuff.
2012-11-29 13:20:02 -06:00
Andrew Johnson
493d6014b9 Add new global menuPost
To reduce duplication.
2012-11-29 12:53:21 -06:00
Andrew Johnson
01276d952f ca: Build caRepeater etc. by default
Exceptions for vxWorks, RTEMS and iOS which don't support
executable programs like the workstation OSs.
2012-11-26 15:37:54 -06:00
Andrew Johnson
d69f3904d7 Fix for win32 builds. 2012-11-20 17:27:38 -06:00
Andrew Johnson
7778c0c3ff Solaris & vxWorks 5.5.x fixes
Remove C++-isms.
Make internal routines static when duplicate names appear
in the epicsMutexTest.cpp code; on vxWorks and RTEMS all
test programs get linked into a single binary.
2012-11-20 15:55:53 -06:00
Andrew Johnson
f320cbcecd Fix vxWorks implementation. 2012-11-20 15:04:28 -06:00
Andrew Johnson
809633d698 Set snapshot to 3.14.12.3-pre1-DEV 2012-11-19 15:04:58 -06:00
Andrew Johnson
1f573172b3 Creating 3.14.12.3-pre1 2012-11-19 15:02:22 -06:00
Andrew Johnson
d6f72900f8 Update release notes. 2012-11-19 13:19:04 -06:00
Andrew Johnson
5b1d3a7725 conigure: Fix iOS build warning.
from Tom Palaia.
2012-11-19 10:48:24 -06:00
Andrew Johnson
7d79a83519 Apple iOS updates from Tom Pelaia
Adds iOS 6.0, which is now the default.
- changed the default iOS SDK to version 6.0
- use xcrun to locate the selected compiler
- added armv7s as an option for architecture
- made armv7 + armv7s the default architecture
- renamed the LLVM compiler option to LLVM_GNU for clarity
  since LLVM is naturally associated with CLANG
2012-11-17 13:18:16 -06:00
Andrew Johnson
6fd9fb3066 libCom: Removed epicsSingleton workaround
This undoes commit 11565, "workaround for archaic T202 g++ bug"
which doesn't actually seem to be necessary for T202 compilation.
It also replaces 'typename' with 'class', for another compiler.

Modification provided by Dirk Zimoch.
2012-11-16 16:14:13 -06:00
Andrew Johnson
28c7fe12f3 configure: Added Guobao Shen's comments on using MacPorts GCC 2012-11-16 12:54:29 -06:00
Andrew Johnson
36be0aa783 rec: Fix minor string in + out issue.
Undo strncmp+strncpy to strcmp+strcpy change in r12048.
The 'n' versions are needed because device support was
never explicitly required to Nil-terminate the string.
The dbAccess routines do enforce termination though.
2012-11-16 12:40:57 -06:00
Jeff Hill johill@lanl.gov
694ac0a650 epicsTime::addNanoSec function size is large now so it shouldnt be inline 2012-11-14 13:10:44 -07:00
Jeff Hill johill@lanl.gov
5ce291facf fixed spelling in comment 2012-11-14 13:03:30 -07:00
Jeff Hill johill@lanl.gov
b86c4107c1 After qptimizing the epicsTime::addNanoSec function we now have a larger code which uses only unsigned integer arithmetic. This is for the benefit of embedded cpu's lacking a hardware floating point coprocessor at the expense of some additional code to maintain. I measered the cpu load improving from 40% free to 80% free after making this change, on a nios2 soft core processor. 2012-11-14 12:51:30 -07:00
Andrew Johnson
e3f59fd5c2 Support variable array size
Added LEN field and get_array_info() routine.
Removed len arg from device support write_string() routine.
Modified device support to match.
2012-11-12 13:45:23 -06:00
Andrew Johnson
b8eec29e43 libCom: Added errlogSetConsole() functionality. 2012-11-09 17:06:32 -06:00
Andrew Johnson
69d8be78d3 startup: Recognize 64-bit Windows
For 64-bit versions of Perl on Windows, the EpicsHostArch.pl
script will now return the host architecture "windows-x64".
2012-11-01 14:57:36 -05:00
Andrew Johnson
fc61cc34ce iocLogServer fix for unsigned char arch's
Reported by Guy Jennings
2012-10-31 13:56:12 -05:00
Ralph Lange
3f18327d2d libCom/osi: add tests for epicsSpin (based on epicsMutex tests) 2012-10-29 20:26:11 +01:00
Ralph Lange
a977edfaa6 libCom/osi: add epicsSpin with default, posix, and vxWorks implementations
- posix uses pthread_spin_ interface when supported, pthread_mutex_ otherwise
- default uses epicsMutex
- vxWorks (single core) uses intLock()
2012-10-29 20:25:23 +01:00
Ralph Lange
f9135c39cd configure: change Posix definition from 199506L to 200112L
needed to be able to use spinlocks
2012-10-29 20:20:36 +01:00
Andrew Johnson
c06f3cd9a0 db: Fix dbGet so attributes and value can be fetched simultaneously
Only the Async Soft Channel support did this, so that's where it
was noticed that this didn't work.
2012-10-29 01:20:56 -05:00
Andrew Johnson
35a2793c23 rec: Cleanup of compress & histogram record source code
No functional changes.
2012-10-19 15:06:37 -05:00
Andrew Johnson
c9da766e9e rec: Fix compress & histogram attribute bugs
Problems introduced during Dirk's non-val attribute changes.
2012-10-19 15:01:43 -05:00
Andrew Johnson
7f21c8eec1 Merged changes from 3.14 branch
Merged up to revno 12369 on 2012-10-17
2012-10-18 00:10:12 -05:00
Andrew Johnson
e889336458 db: Undefined alarm limits should return NaN
Where the record doesn't provide get_alarm_double() or for fields
where the default applies, we were still returning 0.
2012-10-17 18:08:39 -05:00
Michael Davidsaver
2613c62b40 rec/aSub: Add cleanup subroutine 2012-10-15 12:35:04 -05:00
Michael Davidsaver
7cac267a4b db: Fix possible error handling in dbPut 2012-10-11 18:10:00 -05:00
Andrew Johnson
71079ede4b rec/aSub: Fixes from Michael Davidsaver
* Changing the number of elements in a VALx array triggers monitors
* Post monitors on the NEVx fields, following EFLG
* Remove artificial limit on array sizes
2012-10-11 17:51:00 -05:00
Andrew Johnson
ab7d73c537 cas: Fix syntax error in last commit
errMessage() is not printf-like, use errPrintf() instead.
2012-10-11 11:28:28 -05:00
Jeff Hill
7d37c31cc5 added the PV name to the unable to read application types "enums" message 2012-10-10 19:08:18 -06:00
Michael Davidsaver
26173c1e0d devLib: add compatibility typedef for VME table type 2012-10-10 15:52:34 -05:00
Andrew Johnson
9c1b8ba952 rec: Fix problem with NAN in MLST/ALST fields
If MLST or ALST became NAN the associated monitor would never trigger.
Now a NAN will cause it to always trigger.
2012-10-06 21:48:01 -05:00
Andrew Johnson
f0c88c3d3c Document the CLEANS variable
Also shows how to be backwards-compatible with the 3.14 build
system.
2012-10-05 22:58:59 -05:00
Andrew Johnson
a05f022e44 Reorganize where the POD should be placed
The converter now only handles POD from the root DBD object.
However there are commands that pull POD out of named sub-objects.
This also adds generating tables from menu choices.
2012-10-01 17:38:08 -05:00
Andrew Johnson
f519b63a6f tools/DBD: Don't include =cut lines in the captured POD. 2012-10-01 17:35:23 -05:00
Andrew Johnson
eb908c6ebf Make HTMLS_DIR default to . if not set.
Remove HTMLS_DIR setting for files generated from DBD/POD.
2012-10-01 17:29:11 -05:00
Andrew Johnson
2f25d7c9c9 doc: Delete old TOC entry. 2012-10-01 17:26:15 -05:00
Andrew Johnson
68bde36d75 Merged changes from 3.14 branch.
Merged up to commit 12364 (2012-09-11) inclusive.
2012-10-01 00:54:10 -05:00
Andrew Johnson
e94ffd48fa std: Device support for new printf record type 2012-09-28 18:00:42 -05:00
Andrew Johnson
d8812cbee3 std: Added new printf record type 2012-09-28 18:00:13 -05:00
Andrew Johnson
0f7cb737bb Merged J. Lewis Muir's caput help text fix branch. 2012-09-26 22:38:17 -05:00
Andrew Johnson
ea725ad1a2 ioc/db: Call rset::cvt_dbaddr() before processing field modifiers
The channel filters and field modifiers should apply to the
field *after* the record type has made any SPC_DBADDR changes.
2012-09-26 14:41:52 -05:00
J. Lewis Muir
37407c94e0 ca/client/tools: add -F option to caput usage output 2012-09-26 10:37:20 -05:00
Ralph Lange
12909bfb1d Merge libCom/osi changes needed for MultiCore Real-Time Utils 2012-09-20 22:00:17 +02:00
Ralph Lange
ca441a2a0e libCom/osi: (posix) make getOssPriorityValue() public as epicsThreadGetPosixPriority() 2012-09-20 21:55:32 +02:00
Andrew Johnson
ecba376d72 std/rec: Enhance sequence record just like fanout
Add link groups 0 and B through F, plus the OFFS and SHFT fields to
provide backwards compatibility.
2012-09-19 15:13:13 -05:00
Ralph Lange
047bdc9200 libCom/osi: (posix) keep scheduling policy by thread, to support SCHED_RR 2012-09-18 13:43:02 +02:00
Ralph Lange
2485c1fb1c libCom/osi: Rename osd thread sched policy flag (Fifo -> RealTime) 2012-09-17 13:22:09 +02:00
Andrew Johnson
a106129c9b Extended the fanout record to 16 links
Added SHFT and OFFS fields for backwards compatibility.
See Release Notes for detailed description.
2012-09-14 10:56:08 -05:00
Andrew Johnson
c574722a9b catools: Fix syntax error from vxWorks gcc. 2012-09-11 15:19:29 -05:00
Andrew Johnson
4790578953 tools: Try harder to collapse ../ components in AbsPath
Idea from Angus Gratton, ANU
2012-09-11 12:11:55 -05:00
Ralph Lange
7e6e38060f catools: Change behaviour of camonitor when printing array of chars as string
camonitor was using strlen() to find out the length of the array to print as %s string,
which led to printing old buffer contents when the array-string was not null terminated.
Now uses the minimum of strlen(), elements received, and elements requested.

Suggested by Mark Rivers on tech-talk (11 Sep 2012)
2012-09-11 16:58:43 +02:00
Andrew Johnson
d2d40b901a Update the initial documentation to normal Pod syntax 2012-09-04 00:40:37 -05:00
Andrew Johnson
29a9ad3f90 Make the DBD parser recognize Pod syntax directly
Source DBD files can include Pod blocks, as long as the dbdExpand.pl
script doesn't try and include it in expanded DBD output files.
This makes it easier to write the Pod, and perldoc can parse most
of the result for checking (it complains about the =field directives
though, which dbdToHtml.pl handles itself).
2012-09-04 00:35:17 -05:00
Ralph Lange
709b6ef2f3 catools: Fix off-by-one bug in caput
An internal buffer was allocated one char too short, when caput was used
with the '-S' (send string as array of chars) option.

Reported by J. Lewis Muir (tech-talk on 17-Aug-2012)
2012-09-03 21:25:44 +02:00
Andrew Johnson
29c6d34be4 filters: Document the deadband filter 2012-09-02 00:04:47 -05:00
Andrew Johnson
dad89d5bba dbdToHtml.pl: Fix generated link URLs to other docs
Also added some code comments
2012-09-02 00:02:38 -05:00
Andrew Johnson
169b30081a Fix for vxWorks 6.x LED_ID
Use LED_ID in epicsReadline.c
Provide a typedef for vxWorks 5.x where it doesn't exist.
2012-08-31 16:05:14 -05:00
Andrew Johnson
a19e1d21da libCom: Fix epicsSnprintf() under MinGW
Use the Microsoft _vscprintf() function which was just missing
a prototype in earlier versions of MinGW's stdio.h header.
2012-08-31 15:57:59 -05:00
Janet Anderson
c48e92b1a8 Include RULES_JAVA when using EPICS base 3.15 and later. 2012-08-31 13:52:54 -05:00
Andrew Johnson
d86db4e6b6 Start annotating fields and writing POD comments 2012-08-30 00:59:17 -05:00
Andrew Johnson
56c812f990 Add rules to run dbdToHtml.pl and install the result 2012-08-30 00:57:00 -05:00
Andrew Johnson
874cebb63d Change dbdToHtml.pl to parse POD from DBD comments 2012-08-30 00:55:22 -05:00
Andrew Johnson
43393096ac Add ability to save & retrieve comments to DBD objects 2012-08-30 00:53:07 -05:00
Andrew Johnson
29a8efa781 Document addition of MSI to Base. 2012-08-29 16:46:40 -05:00
Andrew Johnson
1ac8ff6378 as: Make asSetFilename() warn on relative paths
Tell the user if they try this.  They'll get an error from
asInit() later, but it gets lost easily in other noise.
2012-08-28 16:35:52 -05:00
Andrew Johnson
7da070bca3 Fix bldEnvData.pl library search path
It wasn't working when INSTALL_LOCATION is used.
2012-08-23 09:45:31 -05:00
Andrew Johnson
f29e995103 Permit but check duplicate DBD entries
Record types cannot be duplicated however.
DBD sub-objects now have a ->what method for their description.
This also adds a method to look up a breaktable by name.
2012-08-22 16:54:54 -05:00
Janet Anderson
786a01b59c RULES_JAVA removed from base and put in extensions 2012-08-21 09:38:37 -05:00
Janet Anderson
5c2ef73c4a Fixed X11 include definitions, X11_INC and XPM_INC. 2012-08-20 12:27:39 -05:00
Andrew Johnson
958aa02320 Change build defaults for darwin-x86
* Use clang and clang++
* Build for x86_64 only
2012-08-20 10:03:50 -05:00
Andrew Johnson
0faff0f03e registerRecordDeviceDriver updates
Added -D and -o <outfile> options
Changed the build rules to use -o
Moved the script into src/tools
2012-08-10 11:40:50 -05:00
Andrew Johnson
93f7caebc4 tools/DBD: Fix DBD output of empty attributes
Use the regex's from Base.pm for value recognition
in both Parser.pm and Output.pm
2012-08-10 11:39:30 -05:00
Andrew Johnson
1faae9c3ed configure: Don't install test libraries
This was actually hapenning through a TESTPROD being dependent
on the TESTLIBRARY and not having a <lib>_DIR to tell it where
the library would be found. We now set <lib>_DIR = . for all
test libraries and they don't get installed any more.
2012-08-09 15:41:26 -05:00
Andrew Johnson
f0633d0d16 configure: Set BASE_3_14 = NO
This allows "ifdef BASE_3_14" to still mean 3.14 or later,
but also "ifeq ($(BASE_3_14),YES)" to mean 3.14 only.
2012-08-09 11:16:15 -05:00
Andrew Johnson
eb8bac8afb ioc: Added extern "C" block to dbLink.h file. 2012-08-08 13:38:21 -05:00
Andrew Johnson
a80ec2e0bf cap5: Fix symbol export when using -fvisibility=hidden
The boot_Cap5 symbol must be exported for the module to load.
2012-08-07 12:35:12 -05:00
Andrew Johnson
05377e5886 Merged changes from 3.14 branch
Includes everything up to revno 12355 on 2012-08-07
2012-08-07 12:31:55 -05:00
Andrew Johnson
c93c7b5e36 configure: Fix test rules dependency 2012-08-07 10:37:13 -05:00
Andrew Johnson
b993e29fad configure: Minor fixes
Don't add extraneous characters when SHRLIB_VERSION or GNU_TARGET
are empty.  The addprefix or addsuffix functions only include the
prefix/suffix part if the list argument is not empty.

This fixes issues naming libCap5.so at build-time.
2012-08-07 09:41:21 -05:00
Andrew Johnson
685e6b0937 rsrv: Use osiSockIoctl_t 2012-08-04 14:18:32 -05:00
Andrew Johnson
b4c7f4542e configure: Deleted RULES_JAVA and associated variables
Also removed some extensions template configuration files for
architectures that we have already removed from Base.
2012-08-03 17:45:28 -05:00
Andrew Johnson
d9013bffe9 libCom: Expand comments on -fvisibility in shareLib.h 2012-08-03 17:37:15 -05:00
Andrew Johnson
282d67caef Set version back to -DEV 2012-08-01 10:01:01 -05:00
Till Straumann
c11aec5d76 - added copyright and author info. 2011-08-26 17:02:02 -07:00
Till Straumann
b71aa81a47 - compute and print stack trace (on select architectures) from cantProceed and epicsAssert 2011-08-26 14:40:15 -07:00
597 changed files with 28602 additions and 12864 deletions

View File

@@ -6,3 +6,4 @@
./include
./templates
**/O.*
./QtC-*

View File

@@ -1,13 +1,14 @@
#*************************************************************************
# Copyright (c) 2010 UChicago Argonne LLC, as Operator of Argonne
# Copyright (c) 2013 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.
# in the file LICENSE that is included with this distribution.
#*************************************************************************
#
# $Revision-Id$
#
# Common build definitions
#
@@ -82,8 +83,6 @@ endif
-include $(CONFIG)/os/CONFIG_SITE.Common.$(T_A)
-include $(CONFIG)/os/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
endif
# Include <top>/cfg/CONFIG* definitions from tops defined in RELEASE* files
#
ifneq ($(CONFIG),$(TOP)/configure)
@@ -96,12 +95,12 @@ endif
# Include $(INSTALL_CFG)/CONFIG* definitions
#
ifndef T_A
TOP_CFG_CONFIGS = $(wildcard $(INSTALL_CFG)/CONFIG*)
ifneq ($(TOP_CFG_CONFIGS),)
include $(TOP_CFG_CONFIGS)
endif
endif
endif # ifdef T_A
# User specific definitions
#
@@ -111,3 +110,4 @@ ifdef T_A
-include $(HOME)/configure/CONFIG_USER.Common.$(T_A)
-include $(HOME)/configure/CONFIG_USER.$(EPICS_HOST_ARCH).$(T_A)
endif

View File

@@ -412,17 +412,6 @@ USR_LIBS += $(USR_LIBS_DEFAULT)
endif
endif
#
# concat specific include files
#
ifneq ($(strip $(INC_$(OS_CLASS))),)
INC += $(subst -nil-,,$(INC_$(OS_CLASS)))
else
ifdef INC_DEFAULT
INC+=$(INC_DEFAULT)
endif
endif
#
# concat specific library contents (if defined) to SYS_PROD_LIBS
#

View File

@@ -14,8 +14,8 @@
EPICS_BASE_HOST_BIN = $(EPICS_BASE)/bin/$(EPICS_HOST_ARCH)
EPICS_BASE_HOST_LIB = $(EPICS_BASE)/lib/$(EPICS_HOST_ARCH)
ifdef T_A
EPICS_BASE_LIB = $(EPICS_BASE)/lib/$(T_A)
EPICS_BASE_BIN = $(EPICS_BASE)/bin/$(T_A)
EPICS_BASE_LIB = $(EPICS_BASE)/lib/$(T_A)
EPICS_BASE_BIN = $(EPICS_BASE)/bin/$(T_A)
endif
#---------------------------------------------------------------
@@ -33,8 +33,10 @@ EPICS_BASE_HOST_LIBS += ca Com
# Version number for base shared libraries (and win32 products)
ifdef BASE_TOP
SHRLIB_VERSION = $(EPICS_VERSION).$(EPICS_REVISION)
PROD_VERSION = $(EPICS_VERSION).$(EPICS_REVISION)
# Unix lib.so.<v.r.m> Darwin lib.<v.r.m>.dylib
SHRLIB_VERSION = $(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION)
# Windows only allows 2 levels of version numbering
PROD_VERSION = $(EPICS_VERSION).$(EPICS_REVISION)
endif # BASE_TOP
#---------------------------------------------------------------
@@ -62,6 +64,7 @@ DBTORECORDTYPEH = $(PERL) $(TOOLS)/dbdToRecordtypeH.pl
DBTOMENUH = $(PERL) $(TOOLS)/dbdToMenuH.pl
REGISTERRECORDDEVICEDRIVER = $(PERL) $(TOOLS)/registerRecordDeviceDriver.pl
CONVERTRELEASE = $(PERL) $(TOOLS)/convertRelease.pl
FULLPATHNAME = $(PERL) $(TOOLS)/fullPathName.pl
#-------------------------------------------------------
# tools for installing libraries and products
@@ -83,12 +86,15 @@ ELEX = $(call PATH_FILTER, $(TOOLS)/e_flex$(HOSTEXE)) -S$(EPICS_BASE)/include/fl
YACC = $(EYACC)
LEX = $(ELEX)
#---------------------------------------------------------------
# msi used to be an external tool
MSI ?= $(EPICS_BASE_HOST_BIN)/msi
#---------------------------------------------------------------
# External tools and tool flags - must be in path or defined in application
ifndef ADL2DL
ADL2DL = adl2dl
endif
ADL2DL ?= adl2dl
# sch2edif compiler and flags
SCH2EDIF = sch2edif
@@ -98,18 +104,11 @@ SCH2EDIF_FLAGS =
# e2db and flags
# - again there is an assumption where edb.def is installed.
ifndef E2DB
E2DB = e2db
endif
E2DB ?= e2db
E2DB_SYSFLAGS = -ate -d $(CAPFAST_TEMPLATES)/edb.def
E2DB_FLAGS =
ifndef DBST
DBST = dbst
endif
ifndef MSI
MSI = $(EPICS_BASE_HOST_BIN)/msi
endif
DBST ?= dbst

View File

@@ -17,7 +17,9 @@
# EPICS_SITE_VERSION is defined in CONFIG_SITE for sites that want a local
# version number to be included in the reported version string.
BASE_3_14 = YES
# In 3.15 we still define BASE_3_14 so "ifdef BASE_3_14" means
# 3.14 or later, but "ifeq ($(BASE_3_14),YES)" means 3.14 only.
BASE_3_14 = NO
BASE_3_15 = YES
# EPICS_VERSION must be a number >0 and <256
@@ -27,11 +29,11 @@ EPICS_VERSION = 3
EPICS_REVISION = 15
# EPICS_MODIFICATION must be a number >=0 and <256
EPICS_MODIFICATION = 0
EPICS_MODIFICATION = 1
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
# Not included if zero
EPICS_PATCH_LEVEL = 1
EPICS_PATCH_LEVEL = 0
# This will end in -DEV between official releases
#EPICS_DEV_SNAPSHOT=-DEV

View File

@@ -74,11 +74,13 @@ INSTALL_TEMPLATES = $(INSTALL_LOCATION)/templates
INSTALL_DBD = $(INSTALL_LOCATION)/dbd
INSTALL_DB = $(INSTALL_LOCATION)/db
INSTALL_CONFIG = $(INSTALL_LOCATION)/configure
INSTALL_JAVA = $(INSTALL_LOCATION)/javalib
#Directory for OS independant build created files
# Directory for OS independant build created files
COMMON_DIR = ../O.Common
# IOC's absolute path to $(TOP), may be overridden inside the application
IOCS_APPL_TOP = $(shell $(FULLPATHNAME) $(INSTALL_LOCATION))
#-------------------------------------------------------
# Make echo output - suppress echoing if make's '-s' flag is set
NOP = :
@@ -163,9 +165,6 @@ TESTPRODNAME = $(addsuffix $(EXE),$(basename $(TESTPROD)))
SHRLIBNAME = $(SHRLIBNAME_$(SHARED_LIBRARIES))
TESTSHRLIBNAME = $(TESTSHRLIBNAME_$(SHARED_LIBRARIES))
JAVA =
JAR =
#--------------------------------------------------
# obj files
@@ -178,7 +177,7 @@ LIBRARY_OBJS = $(addsuffix $(OBJ),$(basename $(SRCS) $(USR_SRCS) $(LIB_SRCS) $(L
LIBRARY_LD_OBJS = $(USR_OBJLIBS) $(LIB_OBJLIBS) $(TARGET_OBJS) $(LIBRARY_OBJS)
#--------------------------------------------------
# WIN95/NT resource files
# Windows resource files
TARGET_RESS = $(if $(RES),$(addsuffix $(RES),$(basename $($*_RCS))),)
@@ -188,11 +187,6 @@ PROD_LD_RESS = $(TARGET_RESS) $(PROD_RESS)
LIBRARY_RESS = $(if $(RES),$(addsuffix $(RES),$(basename $(RCS) $(LIB_RCS) $(LIBRARY_RCS))),)
LIBRARY_LD_RESS = $(TARGET_RESS) $(LIBRARY_RESS)
#--------------------------------------------------
# WIN95/NT source browser
PROD_BAF = $(addsuffix $(BAF), $(basename $(PROD)))
LIB_BAF=$(addsuffix $(BAF),$(basename $(LIBRARY)))
#--------------------------------------------------
# C preprocessor, compiler, and linker flag defaults
@@ -344,9 +338,11 @@ HDEPENDS.c = $(HDEPENDS_$(HDEPENDS_METHOD).c)
HDEPENDS.cpp = $(HDEPENDS_$(HDEPENDS_METHOD).cpp)
#--------------------------------------------------
# depends definition
# Dependency files
TARGET_SRCS = $(foreach name, $(TESTPROD) $(PROD) $(TESTLIBRARY) $(LIBRARY) $(LOADABLE_LIBRARY), $($(name)_SRCS))
TARGET_SRCS = $(foreach name, \
$(TESTPROD) $(PROD) $(TESTLIBRARY) $(LIBRARY) $(LOADABLE_LIBRARY), \
$($(name)_SRCS))
SRC_FILES = $(LIB_SRCS) $(LIBSRCS) $(SRCS) $(USR_SRCS) $(PROD_SRCS) $(TARGET_SRCS)
HDEPENDS_FILES = $(addsuffix $(DEP),$(notdir $(basename $(SRC_FILES))))
@@ -381,6 +377,7 @@ INSTALL_LIB_INSTALLS = $(addprefix $(INSTALL_LIB)/,$(notdir $(LIB_INSTALLS)))
# Installed file permissions
BIN_PERMISSIONS = 555
LIB_PERMISSIONS = 444
SHRLIB_PERMISSIONS = 555
INSTALL_PERMISSIONS = 444
#---------------------------------------------------------------

View File

@@ -1,10 +1,10 @@
#*************************************************************************
# Copyright (c) 2006 UChicago Argonne LLC, as Operator of Argonne
# Copyright (c) 2013 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.
# in the file LICENSE that is included with this distribution.
#*************************************************************************
# $Revision-Id$
#
@@ -12,7 +12,7 @@
#
# --------------------------------------------------------------
# Module developers can now define a new type of file, e.g. ABC,
# Module developers can now define a new type of file, e.g. ABC,
# so that files of type ABC will be installed into a directory
# defined by INSTALL_ABC. This is done by creating a new CONFIG<name>
# file, e.g. CONFIG_ABC, with the following lines:
@@ -24,8 +24,14 @@
# $(INSTALL_LOCATION). The file type ABC should be target
# architecture independent (alh files, medm files, edm files).
#
# Optional rules necessary for files of type ABC should be put in
# a RULES_ABC file.
# Files of type ABC are then installed into the INSTALL_ABC
# directory by adding a line like the following to a Makefile.
#
# ABC += <filename1> <filename2> <filename3>
#
# Rules necessary to create files of type ABC should be put in
# a RULES_ABC file. Variables used by those rules should appear
# in a CONFIG_ABC file.
#
# The module developer installs new CONFIG* or RULES* files
# into the directory $(INSTALL_LOCATION)/cfg by including the
@@ -33,16 +39,11 @@
#
# CFG += CONFIG_ABC RULES_ABC
#
# Files of type ABC are installed into INSTALL_ABC directory
# by adding a line like the following to a Makefile.
#
# ABC += <filename1> <filename2> <filename3>
#
# Files in $(INSTALL_LOCATION)/cfg directory are now included by
# the base config files so the definitions and rules are available
# for use by later src directory Makefiles in the same module or
# by other modules with a RELEASE line pointing to the TOP of
# the module with RULES_ABC.
# CONFIG and RULES files in the $(INSTALL_LOCATION)/cfg directory
# are included by the Base config files so their definitions and
# rules are available for use by later src directory Makefiles in
# the same module, or by other modules with a RELEASE line that
# points to the TOP of the module providing these files.
FILE_TYPE += ADL
INSTALL_ADL = $(INSTALL_LOCATION)/adl
@@ -59,6 +60,9 @@ INSTALL_EDL = $(INSTALL_LOCATION)/edl
FILE_TYPE += PERL_MODULES
INSTALL_PERL_MODULES = $(INSTALL_LOCATION_LIB)/perl
INSTALLS_CFG= $(CFG:%= $(INSTALL_CFG)/%)
FILE_TYPE += PKGCONFIG
INSTALL_PKGCONFIG = $(INSTALL_LOCATION_LIB)/pkgconfig
INSTALLS_CFG = $(CFG:%= $(INSTALL_CFG)/%)
DIRECTORY_TARGETS += $(foreach type, $(FILE_TYPE),$(INSTALL_$(type)))

View File

@@ -17,6 +17,7 @@
#
# Currently Supporting:
# cygwin-x86 (cygwin compiler used for host builds)
# cygwin-x86_64 (cygwin compiler used for host builds)
# darwin-ppc (PowerPC based Apple running OSX)
# darwin-ppcx86 (Universal binaries for both CPUs)
# darwin-x86 (Intel based Apple running OSX)
@@ -37,6 +38,7 @@
# win32-x86 (MS Visual C++ compiler used for host builds)
# win32-x86-mingw (MinGW compiler used for host builds)
# windows-x64 (MS Visual C++ compiler used for host builds)
# windows-x64-mingw (MinGW compiler used for host builds)
# Debugging builds:
# linux-x86-debug (GNU compiler with -g option for host builds)
@@ -68,6 +70,7 @@
# linux-cris (Axis GNU crosscompiler on linux-x86 host)
# linux-cris_v10 (Axis GNU crosscompiler on linux-x86 host)
# linux-cris_v32 (Axis GNU crosscompiler on linux-x86 host)
# linux-microblaze
# linux-xscale_be
# vxWorks-486
# vxWorks-68040

View File

@@ -30,23 +30,23 @@
# local timezone info for vxWorks and RTEMS IOCs. The format is
# <name>::<minutesWest>:<start daylight>:<end daylight>
# where the start and end are mmddhh - that is month,day,hour
# e.g. for ANL in 2010: EPICS_TIMEZONE=CUS::360:031402:110702
# e.g. for ANL in 2015: EPICS_TIMEZONE=CST/CDT::360:030802:110102
#
# DST for 2011 US: Mar 13 - Nov 06
# EU: Mar 27 - Oct 30
# DST for 2012 US: Mar 11 - Nov 04
# EU: Mar 25 - Oct 28
# DST for 2013 US: Mar 10 - Nov 03
# EU: Mar 31 - Oct 27
# DST for 2014 US: Mar 09 - Nov 02
# EU: Mar 30 - Oct 26
# DST for 2015 US: Mar 08 - Nov 01
# EU: Mar 29 - Oct 25
# (see: http://www.worldtimezone.org/daylight.html)
# DST for 2016 US: Mar 13 - Nov 06
# EU: Mar 27 - Oct 30
# DST for 2017 US: Mar 12 - Nov 05
# EU: Mar 26 - Oct 29
# DST for 2018 US: Mar 11 - Nov 04
# EU: Mar 25 - Oct 28
# DST for 2019 US: Mar 10 - Nov 03
# EU: Mar 31 - Oct 27
# (see: http://www.timeanddate.com/time/map/)
#
# These values are for 2011:
EPICS_TIMEZONE=CUS::360:031302:110602
#EPICS_TIMEZONE=MET::-60:032702:103002
# These values are for 2015:
EPICS_TIMEZONE=CST/CDT::360:030802:110102
#EPICS_TIMEZONE=CET/CEST::-60:032902:102502
# EPICS_TS_NTP_INET
# NTP time server ip address. Uses boot host if not set.

View File

@@ -8,16 +8,21 @@
#*************************************************************************
#RULES.Db
# Set db substitutions file suffix
SUBST_SUFFIX ?= .substitutions
##################################################### vpath
vpath %.dbd $(USR_VPATH) $(GENERIC_SRC_DIRS) $(dir $(DBD))
vpath %.db $(USR_VPATH) $(GENERIC_SRC_DIRS) $(dir $(DB))
vpath %.vdb $(USR_VPATH) $(GENERIC_SRC_DIRS) $(dir $(DB))
vpath %.substitutions $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)
vpath %.template $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)
vpath bpt%.data $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)
vpath %.acf $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)
vpath %.acs $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)
vpath %.pm $(USR_VPATH) $(SRC_DIRS) $(dir $(DBD))
vpath %.pod $(USR_VPATH) $(SRC_DIRS) $(dir $(DBD))
vpath %.dbd $(USR_VPATH) $(SRC_DIRS) $(dir $(DBD))
vpath %.db $(USR_VPATH) $(SRC_DIRS) $(dir $(DB))
vpath %.vdb $(USR_VPATH) $(SRC_DIRS) $(dir $(DB))
vpath %$(SUBST_SUFFIX) $(USR_VPATH) $(SRC_DIRS) $(COMMON_DIR)
vpath %.template $(USR_VPATH) $(SRC_DIRS) $(COMMON_DIR)
vpath bpt%.data $(USR_VPATH) $(SRC_DIRS) $(COMMON_DIR)
vpath %.acf $(USR_VPATH) $(SRC_DIRS) $(COMMON_DIR)
vpath %.acs $(USR_VPATH) $(SRC_DIRS) $(COMMON_DIR)
##################################################### dbflags dbdflags
@@ -26,6 +31,7 @@ DB_SEARCH_DIRS = . .. $(COMMON_DIR) $(SRC_DIRS) $(INSTALL_DB) $(RELEASE_DB_DIRS)
DBDFLAGS = $(USR_DBDFLAGS) $(addprefix -I,$(DBD_SEARCH_DIRS))
DBFLAGS = $($*_DBFLAGS) $(USR_DBFLAGS) $(addprefix -I,$(DB_SEARCH_DIRS))
REGRDDFLAGS = $(DBDFLAGS) $($*_REGRDDFLAGS) $(USR_REGRDDFLAGS)
##################################################### Targets
@@ -42,6 +48,21 @@ DBD += $(foreach type, $(CROSS_TARGET_OS_TYPES), $(DBD_$(type)))
# DBD_RTEMS += abcRTEMS.dbd
# DBD_solaris += abcSolaris.dbd
#
# ---------------------------------------------------
# DBD concatination files
COMMON_DBDCATS += $(addprefix $(COMMON_DIR)/,$(DBDCAT))
DBDCAT_SOURCES += $(foreach file, $($*_DBD), $(DBDCAT_SOURCE) )
DBDCAT_SOURCE = $(firstword $(wildcard $(file) $(foreach dir, \
$(DBD_SEARCH_DIRS),$(addsuffix /$(file),$(dir)))) \
$(COMMON_DIR)/$(file))
DBDCAT_COMMAND = $(if $(DBDCAT_SOURCES),\
$(CAT) $(DBDCAT_SOURCES) > $(notdir $@),\
@echo "No input files for $(notdir $@)")
INSTALL_DBDS += $(addprefix $(INSTALL_DBD)/,$(DBDCAT))
# ---------------------------------------------------
DBDINC_NAME = $(patsubst %.h,%,$(patsubst %.dbd,%,$(DBDINC)))
@@ -65,7 +86,7 @@ SOURCE_DB_bbb = $(foreach dir, $(GENERIC_SRC_DIRS), $(SOURCE_DB_aaa) )
SOURCE_DB_aaa = $(addsuffix /$(file), $(dir) )
COMMONS = $(COMMON_DIR)/*.dbd $(COMMON_DIR)/*.db $(COMMON_DIR)/*.h \
$(COMMON_DIR)/*.substitutions $(COMMON_DIR)/*.template
$(COMMON_DIR)/*$(SUBST_SUFFIX) $(COMMON_DIR)/*.template
# Remove trailing numbers (to 99) on stem
TEMPLATE1=$(patsubst %0,%,$(patsubst %1,%,$(patsubst %2,%,$(patsubst %3,%,$(patsubst %4,%, \
@@ -116,6 +137,9 @@ DBDDEPENDS_FILES += $(addsuffix $(DEP),$(HINC) \
ifndef T_A
DEP = .d
TEMPLATE3+=$(addsuffix .template, $(TEMPLATE2))
COMMON_DIR = .
INSTALL_DBDS =
INSTALL_DBS =
@@ -127,8 +151,7 @@ ACTIONS = inc
ACTIONS += build
ACTIONS += install
ACTIONS += buildInstall
ACTIONS += browse
ACTIONS += runtests
ACTIONS += runtests tapfiles
actionArchTargets = $(foreach x, $(ACTIONS),\ $(foreach arch,$(BUILD_ARCHS), $(x)$(DIVIDER)$(arch)))
@@ -136,6 +159,12 @@ cleanArchTargets = $(foreach arch,$(BUILD_ARCHS), clean$(DIVIDER)$(arch))
-include $(TOP)/configure/CONFIG_APP_INCLUDE
all: install
ifeq ($(EPICS_HOST_ARCH),$T_A)
host: install
else
# Do nothing
host:
endif
install: buildInstall
@@ -143,10 +172,10 @@ buildInstall : build
rebuild: clean install
.PHONY: all inc build install clean rebuild buildInstall
.PHONY: all host $(ACTIONS)
$(actionArchTargets) $(BUILD_ARCHS):install
$(cleanArchTargets):clean
$(actionArchTargets) $(BUILD_ARCHS): install
$(cleanArchTargets): clean
.PHONY: $(BUILD_ARCHS) $(actionArchTargets) $(cleanArchTargets)
@@ -160,7 +189,7 @@ endif
inc : $(COMMON_INC) $(INSTALL_INC)
build : $(COMMON_DBDS) $(COMMON_DBS) \
build : $(COMMON_DBDS) $(COMMON_DBS) $(COMMON_DBDCATS) \
$(INSTALL_DBDS) $(INSTALL_DBS) \
$(DBDDEPENDS_FILES) $(TARGETS) \
$(INSTALL_DB_INSTALLS) $(INSTALL_DBD_INSTALLS)
@@ -188,6 +217,11 @@ realclean: clean
@$(DBTORECORDTYPEH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@
@echo "$(COMMONDEP_TARGET): ../Makefile" >> $@
%Record.h$(DEP): ../%Record.dbd
@$(RM) $@
@$(DBTORECORDTYPEH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@
@echo "$(COMMONDEP_TARGET): ../Makefile" >> $@
menu%.h$(DEP): $(COMMON_DIR)/menu%.dbd
@$(RM) $@
@$(DBTOMENUH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@
@@ -198,7 +232,12 @@ menu%.h$(DEP): menu%.dbd
@$(DBTOMENUH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@
@echo "$(COMMONDEP_TARGET): ../Makefile" >> $@
%.dbd$(DEP): $(COMMON_DIR)/%Include.dbd
menu%.h$(DEP): ../menu%.dbd
@$(RM) $@
@$(DBTOMENUH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@
@echo "$(COMMONDEP_TARGET): ../Makefile" >> $@
%.dbd$(DEP): %.dbd.pod
@$(RM) $@
@$(DBEXPAND) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@
@echo "$(COMMONDEP_TARGET): ../Makefile" >> $@
@@ -208,7 +247,23 @@ menu%.h$(DEP): menu%.dbd
@$(DBEXPAND) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@
@echo "$(COMMONDEP_TARGET): ../Makefile" >> $@
%.db$(RAW)$(DEP): %.substitutions
%.dbd$(DEP): ../%Include.dbd
@$(RM) $@
@$(DBEXPAND) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@
@echo "$(COMMONDEP_TARGET): ../Makefile" >> $@
%.dbd$(DEP):
@$(RM) $@
@$(DBEXPAND) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $($*_DBD) > $@
@echo "$(COMMONDEP_TARGET): ../Makefile" >> $@
%.db$(RAW)$(DEP): %$(SUBST_SUFFIX)
@$(RM) $@
$(MKMF) -m$@ $(DBFLAGS) $(COMMONDEP_TARGET) $< $(TEMPLATE_FILENAME)
@echo "$(COMMONDEP_TARGET): $(TEMPLATE_FILENAME)" >> $@
@echo "$@: $(TEMPLATE_FILENAME)" >> $@
%.db$(RAW)$(DEP): ../%$(SUBST_SUFFIX)
@$(RM) $@
$(MKMF) -m$@ $(DBFLAGS) $(COMMONDEP_TARGET) $< $(TEMPLATE_FILENAME)
@echo "$(COMMONDEP_TARGET): $(TEMPLATE_FILENAME)" >> $@
@@ -218,10 +273,18 @@ menu%.h$(DEP): menu%.dbd
@$(RM) $@
$(MKMF) -m$@ $(DBFLAGS) $(COMMONDEP_TARGET) $<
%.db$(RAW)$(DEP): ../%.template
@$(RM) $@
$(MKMF) -m$@ $(DBFLAGS) $(COMMONDEP_TARGET) $<
%.acf$(DEP): %.acs
@$(RM) $@
@$(ACFDEPENDS_CMD)
%.acf$(DEP): ../%.acs
@$(RM) $@
@$(ACFDEPENDS_CMD)
##################################################### CapFast filter
$(COMMON_DIR)/%.edf: ../%.sch $(DEPSCHS)
@@ -234,17 +297,21 @@ $(COMMON_DIR)/%.edf: ../%.sch $(DEPSCHS)
# WARNING: CREATESUBSTITUTIONS script needs output dir on command line
ifdef CREATESUBSTITUTIONS
$(COMMON_DIR)/%.substitutions:
$(COMMON_DIR)/%$(SUBST_SUFFIX):
$(ECHO) "Create substitutions"
@$(RM) $@
$(CREATESUBSTITUTIONS) $@
endif
$(INSTALL_DB)/%.substitutions: %.substitutions
$(INSTALL_DB)/%$(SUBST_SUFFIX): %$(SUBST_SUFFIX)
$(ECHO) "Installing db file $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
.PRECIOUS: $(COMMON_DIR)/%.substitutions
$(INSTALL_DB)/%$(SUBST_SUFFIX): ../%$(SUBST_SUFFIX)
$(ECHO) "Installing db file $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
.PRECIOUS: $(COMMON_DIR)/%$(SUBST_SUFFIX)
##################################################### Template files
@@ -258,6 +325,10 @@ $(INSTALL_DB)/%.template: %.template
$(ECHO) "Installing db file $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
$(INSTALL_DB)/%.template: ../%.template
$(ECHO) "Installing db file $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
.PRECIOUS: $(COMMON_DIR)/%.template
##################################################### INC files
@@ -272,6 +343,11 @@ $(COMMON_DIR)/%Record.h: %Record.dbd
$(DBTORECORDTYPEH) $(DBDFLAGS) -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/%Record.h: ../%Record.dbd
@$(RM) $(notdir $@)
$(DBTORECORDTYPEH) $(DBDFLAGS) -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/menu%.h: $(COMMON_DIR)/menu%.dbd
@$(RM) $(notdir $@)
$(DBTOMENUH) $(DBDFLAGS) -o $(notdir $@) $<
@@ -282,30 +358,53 @@ $(COMMON_DIR)/menu%.h: menu%.dbd
$(DBTOMENUH) $(DBDFLAGS) -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/menu%.h: ../menu%.dbd
@$(RM) $(notdir $@)
$(DBTOMENUH) $(DBDFLAGS) -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
.PRECIOUS: $(COMMON_DIR)/%.h
##################################################### DBD files
$(COMMON_DIR)/bpt%.dbd: bpt%.data
$(COMMON_DIR)/bpt%.dbd: bpt%.data
@$(RM) $(notdir $@)
$(MAKEBPT) $< $(notdir $@)
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/%.dbd: $(COMMON_DIR)/%Include.dbd
$(ECHO) "Expanding created dbd file $(notdir $<)"
$(COMMON_DIR)/%.dbd: %.dbd.pod
@$(RM) $(notdir $@)
$(DBEXPAND) $(DBDFLAGS) -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/%.dbd: %Include.dbd
$(COMMON_DIR)/%.dbd: %Include.dbd
$(ECHO) "Expanding dbd file $<"
@$(RM) $(notdir $@)
$(DBEXPAND) $(DBDFLAGS) -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/%Include.dbd:
$(COMMON_DIR)/%.dbd: ../%Include.dbd
$(ECHO) "Expanding dbd file $<"
@$(RM) $(notdir $@)
$(PERL) $(TOOLS)/makeIncludeDbd.pl $($*_DBD) $(notdir $@)
$(DBEXPAND) $(DBDFLAGS) -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
# Make DBDCAT file x depend on x_DBD source files
define DBDCAT_template
$$(COMMON_DIR)/$(1).dbd : ../Makefile $$(foreach file, $$($(1)_DBD),$$(DBDCAT_SOURCE) )
endef
$(foreach name,$(subst .dbd,,$(DBDCAT)), $(eval $(call DBDCAT_template,$(name))))
$(COMMON_DBDCATS):$(COMMON_DIR)/%.dbd:
$(ECHO) "Creating dbd file $(notdir $@)"
@$(RM) $(notdir $@)
$(DBDCAT_COMMAND)
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/%.dbd:
$(ECHO) "Creating dbd file $(notdir $@)"
@$(RM) $(notdir $@)
$(DBEXPAND) $(DBDFLAGS) -o $(notdir $@) $($*_DBD)
@$(MV) $(notdir $@) $@
$(INSTALL_DBD)/%: $(COMMON_DIR)/%
@@ -316,6 +415,10 @@ $(INSTALL_DBD)/%: %
$(ECHO) "Installing dbd file $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
$(INSTALL_DBD)/%: ../%
$(ECHO) "Installing dbd file $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
define DBD_INSTALLS_template
$$(INSTALL_DBD)/$$(notdir $(1)) : $(1)
$(ECHO) "Installing $$@"
@@ -325,6 +428,30 @@ $(foreach file, $(DBD_INSTALLS), $(eval $(call DBD_INSTALLS_template, $(file))))
.PRECIOUS: $(COMMON_DBDS) $(COMMON_DIR)/%Include.dbd
##################################################### HTML files
$(COMMON_DIR)/%.html: %.dbd.pod $(TOOLS)/dbdToHtml.pl
@$(RM) $(notdir $@)
$(PERL) $(TOOLS)/dbdToHtml.pl $(DBDFLAGS) -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/%.html: %.pod $(TOOLS)/podToHtml.pl
@$(RM) $(notdir $@)
$(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/%.html: %.pm $(TOOLS)/podToHtml.pl
@$(RM) $(notdir $@)
$(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/%.html: ../%.pm $(TOOLS)/podToHtml.pl
@$(RM) $(notdir $@)
$(PERL) $(TOOLS)/podToHtml.pl -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
.PRECIOUS: $(COMMON_DIR)/%.html %.html
##################################################### DB files
$(COMMON_DIR)/%.db$(RAW): $(COMMON_DIR)/%.edf
@@ -332,7 +459,13 @@ $(COMMON_DIR)/%.db$(RAW): $(COMMON_DIR)/%.edf
@$(REPLACEVAR) < $*.VAR > $@
@$(RM) $*.VAR
$(COMMON_DIR)/%.db$(RAW): %.substitutions
$(COMMON_DIR)/%.db$(RAW): %$(SUBST_SUFFIX)
$(ECHO) "Inflating database from $< $(TEMPLATE_FILENAME)"
@$(RM) $@ $*.tmp
$(MSI) $(DBFLAGS) -S$< $(TEMPLATE_FILENAME) > $*.tmp
$(MV) $*.tmp $@
$(COMMON_DIR)/%.db$(RAW): ../%$(SUBST_SUFFIX)
$(ECHO) "Inflating database from $< $(TEMPLATE_FILENAME)"
@$(RM) $@ $*.tmp
$(MSI) $(DBFLAGS) -S$< $(TEMPLATE_FILENAME) > $*.tmp
@@ -344,11 +477,22 @@ $(COMMON_DIR)/%.db$(RAW): %.template
$(MSI) $(DBFLAGS) $< > $*.tmp
$(MV) $*.tmp $@
$(COMMON_DIR)/%.db$(RAW): ../%.template
$(ECHO) "Inflating database from $<"
@$(RM) $@ $*.tmp
$(MSI) $(DBFLAGS) $< > $*.tmp
$(MV) $*.tmp $@
$(COMMON_DIR)/%.acf: %.acs
$(ECHO) "Creating acf file $@"
@$(RM) $@
$(ACF_CMD)
$(COMMON_DIR)/%.acf: ../%.acs
$(ECHO) "Creating acf file $@"
@$(RM) $@
$(ACF_CMD)
.PRECIOUS: $(COMMON_DIR)/%.acf
# dbst based database optimization
@@ -370,6 +514,10 @@ else
$(INSTALL_DB)/%: %
$(ECHO) "Installing db file $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
$(INSTALL_DB)/%: ../%
$(ECHO) "Installing db file $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
endif
$(INSTALL_DB)/%.db: $(COMMON_DIR)/%.db
@@ -388,18 +536,18 @@ $(foreach file, $(DB_INSTALLS), $(eval $(call DB_INSTALLS_template, $(file))))
##################################################### register record,device,driver support
IOC_INST_TOP := $(firstword $(IOCS_APPL_TOP) \
$(shell $(PERL) $(TOOLS)/fullPathName.pl $(INSTALL_LOCATION) ) )
%_registerRecordDeviceDriver.cpp: $(COMMON_DIR)/%.dbd
@$(RM) $@ $*.tmp
$(REGISTERRECORDDEVICEDRIVER) $(DBDFLAGS) $< $(basename $@) $(IOC_INST_TOP) > $*.tmp
$(MV) $*.tmp $@
%_registerRecordDeviceDriver.cpp: $(COMMON_DIR)/%.dbd
@$(RM) $@
$(REGISTERRECORDDEVICEDRIVER) $(REGRDDFLAGS) -o $@ $< $(basename $@) $(IOCS_APPL_TOP)
%_registerRecordDeviceDriver.cpp: %.dbd
@$(RM) $@ $*.tmp
$(REGISTERRECORDDEVICEDRIVER) $(DBDFLAGS) $< $(basename $@) $(IOC_INST_TOP) > $*.tmp
$(MV) $*.tmp $@
%_registerRecordDeviceDriver.cpp: %.dbd
@$(RM) $@
$(REGISTERRECORDDEVICEDRIVER) $(REGRDDFLAGS) -o $@ $< $(basename $@) $(IOCS_APPL_TOP)
%_registerRecordDeviceDriver.cpp: ../%.dbd
@$(RM) $@
$(REGISTERRECORDDEVICEDRIVER) $(REGRDDFLAGS) -o $@ $< $(basename $@) $(IOCS_APPL_TOP)
.PRECIOUS: %_registerRecordDeviceDriver.cpp

View File

@@ -1,13 +1,13 @@
#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
# Copyright (c) 2013 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 file LICENSE that is included with this distribution.
#*************************************************************************
#RULES.ioc
include $(CONFIG)/RULES_DIRS
build$(DIVIDER)$(ARCH) build: buildInstall
@@ -15,24 +15,20 @@ install$(DIVIDER)$(ARCH) install: buildInstall
$(ARCH): buildInstall
ifeq ($(filter $(ARCH),$(BUILD_ARCHS)),$(ARCH))
buildInstall$(DIVIDER)$(ARCH) buildInstall: $(TARGETS)
buildInstall$(DIVIDER)$(ARCH) buildInstall: $(TARGETS)
clean$(DIVIDER)$(ARCH) clean:
$(RM) cdCommands envPaths dllPath.bat
else
buildInstall$(DIVIDER)$(ARCH) buildInstall:
clean$(DIVIDER)$(ARCH) clean:
endif
cdCommands envPaths dllPath.bat: $(wildcard $(TOP)/configure/RELEASE*) \
$(TOP)/configure/CONFIG $(INSTALL_BIN)
ifeq ($(IOCS_APPL_TOP),)
$(PERL) $(TOOLS)/convertRelease.pl -a $(ARCH) $@
clean$(DIVIDER)$(ARCH) clean:
$(RM) cdCommands envPaths dllPath.bat relPaths.sh
else
$(PERL) $(TOOLS)/convertRelease.pl -a $(ARCH) -t $(IOCS_APPL_TOP) $@
buildInstall$(DIVIDER)$(ARCH) buildInstall:
clean$(DIVIDER)$(ARCH) clean:
endif
cdCommands envPaths dllPath.bat relPaths.sh: \
$(wildcard $(TOP)/configure/RELEASE*) \
$(wildcard $(TOP)/configure/CONFIG_SITE*) $(INSTALL_BIN)
$(CONVERTRELEASE) -a $(ARCH) -t $(IOCS_APPL_TOP) $@
realclean:
$(RM) cdCommands envPaths dllPath.bat
$(RM) cdCommands envPaths dllPath.bat relPaths.sh

View File

@@ -11,53 +11,45 @@
#
all: install
host: install$(DIVIDER)$(EPICS_HOST_ARCH)
ACTIONS = inc
ACTIONS += build
ACTIONS += install
ACTIONS += buildInstall
ACTIONS += browse
ACTIONS += runtests
#ACTIONS += rebuild
ACTIONS += runtests tapfiles
actionPart = $(word 1, $(subst $(DIVIDER), ,$@))
archPart = $(word 2, $(subst $(DIVIDER), ,$@))
actionArchTargets = $(foreach x, $(ACTIONS),\
$(foreach arch,$(BUILD_ARCHS), $(x)$(DIVIDER)$(arch)))
actionArchTargets = $(foreach action, $(ACTIONS), \
$(addprefix $(action)$(DIVIDER), $(BUILD_ARCHS)))
cleanArchTargets = $(foreach arch,$(BUILD_ARCHS), clean$(DIVIDER)$(arch))
cleanArchTargets = $(addprefix clean$(DIVIDER), $(BUILD_ARCHS))
buildDirs = $(addprefix O.,$(BUILD_ARCHS))
buildDirs = $(addprefix O., $(BUILD_ARCHS))
#*************************************************************************
# Create epics_host_arch dependancies for GNU make -j option
# Only works with GNU make 3.81 or later (uses eval function)
# Needed in dirs where EPICS_HOST_ARCH build creates a tool used in
# Create EPICS_HOST_ARCH dependancies for GNU make -j option
# Needed in dirs where EPICS_HOST_ARCH builds a tool used by
# cross arch builds
CROSS_ARCHS += $(CROSS1) $(CROSS2)
define DEP_template
$(2): $$(EPICS_HOST_ARCH)
$(1)$$(DIVIDER)$(2): $(1)$$(DIVIDER)$$(EPICS_HOST_ARCH) O.$(2)
$(2) : $(EPICS_HOST_ARCH)
$(1)$(DIVIDER)$(2) : $(1)$(DIVIDER)$(EPICS_HOST_ARCH) O.$(2)
endef
ifeq ($(MAKE_VERSION),3.81)
$(foreach action, $(ACTIONS), $(foreach arch,\
$(CROSS_ARCHS),$(eval $(call DEP_template,$(action),$(arch)))))
else
ifeq ($(findstring j,$(MAKEFLAGS)),j)
$(foreach action, $(ACTIONS), $(foreach arch,\
$(CROSS_ARCHS),$(eval $(call DEP_template,$(action),$(arch)))))
endif
endif
$(foreach action, $(ACTIONS), $(foreach arch, $(CROSS_ARCHS), \
$(eval $(call DEP_template,$(action),$(arch)))))
#*************************************************************************
# Allows rebuild to work with parallel builds option, -j.
ifeq (rebuild,$(filter rebuild,$(MAKECMDGOALS)))
$(buildDirs) O.Common : clean
rebuild: install
$(buildDirs) O.Common : clean
rebuild : install
endif
$(actionArchTargets) : $(buildDirs) O.Common
@@ -66,7 +58,7 @@ $(actionArchTargets) : $(buildDirs) O.Common
$(BUILD_ARCHS) : % : O.% O.Common
$(MAKE) -C O.$@ -f ../Makefile TOP=$(TOP)/.. T_A=$@
$(ACTIONS):%: $(foreach arch, $(BUILD_ARCHS), %$(DIVIDER)$(arch))
$(ACTIONS) : % : $(foreach arch, $(BUILD_ARCHS), %$(DIVIDER)$(arch))
$(buildDirs):
$(PERL) $(TOOLS)/makeMakefile.pl $@ $(TOP)/..
@@ -77,21 +69,21 @@ O.Common:
#
# special clean rule
#
clean : archs_common_clean
clean: archsCommonClean
archs_common_clean :
$(RMDIR) $(addprefix O.,$(BUILD_ARCHS)) O.Common
archsCommonClean:
$(RMDIR) $(buildDirs) O.Common
archclean :
$(RMDIR) $(addprefix O.,$(BUILD_ARCHS))
archclean:
$(RMDIR) $(buildDirs)
$(cleanArchTargets) :
$(cleanArchTargets):
$(RMDIR) O.$(archPart)
realclean :
realclean:
$(RMDIR) O.*
.PHONY : $(actionArchTargets)
.PHONY : $(cleanArchTargets)
.PHONY : $(BUILD_ARCHS) rebuild arch_common_clean
.PHONY : $(ACTIONS) clean realclean archclean all
.PHONY : $(BUILD_ARCHS) rebuild archsCommonClean
.PHONY : $(ACTIONS) clean realclean archclean host all

View File

@@ -21,6 +21,7 @@ vpath %.cc $(USR_VPATH) $(ALL_SRC_DIRS)
vpath %.cpp $(USR_VPATH) $(ALL_SRC_DIRS)
vpath %.rc $(USR_VPATH) $(ALL_SRC_DIRS)
vpath %.h $(USR_VPATH) $(ALL_SRC_DIRS)
vpath %.hpp $(USR_VPATH) $(ALL_SRC_DIRS)
vpath %.html $(USR_VPATH) $(ALL_SRC_DIRS)
vpath %.skel.static $(USR_VPATH) $(ALL_SRC_DIRS)
vpath %.y $(USR_VPATH) $(ALL_SRC_DIRS)
@@ -67,27 +68,36 @@ else
INSTALL_TEMPLATES_SUBDIR = $(INSTALL_TEMPLATES)
endif
HTMLS_DIR ?= .
#---------------------------------------------------------------
# First target
all: install
all: install
ifeq ($(EPICS_HOST_ARCH),$T_A)
host: install
else
# Do nothing
host:
endif
-include $(CONFIG)/RULES.Db
-include $(CONFIG)/RULES_JAVA
#---------------------------------------------------------------
# Include defines and rules for prod, library and test* targets
#ifneq (,$(strip $(PROD) $(TESTPROD) $(LIBRARY) $(TESTLIBRARY) $(LOADABLE_LIBRARY) ))
include $(CONFIG)/RULES_TARGET
#endif
#---------------------------------------------------------------
# Read dependency files
ifneq (,$(strip $(HDEPENDS_FILES)))
$(filter-out $(wildcard *$(DEP)), $(HDEPENDS_FILES)): $(COMMON_INC)
-include $(HDEPENDS_FILES)
endif
#---------------------------------------------------------------
# Included defines and rules for prod,testprod, and library targets
#ifneq (,$(strip $(PROD) $(TESTPROD) $(LIBRARY) $(TESTLIBRARY) $(LOADABLE_LIBRARY) ))
include $(CONFIG)/RULES_TARGET
#endif
#---------------------------------------------------------------
# Products and Object libraries
#
@@ -100,6 +110,8 @@ ifneq (,$(strip $(TESTS)))
TARGETS += testspec
endif
TAPFILES += $(TESTSCRIPTS:.t=.tap)
#---------------------------------------------------------------
# Libraries
#
@@ -149,21 +161,11 @@ build_clean:
$(LOADABLE_SHRLIBNAME) \
$(INC) $(TARGETS) $(TDS) $(CLEANS) \
*.out MakefileInclude *.manifest *.exp \
$(COMMON_INC) $(HDEPENDS_FILES) $(PRODTARGETS) $(TESTSCRIPTS)
$(COMMON_INC) $(HDEPENDS_FILES) $(PRODTARGETS) \
$(TESTSCRIPTS) $(TAPFILES)
ifdef RES
@$(RM) *$(RES)
endif
ifdef BAF
@$(RM) $(PROD_BAF) $(LIB_BAF)
endif
ifdef BOF
@$(RM) *$(BOF)
endif
# WIN95/NT source browser
#ifdef BAF
browse: $(LIB_BAF) $(PROD_BAF)
#endif
$(DIRECTORY_TARGETS) :
$(MKDIR) -p $@
@@ -186,18 +188,11 @@ endif
$(TESTPRODNAME) $(PRODNAME): $(PRODUCT_OBJS) $(PROD_RESS) $(PROD_DEPLIBS)
$(TESTPRODNAME) $(PRODNAME):%$(EXE):
$(TESTPRODNAME) $(PRODNAME): %$(EXE):
@$(RM) $@
$(DEBUGCMD) $(LINK.cpp)
$(MT_EXE_COMMAND)
# object libs for R3.13 vxWorks compatibility only
$(OBJLIBNAME): $(OBJLIB_LD_OBJS)
$(OBJLIBNAME):%$(OBJ):
@$(RM) $@
$(OBJLIB_LINK.cpp)
%_ctdt$(OBJ) : %_ctdt.c
@$(RM) $@
$(COMPILE.ctdt) $<
@@ -214,29 +209,29 @@ $(OBJLIBNAME):%$(OBJ):
@$(RM) $@
$(HDEPENDS.cpp) $<
%$(OBJ): %.c
# Cancel GNUMake's built-in rules, which don't have our _INC
# dependencies so could get used in some circumstances (gdd)
%.o : %.c
%.o : %.cc
%.o : %.cpp
%$(OBJ): %.c $(COMMON_INC) $(INSTALL_INC)
@$(RM) $@
$(COMPILE.c) -c $<
%$(OBJ): %.cc
%$(OBJ): %.cc $(COMMON_INC) $(INSTALL_INC)
@$(RM) $@
$(COMPILE.cpp) -c $<
%$(OBJ): %.cpp
%$(OBJ): %.cpp $(COMMON_INC) $(INSTALL_INC)
@$(RM) $@
$(COMPILE.cpp) -c $<
# WIN95/NT resource compiler
# Windows resource compiler
%$(RES): %.rc
@$(RM) $@
$(RCCMD)
# WIN95/NT source browser
%.bsc: %.sbr
$(ECHO) "building source browser archive $@"
@$(RM) $@
$(BAFCMD) $<
YACCOPT ?= $($*_YACCOPT)
#
# rename the y.tab.h file only if we
@@ -259,16 +254,6 @@ YACCOPT ?= $($*_YACCOPT)
@$(RM) $@
$(MV) $*.yy.c $@
# WIN95/NT source browser
ifdef BAF
$(LIB_BAF): $(addsuffix $(BOF),$(basename $(LIBRARY_LD_OBJS)))
$(ECHO) "Building source browser archive $@"
@$(RM) $@
$(BAFCMD) $^
endif
#---------------------------------------------------------------
# Libraries, shared/DLL and stubs
@@ -284,8 +269,13 @@ endif # RANLIB
$(SHRLIBNAME) $(DLLSTUB_LIBNAME) $(TESTSHRLIBNAME) $(TESTDLLSTUB_LIBNAME): \
$(LIBRARY_OBJS) $(LIBRARY_RESS) $(SHRLIB_DEPLIBS)
$(SHRLIBNAME) $(TESTSHRLIBNAME): $(SHRLIB_PREFIX)%$(SHRLIB_SUFFIX):
$(RM) $@
$(SHRLIBNAME): $(SHRLIB_PREFIX)%$(SHRLIB_SUFFIX):
@$(RM) $@
$(LINK.shrlib)
$(MT_DLL_COMMAND)
$(TESTSHRLIBNAME): $(SHRLIB_PREFIX)%$(SHRLIB_SUFFIX):
@$(RM) $@
$(LINK.shrlib)
$(MT_DLL_COMMAND)
@@ -315,17 +305,13 @@ $(MUNCHNAME): %$(MUNCH_SUFFIX): $(MUNCH_DEPENDS) %$(EXE)
@$(RM) $@
$(MUNCH_CMD)
$(OBJLIB_MUNCHNAME): %.munch: %_ctdt$(OBJ) %$(OBJ)
@$(RM) $@
$(MUNCH_CMD)
#---------------------------------------------------------------
# Automated testing
runtests: $(TESTSCRIPTS_$(BUILD_CLASS))
runtests: $(TESTSCRIPTS)
-$(PERL) -MTest::Harness -e 'runtests @ARGV if @ARGV;' $^
testspec: $(TESTSCRIPTS_$(BUILD_CLASS))
testspec: $(TESTSCRIPTS)
@$(RM) $@
@echo OS-class: $(OS_CLASS) > $@
@echo Target-arch: $(T_A) >> $@
@@ -333,16 +319,22 @@ testspec: $(TESTSCRIPTS_$(BUILD_CLASS))
$(if $(TESTFILES), @echo Files: $(TESTFILES) >> $@)
$(if $(TESTSPEC_$(OS_CLASS)), @echo "Harness: $(TESTSPEC_$(OS_CLASS))" >> $@)
tapfiles: $(TESTSCRIPTS) $(TAPFILES)
# A .tap file is the output from running the associated test script
%.tap: %.t
-HARNESS_ACTIVE=1 $(PERL) $< > $@
# If there's a perl test script (.plt) available, use it
%.t: ../%.plt
@$(RM) $@
@$(CP) $< $@
$(CP) $< $@
# Some versions of Test::Harness expect test programs in perl only.
# Test programs (.t files) must be written in Perl.
# Generate a perl program to exec the real test binary.
%.t: %$(EXE)
@$(RM) $@
@$(PERL) $(TOOLS)/makeTestfile.pl $@ $<
$(PERL) $(TOOLS)/makeTestfile.pl $@ $<
#---------------------------------------------------------------
# Install rules for BIN_INSTALLS and LIB_INSTALLS
@@ -387,7 +379,7 @@ endif # SUFFIX
$(INSTALL_SHRLIBS): $(INSTALL_SHRLIB)/%: %
$(ECHO) "Installing shared library $@"
@$(INSTALL_LIBRARY) -d -m $(LIB_PERMISSIONS) $< $(INSTALL_SHRLIB)
@$(INSTALL_LIBRARY) -d -m $(SHRLIB_PERMISSIONS) $< $(INSTALL_SHRLIB)
ifneq ($(SHRLIB_SUFFIX),$(SHRLIB_SUFFIX_BASE))
ifneq (,$(strip $(SHRLIB_VERSION)))
@$(RM) $(subst $(SHRLIB_SUFFIX),$(SHRLIB_SUFFIX_BASE),$@)
@@ -411,7 +403,7 @@ $(INSTALL_TCLLIB)/$(TCLINDEX): $(INSTALL_TCLLIBS)
$(INSTALL_LOADABLE_SHRLIBS): $(INSTALL_SHRLIB)/%: %
$(ECHO) "Installing loadable shared library $@"
@$(INSTALL_LIBRARY) -d -m 555 $< $(INSTALL_SHRLIB)
@$(INSTALL_LIBRARY) -d -m $(SHRLIB_PERMISSIONS) $< $(INSTALL_SHRLIB)
ifneq ($(LOADABLE_SHRLIB_SUFFIX),$(SHRLIB_SUFFIX_BASE))
ifneq (,$(strip $(LOADABLE_SHRLIB_VERSION)))
@$(RM) $(subst $(LOADABLE_SHRLIB_SUFFIX),$(SHRLIB_SUFFIX_BASE),$@)
@@ -459,6 +451,10 @@ $(INSTALL_HTML)/$(HTMLS_DIR)/%: ../%
$(ECHO) "Installing html $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
$(INSTALL_HTML)/$(HTMLS_DIR)/%: $(COMMON_DIR)/%
$(ECHO) "Installing generated html $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
$(INSTALL_TEMPLATES_SUBDIR)/%: ../%
$(ECHO) "Installing $@"
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
@@ -472,8 +468,8 @@ $(INSTALL_TEMPLATES_SUBDIR)/%: %
.PRECIOUS: %.i %.o %.c %.nm %.cpp %.cc
.PRECIOUS: $(COMMON_INC)
.PHONY: all inc build install clean rebuild buildInstall build_clean
.PHONY: runtests checkRelease warnRelease noCheckRelease
.PHONY: all host inc build install clean rebuild buildInstall build_clean
.PHONY: runtests tapfiles checkRelease warnRelease noCheckRelease
endif # BASE_RULES_BUILD
# EOF RULES_BUILD

View File

@@ -12,7 +12,8 @@
ARCHS += $(BUILD_ARCHS)
ACTIONS += inc build install buildInstall clean realclean archclean runtests
ACTIONS += inc build install buildInstall clean realclean archclean
ACTIONS += runtests tapfiles
dirPart = $(join $(dir $@), $(word 1, $(subst $(DIVIDER), ,$(notdir $@))))
@@ -33,7 +34,8 @@ actionArchTargets = $(foreach action, $(ACTIONS),\
$(foreach arch, $(ARCHS), \
$(action)$(DIVIDER)$(arch)))
all : install
all: install
host: install$(DIVIDER)$(EPICS_HOST_ARCH)
# Allows rebuild to work with parallel builds option, -j.
ifeq (rebuild,$(filter rebuild,$(MAKECMDGOALS)))
@@ -72,7 +74,7 @@ $(DIRS) $(dirActionTargets) $(dirArchTargets) $(dirActionArchTargets) :
$(ARCHS) $(ACTIONS) $(actionArchTargets) :%: \
$(foreach dir, $(DIRS), $(dir)$(DIVIDER)%)
.PHONY : $(DIRS) all rebuild
.PHONY : $(DIRS) all host rebuild
.PHONY : $(ARCHS) $(ACTIONS)
.PHONY : $(dirActionTargets) $(dirArchTargets)
.PHONY : $(dirActionArchTargets)

View File

@@ -1,6 +1,6 @@
# <top>/configure/RULES_EXPAND
ifeq ($(findstring Host,$(VALID_BUILDS)),Host)
vpath %@ $(USR_VPATH) $(ALL_SRC_DIRS)
# Default settings
EXPAND_TOOL ?= $(PERL) $(TOOLS)/expandVars.pl
@@ -8,11 +8,12 @@ EXPAND_TOOL ?= $(PERL) $(TOOLS)/expandVars.pl
EXPANDFLAGS += -t $(INSTALL_LOCATION) -a $(T_A)
EXPANDFLAGS += $(addprefix -D ,$(EXPAND_VARS))
# The names of files to be expanded must end with '@'
EXPANDED = $(EXPAND:%@=%)
buildInstall: $(EXPANDED)
$(EXPANDED): %: ../%@
$(EXPANDED): %: %@
$(ECHO) "Expanding $< to $@"
@$(RM) $@
@$(EXPAND_TOOL) $(EXPANDFLAGS) $($@_EXPANDFLAGS) $< $@
@@ -23,5 +24,3 @@ expand_clean:
@$(RM) $(EXPANDED)
.PHONY : expand_clean
endif

View File

@@ -1,10 +1,10 @@
#*************************************************************************
# Copyright (c) 2006 UChicago Argonne LLC, as Operator of Argonne
# Copyright (c) 2013 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.
# in the file LICENSE that is included with this distribution.
#*************************************************************************
# $Revision-Id$
#
@@ -36,13 +36,11 @@ endif
endif
#---------------------------------------------
# Include existing and new $(INSTALL_CFG)/* definitions
# Include our own $(INSTALL_CFG)/RULES* definitions
#
TOP_CFG_FILES = $(sort $(wildcard $(INSTALL_CFG)/RULES*) \
$(wildcard $(INSTALL_CFG)/CONFIG*) \
$(addprefix $(INSTALL_CFG)/,$(CFG)))
ifneq ($(TOP_CFG_FILES),)
include $(TOP_CFG_FILES)
TOP_CFG_RULES = $(wildcard $(INSTALL_CFG)/RULES*)
ifneq ($(TOP_CFG_RULES),)
include $(TOP_CFG_RULES)
endif
#---------------------------------------------------------------

View File

@@ -50,13 +50,13 @@ $(1)_RESS = $$(if $(RES),$$(addsuffix $(RES),$$(basename $$($(1)_RCS))),)
$(1)_OBJSNAME = $$(addsuffix $(OBJ),$$(basename $$($(1)_OBJS) $$($(1)_SRCS) ))
$(1)_DEPLIBS = $$(foreach lib, $$($(1)_LDLIBS), \
$$(firstword $$(wildcard \
$$(addsuffix /$(SHRLIB_PREFIX)$$(lib)*$(SHRLIB_SUFFIX_BASE)*, \
$$($$(lib)_DIR) $$(SHRLIB_SEARCH_DIRS)) \
$$(addsuffix /$(DLLSTUB_PREFIX)$$(lib)$(DLLSTUB_SUFFIX), \
$$($$(lib)_DIR) $$(SHRLIB_SEARCH_DIRS)) \
$$(addsuffix /$(SHRLIB_PREFIX)$$(lib)*$(SHRLIB_SUFFIX_BASE)*, \
$$($$(lib)_DIR) $$(SHRLIB_SEARCH_DIRS)) \
$$(addsuffix /$(LIB_PREFIX)$$(lib)$(LIB_SUFFIX), \
$$($$(lib)_DIR) $$(SHRLIB_SEARCH_DIRS))) \
$$(addsuffix /$(BUILDLIB_PREFIX)$$(lib)$(BUILDLIB_SUFFIX), \
$$($$(lib)_DIR) $$(SHRLIB_SEARCH_DIRS)) \
) $$(addsuffix /$(BUILDLIB_PREFIX)$$(lib)$(BUILDLIB_SUFFIX), \
$$(firstword $$($$(lib)_DIR) $(SHRLIB_SEARCH_DIRS)))))
endef
@@ -79,27 +79,26 @@ define LIBRARY_template
$(1)_DLL_DEPLIBS=$$(foreach lib, $$($(1)_DLL_LIBS), \
$$(firstword $$(wildcard \
$$(addsuffix /$(SHRLIB_PREFIX)$$(lib)*$(SHRLIB_SUFFIX_BASE)*, \
$$($$(lib)_DIR) $$(SHRLIB_SEARCH_DIRS)) \
$$(addsuffix /$(DLLSTUB_PREFIX)$$(lib)$(DLLSTUB_SUFFIX), \
$$($$(lib)_DIR) $$(SHRLIB_SEARCH_DIRS)) \
$$(addsuffix /$(SHRLIB_PREFIX)$$(lib)*$(SHRLIB_SUFFIX_BASE)*, \
$$($$(lib)_DIR) $$(SHRLIB_SEARCH_DIRS)) \
$$(addsuffix /$(LIB_PREFIX)$$(lib)$(LIB_SUFFIX), \
$$($$(lib)_DIR) $$(SHRLIB_SEARCH_DIRS))) \
$$(addsuffix /$(BUILDLIB_PREFIX)$$(lib)$(BUILDLIB_SUFFIX), \
$$($$(lib)_DIR) $$(SHRLIB_SEARCH_DIRS)) \
) $$(addsuffix /$(BUILDLIB_PREFIX)$$(lib)$(BUILDLIB_SUFFIX), \
$$(firstword $$($$(lib)_DIR) $$(SHRLIB_SEARCH_DIRS)))))
$$(LIB_PREFIX)$(1)$$(LIB_SUFFIX):$$($(1)_OBJSNAME) $$($(1)_RESS)
$$(LIB_PREFIX)$(1)$$(LIB_SUFFIX):$$($(1)_DEPLIBS)
ifeq ($$(SHARED_LIBRARIES),YES)
ifdef SHRLIB_SUFFIX
$$(SHRLIB_PREFIX)$(1)$$(SHRLIB_SUFFIX):$$($(1)_OBJSNAME) $$($(1)_RESS)
$$(SHRLIB_PREFIX)$(1)$$(SHRLIB_SUFFIX):$$($(1)_DEPLIBS)
$$(SHRLIB_PREFIX)$(1)$$(SHRLIB_SUFFIX):$$($(1)_DLL_DEPLIBS)
# Needed for -j parallel builds option
ifeq ($$(SHARED_LIBRARIES),YES)
ifdef SHRLIB_SUFFIX
$$(INSTALL_LIB)/$$(LIB_PREFIX)$(1)$$(LIB_SUFFIX): \
$$(INSTALL_SHRLIB)/$$(SHRLIB_PREFIX)$(1)$$(SHRLIB_SUFFIX)
endif
endif
endef
@@ -111,6 +110,14 @@ $(foreach target, $(LIBRARY) $(TESTLIBRARY), \
define LIBRARY2_template
BUILD_LIBRARY += $$(if $$(strip $$($(1)_OBJSNAME) $$(LIBRARY_OBJS)),$(1),)
# Needed for -j parallel builds option
ifeq ($$(SHARED_LIBRARIES),YES)
ifdef SHRLIB_SUFFIX
$$(INSTALL_LIB)/$$(DLLSTUB_PREFIX)$(1)$$(DLLSTUB_SUFFIX): \
$$(INSTALL_SHRLIB)/$$(SHRLIB_PREFIX)$(1)$$(SHRLIB_SUFFIX)
endif
endif
endef
$(foreach target, $(LIBRARY), \
@@ -119,6 +126,7 @@ $(foreach target, $(LIBRARY), \
#-----------------------------------------------------------------------
define LIBRARY3_template
$(1)_DIR = .
TESTBUILD_LIBRARY += $$(if $$(strip $$($(1)_OBJSNAME) $$(LIBRARY_OBJS)),$(1),)
endef

View File

@@ -22,9 +22,8 @@ realuninstall: uninstallDirs
$(RMDIR) $(INSTALL_LOCATION_BIN)
$(RMDIR) $(INSTALL_LOCATION_LIB)
UNINSTALL_DIRS += $(INSTALL_DBD) $(INSTALL_INCLUDE) $(INSTALL_DOC)\
$(INSTALL_HTML) $(INSTALL_JAVA) $(INSTALL_TEMPLATES) \
$(INSTALL_DB)
UNINSTALL_DIRS += $(INSTALL_DBD) $(INSTALL_INCLUDE) $(INSTALL_DOC)
UNINSTALL_DIRS += $(INSTALL_HTML) $(INSTALL_TEMPLATES) $(INSTALL_DB)
UNINSTALL_DIRS += $(DIRECTORY_TARGETS)
uninstallDirs:
$(RMDIR) $(UNINSTALL_DIRS)
@@ -64,11 +63,12 @@ help:
@echo " rebuild - Same as clean install"
@echo " archclean - Removes O.<arch> dirs but not O.Common dir"
@echo "\"Partial\" build targets supported by Makefiles:"
@echo " inc.<arch> - Installs <arch> only header files."
@echo " build.<arch> - Builds and installs <arch> only."
@echo " install.<arch> - Builds and installs <arch> only."
@echo " clean.<arch> - Cleans <arch> binaries in O.<arch> dirs only."
@echo " uninstall.<arch> - Remove bin & lib directories for <arch> only."
@echo " host - Builds and installs $(EPICS_HOST_ARCH) only."
@echo " inc$(DIVIDER)<arch> - Installs <arch> only header files."
@echo " build$(DIVIDER)<arch> - Builds and installs <arch> only."
@echo " install$(DIVIDER)<arch> - Builds and installs <arch> only."
@echo " clean$(DIVIDER)<arch> - Cleans <arch> binaries in O.<arch> dirs only."
@echo " uninstall$(DIVIDER)<arch> - Remove bin & lib directories for <arch> only."
@echo "Targets supported by top level Makefile:"
@echo " archuninstall - Remove bin & lib directories created by this hostarch."
@echo " uninstall - Remove install directories created by this hostarch."

0
configure/Sample.Makefile Executable file → Normal file
View File

View File

@@ -71,6 +71,8 @@ CPPFLAGS += $(CROSS_CPPFLAGS) $(POSIX_CPPFLAGS)\
$(BASE_CPPFLAGS) $(TARGET_CPPFLAGS) $(USR_CPPFLAGS) $(ARCH_DEP_CPPFLAGS)\
$(OP_SYS_CPPFLAGS) $(OP_SYS_INCLUDE_CPPFLAGS) $(CODE_CPPFLAGS)
ECHO = @$(if $(findstring s,$(patsubst T_A=%,,$(MAKEFLAGS))),$(NOP),echo)
#--------------------------------------------------
# Although RTEMS uses gcc, it wants to use gcc its own way
CROSS_CPPFLAGS =

View File

@@ -20,8 +20,8 @@ OBJ = .o
LIB_PREFIX = lib
LIB_SUFFIX = .a
SHRLIB_SUFFIX_BASE = .so
SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE).$(SHRLIB_VERSION)
LOADABLE_SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE).$(LOADABLE_SHRLIB_VERSION)
SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE)$(addprefix .,$(SHRLIB_VERSION))
LOADABLE_SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE)$(addprefix .,$(LOADABLE_SHRLIB_VERSION))
LOADABLE_SHRLIB_PREFIX = lib
#-------------------------------------------------------
@@ -42,13 +42,14 @@ LIB_LIBS += $(SHRLIB_LIBS)
SHRLIB_DEPLIBS = $(foreach lib, $(LIB_LIBS) $(USR_LIBS), \
$(firstword $(wildcard \
$(addsuffix /$(SHRLIB_PREFIX)$(lib)*$(SHRLIB_SUFFIX_BASE)*, \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
$(addsuffix /$(DLLSTUB_PREFIX)$(lib)$(DLLSTUB_SUFFIX), \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
$(addsuffix /$(SHRLIB_PREFIX)$(lib)*$(SHRLIB_SUFFIX_BASE)*, \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
$(addsuffix /$(LIB_PREFIX)$(lib)$(LIB_SUFFIX), \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS))) \
$(addsuffix /$(BUILDLIB_PREFIX)$(lib)$(BUILDLIB_SUFFIX), $(INSTALL_LIB))))
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
) $(addsuffix /$(BUILDLIB_PREFIX)$(lib)$(BUILDLIB_SUFFIX), \
$(if $(filter $(lib),$(TESTLIBRARY)),.,$(INSTALL_LIB)))))
SHRLIB_LDLIBS = $(addprefix -l, $($*_LDLIBS) $(LIB_LIBS) $(USR_LIBS)) \
$(STATIC_LDLIBS) \
@@ -57,7 +58,7 @@ SHRLIB_LDLIBS = $(addprefix -l, $($*_LDLIBS) $(LIB_LIBS) $(USR_LIBS)) \
SHRLIB_DEPLIB_DIRS = $(foreach word, \
$(sort $(dir $($*_DEPLIBS) $(SHRLIB_DEPLIBS))), \
$(shell $(PERL) $(TOOLS)/fullPathName.pl $(word)))
$(shell $(FULLPATHNAME) $(word)))
SHRLIBDIR_LDFLAGS += $(SHRLIB_DEPLIB_DIRS:%=-L%)
@@ -66,13 +67,14 @@ SHRLIBDIR_LDFLAGS += $(SHRLIB_DEPLIB_DIRS:%=-L%)
PROD_DEPLIBS = $(foreach lib, $(PROD_LIBS) $(USR_LIBS), \
$(firstword $(wildcard \
$(addsuffix /$(SHRLIB_PREFIX)$(lib)*$(SHRLIB_SUFFIX_BASE)*, \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
$(addsuffix /$(DLLSTUB_PREFIX)$(lib)$(DLLSTUB_SUFFIX), \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
$(addsuffix /$(SHRLIB_PREFIX)$(lib)*$(SHRLIB_SUFFIX_BASE)*, \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
$(addsuffix /$(LIB_PREFIX)$(lib)$(LIB_SUFFIX), \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS))) \
$(addsuffix /$(BUILDLIB_PREFIX)$(lib)$(BUILDLIB_SUFFIX), $(INSTALL_LIB))))
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
) $(addsuffix /$(BUILDLIB_PREFIX)$(lib)$(BUILDLIB_SUFFIX), \
$(if $(filter $(lib),$(TESTLIBRARY)),.,$(INSTALL_LIB)))))
PROD_LDLIBS = $(addprefix -l, $($*_LDLIBS) $(PROD_LIBS) $(USR_LIBS)) \
$(STATIC_LDLIBS) \
@@ -85,7 +87,7 @@ PROD_LDLIBS += $($(firstword $(LDLIBS_STATIC_$(STATIC_BUILD)) \
PROD_DEPLIB_DIRS = $(foreach word, \
$(sort $(dir $($*_DEPLIBS) $(PROD_DEPLIBS))), \
$(shell $(PERL) $(TOOLS)/fullPathName.pl $(word)))
$(shell $(FULLPATHNAME) $(word)))
PRODDIR_LDFLAGS += $(PROD_DEPLIB_DIRS:%=-L%)

View File

@@ -61,7 +61,7 @@ SHRLIB_PREFIX =
SHRLIB_SUFFIX_BASE = .dll
SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE)
SHRLIBNAME_YES = $(BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX))
TESTSHRLIBNAME_YES = $(TESTBUILD_LIBRARY:%=%$(SHRLIB_SUFFIX))
TESTSHRLIBNAME_YES = $(TESTBUILD_LIBRARY:%=%$(SHRLIB_SUFFIX_BASE))
LOADABLE_SHRLIBNAME = $(LOADABLE_BUILD_LIBRARY:%=%$(LOADABLE_SHRLIB_SUFFIX))
#
@@ -74,6 +74,8 @@ LIB_PREFIX_YES = lib
LIB_SUFFIX_YES = .dll.a
LIB_PREFIX = $(LIB_PREFIX_$(SHARED_LIBRARIES))
LIB_SUFFIX = $(LIB_SUFFIX_$(SHARED_LIBRARIES))
DLLSTUB_PREFIX = lib
DLLSTUB_SUFFIX = .dll.a
DLLSTUB_LIBNAME_YES = $(BUILD_LIBRARY:%=$(LIB_PREFIX)%$(LIB_SUFFIX))
DLLSTUB_LIBNAME = $(DLLSTUB_LIBNAME_$(SHARED_LIBRARIES))

View File

@@ -0,0 +1,14 @@
# CONFIG.Common.cygwin-x86_64
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for cygwin-x86_64 target builds
# Sites may override these definitions in CONFIG_SITE.Common.cygwin-x86_64
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.Common.cygwin-x86
ARCH_DEP_CFLAGS = -m64
ARCH_DEP_LDFLAGS = -m64

View File

@@ -11,6 +11,8 @@
IOS_PLATFORM = iPhoneOS
OP_SYS_CFLAGS += -fno-inline-functions
OP_SYS_CFLAGS += -miphoneos-version-min=$(IOS_DEPLOYMENT_TARGET)
OP_SYS_LDFLAGS += -miphoneos-version-min=$(IOS_DEPLOYMENT_TARGET)
# iOS optimization flags for arm architecture
OPT_CFLAGS_YES = -O2

View File

@@ -10,6 +10,9 @@
IOS_PLATFORM = iPhoneSimulator
OP_SYS_CFLAGS += -mios-simulator-version-min=$(IOS_DEPLOYMENT_TARGET)
OP_SYS_LDFLAGS += -mios-simulator-version-min=$(IOS_DEPLOYMENT_TARGET)
#
# Architecture-specific information
#

View File

@@ -25,7 +25,7 @@ OS_CLASS = iOS
#--------------------------------------------------
# GNU and SDK directories
GNU_DIR = $(PLATFORM_DIR)/Developer/usr
SDK_DIR = $(PLATFORM_DIR)/Developer/SDKs/$(IOS_PLATFORM)$(IOS_VERSION).sdk
SDK_DIR = $(PLATFORM_DIR)/Developer/SDKs/$(IOS_PLATFORM).sdk
#-------------------------------------------------------
# Build architecture flags
@@ -40,7 +40,8 @@ ARCH_DEP_LDFLAGS += $(ARCH_DEP_FLAGS)
#--------------------------------------------------
# Operating system flags
OP_SYS_CFLAGS += -isysroot $(SDK_DIR) -D__IPHONE_OS_VERSION_MIN_REQUIRED=30200
OP_SYS_CFLAGS += -isysroot $(SDK_DIR)
OP_SYS_LDFLAGS += -isysroot $(SDK_DIR)
#--------------------------------------------------
# Always compile in debugging symbol table information
@@ -54,16 +55,19 @@ OPT_CXXFLAGS_YES += -g
CC_GNU = gcc
CCC_GNU = g++
CMPLR_CLASS_GNU = gcc
CC_LLVM = llvm-gcc
CCC_LLVM = llvm-g++
CMPLR_CLASS_LLVM = gcc
CC_LLVM_GNU = llvm-gcc
CCC_LLVM_GNU = llvm-g++
CMPLR_CLASS_LLVM_GNU = gcc
CC_CLANG = clang
CCC_CLANG = clang++
CMPLR_CLASS_CLANG = clang
CC = $(firstword $(wildcard $(GNU_BIN)/$(CC_$(COMPILER))) $(CC_$(COMPILER)))
CCC = $(firstword $(wildcard $(GNU_BIN)/$(CCC_$(COMPILER))) $(CCC_$(COMPILER)))
CMPLR_CLASS = $(CMPLR_CLASS_$(COMPLER))
CMPLR_CLASS = $(CMPLR_CLASS_$(COMPILER))
# Convert the iOS platform to lowercase for passing to xcrun's sdk parameter
XCRUN_SDK_BASE = $(shell echo $(IOS_PLATFORM) | tr A-Z a-z)
#-------------------------------------------------------
# Linker flags
@@ -74,7 +78,7 @@ OP_SYS_LDFLAGS += -dynamic -Z -L$(SDK_DIR)/usr/lib -L$(SDK_DIR)/usr/lib/system
# Shared libraries
SHRLIB_VERSION = $(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION)
SHRLIB_LDFLAGS = -dynamiclib -flat_namespace -undefined suppress \
-install_name $(shell $(PERL) $(TOOLS)/fullPathName.pl $(INSTALL_LIB))/$@ \
-install_name $(shell $(FULLPATHNAME) $(INSTALL_LIB))/$@ \
-compatibility_version $(EPICS_VERSION).$(EPICS_REVISION) \
-current_version $(SHRLIB_VERSION)
SHRLIB_SUFFIX_BASE = .dylib
@@ -103,3 +107,11 @@ HDEPENDS_METHOD = MKMF
# Allow site overrides
-include $(CONFIG)/os/CONFIG_SITE.Common.iosCommon
-include $(CONFIG)/os/CONFIG_SITE.$(EPICS_HOST_ARCH).iosCommon
#--------------------------------------------------
# Find the Xcode programs for the selected SDK
CC := $(shell xcrun -sdk $(XCRUN_SDK_BASE) -find $(CC_$(COMPILER)))
CCC := $(shell xcrun -sdk $(XCRUN_SDK_BASE) -find $(CCC_$(COMPILER)))
AR := $(shell xcrun -sdk $(XCRUN_SDK_BASE) -find ar) -rc
LD := $(shell xcrun -sdk $(XCRUN_SDK_BASE) -find ld) -r
RANLIB := $(shell xcrun -sdk $(XCRUN_SDK_BASE) -find ranlib)

View File

@@ -17,7 +17,7 @@ ifeq ($(BUILD_CLASS),CROSS)
# prefix of compiler tools
CMPLR_SUFFIX =
CMPLR_PREFIX = $(GNU_TARGET)-
CMPLR_PREFIX = $(addsuffix -,$(GNU_TARGET))
# Provide a link-time path for shared libraries
SHRLIBDIR_RPATH_LDFLAGS_YES += $(SHRLIB_DEPLIB_DIRS:%=-Wl,-rpath-link,%)

View File

@@ -12,17 +12,16 @@ include $(CONFIG)/os/CONFIG.Common.UnixCommon
OS_CLASS = Linux
CODE_CPPFLAGS = -D_REENTRANT
POSIX_CPPFLAGS = -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS -D_XOPEN_SOURCE=500
# Define _GNU_SOURCE and _DEFAULT_SOURCE for maximum portability
POSIX_CPPFLAGS = -D_GNU_SOURCE -D_DEFAULT_SOURCE
POSIX_LDLIBS = -lpthread
# -D_BSD_SOURCE for gethostname() in unistd.h as needed by cacChannelIO.cpp.
OP_SYS_CPPFLAGS += -D_BSD_SOURCE
OP_SYS_CPPFLAGS += -Dlinux
OP_SYS_LDLIBS += -lrt -ldl
# Use -rdynamic to maximize symbols available for stacktrace
OP_SYS_LDFLAGS += -rdynamic
# Added here for cross-target builds which include this file
# Linker flags for static & shared-library builds
STATIC_LDFLAGS_YES= -Wl,-Bstatic
STATIC_LDFLAGS_NO=
STATIC_LDLIBS_YES= -Wl,-Bdynamic

View File

@@ -20,12 +20,11 @@ COMPILER_LDFLAGS += -mt
SOLARIS_VERSION = $(subst 5.,,$(shell uname -r))
POSIX_CPPFLAGS += -D_POSIX_C_SOURCE=199506L $(POSIX_CPPFLAGS_$(SOLARIS_VERSION))
POSIX_CPPFLAGS += -D_XOPEN_SOURCE=500
POSIX_LDLIBS += -lposix4 -lpthread $(POSIX_LDLIBS_$(SOLARIS_VERSION))
POSIX_CFLAGS = -xc99 -D_POSIX_C_SOURCE=200112L
POSIX_LDLIBS += -lposix4 -lpthread
OP_SYS_CPPFLAGS += -DSOLARIS=$(SOLARIS_VERSION) $(COMPILER_CPPFLAGS)
OP_SYS_LDFLAGS += $(COMPILER_LDFLAGS)
OP_SYS_LDFLAGS += $(COMPILER_LDFLAGS)
# Set runtime path for shared libraries
SHRLIBDIR_RPATH_LDFLAGS_YES += $(SHRLIB_DEPLIB_DIRS:%=-R%)

View File

@@ -9,13 +9,15 @@
# Include definitions common to all solaris-sparc target archs
include $(CONFIG)/os/CONFIG.Common.solaris-sparc
# CONFIG.Common.solaris-sparc
COMPILER_CPPFLAGS = -D_REENTRANT
COMPILER_CPPFLAGS = -D_REENTRANT
POSIX_CFLAGS = -std=gnu99 -D_POSIX_C_SOURCE=200112L
STLPORT_LDLIBS_NO =
OP_SYS_LDLIBS_8 = -ldl
OP_SYS_LDLIBS_9 = -ldl
OP_SYS_LDLIBS_10 =
OP_SYS_LDLIBS_11 = -lc

View File

@@ -20,9 +20,8 @@ COMPILER_LDFLAGS += -mt
SOLARIS_VERSION = $(subst 5.,,$(shell uname -r))
POSIX_CPPFLAGS += -D_POSIX_C_SOURCE=199506L $(POSIX_CPPFLAGS_$(SOLARIS_VERSION))
POSIX_CPPFLAGS += -D_XOPEN_SOURCE=500
POSIX_LDLIBS += -lposix4 -lpthread $(POSIX_LDLIBS_$(SOLARIS_VERSION))
POSIX_CFLAGS = -xc99 -D_POSIX_C_SOURCE=200112L
POSIX_LDLIBS += -lposix4 -lpthread
OP_SYS_CPPFLAGS += -DSOLARIS=$(SOLARIS_VERSION) $(COMPILER_CPPFLAGS)
OP_SYS_LDFLAGS += $(COMPILER_LDFLAGS)
@@ -53,6 +52,7 @@ OP_SYS_LDLIBS += -lsocket -lnsl
OP_SYS_LDLIBS_8 += -ldl -lCrun -lc
OP_SYS_LDLIBS_9 += -ldl -lCrun -lc
OP_SYS_LDLIBS_10 += -lCrun -lc
OP_SYS_LDLIBS_11 += -lCrun -lc
OP_SYS_LDLIBS += $(OP_SYS_LDLIBS_$(SOLARIS_VERSION))
OP_SYS_LDLIBS += $(STLPORT_LDLIBS_$(USE_STLPORT))

View File

@@ -12,9 +12,12 @@ include $(CONFIG)/os/CONFIG.Common.solaris-x86
COMPILER_CPPFLAGS = -D_REENTRANT
POSIX_CFLAGS = -std=gnu99 -D_POSIX_C_SOURCE=200112L
STLPORT_LDLIBS_NO =
OP_SYS_LDLIBS_8 = -ldl -lc
OP_SYS_LDLIBS_9 = -ldl -lc
OP_SYS_LDLIBS_10 = -lc
OP_SYS_LDLIBS_11 = -lc

View File

@@ -11,14 +11,13 @@
include $(CONFIG)/os/CONFIG.Common.vxWorksCommon
# Vx GNU cross compiler suffix
CMPLR_SUFFIX = 386
CMPLR_SUFFIX = pentium
ARCH_CLASS = pc486
ARCH_CLASS = x86
ARCH_DEP_CPPFLAGS = -DCPU=I80486 -D_X86_
ARCH_DEP_CFLAGS = -m486
ARCH_DEP_CXXFLAGS += -x 'c++'
ARCH_DEP_CFLAGS += -fno-defer-pop
ARCH_DEP_CPPFLAGS = -DCPU=I80486 -D_X86_
ARCH_DEP_CFLAGS = -mtune=i486 -march=i486
ARCH_DEP_CFLAGS += -fno-zero-initialized-in-bss -fno-defer-pop
# Allow site overrides
-include $(CONFIG)/os/CONFIG_SITE.Common.vxWorks-486

View File

@@ -11,12 +11,14 @@
include $(CONFIG)/os/CONFIG.Common.vxWorksCommon
# Vx GNU cross compiler suffix
CMPLR_SUFFIX = 386
ARCH_CLASS = pcPentium
CMPLR_SUFFIX = pentium
ARCH_DEP_CPPFLAGS = -DCPU=PENTIUM -D_X86_
ARCH_DEP_CFLAGS = -mpentium
ARCH_DEP_CXXFLAGS += -x 'c++'
ARCH_DEP_CFLAGS += -fno-defer-pop
ARCH_CLASS = x86
ARCH_DEP_CPPFLAGS = -DCPU=PENTIUM -D_X86_
ARCH_DEP_CFLAGS = -mtune=pentium -march=pentium
ARCH_DEP_CFLAGS += -fno-zero-initialized-in-bss -fno-defer-pop
# Allow site overrides
-include $(CONFIG)/os/CONFIG_SITE.Common.vxWorks-pentium

View File

@@ -41,7 +41,9 @@ PROD_DEPLIBS = $(foreach lib,$(PROD_LIBS) $(USR_LIBS), \
$(firstword $(wildcard \
$(addsuffix /$(LIB_PREFIX)$(lib)$(LIB_SUFFIX), \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS))) \
$(addsuffix /$(LIB_PREFIX)$(lib)$(LIB_SUFFIX), $(INSTALL_LIB))))
$(addsuffix /$(LIB_PREFIX)$(lib)$(LIB_SUFFIX), \
$(if $(filter $(lib),$(TESTLIBRARY)),.,$(INSTALL_LIB)))))
PROD_LDLIBS = $(addprefix -l,$($*_LDLIBS) $(PROD_LIBS) $(USR_LIBS) \
$($*_SYS_LIBS) $(PROD_SYS_LIBS) $(USR_SYS_LIBS))

View File

@@ -12,6 +12,7 @@ include $(CONFIG)/os/CONFIG.Common.UnixCommon
OS_CLASS = WIN32
ARCH_CLASS = x86
POSIX = NO
# Definitions used when COMMANDLINE_LIBRARY is READLINE
LDLIBS_READLINE = -lreadline -lcurses
@@ -61,7 +62,7 @@ SHRLIB_PREFIX =
SHRLIB_SUFFIX_BASE = .dll
SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE)
SHRLIBNAME_YES = $(BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX))
TESTSHRLIBNAME_YES = $(TESTBUILD_LIBRARY:%=%$(SHRLIB_SUFFIX))
TESTSHRLIBNAME_YES = $(TESTBUILD_LIBRARY:%=%$(SHRLIB_SUFFIX_BASE))
LOADABLE_SHRLIB_PREFIX =
LOADABLE_SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE)
LOADABLE_SHRLIBNAME = $(LOADABLE_BUILD_LIBRARY:%=%$(LOADABLE_SHRLIB_SUFFIX))

View File

@@ -0,0 +1,15 @@
# CONFIG.Common.windows-x64-mingw
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for windows-x64-mingw target builds
# Sites may override these definitions in CONFIG_SITE.Common.windows-x64-mingw
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.Common.win32-x86-mingw
ARCH_CLASS = x64
ARCH_DEP_CFLAGS = -m64
ARCH_DEP_LDFLAGS = -m64

View File

@@ -13,6 +13,7 @@ MV = mv
RM = rm -f
MKDIR = mkdir
RMDIR = rm -rf
CAT = cat
# Allow site overrides
-include $(CONFIG)/os/CONFIG_SITE.UnixCommon.Common

View File

@@ -0,0 +1,10 @@
# CONFIG.cygwin-x86_64.Common
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for cygwin-x86_64 host archs
# Sites may override these definitions in CONFIG_SITE.cygwin-x86_64.Common
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.cygwin-x86.Common

View File

@@ -0,0 +1,11 @@
# CONFIG.cygwin-x86_64.cygwin-x86_64
#
# $Revision-Id$
#
# Definitions for cygwin-x86_64 host - cygwin-x86_64 target builds
# Sites may override these definitions in CONFIG_SITE.cygwin-x86_64.cygwin-x86_64
#-------------------------------------------------------
# Include common gnu compiler definitions
include $(CONFIG)/os/CONFIG.cygwin-x86.cygwin-x86

View File

@@ -59,19 +59,21 @@ COMMANDLINE_LIBRARY=READLINE
GNU_DIR = /usr
CC = $(GNU_BIN)/cc
CCC = $(GNU_BIN)/c++
# Apple soft-links these compilers to clang/clang++
CMPLR_CLASS = clang
CC = cc
CCC = c++
GNU = NO
#
# Darwin shared libraries
#
SHRLIB_VERSION = $(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION)
SHRLIB_LDFLAGS = -dynamiclib -flat_namespace -undefined suppress \
-install_name $(shell $(PERL) $(TOOLS)/fullPathName.pl $(INSTALL_LIB))/$@ \
-compatibility_version $(EPICS_VERSION).$(EPICS_REVISION) \
-current_version $(SHRLIB_VERSION)
-install_name $(shell $(FULLPATHNAME) $(INSTALL_LIB))/$@ \
$(addprefix -compatibility_version , $(SHRLIB_VERSION)) \
$(addprefix -current_version , $(SHRLIB_VERSION))
SHRLIB_SUFFIX_BASE = .dylib
SHRLIB_SUFFIX = .$(SHRLIB_VERSION)$(SHRLIB_SUFFIX_BASE)
SHRLIB_SUFFIX = $(addprefix ., $(SHRLIB_VERSION))$(SHRLIB_SUFFIX_BASE)
LOADABLE_SHRLIB_LDFLAGS = -bundle -flat_namespace -undefined suppress

View File

@@ -12,6 +12,8 @@ CMPLR_CLASS = solStudio
SPARCWORKS = /opt/SUNWspro
GNU = NO
# SPARCWORKS path is set in a CONFIG_SITE file
CC = $(SPARCWORKS)/bin/cc
CCC = $(SPARCWORKS)/bin/CC
CPP = $(CC) -E -Qn

View File

@@ -3,8 +3,8 @@
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for win32-x86-cygwin host archs
# Sites may override these definitions in CONFIG_SITE.win32-x86-cygwin.Common
# Definitions for win32-x86-mingw host archs
# Sites may override these definitions in CONFIG_SITE.win32-x86-mingw.Common
#-------------------------------------------------------
#Include definitions common to unix hosts
@@ -19,6 +19,7 @@ RM = $(PERL) -MExtUtils::Command -e rm_f
MKDIR = $(PERL) -MExtUtils::Command -e mkpath
RMDIR = $(PERL) -MExtUtils::Command -e rm_rf
NOP = $(PERL) -e ''
CAT = $(PERL) -MExtUtils::Command -e cat
WIND_HOST_TYPE = x86-win32
OSITHREAD_USE_DEFAULT_STACK = NO

View File

@@ -9,14 +9,15 @@
# Include common gnu compiler definitions
include $(CONFIG)/CONFIG.gnuCommon
# gcc, g++, ar, ld, and ranlib must be in user's path
CC = gcc
CCC = g++
AR = ar -rc
LD = ld -r
RANLIB = ranlib
RES=.coff
RCCMD = windres $(INCLUDES) $< $@
CMPLR_PREFIX =
CC = $(CMPLR_PREFIX)gcc
CCC = $(CMPLR_PREFIX)g++
AR = $(CMPLR_PREFIX)ar -rc
LD = $(CMPLR_PREFIX)ld -r
RANLIB = $(CMPLR_PREFIX)ranlib
RES = .coff
RCCMD = $(CMPLR_PREFIX)windres $(INCLUDES) $< $@
# No -fPIC avoids "-fPIC ignored for target (all code is position independent)"
SHRLIB_CFLAGS =
@@ -28,4 +29,4 @@ LOADABLE_SHRLIB_LDFLAGS = -shared \
# Override linking with gcc library from CONFIG.gnuCommon
GNU_LDLIBS_YES =
OP_SYS_LDLIBS = -lws2_32
OP_SYS_LDLIBS = -lws2_32

View File

@@ -0,0 +1,11 @@
# CONFIG.win32-x86-static.Common
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for win32-x86-static host archs
# Sites may override these definitions in CONFIG_SITE.win32-x86-static.Common
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.win32-x86.Common

View File

@@ -0,0 +1,13 @@
# CONFIG.win32-x86-static.win32-x86.static
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for win32-x86-static target archs when host arch is win32-x86-static
# Sites may override these definitions in CONFIG_SITE.win32-x86-static.win32-x86-static
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.win32-x86.win32-x86
SHARED_LIBRARIES = NO
STATIC_BUILD = YES

View File

@@ -16,6 +16,7 @@ RM = $(PERL) -MExtUtils::Command -e rm_f
MKDIR = $(PERL) -MExtUtils::Command -e mkpath
RMDIR = $(PERL) -MExtUtils::Command -e rm_rf
NOP = $(PERL) -e ''
CAT = $(PERL) -MExtUtils::Command -e cat
WIND_HOST_TYPE = x86-win32
OSITHREAD_USE_DEFAULT_STACK = NO

View File

@@ -15,17 +15,12 @@ CMPLR_CLASS = msvc
#-------------------------------------------------------
#
# "\ " forces gnu make to keep this as one token
#
WINLINK = link
RCCMD = rc -l 0x409 $(INCLUDES) -fo $@ $<
ARCMD = lib -nologo -verbose -out:$@ $(LIB_OPT_LDFLAGS) $(LIBRARY_LD_OBJS)
BAFCMD = bscmake -nologo -o $@
#
# Configure OS vendor C compiler
CC = cl
@@ -43,19 +38,13 @@ WARN_CFLAGS_NO = -W1
#
# -Ox maximum optimizations
# -MD use MSVCRT (run-time as DLL, multi-thread support)
# -GL whole program optimization
# -Zi generate program database for debugging information
OPT_CFLAGS_YES = -Ox -GL
# -Oy- re-enable creation of frame pointers
OPT_CFLAGS_YES = -Ox -GL -Oy-
#
# -Zi generate program database for debugging information
# -Z7 include debugging info in object files
# -Fr create source browser file
# -GZ catch bugs occurring only in optimized code
# -D_CRTDBG_MAP_ALLOC
# -RTCsu catch bugs occuring only inoptimized code
# -DEPICS_FREELIST_DEBUG good for detecting mem mrg bugs
OPT_CFLAGS_NO = -Zi -RTCsu
# specify object file name and location
@@ -81,23 +70,18 @@ STATIC_CFLAGS_NO= -MD$(VISC_CFLAGS_DEBUG) $(BUILD_DLL_CFLAGS) -DEPICS_CALL_DLL
# OS vendor c preprocessor
CPP = cl -C -E
#GNU c preprocessor
#CPP = gcc -x c -E
# Configure OS vendor C++ compiler
#
# __STDC__=0 is a real great idea of Jeff that gives us both:
# __STDC__=0 gives us both:
# 1) define STDC for code (pretend ANSI conformance)
# 2) set it to 0 to use MS C "extensions" (open for _open etc.)
# because MS uses: if __STDC__ ... disable many nice things
#
# Use of -Za would dissable DLL import/export keywords which
# include/excludes using architecture neutral macros
#
# -EHsc - generate code for exceptions
# -GR - generate code for run time type identification
#
CCC = cl -nologo -EHsc -GR
CCC = cl -EHsc -GR
CODE_CPPFLAGS += -nologo -D__STDC__=0
CODE_CPPFLAGS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
@@ -111,16 +95,12 @@ WARN_CXXFLAGS_NO = -W1
#
# -Ox maximum optimizations
# -GL whole program optimization
# -Zi generate program database for debugging information
OPT_CXXFLAGS_YES = -Ox -GL
# -Oy- re-enable creation of frame pointers
OPT_CXXFLAGS_YES = -Ox -GL -Oy-
#
# -Zi generate program database for debugging information
# -Z7 include debugging info in object files
# -Fr create source browser file
# -D_CRTDBG_MAP_ALLOC
# -RTCsu catch bugs occurring only in optimized code
# -DEPICS_FREELIST_DEBUG good for detecting mem mrg bugs
OPT_CXXFLAGS_NO = -RTCsu -Zi
# specify object file name and location
@@ -143,10 +123,13 @@ STATIC_LDLIBS_NO=
STATIC_LDFLAGS=
RANLIB=
#
# add -profile here to run the ms profiler
# -LTCG - whole program optimization
# -fixed:no good for programs such as purify and quantify
# -debug good for programs such as purify and quantify
# -LTCG whole program optimization
# -incremental:no full linking
# -fixed:no generate relocatable code
# -version:<major>.<minor> - only 2 components allowed, 0-65535 each
# -debug generate debugging info
LINK_OPT_FLAGS_YES = -LTCG -incremental:no -opt:ref \
-release $(PROD_VERSION:%=-version:%)
LINK_OPT_FLAGS_NO = -debug -incremental:no -fixed:no
@@ -166,8 +149,6 @@ WIN32=1
EXE=.exe
OBJ=.obj
RES=.res
BAF=.bsc
BOF=.sbr
# Problem: MS Visual C++ does not recognize *.cc as C++ source,
# so we do C++ compiles using the global flag -TP
@@ -177,16 +158,13 @@ COMPILER_CXXFLAGS = -TP
OP_SYS_CFLAGS =
OP_SYS_CXXFLAGS = $(COMPILER_CXXFLAGS)
#
# Files and flags needed to link DLLs (used in RULES_BUILD)
#
# Strange but seems to work without: WIN32_DLLFLAGS should contain
# an entry point:
# '-entry:_DllMainCRTStartup$(DLLENTRY)'
DLLENTRY = @12
WIN32_DLLFLAGS = -subsystem:windows -dll $(OPT_LDFLAGS) $(USR_LDFLAGS) $(TARGET_LDFLAGS) $(LIB_LDFLAGS)
WIN32_DLLFLAGS = -subsystem:windows -dll \
$(OPT_LDFLAGS) $(USR_LDFLAGS) $(TARGET_LDFLAGS) $(LIB_LDFLAGS)
#
# specify dll .def file only if it exists
#
DLL_DEF_FLAG = $(addprefix -def:,$(wildcard ../$(addsuffix .def,$*)))
@@ -197,9 +175,9 @@ DLL_DEF_FLAG = $(addprefix -def:,$(wildcard ../$(addsuffix .def,$*)))
# x.lib: what you link to progs that use the dll (DLLSTUB_LIBNAME)
# x.exp: what you need to build the dll (in no variable)
#
LINK.shrlib = $(WINLINK) -nologo $(WIN32_DLLFLAGS) -implib:$*.lib -out:$*.dll \
LINK.shrlib = $(WINLINK) -nologo $(WIN32_DLLFLAGS) -out:$@ \
-implib:$(@:%$(SHRLIB_SUFFIX)=%$(LIB_SUFFIX)) \
$(DLL_DEF_FLAG) $(LIBRARY_LD_OBJS) $(LIBRARY_LD_RESS) $(SHRLIB_LDLIBS)
#MUNCH_CMD = $(CCC) -Fo $@ $^
# adjust names of libraries to build
@@ -208,12 +186,13 @@ SHRLIB_SUFFIX_BASE = .dll
SHRLIB_SUFFIX = $(SHRLIB_SUFFIX_BASE)
SHRLIBNAME_YES = $(BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX))
LOADABLE_SHRLIBNAME = $(LOADABLE_BUILD_LIBRARY:%=%$(SHRLIB_SUFFIX))
TESTSHRLIBNAME_YES = $(TESTBUILD_LIBRARY:%=%$(SHRLIB_SUFFIX))
TESTSHRLIBNAME_YES = $(TESTBUILD_LIBRARY:%=%$(SHRLIB_SUFFIX_BASE))
#
# When SHARED_LIBRARIES is YES we are building a DLL link library
# and when SHARED_LIBRARIES is NO we are building an object library
#
DLLSTUB_SUFFIX = .lib
DLLSTUB_LIBNAME_YES = $(BUILD_LIBRARY:%=%.lib)
DLLSTUB_LIBNAME = $(DLLSTUB_LIBNAME_$(SHARED_LIBRARIES))
TESTDLLSTUB_LIBNAME_YES = $(TESTBUILD_LIBRARY:%=%.lib)
@@ -235,13 +214,15 @@ INSTALL_SHRLIB = $(INSTALL_BIN)
PROD_DEPLIBS = $(foreach lib, $(PROD_LIBS) $(USR_LIBS), \
$(firstword $(wildcard \
$(addsuffix /$(SHRLIB_PREFIX)$(lib)*$(SHRLIB_SUFFIX_BASE)*, \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
$(addsuffix /$(DLLSTUB_PREFIX)$(lib)$(DLLSTUB_SUFFIX), \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
$(addsuffix /$(SHRLIB_PREFIX)$(lib)*$(SHRLIB_SUFFIX_BASE)*, \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
$(addsuffix /$(LIB_PREFIX)$(lib)$(LIB_SUFFIX), \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS))) \
$(addsuffix /$(BUILDLIB_PREFIX)$(lib)$(BUILDLIB_SUFFIX), $(INSTALL_LIB))))
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
) $(addsuffix /$(BUILDLIB_PREFIX)$(lib)$(BUILDLIB_SUFFIX), \
$(if $(filter $(lib),$(TESTLIBRARY)),.,$(INSTALL_LIB)))))
PROD_LDLIBS += $($*_DEPLIBS) $(PROD_DEPLIBS)
PROD_LDLIBS += $(addsuffix .lib, \
@@ -261,13 +242,14 @@ PROD_LDLIBS += $(STATIC_LDLIBS) \
SHRLIB_DEPLIBS = $(foreach lib, $(LIB_LIBS) $(USR_LIBS), \
$(firstword $(wildcard \
$(addsuffix /$(SHRLIB_PREFIX)$(lib)*$(SHRLIB_SUFFIX_BASE)*, \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
$(addsuffix /$(DLLSTUB_PREFIX)$(lib)$(DLLSTUB_SUFFIX), \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
$(addsuffix /$(SHRLIB_PREFIX)$(lib)*$(SHRLIB_SUFFIX_BASE)*, \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
$(addsuffix /$(LIB_PREFIX)$(lib)$(LIB_SUFFIX), \
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS))) \
$(addsuffix /$(BUILDLIB_PREFIX)$(lib)$(BUILDLIB_SUFFIX), $(INSTALL_LIB))))
$($(lib)_DIR) $(SHRLIB_SEARCH_DIRS)) \
) $(addsuffix /$(BUILDLIB_PREFIX)$(lib)$(BUILDLIB_SUFFIX), \
$(if $(filter $(lib),$(TESTLIBRARY)),.,$(INSTALL_LIB)))))
SHRLIB_LDLIBS += $($*_DLL_DEPLIBS) $($*_DEPLIBS) $(SHRLIB_DEPLIBS)

View File

@@ -0,0 +1,14 @@
# CONFIG.win32-x86.win32-x86-static
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for win32-x86-static target archs when host arch is win32-x86
# Sites may override these definitions in CONFIG_SITE.win32-x86.win32-x86-static
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.win32-x86.win32-x86
BUILD_CLASS = HOST
SHARED_LIBRARIES = NO
STATIC_BUILD = YES

View File

@@ -10,19 +10,9 @@
-include $(CONFIG)/os/CONFIG.Common.win32-x86
-include $(CONFIG)/os/CONFIG.win32-x86.win32-x86
ARCH_DEP_CPPFLAGS += /favor:blend
#ARCH_DEP_CPPFLAGS += /Wp64
# /favor:blend both AMD64 and INTEL64
# /favor:AMD64
# /favor:INTEL64 (new value)
# /favor:EN64T (old value)
OPT_LDFLAGS += /MACHINE:X64
# /MACHINE:X64
# /MACHINE:IA64 (Itanium)
# /MACHINE:X86
#The following option does not work
#ARCH_DEP_CPPFLAGS += /env x64

View File

@@ -0,0 +1,11 @@
# CONFIG.windows-x64-mingw.Common
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for windows-x64-mingw host archs
# Sites may override these definitions in CONFIG_SITE.windows-x64-mingw.Common
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.win32-x86-mingw.Common

View File

@@ -0,0 +1,11 @@
# CONFIG.windows-x64-mingw.windows-x64-mingw
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for windows-x64-mingw target archs
# Sites may override these definitions in CONFIG_SITE.windows-x64-mingw.windows-x64-mingw
#-------------------------------------------------------
# Include common gnu compiler definitions
include $(CONFIG)/os/CONFIG.win32-x86-mingw.win32-x86-mingw

View File

@@ -0,0 +1,11 @@
# CONFIG.windows-x64-static.Common
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for windows-x64-static host archs
# Sites may override these definitions in CONFIG_SITE.windows-x64-static.Common
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.windows-x64.Common

View File

@@ -0,0 +1,13 @@
# CONFIG.windows-x64-static.windows-x64-static
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for windows-x64-static target archs when host arch is windows-x64-static
# Sites may override these definitions in CONFIG_SITE.windows-x64-static.windows-x64-static
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.windows-x64.windows-x64
SHARED_LIBRARIES = NO
STATIC_BUILD= YES

View File

@@ -9,14 +9,6 @@
-include $(CONFIG)/os/CONFIG.win32-x86.win32-x86
ARCH_DEP_CPPFLAGS += /favor:blend
#ARCH_DEP_CPPFLAGS += /Wp64
# /favor:blend both AMD64 and INTEL64
# /favor:AMD64
# /favor:INTEL64 (new value)
# /favor:EN64T (old value)
OPT_LDFLAGS += /MACHINE:X64
# /MACHINE:X64

View File

@@ -0,0 +1,12 @@
# CONFIG.windows-x64.windows-x64-debug
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for windows-x64 compiler host - windows-x64 debug compiler target builds
# Sites may override these definitions in CONFIG_SITE.windows-x64.windows-x64-debug
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.windows-x64.windows-x64
HOST_OPT=NO

View File

@@ -0,0 +1,14 @@
# CONFIG.windows-x86.windows-x86-static
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Definitions for windows-x64-static target archs when host arch is windows-x64
# Sites may override these definitions in CONFIG_SITE.windows-x64.windows-x64-static
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.windows-x64.windows-x64
BUILD_CLASS = HOST
SHARED_LIBRARIES = NO
STATIC_BUILD = YES

View File

@@ -5,21 +5,22 @@
# Where to find RTEMS
#
RTEMS_VERSION=4.9.2
RTEMS_BASE=/usr/local/rtems/rtems-$(RTEMS_VERSION)
RTEMS_VERSION = 4.10.2
RTEMS_BASE = /usr/local/rtems/rtems-$(RTEMS_VERSION)
# Cross-compile toolchain in $(RTEMS_TOOLS)/bin
#
RTEMS_TOOLS=$(RTEMS_BASE)
RTEMS_TOOLS = $(RTEMS_BASE)
# If you're using neither BOOTP/DHCP nor FLASH to pick up your IOC
# network configuration you must uncomment and specify your Internet
# network configuration you must uncomment and specify your Internet
# Domain Name here
#
#OP_SYS_CFLAGS += -DRTEMS_NETWORK_CONFIG_DNS_DOMAINNAME=<domainname>
#
# Specify your desired command-line-input library
# Select the command-line-input library to use
#
COMMANDLINE_LIBRARY = EPICS
#COMMANDLINE_LIBRARY = LIBTECLA
#COMMANDLINE_LIBRARY = READLINE

View File

@@ -3,11 +3,6 @@
# $Revision-Id$
#
# Site Specific definitions for cygwin-x86 target
# Only the local epics system manager should modify this file
# Currently the Cygwin build only works without shared libraries.
SHARED_LIBRARIES = NO
STATIC_BUILD = YES
# Depending on your version of Cygwin you'll want one of the following
# lines to enable command-line editing and history in iocsh. If you're
@@ -23,4 +18,3 @@ COMMANDLINE_LIBRARY = READLINE_NCURSESW
# No other libraries needed
#COMMANDLINE_LIBRARY = READLINE

View File

@@ -0,0 +1,14 @@
# CONFIG_SITE.Common.cygwin-x86_64
#
# $Revision-Id$
#
# Site Specific definitions for cygwin-x86_64 target
# Only the local epics system manager should modify this file
# If readline is installed uncomment the following line
# to add command-line editing and history support
#COMMANDLINE_LIBRARY = READLINE
# Uncomment the following line if readline has problems
#LDLIBS_READLINE = -lreadline -lcurses

View File

@@ -7,16 +7,33 @@
#-------------------------------------------------------
# Select which CPU architecture(s) to include in your MacOS binaries:
# i386
# x86_64 - Needs MacOS 10.4 with the Universal SDK, or 10.5 and later
# i386, x86_64, or both (fat binaries).
ARCH_CLASS = i386
#ARCH_CLASS = x86_64
#ARCH_CLASS = i386
ARCH_CLASS = x86_64
#ARCH_CLASS = i386 x86_64
# Uncomment the followings lines to build with CLANG instead of GCC.
#
#GNU = NO
#CMPLR_CLASS = clang
#CC = clang
#CCC = clang++
# Uncomment the following 3 lines to build with Apple's GCC instead of CLANG.
#
#CMPLR_CLASS = gcc
#CC = gcc
#CCC = g++
#GNU = YES
# To use MacPorts GCC uncomment (and modify if necessary) the following:
#GNU_DIR = /opt/local
#CMPLR_CLASS = gcc
#CC = $(GNU_BIN)/gcc -m64
#CCC = $(GNU_BIN)/g++ -m64
#GNU = YES
# If you see this or similar errors while building in the src/cap5 directory
# gcc: error: unrecognized option '-no-cpp-precomp'
# the problem is due to the ccflags configuration that your version of Perl
# was built with. You can replace the Cap5_CFLAGS setting in the Makefile
# with a hand-edited set of flags for building that Perl library, or ignore
# this problem if you don't need to use Channel Access from Perl.

View File

@@ -1,21 +1,31 @@
# CONFIG_SITE.Common.ios-arm
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Site-specific settings for ios-arm target builds
#-------------------------------------------------------
# Which ARM instruction set(s) to generate code for:
# Most iOS devices can run programs compiled for both the
# ARMv6 and ARMv7 instruction sets. ARMv7 code is usually
# more efficient, but the older devices listed below can only
# use the ARMv6 instruction set. Including both architectures
# generates a Universal binary, which is larger and takes
# longer to compile but runs efficiently on all devices.
# Most iOS devices can run programs compiled for older
# instruction sets, although the newer instructions are
# more efficient.
#
# ARMv6-only devices: iPhone 1 or 3G, iPod Touch Gen 1 or 2
# Apple's compilers can build for multiple architectures,
# generating a Universal binary. This is larger and takes
# longer to compile, but runs efficiently on all devices.
#
ARCH_CLASS = armv7
# Xcode 4.5 dropped support for the ARMv6.
#
# ARMv8 (arm64) devices: iPhone 5S
# ARMv7s devices: iPhone 5 and 5C, iPad Gen 4
# ARMv7 devices: iPhone 3GS, 4 and 4S, iPod Touch Gen 3 to 5
# iPad Gen 1 to 3, iPad Mini, Apple TV Gen 2 and 3
# ARMv6 devices: iPhone 1 and 3G, iPod Touch Gen 1 and 2
#ARCH_CLASS = arm64
#ARCH_CLASS = armv7s arm64
ARCH_CLASS = armv7 armv7s arm64
#ARCH_CLASS = armv7 armv7s
#ARCH_CLASS = armv7
#ARCH_CLASS = armv6 armv7
#ARCH_CLASS = armv6

View File

@@ -1,27 +1,28 @@
# CONFIG_SITE.Common.iosCommon
#
# $Revision-Id$
# This file is maintained by the build community.
#
# Site-specific settings for Apple iOS builds
#-------------------------------------------------------
# iOS Version number
# Minimum version of iOS the executables must run on.
# Earlier versions may work, if XCode supports them.
#IOS_VERSION = 3.2
#IOS_VERSION = 4.1
#IOS_VERSION = 4.2
#IOS_VERSION = 4.3
IOS_VERSION = 5.0
#IOS_DEPLOYMENT_TARGET = 5.0
#IOS_DEPLOYMENT_TARGET = 5.1
#IOS_DEPLOYMENT_TARGET = 6.0
#IOS_DEPLOYMENT_TARGET = 6.1
IOS_DEPLOYMENT_TARGET = 7.0
#IOS_DEPLOYMENT_TARGET = 8.0
# Which compiler to use:
# CLANG is preferred for recent versions of Xcode
# LLVM uses the llvm-gcc and llvm-g++ compilers
# CLANG is required for Xcode 5.0 and later
# LLVM_GNU uses the llvm-gcc and llvm-g++ compilers
# GNU is needed for older versions of Xcode
COMPILER = CLANG
#COMPILER = LLVM
#COMPILER = LLVM_GNU
#COMPILER = GNU

View File

@@ -46,6 +46,7 @@ COMMANDLINE_LIBRARY = READLINE
# This does cost disk space, but not memory as debug symbols are not
# loaded into RAM when the binary is loaded.
OPT_CFLAGS_YES += -g
OPT_CXXFLAGS_YES += -g
# Tune GNU compiler output for a specific cpu-type

View File

@@ -46,3 +46,4 @@ COMMANDLINE_LIBRARY = READLINE
# This does cost disk space, but not memory as debug symbols are not
# loaded into RAM when the binary is loaded.
OPT_CFLAGS_YES += -g
OPT_CXXFLAGS_YES += -g

View File

@@ -5,11 +5,12 @@
# Site Specific definitions for solaris-sparc target
# Only the local epics system manager should modify this file
# If readline is installed uncomment the following macro definition
# to include command-line editing and history support
#
# location of the Solaris Studio (was SunPro) compilers
SPARCWORKS = /opt/SUNWspro
#SPARCWORKS = /opt/solarisstudio12.3
# Readline library provides command-line editing and history in IOC shell
# If readline is installed, uncomment the following macro definition
# to use it for command-line editing and history support
#COMMANDLINE_LIBRARY = READLINE
# Use stLport library instead of default Cstd library

View File

@@ -0,0 +1,11 @@
# CONFIG_SITE.Common.solaris-x86
#
# $Revision-Id$
#
# Site Specific definitions for solaris-x86 targets
# Only the local epics system manager should modify this file
# location of the Solaris Studio (was SunPro) compilers
SPARCWORKS = /opt/SUNWspro
#SPARCWORKS = /opt/solarisstudio12.3

View File

@@ -5,7 +5,7 @@
# Site Specific definitions for solaris-x86_64 target
# Only the local epics system manager should modify this file
# Include definitions common to all solaris-x86_64 target archs
# Include definitions common to all solaris-x86 target archs
-include $(CONFIG)/os/CONFIG_SITE.Common.solaris-x86
COMMANDLINE_LIBRARY = EPICS

View File

@@ -0,0 +1,11 @@
# CONFIG_SITE.Common.windows-x64-static
#
# $Revision-Id$
#
# Site Specific definitions for windows-x64-static target
# Only the local epics system manager should modify this file
# 64-bit Visual Studio 2010 builds fail when built optimized.
# If you are using a newer version you can try removing this:
HOST_OPT = NO

View File

@@ -4,7 +4,4 @@
#
# Site specific override definitions for solaris-sparc host builds
# Only the local epics system manager should modify this file
#INSTALL_LOCATION = /home/phoebus/JBA/testBaseNew
#CROSS_COMPILER_TARGET_ARCHS += vxWorks-ppc604 vxWorks-ppc603 vxWorks-68040

View File

@@ -0,0 +1,9 @@
# CONFIG_SITE.windows-x64-mingw.windows-x64-mingw
#
# $Revision-Id$
#
# Site Specific definitions for windows-x64-mingw target
# Only the local epics system manager should modify this file
# Prefix for mingw compiler from cygwin
#CMPLR_PREFIX = x86_64-w64-mingw32-

View File

@@ -4,26 +4,27 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Known Problems in R3.15.0.1</title>
<title>Known Problems in R3.15.1</title>
</head>
<body>
<h1 style="text-align: center">EPICS Base R3.15.0.1: Known Problems</h1>
<h1 style="text-align: center">EPICS Base R3.15.1: Known Problems</h1>
<p>Any patch files linked below should be applied at the root of the
base-3.15.0.1 tree. Download them, then use the GNU Patch program as
base-3.15.1 tree. Download them, then use the GNU Patch program as
follows:</p>
<blockquote><pre>% <b>cd <i>/path/to/</i>base-3.15.0.1</b>
<blockquote><pre>% <b>cd <i>/path/to/</i>base-3.15.1</b>
% <b>patch -p0 &lt; <i>/path/to/</i>file.patch</b></pre></blockquote>
<p>The following significant problems have been reported with this
version of EPICS Base:</p>
<ul>
<li>64-bit Windows builds may not work with some tool-sets, the code in
<tt>src/legacy/gdd</tt> is not comptible with the LLP64 model that Windows
uses for its 64-bit ABI.</li>
<li>64-bit Windows builds of the CAS library may not work with some compilers.
The code in <tt>src/legacy/gdd</tt> is currently incompatible with the LLP64
model that Windows uses for its 64-bit ABI.</li>
</ul>

View File

@@ -1,25 +1,24 @@
Installation Instructions
EPICS Base Release 3.15.0.1
EPICS Base Release 3.15.1
--------------------------------------------------------------------------
Table of Contents
* What is EPICS base?
* What is new in this release?
* Copyright
* Supported platforms
* Supported compilers
* Software requirements
* Host system storage requirements
* Documentation
* WWW pages
* Directory Structure
* Build related components
* Building EPICS base (Unix and Win32)
* Example application and extension
* Multiple host platforms
* What is EPICS base?
* What is new in this release?
* Copyright
* Supported platforms
* Supported compilers
* Software requirements
* Host system storage requirements
* Documentation
* Directory Structure
* Build related components
* Building EPICS base (Unix and Win32)
* Example application and extension
* Multiple host platforms
--------------------------------------------------------------------------
@@ -198,7 +197,6 @@
RULES_DIRS Definitions and rules for building subdirectories
RULES_EXPAND
RULES_FILE_TYPE
RULES_JAVA Definitions and rules for java jars and classes
RULES_TARGET
RULES_TOP Rules specific to a <top> dir (uninstall and tar)
Sample.Makefile Sample makefile with comments

View File

@@ -9,7 +9,7 @@
<BODY>
<CENTER>
<H1>Installation Instructions</H1>
<H2>EPICS Base Release 3.15.0.1</H2><BR>
<H2>EPICS Base Release 3.15.1</H2><BR>
</CENTER>
<HR>
<H3> Table of Contents</H3>
@@ -22,7 +22,6 @@
<LI><A HREF="#0_0_6"> Software requirements</A></LI>
<LI><A HREF="#0_0_7"> Host system storage requirements</A></LI>
<LI><A HREF="#0_0_8"> Documentation</A></LI>
<LI><A HREF="#0_0_9"> WWW pages</A></LI>
<LI><A HREF="#0_0_10"> Directory Structure</A></LI>
<LI><A HREF="#0_0_11"> Build related components</A></LI>
<LI><A HREF="#0_0_12"> Building EPICS base (Unix and Win32)</A></LI>
@@ -209,7 +208,6 @@
RULES_DIRS Definitions and rules for building subdirectories
RULES_EXPAND
RULES_FILE_TYPE
RULES_JAVA Definitions and rules for java jars and classes
RULES_TARGET
RULES_TOP Rules specific to a &lt;top&gt; dir (uninstall and tar)
Sample.Makefile Sample makefile with comments

View File

@@ -3,17 +3,552 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>EPICS Base R3.15.0.1 Release Notes</title>
<title>EPICS Base R3.15.1 Release Notes</title>
</head>
<body lang="en">
<h1 align="center">EPICS Base Release 3.15.0.1</h1>
<h1 align="center">EPICS Base Release 3.15.1</h1>
<h2 align="center">Changes between 3.15.0.2 and 3.15.1</h2>
<h3>epicsStrnEscapedFromRaw() and epicsStrnRawFromEscaped()</h3>
<p>These routines have been rewritten; the previous implementations did not
always behave exactly as specified.</p>
<h3>Shared Library Versions</h3>
<p>On architectures that can support it, the shared library version number for
libraries provided with Base has had the third component of the EPICS version
number added to it, thus libCom.so.3.15.1 instead of libCom.so.3.15. Windows
can only support two components to its internal product version number, and the
Darwin bug that external shared libraries were being built using the EPICS
version number has been fixed.</p>
<h3>Hooking into dbLoadRecords</h3>
<p>A function pointer hook has been added to the dbLoadRecords() routine, to
allow external modules such as autosave to be notified when new records have
been loaded during IOC initialization. The hook is called dbLoadRecordsHook and
follows the model of the recGblAlarmHook pointer in that modules that wish to
use it must save the current value of the pointer before installing their own
function pointer, and must call the original function from their own
routine.</p>
<p>The hook is activiated from the dbLoadRecords() routine and gets called only
after a database instance file has been read in without error. Note that the
dbLoadTemplates() routine directly calls dbLoadRecords() so this hook also
provides information about instantiated database templates. It is still possible
to load record instances using dbLoadDatabase() though, and doing this will not
result in the hook routines being called.</p>
<p>Code to use this hook should look something like this:</p>
<blockquote><pre>
#include "dbAccessDefs.h"
static DB_LOAD_RECORDS_HOOK_ROUTINE previousHook;
static void myRoutine(const char* file, const char* subs) {
if (previousHook)
previousHook(file, subs);
/* Do whatever ... */
}
void myInit(void) {
static int done = 0;
if (!done) {
previousHook = dbLoadRecordsHook;
dbLoadRecordsHook = myRoutine;
done = 1;
}
}
</pre></blockquote>
<p>As with many other parts of the static database access library there is no
mutex to protect the function pointer. Initialization is expected to take place
in the context of the IOC's main thread, from either a static C++ constructor or
an EPICS registrar routine.</p>
<h2 align="center">Changes between 3.15.0.1 and 3.15.0.2</h2>
<h3>New iocshLoad command</h3>
<p>A new command <tt>iocshLoad</tt> has been added to iocsh which executes a
named iocsh script and can also set one or more shell macro variables at the
same time, the values of which will be forgotten immediately after the named
script finishes executing. The following example shows the syntax:</p>
<blockquote><pre>
iocshLoad "serial.cmd", "DEV=/dev/ttyS0,PORT=com1,TYPE=RS485"
iocshLoad "radmon.cmd", "PORT=com1,ADDR=0"
</pre></blockquote>
<h3>Support routines for 64-bit integers</h3>
<p>The libCom library now provides support for 64-bit integer types on all
supported architectures. The epicsTypes.h header file defines epicsInt64 and
epicsUInt64 type definitions for both C and C++ code. The epicsStdlib.h header
also declares the following for parsing strings into the relevent sized integer
variables: Functions epicsParseLLong(), epicsParseULLong() with related macros
epicsScanLLong() and epicsScanULLong(), and the functions epicsParseInt64()
and epicsParseUInt64(). Use the first two functions and the macros for long long
and unsigned long long integer types, and the last two functions for the
epicsInt64 and epicsUInt64 types. Note that the latter can map to the types long
and unsigned long on some 64-bit architectures such as linux-x86_64, not to the
two long long types.</p>
<p>This version does not provide the ability to define 64-bit record fields, the
use of the 64-bit types in the IOC database will come in a later release of
EPICS Base.</p>
<h3>Full support for loadable support modules</h3>
<p>Apparently later versions of Base 3.14 permitted support modules to be loaded
from a shared library at runtime without the IOC having been linked against that
shared library; the registerRecordDeviceDriver.pl program would accept a partial
DBD file containing just the entries needed for the library and generate the
appropriate registration code. In 3.15 however the registerRecordDeviceDriver.pl
program was replaced by one using the new DBD file parser, and in this a device
support entry would only be accepted after first loading the record type that it
depended on.</p>
<p>The parser has been modified to accept device entries without having seen the
record type first, although a warning is given when that happens. To remove the
warning the DBD file can provide a record type declaration instead (no fields
can be defined, so the braces must be empty), before the device() entry. The
result will generate the correct registration code for the device entry without
including anything for any merely declared record types. The generated code can
be linked into a shared library and loaded by an IOC at runtime using dlload.
</p>
<h3>Parallel callback threads</h3>
<p>The general purpose callback facility can run multiple parallel callback
threads per priority level. This makes better use of SMP architectures (e.g.
processors with multiple cores), as callback work - which includes second
stage processing of records with asynchronuous device support and I/O
scanned processing - can be distributed over the available CPUs.</p>
<p>Note that by using parallel callback threads the order of scan callback
requests in the queue is not retained. If a device support needs to be
informed when scanIoRequest processing has finished, it should use the new
scanIoSetComplete() feature to add a user function that will be called after
the scanIoRequest record processing has finished.</p>
<p>Parallel callback threads have to be explicitly configured, by default
the IOC keeps the old behavior of running one callback thread per priority.</p>
<h3>Merge MMIO API from devLib2</h3>
<p>Added calls to handle 8, 16, and 32 bit Memory Mapped I/O reads and writes.
The calls added include <tt><i>X</i>_iowrite<i>Y</i>()</tt> and
<tt><i>X</i>_ioread<i>Y</i>()</tt>
where <tt><i>X</i></tt> is <tt>nat</tt> (native), <tt>be</tt> or <tt>le</tt>,
and <tt><i>Y</i></tt> is <tt>16</tt> or <tt>32</tt>.
Also added are <tt>ioread8()</tt> and <tt>iowrite8()</tt>.</p>
<h3>Added optional dbServer API to database</h3>
<p>A server layer that sits on top of the IOC database may now register itself
as such by calling <tt>dbRegisterServer()</tt> and providing optional routines
that other components can use. The initial purpose of this API allows the Trace
Processing implementation in <tt>dbProcess()</tt> to identify a client that
causes a record to process when TPRO is set.</p>
<p>To support the client idenfication, the server provides a routine that
returns that identity string when called by one of its own processing
threads.</p>
<h3>Concatenated database definition files</h3>
<p>A series of database definition (dbd) files can now be concatenated during
the build process into a newly-created dbd file with result being installed into
$(INSTALL_LOCATION)/dbd without expanding it.</p>
<p>The following lines in an EPICS Makefile will create a file name.dbd in the
O.Common build directory containing the contents of file1.dbd followed by
file2.dbd then file3.dbd. The new file will then be installed into
$(INSTALL_LOCATION)/dbd without expanding any of its include statements.</p>
<blockquote><pre>
DBDCAT += name.dbd
name_DBD += file1.dbd file2.dbd file3.dbd
</pre></blockquote>
<p>The source files file1.dbd, file2.dbd and file3.dbd may be created by the
current Makefile, be located in the parent directory or any other directory in
the SRC_DIRS list, be specified by their full pathname, exist in the install dbd
directory, or be found in any dbd directory linked from the application's
RELEASE files.</p>
<h3>Posix: Drop SCHED_FIFO before exec() in child process</h3>
<p>If Base is compiled with <tt>USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES</tt>
in configure/CONFIG_SITE or related files, the Posix implementation of the
libCom <tt>osiSpawnDetachedProcess()</tt> routine will switch the child process
to use the normal SCHED_OTHER (non real-time) scheduler before executing the
named executable program. If it needs to use the real-time scheduler the new
program can request that for itself.</p>
<h3>Posix: Lock all memory when running with FIFO scheduler</h3>
<p>On Posix systems, an IOC application's ability to meet timing deadlines is
often dependent on its ability to lock part or all of the process's virtual
address space into RAM, preventing that memory from being paged to the swap
area. This change will attempt to lock the process's virtual address space into
RAM if the process has the ability to run threads with different priorities. If
unsuccessful, it prints an message to stderr and continues.</p>
<p>On Linux, one can grant a process the ability to run threads with different
priorities by using the command <code>ulimit -r unlimited</code>. To use the
FIFO scheduler for an IOC, use a command like this:</p>
<blockquote><pre>chrt -f 1 softIoc -d test.db</pre></blockquote>
<p>On Linux, one can grant a process the ability to lock itself into memory
using the command <code>ulimit -l unlimited</code>. These limits can also be
configured on a per user/per group basis by changing /etc/security/limits.conf
or its equivalent.</p>
<p>A child process created via fork() normally inherits its parent's resource
limits, so a child of a real-time soft-IOC will get its parent's real-time
priority and memlock limits. The memory locks themselves however are not
inherited by child processes.</p>
<h3>Implement EPICS_CAS_INTF_ADDR_LIST in rsrv</h3>
<p>The IOC server can now bind to a single IP address (and optional port number)
read from the standard environment parameter EPICS_CAS_INTF_ADDR_LIST.
Additional addresses included in that parameter after the first will be ignored
and a warning message displayed at iocInit time.</p>
<h3>alarmString.h deprecated again</h3>
<p>The string arrays that provide string versions of the alarm status and
severity values have been moved into libCom and the header file that used to
instanciate them is no longer required, although a copy is still provided for
backwards compatibility reasons. Only the alarm.h header needs to be included
now to declare the epicsAlarmSeverityStrings and epicsAlarmConditionStrings
arrays.</p>
<h3>General purpose thread pool</h3>
<p>
EPICS Base 3.15.0.x releases are not intended for use in production systems.</p>
A general purpose threaded work queue API epicsThreadPool is added.
Multiple pools can be created with controlable priority and number
of worker threads. Lazy worker startup is supported.</p>
<h3>Database field setting updates</h3>
<p>A database (.db) file loaded by an IOC does not have to repeat the record
type of a record that has already been loaded. It may replace the first
parameter of the <tt>record(type, name)</tt> statement with an asterisk
character inside double-quotes, <tt>"*"</tt> instead. Thus the following is a
legal database file:</p>
<blockquote><pre>record(ao, "ao1") {}
record("*", "ao1") {
field(VAL, 10)
}</pre></blockquote>
<p>Note that database configuration tools will not be expected to have to
understand this syntax, which is provided for scripted and hand-coded database
and template instantiation only. Setting the IOC's <tt>dbRecordsOnceOnly</tt>
flag also makes this syntax illegal, since its purpose is to prevent
multiply-defined records from being collapsed into a single instance.</p>
<h3>Added echo command to iocsh</h3>
<p>The single argument string may contain escaped characters, which will be
translated to their raw form before being printed (enclose the string in quotes
to avoid double-translation). A newline is always appended to the output, and
output stream redirection is supported.</p>
<h3>Added macro EPICS_UNUSED to compilerDependencies.h</h3>
<p>To prevent the compiler from warning about a known-unused variable, mark it
with the macro EPICS_UNUSED. On gcc and clang this will expand to
<tt>__attribute__((unused))</tt> to prevent the warning.</p>
<h3>User specified db substitution file suffix</h3>
<p>Per Dirk Zimoch's suggestion, a user specified db substitution file suffix is
now allowed by setting the variable SUBST_SUFFIX in a configuration directory
CONFIG_SITE file or in a Makefile before the include $(TOP)/configure/RULES
line. The default for SUBST_SUFFIX is <tt>.substitutions</tt></p>
<h3>NTP Time Provider adjusts to OS tick rate changes</h3>
<p>Dirk Zimoch provided code that allows the NTP Time provider (used on VxWorks
and RTEMS only) to adapt to changes in the OS clock tick rate after the provider
has been initialized. Note that changing the tick rate after iocInit() is not
advisable, and that other software might still misbehave if initialized before
an OS tick rate change.</p>
<h3>Added newEpicsMutex macro</h3>
<p>Internal C++ uses of <tt>new epicsMutex()</tt> have been replaced with a new
macro which calls a new constructor, passing it the file name and line number of
the mutex creation code. C code that creates mutexes has been using a similar
macro for a long time, but there was no equivalent constructor for the C++
wrapper class, so identifying a specific mutex was much harder to do.</p>
<h3>Post DBE_PROPERTY events automatically</h3>
<p>A new record field attribute "prop(YES)" has been added to identify fields
holding meta-data. External changes to these fields will cause a CA monitor
event to be sent to all record subscribers who have asked for DBE_PROPERTY
updates. Meta-data fields have been marked for all Base record types.</p>
<h3>errlogRemoveListener() routine changed</h3>
<p>Code that calls <tt>errlogRemoveListener(myfunc)</tt> must be modified to use
the new, safer routine <tt>errlogRemoveListeners(myfunc, &amp;pvt)</tt> instead.
The replacement routine takes a second argument which must be the same private
pointer that was passed to <tt>errlogAddListener()</tt> when adding that
listener. It also deletes all matching listeners (hence the new plural name) and
returns how many were actually deleted, whereas the previous routine only
removed the first listener that matched.</p>
<h3>Simplified generation of .dbd files</h3>
<p>The Perl script <tt>makeIncludeDbd.pl</tt> has been removed and the rules
that created an intermediate <tt><i>xxx</i>Include.dbd</tt> file from the
Makefile variable <tt>xxx_DBD</tt> have been modified to generate the target
<tt><i>xxx</i>.dbd</tt> file directly. This should simplify applications that
might have had to provide dependency rules for the intermediate files in 3.15.
Applications which provide their own <tt><i>xxx</i>Include.dbd</tt> source file
will continue to have it expanded as before.</p>
<h3>New Undefined Severity field UDFS</h3>
<p>A new field has been added to dbCommon which configures the alarm severity
associated with the record being undefined (when UDF=TRUE). The default value is
INVALID so old databases will not be affected, but now individual records can be
configured to have a lower severity or even no alarm when undefined. Be careful
when changing this on applications where the IVOA field of output records is
used, IVOA still requires an INVALID severity to trigger value replacement.</p>
<h3>New build target <q>tapfiles</q></h3>
<p>This new make target runs the same tests as the <q>runtests</q> target, but
instead of summarizing or displaying the output for each test script it creates
a <q>.tap</q> file inside the architecture build directory which contains the
detailed test output. The output file can be parsed by continuous integration
packages such as <a href="http://www.jenkins-ci.org/">Jenkins</a> to show the
test results.</p>
<h3>Array field double-buffering</h3>
<p>Array data can now be moved, without copying, into and out of the VAL field
of the waveform, aai, and aao record types by replacing the pointer in BPTR.
The basic rules which device support must follow are:</p>
<ol>
<li>BPTR, and the memory it is currently pointing to, can only be accessed
while the record is locked.</li>
<li>NELM may not be changed; NORD should be updated whenever the number of
valid data elements changes.</li>
<li>When BPTR is replaced it must always point to a block of memory large
enough to hold the maximum number of elements, as given by the NELM and
FTVL fields.</li>
</ol>
<h3>Spin-locks API added</h3>
<p>The new header file epicsSpin.h adds a portable spin-locks API which is
intended for locking very short sections of code (typically one or two lines of
C or C++) to provide a critical section that protects against race conditions.
On Posix platforms this uses the pthread_spinlock_t type if it's available and
the build is not configured to use Posix thread priorities, but otherwise it
falls back to a pthread_mutex_t. On the UP VxWorks and RTEMS platforms the
implementations lock out CPU interrupts and disable task preemption while a
spin-lock is held. The default implementation (used when no other implementation
is provided) uses an epicsMutex. Spin-locks may not be taken recursively, and
the code inside the critical section should be short and deterministic.</p>
<h3>Improvements to aToIPAddr()</h3>
<p>The libCom routine aToIPAddr() and the vxWorks implementation of the
associated hostToIPAddr() function have been modified to be able to look up
hostnames that begin with one or more digits. The epicsSockResolveTest program
was added to check this functionality.</p>
<h3>mbboDirect and mbbiDirect records</h3>
<p>These record types have undergone some significant rework, and will behave
slightly differently than they did in their 3.14 versions. The externally
visible changes are as follows:</p>
<h5>mbbiDirect</h5>
<ul>
<li>If the MASK field is set in a database file, it will not be over-written
when the record is initialized. This allows non-contiguous masks to be set,
although only the device support actually uses the MASK field.</li>
<li>If process() finds the UDF field to be set, the record will raise a
UDF/INVALID alarm.</li>
</ul>
<h5>mbboDirect</h5>
<ul>
<li>If the MASK field is set in a database file, it will not be over-written
when the record is initialized. This allows non-contiguous masks to be set,
although only the device support actually uses the MASK field.</li>
<li>After the device support's init_record() routine returns during record
initialization, if OMSL is <q>supervisory</q> and UDF is clear the fields
B0-BF will be set from the current VAL field.</li>
<li>When a put to the OMSL field sets it to <q>supervisory</q>, the fields
B0-BF will be set from the current VAL field. This did not used to happen,
the individual bit fields were previously never modified by the record.
Note that this change may require some databases to be modified, if they
were designed to take advantage of the previous behavior.</li>
</ul>
<h3>Redirection of the errlog console stream</h3>
<p>A new routine has been added to the errlog facility which allows the console
error message stream to be redirected from stderr to some other already open
file stream:</p>
<blockquote><pre>int errlogSetConsole(FILE *stream);
</pre></blockquote>
<p>The stream argument must be a FILE* pointer as returned by fopen() that is
open for output. If NULL is passed in, the errlog thread's stderr output stream
will be used instead. Note that messages to the console can be disabled and
re-enabled using the eltc routine which is also an iocsh command, but there is
no iocsh command currently provided for calling errlogSetConsole.</p>
<h3>Add cleanup subroutine to aSub record</h3>
<p>An aSub routine may set the CADR field with a function pointer which will be
run before a new routine in the event that a change to the SNAM field changes
the record's process subroutine.</p>
<p>This can be used to free any resources the routine needs to allocate. It can
also be used to determine if this is the first time this routine has been called
by this record instance. The CADR field is set to NULL immediately after the
routine it points to is called.</p>
<p>Example:</p>
<blockquote><pre>void cleanup(aSubRecord* prec) {
free(prec-&gt;dpvt);
prec-&gt;dpvt = NULL;
}
long myAsubRoutine(aSubRecord* prec) {
if (!prec-&gt;cadr) {
/* check types of inputs and outputs */
if (prec-&gt;ftva != menuFtypeDOUBLE)
return 1; /* oops */
dpvt = malloc(42);
prec-&gt;cadr = &amp;cleanup;
}
/* normal processing */
}
epicsRegisterFunction(myAsubRoutine);
</pre></blockquote>
<h3>Sequence record enhancements</h3>
<p>The sequence record type now has 16 link groups numbered 0 through 9 and A
through F, instead of the previous 10 groups numbered 1 through 9 and A. The
changes to this record are directly equivalent to those described below for the
fanout record. The fields OFFS and SHFT have been added and operate on the SELN
value exactly the same way. The result is backwards compatible with the 3.14
version of the sequence record as long as none of the new fields are modified
and the application does not rely on the SOFT/INVALID alarm that was generated
when the selection number exceeded 10. The record also now posts monitors on the
SELN field at the end of the sequence if its value changed when read through the
SELL link.
<h3>Fanout record enhancements</h3>
<p>The fanout record type now has 16 output links LNK0-LNK9 and LNKA-LNKF, plus
two additional fields which make the result backwards compatible with 3.14
databases, but also allow the link selection to be shifted without having to
process the SELN value through a calc or calcout record first.</p>
<p>Previously there was no LNK0 field, so when SELM is <q>Mask</q> bit 0 of SELN
controls whether the LNK1 link field was activated; bit 1 controls LNK2 and so
on. When SELM is <q>Specified</q> and SELN is zero no output link would be
activated at all; LNK1 gets activated when SELN is 1 and so on. Only 6 links
were provided, LNK1 through LNK6. The updated record type maintains the original
behavior when the new fields are not configured, except that the SOFT/INVALID
alarm is not generated when SELN is 7 through 15.</p>
<p>The update involved adding a LNK0 field, as well as fields LNK7 through LNK9
and LNKA through LNKF. To add flexibility and maintain backwards compatibility,
two additional fields have been added:</p>
<dl>
<dt><b>OFFS</b></dt>
<dd>This field holds a signed offset which is added to SELN to select which link
to activate when SELM is <q>Specified</q>. If the resulting value is outside the
range 0 .. 15 the record will go into a SOFT/INVALID alarm state. The default
value of OFFS is zero, so if it is not explicitly set and SELN is 1 the LNK1
link will be activated.</dd>
<dt><b>SHFT</b></dt>
<dd>When SELM is <q>Mask</q> the signed field SHFT is used to shift the SELN
value by SHFT bits (positive means right-wards, values outside the range -15 ..
15 will result in a SOFT/INVALID alarm), before using the resulting bit-pattern
to control which links to activate. The default value is -1, so if SHFT is not
explicitly set bit 0 of SELN will be used to control whether LNK1 gets
activated.</dd>
</dl>
<p>The record also now posts monitors on the SELN field if it changes as a
result of record processing (i.e. when read through the SELL link).</p>
<h3>Deleted Java build rules</h3>
<p>Java has its own build systems now, so we've deleted the rules and associated
variables from Base, although they might get added to the Extensions build rules
for a while in case anyone still needs them.</p>
<h2 align="center">Changes between 3.14.x and 3.15.0.1</h2>
<!-- Insert new items immediately below here ... -->
<h3>Application clean rules</h3>
<p>The <tt>clean</tt> Makefile target has changed between a single-colon rule
and a double-colon rule more than once in the life of the EPICS build rules, and
it just changed back to a single-colon rule, but now we recommend that
applications that wish to provide a Makefile that is backwards compatible with
the 3.14 build rules use the construct shown below. The 3.15 rules now support
a variable called <tt>CLEANS</tt> to which a Makefile can add a list of files to
be deleted when the user does a <tt>make clean</tt> like this:</p>
<blockquote><pre>CLEANS += &lt;list of files to be cleaned&gt;
ifndef BASE_3_15
clean::
$(RM) $(CLEANS)
endif</pre></blockquote>
<p>The conditional rule provides compatibility for use with the 3.14 build
system.</p>
<h3>MSI included with Base</h3>
<p>An enhanced version of the Macro Substitution and Include program <q>msi</q>
has been included with Base. Both this new version of msi and the IOC's
<tt>dbLoadTemplates</tt> command now support setting global macros in
substitution files, and <tt>dbLoadTemplates</tt> can now take a list of global
macro settings as the second argument on its command line. The substitution file
syntax is documented in the Application Developers Guide.</p>
<h3>Cross-builds targeting win32-x86-mingw</h3>
@@ -106,10 +641,10 @@ that number of seconds.</p>
<h3>Post events on Waveform record's NORD field</h3>
<p>When the record type or soft device support modify the NORD field of a
waveform record they now also post a DBE_VALUE and DBE_LOG event, signalling the
array length change to any clients monitoring the NORD field. Input device
support routines should be modified to do this as well.</p>
<p>When the record type or device support modify the NORD field of a waveform
record, the record support code now posts DBE_VALUE and DBE_LOG events for that
field, signalling the array length change to any client monitoring the NORD
field.</p>
<h3>Attributes of Non-VAL Fields</h3>
@@ -195,7 +730,7 @@ Code that will not work with a version of Base before 3.15.0 can now be
written like this to prevent it from compiling:</p>
<pre style="margin: 0 2em;">
#if defined(VERSION_INT) && EPICS_VERSION_INT < VERSION_INT(3,15,0,0)
#if defined(VERSION_INT) &amp;&amp; EPICS_VERSION_INT &lt; VERSION_INT(3,15,0,0)
# error EPICS Base R3.15.0 or later is required
#endif
</pre>

View File

@@ -75,6 +75,8 @@ std_DEPEND_DIRS = ioc libCom/RTEMS
DIRS += std/filters/test
std/filters/test_DEPEND_DIRS = std
DIRS += std/rec/test
std/rec/test_DEPEND_DIRS = std
include $(TOP)/configure/RULES_DIRS

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 file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -25,8 +25,6 @@
#include "cac.h"
#include "sgAutoPtr.h"
casgRecycle::~casgRecycle () {}
CASG::CASG ( epicsGuard < epicsMutex > & guard, ca_client_context & cacIn ) :
client ( cacIn ), magic ( CASG_MAGIC )
{
@@ -37,13 +35,14 @@ CASG::~CASG ()
{
}
void CASG::destructor (
void CASG::destructor (
CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
if ( this->verify ( guard ) ) {
this->reset ( guard );
this->reset ( cbGuard, guard );
this->client.uninstallCASG ( guard, *this );
this->magic = 0;
}
@@ -61,9 +60,9 @@ bool CASG::verify ( epicsGuard < epicsMutex > & ) const
/*
* CASG::block ()
*/
int CASG::block (
epicsGuard < epicsMutex > * pcbGuard,
epicsGuard < epicsMutex > & guard,
int CASG::block (
epicsGuard < epicsMutex > * pcbGuard,
epicsGuard < epicsMutex > & guard,
double timeout )
{
epicsTime cur_time;
@@ -75,7 +74,7 @@ int CASG::block (
guard.assertIdenticalMutex ( this->client.mutexRef() );
// prevent recursion nightmares by disabling blocking
// for IO from within a CA callback.
// for IO from within a CA callback.
if ( epicsThreadPrivateGet ( caClientCallbackThreadId ) ) {
return ECA_EVDISALLOW;
}
@@ -120,44 +119,45 @@ int CASG::block (
}
/*
* force a time update
* force a time update
*/
cur_time = epicsTime::getCurrent ();
delay = cur_time - beg_time;
}
this->reset ( guard );
return status;
}
void CASG::reset (
void CASG::reset (
CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
this->destroyCompletedIO ( guard );
this->destroyPendingIO ( guard );
this->destroyCompletedIO ( cbGuard, guard );
this->destroyPendingIO ( cbGuard, guard );
}
// lock must be applied
void CASG::destroyCompletedIO (
void CASG::destroyCompletedIO (
CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
syncGroupNotify * pNotify;
while ( ( pNotify = this->ioCompletedList.get () ) ) {
pNotify->destroy ( guard, * this );
pNotify->destroy ( cbGuard, guard );
}
}
void CASG::destroyPendingIO (
void CASG::destroyPendingIO (
CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
while ( syncGroupNotify * pNotify = this->ioPendingList.first () ) {
pNotify->cancel ( guard );
// cancel must release the guard while
pNotify->cancel ( cbGuard, guard );
// cancel must release the guard while
// canceling put callbacks so we
// must double check list membership
if ( pNotify->ioPending ( guard ) ) {
@@ -166,7 +166,7 @@ void CASG::destroyPendingIO (
else {
this->ioCompletedList.remove ( *pNotify );
}
pNotify->destroy ( guard, *this );
pNotify->destroy ( cbGuard, guard );
}
}
@@ -176,7 +176,7 @@ void CASG::show ( unsigned level ) const
this->show ( guard, level );
}
void CASG::show (
void CASG::show (
epicsGuard < epicsMutex > & guard, unsigned level ) const
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
@@ -184,14 +184,14 @@ void CASG::show (
this->getId (), this->magic, this->ioPendingList.count () );
if ( level ) {
::printf ( "\tPending" );
tsDLIterConst < syncGroupNotify > notifyPending =
tsDLIterConst < syncGroupNotify > notifyPending =
this->ioPendingList.firstIter ();
while ( notifyPending.valid () ) {
notifyPending->show ( guard, level - 1u );
notifyPending++;
}
::printf ( "\tCompleted" );
tsDLIterConst < syncGroupNotify > notifyCompleted =
tsDLIterConst < syncGroupNotify > notifyCompleted =
this->ioCompletedList.firstIter ();
while ( notifyCompleted.valid () ) {
notifyCompleted->show ( guard, level - 1u );
@@ -201,10 +201,11 @@ void CASG::show (
}
bool CASG::ioComplete (
CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
this->destroyCompletedIO ( guard );
this->destroyCompletedIO ( cbGuard, guard );
return this->ioPendingList.count () == 0u;
}
@@ -212,9 +213,9 @@ void CASG::put ( epicsGuard < epicsMutex > & guard, chid pChan,
unsigned type, arrayElementCount count, const void * pValue )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
sgAutoPtr < syncGroupWriteNotify > pNotify ( guard, *this, this->ioPendingList );
sgAutoPtr < syncGroupWriteNotify > pNotify ( guard, *this );
pNotify = syncGroupWriteNotify::factory (
this->freeListWriteOP, *this, pChan );
this->freeListWriteOP, *this, & CASG :: recycleWriteNotifyIO, pChan );
pNotify->begin ( guard, type, count, pValue );
pNotify.release ();
}
@@ -223,14 +224,14 @@ void CASG::get ( epicsGuard < epicsMutex > & guard, chid pChan,
unsigned type, arrayElementCount count, void *pValue )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
sgAutoPtr < syncGroupReadNotify > pNotify ( guard, *this, this->ioPendingList );
sgAutoPtr < syncGroupReadNotify > pNotify ( guard, *this );
pNotify = syncGroupReadNotify::factory (
this->freeListReadOP, *this, pChan, pValue );
this->freeListReadOP, *this, & CASG :: recycleReadNotifyIO, pChan, pValue );
pNotify->begin ( guard, type, count );
pNotify.release ();
}
void CASG::completionNotify (
void CASG::completionNotify (
epicsGuard < epicsMutex > & guard, syncGroupNotify & notify )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
@@ -241,56 +242,56 @@ void CASG::completionNotify (
}
}
void CASG::recycleSyncGroupWriteNotify (
epicsGuard < epicsMutex > & guard, syncGroupWriteNotify & io )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
this->freeListWriteOP.release ( & io );
}
void CASG::recycleSyncGroupReadNotify (
epicsGuard < epicsMutex > & guard, syncGroupReadNotify & io )
void CASG :: recycleReadNotifyIO ( epicsGuard < epicsMutex > & guard,
syncGroupReadNotify & io )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
this->freeListReadOP.release ( & io );
}
void CASG :: recycleWriteNotifyIO ( epicsGuard < epicsMutex > & guard,
syncGroupWriteNotify & io )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
this->freeListWriteOP.release ( & io );
}
int CASG :: printFormated ( const char *pformat, ... )
{
va_list theArgs;
int status;
va_start ( theArgs, pformat );
status = this->client.varArgsPrintFormated ( pformat, theArgs );
va_end ( theArgs );
return status;
}
void CASG::exception (
epicsGuard < epicsMutex > & guard,
int status, const char * pContext,
void CASG::exception (
epicsGuard < epicsMutex > & guard,
int status, const char * pContext,
const char * pFileName, unsigned lineNo )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
if ( status != ECA_CHANDESTROY ) {
this->client.exception (
this->client.exception (
guard, status, pContext, pFileName, lineNo );
}
}
void CASG::exception (
epicsGuard < epicsMutex > & guard,
void CASG::exception (
epicsGuard < epicsMutex > & guard,
int status, const char * pContext,
const char * pFileName, unsigned lineNo, oldChannelNotify & chan,
const char * pFileName, unsigned lineNo, oldChannelNotify & chan,
unsigned type, arrayElementCount count, unsigned op )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
if ( status != ECA_CHANDESTROY ) {
this->client.exception (
guard, status, pContext, pFileName,
this->client.exception (
guard, status, pContext, pFileName,
lineNo, chan, type, count, op );
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -84,14 +84,19 @@ PROD_LIBS = ca Com
# needed when its an object library build
PROD_SYS_LIBS_WIN32 = ws2_32 advapi32 user32
PROD_HOST += caRepeater catime acctst caConnTest casw caEventRate
OBJS_vxWorks += catime acctst caConnTest casw caEventRate acctstRegister
PROD_DEFAULT += caRepeater catime acctst caConnTest casw caEventRate
PROD_vxWorks = -nil-
PROD_RTEMS = -nil-
PROD_iOS = -nil-
OBJS_vxWorks = catime acctst caConnTest casw caEventRate acctstRegister
caRepeater_SRCS = caRepeater.cpp
catime_SRCS = catimeMain.c catime.c
acctst_SRCS = acctstMain.c acctst.c
catime_SRCS = catimeMain.c catime.c
acctst_SRCS = acctstMain.c acctst.c
caEventRate_SRCS = caEventRateMain.cpp caEventRate.cpp
casw_SRCS = casw.cpp
caConnTest_SRCS = caConnTestMain.cpp caConnTest.cpp
caConnTest_SRCS = caConnTestMain.cpp caConnTest.cpp
casw_SYS_LIBS_solaris = socket

0
src/ca/client/SearchDest.h Executable file → Normal file
View File

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.
\*************************************************************************/
/*
@@ -30,7 +30,7 @@
/*
* allocate error message string array
* allocate error message string array
* here so I can use sizeof
*/
#define CA_ERROR_GLBLSOURCE
@@ -182,7 +182,7 @@ int epicsShareAPI ca_task_initialize ( void )
}
// extern "C"
int epicsShareAPI ca_context_create (
int epicsShareAPI ca_context_create (
ca_preemptive_callback_select premptiveCallbackSelect )
{
ca_client_context *pcac;
@@ -202,7 +202,7 @@ int epicsShareAPI ca_context_create (
return ECA_NORMAL;
}
pcac = new ca_client_context (
pcac = new ca_client_context (
premptiveCallbackSelect == ca_enable_preemptive_callback );
if ( ! pcac ) {
return ECA_ALLOCMEM;
@@ -275,7 +275,7 @@ int epicsShareAPI ca_task_exit ()
*/
// extern "C"
int epicsShareAPI ca_build_and_connect ( const char *name_str, chtype get_type,
arrayElementCount get_count, chid * chan, void *pvalue,
arrayElementCount get_count, chid * chan, void *pvalue,
caCh *conn_func, void *puser )
{
if ( get_type != TYPENOTCONN && pvalue != 0 && get_count != 0 ) {
@@ -286,14 +286,14 @@ int epicsShareAPI ca_build_and_connect ( const char *name_str, chtype get_type,
}
/*
* ca_search_and_connect()
* ca_search_and_connect()
*/
// extern "C"
int epicsShareAPI ca_search_and_connect (
const char * name_str, chid * chanptr,
caCh * conn_func, void * puser )
{
return ca_create_channel ( name_str, conn_func,
return ca_create_channel ( name_str, conn_func,
puser, CA_PRIORITY_DEFAULT, chanptr );
}
@@ -312,7 +312,7 @@ int epicsShareAPI ca_create_channel (
CAFDHANDLER * pFunc = 0;
void * pArg = 0;
{
epicsGuard < epicsMutex >
epicsGuard < epicsMutex >
guard ( pcac->mutex );
if ( pcac->fdRegFuncNeedsToBeCalled ) {
pFunc = pcac->fdRegFunc;
@@ -327,9 +327,9 @@ int epicsShareAPI ca_create_channel (
try {
epicsGuard < epicsMutex > guard ( pcac->mutex );
oldChannelNotify * pChanNotify =
new ( pcac->oldChannelNotifyFreeList )
oldChannelNotify ( guard, *pcac, name_str,
oldChannelNotify * pChanNotify =
new ( pcac->oldChannelNotifyFreeList )
oldChannelNotify ( guard, *pcac, name_str,
conn_func, puser, priority );
// make sure that their chan pointer is set prior to
// calling connection call backs
@@ -352,9 +352,9 @@ int epicsShareAPI ca_create_channel (
return ECA_UNAVAILINSERV;
}
catch ( std :: exception & except ) {
pcac->printFormated (
pcac->printFormated (
"ca_create_channel: "
"unexpected exception was \"%s\"",
"unexpected exception was \"%s\"",
except.what () );
return ECA_INTERNAL;
}
@@ -369,22 +369,42 @@ int epicsShareAPI ca_create_channel (
* ca_clear_channel ()
*
* a known defect here is that there will be a
* crash if they destroy the channel after destroying
* crash if they destroy the channel after destroying
* its context
*/
// extern "C"
int epicsShareAPI ca_clear_channel ( chid pChan )
{
ca_client_context & cac = pChan->getClientCtx ();
epicsGuard < epicsMutex > guard ( cac.mutex );
try {
pChan->eliminateExcessiveSendBacklog ( guard );
{
epicsGuard < epicsMutex > guard ( cac.mutex );
try {
pChan->eliminateExcessiveSendBacklog ( guard );
}
catch ( cacChannel::notConnected & ) {
// intentionally ignored
}
}
catch ( cacChannel::notConnected & ) {
// intentionally ignored
if ( cac.pCallbackGuard.get() &&
cac.createdByThread == epicsThreadGetIdSelf () ) {
epicsGuard < epicsMutex > guard ( cac.mutex );
pChan->destructor ( *cac.pCallbackGuard.get(), guard );
cac.oldChannelNotifyFreeList.release ( pChan );
}
else {
//
// we will definately stall out here if all of the
// following are true
//
// o user creates non-preemtive mode client library context
// o user doesnt periodically call a ca function
// o user calls this function from an auxiillary thread
//
CallbackGuard cbGuard ( cac.cbMutex );
epicsGuard < epicsMutex > guard ( cac.mutex );
pChan->destructor ( *cac.pCallbackGuard.get(), guard );
cac.oldChannelNotifyFreeList.release ( pChan );
}
pChan->destructor ( guard );
cac.oldChannelNotifyFreeList.release ( pChan );
return ECA_NORMAL;
}
@@ -399,7 +419,7 @@ int epicsShareAPI ca_add_exception_event ( caExceptionHandler *pfunc, void *arg
if ( caStatus != ECA_NORMAL ) {
return caStatus;
}
pcac->changeExceptionEvent ( pfunc, arg );
return ECA_NORMAL;
@@ -408,10 +428,10 @@ int epicsShareAPI ca_add_exception_event ( caExceptionHandler *pfunc, void *arg
/*
* ca_add_masked_array_event
*/
int epicsShareAPI ca_add_masked_array_event (
chtype type, arrayElementCount count, chid pChan,
caEventCallBackFunc *pCallBack, void *pCallBackArg,
ca_real, ca_real, ca_real,
int epicsShareAPI ca_add_masked_array_event (
chtype type, arrayElementCount count, chid pChan,
caEventCallBackFunc *pCallBack, void *pCallBackArg,
ca_real, ca_real, ca_real,
evid *monixptr, long mask )
{
return ca_create_subscription ( type, count, pChan, mask,
@@ -429,7 +449,7 @@ int epicsShareAPI ca_clear_event ( evid pMon )
// extern "C"
chid epicsShareAPI ca_evid_to_chid ( evid pMon )
{
return & pMon->channel ();
return & pMon->channel ();
}
// extern "C"
@@ -498,7 +518,7 @@ int epicsShareAPI ca_pend_io ( ca_real timeout )
/*
* ca_flush_io ()
*/
*/
int epicsShareAPI ca_flush_io ()
{
ca_client_context * pcac;
@@ -545,7 +565,7 @@ void epicsShareAPI ca_signal ( long ca_status, const char *message )
* ca_message (long ca_status)
*
* - if it is an unknown error code then it possible
* that the error string generated below
* that the error string generated below
* will be overwritten before (or while) the caller
* of this routine is calling this routine
* (if they call this routine again).
@@ -567,7 +587,7 @@ const char * epicsShareAPI ca_message ( long ca_status )
* ca_signal_with_file_and_lineno()
*/
// extern "C"
void epicsShareAPI ca_signal_with_file_and_lineno ( long ca_status,
void epicsShareAPI ca_signal_with_file_and_lineno ( long ca_status,
const char *message, const char *pfilenm, int lineno )
{
ca_signal_formated ( ca_status, pfilenm, lineno, message );
@@ -577,7 +597,7 @@ void epicsShareAPI ca_signal_with_file_and_lineno ( long ca_status,
* ca_signal_formated()
*/
// extern "C"
void epicsShareAPI ca_signal_formated ( long ca_status, const char *pfilenm,
void epicsShareAPI ca_signal_formated ( long ca_status, const char *pfilenm,
int lineno, const char *pFormat, ... )
{
ca_client_context *pcac;
@@ -590,12 +610,12 @@ void epicsShareAPI ca_signal_formated ( long ca_status, const char *pfilenm,
}
va_list theArgs;
va_start ( theArgs, pFormat );
va_start ( theArgs, pFormat );
if ( pcac ) {
pcac->vSignal ( ca_status, pfilenm, lineno, pFormat, theArgs );
}
else {
fprintf ( stderr, "CA exception in thread w/o CA ctx: status=%s file=%s line=%d: \n",
fprintf ( stderr, "CA exception in thread w/o CA ctx: status=%s file=%s line=%d: \n",
ca_message ( ca_status ), pfilenm, lineno );
if ( pFormat ) {
vfprintf ( stderr, pFormat, theArgs );
@@ -607,7 +627,7 @@ void epicsShareAPI ca_signal_formated ( long ca_status, const char *pfilenm,
/*
* CA_ADD_FD_REGISTRATION
*
* call their function with their argument whenever
* call their function with their argument whenever
* a new fd is added or removed
* (for a manager of the select system call under UNIX)
*
@@ -631,7 +651,7 @@ int epicsShareAPI ca_add_fd_registration ( CAFDHANDLER * func, void * arg )
* function that returns the CA version string
*/
// extern "C"
const char * epicsShareAPI ca_version ()
const char * epicsShareAPI ca_version ()
{
return CA_VERSION_STRING ( CA_MINOR_PROTOCOL_REVISION );
}
@@ -660,7 +680,7 @@ int epicsShareAPI ca_replace_printf_handler ( caPrintfFunc *ca_printf_func )
* (for testing purposes only)
*/
// extern "C"
unsigned epicsShareAPI ca_get_ioc_connection_count ()
unsigned epicsShareAPI ca_get_ioc_connection_count ()
{
ca_client_context * pcac;
int caStatus = fetchClientContext ( & pcac );
@@ -720,7 +740,7 @@ struct ca_client_context * epicsShareAPI ca_current_context ()
{
struct ca_client_context *pCtx;
if ( caClientContextId ) {
pCtx = ( struct ca_client_context * )
pCtx = ( struct ca_client_context * )
epicsThreadPrivateGet ( caClientContextId );
}
else {
@@ -749,7 +769,7 @@ int epicsShareAPI ca_attach_context ( struct ca_client_context * pCtx )
return ECA_NORMAL;
}
void epicsShareAPI ca_detach_context ()
void epicsShareAPI ca_detach_context ()
{
if ( caClientContextId ) {
epicsThreadPrivateSet ( caClientContextId, 0 );
@@ -794,43 +814,43 @@ epicsShareDef const int epicsTypeToDBR_XXXX [lastEpicsType+1] = {
// extern "C"
epicsShareDef const epicsType DBR_XXXXToEpicsType [LAST_BUFFER_TYPE+1] = {
epicsOldStringT,
epicsInt16T,
epicsFloat32T,
epicsEnum16T,
epicsUInt8T,
epicsInt32T,
epicsInt16T,
epicsFloat32T,
epicsEnum16T,
epicsUInt8T,
epicsInt32T,
epicsFloat64T,
epicsOldStringT,
epicsInt16T,
epicsFloat32T,
epicsEnum16T,
epicsUInt8T,
epicsInt32T,
epicsInt16T,
epicsFloat32T,
epicsEnum16T,
epicsUInt8T,
epicsInt32T,
epicsFloat64T,
epicsOldStringT,
epicsInt16T,
epicsFloat32T,
epicsEnum16T,
epicsUInt8T,
epicsInt32T,
epicsInt16T,
epicsFloat32T,
epicsEnum16T,
epicsUInt8T,
epicsInt32T,
epicsFloat64T,
epicsOldStringT,
epicsInt16T,
epicsFloat32T,
epicsEnum16T,
epicsUInt8T,
epicsInt32T,
epicsInt16T,
epicsFloat32T,
epicsEnum16T,
epicsUInt8T,
epicsInt32T,
epicsFloat64T,
epicsOldStringT,
epicsInt16T,
epicsFloat32T,
epicsEnum16T,
epicsUInt8T,
epicsInt32T,
epicsInt16T,
epicsFloat32T,
epicsEnum16T,
epicsUInt8T,
epicsInt32T,
epicsFloat64T,
epicsUInt16T,
@@ -939,7 +959,7 @@ epicsShareDef const unsigned short dbr_value_size[LAST_BUFFER_TYPE+1] = {
sizeof(dbr_string_t), /* string max size */
};
//extern "C"
//extern "C"
epicsShareDef const enum dbr_value_class dbr_value_class[LAST_BUFFER_TYPE+1] = {
dbr_class_string, /* string max size */
dbr_class_int, /* short */

View File

@@ -13,6 +13,7 @@
* Authors:
* Jeff Hill
* Murali Shankar - initial versions of verifyMultithreadSubscr
* Michael Abbott - initial versions of multiSubscrDestroyNoLateCallbackTest
*
*/
@@ -1328,6 +1329,159 @@ void test_sync_groups ( chid chan, unsigned interestLevel )
showProgressEnd ( interestLevel );
}
#define multiSubscrDestroyNoLateCallbackEventCount 500
struct MultiSubscrDestroyNoLateCallbackEventData {
evid m_id;
size_t m_nCallback;
int m_callbackIsOk;
struct MultiSubscrDestroyNoLateCallbackTestData * m_pTestData;
};
struct MultiSubscrDestroyNoLateCallbackTestData {
const char * m_pChanName;
chid m_chan;
epicsMutexId m_mutex;
epicsEventId m_testDoneEvent;
unsigned m_interestLevel;
struct MultiSubscrDestroyNoLateCallbackEventData
m_eventData [multiSubscrDestroyNoLateCallbackEventCount];
};
static void noLateCallbackDetect ( struct event_handler_args args )
{
int callbackIsOk;
struct MultiSubscrDestroyNoLateCallbackEventData * const pEventData = args.usr;
epicsMutexLockStatus lockStatus = epicsMutexLock ( pEventData->m_pTestData->m_mutex );
callbackIsOk = pEventData->m_callbackIsOk;
pEventData->m_nCallback++;
epicsMutexUnlock ( pEventData->m_pTestData->m_mutex );
verify ( lockStatus == epicsMutexLockOK );
verify ( callbackIsOk );
}
static void multiSubscrDestroyNoLateCallbackThread ( void * pParm )
{
struct MultiSubscrDestroyNoLateCallbackTestData * const pTestData =
( struct MultiSubscrDestroyNoLateCallbackTestData * ) pParm;
unsigned i, j;
int status;
status = ca_context_create ( ca_enable_preemptive_callback );
verify ( status == ECA_NORMAL );
status = ca_create_channel ( pTestData->m_pChanName, 0, 0,
CA_PRIORITY_DEFAULT, &pTestData->m_chan );
status = ca_pend_io ( timeoutToPendIO );
SEVCHK ( status, "multiSubscrDestroyLateNoCallbackTest: channel connect failed" );
verify ( status == ECA_NORMAL );
/*
* create a set of subscriptions
*/
for ( i=0; i < 10000; i++ ) {
unsigned int priorityOfTestThread;
for ( j=0; j < multiSubscrDestroyNoLateCallbackEventCount; j++ ) {
epicsMutexLockStatus lockStatus = epicsMutexLock ( pTestData->m_mutex );
verify ( lockStatus == epicsMutexLockOK );
pTestData->m_eventData[j].m_nCallback = 0;
pTestData->m_eventData[j].m_callbackIsOk = TRUE;
pTestData->m_eventData[j].m_pTestData = pTestData;
epicsMutexUnlock ( pTestData->m_mutex );
SEVCHK ( ca_add_event ( DBR_GR_FLOAT, pTestData->m_chan, noLateCallbackDetect,
&pTestData->m_eventData[j], &pTestData->m_eventData[j].m_id ) , NULL );
}
SEVCHK ( ca_flush_io(), NULL );
/*
* raise the priority of the current thread hoping to improve our
* likelyhood of detecting a bug
*/
priorityOfTestThread = epicsThreadGetPrioritySelf ();
epicsThreadSetPriority ( epicsThreadGetIdSelf(), epicsThreadPriorityHigh );
/*
* wait for the first subscription update to arrive
*/
{
epicsMutexLockStatus lockStatus = epicsMutexLock ( pTestData->m_mutex );
verify ( lockStatus == epicsMutexLockOK );
while ( pTestData->m_eventData[0].m_nCallback == 0 ) {
epicsMutexUnlock ( pTestData->m_mutex );
epicsThreadSleep ( 50e-6 );
lockStatus = epicsMutexLock ( pTestData->m_mutex );
verify ( lockStatus == epicsMutexLockOK );
}
epicsMutexUnlock ( pTestData->m_mutex );
}
/*
* try to destroy all of the subscriptions at precisely the same time that
* their first callbacks are running
*/
for ( j=0; j < multiSubscrDestroyNoLateCallbackEventCount; j++ ) {
epicsMutexLockStatus lockStatus;
SEVCHK ( ca_clear_event ( pTestData->m_eventData[j].m_id ) , NULL );
lockStatus = epicsMutexLock ( pTestData->m_mutex );
verify ( lockStatus == epicsMutexLockOK );
pTestData->m_eventData[j].m_callbackIsOk = FALSE;
epicsMutexUnlock ( pTestData->m_mutex );
}
/*
* return to the original priority
*/
epicsThreadSetPriority ( epicsThreadGetIdSelf(), priorityOfTestThread );
if ( i % 1000 == 0 ) {
showProgress ( pTestData->m_interestLevel );
}
}
SEVCHK ( ca_clear_channel ( pTestData->m_chan ), NULL );
ca_context_destroy ();
epicsEventMustTrigger ( pTestData->m_testDoneEvent );
}
/*
* verify that, in a preemtive callback mode client, a subscription callback never
* comes after the subscription is destroyed
*/
static void multiSubscrDestroyNoLateCallbackTest ( const char *pName, unsigned interestLevel )
{
struct MultiSubscrDestroyNoLateCallbackTestData * pTestData;
showProgressBegin ( "multiSubscrDestroyNoLateCallbackTest", interestLevel );
pTestData = calloc ( 1u, sizeof ( struct MultiSubscrDestroyNoLateCallbackTestData ) );
verify ( pTestData );
pTestData->m_mutex = epicsMutexMustCreate ();
pTestData->m_testDoneEvent = epicsEventMustCreate ( epicsEventEmpty );
pTestData->m_pChanName = pName;
pTestData->m_interestLevel = interestLevel;
epicsThreadMustCreate (
"multiSubscrDestroyNoLateCallbackTest",
epicsThreadPriorityLow,
epicsThreadGetStackSize ( epicsThreadStackMedium ),
multiSubscrDestroyNoLateCallbackThread,
pTestData );
/*
* wait for test to complete
*/
epicsEventMustWait ( pTestData->m_testDoneEvent );
/*
* cleanup
*/
epicsMutexDestroy ( pTestData->m_mutex );
epicsEventDestroy ( pTestData->m_testDoneEvent );
free ( pTestData );
showProgressEnd ( interestLevel );
}
/*
* multiSubscriptionDeleteTest
*
@@ -3263,6 +3417,11 @@ int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
epicsEnvSet ( "EPICS_CA_MAX_ARRAY_BYTES", tmpString );
}
/*
* this test creates, and then destroys, a private CA context
*/
multiSubscrDestroyNoLateCallbackTest ( pName, interestLevel );
status = ca_context_create ( select );
SEVCHK ( status, NULL );

0
src/ca/client/ca.rc Executable file → Normal file
View File

View File

@@ -4,19 +4,19 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
/*
*
*
*
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
*
*
* Copyright, 1986, The Regents of the University of California.
*
*
*
*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
@@ -27,7 +27,7 @@
#endif
#include <stdexcept>
#include <string> // vxWorks 6.0 requires this include
#include <string> // vxWorks 6.0 requires this include
#include <stdio.h>
#include "epicsExit.h"
@@ -57,7 +57,7 @@ extern "C" void cacOnceFunc ( void * )
{
caClientCallbackThreadId = epicsThreadPrivateCreate ();
assert ( caClientCallbackThreadId );
ca_client_context::pDefaultServiceInstallMutex = new epicsMutex;
ca_client_context::pDefaultServiceInstallMutex = newEpicsMutex;
epicsAtExit ( cacExitHandler,0 );
}
@@ -67,11 +67,11 @@ cacService * ca_client_context::pDefaultService = 0;
epicsMutex * ca_client_context::pDefaultServiceInstallMutex;
ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) :
createdByThread ( epicsThreadGetIdSelf () ),
ca_exception_func ( 0 ), ca_exception_arg ( 0 ),
createdByThread ( epicsThreadGetIdSelf () ),
ca_exception_func ( 0 ), ca_exception_arg ( 0 ),
pVPrintfFunc ( errlogVprintf ), fdRegFunc ( 0 ), fdRegArg ( 0 ),
pndRecvCnt ( 0u ), ioSeqNo ( 0u ), callbackThreadsPending ( 0u ),
localPort ( 0 ), fdRegFuncNeedsToBeCalled ( false ),
pndRecvCnt ( 0u ), ioSeqNo ( 0u ), callbackThreadsPending ( 0u ),
localPort ( 0 ), fdRegFuncNeedsToBeCalled ( false ),
noWakeupSincePend ( true )
{
static const unsigned short PORT_ANY = 0u;
@@ -85,7 +85,7 @@ ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) :
epicsGuard < epicsMutex > guard ( *ca_client_context::pDefaultServiceInstallMutex );
if ( ca_client_context::pDefaultService ) {
this->pServiceContext.reset (
& ca_client_context::pDefaultService->contextCreate (
& ca_client_context::pDefaultService->contextCreate (
this->mutex, this->cbMutex, *this ) );
}
else {
@@ -125,7 +125,7 @@ ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) :
osiSockAddr addr;
memset ( (char *)&addr, 0 , sizeof ( addr ) );
addr.ia.sin_family = AF_INET;
addr.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
addr.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
addr.ia.sin_port = htons ( PORT_ANY );
int status = bind (this->sock, &addr.sa, sizeof (addr) );
if ( status < 0 ) {
@@ -139,7 +139,7 @@ ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) :
throwWithLocation ( noSocket () );
}
}
{
osiSockAddr tmpAddr;
osiSocklen_t saddr_length = sizeof ( tmpAddr );
@@ -159,9 +159,9 @@ ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) :
this->localPort = htons ( tmpAddr.ia.sin_port );
}
epics_auto_ptr < epicsGuard < epicsMutex > > pCBGuard;
epics_auto_ptr < CallbackGuard > pCBGuard;
if ( ! enablePreemptiveCallback ) {
pCBGuard.reset ( new epicsGuard < epicsMutex > ( this->cbMutex ) );
pCBGuard.reset ( new CallbackGuard ( this->cbMutex ) );
}
// multiple steps ensure exception safety
@@ -171,7 +171,7 @@ ca_client_context::ca_client_context ( bool enablePreemptiveCallback ) :
ca_client_context::~ca_client_context ()
{
if ( this->fdRegFunc ) {
( *this->fdRegFunc )
( *this->fdRegFunc )
( this->fdRegArg, this->sock, false );
}
epicsSocketDestroy ( this->sock );
@@ -179,9 +179,9 @@ ca_client_context::~ca_client_context ()
osiSockRelease ();
// force a logical shutdown order
// so that the cac class does not hang its
// so that the cac class does not hang its
// receive threads during their shutdown sequence
// and so that classes using this classes mutex
// and so that classes using this classes mutex
// are destroyed before the mutex is destroyed
if ( this->pCallbackGuard.get() ) {
epicsGuardRelease < epicsMutex > unguard ( *this->pCallbackGuard );
@@ -192,7 +192,7 @@ ca_client_context::~ca_client_context ()
}
}
void ca_client_context::destroyGetCopy (
void ca_client_context::destroyGetCopy (
epicsGuard < epicsMutex > & guard, getCopy & gc )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -200,7 +200,7 @@ void ca_client_context::destroyGetCopy (
this->getCopyFreeList.release ( & gc );
}
void ca_client_context::destroyGetCallback (
void ca_client_context::destroyGetCallback (
epicsGuard < epicsMutex > & guard, getCallback & gcb )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -208,7 +208,7 @@ void ca_client_context::destroyGetCallback (
this->getCallbackFreeList.release ( & gcb );
}
void ca_client_context::destroyPutCallback (
void ca_client_context::destroyPutCallback (
epicsGuard < epicsMutex > & guard, putCallback & pcb )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -216,7 +216,7 @@ void ca_client_context::destroyPutCallback (
this->putCallbackFreeList.release ( & pcb );
}
void ca_client_context::destroySubscription (
void ca_client_context::destroySubscription (
epicsGuard < epicsMutex > & guard, oldSubscription & os )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -224,7 +224,7 @@ void ca_client_context::destroySubscription (
this->subscriptionFreeList.release ( & os );
}
void ca_client_context::changeExceptionEvent (
void ca_client_context::changeExceptionEvent (
caExceptionHandler * pfunc, void * arg )
{
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -233,7 +233,7 @@ void ca_client_context::changeExceptionEvent (
// should block here until releated callback in progress completes
}
void ca_client_context::replaceErrLogHandler (
void ca_client_context::replaceErrLogHandler (
caPrintfFunc * ca_printf_func )
{
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -246,7 +246,7 @@ void ca_client_context::replaceErrLogHandler (
// should block here until releated callback in progress completes
}
void ca_client_context::registerForFileDescriptorCallBack (
void ca_client_context::registerForFileDescriptorCallBack (
CAFDHANDLER *pFunc, void *pArg )
{
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -261,22 +261,22 @@ void ca_client_context::registerForFileDescriptorCallBack (
// should block here until releated callback in progress completes
}
int ca_client_context :: printFormated (
int ca_client_context :: printFormated (
const char *pformat, ... ) const
{
va_list theArgs;
int status;
va_start ( theArgs, pformat );
status = this->ca_client_context :: varArgsPrintFormated ( pformat, theArgs );
va_end ( theArgs );
return status;
}
int ca_client_context :: varArgsPrintFormated (
int ca_client_context :: varArgsPrintFormated (
const char *pformat, va_list args ) const
{
caPrintfFunc * pFunc;
@@ -292,8 +292,8 @@ int ca_client_context :: varArgsPrintFormated (
}
}
void ca_client_context::exception (
epicsGuard < epicsMutex > & guard, int stat, const char * pCtx,
void ca_client_context::exception (
epicsGuard < epicsMutex > & guard, int stat, const char * pCtx,
const char * pFile, unsigned lineNo )
{
struct exception_handler_args args;
@@ -321,9 +321,9 @@ void ca_client_context::exception (
}
}
void ca_client_context::exception (
void ca_client_context::exception (
epicsGuard < epicsMutex > & guard, int status, const char * pContext,
const char * pFileName, unsigned lineNo, oldChannelNotify & chan,
const char * pFileName, unsigned lineNo, oldChannelNotify & chan,
unsigned type, arrayElementCount count, unsigned op )
{
struct exception_handler_args args;
@@ -346,29 +346,29 @@ void ca_client_context::exception (
( *pFunc ) ( args );
}
else {
this->signal ( status, pFileName, lineNo,
"op=%u, channel=%s, type=%s, count=%lu, ctx=\"%s\"",
op, ca_name ( &chan ),
dbr_type_to_text ( static_cast <int> ( type ) ),
this->signal ( status, pFileName, lineNo,
"op=%u, channel=%s, type=%s, count=%lu, ctx=\"%s\"",
op, ca_name ( &chan ),
dbr_type_to_text ( static_cast <int> ( type ) ),
count, pContext );
}
}
}
void ca_client_context::signal ( int ca_status, const char * pfilenm,
void ca_client_context::signal ( int ca_status, const char * pfilenm,
int lineno, const char * pFormat, ... )
{
va_list theArgs;
va_start ( theArgs, pFormat );
va_start ( theArgs, pFormat );
this->vSignal ( ca_status, pfilenm, lineno, pFormat, theArgs);
va_end ( theArgs );
}
void ca_client_context :: vSignal (
int ca_status, const char *pfilenm,
void ca_client_context :: vSignal (
int ca_status, const char *pfilenm,
int lineno, const char *pFormat, va_list args )
{
static const char *severity[] =
static const char *severity[] =
{
"Warning",
"Success",
@@ -379,11 +379,11 @@ void ca_client_context :: vSignal (
"Fatal",
"Fatal"
};
this->printFormated ( "CA.Client.Exception...............................................\n" );
this->printFormated ( " %s: \"%s\"\n",
severity[ CA_EXTRACT_SEVERITY ( ca_status ) ],
this->printFormated ( " %s: \"%s\"\n",
severity[ CA_EXTRACT_SEVERITY ( ca_status ) ],
ca_message ( ca_status ) );
if ( pFormat ) {
@@ -391,26 +391,26 @@ void ca_client_context :: vSignal (
this->varArgsPrintFormated ( pFormat, args );
this->printFormated ( "\"\n" );
}
if ( pfilenm ) {
this->printFormated ( " Source File: %s line %d\n",
pfilenm, lineno );
}
pfilenm, lineno );
}
epicsTime current = epicsTime::getCurrent ();
char date[64];
current.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S.%f");
this->printFormated ( " Current Time: %s\n", date );
/*
* Terminate execution if unsuccessful
*/
if( ! ( ca_status & CA_M_SUCCESS ) &&
if( ! ( ca_status & CA_M_SUCCESS ) &&
CA_EXTRACT_SEVERITY ( ca_status ) != CA_K_WARNING ){
errlogFlush ();
abort ();
}
this->printFormated ( "..................................................................\n" );
}
@@ -418,7 +418,7 @@ void ca_client_context::show ( unsigned level ) const
{
epicsGuard < epicsMutex > guard ( this->mutex );
::printf ( "ca_client_context at %p pndRecvCnt=%u ioSeqNo=%u\n",
::printf ( "ca_client_context at %p pndRecvCnt=%u ioSeqNo=%u\n",
static_cast <const void *> ( this ),
this->pndRecvCnt, this->ioSeqNo );
@@ -443,7 +443,7 @@ void ca_client_context::attachToClientCtx ()
epicsThreadPrivateSet ( caClientContextId, this );
}
void ca_client_context::incrementOutstandingIO (
void ca_client_context::incrementOutstandingIO (
epicsGuard < epicsMutex > & guard, unsigned ioSeqNoIn )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -453,7 +453,7 @@ void ca_client_context::incrementOutstandingIO (
}
}
void ca_client_context::decrementOutstandingIO (
void ca_client_context::decrementOutstandingIO (
epicsGuard < epicsMutex > & guard, unsigned ioSeqNoIn )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -466,16 +466,16 @@ void ca_client_context::decrementOutstandingIO (
}
}
// !!!! This routine is only visible in the old interface - or in a new ST interface.
// !!!! In the old interface we restrict thread attach so that calls from threads
// !!!! other than the initializing thread are not allowed if preemptive callback
// !!!! This routine is only visible in the old interface - or in a new ST interface.
// !!!! In the old interface we restrict thread attach so that calls from threads
// !!!! other than the initializing thread are not allowed if preemptive callback
// !!!! is disabled. This prevents the preemptive callback lock from being released
// !!!! by other threads than the one that locked it.
//
int ca_client_context::pendIO ( const double & timeout )
{
// prevent recursion nightmares by disabling calls to
// pendIO () from within a CA callback.
// prevent recursion nightmares by disabling calls to
// pendIO () from within a CA callback.
if ( epicsThreadPrivateGet ( caClientCallbackThreadId ) ) {
return ECA_EVDISALLOW;
}
@@ -487,7 +487,7 @@ int ca_client_context::pendIO ( const double & timeout )
epicsGuard < epicsMutex > guard ( this->mutex );
this->flush ( guard );
while ( this->pndRecvCnt > 0 ) {
if ( remaining < CAC_SIGNIFICANT_DELAY ) {
status = ECA_TIMEOUT;
@@ -514,16 +514,16 @@ int ca_client_context::pendIO ( const double & timeout )
return status;
}
// !!!! This routine is only visible in the old interface - or in a new ST interface.
// !!!! In the old interface we restrict thread attach so that calls from threads
// !!!! other than the initializing thread are not allowed if preemptive callback
// !!!! This routine is only visible in the old interface - or in a new ST interface.
// !!!! In the old interface we restrict thread attach so that calls from threads
// !!!! other than the initializing thread are not allowed if preemptive callback
// !!!! is disabled. This prevents the preemptive callback lock from being released
// !!!! by other threads than the one that locked it.
//
int ca_client_context::pendEvent ( const double & timeout )
{
// prevent recursion nightmares by disabling calls to
// pendIO () from within a CA callback.
// prevent recursion nightmares by disabling calls to
// pendIO () from within a CA callback.
if ( epicsThreadPrivateGet ( caClientCallbackThreadId ) ) {
return ECA_EVDISALLOW;
}
@@ -541,17 +541,17 @@ int ca_client_context::pendEvent ( const double & timeout )
epicsGuard < epicsMutex > guard ( this->mutex );
//
// This is needed because in non-preemptive callback mode
// legacy applications that use file descriptor managers
// This is needed because in non-preemptive callback mode
// legacy applications that use file descriptor managers
// will register for ca receive thread activity and keep
// calling ca_pend_event until all of the socket data has
// been read. We must guarantee that other threads get a
// been read. We must guarantee that other threads get a
// chance to run if there is data in any of the sockets.
//
if ( this->fdRegFunc ) {
epicsGuardRelease < epicsMutex > unguard ( guard );
// remove short udp message sent to wake
// remove short udp message sent to wake
// up a file descriptor manager
osiSockAddr tmpAddr;
osiSocklen_t addrSize = sizeof ( tmpAddr.sa );
@@ -592,7 +592,7 @@ int ca_client_context::pendEvent ( const double & timeout )
return ECA_TIMEOUT;
}
void ca_client_context::blockForEventAndEnableCallbacks (
void ca_client_context::blockForEventAndEnableCallbacks (
epicsEvent & event, const double & timeout )
{
if ( this->pCallbackGuard.get() ) {
@@ -659,12 +659,12 @@ void ca_client_context::callbackProcessingCompleteNotify ()
}
}
cacChannel & ca_client_context::createChannel (
epicsGuard < epicsMutex > & guard, const char * pChannelName,
cacChannel & ca_client_context::createChannel (
epicsGuard < epicsMutex > & guard, const char * pChannelName,
cacChannelNotify & chan, cacChannel::priLev pri )
{
guard.assertIdenticalMutex ( this->mutex );
return this->pServiceContext->createChannel (
return this->pServiceContext->createChannel (
guard, pChannelName, chan, pri );
}
@@ -685,21 +685,21 @@ unsigned ca_client_context::beaconAnomaliesSinceProgramStart () const
return this->pServiceContext->beaconAnomaliesSinceProgramStart ( guard );
}
void ca_client_context::installCASG (
void ca_client_context::installCASG (
epicsGuard < epicsMutex > & guard, CASG & sg )
{
guard.assertIdenticalMutex ( this->mutex );
this->sgTable.idAssignAdd ( sg );
}
void ca_client_context::uninstallCASG (
void ca_client_context::uninstallCASG (
epicsGuard < epicsMutex > & guard, CASG & sg )
{
guard.assertIdenticalMutex ( this->mutex );
this->sgTable.remove ( sg );
}
CASG * ca_client_context::lookupCASG (
CASG * ca_client_context::lookupCASG (
epicsGuard < epicsMutex > & guard, unsigned idIn )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -724,7 +724,7 @@ epicsMutex & ca_client_context::mutexRef () const
return this->mutex;
}
cacContext & ca_client_context::createNetworkContext (
cacContext & ca_client_context::createNetworkContext (
epicsMutex & mutexIn, epicsMutex & cbMutexIn )
{
return * new cac ( mutexIn, cbMutexIn, *this );
@@ -751,34 +751,54 @@ epicsShareFunc int epicsShareAPI ca_clear_subscription ( evid pMon )
{
oldChannelNotify & chan = pMon->channel ();
ca_client_context & cac = chan.getClientCtx ();
epicsGuard < epicsMutex > guard ( cac.mutex );
try {
// if this stalls out on a live circuit then an exception
// can be forthcoming which we must ignore as the clear
// request must always be successful
chan.eliminateExcessiveSendBacklog ( guard );
// !!!! the order in which we take the mutex here prevents deadlocks
{
epicsGuard < epicsMutex > guard ( cac.mutex );
try {
// if this stalls out on a live circuit then an exception
// can be forthcoming which we must ignore as the clear
// request must always be successful
chan.eliminateExcessiveSendBacklog ( guard );
}
catch ( cacChannel::notConnected & ) {
// intentionally ignored
}
}
catch ( cacChannel::notConnected & ) {
// intentionally ignored
if ( cac.pCallbackGuard.get() &&
cac.createdByThread == epicsThreadGetIdSelf () ) {
epicsGuard < epicsMutex > guard ( cac.mutex );
pMon->cancel ( *cac.pCallbackGuard.get(), guard );
}
else {
//
// we will definately stall out here if all of the
// following are true
//
// o user creates non-preemtive mode client library context
// o user doesnt periodically call a ca function
// o user calls this function from an auxiillary thread
//
CallbackGuard cbGuard ( cac.cbMutex );
epicsGuard < epicsMutex > guard ( cac.mutex );
pMon->cancel ( cbGuard, guard );
}
pMon->cancel ( guard );
return ECA_NORMAL;
}
void ca_client_context :: eliminateExcessiveSendBacklog (
void ca_client_context :: eliminateExcessiveSendBacklog (
epicsGuard < epicsMutex > & guard, cacChannel & chan )
{
if ( chan.requestMessageBytesPending ( guard ) >
if ( chan.requestMessageBytesPending ( guard ) >
ca_client_context :: flushBlockThreshold ) {
if ( this->pCallbackGuard.get() &&
if ( this->pCallbackGuard.get() &&
this->createdByThread == epicsThreadGetIdSelf () ) {
// we need to be very careful about lock hierarchy
// we need to be very careful about lock hierarchy
// inversion in this situation
epicsGuardRelease < epicsMutex > unguard ( guard );
{
epicsGuardRelease < epicsMutex > cbunguard (
* this->pCallbackGuard.get() );
{
{
epicsGuard < epicsMutex > nestedGuard ( this->mutex );
chan.flush ( nestedGuard );
}

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 file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -22,7 +22,7 @@
#include <new>
#include <stdexcept>
#include <string> // vxWorks 6.0 requires this include
#include <string> // vxWorks 6.0 requires this include
#include "dbDefs.h"
#include "epicsGuard.h"
@@ -50,12 +50,12 @@
#include "autoPtrFreeList.h"
#include "noopiiu.h"
static const char pVersionCAC[] =
"@(#) " EPICS_VERSION_STRING
static const char pVersionCAC[] =
"@(#) " EPICS_VERSION_STRING
", CA Client Library " __DATE__;
// TCP response dispatch table
const cac::pProtoStubTCP cac::tcpJumpTableCAC [] =
const cac::pProtoStubTCP cac::tcpJumpTableCAC [] =
{
&cac::versionAction,
&cac::eventRespAction,
@@ -68,7 +68,7 @@ const cac::pProtoStubTCP cac::tcpJumpTableCAC [] =
&cac::badTCPRespAction,
&cac::badTCPRespAction,
// legacy CA_PROTO_READ_SYNC used as an echo with legacy server
&cac::echoRespAction,
&cac::echoRespAction,
&cac::exceptionRespAction,
&cac::clearChannelRespAction,
&cac::badTCPRespAction,
@@ -89,7 +89,7 @@ const cac::pProtoStubTCP cac::tcpJumpTableCAC [] =
};
// TCP exception dispatch table
const cac::pExcepProtoStubTCP cac::tcpExcepJumpTableCAC [] =
const cac::pExcepProtoStubTCP cac::tcpExcepJumpTableCAC [] =
{
&cac::defaultExcep, // CA_PROTO_VERSION
&cac::eventAddExcep, // CA_PROTO_EVENT_ADD
@@ -109,7 +109,7 @@ const cac::pExcepProtoStubTCP cac::tcpExcepJumpTableCAC [] =
&cac::readNotifyExcep, // CA_PROTO_READ_NOTIFY
&cac::defaultExcep, // CA_PROTO_READ_BUILD
&cac::defaultExcep, // REPEATER_CONFIRM
&cac::defaultExcep, // CA_PROTO_CREATE_CHAN
&cac::defaultExcep, // CA_PROTO_CREATE_CHAN
&cac::writeNotifyExcep, // CA_PROTO_WRITE_NOTIFY
&cac::defaultExcep, // CA_PROTO_CLIENT_NAME
&cac::defaultExcep, // CA_PROTO_HOST_NAME
@@ -124,9 +124,9 @@ const cac::pExcepProtoStubTCP cac::tcpExcepJumpTableCAC [] =
//
// cac::cac ()
//
cac::cac (
epicsMutex & mutualExclusionIn,
epicsMutex & callbackControlIn,
cac::cac (
epicsMutex & mutualExclusionIn,
epicsMutex & callbackControlIn,
cacContextNotify & notifyIn ) :
_refLocalHostName ( localHostNameCache.getReference () ),
programBeginTime ( epicsTime::getCurrent() ),
@@ -134,7 +134,7 @@ cac::cac (
mutex ( mutualExclusionIn ),
cbMutex ( callbackControlIn ),
ipToAEngine ( ipAddrToAsciiEngine::allocate () ),
timerQueue ( epicsTimerQueueActive::allocate ( false,
timerQueue ( epicsTimerQueueActive::allocate ( false,
lowestPriorityLevelAbove(epicsThreadGetPrioritySelf()) ) ),
pUserName ( 0 ),
pudpiiu ( 0 ),
@@ -157,8 +157,8 @@ cac::cac (
long status;
/*
* Certain os, such as HPUX, do not unblock a socket system call
* when another thread asynchronously calls both shutdown() and
* Certain os, such as HPUX, do not unblock a socket system call
* when another thread asynchronously calls both shutdown() and
* close(). To solve this problem we need to employ OS specific
* mechanisms.
*/
@@ -179,7 +179,7 @@ cac::cac (
strncpy ( this->pUserName, tmp, len );
}
this->_serverPort =
this->_serverPort =
envGetInetPortConfigParam ( &EPICS_CA_SERVER_PORT,
static_cast <unsigned short> (CA_SERVER_PORT) );
@@ -224,7 +224,7 @@ cac::cac (
}
unsigned bufsPerArray = this->maxRecvBytesTCP / comBuf::capacityBytes ();
if ( bufsPerArray > 1u ) {
maxContigFrames = bufsPerArray *
maxContigFrames = bufsPerArray *
contiguousMsgCountWhichTriggersFlowControl;
}
}
@@ -275,8 +275,8 @@ cac::~cac ()
// this blocks until the UDP thread exits so that
// it will not sneak in any new clients
//
// lock intentionally not held here so that we dont deadlock
// waiting for the UDP thread to exit while it is waiting to
// lock intentionally not held here so that we dont deadlock
// waiting for the UDP thread to exit while it is waiting to
// get the lock.
{
epicsGuard < epicsMutex > cbGuard ( this->cbMutex );
@@ -298,11 +298,11 @@ cac::~cac ()
}
}
}
//
// wait for all tcp threads to exit
//
// this will block for oustanding sends to go out so dont
// this will block for oustanding sends to go out so dont
// hold a lock while waiting
//
{
@@ -323,7 +323,7 @@ cac::~cac ()
delete [] this->pUserName;
tsSLList < bhe > tmpBeaconList;
this->beaconTable.removeAll ( tmpBeaconList );
this->beaconTable.removeAll ( tmpBeaconList );
while ( bhe * pBHE = tmpBeaconList.get() ) {
pBHE->~bhe ();
this->bheFreeList.release ( pBHE );
@@ -338,7 +338,7 @@ cac::~cac ()
osiSockRelease ();
// its ok for channels and subscriptions to still
// exist at this point. The user created them and
// exist at this point. The user created them and
// its his responsibility to clean them up.
}
@@ -346,7 +346,7 @@ unsigned cac::lowestPriorityLevelAbove ( unsigned priority )
{
unsigned abovePriority;
epicsThreadBooleanStatus tbs;
tbs = epicsThreadLowestPriorityLevelAbove (
tbs = epicsThreadLowestPriorityLevelAbove (
priority, & abovePriority );
if ( tbs != epicsThreadBooleanStatusSuccess ) {
abovePriority = priority;
@@ -358,7 +358,7 @@ unsigned cac::highestPriorityLevelBelow ( unsigned priority )
{
unsigned belowPriority;
epicsThreadBooleanStatus tbs;
tbs = epicsThreadHighestPriorityLevelBelow (
tbs = epicsThreadHighestPriorityLevelBelow (
priority, & belowPriority );
if ( tbs != epicsThreadBooleanStatusSuccess ) {
belowPriority = priority;
@@ -379,21 +379,21 @@ void cac::flush ( epicsGuard < epicsMutex > & guard )
}
}
unsigned cac::circuitCount (
unsigned cac::circuitCount (
epicsGuard < epicsMutex > & guard ) const
{
guard.assertIdenticalMutex ( this->mutex );
return this->circuitList.count ();
}
void cac::show (
void cac::show (
epicsGuard < epicsMutex > & guard, unsigned level ) const
{
guard.assertIdenticalMutex ( this->mutex );
::printf ( "Channel Access Client Context at %p for user %s\n",
::printf ( "Channel Access Client Context at %p for user %s\n",
static_cast <const void *> ( this ), this->pUserName );
// this also supresses the "defined, but not used"
// this also supresses the "defined, but not used"
// warning message
::printf ( "\trevision \"%s\"\n", pVersionCAC );
@@ -451,7 +451,7 @@ void cac::beaconNotify ( const inetAddrID & addr, const epicsTime & currentTime,
/*
* return if the beacon period has not changed significantly
*/
if ( ! pBHE->updatePeriod ( guard, this->programBeginTime,
if ( ! pBHE->updatePeriod ( guard, this->programBeginTime,
currentTime, beaconNumber, protocolRevision ) ) {
return;
}
@@ -488,8 +488,8 @@ void cac::beaconNotify ( const inetAddrID & addr, const epicsTime & currentTime,
# endif
}
cacChannel & cac::createChannel (
epicsGuard < epicsMutex > & guard, const char * pName,
cacChannel & cac::createChannel (
epicsGuard < epicsMutex > & guard, const char * pName,
cacChannelNotify & chan, cacChannel::priLev pri )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -503,19 +503,19 @@ cacChannel & cac::createChannel (
}
if ( ! this->pudpiiu ) {
this->pudpiiu = new udpiiu (
guard, this->timerQueue, this->cbMutex,
this->pudpiiu = new udpiiu (
guard, this->timerQueue, this->cbMutex,
this->mutex, this->notify, *this, this->_serverPort,
this->searchDestList );
}
nciu * pNetChan = new ( this->channelFreeList )
nciu * pNetChan = new ( this->channelFreeList )
nciu ( *this, noopIIU, chan, pName, pri );
this->chanTable.idAssignAdd ( *pNetChan );
return *pNetChan;
}
bool cac::findOrCreateVirtCircuit (
bool cac::findOrCreateVirtCircuit (
epicsGuard < epicsMutex > & guard, const osiSockAddr & addr,
unsigned priority, tcpiiu *& piiu, unsigned minorVersionNumber,
SearchDestTCP * pSearchDest )
@@ -532,14 +532,14 @@ bool cac::findOrCreateVirtCircuit (
try {
autoPtrFreeList < tcpiiu, 32, epicsMutexNOOP > pnewiiu (
this->freeListVirtualCircuit,
new ( this->freeListVirtualCircuit ) tcpiiu (
*this, this->mutex, this->cbMutex, this->notify, this->connTMO,
this->timerQueue, addr, this->comBufMemMgr, minorVersionNumber,
new ( this->freeListVirtualCircuit ) tcpiiu (
*this, this->mutex, this->cbMutex, this->notify, this->connTMO,
this->timerQueue, addr, this->comBufMemMgr, minorVersionNumber,
this->ipToAEngine, priority, pSearchDest ) );
bhe * pBHE = this->beaconTable.lookup ( addr.ia );
if ( ! pBHE ) {
pBHE = new ( this->bheFreeList )
pBHE = new ( this->bheFreeList )
bhe ( this->mutex, epicsTime (), 0u, addr.ia );
if ( this->beaconTable.add ( *pBHE ) < 0 ) {
return newIIU;
@@ -553,13 +553,13 @@ bool cac::findOrCreateVirtCircuit (
newIIU = true;
}
catch ( std :: exception & except ) {
errlogPrintf (
errlogPrintf (
"CAC: exception during virtual circuit creation \"%s\"\n",
except.what () );
return newIIU;
}
catch ( ... ) {
errlogPrintf (
errlogPrintf (
"CAC: Nonstandard exception during virtual circuit creation\n" );
return newIIU;
}
@@ -567,9 +567,9 @@ bool cac::findOrCreateVirtCircuit (
return newIIU;
}
void cac::transferChanToVirtCircuit (
void cac::transferChanToVirtCircuit (
unsigned cid, unsigned sid,
ca_uint16_t typeCode, arrayElementCount count,
ca_uint16_t typeCode, arrayElementCount count,
unsigned minorVersionNumber, const osiSockAddr & addr,
const epicsTime & currentTime )
{
@@ -604,12 +604,12 @@ void cac::transferChanToVirtCircuit (
char acc[64];
pChan->getPIIU(guard)->getHostName ( guard, acc, sizeof ( acc ) );
msgForMultiplyDefinedPV * pMsg = new ( this->mdpvFreeList )
msgForMultiplyDefinedPV ( this->ipToAEngine,
msgForMultiplyDefinedPV ( this->ipToAEngine,
*this, pChan->pName ( guard ), acc );
// It is possible for the ioInitiate call below to
// call the callback directly if queue quota is exceeded.
// This callback takes the callback lock and therefore we
// must release the primary mutex here to avoid a lock
// must release the primary mutex here to avoid a lock
// hierarchy inversion.
epicsGuardRelease < epicsMutex > unguard ( guard );
pMsg->ioInitiate ( addr );
@@ -625,9 +625,9 @@ void cac::transferChanToVirtCircuit (
pChan->getPriority(guard), piiu, minorVersionNumber );
// must occur before moving to new iiu
pChan->getPIIU(guard)->uninstallChanDueToSuccessfulSearchResponse (
pChan->getPIIU(guard)->uninstallChanDueToSuccessfulSearchResponse (
guard, *pChan, currentTime );
piiu->installChannel (
piiu->installChannel (
guard, *pChan, sid, typeCode, count );
if ( newIIU ) {
@@ -635,14 +635,14 @@ void cac::transferChanToVirtCircuit (
}
}
void cac::destroyChannel (
void cac::destroyChannel (
epicsGuard < epicsMutex > & guard,
nciu & chan )
nciu & chan )
{
guard.assertIdenticalMutex ( this->mutex );
// uninstall channel so that recv threads
// will not start a new callback for this channel's IO.
// will not start a new callback for this channel's IO.
if ( this->chanTable.remove ( chan ) != & chan ) {
throw std::logic_error ( "Invalid channel identifier" );
}
@@ -650,9 +650,9 @@ void cac::destroyChannel (
this->channelFreeList.release ( & chan );
}
void cac::disconnectAllIO (
void cac::disconnectAllIO (
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard,
epicsGuard < epicsMutex > & guard,
nciu & chan, tsDLList < baseNMIU > & ioList )
{
cbGuard.assertIdenticalMutex ( this->cbMutex );
@@ -672,8 +672,8 @@ void cac::disconnectAllIO (
}
}
int cac :: printFormated (
epicsGuard < epicsMutex > & callbackControl,
int cac :: printFormated (
epicsGuard < epicsMutex > & callbackControl,
const char * pformat, ... ) const
{
va_list theArgs;
@@ -683,26 +683,26 @@ int cac :: printFormated (
return status;
}
netWriteNotifyIO & cac::writeNotifyRequest (
netWriteNotifyIO & cac::writeNotifyRequest (
epicsGuard < epicsMutex > & guard, nciu & chan, privateInterfaceForIO & icni,
unsigned type, arrayElementCount nElem, const void * pValue, cacWriteNotify & notifyIn )
{
guard.assertIdenticalMutex ( this->mutex );
autoPtrRecycle < netWriteNotifyIO > pIO (
guard, this->ioTable, *this,
autoPtrRecycle < netWriteNotifyIO > pIO (
guard, this->ioTable, *this,
netWriteNotifyIO::factory ( this->freeListWriteNotifyIO, icni, notifyIn ) );
this->ioTable.idAssignAdd ( *pIO );
chan.getPIIU(guard)->writeNotifyRequest (
chan.getPIIU(guard)->writeNotifyRequest (
guard, chan, *pIO, type, nElem, pValue );
return *pIO.release();
}
netReadNotifyIO & cac::readNotifyRequest (
netReadNotifyIO & cac::readNotifyRequest (
epicsGuard < epicsMutex > & guard, nciu & chan, privateInterfaceForIO & icni,
unsigned type, arrayElementCount nElem, cacReadNotify & notifyIn )
{
guard.assertIdenticalMutex ( this->mutex );
autoPtrRecycle < netReadNotifyIO > pIO (
autoPtrRecycle < netReadNotifyIO > pIO (
guard, this->ioTable, *this,
netReadNotifyIO::factory ( this->freeListReadNotifyIO, icni, notifyIn ) );
this->ioTable.idAssignAdd ( *pIO );
@@ -711,7 +711,8 @@ netReadNotifyIO & cac::readNotifyRequest (
}
bool cac::destroyIO (
epicsGuard < epicsMutex > & guard,
CallbackGuard & callbackGuard,
epicsGuard < epicsMutex > & guard,
const cacChannel::ioid & idIn, nciu & chan )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -720,18 +721,18 @@ bool cac::destroyIO (
if ( pIO ) {
class netSubscription * pSubscr = pIO->isSubscription ();
if ( pSubscr ) {
pSubscr->unsubscribeIfRequired ( guard, chan );
pSubscr->unsubscribeIfRequired ( guard, chan );
}
// this uninstalls from the list and destroys the IO
pIO->exception ( guard, *this,
ECA_CHANDESTROY, chan.pName ( guard ) );
return true;
}
}
return false;
}
void cac::ioShow (
void cac::ioShow (
epicsGuard < epicsMutex > & guard,
const cacChannel::ioid & idIn, unsigned level ) const
{
@@ -741,8 +742,8 @@ void cac::ioShow (
}
}
void cac::ioExceptionNotify (
unsigned idIn, int status, const char * pContext,
void cac::ioExceptionNotify (
unsigned idIn, int status, const char * pContext,
unsigned type, arrayElementCount count )
{
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -752,8 +753,8 @@ void cac::ioExceptionNotify (
}
}
void cac::ioExceptionNotifyAndUninstall (
unsigned idIn, int status, const char * pContext,
void cac::ioExceptionNotifyAndUninstall (
unsigned idIn, int status, const char * pContext,
unsigned type, arrayElementCount count )
{
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -763,38 +764,38 @@ void cac::ioExceptionNotifyAndUninstall (
}
}
void cac::recycleReadNotifyIO (
void cac::recycleReadNotifyIO (
epicsGuard < epicsMutex > & guard, netReadNotifyIO & io )
{
guard.assertIdenticalMutex ( this->mutex );
this->freeListReadNotifyIO.release ( & io );
}
void cac::recycleWriteNotifyIO (
void cac::recycleWriteNotifyIO (
epicsGuard < epicsMutex > & guard, netWriteNotifyIO & io )
{
guard.assertIdenticalMutex ( this->mutex );
this->freeListWriteNotifyIO.release ( & io );
}
void cac::recycleSubscription (
void cac::recycleSubscription (
epicsGuard < epicsMutex > & guard, netSubscription & io )
{
guard.assertIdenticalMutex ( this->mutex );
this->freeListSubscription.release ( & io );
}
netSubscription & cac::subscriptionRequest (
epicsGuard < epicsMutex > & guard,
netSubscription & cac::subscriptionRequest (
epicsGuard < epicsMutex > & guard,
nciu & chan, privateInterfaceForIO & privChan,
unsigned type,
arrayElementCount nElem, unsigned mask,
arrayElementCount nElem, unsigned mask,
cacStateNotify & notifyIn,
bool chanIsInstalled )
{
guard.assertIdenticalMutex ( this->mutex );
autoPtrRecycle < netSubscription > pIO (
guard, this->ioTable, *this,
autoPtrRecycle < netSubscription > pIO (
guard, this->ioTable, *this,
netSubscription::factory ( this->freeListSubscription,
privChan, type, nElem, mask, notifyIn ) );
this->ioTable.idAssignAdd ( *pIO );
@@ -804,23 +805,23 @@ netSubscription & cac::subscriptionRequest (
return *pIO.release ();
}
bool cac::versionAction ( callbackManager &, tcpiiu & iiu,
bool cac::versionAction ( callbackManager &, tcpiiu & iiu,
const epicsTime &, const caHdrLargeArray & msg, void * )
{
iiu.versionRespNotify ( msg );
return true;
}
bool cac::echoRespAction (
callbackManager & mgr, tcpiiu & iiu,
bool cac::echoRespAction (
callbackManager & mgr, tcpiiu & iiu,
const epicsTime & /* current */, const caHdrLargeArray &, void * )
{
iiu.probeResponseNotify ( mgr.cbGuard );
return true;
}
bool cac::writeNotifyRespAction (
callbackManager &, tcpiiu &,
bool cac::writeNotifyRespAction (
callbackManager &, tcpiiu &,
const epicsTime &, const caHdrLargeArray & hdr, void * )
{
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -837,7 +838,7 @@ bool cac::writeNotifyRespAction (
return true;
}
bool cac::readNotifyRespAction ( callbackManager &, tcpiiu & iiu,
bool cac::readNotifyRespAction ( callbackManager &, tcpiiu & iiu,
const epicsTime &, const caHdrLargeArray & hdr, void * pMsgBdy )
{
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -856,13 +857,13 @@ bool cac::readNotifyRespAction ( callbackManager &, tcpiiu & iiu,
baseNMIU * pmiu = this->ioTable.remove ( hdr.m_available );
//
// The IO destroy routines take the call back mutex
// when uninstalling and deleting the baseNMIU so there is
// The IO destroy routines take the call back mutex
// when uninstalling and deleting the baseNMIU so there is
// no need to worry here about the baseNMIU being deleted while
// it is in use here.
//
if ( pmiu ) {
// if its a circuit-becomes-responsive subscription update
// if its a circuit-becomes-responsive subscription update
// then we need to reinstall the IO into the table
netSubscription * pSubscr = pmiu->isSubscription ();
if ( pSubscr ) {
@@ -874,7 +875,7 @@ bool cac::readNotifyRespAction ( callbackManager &, tcpiiu & iiu,
* convert the data buffer from net
* format to host format
*/
caStatus = caNetConvert (
caStatus = caNetConvert (
hdr.m_dataType, pMsgBdy, pMsgBdy, false, hdr.m_count );
}
if ( caStatus == ECA_NORMAL ) {
@@ -882,7 +883,7 @@ bool cac::readNotifyRespAction ( callbackManager &, tcpiiu & iiu,
hdr.m_dataType, hdr.m_count, pMsgBdy );
}
else {
pmiu->exception ( guard, *this,
pmiu->exception ( guard, *this,
caStatus, "read failed",
hdr.m_dataType, hdr.m_count );
}
@@ -890,8 +891,8 @@ bool cac::readNotifyRespAction ( callbackManager &, tcpiiu & iiu,
return true;
}
bool cac::searchRespAction ( callbackManager &, tcpiiu & iiu,
const epicsTime & currentTime, const caHdrLargeArray & msg,
bool cac::searchRespAction ( callbackManager &, tcpiiu & iiu,
const epicsTime & currentTime, const caHdrLargeArray & msg,
void * /* pMsgBdy */ )
{
assert ( this->pudpiiu );
@@ -899,13 +900,13 @@ bool cac::searchRespAction ( callbackManager &, tcpiiu & iiu,
return true;
}
bool cac::eventRespAction ( callbackManager &, tcpiiu &iiu,
bool cac::eventRespAction ( callbackManager &, tcpiiu &iiu,
const epicsTime &, const caHdrLargeArray & hdr, void * pMsgBdy )
{
{
int caStatus;
/*
* m_postsize = 0 used to be a subscription cancel confirmation,
* m_postsize = 0 used to be a subscription cancel confirmation,
* but is now a noop because the IO block is immediately deleted
*/
if ( ! hdr.m_postsize ) {
@@ -926,8 +927,8 @@ bool cac::eventRespAction ( callbackManager &, tcpiiu &iiu,
}
//
// The IO destroy routines take the call back mutex
// when uninstalling and deleting the baseNMIU so there is
// The IO destroy routines take the call back mutex
// when uninstalling and deleting the baseNMIU so there is
// no need to worry here about the baseNMIU being deleted while
// it is in use here.
//
@@ -937,7 +938,7 @@ bool cac::eventRespAction ( callbackManager &, tcpiiu &iiu,
* convert the data buffer from net format to host format
*/
if ( caStatus == ECA_NORMAL ) {
caStatus = caNetConvert (
caStatus = caNetConvert (
hdr.m_dataType, pMsgBdy, pMsgBdy, false, hdr.m_count );
}
if ( caStatus == ECA_NORMAL ) {
@@ -945,7 +946,7 @@ bool cac::eventRespAction ( callbackManager &, tcpiiu &iiu,
hdr.m_dataType, hdr.m_count, pMsgBdy );
}
else {
pmiu->exception ( guard, *this, caStatus,
pmiu->exception ( guard, *this, caStatus,
"subscription update read failed",
hdr.m_dataType, hdr.m_count );
}
@@ -953,14 +954,14 @@ bool cac::eventRespAction ( callbackManager &, tcpiiu &iiu,
return true;
}
bool cac::readRespAction ( callbackManager &, tcpiiu &,
bool cac::readRespAction ( callbackManager &, tcpiiu &,
const epicsTime &, const caHdrLargeArray & hdr, void * pMsgBdy )
{
epicsGuard < epicsMutex > guard ( this->mutex );
baseNMIU * pmiu = this->ioTable.remove ( hdr.m_available );
//
// The IO destroy routines take the call back mutex
// when uninstalling and deleting the baseNMIU so there is
// The IO destroy routines take the call back mutex
// when uninstalling and deleting the baseNMIU so there is
// no need to worry here about the baseNMIU being deleted while
// it is in use here.
//
@@ -971,14 +972,14 @@ bool cac::readRespAction ( callbackManager &, tcpiiu &,
return true;
}
bool cac::clearChannelRespAction ( callbackManager &, tcpiiu &,
bool cac::clearChannelRespAction ( callbackManager &, tcpiiu &,
const epicsTime &, const caHdrLargeArray &, void * /* pMsgBody */ )
{
return true; // currently a noop
}
bool cac::defaultExcep (
callbackManager &, tcpiiu & iiu,
bool cac::defaultExcep (
callbackManager &, tcpiiu & iiu,
const caHdrLargeArray &, const char * pCtx, unsigned status )
{
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -990,69 +991,69 @@ bool cac::defaultExcep (
return true;
}
void cac::exception (
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard, int status,
void cac::exception (
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard, int status,
const char * pContext, const char * pFileName, unsigned lineNo )
{
cbGuard.assertIdenticalMutex ( this->cbMutex );
guard.assertIdenticalMutex ( this->mutex );
this->notify.exception ( guard, status, pContext,
this->notify.exception ( guard, status, pContext,
pFileName, lineNo );
}
bool cac::eventAddExcep (
callbackManager &, tcpiiu &,
const caHdrLargeArray &hdr,
bool cac::eventAddExcep (
callbackManager &, tcpiiu &,
const caHdrLargeArray &hdr,
const char *pCtx, unsigned status )
{
this->ioExceptionNotify ( hdr.m_available, status, pCtx,
this->ioExceptionNotify ( hdr.m_available, status, pCtx,
hdr.m_dataType, hdr.m_count );
return true;
}
bool cac::readExcep ( callbackManager &, tcpiiu &,
const caHdrLargeArray & hdr,
bool cac::readExcep ( callbackManager &, tcpiiu &,
const caHdrLargeArray & hdr,
const char * pCtx, unsigned status )
{
this->ioExceptionNotifyAndUninstall ( hdr.m_available,
this->ioExceptionNotifyAndUninstall ( hdr.m_available,
status, pCtx, hdr.m_dataType, hdr.m_count );
return true;
}
bool cac::writeExcep (
bool cac::writeExcep (
callbackManager & mgr,
tcpiiu &, const caHdrLargeArray & hdr,
tcpiiu &, const caHdrLargeArray & hdr,
const char * pCtx, unsigned status )
{
epicsGuard < epicsMutex > guard ( this->mutex );
nciu * pChan = this->chanTable.lookup ( hdr.m_available );
if ( pChan ) {
pChan->writeException ( mgr.cbGuard, guard, status, pCtx,
pChan->writeException ( mgr.cbGuard, guard, status, pCtx,
hdr.m_dataType, hdr.m_count );
}
return true;
}
bool cac::readNotifyExcep ( callbackManager &, tcpiiu &,
const caHdrLargeArray &hdr,
bool cac::readNotifyExcep ( callbackManager &, tcpiiu &,
const caHdrLargeArray &hdr,
const char *pCtx, unsigned status )
{
this->ioExceptionNotifyAndUninstall ( hdr.m_available,
this->ioExceptionNotifyAndUninstall ( hdr.m_available,
status, pCtx, hdr.m_dataType, hdr.m_count );
return true;
}
bool cac::writeNotifyExcep ( callbackManager &, tcpiiu &,
const caHdrLargeArray &hdr,
bool cac::writeNotifyExcep ( callbackManager &, tcpiiu &,
const caHdrLargeArray &hdr,
const char *pCtx, unsigned status )
{
this->ioExceptionNotifyAndUninstall ( hdr.m_available,
this->ioExceptionNotifyAndUninstall ( hdr.m_available,
status, pCtx, hdr.m_dataType, hdr.m_count );
return true;
}
bool cac::exceptionRespAction ( callbackManager & cbMutexIn, tcpiiu & iiu,
bool cac::exceptionRespAction ( callbackManager & cbMutexIn, tcpiiu & iiu,
const epicsTime &, const caHdrLargeArray & hdr, void * pMsgBdy )
{
const caHdr * pReq = reinterpret_cast < const caHdr * > ( pMsgBdy );
@@ -1069,7 +1070,7 @@ bool cac::exceptionRespAction ( callbackManager & cbMutexIn, tcpiiu & iiu,
req.m_available = AlignedWireRef < const epicsUInt32 > ( pReq->m_available );
const ca_uint32_t * pLW = reinterpret_cast < const ca_uint32_t * > ( pReq + 1 );
if ( req.m_postsize == 0xffff ) {
static const unsigned annexSize =
static const unsigned annexSize =
sizeof ( req.m_postsize ) + sizeof ( req.m_count );
bytesSoFar += annexSize;
if ( hdr.m_postsize < bytesSoFar ) {
@@ -1100,9 +1101,9 @@ bool cac::accessRightsRespAction (
nciu * pChan = this->chanTable.lookup ( hdr.m_cid );
if ( pChan ) {
unsigned ar = hdr.m_available;
caAccessRights accessRights (
( ar & CA_PROTO_ACCESS_RIGHT_READ ) ? true : false,
( ar & CA_PROTO_ACCESS_RIGHT_WRITE ) ? true : false);
caAccessRights accessRights (
( ar & CA_PROTO_ACCESS_RIGHT_READ ) ? true : false,
( ar & CA_PROTO_ACCESS_RIGHT_WRITE ) ? true : false);
pChan->accessRightsStateChange ( accessRights, mgr.cbGuard, guard );
}
@@ -1125,11 +1126,11 @@ bool cac::createChannelRespAction (
}
bool wasExpected = iiu.connectNotify ( guard, *pChan );
if ( wasExpected ) {
pChan->connect ( hdr.m_dataType, hdr.m_count, sidTmp,
pChan->connect ( hdr.m_dataType, hdr.m_count, sidTmp,
mgr.cbGuard, guard );
}
else {
errlogPrintf (
errlogPrintf (
"CA Client Library: Ignored duplicate create channel "
"response from CA server?\n" );
}
@@ -1140,10 +1141,10 @@ bool cac::createChannelRespAction (
iiu.clearChannelRequest ( guard, hdr.m_available, hdr.m_cid );
}
return true;
return true;
}
bool cac::verifyAndDisconnectChan (
bool cac::verifyAndDisconnectChan (
callbackManager & mgr, tcpiiu &,
const epicsTime &, const caHdrLargeArray & hdr, void * /* pMsgBody */ )
{
@@ -1168,18 +1169,18 @@ void cac::disconnectChannel (
chan.unresponsiveCircuitNotify ( cbGuard, guard );
}
bool cac::badTCPRespAction ( callbackManager &, tcpiiu & iiu,
bool cac::badTCPRespAction ( callbackManager &, tcpiiu & iiu,
const epicsTime &, const caHdrLargeArray & hdr, void * /* pMsgBody */ )
{
epicsGuard < epicsMutex > guard ( this->mutex );
char hostName[64];
iiu.getHostName ( guard, hostName, sizeof ( hostName ) );
errlogPrintf ( "CAC: Undecipherable TCP message ( bad response type %u ) from %s\n",
errlogPrintf ( "CAC: Undecipherable TCP message ( bad response type %u ) from %s\n",
hdr.m_cmmd, hostName );
return false;
}
bool cac::executeResponse ( callbackManager & mgr, tcpiiu & iiu,
bool cac::executeResponse ( callbackManager & mgr, tcpiiu & iiu,
const epicsTime & currentTime, caHdrLargeArray & hdr, char * pMshBody )
{
// execute the response message
@@ -1193,7 +1194,7 @@ bool cac::executeResponse ( callbackManager & mgr, tcpiiu & iiu,
return ( this->*pStub ) ( mgr, iiu, currentTime, hdr, pMshBody );
}
void cac::selfTest (
void cac::selfTest (
epicsGuard < epicsMutex > & guard ) const
{
guard.assertIdenticalMutex ( this->mutex );
@@ -1221,7 +1222,7 @@ void cac::destroyIIU ( tcpiiu & iiu )
pBHE->unregisterIIU ( guard, iiu );
}
}
assert ( this->pudpiiu );
iiu.disconnectAllChannels ( mgr.cbGuard, guard, *this->pudpiiu );
@@ -1233,7 +1234,7 @@ void cac::destroyIIU ( tcpiiu & iiu )
// so we must not hold the primary mutex here
//
// this waits for send/recv threads to exit
// this also uses the cac free lists so cac must wait
// this also uses the cac free lists so cac must wait
// for this to finish before it shuts down
iiu.~tcpiiu ();
@@ -1248,8 +1249,8 @@ void cac::destroyIIU ( tcpiiu & iiu )
// do not touch "this" after lock is released above
}
double cac::beaconPeriod (
epicsGuard < epicsMutex > & guard,
double cac::beaconPeriod (
epicsGuard < epicsMutex > & guard,
const nciu & chan ) const
{
const netiiu * pIIU = chan.getConstPIIU ( guard );
@@ -1266,8 +1267,8 @@ double cac::beaconPeriod (
return - DBL_MAX;
}
void cac::initiateConnect (
epicsGuard < epicsMutex > & guard,
void cac::initiateConnect (
epicsGuard < epicsMutex > & guard,
nciu & chan, netiiu * & piiu )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -1285,7 +1286,7 @@ void cacComBufMemoryManager::release ( void * pCadaver )
this->freeList.release ( pCadaver );
}
void cac::pvMultiplyDefinedNotify ( msgForMultiplyDefinedPV & mfmdpv,
void cac::pvMultiplyDefinedNotify ( msgForMultiplyDefinedPV & mfmdpv,
const char * pChannelName, const char * pAcc, const char * pRej )
{
char buf[256];

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 file LICENSE that is included with this distribution.
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -57,11 +57,11 @@ class netSubscription;
// is applied
class cacRecycle {
public:
virtual void recycleReadNotifyIO (
virtual void recycleReadNotifyIO (
epicsGuard < epicsMutex > &, netReadNotifyIO &io ) = 0;
virtual void recycleWriteNotifyIO (
virtual void recycleWriteNotifyIO (
epicsGuard < epicsMutex > &, netWriteNotifyIO &io ) = 0;
virtual void recycleSubscription (
virtual void recycleSubscription (
epicsGuard < epicsMutex > &, netSubscription &io ) = 0;
protected:
virtual ~cacRecycle() {}
@@ -96,85 +96,81 @@ private:
class callbackManager : public notifyGuard {
public:
callbackManager (
cacContextNotify &,
callbackManager (
cacContextNotify &,
epicsMutex & callbackControl );
epicsGuard < epicsMutex > cbGuard;
};
class cac :
class cac :
public cacContext,
private cacRecycle,
private cacRecycle,
private callbackForMultiplyDefinedPV
{
public:
cac (
epicsMutex & mutualExclusion,
epicsMutex & callbackControl,
cac (
epicsMutex & mutualExclusion,
epicsMutex & callbackControl,
cacContextNotify & );
virtual ~cac ();
// beacon management
void beaconNotify ( const inetAddrID & addr, const epicsTime & currentTime,
void beaconNotify ( const inetAddrID & addr, const epicsTime & currentTime,
ca_uint32_t beaconNumber, unsigned protocolRevision );
unsigned beaconAnomaliesSinceProgramStart (
epicsGuard < epicsMutex > & ) const;
// IO management
void flush ( epicsGuard < epicsMutex > & guard );
bool executeResponse ( callbackManager &, tcpiiu &,
bool executeResponse ( callbackManager &, tcpiiu &,
const epicsTime & currentTime, caHdrLargeArray &, char *pMsgBody );
// channel routines
void transferChanToVirtCircuit (
unsigned cid, unsigned sid,
ca_uint16_t typeCode, arrayElementCount count,
void transferChanToVirtCircuit (
unsigned cid, unsigned sid,
ca_uint16_t typeCode, arrayElementCount count,
unsigned minorVersionNumber, const osiSockAddr &,
const epicsTime & currentTime );
cacChannel & createChannel (
epicsGuard < epicsMutex > & guard, const char * pChannelName,
cacChannel & createChannel (
epicsGuard < epicsMutex > & guard, const char * pChannelName,
cacChannelNotify &, cacChannel::priLev );
void destroyChannel (
void destroyChannel (
epicsGuard < epicsMutex > &, nciu & );
void initiateConnect (
void initiateConnect (
epicsGuard < epicsMutex > &, nciu &, netiiu * & );
nciu * lookupChannel (
epicsGuard < epicsMutex > &, const cacChannel::ioid & );
// IO requests
netWriteNotifyIO & writeNotifyRequest (
netWriteNotifyIO & writeNotifyRequest (
epicsGuard < epicsMutex > &, nciu &, privateInterfaceForIO &,
unsigned type, arrayElementCount nElem, const void * pValue,
unsigned type, arrayElementCount nElem, const void * pValue,
cacWriteNotify & );
netReadNotifyIO & readNotifyRequest (
netReadNotifyIO & readNotifyRequest (
epicsGuard < epicsMutex > &, nciu &, privateInterfaceForIO &,
unsigned type, arrayElementCount nElem,
unsigned type, arrayElementCount nElem,
cacReadNotify & );
netSubscription & subscriptionRequest (
netSubscription & subscriptionRequest (
epicsGuard < epicsMutex > &, nciu &, privateInterfaceForIO &,
unsigned type, arrayElementCount nElem, unsigned mask,
unsigned type, arrayElementCount nElem, unsigned mask,
cacStateNotify &, bool channelIsInstalled );
bool destroyIO (
epicsGuard < epicsMutex > & guard,
const cacChannel::ioid & idIn,
CallbackGuard & callbackGuard,
epicsGuard < epicsMutex > & mutualExclusionGuard,
const cacChannel::ioid & idIn,
nciu & chan );
void disconnectAllIO (
void disconnectAllIO (
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard,
epicsGuard < epicsMutex > & guard,
nciu &, tsDLList < baseNMIU > & ioList );
void ioShow (
void ioShow (
epicsGuard < epicsMutex > & guard,
const cacChannel::ioid &id, unsigned level ) const;
// sync group routines
CASG * lookupCASG ( epicsGuard < epicsMutex > &, unsigned id );
void installCASG ( epicsGuard < epicsMutex > &, CASG & );
void uninstallCASG ( epicsGuard < epicsMutex > &, CASG & );
// exception generation
void exception (
epicsGuard < epicsMutex > & cbGuard,
void exception (
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard,
int status, const char * pContext,
const char * pFileName, unsigned lineNo );
@@ -189,11 +185,11 @@ public:
// diagnostics
unsigned circuitCount ( epicsGuard < epicsMutex > & ) const;
void show ( epicsGuard < epicsMutex > &, unsigned level ) const;
int printFormated (
epicsGuard < epicsMutex > & callbackControl,
int printFormated (
epicsGuard < epicsMutex > & callbackControl,
const char *pformat, ... ) const;
int varArgsPrintFormated (
epicsGuard < epicsMutex > & callbackControl,
int varArgsPrintFormated (
epicsGuard < epicsMutex > & callbackControl,
const char *pformat, va_list args ) const;
double connectionTimeout ( epicsGuard < epicsMutex > & );
@@ -210,17 +206,17 @@ public:
unsigned getInitializingThreadsPriority () const;
epicsMutex & mutexRef ();
void attachToClientCtx ();
void selfTest (
void selfTest (
epicsGuard < epicsMutex > & ) const;
double beaconPeriod (
double beaconPeriod (
epicsGuard < epicsMutex > &,
const nciu & chan ) const;
static unsigned lowestPriorityLevelAbove ( unsigned priority );
static unsigned highestPriorityLevelBelow ( unsigned priority );
void destroyIIU ( tcpiiu & iiu );
void destroyIIU ( tcpiiu & iiu );
const char * pLocalHostName ();
private:
epicsSingleton < localHostName > :: reference _refLocalHostName;
chronIntIdResTable < nciu > chanTable;
@@ -229,11 +225,11 @@ private:
// !!!! to maintain one IO table for all types of
// !!!! IO. It would probably be better to maintain
// !!!! an independent table for each IO type. The
// !!!! new adaptive sized hash table will not
// !!!! waste memory. Making this change will
// !!!! avoid virtual function overhead when
// !!!! new adaptive sized hash table will not
// !!!! waste memory. Making this change will
// !!!! avoid virtual function overhead when
// !!!! accessing the different types of IO. This
// !!!! approach would also probably be safer in
// !!!! approach would also probably be safer in
// !!!! terms of detecting damaged protocol.
//
chronIntIdResTable < baseNMIU > ioTable;
@@ -241,23 +237,23 @@ private:
resTable < tcpiiu, caServerID > serverTable;
tsDLList < tcpiiu > circuitList;
tsDLList < SearchDest > searchDestList;
tsFreeList
< class tcpiiu, 32, epicsMutexNOOP >
tsFreeList
< class tcpiiu, 32, epicsMutexNOOP >
freeListVirtualCircuit;
tsFreeList
< class netReadNotifyIO, 1024, epicsMutexNOOP >
tsFreeList
< class netReadNotifyIO, 1024, epicsMutexNOOP >
freeListReadNotifyIO;
tsFreeList
< class netWriteNotifyIO, 1024, epicsMutexNOOP >
tsFreeList
< class netWriteNotifyIO, 1024, epicsMutexNOOP >
freeListWriteNotifyIO;
tsFreeList
< class netSubscription, 1024, epicsMutexNOOP >
tsFreeList
< class netSubscription, 1024, epicsMutexNOOP >
freeListSubscription;
tsFreeList
< class nciu, 1024, epicsMutexNOOP >
tsFreeList
< class nciu, 1024, epicsMutexNOOP >
channelFreeList;
tsFreeList
< class msgForMultiplyDefinedPV, 16 >
tsFreeList
< class msgForMultiplyDefinedPV, 16 >
mdpvFreeList;
cacComBufMemoryManager comBufMemMgr;
bheFreeStore bheFreeList;
@@ -285,74 +281,74 @@ private:
unsigned iiuExistenceCount;
bool cacShutdownInProgress;
void recycleReadNotifyIO (
void recycleReadNotifyIO (
epicsGuard < epicsMutex > &, netReadNotifyIO &io );
void recycleWriteNotifyIO (
void recycleWriteNotifyIO (
epicsGuard < epicsMutex > &, netWriteNotifyIO &io );
void recycleSubscription (
void recycleSubscription (
epicsGuard < epicsMutex > &, netSubscription &io );
void disconnectChannel (
epicsGuard < epicsMutex > & cbGuard,
void disconnectChannel (
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard, nciu & chan );
void ioExceptionNotify ( unsigned id, int status,
void ioExceptionNotify ( unsigned id, int status,
const char * pContext, unsigned type, arrayElementCount count );
void ioExceptionNotifyAndUninstall ( unsigned id, int status,
void ioExceptionNotifyAndUninstall ( unsigned id, int status,
const char * pContext, unsigned type, arrayElementCount count );
void pvMultiplyDefinedNotify ( msgForMultiplyDefinedPV & mfmdpv,
void pvMultiplyDefinedNotify ( msgForMultiplyDefinedPV & mfmdpv,
const char * pChannelName, const char * pAcc, const char * pRej );
// recv protocol stubs
bool versionAction ( callbackManager &, tcpiiu &,
bool versionAction ( callbackManager &, tcpiiu &,
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
bool echoRespAction ( callbackManager &, tcpiiu &,
bool echoRespAction ( callbackManager &, tcpiiu &,
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
bool writeNotifyRespAction ( callbackManager &, tcpiiu &,
bool writeNotifyRespAction ( callbackManager &, tcpiiu &,
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
bool searchRespAction ( callbackManager &, tcpiiu &,
bool searchRespAction ( callbackManager &, tcpiiu &,
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
bool readNotifyRespAction ( callbackManager &, tcpiiu &,
bool readNotifyRespAction ( callbackManager &, tcpiiu &,
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
bool eventRespAction ( callbackManager &, tcpiiu &,
bool eventRespAction ( callbackManager &, tcpiiu &,
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
bool readRespAction ( callbackManager &, tcpiiu &,
bool readRespAction ( callbackManager &, tcpiiu &,
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
bool clearChannelRespAction ( callbackManager &, tcpiiu &,
bool clearChannelRespAction ( callbackManager &, tcpiiu &,
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
bool exceptionRespAction ( callbackManager &, tcpiiu &,
bool exceptionRespAction ( callbackManager &, tcpiiu &,
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
bool accessRightsRespAction ( callbackManager &, tcpiiu &,
bool accessRightsRespAction ( callbackManager &, tcpiiu &,
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
bool createChannelRespAction ( callbackManager &, tcpiiu &,
bool createChannelRespAction ( callbackManager &, tcpiiu &,
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
bool verifyAndDisconnectChan ( callbackManager &, tcpiiu &,
bool verifyAndDisconnectChan ( callbackManager &, tcpiiu &,
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
bool badTCPRespAction ( callbackManager &, tcpiiu &,
bool badTCPRespAction ( callbackManager &, tcpiiu &,
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
typedef bool ( cac::*pProtoStubTCP ) (
callbackManager &, tcpiiu &,
typedef bool ( cac::*pProtoStubTCP ) (
callbackManager &, tcpiiu &,
const epicsTime & currentTime, const caHdrLargeArray &, void *pMsgBdy );
static const pProtoStubTCP tcpJumpTableCAC [];
bool defaultExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
bool defaultExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
const char *pCtx, unsigned status );
bool eventAddExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
bool eventAddExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
const char *pCtx, unsigned status );
bool readExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
bool readExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
const char *pCtx, unsigned status );
bool writeExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
bool writeExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
const char *pCtx, unsigned status );
bool clearChanExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
bool clearChanExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
const char *pCtx, unsigned status );
bool readNotifyExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
bool readNotifyExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
const char *pCtx, unsigned status );
bool writeNotifyExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
bool writeNotifyExcep ( callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
const char *pCtx, unsigned status );
typedef bool ( cac::*pExcepProtoStubTCP ) (
callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
typedef bool ( cac::*pExcepProtoStubTCP ) (
callbackManager &, tcpiiu &iiu, const caHdrLargeArray &hdr,
const char *pCtx, unsigned status );
static const pExcepProtoStubTCP tcpExcepJumpTableCAC [];
@@ -375,8 +371,8 @@ inline epicsMutex & cac::mutexRef ()
return this->mutex;
}
inline int cac :: varArgsPrintFormated (
epicsGuard < epicsMutex > & callbackControl,
inline int cac :: varArgsPrintFormated (
epicsGuard < epicsMutex > & callbackControl,
const char *pformat, va_list args ) const
{
callbackControl.assertIdenticalMutex ( this->cbMutex );
@@ -435,14 +431,14 @@ inline notifyGuard::~notifyGuard ()
this->notify.callbackProcessingCompleteNotify ();
}
inline callbackManager::callbackManager (
inline callbackManager::callbackManager (
cacContextNotify & notify, epicsMutex & callbackControl ) :
notifyGuard ( notify ), cbGuard ( callbackControl )
{
}
inline nciu * cac::lookupChannel (
epicsGuard < epicsMutex > & guard,
epicsGuard < epicsMutex > & guard,
const cacChannel::ioid & idIn )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -458,11 +454,11 @@ inline unsigned cac ::
maxContiguousFrames ( epicsGuard < epicsMutex > & ) const
{
return maxContigFrames;
}
}
inline double cac ::
connectionTimeout ( epicsGuard < epicsMutex > & guard )
{
{
guard.assertIdenticalMutex ( this->mutex );
return this->connTMO;
}

View File

@@ -5,18 +5,18 @@
* 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.
\*************************************************************************/
/*
/*
*
*
*
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
*
*
* Copyright, 1986, The Regents of the University of California.
*
*
*
*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
@@ -74,9 +74,9 @@ public:
virtual ~cacWriteNotify () = 0;
virtual void completion ( epicsGuard < epicsMutex > & ) = 0;
// we should probably have a different vf for each type of exception ????
virtual void exception (
virtual void exception (
epicsGuard < epicsMutex > &,
int status, const char * pContext,
int status, const char * pContext,
unsigned type, arrayElementCount count ) = 0;
};
@@ -85,13 +85,13 @@ public:
class epicsShareClass cacReadNotify {
public:
virtual ~cacReadNotify () = 0;
virtual void completion (
epicsGuard < epicsMutex > &, unsigned type,
virtual void completion (
epicsGuard < epicsMutex > &, unsigned type,
arrayElementCount count, const void * pData ) = 0;
// we should probably have a different vf for each type of exception ????
virtual void exception (
epicsGuard < epicsMutex > &, int status,
const char * pContext, unsigned type,
virtual void exception (
epicsGuard < epicsMutex > &, int status,
const char * pContext, unsigned type,
arrayElementCount count ) = 0;
};
@@ -100,21 +100,21 @@ public:
class epicsShareClass cacStateNotify {
public:
virtual ~cacStateNotify () = 0;
virtual void current (
epicsGuard < epicsMutex > &, unsigned type,
virtual void current (
epicsGuard < epicsMutex > &, unsigned type,
arrayElementCount count, const void * pData ) = 0;
// we should probably have a different vf for each type of exception ????
virtual void exception (
epicsGuard < epicsMutex > &, int status,
const char *pContext, unsigned type,
virtual void exception (
epicsGuard < epicsMutex > &, int status,
const char *pContext, unsigned type,
arrayElementCount count ) = 0;
};
class caAccessRights {
public:
caAccessRights (
bool readPermit = false,
bool writePermit = false,
caAccessRights (
bool readPermit = false,
bool writePermit = false,
bool operatorConfirmationRequest = false);
void setReadPermit ();
void setWritePermit ();
@@ -138,20 +138,30 @@ public:
virtual void disconnectNotify ( epicsGuard < epicsMutex > & ) = 0;
virtual void serviceShutdownNotify (
epicsGuard < epicsMutex > & mutualExclusionGuard ) = 0;
virtual void accessRightsNotify (
virtual void accessRightsNotify (
epicsGuard < epicsMutex > &, const caAccessRights & ) = 0;
virtual void exception (
virtual void exception (
epicsGuard < epicsMutex > &, int status, const char *pContext ) = 0;
// we should probably have a different vf for each type of exception ????
virtual void readException (
virtual void readException (
epicsGuard < epicsMutex > &, int status, const char *pContext,
unsigned type, arrayElementCount count, void *pValue ) = 0;
// we should probably have a different vf for each type of exception ????
virtual void writeException (
virtual void writeException (
epicsGuard < epicsMutex > &, int status, const char * pContext,
unsigned type, arrayElementCount count ) = 0;
};
class CallbackGuard :
public epicsGuard < epicsMutex > {
public:
CallbackGuard ( epicsMutex & mutex ) :
epicsGuard < epicsMutex > ( mutex ) {}
private:
CallbackGuard ( const CallbackGuard & );
CallbackGuard & operator = ( const CallbackGuard & );
};
//
// Notes
// 1) This interface assumes that when a channel is deleted then all
@@ -174,43 +184,52 @@ public:
cacChannel ( cacChannelNotify & );
virtual void destroy (
CallbackGuard & callbackGuard,
epicsGuard < epicsMutex > & mutualExclusionGuard ) = 0;
cacChannelNotify & notify () const; // required ?????
virtual unsigned getName (
epicsGuard < epicsMutex > &,
epicsGuard < epicsMutex > &,
char * pBuf, unsigned bufLen ) const throw () = 0;
// !! deprecated, avoid use !!
virtual const char * pName (
epicsGuard < epicsMutex > & guard ) const throw () = 0;
virtual void show (
virtual void show (
epicsGuard < epicsMutex > &,
unsigned level ) const = 0;
virtual void initiateConnect (
epicsGuard < epicsMutex > & ) = 0;
virtual unsigned requestMessageBytesPending (
virtual unsigned requestMessageBytesPending (
epicsGuard < epicsMutex > & mutualExclusionGuard ) = 0;
virtual void flush (
virtual void flush (
epicsGuard < epicsMutex > & mutualExclusionGuard ) = 0;
virtual ioStatus read (
virtual ioStatus read (
epicsGuard < epicsMutex > &,
unsigned type, arrayElementCount count,
unsigned type, arrayElementCount count,
cacReadNotify &, ioid * = 0 ) = 0;
virtual void write (
virtual void write (
epicsGuard < epicsMutex > &,
unsigned type, arrayElementCount count,
unsigned type, arrayElementCount count,
const void *pValue ) = 0;
virtual ioStatus write (
virtual ioStatus write (
epicsGuard < epicsMutex > &,
unsigned type, arrayElementCount count,
unsigned type, arrayElementCount count,
const void *pValue, cacWriteNotify &, ioid * = 0 ) = 0;
virtual void subscribe (
epicsGuard < epicsMutex > &, unsigned type,
arrayElementCount count, unsigned mask, cacStateNotify &,
virtual void subscribe (
epicsGuard < epicsMutex > &, unsigned type,
arrayElementCount count, unsigned mask, cacStateNotify &,
ioid * = 0 ) = 0;
virtual void ioCancel (
// The primary mutex must be released when calling the user's
// callback, and therefore a finite interval exists when we are
// moving forward with the intent to call the users callback
// but the users IO could be deleted during this interval.
// To prevent the user's callback from being called after
// destroying his IO we must past a guard for the callback
// mutex here.
virtual void ioCancel (
CallbackGuard & callbackGuard,
epicsGuard < epicsMutex > & mutualExclusionGuard,
const ioid & ) = 0;
virtual void ioShow (
virtual void ioShow (
epicsGuard < epicsMutex > &,
const ioid &, unsigned level ) const = 0;
virtual short nativeType (
@@ -226,9 +245,9 @@ public:
virtual double receiveWatchdogDelay (
epicsGuard < epicsMutex > & ) const; // negative DBL_MAX if UKN
virtual bool ca_v42_ok (
epicsGuard < epicsMutex > & ) const;
epicsGuard < epicsMutex > & ) const;
virtual bool connected (
epicsGuard < epicsMutex > & ) const;
epicsGuard < epicsMutex > & ) const;
virtual unsigned getHostName (
epicsGuard < epicsMutex > &,
char * pBuf, unsigned bufLength ) const throw ();
@@ -261,11 +280,11 @@ private:
class epicsShareClass cacContext {
public:
virtual ~cacContext ();
virtual cacChannel & createChannel (
virtual cacChannel & createChannel (
epicsGuard < epicsMutex > &,
const char * pChannelName, cacChannelNotify &,
const char * pChannelName, cacChannelNotify &,
cacChannel::priLev = cacChannel::priorityDefault ) = 0;
virtual void flush (
virtual void flush (
epicsGuard < epicsMutex > & ) = 0;
virtual unsigned circuitCount (
epicsGuard < epicsMutex > & ) const = 0;
@@ -273,18 +292,18 @@ public:
epicsGuard < epicsMutex > & ) const = 0;
virtual unsigned beaconAnomaliesSinceProgramStart (
epicsGuard < epicsMutex > & ) const = 0;
virtual void show (
virtual void show (
epicsGuard < epicsMutex > &, unsigned level ) const = 0;
};
class epicsShareClass cacContextNotify {
public:
virtual ~cacContextNotify () = 0;
virtual cacContext & createNetworkContext (
virtual cacContext & createNetworkContext (
epicsMutex & mutualExclusion, epicsMutex & callbackControl ) = 0;
// we should probably have a different vf for each type of exception ????
virtual void exception (
epicsGuard < epicsMutex > &, int status, const char * pContext,
virtual void exception (
epicsGuard < epicsMutex > &, int status, const char * pContext,
const char * pFileName, unsigned lineNo ) = 0;
// perhaps this should be phased out in deference to the exception mechanism
virtual int varArgsPrintFormated ( const char * pformat, va_list args ) const = 0;
@@ -300,9 +319,9 @@ public:
class epicsShareClass cacService {
public:
virtual ~cacService () = 0;
virtual cacContext & contextCreate (
epicsMutex & mutualExclusion,
epicsMutex & callbackControl,
virtual cacContext & contextCreate (
epicsMutex & mutualExclusion,
epicsMutex & callbackControl,
cacContextNotify & ) = 0;
};
@@ -320,9 +339,9 @@ inline cacChannelNotify & cacChannel::notify () const
return this->callback;
}
inline caAccessRights::caAccessRights (
inline caAccessRights::caAccessRights (
bool readPermit, bool writePermit, bool operatorConfirmationRequest) :
f_readPermit ( readPermit ), f_writePermit ( writePermit ),
f_readPermit ( readPermit ), f_writePermit ( writePermit ),
f_operatorConfirmationRequest ( operatorConfirmationRequest ) {}
inline void caAccessRights::setReadPermit ()

View File

@@ -57,9 +57,9 @@ void getCallback::completion (
// fetch client context and destroy prior to releasing
// the lock and calling cb in case they destroy channel there
this->chan.getClientCtx().destroyGetCallback ( guard, *this );
{
if ( pFuncTmp ) {
epicsGuardRelease < epicsMutex > unguard ( guard );
( *pFuncTmp ) ( args );
pFuncTmp ( args );
}
}

View File

@@ -22,12 +22,12 @@
#include <ctype.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include "envDefs.h"
#include "epicsAssert.h"
#include "epicsStdioRedirect.h"
#include "errlog.h"
#include "osiWireFormat.h"

View File

@@ -63,9 +63,7 @@ static const unsigned contiguousMsgCountWhichTriggersFlowControl = 10u;
class caErrorCode {
public:
caErrorCode ( int status ) : code ( status ) {};
private:
int code;
caErrorCode ( int ) {};
};
/*

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.
\*************************************************************************/
/*
*
@@ -39,9 +39,9 @@
#include "db_access.h" // for INVALID_DB_REQ
#include "noopiiu.h"
nciu::nciu ( cac & cacIn, netiiu & iiuIn, cacChannelNotify & chanIn,
nciu::nciu ( cac & cacIn, netiiu & iiuIn, cacChannelNotify & chanIn,
const char *pNameIn, cacChannel::priLev pri ) :
cacChannel ( chanIn ),
cacChannel ( chanIn ),
cacCtx ( cacIn ),
piiu ( & iiuIn ),
sid ( UINT_MAX ),
@@ -57,7 +57,7 @@ nciu::nciu ( cac & cacIn, netiiu & iiuIn, cacChannelNotify & chanIn,
if ( nameLengthTmp > MAX_UDP_SEND - sizeof ( caHdr ) || nameLengthTmp > USHRT_MAX ) {
throw cacChannel::badString ();
}
if ( pri > 0xff ) {
throw cacChannel::badPriority ();
}
@@ -76,26 +76,28 @@ nciu::~nciu ()
// channels are created by the user, and only destroyed by the user
// using this routine
void nciu::destroy (
epicsGuard < epicsMutex > & guard )
{
CallbackGuard & callbackGuard,
epicsGuard < epicsMutex > & mutualExcusionGuard )
{
while ( baseNMIU * pNetIO = this->eventq.first () ) {
bool success = this->cacCtx.destroyIO ( guard, pNetIO->getId (), *this );
bool success = this->cacCtx.destroyIO ( callbackGuard, mutualExcusionGuard,
pNetIO->getId (), *this );
assert ( success );
}
// if the claim reply has not returned yet then we will issue
// the clear channel request to the server when the claim reply
// arrives and there is no matching nciu in the client
if ( this->channelNode::isInstalledInServer ( guard ) ) {
this->getPIIU(guard)->clearChannelRequest (
guard, this->sid, this->id );
if ( this->channelNode::isInstalledInServer ( mutualExcusionGuard ) ) {
this->getPIIU(mutualExcusionGuard)->clearChannelRequest (
mutualExcusionGuard, this->sid, this->id );
}
this->piiu->uninstallChan ( guard, *this );
this->cacCtx.destroyChannel ( guard, *this );
this->piiu->uninstallChan ( mutualExcusionGuard, *this );
this->cacCtx.destroyChannel ( mutualExcusionGuard, *this );
}
void nciu::operator delete ( void * )
{
{
// Visual C++ .net appears to require operator delete if
// placement operator delete is defined? I smell a ms rat
// because if I declare placement new and delete, but
@@ -105,15 +107,15 @@ void nciu::operator delete ( void * )
__FILE__, __LINE__ );
}
void nciu::initiateConnect (
void nciu::initiateConnect (
epicsGuard < epicsMutex > & guard )
{
{
this->cacCtx.initiateConnect ( guard, *this, this->piiu );
}
void nciu::connect ( unsigned nativeType,
unsigned nativeCount, unsigned sidIn,
epicsGuard < epicsMutex > & /* cbGuard */,
void nciu::connect ( unsigned nativeType,
unsigned nativeCount, unsigned sidIn,
epicsGuard < epicsMutex > & /* cbGuard */,
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
@@ -127,7 +129,7 @@ void nciu::connect ( unsigned nativeType,
/*
* if less than v4.1 then the server will never
* send access rights and there will always be access
* send access rights and there will always be access
*/
bool v41Ok = this->piiu->ca_v41_ok ( guard );
if ( ! v41Ok ) {
@@ -138,49 +140,49 @@ void nciu::connect ( unsigned nativeType,
/*
* if less than v4.1 then the server will never
* send access rights and we know that there
* will always be access and also need to call
* will always be access and also need to call
* their call back here
*/
if ( ! v41Ok ) {
this->notify().accessRightsNotify (
this->notify().accessRightsNotify (
guard, this->accessRightState );
}
// channel uninstal routine grabs the callback lock so
// a channel will not be deleted while a call back is
// a channel will not be deleted while a call back is
// in progress
//
// the callback lock is also taken when a channel
// disconnects to prevent a race condition with the
// the callback lock is also taken when a channel
// disconnects to prevent a race condition with the
// code below - ie we hold the callback lock here
// so a chanel cant be destroyed out from under us.
this->notify().connectNotify ( guard );
}
void nciu::unresponsiveCircuitNotify (
epicsGuard < epicsMutex > & cbGuard,
void nciu::unresponsiveCircuitNotify (
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard )
{
ioid tmpId = this->getId ();
cac & caRefTmp = this->cacCtx;
guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
this->cacCtx.disconnectAllIO ( cbGuard, guard,
this->cacCtx.disconnectAllIO ( cbGuard, guard,
*this, this->eventq );
this->notify().disconnectNotify ( guard );
// if they destroy the channel in their disconnect
// if they destroy the channel in their disconnect
// handler then we have to be very careful to not
// touch this object if it has been destroyed
nciu * pChan = caRefTmp.lookupChannel ( guard, tmpId );
if ( pChan ) {
caAccessRights noRights;
pChan->notify().accessRightsNotify ( guard, noRights );
// likewise, they might destroy the channel in their access rights
// handler so we have to be very careful to not touch this
// likewise, they might destroy the channel in their access rights
// handler so we have to be very careful to not touch this
// object from here on down
}
}
void nciu::setServerAddressUnknown ( netiiu & newiiu,
void nciu::setServerAddressUnknown ( netiiu & newiiu,
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
@@ -193,8 +195,8 @@ void nciu::setServerAddressUnknown ( netiiu & newiiu,
this->accessRightState.clrWritePermit();
}
void nciu::accessRightsStateChange (
const caAccessRights & arIn, epicsGuard < epicsMutex > & /* cbGuard */,
void nciu::accessRightsStateChange (
const caAccessRights & arIn, epicsGuard < epicsMutex > & /* cbGuard */,
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
@@ -204,7 +206,7 @@ void nciu::accessRightsStateChange (
// the channel delete routine takes the call back lock so
// that this will not be called when the channel is being
// deleted.
//
//
this->notify().accessRightsNotify ( guard, this->accessRightState );
}
@@ -213,7 +215,7 @@ void nciu::accessRightsStateChange (
*/
bool nciu::searchMsg ( epicsGuard < epicsMutex > & guard )
{
bool success = this->piiu->searchMsg (
bool success = this->piiu->searchMsg (
guard, this->getId (), this->pNameStr, this->nameLength );
if ( success ) {
if ( this->retry < UINT_MAX ) {
@@ -256,21 +258,21 @@ unsigned nciu::nameLen (
return this->nameLength;
}
unsigned nciu::requestMessageBytesPending (
unsigned nciu::requestMessageBytesPending (
epicsGuard < epicsMutex > & guard )
{
return piiu->requestMessageBytesPending ( guard );
}
void nciu::flush (
void nciu::flush (
epicsGuard < epicsMutex > & guard )
{
piiu->flush ( guard );
}
cacChannel::ioStatus nciu::read (
cacChannel::ioStatus nciu::read (
epicsGuard < epicsMutex > & guard,
unsigned type, arrayElementCount countIn,
unsigned type, arrayElementCount countIn,
cacReadNotify &notify, ioid *pId )
{
guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
@@ -292,7 +294,7 @@ cacChannel::ioStatus nciu::read (
throw cacChannel::badType ();
}
netReadNotifyIO & io = this->cacCtx.readNotifyRequest (
netReadNotifyIO & io = this->cacCtx.readNotifyRequest (
guard, *this, *this, type, countIn, notify );
if ( pId ) {
*pId = io.getId ();
@@ -314,7 +316,7 @@ void nciu::stringVerify ( const char *pStr, const unsigned count )
}
}
void nciu::write (
void nciu::write (
epicsGuard < epicsMutex > & guard,
unsigned type, arrayElementCount countIn, const void * pValue )
{
@@ -337,8 +339,8 @@ void nciu::write (
this->piiu->writeRequest ( guard, *this, type, countIn, pValue );
}
cacChannel::ioStatus nciu::write (
epicsGuard < epicsMutex > & guard, unsigned type, arrayElementCount countIn,
cacChannel::ioStatus nciu::write (
epicsGuard < epicsMutex > & guard, unsigned type, arrayElementCount countIn,
const void * pValue, cacWriteNotify & notify, ioid * pId )
{
// make sure that they get this and not "no write access"
@@ -356,7 +358,7 @@ cacChannel::ioStatus nciu::write (
nciu::stringVerify ( (char *) pValue, countIn );
}
netWriteNotifyIO & io = this->cacCtx.writeNotifyRequest (
netWriteNotifyIO & io = this->cacCtx.writeNotifyRequest (
guard, *this, *this, type, countIn, pValue, notify );
if ( pId ) {
*pId = io.getId ();
@@ -365,13 +367,13 @@ cacChannel::ioStatus nciu::write (
return cacChannel::iosAsynch;
}
void nciu::subscribe (
epicsGuard < epicsMutex > & guard, unsigned type,
arrayElementCount nElem, unsigned mask,
void nciu::subscribe (
epicsGuard < epicsMutex > & guard, unsigned type,
arrayElementCount nElem, unsigned mask,
cacStateNotify & notify, ioid *pId )
{
netSubscription & io = this->cacCtx.subscriptionRequest (
guard, *this, *this, type, nElem, mask, notify,
netSubscription & io = this->cacCtx.subscriptionRequest (
guard, *this, *this, type, nElem, mask, notify,
this->channelNode::isInstalledInServer ( guard ) );
this->eventq.add ( io );
if ( pId ) {
@@ -379,24 +381,27 @@ void nciu::subscribe (
}
}
void nciu::ioCancel (
epicsGuard < epicsMutex > & guard, const ioid & idIn )
void nciu::ioCancel (
CallbackGuard & callbackGuard,
epicsGuard < epicsMutex > & mutualExclusionGuard,
const ioid & idIn )
{
this->cacCtx.destroyIO ( guard, idIn, *this );
this->cacCtx.destroyIO ( callbackGuard,
mutualExclusionGuard, idIn, *this );
}
void nciu::ioShow (
epicsGuard < epicsMutex > & guard,
void nciu::ioShow (
epicsGuard < epicsMutex > & guard,
const ioid &idIn, unsigned level ) const
{
this->cacCtx.ioShow ( guard, idIn, level );
}
unsigned nciu::getHostName (
unsigned nciu::getHostName (
epicsGuard < epicsMutex > & guard,
char *pBuf, unsigned bufLength ) const throw ()
{
return this->piiu->getHostName (
{
return this->piiu->getHostName (
guard, pBuf, bufLength );
}
@@ -424,7 +429,7 @@ short nciu::nativeType (
return type;
}
arrayElementCount nciu::nativeElementCount (
arrayElementCount nciu::nativeElementCount (
epicsGuard < epicsMutex > & guard ) const
{
arrayElementCount countOut = 0ul;
@@ -472,20 +477,20 @@ void nciu::show ( unsigned level ) const
this->show ( guard, level );
}
void nciu::show (
void nciu::show (
epicsGuard < epicsMutex > & guard, unsigned level ) const
{
if ( this->connected ( guard ) ) {
char hostNameTmp [256];
this->getHostName ( guard, hostNameTmp, sizeof ( hostNameTmp ) );
::printf ( "Channel \"%s\", connected to server %s",
::printf ( "Channel \"%s\", connected to server %s",
this->pNameStr, hostNameTmp );
if ( level > 1u ) {
int tmpTypeCode = static_cast < int > ( this->typeCode );
::printf ( ", native type %s, native element count %u",
dbf_type_to_text ( tmpTypeCode ), this->count );
::printf ( ", %sread access, %swrite access",
this->accessRightState.readPermit() ? "" : "no ",
::printf ( ", %sread access, %swrite access",
this->accessRightState.readPermit() ? "" : "no ",
this->accessRightState.writePermit() ? "" : "no ");
}
::printf ( "\n" );
@@ -495,7 +500,7 @@ void nciu::show (
}
if ( level > 2u ) {
::printf ( "\tnetwork IO pointer = %p\n",
::printf ( "\tnetwork IO pointer = %p\n",
static_cast <void *> ( this->piiu ) );
::printf ( "\tserver identifier %u\n", this->sid );
::printf ( "\tsearch retry number=%u\n", this->retry );
@@ -503,7 +508,7 @@ void nciu::show (
}
}
void nciu::ioCompletionNotify (
void nciu::ioCompletionNotify (
epicsGuard < epicsMutex > &, class baseNMIU & io )
{
this->eventq.remove ( io );
@@ -544,7 +549,7 @@ void nciu::sendSubscriptionUpdateRequests ( epicsGuard < epicsMutex > & guard )
pNetIO->forceSubscriptionUpdate ( guard, *this );
}
catch ( ... ) {
errlogPrintf (
errlogPrintf (
"CAC: failed to send subscription update request "
"during channel connect\n" );
}
@@ -552,68 +557,68 @@ void nciu::sendSubscriptionUpdateRequests ( epicsGuard < epicsMutex > & guard )
}
}
void nciu::disconnectAllIO (
epicsGuard < epicsMutex > & cbGuard,
void nciu::disconnectAllIO (
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard )
{
this->cacCtx.disconnectAllIO ( cbGuard, guard,
this->cacCtx.disconnectAllIO ( cbGuard, guard,
*this, this->eventq );
}
void nciu::serviceShutdownNotify (
epicsGuard < epicsMutex > & callbackControlGuard,
epicsGuard < epicsMutex > & callbackControlGuard,
epicsGuard < epicsMutex > & mutualExclusionGuard )
{
this->setServerAddressUnknown ( noopIIU, mutualExclusionGuard );
this->notify().serviceShutdownNotify ( mutualExclusionGuard );
}
void channelNode::setRespPendingState (
epicsGuard < epicsMutex > &, unsigned index )
void channelNode::setRespPendingState (
epicsGuard < epicsMutex > &, unsigned index )
{
this->listMember =
this->listMember =
static_cast < channelNode::channelState >
( channelNode::cs_searchRespPending0 + index );
if ( this->listMember > cs_searchRespPending17 ) {
throw std::runtime_error (
throw std::runtime_error (
"resp search timer index out of bounds" );
}
}
void channelNode::setReqPendingState (
epicsGuard < epicsMutex > &, unsigned index )
void channelNode::setReqPendingState (
epicsGuard < epicsMutex > &, unsigned index )
{
this->listMember =
this->listMember =
static_cast < channelNode::channelState >
( channelNode::cs_searchReqPending0 + index );
if ( this->listMember > cs_searchReqPending17 ) {
throw std::runtime_error (
throw std::runtime_error (
"req search timer index out of bounds" );
}
}
unsigned channelNode::getMaxSearchTimerCount ()
unsigned channelNode::getMaxSearchTimerCount ()
{
return epicsMin (
return epicsMin (
cs_searchReqPending17 - cs_searchReqPending0,
cs_searchRespPending17 - cs_searchRespPending0 ) + 1u;
}
unsigned channelNode::getSearchTimerIndex (
unsigned channelNode::getSearchTimerIndex (
epicsGuard < epicsMutex > & )
{
channelNode::channelState chanState = this->listMember;
unsigned index = 0u;
if ( chanState >= cs_searchReqPending0 &&
if ( chanState >= cs_searchReqPending0 &&
chanState <= cs_searchReqPending17 ) {
index = chanState - cs_searchReqPending0;
}
else if ( chanState >= cs_searchRespPending0 &&
else if ( chanState >= cs_searchRespPending0 &&
chanState <= cs_searchRespPending17 ) {
index = chanState - cs_searchRespPending0;
}
else {
throw std::runtime_error (
throw std::runtime_error (
"channel was expected to be in a search timer, but wasnt" );;
}
return index;

View File

@@ -5,24 +5,24 @@
* 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.
\*************************************************************************/
/*
/*
*
*
*
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
*
*
* Copyright, 1986, The Regents of the University of California.
*
*
*
*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
*/
#ifndef nciuh
#ifndef nciuh
#define nciuh
#ifdef epicsExportSharedSymbols
@@ -123,45 +123,45 @@ private:
class privateInterfaceForIO {
public:
virtual void ioCompletionNotify (
virtual void ioCompletionNotify (
epicsGuard < epicsMutex > &, class baseNMIU & ) = 0;
virtual arrayElementCount nativeElementCount (
virtual arrayElementCount nativeElementCount (
epicsGuard < epicsMutex > & ) const = 0;
virtual bool connected ( epicsGuard < epicsMutex > & ) const = 0;
protected:
virtual ~privateInterfaceForIO() {}
};
class nciu :
class nciu :
public cacChannel,
public chronIntIdRes < nciu >,
public chronIntIdRes < nciu >,
public channelNode,
private privateInterfaceForIO {
public:
nciu ( cac &, netiiu &, cacChannelNotify &,
nciu ( cac &, netiiu &, cacChannelNotify &,
const char * pNameIn, cacChannel::priLev );
~nciu ();
void connect ( unsigned nativeType,
unsigned nativeCount, unsigned sid,
epicsGuard < epicsMutex > & cbGuard,
void connect ( unsigned nativeType,
unsigned nativeCount, unsigned sid,
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard );
void connect ( epicsGuard < epicsMutex > & cbGuard,
void connect ( epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard );
void unresponsiveCircuitNotify (
epicsGuard < epicsMutex > & cbGuard,
void unresponsiveCircuitNotify (
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard );
void circuitHangupNotify ( class udpiiu &,
epicsGuard < epicsMutex > & cbGuard,
void circuitHangupNotify ( class udpiiu &,
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard );
void setServerAddressUnknown (
void setServerAddressUnknown (
netiiu & newiiu, epicsGuard < epicsMutex > & guard );
bool searchMsg (
bool searchMsg (
epicsGuard < epicsMutex > & );
void serviceShutdownNotify (
epicsGuard < epicsMutex > & callbackControlGuard,
epicsGuard < epicsMutex > & callbackControlGuard,
epicsGuard < epicsMutex > & mutualExclusionGuard );
void accessRightsStateChange ( const caAccessRights &,
epicsGuard < epicsMutex > & cbGuard,
void accessRightsStateChange ( const caAccessRights &,
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard );
ca_uint32_t getSID (
epicsGuard < epicsMutex > & ) const;
@@ -172,12 +172,12 @@ public:
const netiiu * getConstPIIU (
epicsGuard < epicsMutex > & ) const;
cac & getClient ();
void searchReplySetUp ( netiiu &iiu, unsigned sidIn,
void searchReplySetUp ( netiiu &iiu, unsigned sidIn,
ca_uint16_t typeIn, arrayElementCount countIn,
epicsGuard < epicsMutex > & );
void show (
void show (
unsigned level ) const;
void show (
void show (
epicsGuard < epicsMutex > &,
unsigned level ) const;
unsigned getName (
@@ -189,22 +189,22 @@ public:
epicsGuard < epicsMutex > & ) const;
unsigned getHostName (
epicsGuard < epicsMutex > &,
char * pBuf, unsigned bufLen ) const throw ();
void writeException (
char * pBuf, unsigned bufLen ) const throw ();
void writeException (
epicsGuard < epicsMutex > &, epicsGuard < epicsMutex > &,
int status, const char *pContext, unsigned type, arrayElementCount count );
cacChannel::priLev getPriority (
epicsGuard < epicsMutex > & ) const;
void * operator new (
void * operator new (
size_t size, tsFreeList < class nciu, 1024, epicsMutexNOOP > & );
epicsPlacementDeleteOperator (
( void *, tsFreeList < class nciu, 1024, epicsMutexNOOP > & ))
//arrayElementCount nativeElementCount ( epicsGuard < epicsMutex > & ) const;
void resubscribe ( epicsGuard < epicsMutex > & );
void sendSubscriptionUpdateRequests ( epicsGuard < epicsMutex > & );
void disconnectAllIO (
void disconnectAllIO (
epicsGuard < epicsMutex > &, epicsGuard < epicsMutex > & );
bool connected ( epicsGuard < epicsMutex > & ) const;
bool connected ( epicsGuard < epicsMutex > & ) const;
unsigned getcount() const { return count; }
private:
@@ -218,38 +218,47 @@ private:
unsigned retry; // search retry number
unsigned short nameLength; // channel name length
ca_uint16_t typeCode;
ca_uint8_t priority;
ca_uint8_t priority;
virtual void destroy (
CallbackGuard & callbackGuard,
epicsGuard < epicsMutex > & mutualExclusionGuard );
void initiateConnect (
epicsGuard < epicsMutex > & );
unsigned requestMessageBytesPending (
unsigned requestMessageBytesPending (
epicsGuard < epicsMutex > & mutualExclusionGuard );
void flush (
void flush (
epicsGuard < epicsMutex > & mutualExclusionGuard );
ioStatus read (
ioStatus read (
epicsGuard < epicsMutex > &,
unsigned type, arrayElementCount count,
unsigned type, arrayElementCount count,
cacReadNotify &, ioid * );
void write (
void write (
epicsGuard < epicsMutex > &,
unsigned type, arrayElementCount count,
unsigned type, arrayElementCount count,
const void *pValue );
ioStatus write (
ioStatus write (
epicsGuard < epicsMutex > &,
unsigned type, arrayElementCount count,
unsigned type, arrayElementCount count,
const void *pValue, cacWriteNotify &, ioid * );
void subscribe (
epicsGuard < epicsMutex > & guard,
unsigned type, arrayElementCount nElem,
void subscribe (
epicsGuard < epicsMutex > & guard,
unsigned type, arrayElementCount nElem,
unsigned mask, cacStateNotify &notify, ioid * );
virtual void ioCancel (
// The primary mutex must be released when calling the user's
// callback, and therefore a finite interval exists when we are
// moving forward with the intent to call the users callback
// but the users IO could be deleted during this interval.
// To prevent the user's callback from being called after
// destroying his IO we must past a guard for the callback
// mutex here.
virtual void ioCancel (
CallbackGuard & callbackGuard,
epicsGuard < epicsMutex > & mutualExclusionGuard,
const ioid & );
void ioShow (
void ioShow (
epicsGuard < epicsMutex > &,
const ioid &, unsigned level ) const;
short nativeType (
short nativeType (
epicsGuard < epicsMutex > & ) const;
caAccessRights accessRights (
epicsGuard < epicsMutex > & ) const;
@@ -264,7 +273,7 @@ private:
arrayElementCount nativeElementCount (
epicsGuard < epicsMutex > & ) const;
static void stringVerify ( const char *pStr, const unsigned count );
void ioCompletionNotify (
void ioCompletionNotify (
epicsGuard < epicsMutex > &, class baseNMIU & );
const char * pHostName (
epicsGuard < epicsMutex > & guard ) const throw ();
@@ -273,16 +282,16 @@ private:
void operator delete ( void * );
};
inline void * nciu::operator new ( size_t size,
inline void * nciu::operator new ( size_t size,
tsFreeList < class nciu, 1024, epicsMutexNOOP > & freeList )
{
{
return freeList.allocate ( size );
}
#ifdef CXX_PLACEMENT_DELETE
inline void nciu::operator delete ( void * pCadaver,
tsFreeList < class nciu, 1024, epicsMutexNOOP > & freeList )
{
{
freeList.release ( pCadaver, sizeof ( nciu ) );
}
#endif
@@ -300,19 +309,19 @@ inline ca_uint32_t nciu::getCID (
}
// this is to only be used by early protocol revisions
inline void nciu::connect ( epicsGuard < epicsMutex > & cbGuard,
inline void nciu::connect ( epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard )
{
this->connect ( this->typeCode, this->count,
this->connect ( this->typeCode, this->count,
this->sid, cbGuard, guard );
}
inline void nciu::searchReplySetUp ( netiiu &iiu, unsigned sidIn,
inline void nciu::searchReplySetUp ( netiiu &iiu, unsigned sidIn,
ca_uint16_t typeIn, arrayElementCount countIn,
epicsGuard < epicsMutex > & )
{
this->piiu = & iiu;
this->typeCode = typeIn;
this->typeCode = typeIn;
this->count = countIn;
this->sid = sidIn;
}
@@ -323,13 +332,13 @@ inline netiiu * nciu::getPIIU (
return this->piiu;
}
inline void nciu::writeException (
epicsGuard < epicsMutex > & /* cbGuard */,
epicsGuard < epicsMutex > & guard,
int status, const char * pContext,
inline void nciu::writeException (
epicsGuard < epicsMutex > & /* cbGuard */,
epicsGuard < epicsMutex > & guard,
int status, const char * pContext,
unsigned typeIn, arrayElementCount countIn )
{
this->notify().writeException ( guard,
this->notify().writeException ( guard,
status, pContext, typeIn, countIn );
}
@@ -357,15 +366,15 @@ inline channelNode::channelNode () :
inline bool channelNode::isConnected ( epicsGuard < epicsMutex > & ) const
{
return
this->listMember == cs_connected ||
return
this->listMember == cs_connected ||
this->listMember == cs_subscripReqPend ||
this->listMember == cs_subscripUpdateReqPend;
}
inline bool channelNode::isInstalledInServer ( epicsGuard < epicsMutex > & ) const
{
return
return
this->listMember == cs_connected ||
this->listMember == cs_subscripReqPend ||
this->listMember == cs_unrespCircuit ||

View File

@@ -5,19 +5,19 @@
* 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.
\*************************************************************************/
/*
/*
*
*
*
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
*
*
* Copyright, The Regents of the University of California.
*
*
*
*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
@@ -48,92 +48,94 @@
struct oldChannelNotify : private cacChannelNotify {
public:
oldChannelNotify (
epicsGuard < epicsMutex > &, struct ca_client_context &,
const char * pName, caCh * pConnCallBackIn,
oldChannelNotify (
epicsGuard < epicsMutex > &, struct ca_client_context &,
const char * pName, caCh * pConnCallBackIn,
void * pPrivateIn, capri priority );
void destructor (
epicsGuard < epicsMutex > & guard );
void destructor (
CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & mutexGuard );
// legacy C API
friend unsigned epicsShareAPI ca_get_host_name (
friend unsigned epicsShareAPI ca_get_host_name (
chid pChan, char * pBuf, unsigned bufLength );
friend const char * epicsShareAPI ca_host_name (
friend const char * epicsShareAPI ca_host_name (
chid pChan );
friend const char * epicsShareAPI ca_name (
friend const char * epicsShareAPI ca_name (
chid pChan );
friend void epicsShareAPI ca_set_puser (
friend void epicsShareAPI ca_set_puser (
chid pChan, void * puser );
friend void * epicsShareAPI ca_puser (
friend void * epicsShareAPI ca_puser (
chid pChan );
friend int epicsShareAPI ca_change_connection_event (
friend int epicsShareAPI ca_change_connection_event (
chid pChan, caCh * pfunc );
friend int epicsShareAPI ca_replace_access_rights_event (
friend int epicsShareAPI ca_replace_access_rights_event (
chid pChan, caArh *pfunc );
friend int epicsShareAPI ca_array_get ( chtype type,
friend int epicsShareAPI ca_array_get ( chtype type,
arrayElementCount count, chid pChan, void * pValue );
friend int epicsShareAPI ca_array_get_callback ( chtype type,
friend int epicsShareAPI ca_array_get_callback ( chtype type,
arrayElementCount count, chid pChan,
caEventCallBackFunc *pfunc, void *arg );
friend int epicsShareAPI ca_array_put (
chtype type, arrayElementCount count,
friend int epicsShareAPI ca_array_put (
chtype type, arrayElementCount count,
chid pChan, const void * pValue );
friend int epicsShareAPI ca_array_put_callback (
chtype type, arrayElementCount count,
chid pChan, const void *pValue,
friend int epicsShareAPI ca_array_put_callback (
chtype type, arrayElementCount count,
chid pChan, const void *pValue,
caEventCallBackFunc *pfunc, void *usrarg );
friend double epicsShareAPI ca_beacon_period (
friend double epicsShareAPI ca_beacon_period (
chid pChan );
friend unsigned epicsShareAPI ca_search_attempts (
friend unsigned epicsShareAPI ca_search_attempts (
chid pChan );
friend unsigned epicsShareAPI ca_write_access (
friend unsigned epicsShareAPI ca_write_access (
chid pChan );
friend unsigned epicsShareAPI ca_read_access (
friend unsigned epicsShareAPI ca_read_access (
chid pChan );
friend short epicsShareAPI ca_field_type (
friend short epicsShareAPI ca_field_type (
chid pChan );
friend arrayElementCount epicsShareAPI ca_element_count (
friend arrayElementCount epicsShareAPI ca_element_count (
chid pChan );
friend int epicsShareAPI ca_v42_ok (
friend int epicsShareAPI ca_v42_ok (
chid pChan );
friend int epicsShareAPI ca_create_subscription (
chtype type, arrayElementCount count, chid pChan,
long mask, caEventCallBackFunc * pCallBack,
friend int epicsShareAPI ca_create_subscription (
chtype type, arrayElementCount count, chid pChan,
long mask, caEventCallBackFunc * pCallBack,
void * pCallBackArg, evid * monixptr );
friend enum channel_state epicsShareAPI ca_state (
chid pChan );
friend double epicsShareAPI ca_receive_watchdog_delay (
friend enum channel_state epicsShareAPI ca_state (
chid pChan );
friend double epicsShareAPI ca_receive_watchdog_delay (
chid pChan );
unsigned getName (
epicsGuard < epicsMutex > &,
char * pBuf, unsigned bufLen ) const throw ();
void show (
void show (
epicsGuard < epicsMutex > &,
unsigned level ) const;
void initiateConnect (
epicsGuard < epicsMutex > & );
void read (
void read (
epicsGuard < epicsMutex > &,
unsigned type, arrayElementCount count,
unsigned type, arrayElementCount count,
cacReadNotify &notify, cacChannel::ioid *pId = 0 );
void write (
void write (
epicsGuard < epicsMutex > &,
unsigned type, arrayElementCount count, const void *pValue,
unsigned type, arrayElementCount count, const void *pValue,
cacWriteNotify &, cacChannel::ioid *pId = 0 );
void ioCancel (
epicsGuard < epicsMutex > & mutualExclusionGuard,
void ioCancel (
CallbackGuard & callbackGuard,
epicsGuard < epicsMutex > & mutualExclusionGuard,
const cacChannel::ioid & );
void ioShow (
void ioShow (
epicsGuard < epicsMutex > & guard,
const cacChannel::ioid &, unsigned level ) const;
ca_client_context & getClientCtx ();
void eliminateExcessiveSendBacklog (
void eliminateExcessiveSendBacklog (
epicsGuard < epicsMutex > & );
void * operator new ( size_t size,
void * operator new ( size_t size,
tsFreeList < struct oldChannelNotify, 1024, epicsMutexNOOP > & );
epicsPlacementDeleteOperator (( void * ,
epicsPlacementDeleteOperator (( void * ,
tsFreeList < struct oldChannelNotify, 1024, epicsMutexNOOP > & ))
protected:
~oldChannelNotify ();
@@ -150,7 +152,7 @@ private:
void disconnectNotify ( epicsGuard < epicsMutex > & );
void serviceShutdownNotify (
epicsGuard < epicsMutex > & mutualExclusionGuard );
void accessRightsNotify (
void accessRightsNotify (
epicsGuard < epicsMutex > &, const caAccessRights & );
void exception ( epicsGuard < epicsMutex > &,
int status, const char * pContext );
@@ -160,24 +162,24 @@ private:
void writeException ( epicsGuard < epicsMutex > &,
int status, const char * pContext,
unsigned type, arrayElementCount count );
oldChannelNotify ( const oldChannelNotify & );
oldChannelNotify & operator = ( const oldChannelNotify & );
oldChannelNotify ( const oldChannelNotify & );
oldChannelNotify & operator = ( const oldChannelNotify & );
void operator delete ( void * );
};
class getCopy : public cacReadNotify {
public:
getCopy (
epicsGuard < epicsMutex > & guard,
ca_client_context & cacCtx,
oldChannelNotify &, unsigned type,
getCopy (
epicsGuard < epicsMutex > & guard,
ca_client_context & cacCtx,
oldChannelNotify &, unsigned type,
arrayElementCount count, void *pValue );
~getCopy ();
void show ( unsigned level ) const;
void cancel ();
void * operator new ( size_t size,
void * operator new ( size_t size,
tsFreeList < class getCopy, 1024, epicsMutexNOOP > & );
epicsPlacementDeleteOperator (( void *,
epicsPlacementDeleteOperator (( void *,
tsFreeList < class getCopy, 1024, epicsMutexNOOP > & ))
private:
arrayElementCount count;
@@ -187,10 +189,10 @@ private:
unsigned ioSeqNo;
unsigned type;
void completion (
epicsGuard < epicsMutex > &, unsigned type,
epicsGuard < epicsMutex > &, unsigned type,
arrayElementCount count, const void *pData );
void exception (
epicsGuard < epicsMutex > &, int status,
void exception (
epicsGuard < epicsMutex > &, int status,
const char *pContext, unsigned type, arrayElementCount count );
getCopy ( const getCopy & );
getCopy & operator = ( const getCopy & );
@@ -199,23 +201,23 @@ private:
class getCallback : public cacReadNotify {
public:
getCallback (
oldChannelNotify & chanIn,
getCallback (
oldChannelNotify & chanIn,
caEventCallBackFunc *pFunc, void *pPrivate );
~getCallback ();
void * operator new ( size_t size,
~getCallback ();
void * operator new ( size_t size,
tsFreeList < class getCallback, 1024, epicsMutexNOOP > & );
epicsPlacementDeleteOperator (( void *,
epicsPlacementDeleteOperator (( void *,
tsFreeList < class getCallback, 1024, epicsMutexNOOP > & ))
private:
oldChannelNotify & chan;
caEventCallBackFunc * pFunc;
void * pPrivate;
void completion (
epicsGuard < epicsMutex > &, unsigned type,
epicsGuard < epicsMutex > &, unsigned type,
arrayElementCount count, const void *pData);
void exception (
epicsGuard < epicsMutex > &, int status,
void exception (
epicsGuard < epicsMutex > &, int status,
const char * pContext, unsigned type, arrayElementCount count );
getCallback ( const getCallback & );
getCallback & operator = ( const getCallback & );
@@ -224,21 +226,21 @@ private:
class putCallback : public cacWriteNotify {
public:
putCallback (
oldChannelNotify &,
putCallback (
oldChannelNotify &,
caEventCallBackFunc *pFunc, void *pPrivate );
~putCallback ();
void * operator new ( size_t size,
void * operator new ( size_t size,
tsFreeList < class putCallback, 1024, epicsMutexNOOP > & );
epicsPlacementDeleteOperator (( void *,
epicsPlacementDeleteOperator (( void *,
tsFreeList < class putCallback, 1024, epicsMutexNOOP > & ))
private:
oldChannelNotify & chan;
caEventCallBackFunc * pFunc;
void *pPrivate;
void completion ( epicsGuard < epicsMutex > & );
void exception (
epicsGuard < epicsMutex > &, int status, const char *pContext,
void exception (
epicsGuard < epicsMutex > &, int status, const char *pContext,
unsigned type, arrayElementCount count );
putCallback ( const putCallback & );
putCallback & operator = ( const putCallback & );
@@ -249,17 +251,25 @@ struct oldSubscription : private cacStateNotify {
public:
oldSubscription (
epicsGuard < epicsMutex > & guard,
oldChannelNotify & chanIn, cacChannel & io,
oldChannelNotify & chanIn, cacChannel & io,
unsigned type, arrayElementCount nElem, unsigned mask,
caEventCallBackFunc * pFuncIn, void * pPrivateIn,
evid * );
~oldSubscription ();
oldChannelNotify & channel () const;
void cancel (
epicsGuard < epicsMutex > & guard );
void * operator new ( size_t size,
// The primary mutex must be released when calling the user's
// callback, and therefore a finite interval exists when we are
// moving forward with the intent to call the users callback
// but the users IO could be deleted during this interval.
// To prevent the user's callback from being called after
// destroying his IO we must past a guard for the callback
// mutex here.
void cancel (
CallbackGuard & callbackGuard,
epicsGuard < epicsMutex > & mutualExclusionGuard );
void * operator new ( size_t size,
tsFreeList < struct oldSubscription, 1024, epicsMutexNOOP > & );
epicsPlacementDeleteOperator (( void *,
epicsPlacementDeleteOperator (( void *,
tsFreeList < struct oldSubscription, 1024, epicsMutexNOOP > & ))
private:
oldChannelNotify & chan;
@@ -267,10 +277,10 @@ private:
caEventCallBackFunc * pFunc;
void * pPrivate;
void current (
epicsGuard < epicsMutex > &, unsigned type,
epicsGuard < epicsMutex > &, unsigned type,
arrayElementCount count, const void *pData );
void exception (
epicsGuard < epicsMutex > &, int status,
void exception (
epicsGuard < epicsMutex > &, int status,
const char *pContext, unsigned type, arrayElementCount count );
oldSubscription ( const oldSubscription & );
oldSubscription & operator = ( const oldSubscription & );
@@ -285,16 +295,16 @@ struct ca_client_context : public cacContextNotify
public:
ca_client_context ( bool enablePreemptiveCallback = false );
virtual ~ca_client_context ();
void changeExceptionEvent (
void changeExceptionEvent (
caExceptionHandler * pfunc, void * arg );
void registerForFileDescriptorCallBack (
void registerForFileDescriptorCallBack (
CAFDHANDLER * pFunc, void * pArg );
void replaceErrLogHandler ( caPrintfFunc * ca_printf_func );
cacChannel & createChannel (
epicsGuard < epicsMutex > &, const char * pChannelName,
cacChannel & createChannel (
epicsGuard < epicsMutex > &, const char * pChannelName,
cacChannelNotify &, cacChannel::priLev pri );
void flush ( epicsGuard < epicsMutex > & );
void eliminateExcessiveSendBacklog (
void eliminateExcessiveSendBacklog (
epicsGuard < epicsMutex > &, cacChannel & );
int pendIO ( const double & timeout );
int pendEvent ( const double & timeout );
@@ -304,18 +314,18 @@ public:
unsigned sequenceNumberOfOutstandingIO (
epicsGuard < epicsMutex > & ) const;
unsigned beaconAnomaliesSinceProgramStart () const;
void incrementOutstandingIO (
void incrementOutstandingIO (
epicsGuard < epicsMutex > &, unsigned ioSeqNo );
void decrementOutstandingIO (
void decrementOutstandingIO (
epicsGuard < epicsMutex > &, unsigned ioSeqNo );
void exception (
epicsGuard < epicsMutex > &, int status, const char * pContext,
const char * pFileName, unsigned lineNo );
void exception (
void exception (
epicsGuard < epicsMutex > &, int status, const char * pContext,
const char * pFileName, unsigned lineNo, oldChannelNotify & chan,
const char * pFileName, unsigned lineNo );
void exception (
epicsGuard < epicsMutex > &, int status, const char * pContext,
const char * pFileName, unsigned lineNo, oldChannelNotify & chan,
unsigned type, arrayElementCount count, unsigned op );
void blockForEventAndEnableCallbacks (
void blockForEventAndEnableCallbacks (
epicsEvent & event, const double & timeout );
CASG * lookupCASG ( epicsGuard < epicsMutex > &, unsigned id );
static void installDefaultService ( cacService & );
@@ -325,9 +335,9 @@ public:
// perhaps these should be eliminated in deference to the exception mechanism
int printFormated ( const char * pformat, ... ) const;
int varArgsPrintFormated ( const char * pformat, va_list args ) const;
void signal ( int ca_status, const char * pfilenm,
void signal ( int ca_status, const char * pfilenm,
int lineno, const char * pFormat, ... );
void vSignal ( int ca_status, const char * pfilenm,
void vSignal ( int ca_status, const char * pfilenm,
int lineno, const char *pFormat, va_list args );
bool preemptiveCallbakIsEnabled () const;
void destroyGetCopy ( epicsGuard < epicsMutex > &, getCopy & );
@@ -336,25 +346,27 @@ public:
void destroySubscription ( epicsGuard < epicsMutex > &, oldSubscription & );
epicsMutex & mutexRef () const;
template < class T >
void whenThereIsAnExceptionDestroySyncGroupIO ( epicsGuard < epicsMutex > &, T & );
// legacy C API
// legacy C API
friend int epicsShareAPI ca_create_channel (
const char * name_str, caCh * conn_func, void * puser,
capri priority, chid * chanptr );
friend int epicsShareAPI ca_clear_channel ( chid pChan );
friend int epicsShareAPI ca_array_get ( chtype type,
friend int epicsShareAPI ca_array_get ( chtype type,
arrayElementCount count, chid pChan, void * pValue );
friend int epicsShareAPI ca_array_get_callback ( chtype type,
friend int epicsShareAPI ca_array_get_callback ( chtype type,
arrayElementCount count, chid pChan,
caEventCallBackFunc *pfunc, void *arg );
friend int epicsShareAPI ca_array_put ( chtype type,
friend int epicsShareAPI ca_array_put ( chtype type,
arrayElementCount count, chid pChan, const void * pValue );
friend int epicsShareAPI ca_array_put_callback ( chtype type,
arrayElementCount count, chid pChan, const void * pValue,
friend int epicsShareAPI ca_array_put_callback ( chtype type,
arrayElementCount count, chid pChan, const void * pValue,
caEventCallBackFunc *pfunc, void *usrarg );
friend int epicsShareAPI ca_create_subscription (
chtype type, arrayElementCount count, chid pChan,
long mask, caEventCallBackFunc * pCallBack, void * pCallBackArg,
friend int epicsShareAPI ca_create_subscription (
chtype type, arrayElementCount count, chid pChan,
long mask, caEventCallBackFunc * pCallBack, void * pCallBackArg,
evid *monixptr );
friend int epicsShareAPI ca_flush_io ();
friend int epicsShareAPI ca_clear_subscription ( evid pMon );
@@ -363,6 +375,17 @@ public:
friend int epicsShareAPI ca_sg_block ( const CA_SYNC_GID gid, ca_real timeout );
friend int epicsShareAPI ca_sg_reset ( const CA_SYNC_GID gid );
friend int epicsShareAPI ca_sg_test ( const CA_SYNC_GID gid );
friend int epicsShareAPI ca_sg_array_get ( const CA_SYNC_GID gid,
chtype type, arrayElementCount count,
chid pChan, void *pValue );
friend int epicsShareAPI ca_sg_array_put ( const CA_SYNC_GID gid,
chtype type, arrayElementCount count,
chid pChan, const void *pValue );
friend int ca_sync_group_destroy ( CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard,
ca_client_context & cac, const CA_SYNC_GID gid );
friend void sync_group_reset ( ca_client_context & client,
CASG & sg );
// exceptions
class noSocket {};
@@ -375,11 +398,11 @@ private:
tsFreeList < struct oldSubscription, 1024, epicsMutexNOOP > subscriptionFreeList;
tsFreeList < struct CASG, 128, epicsMutexNOOP > casgFreeList;
mutable epicsMutex mutex;
mutable epicsMutex cbMutex;
mutable epicsMutex cbMutex;
epicsEvent ioDone;
epicsEvent callbackThreadActivityComplete;
epicsThreadId createdByThread;
epics_auto_ptr < epicsGuard < epicsMutex > > pCallbackGuard;
epics_auto_ptr < CallbackGuard > pCallbackGuard;
epics_auto_ptr < cacContext > pServiceContext;
caExceptionHandler * ca_exception_func;
void * ca_exception_arg;
@@ -397,15 +420,15 @@ private:
void attachToClientCtx ();
void callbackProcessingInitiateNotify ();
void callbackProcessingCompleteNotify ();
cacContext & createNetworkContext (
cacContext & createNetworkContext (
epicsMutex & mutualExclusion, epicsMutex & callbackControl );
void _sendWakeupMsg ();
ca_client_context ( const ca_client_context & );
ca_client_context & operator = ( const ca_client_context & );
friend void cacOnceFunc ( void * );
friend void cacExitHandler ( void *);
ca_client_context ( const ca_client_context & );
ca_client_context & operator = ( const ca_client_context & );
friend void cacOnceFunc ( void * );
friend void cacExitHandler ( void *);
static cacService * pDefaultService;
static epicsMutex * pDefaultServiceInstallMutex;
static const unsigned flushBlockThreshold;
@@ -425,7 +448,7 @@ inline unsigned oldChannelNotify::getName (
return this->io.getName ( guard, pBuf, bufLen );
}
inline void oldChannelNotify::show (
inline void oldChannelNotify::show (
epicsGuard < epicsMutex > & guard,
unsigned level ) const
{
@@ -438,58 +461,60 @@ inline void oldChannelNotify::initiateConnect (
this->io.initiateConnect ( guard );
}
inline void oldChannelNotify::ioCancel (
epicsGuard < epicsMutex > & guard,
inline void oldChannelNotify::ioCancel (
CallbackGuard & callbackGuard,
epicsGuard < epicsMutex > & mutualExclusionGuard,
const cacChannel::ioid & id )
{
this->io.ioCancel ( guard, id );
this->io.ioCancel ( callbackGuard, mutualExclusionGuard, id );
}
inline void oldChannelNotify::ioShow (
inline void oldChannelNotify::ioShow (
epicsGuard < epicsMutex > & guard,
const cacChannel::ioid & id, unsigned level ) const
{
this->io.ioShow ( guard, id, level );
}
inline void oldChannelNotify::eliminateExcessiveSendBacklog (
inline void oldChannelNotify::eliminateExcessiveSendBacklog (
epicsGuard < epicsMutex > & guard )
{
this->cacCtx.eliminateExcessiveSendBacklog ( guard, this->io );
}
inline void * oldChannelNotify::operator new ( size_t size,
inline void * oldChannelNotify::operator new ( size_t size,
tsFreeList < struct oldChannelNotify, 1024, epicsMutexNOOP > & freeList )
{
return freeList.allocate ( size );
}
#ifdef CXX_PLACEMENT_DELETE
inline void oldChannelNotify::operator delete ( void *pCadaver,
tsFreeList < struct oldChannelNotify, 1024, epicsMutexNOOP > & freeList )
inline void oldChannelNotify::operator delete ( void *pCadaver,
tsFreeList < struct oldChannelNotify, 1024, epicsMutexNOOP > & freeList )
{
freeList.release ( pCadaver );
}
#endif
inline void * oldSubscription::operator new ( size_t size,
inline void * oldSubscription::operator new ( size_t size,
tsFreeList < struct oldSubscription, 1024, epicsMutexNOOP > & freeList )
{
return freeList.allocate ( size );
}
#ifdef CXX_PLACEMENT_DELETE
inline void oldSubscription::operator delete ( void *pCadaver,
tsFreeList < struct oldSubscription, 1024, epicsMutexNOOP > & freeList )
inline void oldSubscription::operator delete ( void *pCadaver,
tsFreeList < struct oldSubscription, 1024, epicsMutexNOOP > & freeList )
{
freeList.release ( pCadaver );
}
#endif
inline void oldSubscription::cancel (
epicsGuard < epicsMutex > & guard )
inline void oldSubscription::cancel (
CallbackGuard & callbackGuard,
epicsGuard < epicsMutex > & mutualExclusionGuard )
{
this->chan.ioCancel ( guard, this->id );
this->chan.ioCancel ( callbackGuard, mutualExclusionGuard, this->id );
}
inline oldChannelNotify & oldSubscription::channel () const
@@ -497,43 +522,43 @@ inline oldChannelNotify & oldSubscription::channel () const
return this->chan;
}
inline void * getCopy::operator new ( size_t size,
inline void * getCopy::operator new ( size_t size,
tsFreeList < class getCopy, 1024, epicsMutexNOOP > & freeList )
{
return freeList.allocate ( size );
}
#ifdef CXX_PLACEMENT_DELETE
inline void getCopy::operator delete ( void *pCadaver,
tsFreeList < class getCopy, 1024, epicsMutexNOOP > & freeList )
inline void getCopy::operator delete ( void *pCadaver,
tsFreeList < class getCopy, 1024, epicsMutexNOOP > & freeList )
{
freeList.release ( pCadaver );
}
#endif
inline void * putCallback::operator new ( size_t size,
inline void * putCallback::operator new ( size_t size,
tsFreeList < class putCallback, 1024, epicsMutexNOOP > & freeList )
{
return freeList.allocate ( size );
}
#ifdef CXX_PLACEMENT_DELETE
inline void putCallback::operator delete ( void * pCadaver,
tsFreeList < class putCallback, 1024, epicsMutexNOOP > & freeList )
inline void putCallback::operator delete ( void * pCadaver,
tsFreeList < class putCallback, 1024, epicsMutexNOOP > & freeList )
{
freeList.release ( pCadaver );
}
#endif
inline void * getCallback::operator new ( size_t size,
inline void * getCallback::operator new ( size_t size,
tsFreeList < class getCallback, 1024, epicsMutexNOOP > & freeList )
{
return freeList.allocate ( size );
}
#ifdef CXX_PLACEMENT_DELETE
inline void getCallback::operator delete ( void * pCadaver,
tsFreeList < class getCallback, 1024, epicsMutexNOOP > & freeList )
inline void getCallback::operator delete ( void * pCadaver,
tsFreeList < class getCallback, 1024, epicsMutexNOOP > & freeList )
{
freeList.release ( pCadaver );
}
@@ -555,5 +580,32 @@ inline unsigned ca_client_context::sequenceNumberOfOutstandingIO (
// perhaps on SMP systems THERE should be lock/unlock around this
return this->ioSeqNo;
}
template < class T >
void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO (
epicsGuard < epicsMutex > & guard, T & io )
{
if ( this->pCallbackGuard.get() &&
this->createdByThread == epicsThreadGetIdSelf () ) {
io.destroy ( *this->pCallbackGuard.get(), guard );
}
else {
// dont reverse the lock hierarchy
epicsGuardRelease < epicsMutex > guardRelease ( guard );
{
//
// we will definately stall out here if all of the
// following are true
//
// o user creates non-preemtive mode client library context
// o user doesnt periodically call a ca function
// o user calls this function from an auxiillary thread
//
CallbackGuard cbGuard ( this->cbMutex );
epicsGuard < epicsMutex > guard ( this->mutex );
io.destroy ( cbGuard, guard );
}
}
}
#endif // ifndef oldAccessh

View File

@@ -5,18 +5,18 @@
* 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.
\*************************************************************************/
/*
/*
*
*
*
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
*
*
* Copyright, 1986, The Regents of the University of California.
*
*
*
*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
@@ -43,13 +43,13 @@ extern "C" void cacNoopAccesRightsHandler ( struct access_rights_handler_args )
{
}
oldChannelNotify::oldChannelNotify (
epicsGuard < epicsMutex > & guard, ca_client_context & cacIn,
const char *pName, caCh * pConnCallBackIn,
oldChannelNotify::oldChannelNotify (
epicsGuard < epicsMutex > & guard, ca_client_context & cacIn,
const char *pName, caCh * pConnCallBackIn,
void * pPrivateIn, capri priority ) :
cacCtx ( cacIn ),
io ( cacIn.createChannel ( guard, pName, *this, priority ) ),
pConnCallBack ( pConnCallBackIn ),
cacCtx ( cacIn ),
io ( cacIn.createChannel ( guard, pName, *this, priority ) ),
pConnCallBack ( pConnCallBackIn ),
pPrivate ( pPrivateIn ), pAccessRightsFunc ( cacNoopAccesRightsHandler ),
ioSeqNo ( 0 ), currentlyConnected ( false ), prevConnected ( false )
{
@@ -65,19 +65,20 @@ oldChannelNotify::~oldChannelNotify ()
}
void oldChannelNotify::destructor (
epicsGuard < epicsMutex > & guard )
CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & mutexGuard )
{
guard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
this->io.destroy ( guard );
mutexGuard.assertIdenticalMutex ( this->cacCtx.mutexRef () );
this->io.destroy ( cbGuard, mutexGuard );
// no need to worry about a connect preempting here because
// the io (the nciu) has been destroyed above
if ( this->pConnCallBack == 0 && ! this->currentlyConnected ) {
this->cacCtx.decrementOutstandingIO ( guard, this->ioSeqNo );
this->cacCtx.decrementOutstandingIO ( mutexGuard, this->ioSeqNo );
}
this->~oldChannelNotify ();
}
void oldChannelNotify::connectNotify (
void oldChannelNotify::connectNotify (
epicsGuard < epicsMutex > & guard )
{
this->currentlyConnected = true;
@@ -97,7 +98,7 @@ void oldChannelNotify::connectNotify (
}
}
void oldChannelNotify::disconnectNotify (
void oldChannelNotify::disconnectNotify (
epicsGuard < epicsMutex > & guard )
{
this->currentlyConnected = false;
@@ -112,7 +113,7 @@ void oldChannelNotify::disconnectNotify (
}
}
else {
this->cacCtx.incrementOutstandingIO (
this->cacCtx.incrementOutstandingIO (
guard, this->ioSeqNo );
}
}
@@ -123,7 +124,7 @@ void oldChannelNotify::serviceShutdownNotify (
this->disconnectNotify ( guard );
}
void oldChannelNotify::accessRightsNotify (
void oldChannelNotify::accessRightsNotify (
epicsGuard < epicsMutex > & guard, const caAccessRights & ar )
{
struct access_rights_handler_args args;
@@ -137,25 +138,25 @@ void oldChannelNotify::accessRightsNotify (
}
}
void oldChannelNotify::exception (
void oldChannelNotify::exception (
epicsGuard < epicsMutex > & guard, int status, const char * pContext )
{
this->cacCtx.exception ( guard, status, pContext, __FILE__, __LINE__ );
}
void oldChannelNotify::readException (
void oldChannelNotify::readException (
epicsGuard < epicsMutex > & guard, int status, const char *pContext,
unsigned type, arrayElementCount count, void * /* pValue */ )
{
this->cacCtx.exception ( guard, status, pContext,
this->cacCtx.exception ( guard, status, pContext,
__FILE__, __LINE__, *this, type, count, CA_OP_GET );
}
void oldChannelNotify::writeException (
void oldChannelNotify::writeException (
epicsGuard < epicsMutex > & guard, int status, const char *pContext,
unsigned type, arrayElementCount count )
{
this->cacCtx.exception ( guard, status, pContext,
this->cacCtx.exception ( guard, status, pContext,
__FILE__, __LINE__, *this, type, count, CA_OP_PUT );
}
@@ -173,7 +174,7 @@ void oldChannelNotify::operator delete ( void * )
/*
* ca_get_host_name ()
*/
unsigned epicsShareAPI ca_get_host_name (
unsigned epicsShareAPI ca_get_host_name (
chid pChan, char * pBuf, unsigned bufLength )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef() );
@@ -186,7 +187,7 @@ unsigned epicsShareAPI ca_get_host_name (
* !!!! not thread safe !!!!
*
*/
const char * epicsShareAPI ca_host_name (
const char * epicsShareAPI ca_host_name (
chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
@@ -196,7 +197,7 @@ const char * epicsShareAPI ca_host_name (
/*
* ca_set_puser ()
*/
void epicsShareAPI ca_set_puser (
void epicsShareAPI ca_set_puser (
chid pChan, void * puser )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
@@ -206,7 +207,7 @@ void epicsShareAPI ca_set_puser (
/*
* ca_get_puser ()
*/
void * epicsShareAPI ca_puser (
void * epicsShareAPI ca_puser (
chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
@@ -220,7 +221,7 @@ int epicsShareAPI ca_change_connection_event ( chid pChan, caCh * pfunc )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
if ( ! pChan->currentlyConnected ) {
if ( pfunc ) {
if ( pfunc ) {
if ( ! pChan->pConnCallBack ) {
pChan->cacCtx.decrementOutstandingIO ( guard, pChan->ioSeqNo );
}
@@ -238,7 +239,7 @@ int epicsShareAPI ca_change_connection_event ( chid pChan, caCh * pfunc )
/*
* ca_replace_access_rights_event
*/
int epicsShareAPI ca_replace_access_rights_event (
int epicsShareAPI ca_replace_access_rights_event (
chid pChan, caArh *pfunc )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
@@ -246,11 +247,11 @@ int epicsShareAPI ca_replace_access_rights_event (
// The order of the following is significant to guarantee that the
// access rights handler is always gets called even if the channel connects
// while this is running. There is some very small chance that the
// handler could be called twice here with the same access rights state, but
// handler could be called twice here with the same access rights state, but
// that will not upset the application.
pChan->pAccessRightsFunc = pfunc ? pfunc : cacNoopAccesRightsHandler;
caAccessRights tmp = pChan->io.accessRights ( guard );
if ( pChan->currentlyConnected ) {
struct access_rights_handler_args args;
args.chid = pChan;
@@ -265,7 +266,7 @@ int epicsShareAPI ca_replace_access_rights_event (
/*
* ca_array_get ()
*/
int epicsShareAPI ca_array_get ( chtype type,
int epicsShareAPI ca_array_get ( chtype type,
arrayElementCount count, chid pChan, void *pValue )
{
int caStatus;
@@ -279,10 +280,10 @@ int epicsShareAPI ca_array_get ( chtype type,
unsigned tmpType = static_cast < unsigned > ( type );
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
pChan->eliminateExcessiveSendBacklog ( guard );
autoPtrFreeList < getCopy, 0x400, epicsMutexNOOP > pNotify
autoPtrFreeList < getCopy, 0x400, epicsMutexNOOP > pNotify
( pChan->getClientCtx().getCopyFreeList,
new ( pChan->getClientCtx().getCopyFreeList )
getCopy ( guard, pChan->getClientCtx(), *pChan,
new ( pChan->getClientCtx().getCopyFreeList )
getCopy ( guard, pChan->getClientCtx(), *pChan,
tmpType, count, pValue ) );
pChan->io.read ( guard, type, count, *pNotify, 0 );
pNotify.release ();
@@ -333,7 +334,7 @@ int epicsShareAPI ca_array_get ( chtype type,
/*
* ca_array_get_callback ()
*/
int epicsShareAPI ca_array_get_callback ( chtype type,
int epicsShareAPI ca_array_get_callback ( chtype type,
arrayElementCount count, chid pChan,
caEventCallBackFunc *pfunc, void *arg )
{
@@ -342,11 +343,14 @@ int epicsShareAPI ca_array_get_callback ( chtype type,
if ( type < 0 ) {
return ECA_BADTYPE;
}
if ( pfunc == NULL ) {
return ECA_BADFUNCPTR;
}
unsigned tmpType = static_cast < unsigned > ( type );
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
pChan->eliminateExcessiveSendBacklog ( guard );
autoPtrFreeList < getCallback, 0x400, epicsMutexNOOP > pNotify
autoPtrFreeList < getCallback, 0x400, epicsMutexNOOP > pNotify
( pChan->getClientCtx().getCallbackFreeList,
new ( pChan->getClientCtx().getCallbackFreeList )
getCallback ( *pChan, pfunc, arg ) );
@@ -396,9 +400,9 @@ int epicsShareAPI ca_array_get_callback ( chtype type,
return caStatus;
}
void oldChannelNotify::read (
void oldChannelNotify::read (
epicsGuard < epicsMutex > & guard,
unsigned type, arrayElementCount count,
unsigned type, arrayElementCount count,
cacReadNotify & notify, cacChannel::ioid * pId )
{
this->io.read ( guard, type, count, notify, pId );
@@ -407,7 +411,7 @@ void oldChannelNotify::read (
/*
* ca_array_put_callback ()
*/
int epicsShareAPI ca_array_put_callback ( chtype type, arrayElementCount count,
int epicsShareAPI ca_array_put_callback ( chtype type, arrayElementCount count,
chid pChan, const void *pValue, caEventCallBackFunc *pfunc, void *usrarg )
{
int caStatus;
@@ -415,6 +419,9 @@ int epicsShareAPI ca_array_put_callback ( chtype type, arrayElementCount count,
if ( type < 0 ) {
return ECA_BADTYPE;
}
if ( pfunc == NULL ) {
return ECA_BADFUNCPTR;
}
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
pChan->eliminateExcessiveSendBacklog ( guard );
unsigned tmpType = static_cast < unsigned > ( type );
@@ -468,7 +475,7 @@ int epicsShareAPI ca_array_put_callback ( chtype type, arrayElementCount count,
/*
* ca_array_put ()
*/
int epicsShareAPI ca_array_put ( chtype type, arrayElementCount count,
int epicsShareAPI ca_array_put ( chtype type, arrayElementCount count,
chid pChan, const void * pValue )
{
if ( type < 0 ) {
@@ -522,9 +529,9 @@ int epicsShareAPI ca_array_put ( chtype type, arrayElementCount count,
return caStatus;
}
int epicsShareAPI ca_create_subscription (
chtype type, arrayElementCount count, chid pChan,
long mask, caEventCallBackFunc * pCallBack, void * pCallBackArg,
int epicsShareAPI ca_create_subscription (
chtype type, arrayElementCount count, chid pChan,
long mask, caEventCallBackFunc * pCallBack, void * pCallBackArg,
evid * monixptr )
{
if ( type < 0 ) {
@@ -552,7 +559,7 @@ int epicsShareAPI ca_create_subscription (
try {
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
try {
// if this stalls out on a live circuit then an exception
// if this stalls out on a live circuit then an exception
// can be forthcoming which we must ignore (this is a
// special case preserving legacy ca_create_subscription
// behavior)
@@ -562,7 +569,7 @@ int epicsShareAPI ca_create_subscription (
// intentionally ignored (its ok to subscribe when not connected)
}
new ( pChan->getClientCtx().subscriptionFreeList )
oldSubscription (
oldSubscription (
guard, *pChan, pChan->io, tmpType, count, mask,
pCallBack, pCallBackArg, monixptr );
// dont touch object created after above new because
@@ -603,8 +610,8 @@ int epicsShareAPI ca_create_subscription (
}
}
void oldChannelNotify::write (
epicsGuard < epicsMutex > & guard, unsigned type, arrayElementCount count,
void oldChannelNotify::write (
epicsGuard < epicsMutex > & guard, unsigned type, arrayElementCount count,
const void * pValue, cacWriteNotify & notify, cacChannel::ioid * pId )
{
this->io.write ( guard, type, count, pValue, notify, pId );
@@ -613,7 +620,7 @@ void oldChannelNotify::write (
/*
* ca_field_type()
*/
short epicsShareAPI ca_field_type ( chid pChan )
short epicsShareAPI ca_field_type ( chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
return pChan->io.nativeType ( guard );
@@ -622,7 +629,7 @@ short epicsShareAPI ca_field_type ( chid pChan )
/*
* ca_element_count ()
*/
arrayElementCount epicsShareAPI ca_element_count ( chid pChan )
arrayElementCount epicsShareAPI ca_element_count ( chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
return pChan->io.nativeElementCount ( guard );
@@ -674,7 +681,7 @@ const char * epicsShareAPI ca_name ( chid pChan )
unsigned epicsShareAPI ca_search_attempts ( chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
return pChan->io.searchAttempts ( guard );
}

View File

@@ -4,7 +4,7 @@
use strict;
use warnings;
my $version = '0.4';
my $version = '0.6';
package CA;
@@ -95,8 +95,8 @@ CA - Perl 5 interface to EPICS Channel Access
} else {
printf " Value: %g\n", $data->{value};
printf " Severity: %s\n", $data->{severity};
printf " Timestamp: %d.%09d\n",
$data->{stamp}, $data->{stamp_fraction};
printf " Timestamp: %.6f\n",
$data->{stamp} + $data->{stamp_fraction};
}
}
@@ -235,7 +235,7 @@ C<die> with an exception object in the callback and catch that using C<eval> in
the main thread are not likely to succeed and will probably result in a crash.
Callbacks should not perform any operations that would block for more than a
fraction of a second as this will hold up network communications with the
relevent server and could cause the Perl program and/or the Channel Access
relevant server and could cause the Perl program and/or the Channel Access
server to crash. Calling C<< CA->pend_event >> from within a callback is not
permitted by the underlying Channel Access library.
@@ -291,7 +291,7 @@ apply to the callback subroutine as described in C<get_callback> above.
=item put_acks( I<SEVR>, I<SUB> )
Applications that need to ackowledge alarms by doing a C<ca_put()> with type
Applications that need to acknowledge alarms by doing a C<ca_put()> with type
C<DBR_PUT_ACKS> can do so using the C<put_acks> method. The severity argument
may be provided as an integer from zero through three or as a string containing
one of the corresponding EPICS severity names C<NO_ALARM>, C<MINOR>, C<MAJOR> or
@@ -316,6 +316,19 @@ channel; see the C<new> constructor for details. If I<SUB> is C<undef> any
existing handler is removed, otherwise the new subroutine will be used for all
future connection events on this channel.
=item change_access_rights_event( I<SUB> )
This method replaces, adds or cancels an access rights handler subroutine for
the channel, which will be called if the client's right to read from or write
to the channel changes. If I<SUB> is C<undef> any existing handler is removed,
otherwise the new subroutine will be used for all future rights change events
on this channel.
The arguments passed to I<SUB> are the channel object and a pair of scalar
values for read and write permissions respectively, that are true when the
access is permitted, false when it is not.
=back
@@ -325,11 +338,12 @@ The data provided to a callback function registered with either C<get_callback>
or C<create_subscription> can be a scalar value or a reference to an array or a
hash, depending on the data type that was used for the data transfer. If the
request was for a single item of one of the basic data types, the data argument
will be a perl scalar that holds the value directly. If the request was for
will be a Perl scalar that holds the value directly. If the request was for
multiple items of one of the basic types, the data argument will be a reference
to an array holding the data. There is one exception though; if the data type
requested was for an array of C<DBF_CHAR> values that array will be represented
as a single Perl string contining all the characters before the first zero byte.
as a single Perl string containing all the characters before the first zero
byte.
If the request was for one of the compound data types, the data argument will be
a reference to a hash with keys as described below. Keys that are not classed
@@ -355,7 +369,7 @@ widened from the original type used to request or subscribe for the data.
The number of elements in the data returned by the server. If the data type is
C<DBF_CHAR> the value given for C<COUNT> is the number of bytes (including any
trailing zeros) returned by the server, although the value field is given as a
Perl string contining all the characters before the first zero byte.
Perl string containing all the characters before the first zero byte.
=back
@@ -417,7 +431,7 @@ Present only when I<TYPE> is C<DBR_GR_ENUM> or C<DBR_CTRL_ENUM>.
=item stamp
The process variable timestamp, converted to a local C<time_t>. This value is
suitable for passing to the perl C<localtime> or C<gmtime> functions.
suitable for passing to the Perl C<localtime> or C<gmtime> functions.
Present only when I<TYPE> is C<DBR_TIME_yyy>.
@@ -507,6 +521,11 @@ class method syntax, e.g. C<< CA->pend_io(10) >>.
=over 4
=item version
Returns the EPICS_VERSION_STRING from the version of EPICS Base this software
was built using.
=item flush_io
Flush outstanding IO requests to the server. This routine is useful for users
@@ -615,15 +634,15 @@ passing C<undef> as the subroutine reference.
Errors in using the library will be indicated by the module throwing an
exception, i.e. calling C<croak()> with an appropriate error message. These
exceptions can be caught using the standard Parl C<eval {}> statement and
exceptions can be caught using the standard Perl C<eval {}> statement and
testing the C<$@> variable afterwards; if not caught, they will cause the
running program to C<die> with an appropriate error message pointing to the
program line that called the C<CA> library.
Errors messages reported by the underlying CA client library all start with the
Error messages reported by the underlying CA client library all start with the
string C<ECA_> and the remainder of the symbol for the associated CA error
number, and are followed after a space-hyphen-space by a human-readable message
describing the error. Errors that are detected by the perl interface layer do
describing the error. Errors that are detected by the Perl interface layer do
not follow this pattern, but are still printable strings.
@@ -631,9 +650,9 @@ not follow this pattern, but are still printable strings.
=over
=item [1] R3.14 Channel Access Reference Manual by Jeffrey O. Hill
=item [1] R3.15 Channel Access Reference Manual by Jeffrey O. Hill
L<http://www.aps.anl.gov/epics/base/R3-14/11-docs/CAref.html>
L<http://www.aps.anl.gov/epics/base/R3-15/0-docs/CAref.html>
=back
@@ -644,7 +663,7 @@ Andrew Johnson, E<lt>anj@aps.anl.govE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2008 UChicago Argonne LLC, as Operator of Argonne National
Copyright (C) 2008-2014 UChicago Argonne LLC, as Operator of Argonne National
Laboratory.
This software is distributed under the terms of the EPICS Open License.

View File

@@ -10,8 +10,8 @@
#include "cadef.h"
#include "db_access.h"
#include "epicsVersion.h"
#include "alarm.h"
#include "alarmString.h"
typedef union {
dbr_long_t iv;
@@ -519,6 +519,46 @@ void CA_change_connection_event(SV *ca_ref, SV *sub) {
}
}
/* CA::replace_access_rights_event($ca_ref, \$sub) */
static
void rights_handler(struct access_rights_handler_args arha) {
CA_channel *pch = ca_puser(arha.chid);
PERL_SET_CONTEXT(p5_ctx);
{
dSP;
SvSetSV(ERRSV, &PL_sv_undef);
PUSHMARK(SP);
XPUSHs(pch->chan_ref);
XPUSHs(arha.ar.read_access ? &PL_sv_yes : &PL_sv_no);
XPUSHs(arha.ar.write_access ? &PL_sv_yes : &PL_sv_no);
PUTBACK;
call_sv(pch->rights_sub, G_EVAL | G_VOID | G_DISCARD | G_KEEPERR);
if (SvTRUE(ERRSV))
croak(NULL);
}
}
void CA_replace_access_rights_event(SV *ca_ref, SV *sub) {
CA_channel *pch = (CA_channel *)SvIV(SvRV(ca_ref));
caArh *handler = &rights_handler;
int status;
if (! replace_handler(sub, &pch->rights_sub, (long *)&handler))
return;
status = ca_replace_access_rights_event(pch->chan, handler);
if (status != ECA_NORMAL) {
croak("%s", get_error_msg(status));
}
}
/* CA::put($ca_ref, @values) */
@@ -914,16 +954,18 @@ SV * CA_create_subscription(SV *ca_ref, const char *mask_str, SV *sub, ...) {
dbr_text_to_type(treq, type);
if (type < 0) {
croak_msg = "Unknown data type";
croak_msg = "Unknown CA data type";
goto exit_croak;
}
if (type == DBR_PUT_ACKT ||
type == DBR_PUT_ACKS) {
croak_msg = "DBR_PUT_ACK types are write-only";
goto exit_croak;
} else if (type == DBR_CLASS_NAME ||
} else if (type == DBR_GR_ENUM ||
type == DBR_CTRL_ENUM ||
type == DBR_CLASS_NAME ||
type == DBR_STSACK_STRING)
/* These break the dbr_type_is macros */ ;
/* These above types are supported */ ;
else if (dbr_type_is_SHORT(type))
type += (DBR_LONG - DBR_SHORT);
else if (dbr_type_is_FLOAT(type))
@@ -1010,6 +1052,12 @@ void CA_flush_io(const char *class) {
}
/* CA::version($class) */
const char * CA_version(const char *class) {
return EPICS_VERSION_STRING;
}
/* CA::add_exception_event($class, \&sub) */
static
@@ -1214,6 +1262,15 @@ int CA_write_access(SV *ca_ref) {
/******************************************************************************/
/* Ensure that the generated boot_Cap5 function is visible
* outside of the libCap5.so shared library when compiling
* with GCC4+ and -fvisibility=hidden is used.
*/
#if __GNUC__ >= 4
XS(boot_Cap5) __attribute__ ((visibility ("default")));
#endif
MODULE = Cap5 PACKAGE = Cap5
MODULE = Cap5 PACKAGE = CA PREFIX = CA_
@@ -1250,6 +1307,11 @@ CA_change_connection_event (ca_ref, sub)
SV * ca_ref
SV * sub
void
CA_replace_access_rights_event (ca_ref, sub)
SV * ca_ref
SV * sub
void
CA_put (ca_ref, val, ...)
SV * ca_ref
@@ -1385,6 +1447,10 @@ void
CA_flush_io (class)
const char * class
const char *
CA_version (class)
const char * class
void
CA_add_exception_event (class, sub)
const char * class

View File

@@ -8,18 +8,16 @@
TOP=../../../..
include $(TOP)/configure/CONFIG
# Use hdepends command (not GNU compiler flags)
# to generate header file dependancies for Darwin.
# Darwin has multiple -arch compiler flags.
# Special settings for Darwin:
ifeq ($(OS_CLASS),Darwin)
HDEPENDS_METHOD = MKMF
endif
# Use hdepends command (not GNU compiler flags)
# to generate header file dependancies for Darwin.
# Darwin has multiple -arch compiler flags.
HDEPENDS_METHOD = MKMF
ifneq ($(findstring darwin,$(T_A)),)
# Perl loadable libraries on Darwin have funny names
LOADABLE_SHRLIB_PREFIX =
LOADABLE_SHRLIB_SUFFIX = .bundle
LOADABLE_SHRLIB_SUFFIX = .$(shell $(PERL) ../perlConfig.pl dlext)
endif
PERL_VERSION = $(shell $(PERL) ../perlConfig.pl version)
@@ -56,14 +54,11 @@ include $(TOP)/configure/RULES
ifdef T_A
EXTUTILS = $(shell $(PERL) ../perlConfig.pl privlib)/ExtUtils
XSUBPP = $(firstword $(wildcard /usr/bin/xsubpp $(EXTUTILS)/xsubpp))
%.c: ../%.xs
$(RM) $@ $@_new
$(PERL) $(EXTUTILS)/xsubpp -typemap $(EXTUTILS)/typemap $< > $@_new && $(MV) $@_new $@
%.html: ../%.pm
$(RM) $@
podchecker $< && pod2html --infile=$< --outfile=$@
$(PERL) $(XSUBPP) -typemap $(EXTUTILS)/typemap $< > $@_new && $(MV) $@_new $@
$(INSTALL_PERL_MODULES)/$(PERL_ARCHPATH)/%: %
$(ECHO) "Installing loadable shared library $@"

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
use strict;
@@ -148,11 +148,11 @@ sub display {
}
sub HELP_MESSAGE {
print STDERR "\nUsage: caget [options] <PV name> ...\n",
print STDERR "\nUsage: caget.pl [options] <PV name> ...\n",
"\n",
" -h: Help: Print this message\n",
"Channel Access options:\n",
" -w <sec>: Wait time, specifies longer CA timeout, default is $opt_w second\n",
" -w <sec>: Wait time, specifies CA timeout, default is $opt_w second\n",
"Format options:\n",
" -t: Terse mode - print only value, without name\n",
" -a: Wide mode \"name timestamp value stat sevr\" (read PVs as DBR_TIME_xxx)\n",
@@ -182,6 +182,7 @@ sub HELP_MESSAGE {
" -0b: Print as binary number\n",
"Set output field separator:\n",
" -F <ofs>: Use <ofs> to separate fields on output\n",
"\n";
"\n",
"Base version: ", CA->version, "\n";
exit 1;
}

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
use strict;
@@ -52,13 +52,14 @@ sub display {
}
sub HELP_MESSAGE {
print STDERR "\nUsage: cainfo [options] <PV name> ...\n",
print STDERR "\nUsage: cainfo.pl [options] <PV name> ...\n",
"\n",
" -h: Help: Print this message\n",
"Channel Access options:\n",
" -w <sec>: Wait time, specifies CA timeout, default is $opt_w second\n",
"\n",
"Example: cainfo my_channel another_channel\n",
"\n";
"\n",
"Base version: ", CA->version, "\n";
exit 1;
}

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
use strict;
@@ -109,11 +109,11 @@ sub display {
}
sub HELP_MESSAGE {
print STDERR "\nUsage: camonitor [options] <PV name> ...\n",
print STDERR "\nUsage: camonitor.pl [options] <PV name> ...\n",
"\n",
" -h: Help: Print this message\n",
"Channel Access options:\n",
" -w <sec>: Wait time, specifies longer CA timeout, default is $opt_w second\n",
" -w <sec>: Wait time, specifies CA timeout, default is $opt_w second\n",
" -m <mask>: Specify CA event mask to use, with <mask> being any combination of\n",
" 'v' (value), 'a' (alarm), 'l' (log/archive), 'p' (property)",
" Default: '$opt_m'\n",
@@ -144,6 +144,7 @@ sub HELP_MESSAGE {
"\n",
"Example: camonitor -f8 my_channel another_channel\n",
" (doubles are printed as %f with 8 decimal digits)\n",
"\n";
"\n",
"Base version: ", CA->version, "\n";
exit 1;
}

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