Compare commits

..

260 Commits

Author SHA1 Message Date
Janet B. Anderson
22b550ed35 R3.13.0.beta2 1996-10-16 18:42:44 +00:00
Janet B. Anderson
a17b659a86 Added target arch mv162 1996-10-16 18:14:05 +00:00
Janet B. Anderson
b5e120d082 c++ code will, by default, not be compiled. 1996-10-16 14:05:36 +00:00
Marty Kraimer
b8d6a8216e In example database field(FLNK, "mrkc0a1.VAL ") removed
Extra rules in Makefile.Vx
1996-10-15 20:00:44 +00:00
Marty Kraimer
5587867f6f lval was not correctly updated 1996-10-15 19:59:14 +00:00
Marty Kraimer
be33ae291e Round rval 1996-10-15 19:58:05 +00:00
Marty Kraimer
932a4b0d5c Fixed some casts 1996-10-15 19:51:43 +00:00
Marty Kraimer
7452aea2bc Get rid of extra trailing \0 1996-10-15 19:34:23 +00:00
Marty Kraimer
178e034e75 add impLib stuff 1996-10-15 19:27:57 +00:00
Marty Kraimer
cbb5a6acde Allow records in the database but no hardware.
Dont set HW limit alarm. Let recod support do it.
1996-10-15 19:25:58 +00:00
Marty Kraimer
08a8e874eb Allow no field defs in record instance with { } 1996-10-15 19:24:49 +00:00
Marty Kraimer
29f381b8f4 Fix problem of iocInit hanging 1996-10-15 19:23:51 +00:00
Marty Kraimer
5d123c6a4d Fix default problems 1996-10-15 19:23:22 +00:00
Marty Kraimer
2d999ed858 The form for FWDLINK PV fields does not work correctly. 1996-10-15 19:22:07 +00:00
Marty Kraimer
956fba853e Now accepts the characters ^ and ~ in strings. 1996-10-15 19:20:55 +00:00
Marty Kraimer
97b96da957 The dbCa Event task may fail. 1996-10-15 19:18:29 +00:00
Marty Kraimer
63a377ce99 The scan task could fail if addressing location 0 causes a failure 1996-10-15 19:17:30 +00:00
Marty Kraimer
84df076e38 checks that lset was allocated 1996-10-15 19:15:26 +00:00
Marty Kraimer
582d4b64cd add defs for src/devOpt 1996-10-15 19:06:53 +00:00
Marty Kraimer
ebebde9539 sdr2recordtype Failed on ascii files that had invalid GUI defs 1996-10-15 19:05:51 +00:00
Marty Kraimer
8771c33c46 ca_build_and_connect changed to ca_search_and_connect 1996-10-15 19:04:14 +00:00
Janet B. Anderson
3eae90a803 Portability change - added MV definition 1996-10-14 19:07:59 +00:00
Janet B. Anderson
693de689e9 Portability change. 1996-10-14 18:51:41 +00:00
Janet B. Anderson
a30a0fcbaa Portability changes. 1996-10-14 18:45:18 +00:00
Janet B. Anderson
0283890686 Clean rule now uses rm macro. Removed . in VPATH def. 1996-10-14 16:33:36 +00:00
Janet B. Anderson
c1d0a4ad5a Changed clean rule to use macro def for rm. 1996-10-14 16:24:10 +00:00
Janet B. Anderson
b2fcff709b Removed extra slash from CAS def. 1996-10-14 16:16:21 +00:00
Janet B. Anderson
aed16987e2 Removed extra dependancy on deplibs. 1996-10-14 16:08:03 +00:00
Marty Kraimer
b6a5423a1f Original version 1996-09-20 15:37:38 +00:00
Janet B. Anderson
9610b9a07d Modified defs for hostArchs and crossArchs. 1996-09-17 14:49:07 +00:00
Janet B. Anderson
98df963844 Added DBDNAME to build definition and clean rule. 1996-09-17 14:48:28 +00:00
Jeff Hill
19f9d0c14d umsigned => unsigned 1996-09-16 22:55:01 +00:00
Jeff Hill
a5e1223b0c added subroutine wrapper around reads and writes 1996-09-16 22:14:02 +00:00
Jeff Hill
0db9c03505 drvTime.c is no longer used 1996-09-16 22:11:03 +00:00
Jeff Hill
a3ce428cdd better report 1996-09-16 22:03:49 +00:00
Jeff Hill
057e1723cb added several compiler support functions and updated to gcc 2.7.2 1996-09-16 21:56:03 +00:00
Jeff Hill
0f156d5219 this is also in libvxWorks 1996-09-16 21:27:11 +00:00
Jeff Hill
1d39b11b7f removed unused variable 1996-09-16 21:19:25 +00:00
Jeff Hill
9e12de8e4f added prototypes and fixed warnings 1996-09-16 21:18:54 +00:00
Jeff Hill
4aa19f07d7 fixed warinings and added epicsShareAPI 1996-09-16 21:18:12 +00:00
Jeff Hill
142b7515e3 fixed warnings 1996-09-16 21:07:11 +00:00
Jeff Hill
8feefadabf added rebuild target at lower levels 1996-09-16 19:35:59 +00:00
Jeff Hill
6a9030e5e6 added epicsShareAPI 1996-09-16 18:43:14 +00:00
Jeff Hill
bece5d0b9a fixed bug in test routine 1996-09-16 18:41:53 +00:00
Jeff Hill
24e0989142 include shareLib.h 1996-09-16 18:41:13 +00:00
Jeff Hill
815668143f backed out multi-thread build because most sites do not have tornado or gcc 2.7.2 1996-09-16 18:37:28 +00:00
Jeff Hill
737278aa41 fixed comment 1996-09-16 18:30:27 +00:00
Jeff Hill
c14d23494c fixed printf format warning 1996-09-16 18:29:16 +00:00
Jeff Hill
d611fa2d75 vxWorks port changes 1996-09-16 18:27:51 +00:00
Jeff Hill
1aa384308d added cvs log entries 1996-09-16 18:22:09 +00:00
Jeff Hill
2e80e8c2ee allow abs path 1996-09-16 18:19:47 +00:00
Jeff Hill
0830382ec7 added multiThread build 1996-09-16 18:01:31 +00:00
Jeff Hill
c253066bc7 local except => except handler & ca vers str routine 1996-09-16 16:41:47 +00:00
Jeff Hill
6fca0cd260 make EPICS version be the console title 1996-09-16 16:40:13 +00:00
Jeff Hill
470152454b local except => except handler 1996-09-16 16:39:20 +00:00
Jeff Hill
4a8507cb0d o dont print disconnect message when the last channel on a connection is
deleted and the conn goes away
o local exceptions => exception handler
1996-09-16 16:37:02 +00:00
Jeff Hill
6917b31975 local exceptions => exception handler 1996-09-16 16:35:22 +00:00
Jeff Hill
0cf19108db added epicsShareAPI to ca_message() 1996-09-16 16:34:24 +00:00
Jeff Hill
01b3617614 added ca_version() proto and pFile/lineNo args to exception args 1996-09-16 16:33:45 +00:00
Jeff Hill
27567a54ed added CA version string 1996-09-16 16:32:49 +00:00
Jeff Hill
c04f34be42 fixed NT warnings 1996-09-16 16:31:01 +00:00
Jim Kowalkowski
0d2b196be2 New doc files 1996-09-16 13:41:29 +00:00
Jim Kowalkowski
7c23cf9c8c makefile to build library outside of EPICS tree 1996-09-12 11:18:46 +00:00
Jim Kowalkowski
2d0dd7828f Adjusted dbMapper.cc so gdd to string function work correctly
Added checks in gdd.h so that get(pointer) functions work with scalars
1996-09-10 15:06:29 +00:00
Jim Kowalkowski
6fbc050c96 fixes to destroyData function 1996-09-07 13:03:07 +00:00
Janet B. Anderson
5856008613 R3.13.0.beta2 1996-09-05 14:47:19 +00:00
Marty Kraimer
f3003d9052 Remove rule for RECTYPES 1996-09-05 14:22:31 +00:00
Marty Kraimer
340ffec332 Forgot = 1996-09-05 13:42:25 +00:00
Marty Kraimer
91c6f156ff conversion should not have added .5 (bad for - numbers) 1996-09-05 13:01:27 +00:00
Marty Kraimer
2008c19e7d Forgot to save changes last time 1996-09-05 12:52:42 +00:00
Marty Kraimer
4dcb0e3ae6 Changed AB SLC500 DCM names to show that it is only for SLC500 DCM 1996-09-05 12:37:33 +00:00
Marty Kraimer
74bc7758b5 changed to show that support is for SCL500 Dcm 1996-09-05 12:36:05 +00:00
Jeff Hill
17143d0e12 wait for proper compiler installation 1996-09-04 22:51:58 +00:00
Jeff Hill
40be4d1cd5 allow vxWorks 5.1 and gnu win 32 1996-09-04 22:47:09 +00:00
Jeff Hill
d1ba9be665 installed 1996-09-04 22:41:41 +00:00
Jeff Hill
7f6bd17474 removed until the new gnu compilers are installed 1996-09-04 22:41:12 +00:00
Jeff Hill
6a534ca2b5 fixed gcc warnings 1996-09-04 22:08:50 +00:00
Jeff Hill
26ec4dd5c8 installed 1996-09-04 22:06:47 +00:00
Jeff Hill
a0db9a2eb2 not used 1996-09-04 22:06:24 +00:00
Jeff Hill
b5a102ef79 moved netdb.h include here 1996-09-04 22:04:07 +00:00
Jeff Hill
ed1491bb7b fixed gcc warnings 1996-09-04 21:59:03 +00:00
Jeff Hill
7fabc325bb added level arg to client_stat 1996-09-04 21:58:27 +00:00
Jeff Hill
5b546d2467 added vxWorks support 1996-09-04 21:54:56 +00:00
Jeff Hill
6440239832 allow use with goofy vxWorks 5.2 time spec - which has unsigned sec and
signed nsec
1996-09-04 21:53:36 +00:00
Jeff Hill
cb6c444a19 added hashed fd to fdi convert 1996-09-04 21:50:16 +00:00
Jeff Hill
c251b05020 MS Visual C defines sys_errlist in stdlib.h 1996-09-04 21:48:29 +00:00
Jeff Hill
1f7cc343c5 fixed gcc warning 1996-09-04 21:46:20 +00:00
Janet B. Anderson
d67eb28145 Top level dir no longer passed to MakeRelease 1996-09-04 21:41:36 +00:00
Jeff Hill
3001f7e82f no what on win32 1996-09-04 21:40:28 +00:00
Janet B. Anderson
3982ea7d17 Added info about new targets. 1996-09-04 21:22:34 +00:00
Jeff Hill
3fe00ec2a9 installed 1996-09-04 21:21:01 +00:00
Jeff Hill
11fa08c1e0 installed 1996-09-04 21:02:33 +00:00
Jeff Hill
b8d2273683 added GDD_NAME_PV_NAME 1996-09-04 20:58:55 +00:00
Jeff Hill
77fc9734b1 changes for MS VISC++ 1996-09-04 20:58:18 +00:00
Jeff Hill
289302f603 add GDD_NAME_PV_NAME 1996-09-04 20:55:02 +00:00
Jeff Hill
a01241aa19 fixed gcc warnings 1996-09-04 20:44:19 +00:00
Marty Kraimer
525842b076 added devABANALOG 1996-09-04 20:41:57 +00:00
Marty Kraimer
03a4c8ad01 added devABANALOG 1996-09-04 20:41:10 +00:00
Jeff Hill
8a7158b3c6 installed into CVS 1996-09-04 20:39:59 +00:00
Jeff Hill
08c57574d5 removed os depen stuff 1996-09-04 20:29:08 +00:00
Jeff Hill
a6c40247f1 (char *) cast below is for brain dead wrs prototype 1996-09-04 20:28:18 +00:00
Jeff Hill
86969d7b3a doccasdef.h 1996-09-04 20:27:02 +00:00
Jeff Hill
a3c13f6da6 use correct app type for exist test gdd, correct byte oder for mon mask, and efficient use of PV name gdd 1996-09-04 20:25:53 +00:00
Jeff Hill
0d0566253e added operator -> 1996-09-04 20:23:59 +00:00
Jeff Hill
15fda603a5 init new member cas and add arg to serverToolDebug() 1996-09-04 20:23:17 +00:00
Jeff Hill
7c0895bd82 removed operator -> and added member pv 1996-09-04 20:21:41 +00:00
Jeff Hill
5311ba4c15 removed sizeof(casEventMask::mask) for MSVISC++ 1996-09-04 20:20:44 +00:00
Jeff Hill
27b0c05bcf added missing byte swap on search reply port no 1996-09-04 20:19:47 +00:00
Jeff Hill
435208afa8 include db_access.h 1996-09-04 20:19:02 +00:00
Jeff Hill
0f1f7fc30c moved operator -> here 1996-09-04 20:18:27 +00:00
Jeff Hill
471acea0fc init new chan member 1996-09-04 20:18:03 +00:00
Jeff Hill
e122d8f4a6 use ptr not ref to satisfy MSVISC++ 1996-09-04 20:17:34 +00:00
Jeff Hill
53bde9e545 initialize new member - asyncIO 1996-09-04 20:13:16 +00:00
Jeff Hill
2ccaa6dcb6 added arg to serverToolDebugFunc() 1996-09-04 20:12:04 +00:00
Jeff Hill
8c8b971221 comment 1996-09-04 20:11:43 +00:00
Jeff Hill
dd43f91278 added new files 1996-09-04 20:10:43 +00:00
Jeff Hill
6b3a62de9f added main.cc 1996-09-04 20:09:33 +00:00
Jeff Hill
4bd45337bf add getEnums() stub 1996-09-04 20:08:55 +00:00
Jeff Hill
9351447cf2 removed main() 1996-09-04 20:08:33 +00:00
Jeff Hill
b9cdf72ee1 added defualt copy constructor fer MSVISC++ 1996-09-04 20:07:52 +00:00
Jeff Hill
81000e9391 added include of os specific area 1996-09-04 20:06:15 +00:00
Jeff Hill
19b81912fb added mt makefiles 1996-09-04 20:04:57 +00:00
Jeff Hill
b7df13b4fe fixed gcc warning 1996-09-04 20:02:32 +00:00
Jeff Hill
2f3befc845 test for non-nill piiu under vxWorks 1996-09-04 20:02:00 +00:00
Jeff Hill
826b68b652 string id resource now copies id 1996-09-04 19:57:11 +00:00
Janet B. Anderson
aece23e6ee Removed VPATH (puts ../$(INSTALL_LOCATION) in search path) 1996-09-04 19:19:52 +00:00
Janet B. Anderson
3a9ddfbdbb Change ARCHS and ACTIONS defs to +=. 1996-09-04 18:26:44 +00:00
Janet B. Anderson
11bdb5f6d4 Removed cvsignore files. 1996-09-04 18:22:48 +00:00
Janet B. Anderson
741450ce9e Removed copy of vxWorks files. 1996-09-04 18:18:25 +00:00
Janet B. Anderson
868e6c417d Modified dependency. 1996-09-04 18:17:18 +00:00
Marty Kraimer
0c19e23835 added new rules 1996-09-04 15:29:48 +00:00
Marty Kraimer
342ffb5d83 fixed bugs repoeted in 3.13 beta1 1996-09-04 15:28:56 +00:00
Marty Kraimer
afa44fae79 added routines to obtain options for link field 1996-09-04 15:27:53 +00:00
Marty Kraimer
333b379287 fixed bugs 1996-09-04 15:26:58 +00:00
Marty Kraimer
36f74c934e removed event throttling code 1996-09-04 15:25:54 +00:00
Marty Kraimer
8f41686a98 If process routine found udf true it did not perform normal record completion 1996-09-04 15:25:19 +00:00
Marty Kraimer
75feb3a5d4 Changes for 3.13 1996-09-04 15:23:54 +00:00
Marty Kraimer
50ace741fe removed obsolete event throttling code 1996-09-04 15:23:22 +00:00
Marty Kraimer
036cd8dd26 Added INC+= 1996-08-27 16:11:30 +00:00
Marty Kraimer
9758aa4a45 Error on special gave wrong error message 1996-08-27 16:04:31 +00:00
Marty Kraimer
cf1cb554f6 dbPutField - Call special before converting to DB or CA 1996-08-27 16:03:42 +00:00
Marty Kraimer
ee68f746c6 Sometimes sdr2recordtype can't find field name 1996-08-27 15:48:31 +00:00
Jeff Hill
85f2cf5833 No longer used 1996-08-27 15:45:13 +00:00
Jim Kowalkowski
5819ac0c48 final repairs to string functions, put() functions, and error code printing 1996-08-27 13:05:10 +00:00
Jim Kowalkowski
3e26a12948 completed fixes for the aitString and fixed string management 1996-08-23 20:29:36 +00:00
Jim Kowalkowski
279385ecb9 made dump functions print more useful information 1996-08-23 20:28:46 +00:00
Jim Kowalkowski
75c91c8035 More fixes to make strings and fixed string work better. 1996-08-22 21:05:43 +00:00
Janet B. Anderson
1f39f39d79 R3.13.0.beta1 1996-08-15 14:50:15 +00:00
Marty Kraimer
d807b2ace5 More changes for handling forms 1996-08-14 20:59:07 +00:00
Janet B. Anderson
18c52e5839 CVS:Now allows archname in targets.
--------------------i--------------------------------------------------
1996-08-14 20:47:46 +00:00
Janet B. Anderson
81cd82fcca SPECIAL_LANG not needed any more. 1996-08-14 20:46:24 +00:00
Janet B. Anderson
f1d714a57e Added PHONEY stmnts. 1996-08-14 20:42:46 +00:00
Janet B. Anderson
7ce03e13e8 Removed reference to SPECIAL_LANG 1996-08-14 20:41:17 +00:00
Marty Kraimer
3ca0a1f556 More changes for code that handles forms 1996-08-14 18:50:13 +00:00
Jim Kowalkowski
b8a0083745 fixed a put() function that did not return anything 1996-08-14 16:29:38 +00:00
Janet B. Anderson
11925a7168 Added sch2edif and e2db and flags. 1996-08-14 14:33:48 +00:00
Jim Kowalkowski
e81b990a31 added first() to list class, added first()/last() to iterator. 1996-08-14 12:32:09 +00:00
Jim Kowalkowski
edff93791b fixes for converting aitString to aitInt8* and back
fixes for managing the units field for the dbr types
1996-08-14 12:30:15 +00:00
Jeff Hill
5ca9baaede removed os specific code 1996-08-13 23:16:23 +00:00
Jeff Hill
ea0ff36f65 fixed warning 1996-08-13 23:15:36 +00:00
Jeff Hill
a2b8735fe5 check status in call back 1996-08-13 23:14:59 +00:00
Jeff Hill
cb9583a21a win NT changes 1996-08-13 23:13:35 +00:00
Jeff Hill
3d1180b17f C++ support 1996-08-13 23:07:40 +00:00
Jeff Hill
507a125c2c removed include of netdb.h 1996-08-13 23:00:29 +00:00
Jeff Hill
c5bfbfccc0 added init to mutex class 1996-08-13 22:58:38 +00:00
Jeff Hill
d3e21e87b2 fdMgr.h => fdmanager.h 1996-08-13 22:58:15 +00:00
Jeff Hill
9c05191e9e added init for mutex class 1996-08-13 22:56:14 +00:00
Jeff Hill
9c2248a5c6 doc 1996-08-13 22:54:42 +00:00
Jeff Hill
546bb97e92 fixed little endian problem 1996-08-13 22:54:20 +00:00
Jeff Hill
c556f69387 changes for MVC++ 1996-08-13 22:53:14 +00:00
Jeff Hill
2ec12266ad dfMgr =>fdManager 1996-08-13 22:48:25 +00:00
Jeff Hill
13c03c4cde fixed tabs 1996-08-13 22:45:21 +00:00
Jeff Hill
99deec1134 fdMgr.h => fdManager.h 1996-08-13 22:44:24 +00:00
Jeff Hill
1938a00761 use put convert 1996-08-13 22:43:50 +00:00
Janet B. Anderson
e50d5375f8 Added mangen and capfast rules. 1996-08-13 21:48:00 +00:00
Jeff Hill
30e64505e3 added C++ support 1996-08-13 21:42:57 +00:00
Jeff Hill
0b3df30c4f many sequnecer changes from Andy Kozubal 1996-08-13 15:39:22 +00:00
Jim Kowalkowski
070673fa89 changes for better string manipulation and fixes for the units field 1996-08-13 15:07:48 +00:00
Jeff Hill
bfb6dcc118 fixed problem in ca_import_cancel() 1996-08-12 21:50:41 +00:00
Marty Kraimer
46c39c3253 Fixed various bugs related to forms 1996-08-12 20:17:49 +00:00
Jim Kowalkowski
ad232dd2d9 Re-added the installString() function I took out. 1996-08-12 15:37:46 +00:00
Janet B. Anderson
c40ff7da52 Removed .cvsignore file. 1996-08-12 15:14:01 +00:00
Janet B. Anderson
2af23a4893 SPECIAL_LANG changed for new compilers. 1996-08-09 14:01:27 +00:00
Marty Kraimer
7260cf15fb removed .cvsignore; added comment about cd path to startup file 1996-08-09 13:23:17 +00:00
Jim Kowalkowski
ee2cf25c35 fix getRef(aitString*&) to return the correct value if gdd is scalar 1996-08-09 02:29:16 +00:00
Jim Kowalkowski
08ec0e69d8 rewrite of aitString class - more intuitive now, I think 1996-08-09 02:28:09 +00:00
Marty Kraimer
e906138c55 Mods for handling forms 1996-08-08 19:05:34 +00:00
Marty Kraimer
0e6b238881 Changes for new config rules 1996-08-08 19:04:30 +00:00
Marty Kraimer
82e39acd3a Changed rule for dbExpand 1996-08-08 19:03:55 +00:00
Janet B. Anderson
85ef2f5a10 Added prod rule. 1996-08-07 22:38:13 +00:00
Janet B. Anderson
733ed90bd7 Uninstall rule changes. 1996-08-07 21:00:46 +00:00
Janet B. Anderson
4c8c63c9e1 DIRS now used by src/Makefile 1996-08-07 20:50:35 +00:00
Janet B. Anderson
aeaad63186 Now includes RULES_TOP, changed DIRS def. 1996-08-07 20:49:37 +00:00
Janet B. Anderson
70a87d2c95 Now includes RULES_DIRS, added rules for applications 1996-08-07 20:46:45 +00:00
Janet B. Anderson
41b53c1a67 Simplified syntax 1996-08-07 20:40:25 +00:00
Janet B. Anderson
a4ac96afdc Added VPATH, PHONEY, mangen rule, double colon rules. 1996-08-07 20:37:29 +00:00
Janet B. Anderson
a5d46a7a07 Added VPATH, PHONEY, mangen rule and changed rules to double colen rules 1996-08-07 20:23:31 +00:00
Janet B. Anderson
e37d227975 Now installs only build specific config files. 1996-08-07 20:14:26 +00:00
Janet B. Anderson
adab5e6a1a Make some includes optional 1996-08-07 20:12:37 +00:00
Janet B. Anderson
56a11aa90c New Makefile added. 1996-08-07 20:11:03 +00:00
Janet B. Anderson
969152088f Removed reference to EPICS_BASE 1996-08-07 20:10:00 +00:00
Janet B. Anderson
2a5871e303 Bug fix for SRCS.c 1996-08-07 20:09:03 +00:00
Janet B. Anderson
b5c459b036 Added option for creation of missing parent dirs 1996-08-07 20:08:00 +00:00
Janet B. Anderson
cffd160cf0 installEpics must be installed first. 1996-08-07 20:06:22 +00:00
Jim Kowalkowski
c4aa64946f Fixes to the string class.
Changes units field to a aitString instead of aitInt8.
1996-08-06 19:14:13 +00:00
Jeff Hill
069c404d64 use ca_import_cancel() 1996-08-05 23:50:59 +00:00
Jeff Hill
998e413bed gddScaler => gddScalar 1996-08-05 23:22:58 +00:00
Jeff Hill
8fd7fff71c use ca_import_cancel() 1996-08-05 22:41:08 +00:00
Jeff Hill
d799330ec0 removed READONLY which disagrees with VAX compiler 1996-08-05 21:58:57 +00:00
Jeff Hill
631de381fd fixed delete this confusion 1996-08-05 21:53:43 +00:00
Jeff Hill
f15f4ad524 added -include of HOME/.EPICS_CONFIG 1996-08-05 21:46:57 +00:00
Jeff Hill
13156bee16 removed ; from if 1996-08-05 19:33:40 +00:00
Jeff Hill
090e6ce3d3 fixed removes use of iter.cur() 1996-08-05 19:31:59 +00:00
Jeff Hill
fd2a536131 no change 1996-08-05 19:30:49 +00:00
Jeff Hill
6b6c9ce6a1 os depen code now smaller 1996-08-05 19:29:25 +00:00
Jeff Hill
95f4990b98 space became tab 1996-08-05 19:28:49 +00:00
Jeff Hill
ad2a272e90 added process() 1996-08-05 19:27:28 +00:00
Jeff Hill
7438234eb5 doc 1996-08-05 19:26:51 +00:00
Jeff Hill
67eb929b63 made os specific code smaller 1996-08-05 19:26:15 +00:00
Jeff Hill
5d73bdffb2 removed unused code 1996-08-05 19:25:17 +00:00
Jeff Hill
3c603a7e3f removed ERROR and OK 1996-08-05 19:24:23 +00:00
Jeff Hill
ec34df23fc removed unused proto 1996-08-05 19:21:26 +00:00
Jeff Hill
67dce79b62 removed incorrect ver number 1996-08-05 19:20:29 +00:00
Jeff Hill
70c885000e better msg for lack of fp 1996-08-05 19:18:56 +00:00
Jeff Hill
f2cd63c68f info level => warning several codes 1996-08-05 19:17:47 +00:00
Jeff Hill
7d342b5276 WIN sock specific fd range check 1996-08-05 19:16:27 +00:00
Jeff Hill
20880b3950 fixed O.xxx/Makefile 1996-07-30 21:27:39 +00:00
Marty Kraimer
6bd6481cbd check that recGblInitConstantLink returned TRUE before setting udf FALSE
Add DBE_LOG on call to db_post_event when necessary
1996-07-29 20:40:13 +00:00
Marty Kraimer
2433b09c1c additional include install commands were added 1996-07-29 20:35:04 +00:00
Marty Kraimer
a057f79d75 various bugs fixed 1996-07-29 20:33:43 +00:00
Marty Kraimer
1947538968 These utilities core dumped if given no arguments. 1996-07-29 20:29:00 +00:00
Marty Kraimer
dc6972ba06 "Allen Bradley 1746-HTSP" changed to "AB-1746HSTP1"
VS: ----------------------------------------------------------------------
1996-07-29 20:26:19 +00:00
Marty Kraimer
c4171b7ec0 initial check that argc>=2 1996-07-26 19:26:43 +00:00
Jim Kowalkowski
7f08759c2a Corrected a spelling with from gdd associated with the word Scalar. 1996-07-26 02:30:07 +00:00
Jim Kowalkowski
43b11de6ad Corrected a spelling error associated with the word Scalar from gdd. 1996-07-26 02:29:32 +00:00
Jim Kowalkowski
66ee6135ba Corrected the spelling error from gdd associated with the word Scalar 1996-07-26 02:28:37 +00:00
Jim Kowalkowski
3c4ffb5cc4 Fixed the spelling error with Scalar. 1996-07-26 02:23:18 +00:00
Jeff Hill
72a8c35f55 use pattern rule 1996-07-25 23:50:15 +00:00
Jeff Hill
53f2acfaa1 use RULES_DIRS 1996-07-25 21:38:53 +00:00
Jeff Hill
fe4cfd8091 no longer in use 1996-07-25 21:37:54 +00:00
Jeff Hill
8c2cefc5a4 eliminated for loops and redun recursion 1996-07-25 21:09:43 +00:00
Jeff Hill
dbe9f90ac1 DIRS def before include of RULES_TOP 1996-07-25 21:07:39 +00:00
Jeff Hill
4b47e7a979 use pointer (not ref) for list in iter class 1996-07-25 18:01:42 +00:00
Jeff Hill
d12ce5f58a updated tests to current version 1996-07-25 18:00:21 +00:00
Jeff Hill
f1b751a3d3 fixed missing ref in list decl 1996-07-25 17:58:16 +00:00
Jeff Hill
c324b8f598 instlled 1996-07-24 23:03:16 +00:00
Jeff Hill
64e851e05c use iter.remove() 1996-07-24 23:01:53 +00:00
Jeff Hill
e3fb1f6c90 fixed gnu warning int=>size_t 1996-07-24 22:48:06 +00:00
Jeff Hill
0844d7132f removed OPTIM_YES=-g which caused link fail 1996-07-24 22:47:29 +00:00
Jeff Hill
dd8fa0e290 installed makefiles 1996-07-24 22:26:29 +00:00
Jeff Hill
276dd19293 removed gdd:: from func proto 1996-07-24 22:17:17 +00:00
Jeff Hill
a312de99b0 added remove() to iter class + made node's prev/next private 1996-07-24 22:12:09 +00:00
Jeff Hill
ccfcd95561 removed casSpecificOS.h 1996-07-24 22:05:18 +00:00
Jeff Hill
2e42535459 fixed net proto for gnu compiler 1996-07-24 22:03:36 +00:00
Jeff Hill
d3432d487a added pushOnToEventQueue() 1996-07-24 22:00:50 +00:00
Jeff Hill
c6701f8475 CXXCMPLR = STRICT 1996-07-24 21:57:17 +00:00
Jeff Hill
dba800ebb7 fixed gnu warnings 1996-07-24 21:55:33 +00:00
Jeff Hill
cda87cbf31 made acctst catime into targets 1996-07-24 21:52:36 +00:00
Jim Kowalkowski
376f37eb1e various fixes - dbmapper incorrectly worked with enum types 1996-07-23 17:13:34 +00:00
Janet B. Anderson
2f2f378238 Updated to reflect config dir changes. 1996-07-16 14:18:48 +00:00
286 changed files with 10967 additions and 7116 deletions

View File

@@ -10,6 +10,9 @@
# [-b] - For fully built release
#
# $Log$
# Revision 1.8 1996/07/02 13:45:09 jba
# Added dbd and base/config dirs. Removed epics/config and base/rec.
#
# Revision 1.7 1996/06/25 21:54:42 jba
# Command line parm now base dir
#
@@ -75,9 +78,13 @@ fi
FULLY_BUILT=NO
if [ "${2}" = "-b" ]; then
if [ "${1}" = "-b" ]; then
FULLY_BUILT=YES
shift
if [ "${1}" != "." ]; then
echo "TOP: Cannot create a fully built release.";
exit 1;
fi
fi
# Retrieve EPICS release string from src/include/epicsVersion.h

View File

@@ -16,89 +16,19 @@
TOP=.
include $(TOP)/config/CONFIG_BASE
all: install
DIRS = src config
build:
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} $@.$${ARCH}; \
done)
install:
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} $@.$${ARCH}; \
done)
depends:
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} $@.$${ARCH}; \
done)
clean:
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} $@.$${ARCH}; \
done)
uninstall:
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} $@.$${ARCH}; \
done)
include $(TOP)/config/RULES_TOP
release:
@echo TOP: Creating Release...
@./MakeRelease ${TOP}
@./MakeRelease
built_release: install
built_release:
@echo TOP: Creating Fully Built Release...
@./MakeRelease ${TOP} -b
@./MakeRelease -b $(INSTALL_LOCATION)
# Notes for single architecture build rules:
# CheckArch only has to be run for dirs.% . That
# way it will only be run ONCE when filtering down
# dependencies.
#
# CheckArch does not have to be run for cleans
# because you might want to eliminate binaries for
# an old architecture.
# DIRS RULE syntax: make depends.arch
# e.g.: make depends.mv167
#
# Create dependencies for an architecture. We MUST
# do this separately for each architecture because
# some things may be included on a per architecture
# basis.
build.%:
@echo $*: Building
@${MAKE} ${MFLAGS} T_A=$* -f Makefile.subdirs build
install.%:
@echo $*: Installing
@${MAKE} ${MFLAGS} T_A=$* -f Makefile.subdirs install
depends.%:
@echo $*: Performing Make Depends
@${MAKE} ${MFLAGS} T_A=$* -f Makefile.subdirs depends
# Illegal Syntax
release.%:
@echo
@echo "The release.arch syntax is not supported by this build."
@echo " Use 'make release' or 'make built_release' instead."
@echo
uninstall.%:
@echo "TOP: Uninstalling $* "
@rm -rf $(INSTALL_LOCATION_BIN)/$* $(INSTALL_LOCATION_LIB)/$* \
$(INSTALL_LOCATION)/dbd $(INSTALL_MAN) $(INSTALL_INCLUDE)
@rm -rf rec.bak rec
uninstall::
@DIR1=`pwd`;cd $(INSTALL_LOCATION);DIR2=`pwd`;cd $$DIR1;\
if [ "$$DIR1" != "$$DIR2" ]; then rm -fr $(INSTALL_LOCATION)/config; fi
clean.%:
@echo "TOP: Cleaning $* "
@find src -type d -name "O.$*" -prune -exec rm -rf {} \;
@find config -type d -name "O.$*" -prune -exec rm -rf {} \;

View File

@@ -1,55 +0,0 @@
#
# base $Id$
#
# EPICS Makefile For Subdirectory Recursions
# by Matthew Needes and Mike Bordua
#
TOP=.
include $(TOP)/config/CONFIG_BASE
all: build
build: dirs
@(for DIR in ${DIRS}; \
do \
TMP=`pwd`; echo "${T_A}: $@: $$DIR"; \
cd $$DIR/O.${T_A}; ${MAKE} $@ ; \
cd $$TMP; \
done)
install: dirs
@(for DIR in ${DIRS}; \
do \
TMP=`pwd`; echo "${T_A}: $@: $$DIR"; \
cd $$DIR/O.${T_A}; ${MAKE} $@ ; \
cd $$TMP; \
done)
depends: dirs
@(for DIR in ${DIRS}; \
do \
TMP=`pwd`; echo "${T_A}: $@: $$DIR"; \
cd $$DIR/O.${T_A}; ${MAKE} $@ ; \
cd $$TMP; \
done)
dirs:
@echo ${T_A}: Creating Directories
@for DIR in ${DIRS}; \
do \
TMP=`pwd`; \
cd $$DIR ; \
if [ -f Makefile.${BUILD_TYPE} ] ; then \
test -d O.${T_A} || \
mkdir O.${T_A}; \
test -f O.${T_A}/Makefile || \
( echo "T_A=${T_A}" > O.${T_A}/Makefile; \
echo "include ../Makefile.${BUILD_TYPE}" \
>> O.${T_A}/Makefile;); \
test -f O.${T_A}/.DEPENDS || \
touch O.${T_A}/.DEPENDS; \
fi ; \
cd $$TMP; \
done

180
README
View File

@@ -1,7 +1,7 @@
$Id$
----------------------------------------------------------------------------
3.12 EPICS BASE Notes and Build Instructions.
3.13 EPICS BASE Notes and Build Instructions.
- By Matthew Needes
----------------------------------------------------------------------------
@@ -27,9 +27,9 @@ Notes:
1.2 To add a target architecture to EPICS:
cd config
cp CONFIG_ARCH.mv167 CONFIG_ARCH.YOUR_ARCH
edit CONFIG_ARCH.YOUR_ARCH - For compiler flags / etc.
cd base/config
cp CONFIG.mv167 CONFIG.YOUR_ARCH
edit CONFIG.YOUR_ARCH - For compiler flags / etc.
cp CONFIG.Vx.68k CONFIG.Vx.YOUR_ARCH_CLASS
cp CONFIG_SITE.Vx.68k CONFIG_SITE.Vx.YOUR_ARCH_CLASS
@@ -41,35 +41,51 @@ Notes:
1.3 To build EPICS:
cd epics/base
gnumake - To build and install EPICS.
gnumake - To install include files, build and install EPICS.
(Same as "gnumake inc install")
gnumake all - Same as "gnumake"
gnumake clean - To clean temporary object files. Top level
clean will remove all the O.ARCH dirs, not
only those specified in BUILD_ARCHS.
clean will remove all the O.ARCH dirs, not
only those specified in BUILD_ARCHS.
gnumake uninstall - Only available at the top level directory.
Cleans directories created by the install.
gnumake rebuild - Same as "gnumake clean uninstall all"
1.4 To create an EPICS release:
1.4 "Partial" build commands:
edit src/include/epicsVersion.h - ONLY IF you need to change the EPICS
version number.
The complete set of targets now supported are:
gnumake release - Will create Tar file
action
arch
action.arch
dir
dir.action
dir.arch
dir.action.arch
gnumake built_release - Will create Tar file, after generating
dependencies, INCLUDING BINARIES.
where:
action can be clean, inc, install, depends, or build
action can also be uninstall or rebuild at top level only
dir is the name of a subdirectory.
arch can be host, cross, sun4, solaris, mv167, ...
1.5 "Partial" build commands:
Examples are:
gnumake clean.sun4 - Cleans sun4 binaries in O.sun4 dirs only.
gnumake install.sun4 - Builds sun4 only.
gnumake install.mv167 - Builds mv167 only (a HOST_ARCH build must
be complete before this can be issued).
gnumake inc - To install include files
gnumake install.host - To build and install EPICS for host arch.
gnumake install.cross - To build and install EPICS for Vx archs.
gnumake clean.sun4 - Cleans sun4 binaries in O.sun4 dirs only.
gnumake install.sun4 - Builds sun4 only.
gnumake install.mv167 - Builds mv167 only (a HOST_ARCH build must
be complete before this can be issued).
NOTES:
1. base/MakeRelease will create tar files in the directory ABOVE
base. These tar files are then meant to be untarred at that level.
This release will include the "epics/startup" directory.
2. EPICS binaries and shellscripts are installed into the bin/ARCH and
lib/ARCH directories.
1. EPICS binaries and shellscripts are installed into the directory
$(INSTALL_LOCATION)/bin/ARCH.
2. EPICS libraries are installed into the $(INSTALL_LOCATION)/lib/ARCH
directory.
3. During a normal build (a "make" or "make install"), the "depends"
dependency will NOT be invoked. Only if "make depends" is run
@@ -88,7 +104,7 @@ NOTES:
mv167 target.
----------------------------------------------------------------------------
Part 2 --- Configuration Files in epics/config
Part 2 --- Configuration Files in epics/base/config
----------------------------------------------------------------------------
CONFIG - This file is meant to be included in the low-level EPICS Makefiles.
It includes the other EPICS makefiles, and allows individual developers
@@ -107,7 +123,7 @@ manager. It specifies:
etc.
----------------------------------------------------------------------------
CONFIG_ARCH.ARCH - This file defines a particular architecture. It
CONFIG.ARCH - This file defines a particular architecture. It
contains the following variables:
BUILD_TYPE: Unix / Vx
@@ -115,23 +131,21 @@ contains the following variables:
Architecture dependent build flags. The flag names / contents
depend on your architecture class.
----------------------------------------------------------------------------
CONFIG_SITE.BUILD_TYPE.ARCH_CLASS - Contains definitions of where to
find things, like X11 / Motif, etc.
----------------------------------------------------------------------------
CONFIG.BUILD_TYPE.ARCH_CLASS - Contains definitions pertaining to a
particular architecture class. This file's primary usefulness is to
define compile and link flags.
CONFIG_SITE.ARCH - Contains site specific definitions pertaining to a
particular architecture. This file's primary usefulness is to
define site specific compile and link flags.
----------------------------------------------------------------------------
CONFIG_COMMON - Contains definitions describing the layout of base.
----------------------------------------------------------------------------
CONFIG_BASE
CONFIG_EXTENSIONS - Defines what subdirectories get built by default under
base and extensions.
CONFIG_BASE - Defines what subdirectories get built by default under base.
----------------------------------------------------------------------------
RULES.Vx - Rules for building with VxWorks makefiles.
----------------------------------------------------------------------------
RULES.Unix - Rules for building with Unix makefiles.
----------------------------------------------------------------------------
RULES_TOP - Top level rules for building.
----------------------------------------------------------------------------
RULES_ARCHS
RULES_DIRS - Allows top-level type command syntax in low-level directories.
----------------------------------------------------------------------------
@@ -143,18 +157,18 @@ Filename SYS_MGR ADD_VX_ARCH ADD_UNIX_ARCH DEVELOPER
CONFIG m - - m
CONFIG_SITE m m m -
CONFIG_ARCH.ARCH - c c -
CONFIG_SITE.Unix.ARCH_CLASS m - c* -
CONFIG_SITE.Vx.ARCH_CLASS m c* - -
CONFIG.Unix.ARCH_CLASS - - c* -
CONFIG_SITE_ENV m - - -
CONFIG.ARCH - c c -
CONFIG_SITE.ARCH - c c -
CONFIG.Vx.ARCH_CLASS - c* - -
RULES.Vx - - - -
RULES.Unix - - - -
CONFIG_BASE - - - -
CONFIG_EXTENSIONS - - - -
CONFIG_COMMON - - - -
CONFIG_ENV - - - -
RULES_ARCHS - - - -
RULES_DIRS - - - -
RULES_TOP - - - -
m - Modify an existing file.
c - Create a new file.
@@ -172,63 +186,57 @@ RULES_DIRS - - - -
(files are numbered in the order of their inclusion)
src/db/Makefile.Vx (An example EPICS makefile)
^ ^ ^
| | +--- 3. RULES.Vx
| | Default rules.
| +------- 2. CONFIG
| ^ ^ ^ ^ ^
| | | | | |
| | | | | +- 1. CONFIG_SITE
| | | | | HOST_ARCH = sun4
| | | | | BUILD_ARCHS = $(HOST_ARCH) mv167 hkv2f
| | | | | VX_DIR = /vxworks
| | | | | More.
| | | | +--- 2. CONFIG_COMMON
| | | | General info about base.
| | | +----- 3. CONFIG_ARCH.hkv2f
| | | BUILD_TYPE = Vx
| | | ARCH_CLASS = 68k
| | | Arch Specific Compiler Flag Setup
| | +------- 4. CONFIG_SITE.Vx.68k
| | Directory locations
| +--------- 5. CONFIG.Vx.68k
| Compiler/utility setup for ARCH_CLASS
+---------- 1. Target.include
T_A definition (target architecture)
^ ^
| +--- 3. RULES.Vx
| Default rules.
+------- 2. CONFIG
^ ^ ^ ^
| | | |
| | | +- 1. CONFIG_SITE
| | | HOST_ARCH = sun4
| | | BUILD_ARCHS = $(HOST_ARCH) mv167 hkv2f
| | | VX_DIR = /vxworks
| | | More.
| | +--- 2. CONFIG_COMMON
| | General info about base.
| +----- 3. CONFIG.hkv2f
| ^ BUILD_TYPE = Vx
| | ARCH_CLASS = 68k
| | Arch Specific Compiler Flag Setup
| +--- a. CONFIG.Vx.68k
| Compiler/utility setup for ARCH_CLASS
+------- 4. CONFIG_SITE.hkv2f
Site Specific setup
---------------------------- sun4 example --------------------------------
(files are numbered in the order of their inclusion)
src/db/Makefile.Unix (An example EPICS makefile)
^ ^ ^
| | +--- 3. RULES.Unix
| | Default rules.
| +------- 2. CONFIG
| ^ ^ ^ ^ ^
| | | | | |
| | | | | +- 1. CONFIG_SITE
| | | | | HOST_ARCH = sun4
| | | | | BUILD_ARCHS = $(HOST_ARCH) mv167 hkv2f
| | | | | VX_DIR = /vxworks
| | | | | More.
| | | | +--- 2. CONFIG_COMMON
| | | | General info about base.
| | | +----- 3. CONFIG_ARCH.sun4
| | | BUILD_TYPE = Unix
| | | ARCH_CLASS = sun4
| | | Arch Specific Compiler Flag Setup
| | +------- 4. CONFIG_SITE.Unix.sun4
| | Directory locations
| +--------- 5. CONFIG.Unix.sun4
| Compiler/utility setup for ARCH_CLASS
+---------- 1. Target.include
T_A definition (target architecture)
^ ^
| +--- 3. RULES.Unix
| Default rules.
+------- 2. CONFIG
^ ^ ^ ^
| | | |
| | | +- 1. CONFIG_SITE
| | | HOST_ARCH = sun4
| | | BUILD_ARCHS = $(HOST_ARCH) mv167 hkv2f
| | | VX_DIR = /vxworks
| | | More.
| | +--- 2. CONFIG_COMMON
| | General info about base.
| +----- 3. CONFIG.sun4
| BUILD_TYPE = Unix
| ARCH_CLASS = sun4
| Arch Specific Compiler Flag Setup
+------- 4. CONFIG_SITE.sun4
Directory locations
----------------------------------------------------------------------------
Part 4 --- EPICS dependencies
Part 4 --- EPICS makefile rules
----------------------------------------------------------------------------
Dependencies supported by lower level Makefiles:
Rules supported by lower level Makefiles:
depends - Generate include dependencies
build - Builds objects, using libraries from "build_libs"

View File

@@ -11,16 +11,21 @@ include $(EPICS_BASE)/config/CONFIG_SITE
#
include $(EPICS_BASE)/config/CONFIG_COMMON
ifdef T_A
# assume T_A is the host arch if not specified
ifndef T_A
T_A = $(HOST_ARCH)
endif
# Architecture specific definitions
#
include $(EPICS_BASE)/config/CONFIG.$(T_A)
#
include $(EPICS_BASE)/config/CONFIG_SITE.$(T_A)
endif
-include $(EPICS_BASE)/config/CONFIG_SITE.$(T_A)
# User specific definitions
#
-include $(HOME)/.EPICS_CONFIG
# All EPICS options other than BUILD_TYPE
# may be overridden here.
#
@@ -38,4 +43,3 @@ endif
#VX_WARN=YES
#etc.
#

View File

@@ -22,8 +22,11 @@ YACC = $(EYACC)
LEX = $(ELEX)
G++ = g++
CCC = CC
MV = mv
RMDIR = rm -rf
MKDIR = mkdir
ACC_ANSI_INVOKE_W_NO = $(ACC) -w
ACC_ANSI_INVOKE_W_NO = $(ACC) -Xa -w
ACC_ANSI_INVOKE_W_YES = $(ACC) -Xa
ACC_TRAD_INVOKE_W_NO = $(ACC) -Xs -w
ACC_TRAD_INVOKE_W_YES = $(ACC) -Xs
@@ -43,6 +46,24 @@ C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
CC = $(C_$(CMPLR))
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS =
CCC_LD_LIBS =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
# Static Build options
ACC_SFLAGS_YES= -Bstatic
ACC_SFLAGS_NO=
@@ -91,7 +112,6 @@ CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# GNU make likes CXX instead of CCC
CXXFLAGS = $(CCFLAGS)
CXX =$($(CPLUSPLUS))
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
@@ -102,5 +122,5 @@ COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) >> .DEPENDS
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.Linux

View File

@@ -8,11 +8,16 @@ RANLIB = $(VX_GNU_BIN)/ranlib68k
YACC = $(EYACC)
LEX = $(ELEX)
CC = $(VX_GNU_BIN)/cc68k -B$(VX_GNU_LIB)/gcc-lib/ -nostdinc
CXX = $(VX_GNU_BIN)/cc68k -B$(VX_GNU_LIB)/gcc-lib/ -nostdinc
CPP = $(VX_GNU_BIN)/cpp68k -nostdinc
#CPP = $(CC) -E
GCC = $(CC)
LD = $(VX_GNU_BIN)/ld68k -r
EPICS_LDLIBS =
MV=mv
RM=rm -f
MKDIR=mkdir
RMDIR=rm -rf
# special c library requirements
SPECIAL_LANG =
@@ -48,14 +53,18 @@ TARGET_CPPFLAGS = $($(basename $@)_CPPFLAGS)
TARGET_SNCFLAGS = $($(basename $@)_SNCFLAGS)
CFLAGS = $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(VX_CFLAGS)
CXXFLAGS = $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(VX_CFLAGS)
LDFLAGS = $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(VX_LDFLAGS)
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# Build compile line here
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
LINK.c = $(LD) $(LDFLAGS)
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.cc = $(LD) $(LDFLAGS)
CPPSNCFLAGS = $(USR_INCLUDES) $(VX_INCLUDES)
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) >> .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Vx.68k
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = -$(COMPILE.cc) -M $(SRCS.cc) > .DEPENDS

View File

@@ -18,6 +18,9 @@ YACC = $(EYACC)
LEX = $(ELEX)
G++ = g++
CCC = CC
MV = mv
RMDIR = rm -rf
MKDIR = mkdir
ACC_ANSI_INVOKE_W_NO = $(ACC) -w
ACC_ANSI_INVOKE_W_YES = $(ACC)
@@ -37,6 +40,24 @@ C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
CC = $(C_$(CMPLR))
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS =
CCC_LD_LIBS =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
# Static Build options
ACC_SFLAGS_YES= -non_shared
ACC_SFLAGS_NO= -call_shared
@@ -83,7 +104,6 @@ CFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(U
CCFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CCFLAGS) $(USR_CCFLAGS) $(ARCH_DEP_CCFLAGS) $(UNIX_CCFLAGS)
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
CXXFLAGS = $(CCFLAGS)
CXX =$($(CPLUSPLUS))
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)

View File

@@ -20,6 +20,9 @@ YACC = $(EYACC)
LEX = $(ELEX)
G++ = g++
CCC = CC
MV = mv
RMDIR = rm -rf
MKDIR = mkdir
ACC_ANSI_INVOKE_W_NO = $(ACC) -w
ACC_ANSI_INVOKE_W_YES = $(ACC)
@@ -39,7 +42,25 @@ GCC_ANSI_INVOKE_W_YES = $(GCC) -ansi
GCC_STRICT_INVOKE_W_YES = $(GCC) -ansi -Wall -pedantic
GCC_TRAD_INVOKE_W_NO = $(GCC) -traditional -w
GCC_TRAD_INVOKE_W_YES = $(GCC) -traditional
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS =
CCC_LD_LIBS =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
C_OLD = $($(STANDARD)_TRAD_INVOKE_W_$(UNIX_WARN))
C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
@@ -91,7 +112,6 @@ CFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(U
CCFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CCFLAGS) $(USR_CCFLAGS) $(ARCH_DEP_CCFLAGS) $(UNIX_CCFLAGS)
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
CXXFLAGS = $(CCFLAGS)
CXX =$($(CPLUSPLUS))
ARFLAGS = rv

View File

@@ -21,6 +21,9 @@ YACC = $(EYACC)
LEX = $(ELEX)
G++ = g++
CCC = CC
MV = mv
RMDIR = rm -rf
MKDIR = mkdir
ACC_ANSI_INVOKE_W_NO = $(ACC) -xansi -w
ACC_ANSI_INVOKE_W_YES = $(ACC) -xansi
@@ -42,6 +45,25 @@ C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
CC = $(C_$(CMPLR))
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS =
CCC_LD_LIBS =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
# Static Build options
ACC_SFLAGS_YES= -Bstatic
ACC_SFLAGS_NO=
@@ -89,7 +111,6 @@ CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# GNU make likes CXX instead of CCC
CXXFLAGS = $(CCFLAGS)
CXX =$($(CPLUSPLUS))
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
@@ -101,5 +122,5 @@ LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
LOAD.c = ld -shared $(LDFLAGS)
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) >> .DEPENDS
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.sgi

View File

@@ -20,12 +20,17 @@ YACC = $(EYACC)
LEX = $(ELEX)
G++ = /opt/gnu/bin/g++
CCC = /opt/SUNWspro/bin/CC
MV = mv
RMDIR = rm -rf
MKDIR = mkdir
ACC_ANSI_INVOKE_W_NO = $(ACC) -Xa -w
ACC_ANSI_INVOKE_W_YES = $(ACC) -Xa
ACC_STRICT_INVOKE_W_YES = $(ACC) -Xc -v
ACC_TRAD_INVOKE_W_NO = $(ACC) -Xs -w
ACC_TRAD_INVOKE_W_YES = $(ACC) -Xs
ACC_LD_FLAGS =
ACC_LD_LIBS =
SUNCC_TRAD_INVOKE_W_NO = $(ACC_TRAD_INVOKE_W_NO)
SUNCC_TRAD_INVOKE_W_YES = $(ACC_TRAD_INVOKE_W_YES)
GCC_ANSI_INVOKE_W_NO = $(GCC) -ansi -w
@@ -33,12 +38,41 @@ GCC_ANSI_INVOKE_W_YES = $(GCC) -ansi
GCC_STRICT_INVOKE_W_YES = $(GCC) -ansi -Wall -pedantic
GCC_TRAD_INVOKE_W_NO = $(GCC) -traditional -w
GCC_TRAD_INVOKE_W_YES = $(GCC) -traditional
GCC_LD_LIBS =
GCC_LD_FLAGS =
C_OLD = $($(STANDARD)_TRAD_INVOKE_W_$(UNIX_WARN))
C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
CC = $(C_$(CMPLR))
LD_LIBS_OLD = $($(STANDARD)_LD_LIBS)
LD_LIBS_ANSI = $($(ANSI)_LD_LIBS)
LD_LIBS_STRICT = $($(ANSI)_LD_LIBS)
CCOMPILER_LDLIBS = $(LD_LIBS_$(CMPLR))
LD_FLAGS_OLD = $($(STANDARD)_LD_FLAGS)
LD_FLAGS_ANSI = $($(ANSI)_LD_FLAGS)
LD_FLAGS_STRICT = $($(ANSI)_LD_FLAGS)
CCOMPILER_LDFLAGS = $(LD_FLAGS_$(CMPLR))
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS = -L$(SPECIAL_LANG)
CCC_LD_LIBS =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
# Static Build options
#ACC_SFLAGS_YES= -dn
ACC_SFLAGS_YES= -Bstatic
@@ -71,8 +105,8 @@ UNIX_INCLUDES = -I. -I.. -I$(EPICS_BASE_INCLUDE)
# Operating system flags
OP_SYS_FLAGS = -DUNIX
UNIX_LDFLAGS = -L$(EPICS_BASE_LIB)
UNIX_LDLIBS = $(UNIX_SLIBS) -lm
UNIX_LDFLAGS = -L$(EPICS_BASE_LIB) $(CCOMPILER_LDFLAGS)
UNIX_LDLIBS = $(UNIX_SLIBS) -lm $(CCOMPILER_LDLIBS)
# Architecture specific build flags
ARCH_DEP_CFLAGS = -DSOLARIS
@@ -99,7 +133,6 @@ CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# GNU make likes CXX instead of CCC
CXXFLAGS = $(CCFLAGS)
CXX = $(CCC)
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
@@ -110,5 +143,5 @@ COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
DEPENDS_RULE.c = -$(COMPILE.c) -xM $(SRCS.c) >> .DEPENDS
DEPENDS_RULE.c = -$(COMPILE.c) -xM $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.solaris

View File

@@ -21,13 +21,18 @@ YACC = $(EYACC)
LEX = $(ELEX)
G++ = g++
CCC = /usr/lang/CC
MV = mv
RMDIR = rm -rf
MKDIR = mkdir
ACC_ANSI_INVOKE_W_NO = $(ACC) -w
ACC_ANSI_INVOKE_W_NO = $(ACC) -Xa -w
ACC_ANSI_INVOKE_W_YES = $(ACC) -Xa
ACC_TRAD_INVOKE_W_NO = $(ACC) -Xs -w
ACC_TRAD_INVOKE_W_YES = $(ACC) -Xs
ACC_STRICT_INVOKE_W_NO = $(ACC) -Xc -w
ACC_STRICT_INVOKE_W_YES = $(ACC) -Xc -vc
ACC_LD_FLAGS = -L$(SPECIAL_LANG)
ACC_LD_LIBS =
SUNCC_TRAD_INVOKE_W_NO = $(SUNCC) -w
SUNCC_TRAD_INVOKE_W_YES = $(SUNCC)
GCC_ANSI_INVOKE_W_NO = $(GCC) -ansi -w -D__USE_FIXED_PROTOTYPES__
@@ -36,12 +41,42 @@ GCC_STRICT_INVOKE_W_NO = $(GCC) -ansi -pedantic -D__USE_FIXED_PROTOTYPES__
GCC_STRICT_INVOKE_W_YES = $(GCC) -ansi -Wall -pedantic -D__USE_FIXED_PROTOTYPES__
GCC_TRAD_INVOKE_W_NO = $(GCC) -traditional -w
GCC_TRAD_INVOKE_W_YES = $(GCC) -traditional
GCC_LD_LIBS = -liberty
GCC_LD_FLAGS =
C_OLD = $($(STANDARD)_TRAD_INVOKE_W_$(UNIX_WARN))
C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
CC = $(C_$(CMPLR))
LD_LIBS_OLD = $($(STANDARD)_LD_LIBS)
LD_LIBS_ANSI = $($(ANSI)_LD_LIBS)
LD_LIBS_STRICT = $($(ANSI)_LD_LIBS)
CCOMPILER_LDLIBS = $(LD_LIBS_$(CMPLR))
LD_FLAGS_OLD = $($(STANDARD)_LD_FLAGS)
LD_FLAGS_ANSI = $($(ANSI)_LD_FLAGS)
LD_FLAGS_STRICT = $($(ANSI)_LD_FLAGS)
CCOMPILER_LDFLAGS = $(LD_FLAGS_$(CMPLR))
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS = -L$(SPECIAL_LANG)
CCC_LD_LIBS =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
# Static Build options
ACC_SFLAGS_YES= -Bstatic
ACC_SFLAGS_NO=
@@ -67,21 +102,9 @@ UNIX_INCLUDES = -I. -I.. -I$(EPICS_BASE_INCLUDE)
OP_SYS_FLAGS = -DUNIX
UNIX_LDFLAGS = -L$(EPICS_BASE_LIB)
UNIX_LDFLAGS = -L$(EPICS_BASE_LIB) $(CCOMPILER_LDFLAGS)
#
# The three nested if stmnts here document the fact that current
# organization here requires that we must use gcc for
# all compilation or not at all (no mixed compiler compilation)
#
UNIX_LDLIBS = -lm
#ifeq ($(ANSI), GCC)
#ifeq ($(STANDARD), GCC)
#ifeq ($(CPLUSPLUS), G++)
UNIX_LDLIBS += -liberty
#endif
#endif
#endif
UNIX_LDLIBS = -lm $(CCOMPILER_LDLIBS)
ARCH_DEP_CFLAGS = -DSUNOS4
ARCH_DEP_CCFLAGS = $(ARCH_DEP_CFLAGS)
@@ -103,7 +126,6 @@ CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# GNU make likes CXX instead of CCC
CXXFLAGS = $(CCFLAGS)
CXX =$($(CPLUSPLUS))
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
@@ -114,5 +136,5 @@ COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) >> .DEPENDS
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.sun4

View File

@@ -2,51 +2,34 @@
# $Id$
#
# the order of following lists are important
# the order of following list is important
DIRS_Vx= \
src/libCom\
src/libvxWorks\
src/bpt\
src/util\
src/sequencer\
src/misc\
src/db\
src/ca\
src/rsrv\
src/dbStatic\
src/dbtools\
src/rec\
src/as\
src/drv/ansi\
src/drv/old\
src/dev\
src/devOpt\
src/iocCore
DIRS_Unix= \
src/tools \
src/include \
src/cxxTemplates \
src/db \
src/toolsComm/antelope \
src/toolsComm/flex \
src/libCom \
src/cvtDctsdr \
src/dbStatic \
src/bpt \
src/ca \
src/gdd \
src/cas/generic \
src/cas/build/singleThread \
src/cas/example \
src/as \
src/util \
src/sequencer \
src/dbtools \
config
# for c++ build add the dirs gdd and cas after ca
DIRS = \
tools \
include \
cxxTemplates \
toolsComm\
libCom \
libvxWorks\
cvtDctsdr \
dbStatic \
db \
bpt \
ca \
util \
misc \
sequencer \
dbtools \
rsrv\
rec\
as \
drv\
dev\
devOpt\
iocCore
DIRS = $(DIRS_$(BUILD_TYPE))
EPICS_BASE = $(TOP)
@@ -55,3 +38,12 @@ include $(TOP)/config/CONFIG
EPICS_BASE = $(INSTALL_LOCATION)
#
# this speeds up the build by turning off implicit rules search
#
.PHONY: $(TOP)/config/CONFIG
.PHONY: $(TOP)/config/CONFIG.* $(TOP)/config/CONFIG_*
.PHONY: $(TOP)/config/RULES.* $(TOP)/config/RULES_* .DEPENDS
.PHONY: $(HOME)/.EPICS_CONFIG
.PHONY: ../Makefile.Vx ../Makefile.Unix ../Makefile.Host Makefile

View File

@@ -36,6 +36,7 @@ EPICS_BASE_DBD = $(EPICS_BASE)/dbd
EPICS_EXTENSIONS_INCLUDE = $(EPICS_EXTENSIONS)/include
EPICS_EXTENSIONS_TEMPLATES = $(EPICS_EXTENSIONS)/templates
DIVIDER = .
# private versions of lex/yacc from EPICS
EYACC = $(EPICS_BASE)/bin/$(HOST_ARCH)/antelope

View File

@@ -34,9 +34,9 @@ endif
# mv162lc
# mv147
# hkv2f
# niCpu030
# niCpu030
#
CROSS_COMPILER_TARGET_ARCHS=mv167
CROSS_COMPILER_TARGET_ARCHS=mv167 mv162
# If only a subset of the host architectures perform
# the build for the CROSS_COMPILER_TARGET_ARCHS
@@ -95,3 +95,15 @@ UNIX_WARN=YES
# must be either YES or NO
VX_WARN=YES
# sch2edif compiler and flags
SCH2EDIF = sch2edif
SCH2EDIF_PATH =
SCH2EDIF_SYSFLAGS = -n -ap -p.+..+$(SCH2EDIF_PATH)+$(EPICS_EXTENSIONS)/templates/capfast/sym+
SCH2EDIF_FLAGS =
# e2db and flags
# - again there is an assumption where edb.def is installed.
E2DB = $(EPICS_EXTENSIONS)/bin/$(HOST_ARCH)/e2db
E2DB_SYSFLAGS = -ate -d $(EPICS_EXTENSIONS)/templates/capfast/edb.def
E2DB_FLAGS =

View File

@@ -11,3 +11,10 @@
# OLD - Standard C - Not appropriate here.
CMPLR=ANSI
# Default SUN C++ compiler, individual Makefiles will override
# if they are coded to a higher standard.
# STRICT - ANSI C++ force strict warning flags
# NORMAL - ANSI C++ optional warning flags
CXXCMPLR=NORMAL
#CXXCMPLR=STRICT

View File

@@ -12,3 +12,10 @@
# OLD - Standard C - Not appropriate here.
CMPLR=ANSI
# Default SUN C++ compiler, individual Makefiles will override
# if they are coded to a higher standard.
# STRICT - ANSI C++ force strict warning flags
# NORMAL - ANSI C++ optional warning flags
CXXCMPLR=NORMAL
#CXXCMPLR=STRICT

View File

@@ -12,3 +12,10 @@
# OLD - Standard C - Not appropriate here.
CMPLR=ANSI
# Default SUN C++ compiler, individual Makefiles will override
# if they are coded to a higher standard.
# STRICT - ANSI C++ force strict warning flags
# NORMAL - ANSI C++ optional warning flags
CXXCMPLR=NORMAL
#CXXCMPLR=STRICT

View File

@@ -14,8 +14,14 @@
# OLD - Standard C - Not appropriate here.
CMPLR=ANSI
# Default SUN C++ compiler, individual Makefiles will override
# if they are coded to a higher standard.
# STRICT - ANSI C++ force strict warning flags
# NORMAL - ANSI C++ optional warning flags
CXXCMPLR=NORMAL
#CXXCMPLR=STRICT
# Special C library requirements
SPECIAL_LANG = /usr/lang/SC2.0.1patch
SPECIAL_LDFLAGS = -L$(SPECIAL_LANG)

View File

@@ -11,10 +11,16 @@
# OLD - Standard C - Not appropriate here.
CMPLR=ANSI
# Default SUN C++ compiler, individual Makefiles will override
# if they are coded to a higher standard.
# STRICT - ANSI C++ force strict warning flags
# NORMAL - ANSI C++ optional warning flags
CXXCMPLR=NORMAL
#CXXCMPLR=STRICT
# Unbundled C compiler stuff
SPARCWORKS = /opt/SUNWspro
#SPECIAL_LANG = $(SPARCWORKS)/SC3.0/lib
#SPECIAL_LANG = .
#SPECIAL_LDFLAGS = -L$(SPECIAL_LANG)
#SPECIAL_LANG = $(SPARCWORKS)/lib
SPECIAL_LANG = .

View File

@@ -12,12 +12,20 @@
CMPLR=ANSI
# Default SUN C++ compiler, individual Makefiles will override
# if they are coded to a higher standard.
# STRICT - ANSI C++ force strict warning flags
# NORMAL - ANSI C++ optional warning flags
CXXCMPLR=NORMAL
#CXXCMPLR=STRICT
#CMPLR=STRICT
#ANSI=GCC
#STANDARD=GCC
#CPLUSPLUS=G++
# Special C library requirements
SPECIAL_LANG = /usr/lang/SC2.0.1patch
SPECIAL_LDFLAGS = -L$(SPECIAL_LANG)
#SPECIAL_LANG = /usr/lang/SC3.0.1
#SPECIAL_LANG = /usr/lang/lib
SPECIAL_LANG = .

View File

@@ -10,36 +10,15 @@ CONFIGS += CONFIG_BASE
CONFIGS += CONFIG_COMMON
CONFIGS += CONFIG_ENV
CONFIGS += CONFIG.Linux
CONFIGS += CONFIG.alpha
CONFIGS += CONFIG.hp700
CONFIGS += CONFIG.sgi
CONFIGS += CONFIG.solaris
CONFIGS += CONFIG.sun4
CONFIGS += CONFIG.hkv2f
CONFIGS += CONFIG.mv147
CONFIGS += CONFIG.mv162
CONFIGS += CONFIG.mv162lc
CONFIGS += CONFIG.mv167
CONFIGS += CONFIG.niCpu030
CONFIGS += CONFIG.Vx.68k
CONFIGS += CONFIG_SITE
CONFIGS += CONFIG_SITE_ENV
CONFIGS += CONFIG_SITE.Linux
CONFIGS += CONFIG_SITE.alpha
CONFIGS += CONFIG_SITE.hp700
CONFIGS += CONFIG_SITE.sgi
CONFIGS += CONFIG_SITE.solaris
CONFIGS += CONFIG_SITE.sun4
CONFIGS += CONFIG_SITE.hkv2f
CONFIGS += CONFIG_SITE.mv147
CONFIGS += CONFIG_SITE.mv162lc
CONFIGS += CONFIG_SITE.mv162
CONFIGS += CONFIG_SITE.mv167
CONFIGS += CONFIG_SITE.niCpu030
CONFIGS += $(HOST_ARCH:%=CONFIG.%)
CONFIGS += $(CROSS_COMPILER_TARGET_ARCHS:%=CONFIG.%)
CONFIGS += $(HOST_ARCH:%=CONFIG_SITE.%)
CONFIGS += $(CROSS_COMPILER_TARGET_ARCHS:%=CONFIG_SITE.%)
CONFIGS += RULES.Unix
CONFIGS += RULES.Vx
@@ -49,5 +28,3 @@ CONFIGS += RULES_TOP
include $(TOP)/config/RULES.Unix

View File

@@ -19,19 +19,21 @@ INSTALL_TCLLIBS=$(TCLLIBNAME:%=$(INSTALL_TCLLIB)/%)
INSTALL_TCLINDEX=$(TCLINDEX:%=$(INSTALL_TCLLIB)/%)
INSTALL_CONFIGS=$(CONFIGS:%=$(INSTALL_CONFIG)/%)
all: install
all:: install
pre_build:
pre_build::
build: pre_build $(LIBNAME) $(TARGETS) $(PROD)
rebuild:: clean install
install: build $(INSTALL_INC) $(INSTALL_LIBS) $(TARGETS) $(INSTALL_PROD) \
$(INSTALL_MANS) $(INSTALL_DOCS) $(INSTALL_SCRIPTS) $(INSTALL_TEMPLATE) \
build:: pre_build $(LIBNAME) $(TARGETS) $(PROD)
inc:: $(INSTALL_INC)
install:: inc build $(INSTALL_LIBS) $(TARGETS) $(INSTALL_SCRIPTS) $(INSTALL_PROD) \
$(INSTALL_MANS) $(INSTALL_DOCS) $(INSTALL_TEMPLATE) \
$(INSTALL_TCLLIBS) $(INSTALL_TCLINDEX) $(INSTALL_CONFIGS)
depends: $(SRCS.c) $(SRCS.cc)
rm -f .DEPENDS
touch .DEPENDS
depends:: $(SRCS.c) $(SRCS.cc)
ifdef SRCS
echo you have a SRCS in your Makefile
exit 2
@@ -57,7 +59,7 @@ $(TARGETS) $(PROD): $(DEPLIBS)
$(RM) $@
$(LINK.c) -o $@ $< $(LDLIBS)
#$(PROD): $(OBJS) $(DEPLIBS)
#$(PROD): $(OBJS)
# $(RM) $@
# $(LINK.c) -o $@ ${OBJS} $(LDLIBS)
@@ -82,20 +84,20 @@ $(TARGETS) $(PROD): $(DEPLIBS)
$(YACC) $(YACCOPT) $<
@if [ -f y.tab.c ]; \
then \
echo "/bin/mv y.tab.c $*.c"; \
/bin/mv y.tab.c $*.c; \
echo "$(MV) y.tab.c $*.c"; \
$(MV) y.tab.c $*.c; \
fi
@if [ -f y.tab.h ]; \
then \
echo "/bin/mv y.tab.h $*.h"; \
/bin/mv y.tab.h $*.h; \
echo "$(MV) y.tab.h $*.h"; \
$(MV) y.tab.h $*.h; \
fi
%.c: ../%.l
$(RM) lex.yy.c
$(LEX) $(LEXOPT) $<
$(RM) $@
/bin/mv lex.yy.c $@
$(MV) lex.yy.c $@
#state notation language rule
%.c: ../%.st
@@ -106,6 +108,38 @@ $(TARGETS) $(PROD): $(DEPLIBS)
@$(RM) $@
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $*.i
%.c: %.stt
@echo "converting $<
@$(RM) $@
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $<
# Capfast Rules:
%.db: %.edf
$(E2DB) $(E2SR_SYSFLAGS) $(E2SR_FLAGS) $<
%.db: ../%.edf
$(E2DB) $(E2SR_SYSFLAGS) $(E2SR_FLAGS) $<
%.edf: ../%.sch $(DEPSCHS)
@if [ ! -f cad.rc -a -r ../cad.rc ] ; then ln -s ../cad.rc ; fi
$(SCH2EDIF) $(SCH2EDIF_SYSFLAGS) $(SCH2EDIF_FLAGS) $<
# Mangen Rule:
%.1:%
$(RM) $(<F)
$(RM) $(<F).nr
ln -s $<
$(MANGEN) -s $(<F)
$(MV) $(<F).nr $(<F).1
# Mangen Rule:
%.1:../%
$(RM) $(<F)
$(RM) $(<F).nr
ln -s $<
$(MANGEN) -s $(<F)
$(MV) $(<F).nr $(<F).1
$(LIBNAME): $(LIBOBJS)
@echo Building library $@
$(RM) $@
@@ -136,6 +170,11 @@ $(INSTALL_LIB)/%.a: %.a
$(RANLIB) $(RANLIBFLAGS) $@; \
fi
$(INSTALL_CONFIG)/%: %
@echo "Installing $@"
@test -d $(INSTALL_CONFIG) || mkdir $(INSTALL_CONFIG)
@$(INSTALL) -m 644 $< $(INSTALL_CONFIG)
$(INSTALL_CONFIG)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_CONFIG) || mkdir $(INSTALL_CONFIG)
@@ -151,6 +190,20 @@ $(INSTALL_TCLLIB)/$(TCLINDEX): $(INSTALL_TCLLIBS)
@echo "Updating $@"
@echo eval auto_mkindex $(INSTALL_LIB) "$(TCLLIBNAME)" | tclsh
$(INSTALL_MAN)/man9/% \
$(INSTALL_MAN)/man8/% \
$(INSTALL_MAN)/man7/% \
$(INSTALL_MAN)/man6/% \
$(INSTALL_MAN)/man5/% \
$(INSTALL_MAN)/man4/% \
$(INSTALL_MAN)/man3/% \
$(INSTALL_MAN)/man2/% \
$(INSTALL_MAN)/man1/%: %
@echo "Installing $@"
@test -d $(INSTALL_MAN) || mkdir $(INSTALL_MAN)
@test -d $(@D) || mkdir $(@D)
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_MAN)/man9/% \
$(INSTALL_MAN)/man8/% \
$(INSTALL_MAN)/man7/% \
@@ -175,6 +228,11 @@ $(INSTALL_INCLUDE)/%: ../%
@test -d $(INSTALL_INCLUDE) || mkdir $(INSTALL_INCLUDE)
@$(INSTALL) -m 644 $< $(INSTALL_INCLUDE)
$(INSTALL_DOC)/%: %
@echo "Installing $@"
@test -d $(INSTALL_DOC) || mkdir $(INSTALL_DOC)
@$(INSTALL) -m 644 $< $(INSTALL_DOC)
$(INSTALL_DOC)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_DOC) || mkdir $(INSTALL_DOC)
@@ -185,16 +243,18 @@ $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)/%: ../%
@test -d $(INSTALL_TEMPLATES) || mkdir $(INSTALL_TEMPLATES)
@test -d $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR) || \
mkdir $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
@$(INSTALL) -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
@$(INSTALL) -d -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
$(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)/%: %
@echo "Installing $@"
@test -d $(INSTALL_TEMPLATES) || mkdir $(INSTALL_TEMPLATES)
@test -d $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR) || \
mkdir $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
@$(INSTALL) -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
@$(INSTALL) -d -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
.PRECIOUS: %.o %.c
include .DEPENDS
.PHONY: all inc depends build install pre-build clean rebuild
-include .DEPENDS

View File

@@ -1,9 +1,10 @@
# $Id$
INC +=$(RECTYPES) $(MENUS)
INCREC +=$(RECTYPES) $(MENUS)
INSTALL_PROD=$(PROD:%=$(INSTALL_BIN)/%)
INSTALL_LIBS=$(LIBNAME:%=$(INSTALL_BIN)/%)
INSTALL_INC=$(INC:%=$(INSTALL_INCLUDE)/%)
INSTALL_INCREC=$(INCREC:%=$(INSTALL_INCLUDE)/%)
INSTALL_MANS+=$(MAN1:%=$(INSTALL_MAN)/man1/%)
INSTALL_MANS+=$(MAN2:%=$(INSTALL_MAN)/man2/%)
INSTALL_MANS+=$(MAN3:%=$(INSTALL_MAN)/man3/%)
@@ -22,24 +23,26 @@ INSTALL_DBS=$(DBDINSTALL:%=$(INSTALL_DBD)/%)\
$(RECTYPES:%.h=$(INSTALL_DBD)/%.dbd)\
$(MENUS:%.h=$(INSTALL_DBD)/%.dbd)
INSTALL_DBDEXPAND=$(DBDEXPAND:%=$(INSTALL_DBD)/%)
all: install
INSTALL_DBDNAME=$(DBDNAME:%=$(INSTALL_DBD)/%)
pre_build:
all:: install
build: pre_build $(MENUS) $(RECTYPES) $(BPTS)\
$(LIBNAME) $(TARGETS) $(PROD) $(DBDEXPAND)
rebuild:: clean install
install: build $(INSTALL_INC)\
pre_build::
build:: pre_build $(MENUS) $(RECTYPES) $(BPTS)\
$(LIBNAME) $(TARGETS) $(PROD) $(DBDNAME)
inc:: $(INSTALL_INC)
install:: inc build $(INSTALL_INCREC)\
$(INSTALL_LIBS) $(TARGETS) $(INSTALL_PROD) $(INSTALL_MANS)\
$(INSTALL_DOCS) $(INSTALL_SCRIPTS)\
$(INSTALL_INSTALLS) $(INSTALL_DBS)\
$(INSTALL_MENUS) $(INSTALL_RECTYPES) $(INSTALL_BPTS)\
$(INSTALL_DBDEXPAND)
$(INSTALL_INSTALLS) $(INSTALL_DBS) $(INSTALL_BPTS)\
$(INSTALL_DBDNAME)
depends: $(SRCS.c) $(SRCS.cc)
rm -f .DEPENDS
touch .DEPENDS
depends:: $(SRCS.c) $(SRCS.cc)
ifdef SRCS
echo you have a SRCS in your Makefile
exit 2
@@ -54,7 +57,7 @@ endif
clean::
@echo "Cleaning"
@$(RM) *.i *.o *.a $(TARGETS) $(PROD) $(LIBNAME) $(INC) \
$(DBDINSTALL) $(MENUS) $(RECTYPES) $(BPTS) $(DBDEXPAND)
$(DBDINSTALL) $(MENUS) $(RECTYPES) $(BPTS) $(DBDNAME)
# The order of the following dependencies is
@@ -89,22 +92,22 @@ clean::
$(YACC) $(YACCOPT) $<
@if [ -f y.tab.c ]; \
then \
echo "/bin/mv y.tab.c $*.c"; \
/bin/mv y.tab.c $*.c; \
echo "$(MV) y.tab.c $*.c"; \
$(MV) y.tab.c $*.c; \
fi
@if [ -f y.tab.h ]; \
then \
echo "/bin/mv y.tab.h $*.h"; \
/bin/mv y.tab.h $*.h; \
echo "$(MV) y.tab.h $*.h"; \
$(MV) y.tab.h $*.h; \
fi
%.c: ../%.l
$(RM) lex.yy.c
$(LEX) $(LEXOPT) $<
$(RM) $@
/bin/mv lex.yy.c $@
$(MV) lex.yy.c $@
#state notation language rule
#state notation language rules
%.c: ../%.st
@echo "preprocessing $*.st"
@$(RM) $*.i
@@ -113,6 +116,31 @@ clean::
@$(RM) $@
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $*.i
%.c: %.stt
@echo "converting $<
@$(RM) $@
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $<
# Capfast Rules:
%.db: %.edf
$(E2DB) $(E2SR_SYSFLAGS) $(E2SR_FLAGS) $<
%.db: ../%.edf
$(E2DB) $(E2SR_SYSFLAGS) $(E2SR_FLAGS) $<
%.edf: ../%.sch $(DEPSCHS)
@if [ ! -f cad.rc -a -r ../cad.rc ] ; then ln -s ../cad.rc ; fi
$(SCH2EDIF) $(SCH2EDIF_SYSFLAGS) $(SCH2EDIF_FLAGS) $<
# Mangen Rule:
%.1:%
$(RM) $(<F)
$(RM) $(<F).nr
ln -s $<
$(MANGEN) -s $(<F)
$(MV) $(<F).nr $(<F).1
$(INSTALL_DBD)/%: %
@echo "Installing $@"
@test -d $(INSTALL_DBD) || mkdir $(INSTALL_DBD)
@@ -123,23 +151,37 @@ $(INSTALL_DBD)/%: ../%
@test -d $(INSTALL_DBD) || mkdir $(INSTALL_DBD)
@$(INSTALL) -m 644 $< $(INSTALL_DBD)
%Record.h: %Record.dbd
$(RM) $@
$(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH \
$(USER_DBDFLAGS) $<
%Record.h: ../%Record.dbd
$(RM) $@
$(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH \
$(USER_DBDFLAGS) $<
menu%.h: menu%.dbd
$(RM) $@
$(EPICS_BASE)/bin/$(HOST_ARCH)/dbToMenuH $<
menu%.h: ../menu%.dbd
$(RM) $@
$(EPICS_BASE)/bin/$(HOST_ARCH)/dbToMenuH $<
bpt%.dbd: bpt%.data
$(RM) $@
$(EPICS_BASE)/bin/$(HOST_ARCH)/makeBpt $<
bpt%.dbd: ../bpt%.data
$(RM) $@
$(EPICS_BASE)/bin/$(HOST_ARCH)/makeBpt $<
%.dbd: ../%.dbd
$(RM) $@
$(DBDNAME): ../$(DBDEXPAND)
@echo expanding dbd
@$(RM) $@
$(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand\
$(USER_DBDFLAGS) $< > $(<F)
$(USER_DBDFLAGS) $< > $@
$(LIBNAME): $(LIBOBJS)
@echo Building library $@
@@ -164,6 +206,20 @@ $(INSTALL_BIN)/%: $(EPICS_BASE_BIN)/%
@test -d $(INSTALL_BIN) || mkdir $(INSTALL_BIN)
@$(INSTALL) -m 555 $< $(INSTALL_BIN)
$(INSTALL_MAN)/man9/% \
$(INSTALL_MAN)/man8/% \
$(INSTALL_MAN)/man7/% \
$(INSTALL_MAN)/man6/% \
$(INSTALL_MAN)/man5/% \
$(INSTALL_MAN)/man4/% \
$(INSTALL_MAN)/man3/% \
$(INSTALL_MAN)/man2/% \
$(INSTALL_MAN)/man1/%: %
@echo "Installing $@"
@test -d $(INSTALL_MAN) || mkdir $(INSTALL_MAN)
@test -d $(@D) || mkdir $(@D)
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_MAN)/man9/% \
$(INSTALL_MAN)/man8/% \
$(INSTALL_MAN)/man7/% \
@@ -188,6 +244,11 @@ $(INSTALL_INCLUDE)/%: ../%
@test -d $(INSTALL_INCLUDE) || mkdir $(INSTALL_INCLUDE)
@$(INSTALL) -m 644 $< $(INSTALL_INCLUDE)
$(INSTALL_DOC)/%: %
@echo "Installing $@"
@test -d $(INSTALL_DOC) || mkdir $(INSTALL_DOC)
@$(INSTALL) -m 644 $< $(INSTALL_DOC)
$(INSTALL_DOC)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_DOC) || mkdir $(INSTALL_DOC)
@@ -195,5 +256,7 @@ $(INSTALL_DOC)/%: ../%
.PRECIOUS: %.o %.c
include .DEPENDS
.PHONY: all inc depends build install pre-build clean rebuild
-include .DEPENDS

View File

@@ -2,74 +2,90 @@
# $Id$
#
# EPICS RULES_ARCH
# by Matthew Needes and Mike Bordua and Janet Anderson
# by Matthew Needes and Mike Bordua and Janet Andersoni and Jeff Hill
#
all:: install
dirs::
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} dir "T_A=${ARCH}"; \
done)
ACTIONS += inc
ACTIONS += build
ACTIONS += install
ACTIONS += depends
ACTIONS += rebuild
depends::
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} arch "T_A=$${ARCH}" ACTION=$@; \
done)
actionPart = $(word 1, $(subst $(DIVIDER), ,$@))
archPart = $(word 2, $(subst $(DIVIDER), ,$@))
build::
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} arch "T_A=$${ARCH}" ACTION=$@; \
done)
#
# hostActionArchTargets
#
hostArchs = $(HOST_ARCH)
hostActionArchTargets = $(foreach x, $(ACTIONS),\
$(foreach arch,$(hostArchs), $(x)$(DIVIDER)$(arch)))
ifeq (Makefile.$(BUILD_TYPE), $(wildcard Makefile.$(BUILD_TYPE)))
hostDirs = $(addprefix O.,$(hostArchs))
$(hostActionArchTargets) : $(hostDirs)
$(MAKE) -C O.$(archPart) -f ../Makefile.$(BUILD_TYPE) T_A=$(archPart) $(actionPart)
$(hostArchs) : % : O.%
$(MAKE) -C O.$@ -f ../Makefile.$(BUILD_TYPE) T_A=$@
else
$(hostActionArchTargets) :
$(hostArchs) :
endif
install::
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} arch "T_A=$${ARCH}" ACTION=$@; \
done)
#
# crossActionArchTargets
#
crossArchs = $(filter-out $(hostArchs),$(BUILD_ARCHS))
crossActionArchTargets = $(foreach x, $(ACTIONS), \
$(foreach arch, $(CROSS_COMPILER_TARGET_ARCHS), $(x)$(DIVIDER)$(arch)))
ifeq (Makefile.Vx, $(wildcard Makefile.Vx))
crossDirs = $(addprefix O.,$(crossArchs))
$(crossActionArchTargets) : $(crossDirs)
$(MAKE) -C O.$(archPart) -f ../Makefile.Vx T_A=$(archPart) $(actionPart)
$(crossArchs) : % : O.%
$(MAKE) -C O.$@ -f ../Makefile.Vx T_A=$@
else
$(crossActionArchTargets) :
$(crossArchs) :
endif
clean::
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} arch "T_A=$${ARCH}" ACTION=$@; \
done)
$(hostDirs) :
$(MKDIR) $@
echo "T_A=$(subst O.,,$@)" > $@/Makefile
echo "include ../Makefile.$(BUILD_TYPE)" >> $@/Makefile
$(crossDirs) :
$(MKDIR) $@
echo "T_A=$(subst O.,,$@)" > $@/Makefile
echo "include ../Makefile.Vx" >> $@/Makefile
#
# host/cross action targets
#
$(ACTIONS) clean : % : %$(DIVIDER)host %$(DIVIDER)cross
HostActionTargets = $(foreach x, $(ACTIONS) clean, $(x)$(DIVIDER)host)
CrossActionTargets = $(foreach x, $(ACTIONS) clean, $(x)$(DIVIDER)cross)
$(HostActionTargets) : %$(DIVIDER)host : $(addprefix %$(DIVIDER), $(hostArchs))
$(CrossActionTargets) : %$(DIVIDER)cross : $(addprefix %$(DIVIDER), $(crossArchs))
dirs.%::
@${MAKE} dir T_A=$*
#
# arch targets
#
host : $(hostArchs)
cross : $(crossArchs)
depends.%::
@${MAKE} arch T_A=$* ACTION=depends
build.%::
@${MAKE} arch T_A=$* ACTION=build
install.%::
@${MAKE} arch T_A=$* ACTION=install
clean.%::
@${MAKE} arch T_A=$* ACTION=clean
${BUILD_ARCHS}::
@${MAKE} arch T_A=$@ ACTION=install
arch: dir
@if [ -f Makefile.${BUILD_TYPE} ] ; then \
echo "${T_A}: ${ACTION}"; \
cd O.${T_A}; ${MAKE} ${ACTION} ; \
fi
dir:
@if [ -f Makefile.${BUILD_TYPE} ] ; then \
test -f ./.cvsignore || \
echo "O.*" > ./.cvsignore; \
test -d O.${T_A} || \
( echo "Creating O.${T_A}"; mkdir O.${T_A};); \
test -f O.${T_A}/Makefile || \
( echo "T_A=${T_A}" > O.${T_A}/Makefile; \
echo "include ../Makefile.${BUILD_TYPE}" \
>> O.${T_A}/Makefile;); \
test -f O.${T_A}/.DEPENDS || \
touch O.${T_A}/.DEPENDS; \
fi
#
# special clean rule
#
clean$(DIVIDER)% :
$(RMDIR) O.$*
.PHONY : $(HostActionTargets)
.PHONY : $(CrossActionTargets)
.PHONY : $(crossActionArchTargets)
.PHONY : $(hostActionArchTargets)
.PHONY : $(hostArchs) $(crossArchs)
.PHONY : $(ACTIONS) clean all host cross

View File

@@ -1,70 +1,42 @@
#
# $Id$
#
# Top level rules For Subdirectory Recursions
#
all:: install
dirs::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
depends::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
build::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
install::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
clean::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
ARCHS += $(BUILD_ARCHS) host cross
ACTIONS += clean inc install depends
dirPart = $(word 1, $(subst $(DIVIDER), ,$@))
actionArchPart = $(subst $(dirPart)$(DIVIDER), ,$@)
dirActionArchTargets = $(foreach dir, $(DIRS), \
$(foreach action, $(ACTIONS),\
$(foreach arch, $(ARCHS), \
$(dir)$(DIVIDER)$(action)$(DIVIDER)$(arch))))
dirArchTargets += $(foreach dir, $(DIRS), \
$(foreach arch, $(ARCHS),\
$(dir)$(DIVIDER)$(arch)))
dirActionTargets += $(foreach dir, $(DIRS), \
$(foreach action, $(ACTIONS),\
$(dir)$(DIVIDER)$(action)))
actionArchTargets = $(foreach action, $(ACTIONS),\
$(foreach arch, $(ARCHS), \
$(action)$(DIVIDER)$(arch)))
all:: inc install
dirs.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
rebuild:: clean all
$(DIRS) $(dirActionTargets) $(dirArchTargets)$(dirActionArchTargets) ::
$(MAKE) -C $(dirPart) $(actionArchPart)
depends.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
$(ARCHS) $(ACTIONS) $(actionArchTargets):%: $(foreach dir, $(DIRS), $(dir)$(DIVIDER)%)
build.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
install.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
clean.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
.PHONY : $(DIRS)
.PHONY : $(ARCHS) $(ACTIONS)
.PHONY : $(dirActionTargets) $(dirArchTargets)
.PHONY : $(dirActionArchTargets)
.PHONY : $(actionArchTargets)

View File

@@ -2,95 +2,49 @@
# $Id$
#
all:: install
include $(TOP)/config/RULES_DIRS
dirs::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
uninstall$(DIVIDER)%::
@$(RMDIR) $(INSTALL_LOCATION_BIN)/$* $(INSTALL_LOCATION_LIB)/$* \
$(INSTALL_LOCATION)/dbd $(INSTALL_MAN) $(INSTALL_INCLUDE)
@$(RMDIR) rec.bak rec
depends::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
build::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
install::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
clean::
@echo "TOP: Cleaning
@for DIR in ${DIRS}; do \
find $$DIR/src -type d -name "O.*" -prune -exec rm -rf {} \; ; \
done
uninstall::
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} $@.$${ARCH}; \
done)
dirs.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
depends.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
build.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
install.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
clean.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
uninstall.%::
@echo "TOP: Uninstalling $* "
@rm -rf ./bin/$* ./lib/$* dbd include man
@rm -rf rec.bak rec
DIRNAME=$(notdir $(shell pwd))
uninstall:: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS))
tar:
@echo "TOP: Creating $(DIRNAME).Tar file..."
@ls Makefile* | xargs tar vcf ${DIRNAME}.Tar
@if [ -f .current_rel_hist ]; then \
ls .current_rel_hist | xargs tar vrf ${DIRNAME}.Tar ; \
fi
@if [ -f EPICS_BASE ]; then \
ls EPICS_BASE | xargs tar vrf ${DIRNAME}.Tar ; \
fi
@for DIR in ${DIRS}; do \
@DIRNAME=$(notdir $(shell pwd)); \
echo "TOP: Creating $$DIRNAME.Tar file..."; \
ls Makefile* | xargs tar vcf $$DIRNAME.Tar; \
if [ -f .current_rel_hist ]; then \
ls .current_rel_hist | xargs tar vrf $$DIRNAME.Tar ; \
fi ;\
if [ -f EPICS_BASE ]; then \
ls EPICS_BASE | xargs tar vrf $$DIRNAME.Tar ; \
fi ;\
for DIR in ${DIRS}; do \
find $${DIR} -name CVS -prune -o ! -type d -print \
| grep -v "/O\..*$$" | xargs tar vrf ${DIRNAME}.Tar; \
| grep -v "/O\..*$$" | xargs tar vrf $$DIRNAME.Tar; \
done
help:
@echo "Usage: gnumake [options] [target] ..."
@echo "Targets supported by all Makefiles:"
@echo " install - Installs executables in bin/<arch> (default rule)"
@echo " build - Builds objects, using libraries from "build_libs"
@echo " clean - Cleans objects. Clean removes the" O.<arch> dirs
@echo " in all except the O.<arch> level Makefile"
@echo " depends - Generates include dependencies"
@echo "\"Partial\" build targets supported by Makefiles:"
@echo " install.<arch> - Builds and installs <arch> only.
@echo " clean.<arch> - Cleans <arch> binaries in O.<arch> dirs only."
@echo " build.<arch> - Builds <arch> only.
@echo " depends.<arch> - Generates <arch> dependencies only.
@echo "Targets supported by top level Makefile:"
@echo " uninstall - Cleans directories created by the install."
@echo " tar - Create tar file "
@echo "Indiv. object targets are supported by O.<arch> level Makefile .e.g"
@echo " xxxRecord.o
.PHONY : uninstall tar help
.PHONY : $(addprefix uninstall$(DIVIDER), $(BUILDARCHS))

View File

@@ -1,42 +1,14 @@
# $Id$
# Author: Robert Zieman (ANL)
# Date: 6/03/91
#
# Experimental Physics and Industrial Control System (EPICS)
#
# Copyright 1991, the Regents of the University of California,
# and the University of Chicago Board of Governors.
#
# This software was produced under U.S. Government contracts:
# (W-7405-ENG-36) at the Los Alamos National Laboratory,
# and (W-31-109-ENG-38) at Argonne National Laboratory.
#
# Initial development by:
# The Controls and Automation Group (AT-8)
# Ground Test Accelerator
# Accelerator Technology Division
# Los Alamos National Laboratory
#
# Co-developed with
# The Controls and Computing Group
# Accelerator Systems Division
# Advanced Photon Source
# Argonne National Laboratory
#
# Modification Log:
# -----------------
# .01 mm-dd-yy iii Comment
# .02 08-16-93 rcz moving most of these pre-builds back to the
# object area Imakefile and adding DependTarget($(EARLYSRC))
#
# ...
# $Id$
#
all: bld_errSym
TOP = ..
include $(TOP)/config/CONFIG_BASE
bld_errSym:
cd libCom; ../../tools/blderrSymTbl
#
# Directories to build defined in CONFIG_BASE
#
include $(TOP)/config/RULES_DIRS
clean:
/bin/rm -f libCom/errInc.o

View File

@@ -168,9 +168,8 @@ LOCAL void asCaTask(void)
pasg->inpBad |= (1<<pasginp->inpIndex);
pcapvt = pasginp->capvt = asCalloc(1,sizeof(CAPVT));
/*Note calls connectCallback immediately called for local Pvs*/
SEVCHK(ca_build_and_connect(pasginp->inp,TYPENOTCONN,0,
&pcapvt->chid,0,connectCallback,pasginp),
"ca_build_and_connect");
SEVCHK(ca_search_and_connect(pasginp->inp,&pcapvt->chid,
connectCallback,pasginp),"ca_build_and_connect");
/*Note calls accessRightsCallback immediately called for local Pvs*/
SEVCHK(ca_replace_access_rights_event(pcapvt->chid,accessRightsCallback),
"ca_replace_access_rights_event");

View File

@@ -3,9 +3,13 @@ include $(TOP)/config/CONFIG_BASE
INC += cvtTable.h
SRCS.c = ../makeBpt
OBJS = makeBpt
SRCS.c = ../makeBpt.c
OBJS = makeBpt.o
PROD = makeBpt
include $(TOP)/config/RULES.Unix
$(PROD): $(OBJS)
$(RM) $@
$(LINK.c) -o $@ ${OBJS} $(LDLIBS)

View File

@@ -1,13 +1,11 @@
TOP = ../../..
include $(TOP)/config/CONFIG_BASE
CMPLR = STRICT
USR_LDLIBS = -lca -lCom -lm
USR_LDLIBS = -lca -lCom
USR_LDFLAGS = -L.
DEPLIBS_BASE = $(INSTALL_LIB)
DEPLIBS = ./libca.a\
$(DEPLIBS_BASE)/libCom.a
DEPLIBS = ./libca.a $(DEPLIBS_BASE)/libCom.a
INC += cadef.h
INC += caerr.h
@@ -32,15 +30,7 @@ LIBNAME = libca.a
PROD = caRepeater
TARGETS = acctst catime
include $(TOP)/config/RULES.Unix
acctst: acctst.o $(LIBOBJS) $(DEPLIBS_BASE)/libCom.a
$(LINK.c) -o $@ $< $(LIBOBJS) $(DEPLIBS_BASE)/libCom.a \
$(ARCH_DEP_LDLIBS) -lm
catime: catime.o $(LIBOBJS) $(DEPLIBS_BASE)/libCom.a
$(LINK.c) -o $@ $< $(LIBOBJS) $(DEPLIBS_BASE)/libCom.a \
$(ARCH_DEP_LDLIBS) -lm

View File

@@ -99,6 +99,12 @@
/************************************************************************/
/*
* $Log$
* Revision 1.85 1996/09/04 20:02:00 jhill
* test for non-nill piiu under vxWorks
*
* Revision 1.84 1996/07/10 23:30:09 jhill
* fixed GNU warnings
*
* Revision 1.83 1996/07/09 22:43:29 jhill
* silence gcc warnings and default CLOCKS_PER_SEC if it isnt defined (for sunos4 and gcc)
*
@@ -635,7 +641,7 @@ LOCAL void create_udp_fd()
status = taskPriorityGet(VXTASKIDSELF, &pri);
if(status<0)
ca_signal(ECA_INTERNAL,NULL);
genLocalExcep (ECA_INTERNAL,NULL);
strcpy(name,"RD ");
strncat(
@@ -660,7 +666,7 @@ LOCAL void create_udp_fd()
0,
0);
if (status<0) {
ca_signal(ECA_INTERNAL,NULL);
genLocalExcep (ECA_INTERNAL,NULL);
}
ca_static->recv_tid = status;
@@ -833,8 +839,7 @@ void ca_process_exit()
FALSE);
}
if (socket_close(piiu->sock_chan) < 0){
ca_signal(
ECA_INTERNAL,
genLocalExcep ( ECA_INTERNAL,
"Corrupt iiu list- at close");
}
piiu = (struct ioc_in_use *) piiu->node.next;
@@ -1544,14 +1549,16 @@ void *usrarg
piiu = chix->piiu;
if(!CA_V41(CA_PROTOCOL_VERSION, piiu->minor_version_number)){
return ECA_NOSUPPORT;
if (piiu) {
if(!CA_V41(CA_PROTOCOL_VERSION, piiu->minor_version_number)){
return ECA_NOSUPPORT;
}
}
#ifdef vxWorks
if (!piiu) {
CACLIENTPUTNOTIFY *ppn;
int size;
unsigned size;
size = dbr_size_n(type,count);
LOCK;
@@ -2959,11 +2966,41 @@ int epicsShareAPI ca_test_io()
}
}
/*
* generateLocalExceptionWithFileAndLine ()
*/
void generateLocalExceptionWithFileAndLine (long stat, char *ctx,
char *pFile, unsigned lineNo)
{
struct exception_handler_args args;
/*
* NOOP if they disable exceptions
*/
if (!ca_static->ca_exception_func) {
return;
}
args.usr = ca_static->ca_exception_arg;
args.chid = NULL;
args.type = -1;
args.count = 0u;
args.addr = NULL;
args.stat = stat;
args.op = CA_OP_OTHER;
args.ctx = ctx;
args.pFile = pFile;
args.lineNo = lineNo;
LOCKEVENTS;
(*ca_static->ca_exception_func) (args);
UNLOCKEVENTS;
}
/*
* CA_SIGNAL()
*
*
*/
void epicsShareAPI ca_signal(long ca_status,char *message)
{
@@ -2980,7 +3017,7 @@ void epicsShareAPI ca_signal(long ca_status,char *message)
* of this routine is calling this routine
* (if they call this routine again).
*/
const char *ca_message(long ca_status)
READONLY char * epicsShareAPI ca_message (long ca_status)
{
unsigned msgNo = CA_EXTRACT_MSG_NO(ca_status);
@@ -3323,27 +3360,26 @@ void issue_claim_channel(struct ioc_in_use *piiu, chid pchan)
*/
LOCAL void ca_default_exception_handler(struct exception_handler_args args)
{
char *pName;
if(args.chid){
pName = ca_name(args.chid);
}
else{
pName = "?";
}
char *pCtx;
/*
* LOCK around use of sprintf buffer
*/
LOCK;
sprintf(sprintf_buf,
"%s - with request chan=%s op=%ld data type=%s count=%ld",
args.ctx,
pName,
args.op,
dbr_type_to_text(args.type),
args.count);
ca_signal(args.stat, sprintf_buf);
if (args.chid && args.op != CA_OP_OTHER) {
sprintf(sprintf_buf,
"%s - with request chan=%s op=%ld data type=%s count=%ld",
args.ctx,
ca_name(args.chid),
args.op,
dbr_type_to_text(args.type),
args.count);
pCtx = sprintf_buf;
}
else {
pCtx = args.ctx;
}
ca_signal_with_file_and_lineno(args.stat, pCtx, args.pFile, args.lineNo);
UNLOCK;
}
@@ -3418,6 +3454,16 @@ int epicsShareAPI ca_v42_ok(chid chan)
return v42;
}
/*
* ca_version()
* function that returns the CA version string
*/
READONLY char * epicsShareAPI ca_version()
{
return CA_VERSION_STRING;
}
/*
*

View File

@@ -7,6 +7,15 @@ static char *sccsId = "@(#) $Id$";
/*
* $Log$
* Revision 1.37 1996/09/16 16:31:01 jhill
* fixed NT warnings
*
* Revision 1.36 1996/07/24 21:55:33 jhill
* fixed gnu warnings
*
* Revision 1.35 1996/07/01 19:49:15 jhill
* turned on analog value wrap-around test
*
* Revision 1.34 1996/06/19 17:59:02 jhill
* many 3.13 beta changes
*
@@ -100,7 +109,7 @@ int acctst(char *pname)
NULL);
}
#else /* not vxWorks */
main(int argc, char **argv)
int main(int argc, char **argv)
{
if(argc == 2){
doacctst(argv[1]);
@@ -138,6 +147,11 @@ int doacctst(char *pname)
lib$init_timer();
#endif /*VMS*/
printf("CA Client V%s\n", ca_version());
/*
* CA pend event delay accuracy test
*/
{
TS_STAMP end_time;
TS_STAMP start_time;
@@ -155,12 +169,28 @@ int doacctst(char *pname)
accuracy = 100.0*(delay-request)/request;
printf("CA pend event delay accuracy = %f %%\n",
accuracy);
assert (abs(accuracy) < 10.0);
assert (fabs(accuracy) < 10.0);
}
size = dbr_size_n(DBR_GR_FLOAT, NUM);
ptr = (struct dbr_gr_float *) malloc(size);
/*
* verify that we dont print a disconnect message when
* we delete the last channel
* (this fails if we see a disconnect message)
*/
status = ca_search( pname, &chix3);
SEVCHK(status, NULL);
status = ca_pend_io(1000.0);
SEVCHK(status, NULL);
status = ca_clear_channel(chix3);
SEVCHK(status, NULL);
/*
* verify lots of disconnects
* verify channel connected state variables
*/
printf("Connect/disconnect test");
fflush(stdout);
for (i = 0; i < 10; i++) {
@@ -287,32 +317,32 @@ int doacctst(char *pname)
ca_read_access(chix1) &&
ca_write_access(chix1)){
dbr_double_t incr;
dbr_double_t epsil;
dbr_double_t base;
dbr_float_t incr;
dbr_float_t epsil;
dbr_float_t base;
unsigned long iter;
printf ("float test ...");
fflush(stdout);
epsil = FLT_EPSILON*4;
epsil = FLT_EPSILON*4.0F;
base = FLT_MIN;
for (i=FLT_MIN_EXP; i<FLT_MAX_EXP; i+=FLT_MAX_EXP/10) {
incr = ldexp (0.5,i);
iter = FLT_MAX/fabs(incr);
incr = (dbr_float_t) ldexp (0.5F,i);
iter = (unsigned long) (FLT_MAX/fabs(incr));
iter = min (iter,10);
floatTest(chix1, base, incr, epsil, iter);
}
base = FLT_MAX;
for (i=FLT_MIN_EXP; i<FLT_MAX_EXP; i+=FLT_MAX_EXP/10) {
incr = - ldexp (0.5,i);
iter = FLT_MAX/fabs(incr);
incr = (dbr_float_t) - ldexp (0.5F,i);
iter = (unsigned long) (FLT_MAX/fabs(incr));
iter = min (iter,10);
floatTest(chix1, base, incr, epsil, iter);
}
base = - FLT_MAX;
for (i=FLT_MIN_EXP; i<FLT_MAX_EXP; i+=FLT_MAX_EXP/10) {
incr = ldexp (0.5,i);
iter = FLT_MAX/fabs(incr);
incr = (dbr_float_t) ldexp (0.5F,i);
iter = (unsigned long) (FLT_MAX/fabs(incr));
iter = min (iter,10);
floatTest(chix1, base, incr, epsil, iter);
}
@@ -338,21 +368,21 @@ int doacctst(char *pname)
base = DBL_MIN;
for (i=DBL_MIN_EXP; i<DBL_MAX_EXP; i+=DBL_MAX_EXP/10) {
incr = ldexp (0.5,i);
iter = DBL_MAX/fabs(incr);
iter = (unsigned long) (DBL_MAX/fabs(incr));
iter = min (iter,10);
doubleTest(chix1, base, incr, epsil, iter);
}
base = DBL_MAX;
for (i=DBL_MIN_EXP; i<DBL_MAX_EXP; i+=DBL_MAX_EXP/10) {
incr = - ldexp (0.5,i);
iter = DBL_MAX/fabs(incr);
iter = (unsigned long) (DBL_MAX/fabs(incr));
iter = min (iter,10);
doubleTest(chix1, base, incr, epsil, iter);
}
base = - DBL_MAX;
for (i=DBL_MIN_EXP; i<DBL_MAX_EXP; i+=DBL_MAX_EXP/10) {
incr = ldexp (0.5,i);
iter = DBL_MAX/fabs(incr);
iter = (unsigned long) (DBL_MAX/fabs(incr));
iter = min (iter,10);
doubleTest(chix1, base, incr, epsil, iter);
}
@@ -363,8 +393,8 @@ int doacctst(char *pname)
* ca_pend_io() must block
*/
if(ca_read_access(chix4)){
dbr_float_t req = 3.3;
dbr_float_t resp = 0.0;
dbr_float_t req = 3.3F;
dbr_float_t resp = 0.0F;
printf ("get TMO test ...");
fflush(stdout);
@@ -375,10 +405,10 @@ int doacctst(char *pname)
assert (resp == req);
}
else {
assert (resp == 0.0);
assert (resp == 0.0F);
}
resp = 0.0;
resp = 0.0F;
SEVCHK (ca_put(DBR_FLOAT, chix4, &req),NULL);
SEVCHK (ca_get(DBR_FLOAT, chix4, &resp),NULL);
SEVCHK (ca_pend_io(2000.0),NULL);
@@ -513,7 +543,7 @@ int doacctst(char *pname)
status = ca_clear_event(mid[i]);
if(status != ECA_NORMAL){
printf(
"Clear of event %d %x failed because \"%s\"\n",
"Clear of event %ld %x failed because \"%s\"\n",
i,
mid[i]->id,
ca_message(status));
@@ -582,7 +612,7 @@ int doacctst(char *pname)
if (pfloat)
for (i = 0; i < NUM; i++) {
for (j = 0; j < NUM; j++)
sprintf(&pstring[j][0], "%d", j + 100);
sprintf(&pstring[j][0], "%ld", j + 100l);
SEVCHK(ca_array_put(
DBR_STRING,
NUM,
@@ -654,7 +684,7 @@ int doacctst(char *pname)
accuracy = 100.0*(delay-request)/request;
printf("CA pend event delay accuracy = %f %%\n",
accuracy);
assert (abs(accuracy) < 10.0);
assert (fabs(accuracy) < 10.0);
}
{
@@ -752,8 +782,6 @@ unsigned iterations)
void null_event(struct event_handler_args args)
{
static int i;
dbr_double_t fval = 3.8;
int status;
unsigned *pInc = (unsigned *) args.usr;
if (pInc) {

View File

@@ -78,13 +78,32 @@ int cac_select_io(struct timeval *ptimeout, int flags)
continue;
}
if (piiu->sock_chan>=FD_SETSIZE) {
#ifdef WIN32
/* Under WIN32, FD_SETSIZE is the number of sockets,
* not the max. file descriptor value that you may select() !
*
* Of course it's not allowed to look into fd_count,
* but what shall we do? -kuk-
*/
if (pfdi->readMask.fd_count >= FD_SETSIZE)
{
ca_printf(
"%s.%d: file number > FD_SETSIZE=%d ignored\n",
__FILE__, __LINE__, FD_SETSIZE);
"%s.%d: no room for fd %d in fd_set (FD_SETSIZE=%d)\n",
__FILE__, __LINE__, piiu->sock_chan, FD_SETSIZE);
continue;
}
#else
if (piiu->sock_chan>=FD_SETSIZE)
{
ca_printf(
"%s.%d: file number %d > FD_SETSIZE=%d ignored\n",
__FILE__, __LINE__, piiu->sock_chan, FD_SETSIZE);
continue;
}
#endif
/*
* Dont bother receiving if we have insufficient
* space for the maximum UDP message

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.1 1996/06/20 18:02:22 jhill
* installed into CVS
*
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
* ca server installation
*
@@ -62,6 +65,9 @@
*
* .10 050594 joh New command added for CA V4.3 - wakeup the server
* $Log$
* Revision 1.1 1996/06/20 18:02:22 jhill
* installed into CVS
*
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
* ca server installation
*
@@ -70,9 +76,24 @@
#define __CAPROTO__
/* TCP/UDP port number (bumped each protocol change) */
#define CA_PROTOCOL_VERSION 4u
#define CA_MINOR_VERSION 7u
/*
* CA protocol number
* TCP/UDP port number (bumped each major protocol change)
*/
#define CA_PROTOCOL_VERSION_STR 4
#define CA_MINOR_VERSION_STR 7
/*
* add unsigned to the above numbers for numerical
* comparisons (two defines above are used to create
* version number string - prefer not to have u there)
*/
#ifndef CONCAT
#define CONCAT(A,B) A ## B
#endif
#define UNSIGNED(N) CONCAT(N,u)
#define CA_PROTOCOL_VERSION UNSIGNED(CA_PROTOCOL_VERSION_STR)
#define CA_MINOR_VERSION UNSIGNED(CA_MINOR_VERSION_STR)
#define CA_UKN_MINOR_VERSION 0u /* unknown minor version */
#if CA_PROTOCOL_VERSION == 4u
#define CA_V41(MAJOR,MINOR) ((MINOR)>=1u)
@@ -228,5 +249,14 @@ struct monops { /* monitor req opi to ioc */
*/
#define unreasonablePVNameSize 500u
#ifndef STRINGOF
#define STRINGOF(A) #A
#endif
#ifndef EXPANDTOSTRING
#define EXPANDTOSTRING(A) STRINGOF(A)
#endif
#define CA_VERSION_STRING \
(EXPANDTOSTRING(CA_PROTOCOL_VERSION_STR)"."EXPANDTOSTRING(CA_MINOR_VERSION_STR))
#endif /* __CAPROTO__ */

View File

@@ -258,6 +258,8 @@ struct exception_handler_args{
long stat; /* Channel access std status code */
long op; /* External codes for channel access operations */
char *ctx; /* A character string containing context info */
char *pFile; /* source file name (may be NULL) */
unsigned lineNo; /* source file line number */
};
@@ -984,6 +986,11 @@ int epicsShareAPI ca_v42_ok(chid chan);
int epicsShareAPI ca_v42_ok();
#endif /*CAC_FUNC_PROTO*/
/*
* function that returns the CA version string
*/
READONLY char * epicsShareAPI ca_version();
/*
* ca_replace_printf_handler ()
*

View File

@@ -124,22 +124,22 @@ HDRVERSIONID(caerrh, "@(#) $Id$")
#define ECA_ADDFAIL DEFMSG(CA_K_WARNING, 21)
#define ECA_BADCOUNT DEFMSG(CA_K_WARNING, 22)
#define ECA_BADSTR DEFMSG(CA_K_ERROR, 23)
#define ECA_DISCONN DEFMSG(CA_K_INFO, 24)
#define ECA_DBLCHNL DEFMSG(CA_K_INFO, 25)
#define ECA_DISCONN DEFMSG(CA_K_WARNING, 24)
#define ECA_DBLCHNL DEFMSG(CA_K_WARNING, 25)
#define ECA_EVDISALLOW DEFMSG(CA_K_ERROR, 26)
#define ECA_BUILDGET DEFMSG(CA_K_WARNING, 27)
#define ECA_NEEDSFP DEFMSG(CA_K_INFO, 28)
#define ECA_NEEDSFP DEFMSG(CA_K_WARNING, 28)
#define ECA_OVEVFAIL DEFMSG(CA_K_WARNING, 29)
#define ECA_BADMONID DEFMSG(CA_K_ERROR, 30)
#define ECA_NEWADDR DEFMSG(CA_K_INFO, 31)
#define ECA_NEWADDR DEFMSG(CA_K_WARNING, 31)
#define ECA_NEWCONN DEFMSG(CA_K_INFO, 32)
#define ECA_NOCACTX DEFMSG(CA_K_WARNING, 33)
#define ECA_DEFUNCT DEFMSG(CA_K_FATAL, 34)
#define ECA_EMPTYSTR DEFMSG(CA_K_WARNING, 35)
#define ECA_NOREPEATER DEFMSG(CA_K_INFO, 36)
#define ECA_NOCHANMSG DEFMSG(CA_K_INFO, 37)
#define ECA_DLCKREST DEFMSG(CA_K_INFO, 38)
#define ECA_SERVBEHIND DEFMSG(CA_K_INFO, 39)
#define ECA_NOREPEATER DEFMSG(CA_K_WARNING, 36)
#define ECA_NOCHANMSG DEFMSG(CA_K_WARNNING, 37)
#define ECA_DLCKREST DEFMSG(CA_K_WARNING, 38)
#define ECA_SERVBEHIND DEFMSG(CA_K_WARNING, 39)
#define ECA_NOCAST DEFMSG(CA_K_WARNING, 40)
#define ECA_BADMASK DEFMSG(CA_K_ERROR, 41)
#define ECA_IODONE DEFMSG(CA_K_INFO, 42)
@@ -192,7 +192,7 @@ READONLY char *ca_message_text[]
"A monitor by that id cant be found",
"Remote channel has new network address",
"New or resumed network connection",
"Attempt to import from a task without a CA context failed",
"Specified task isnt a member of a CA context",
"Attempt to use defunct CA feature failed",
"The supplied string is empty",
"Unable to spawn the CA repeater thread- auto reconnect will fail",
@@ -214,7 +214,7 @@ READONLY char *ca_message_text[]
#endif
#ifdef __STDC__
READONLY char *ca_message(long ca_status);
READONLY char * epicsShareAPI ca_message(long ca_status);
#else /* __STDC__ */
READONLY char *ca_message();
#endif

View File

@@ -30,6 +30,9 @@
/* (dont send all chans in a block) */
/* */
/* $Log$
* Revision 1.35 1996/06/19 17:59:04 jhill
* many 3.13 beta changes
*
* Revision 1.34 1995/08/22 00:19:21 jhill
* use current time var to init time stamp in a beacon hash entry
* */
@@ -262,7 +265,7 @@ LOCAL void retrySearchRequest (int silent)
if (status == ECA_NORMAL) {
retry_cnt++;
if (!(silent || chix->pConnFunc)) {
ca_signal (
genLocalExcep (
ECA_CHIDNOTFND,
(char *)(chix+1));
retry_cnt_no_handler++;
@@ -314,7 +317,7 @@ LOCAL void retrySearchRequest (int silent)
sprintf_buf,
"%d channels outstanding",
retry_cnt);
ca_signal (ECA_CHIDRETRY, sprintf_buf);
genLocalExcep (ECA_CHIDRETRY, sprintf_buf);
}
}
UNLOCK;

File diff suppressed because it is too large Load Diff

View File

@@ -88,7 +88,7 @@ int local_addr(int s, struct sockaddr_in *plcladdr)
#endif
for ( pifreq = ifconf.ifc_req;
ifconf.ifc_len >= sizeof(*pifreq);
((size_t)ifconf.ifc_len) >= sizeof(*pifreq);
pifreq++, ifconf.ifc_len -= sizeof(*pifreq)) {
status = socket_ioctl(s, SIOCGIFFLAGS, pifreq);

View File

@@ -47,6 +47,12 @@
/* address in use so that test works on UNIX */
/* kernels that support multicast */
/* $Log$
* Revision 1.64 1996/08/13 23:15:36 jhill
* fixed warning
*
* Revision 1.63 1996/07/09 22:41:28 jhill
* silence gcc warning
*
* Revision 1.62 1996/06/19 17:59:06 jhill
* many 3.13 beta changes
*
@@ -422,7 +428,7 @@ int net_proto
sizeof(saddr));
if(status<0){
ca_printf("CAC: bind (err=%s)\n",strerror(MYERRNO));
ca_signal(ECA_INTERNAL,"bind failed");
genLocalExcep (ECA_INTERNAL,"bind failed");
}
#endif
@@ -448,7 +454,7 @@ int net_proto
default:
free(piiu);
ca_signal(ECA_INTERNAL,"alloc_ioc: ukn protocol\n");
genLocalExcep (ECA_INTERNAL,"alloc_ioc: ukn protocol");
/*
* turn off gcc warnings
*/
@@ -538,7 +544,7 @@ void caSetupBCastAddrList (ELLLIST *pList, SOCKET sock, unsigned port)
port);
if (ellCount(pList)==0) {
ca_signal (ECA_NOSEARCHADDR, NULL);
genLocalExcep (ECA_NOSEARCHADDR, NULL);
}
}
@@ -1203,6 +1209,7 @@ LOCAL void close_ioc (IIU *piiu)
caAddrNode *pNode;
chid chix;
int status;
unsigned chanDisconnectCount;
/*
* dont close twice
@@ -1221,10 +1228,13 @@ LOCAL void close_ioc (IIU *piiu)
if (piiu == piiuCast) {
piiuCast = NULL;
chanDisconnectCount = 0u;
}
else {
chid pNext;
chanDisconnectCount = ellCount(&piiu->chidlist);
/*
* remove IOC from the hash table
*/
@@ -1274,7 +1284,9 @@ LOCAL void close_ioc (IIU *piiu)
ellFree (&piiu->destAddr);
ca_signal (ECA_DISCONN,piiu->host_name_str);
if (chanDisconnectCount) {
genLocalExcep (ECA_DISCONN, piiu->host_name_str);
}
free (piiu);
@@ -1662,7 +1674,7 @@ void caAddConfiguredAddr(ELLLIST *pList, ENV_PARAM *pEnv,
addr.in.sin_family = AF_INET;
addr.in.sin_port = htons(port);
addr.in.sin_addr.s_addr = inet_addr(pToken);
if(addr.in.sin_addr.s_addr == -1){
if (addr.in.sin_addr.s_addr == ~0ul) {
ca_printf(
"%s: Parsing '%s'\n",
__FILE__,

View File

@@ -32,6 +32,15 @@
/************************************************************************/
/* $Log$
* Revision 1.56 1996/08/13 23:16:19 jhill
* removed os specific code
*
* Revision 1.55 1996/08/05 19:21:26 jhill
* removed unused proto
*
* Revision 1.54 1996/06/20 21:43:15 jhill
* restored io_done_sem (removed by cleanup)
*
* Revision 1.53 1996/06/20 21:19:35 jhill
* fixed posix signal problem with "cc -Xc"
*
@@ -470,7 +479,6 @@ struct ca_static{
int ca_event_tid;
int ca_tid;
int recv_tid;
unsigned ca_local_ticks;
#endif
};
@@ -595,8 +603,6 @@ unsigned short port,
int net_proto
);
int ca_check_for_fp(void);
void caSetupBCastAddrList (ELLLIST *pList, SOCKET sock, unsigned port);
int ca_os_independent_init (void);
@@ -630,6 +636,10 @@ void clearChannelResources(unsigned id);
void caSetDefaultPrintfHandler (void);
void cacDisconnectChannel(chid chix, enum channel_state state);
int caSendMsgPending(void);
void generateLocalExceptionWithFileAndLine(long stat, char *ctx,
char *pFile, unsigned line);
#define genLocalExcep(STAT, PCTX) \
generateLocalExceptionWithFileAndLine (STAT, PCTX, __FILE__, __LINE__)
/*
* !!KLUDGE!!

View File

@@ -219,11 +219,6 @@ static char *os_depenhSccsId = "$Id$";
#define LOCAL static
#endif
/* delay for when a poll is used */
/* NOTE: DELAYTICKS must be less than TICKSPERSEC */
#define DELAYTICKS 50L /* (adjust units below) */
#define TICKSPERSEC 1000L /* mili sec per sec */
/*
* BSD prototypes missing from SUNOS4, MULTINET and
* perhaps other environments
@@ -231,14 +226,6 @@ static char *os_depenhSccsId = "$Id$";
#include <epicsTypes.h>
#include <bsdProto.h>
/*
* order of ops is important here
*
* NOTE: large OS dependent SYFREQ might cause an overflow
*/
#define LOCALTICKS ((SYSFREQ*DELAYTICKS)/TICKSPERSEC)
#if defined(vxWorks)
# define VXTASKIDNONE 0
# define LOCK semTake(client_lock, WAIT_FOREVER);
@@ -256,8 +243,6 @@ static char *os_depenhSccsId = "$Id$";
# define socket_ioctl(A,B,C) ioctl(A,B,(int)C)
# define MYERRNO (errnoGet()&0xffff)
# define POST_IO_EV semGive(io_done_sem)
# define SYSFREQ ((long) sysClkRateGet()) /* usually 60 Hz */
# define time(A) (tickGet()/SYSFREQ)
typedef int SOCKET;
# define INVALID_SOCKET (-1)
#endif
@@ -272,7 +257,6 @@ static char *os_depenhSccsId = "$Id$";
# define socket_ioctl(A,B,C) ioctl(A,B,C)
# define MYERRNO errno
# define POST_IO_EV
# define SYSFREQ 1000000L /* 1 MHz */
typedef int SOCKET;
# define INVALID_SOCKET (-1)
#endif
@@ -298,7 +282,6 @@ static char *os_depenhSccsId = "$Id$";
# endif
# endif
# define POST_IO_EV
# define SYSFREQ 10000000L /* 10 MHz */
# define LOCK
# define UNLOCK
# define LOCKEVENTS
@@ -326,7 +309,6 @@ static char *os_depenhSccsId = "$Id$";
# define socket_ioctl(A,B,C) ioctlsocket(A,B,C)
# define MYERRNO WSAGetLastError()
# define POST_IO_EV
# define SYSFREQ 1000000L /* 1 MHz */
#endif /*WIN32*/

View File

@@ -63,6 +63,9 @@
* datagram socket (and watching for ECONNREFUSED)
*
* $Log$
* Revision 1.36 1996/07/12 00:40:48 jhill
* fixed client disconnect problem under solaris
*
* Revision 1.32.6.1 1996/07/12 00:39:59 jhill
* fixed client disconnect problem under solaris
*
@@ -115,13 +118,13 @@ LOCAL void fanOut(struct sockaddr_in *pFrom, const char *pMsg, unsigned msgSize)
*/
void ca_repeater()
{
int status;
int size;
SOCKET sock;
struct sockaddr_in from;
struct sockaddr_in local;
int from_size = sizeof from;
unsigned short port;
int status;
int size;
SOCKET sock;
struct sockaddr_in from;
struct sockaddr_in local;
int from_size = sizeof from;
unsigned short port;
port = caFetchPortConfig(
&EPICS_CA_REPEATER_PORT,
@@ -186,7 +189,7 @@ void ca_repeater()
* both zero length message and a registration message
* will register a new client
*/
if(size >= sizeof(*pMsg)){
if( ((size_t)size) >= sizeof(*pMsg)){
if(ntohs(pMsg->m_cmmd) == REPEATER_REGISTER){
register_new_client(&local, &from);

View File

@@ -579,6 +579,8 @@ const struct in_addr *pnet_addr
*/
monix = NULL;
args.addr = NULL;
args.pFile = NULL;
args.lineNo = 0u;
LOCK;
switch (ntohs(req->m_cmmd)) {
case CA_PROTO_READ_NOTIFY:
@@ -813,7 +815,7 @@ const struct in_addr *pnet_addr
(char *)(chan + 1),
chpiiu->host_name_str,
rej);
ca_signal(ECA_DBLCHNL, sprintf_buf);
genLocalExcep (ECA_DBLCHNL, sprintf_buf);
}
UNLOCK;
return;

View File

@@ -29,6 +29,15 @@
* Modification Log:
* -----------------
* $Log$
* Revision 1.25 1996/08/13 23:16:23 jhill
* removed os specific code
*
* Revision 1.23 1996/08/05 19:18:56 jhill
* better msg for lack of fp
*
* Revision 1.22 1996/06/19 17:59:31 jhill
* many 3.13 beta changes
*
* Revision 1.21 1995/10/18 16:44:36 jhill
* select time out must be greater than a vxWorks tick
*
@@ -51,6 +60,17 @@ LOCAL void ca_extra_event_labor(void *pArg);
LOCAL int cac_os_depen_exit_tid (struct ca_static *pcas, int tid);
LOCAL int cac_add_task_variable (struct ca_static *ca_temp);
LOCAL void deleteCallBack(CALLBACK *pcb);
LOCAL void ca_check_for_fp();
/*
* order of ops is important here
*
* NOTE: large OS dependent SYFREQ might cause an overflow
* NOTE: POLLDELAY must be less than TICKSPERSEC
*/
#define POLLDELAY 50 /* milli sec */
#define TICKSPERSEC 1000 /* milli sec per sec */
#define LOCALTICKS ((sysClkRateGet()*POLLDELAY)/TICKSPERSEC)
@@ -103,8 +123,8 @@ void cac_gettimeval(struct timeval *pt)
void cac_block_for_io_completion(struct timeval *pTV)
{
struct timeval itimeout;
unsigned long ticks;
unsigned long rate = sysClkRateGet();
int ticks;
int rate = sysClkRateGet();
#ifdef NOASYNCRECV
cac_mux_io(pTV);
@@ -117,7 +137,7 @@ void cac_block_for_io_completion(struct timeval *pTV)
itimeout.tv_sec = 0;
cac_mux_io(&itimeout);
ticks = pTV->tv_sec*rate + (pTV->tv_usec*rate)/USEC_PER_SEC;
ticks = (int) (pTV->tv_sec*rate + (pTV->tv_usec*rate)/USEC_PER_SEC);
ticks = min(LOCALTICKS, ticks);
semTake(io_done_sem, ticks);
@@ -171,8 +191,8 @@ void os_specific_sg_io_complete(CASG *pcasg)
void cac_block_for_sg_completion(CASG *pcasg, struct timeval *pTV)
{
struct timeval itimeout;
unsigned long ticks;
unsigned long rate = sysClkRateGet();
int ticks;
int rate = sysClkRateGet();
#ifdef NOASYNCRECV
cac_mux_io(pTV);
@@ -185,7 +205,7 @@ void cac_block_for_sg_completion(CASG *pcasg, struct timeval *pTV)
itimeout.tv_sec = 0;
cac_mux_io(&itimeout);
ticks = pTV->tv_sec*rate + (pTV->tv_usec*rate)/USEC_PER_SEC;
ticks = (int) (pTV->tv_sec*rate + (pTV->tv_usec*rate)/USEC_PER_SEC);
ticks = min(LOCALTICKS, ticks);
semTake (pcasg->sem, ticks);
@@ -209,10 +229,7 @@ LOCAL int cac_add_task_variable (struct ca_static *ca_temp)
TVIU *ptviu;
int status;
status = ca_check_for_fp();
if(status != ECA_NORMAL){
return status;
}
ca_check_for_fp();
# ifdef DEBUG
ca_printf("CAC: adding task variable\n");
@@ -342,7 +359,6 @@ int cac_os_depen_init(struct ca_static *pcas)
ellInit(&pcas->ca_putNotifyQue);
pcas->ca_tid = taskIdSelf();
pcas->ca_local_ticks = LOCALTICKS;
pcas->ca_client_lock = semMCreate(SEM_DELETE_SAFE);
assert(pcas->ca_client_lock);
pcas->ca_event_lock = semMCreate(SEM_DELETE_SAFE);
@@ -620,10 +636,7 @@ int ca_import(int tid)
struct ca_static *pcas;
TVIU *ptviu;
status = ca_check_for_fp();
if(status != ECA_NORMAL){
return status;
}
ca_check_for_fp();
/*
* just return success if they have already done
@@ -671,8 +684,26 @@ int ca_import(int tid)
*/
int ca_import_cancel(int tid)
{
int status;
TVIU *ptviu;
int status;
TVIU *ptviu;
struct ca_static *pcas;
if (tid == taskIdSelf()) {
pcas = NULL;
}
else {
pcas = ca_static;
}
/*
* Attempt to attach to the specified context
*/
ca_static = (struct ca_static *)
taskVarGet(tid, (int *)&ca_static);
if (ca_static == (struct ca_static *) ERROR){
ca_static = pcas;
return ECA_NOCACTX;
}
LOCK;
ptviu = (TVIU *) ellFirst(&ca_static->ca_taskVarList);
@@ -684,16 +715,20 @@ int ca_import_cancel(int tid)
}
if(!ptviu){
ca_static = pcas;
UNLOCK;
return ECA_NOCACTX;
}
ellDelete(&ca_static->ca_taskVarList, &ptviu->node);
free(ptviu);
UNLOCK;
status = taskVarDelete(tid, (void *)&ca_static);
assert (status == OK);
ca_static = pcas;
return ECA_NORMAL;
}
@@ -701,15 +736,14 @@ int ca_import_cancel(int tid)
/*
* ca_check_for_fp()
*/
int ca_check_for_fp()
LOCAL void ca_check_for_fp()
{
int options;
assert(taskOptionsGet(taskIdSelf(), &options) == OK);
if (!(options & VX_FP_TASK)) {
return ECA_NEEDSFP;
genLocalExcep (ECA_NEEDSFP, taskName(taskIdSelf()));
}
return ECA_NORMAL;
}

View File

@@ -32,8 +32,20 @@
* Modification Log:
* -----------------
* $Log$
* Revision 1.21 1996/08/05 19:20:29 jhill
* removed incorrect ver number
*
* Revision 1.20 1995/12/19 19:36:20 jhill
* function prototype changes
*
* Revision 1.19 1995/11/29 19:15:42 jhill
* added $Log$ to the header
* added $Log$
* added Revision 1.21 1996/08/05 19:20:29 jhill
* added removed incorrect ver number
* added
* Revision 1.20 1995/12/19 19:36:20 jhill
* function prototype changes
* to the header
*
*/
@@ -43,6 +55,7 @@
#include <windows.h>
#include <process.h>
#include <mmsystem.h>
#include <epicsVersion.h>
#include "iocinf.h"
@@ -463,10 +476,10 @@ BOOL epicsShareAPI DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
#if _DEBUG /* for gui applications, setup console for error messages */
if (AllocConsole()) {
SetConsoleTitle("Channel Access Status");
SetConsoleTitle(EPICS_VERSION_STRING);
freopen( "CONOUT$", "a", stderr );
}
fprintf(stderr, "Process attached to ca.dll R3.12.1\n");
fprintf(stderr, "Process attached to ca.dll\n");
#endif /* init. winsock */
if ((status = WSAStartup(MAKEWORD(1,1), &WsaData)) != 0) {
fprintf(stderr,"Cant init winsock \n");
@@ -497,13 +510,13 @@ BOOL epicsShareAPI DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
case DLL_THREAD_ATTACH:
#if _DEBUG
fprintf(stderr, "Thread attached to ca.dll R3.12.1\n");
fprintf(stderr, "Thread attached to ca.dll\n");
#endif
break;
case DLL_THREAD_DETACH:
#if _DEBUG
fprintf(stderr, "Thread detached from ca.dll R3.12.1\n");
fprintf(stderr, "Thread detached from ca.dll\n");
#endif
break;

View File

@@ -0,0 +1,8 @@
TOP=../../../..
include $(TOP)/config/CONFIG_BASE
include $(TOP)/config/RULES_ARCHS

View File

@@ -0,0 +1,93 @@
#HERE := $(shell pwd)
HERE = .
CAS = $(HERE)/../../..
TOP = $(CAS)/../..
SRC = $(CAS)/generic
CA = $(CAS)/../ca
IOSRC = $(CAS)/io/bsdSocket
OSSRC = $(CAS)/os/vxWorks
VPATH = $(SRC) $(IOSRC) $(OSSRC)
include $(TOP)/config/CONFIG_BASE
CXXCMPLR = STRICT
USR_INCLUDES = -I$(SRC) -I$(OSSRC) -I$(IOSRC) -I$(CA)\
-I$(TOP)/src/include/os/vxWorks
DEPLIBS_BASE = $(EPICS_BASE_LIB)
SRCS.cc += $(SRC)/caServer.cc
SRCS.cc += $(SRC)/caServerI.cc
SRCS.cc += $(SRC)/casCoreClient.cc
SRCS.cc += $(SRC)/casClient.cc
SRCS.cc += $(SRC)/casDGClient.cc
SRCS.cc += $(SRC)/casStrmClient.cc
SRCS.cc += $(SRC)/casPV.cc
SRCS.cc += $(SRC)/casPVI.cc
SRCS.cc += $(SRC)/casChannel.cc
SRCS.cc += $(SRC)/casChannelI.cc
SRCS.cc += $(SRC)/casClientMon.cc
SRCS.cc += $(SRC)/casChanDelEv.cc
SRCS.cc += $(SRC)/casMsgIO.cc
SRCS.cc += $(SRC)/casAsyncIO.cc
SRCS.cc += $(SRC)/casAsyncIOI.cc
SRCS.cc += $(SRC)/casEventSys.cc
SRCS.cc += $(SRC)/casMonitor.cc
SRCS.cc += $(SRC)/casMonEvent.cc
SRCS.cc += $(SRC)/outBuf.cc
SRCS.cc += $(SRC)/inBuf.cc
SRCS.cc += $(SRC)/casEventMask.cc
SRCS.cc += $(OSSRC)/caServerOS.cc
SRCS.cc += $(OSSRC)/casDGOS.cc
SRCS.cc += $(OSSRC)/casStreamOS.cc
SRCS.cc += $(IOSRC)/caServerIO.cc
SRCS.cc += $(IOSRC)/casDGIO.cc
SRCS.cc += $(IOSRC)/casStreamIO.cc
SRCS.c += $(IOSRC)/sigPipeIgnore.c
LIBOBJS += caServer.o
LIBOBJS += caServerI.o
LIBOBJS += casCoreClient.o
LIBOBJS += casClient.o
LIBOBJS += casDGClient.o
LIBOBJS += casStrmClient.o
LIBOBJS += casPV.o
LIBOBJS += casPVI.o
LIBOBJS += casChannel.o
LIBOBJS += casChannelI.o
LIBOBJS += casClientMon.o
LIBOBJS += casChanDelEv.o
LIBOBJS += casMsgIO.o
LIBOBJS += casAsyncIO.o
LIBOBJS += casAsyncIOI.o
LIBOBJS += casEventSys.o
LIBOBJS += casMonitor.o
LIBOBJS += casMonEvent.o
LIBOBJS += outBuf.o
LIBOBJS += inBuf.o
LIBOBJS += casEventMask.o
LIBOBJS += caServerOS.o
LIBOBJS += casDGOS.o
LIBOBJS += casStreamOS.o
LIBOBJS += caServerIO.o
LIBOBJS += casDGIO.o
LIBOBJS += casStreamIO.o
LIBOBJS += sigPipeIgnore.o
LIBNAME = libcas.o
include $(TOP)/config/RULES.Vx
obj: $(LIBOBJS)
test.o:
clean::
@$(RM) -rf Templates.DB

View File

@@ -1,5 +1,7 @@
CAS = ../../..
#HERE := $(shell pwd)
HERE = .
CAS := $(HERE)/../../..
TOP = $(CAS)/../..
SRC = $(CAS)/generic
CA = $(CAS)/../ca
@@ -9,7 +11,10 @@ VPATH = $(SRC) $(IOSRC) $(OSSRC)
include $(TOP)/config/CONFIG_BASE
USR_INCLUDES = -I$(SRC) -I$(OSSRC) -I$(IOSRC) -I$(CA)
CXXCMPLR = STRICT
USR_INCLUDES = -I$(SRC) -I$(OSSRC) -I$(IOSRC) -I$(CA) \
-I$(TOP)/src/include/os/$(T_A)
DEPLIBS_BASE = $(EPICS_BASE_LIB)

View File

@@ -1,9 +1,11 @@
CAS = ../../
CAS = ../..
TOP = $(CAS)/../..
include $(TOP)/config/CONFIG_BASE
CXXCMPLR = STRICT
USR_INCLUDES =
USR_LDLIBS = -lcas -lca -lCom -lgdd
@@ -14,12 +16,14 @@ DEPLIBSWOCAS = $(DEPLIBS_BASE)/libca.a $(DEPLIBS_BASE)/libCom.a \
$(DEPLIBS_BASE)/libgdd.a
DEPLIBS = $(DEPLIBS_BASE)/libcas.a $(DEPLIBSWOCAS)
SRCS.cc += ../main.cc
SRCS.cc += ../exServer.cc
SRCS.cc += ../exPV.cc
SRCS.cc += ../exSyncPV.cc
SRCS.cc += ../exAsyncPV.cc
SRCS.cc += ../exChannel.cc
OBJS += main.o
OBJS += exServer.o
OBJS += exPV.o
OBJS += exSyncPV.o
@@ -67,16 +71,21 @@ excas: $(OBJS) $(DEPLIBS)
$(LINK.cc) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
#
# fast link (without library build)
# fast link (without waiting for library build)
#
#PURIFY = /remote/lear_local/pure/purify-3.0a-sunos4/purify
nolib: $(OBJS) $(GLOMBOBJ) $(DEPLIBSWOCAS)
$(PURIFY) $(LINK.cc) -o $@ $(OBJS) $(GLOMBOBJ) $(DEPLIBSWOCAS)
$(LINK.cc) -o $@ $(OBJS) $(GLOMBOBJ) $(DEPLIBSWOCAS)
#
# build with purify
#
purify: $(OBJS) $(GLOMBOBJ) $(DEPLIBSWOCAS)
$(PURIFY) -best-effort $(LINK.cc) -o $@ $(OBJS) $(GLOMBOBJ) $(DEPLIBSWOCAS)
clean::
@$(RM) excas
@$(RM) nolib
@$(RM) purify
@$(RM) -rf Templates.DB
@$(RM) core

View File

@@ -64,7 +64,7 @@ void exPV::scanPV()
//
this->currentTime = osiTime::getCurrent();
pDD = new gddScaler (gddAppType_value, aitEnumFloat32);
pDD = new gddScalar (gddAppType_value, aitEnumFloat32);
if (!pDD) {
return;
}
@@ -140,7 +140,7 @@ caStatus exPV::update(gdd &valueIn)
this->info.getName().string, valueIn);
# endif
if (valueIn.isScaler()) {
if (valueIn.isScalar()) {
pNewValue = &valueIn;
pNewValue->reference();
}
@@ -149,7 +149,7 @@ caStatus exPV::update(gdd &valueIn)
// this does not modify the current value
// (because it may be referenced in the event queue)
//
pNewValue = new gddScaler (gddAppType_value, aitEnumFloat32);
pNewValue = new gddScalar (gddAppType_value, aitEnumFloat32);
if (!pNewValue) {
return S_casApp_noMemory;
}
@@ -255,10 +255,10 @@ void exPV::show(unsigned level)
caStatus exPV::getStatus(gdd &value)
{
if (this->pValue) {
value.putConvert(this->pValue->getStat());
value.put(this->pValue->getStat());
}
else {
value.putConvert(epicsAlarmUDF);
value.put((aitUint16)epicsAlarmUDF);
}
return S_cas_success;
}
@@ -269,10 +269,10 @@ caStatus exPV::getStatus(gdd &value)
caStatus exPV::getSeverity(gdd &value)
{
if (this->pValue) {
value.putConvert(this->pValue->getSevr());
value.put(this->pValue->getSevr());
}
else {
value.putConvert(epicsSevInvalid);
value.put((aitUint16)epicsSevInvalid);
}
return S_cas_success;
}
@@ -299,7 +299,7 @@ inline aitTimeStamp exPV::getTS()
caStatus exPV::getSeconds(gdd &value)
{
aitUint32 sec (this->getTS().tv_sec);
value.putConvert (sec);
value.put(sec);
return S_cas_success;
}
@@ -309,7 +309,7 @@ caStatus exPV::getSeconds(gdd &value)
caStatus exPV::getNanoseconds(gdd &value)
{
aitUint32 nsec (this->getTS().tv_nsec);
value.putConvert (nsec);
value.put(nsec);
return S_cas_success;
}
@@ -318,7 +318,7 @@ caStatus exPV::getNanoseconds(gdd &value)
//
caStatus exPV::getPrecision(gdd &prec)
{
prec.putConvert(4u);
prec.put(4u);
return S_cas_success;
}
@@ -327,7 +327,7 @@ caStatus exPV::getPrecision(gdd &prec)
//
caStatus exPV::getHighLimit(gdd &value)
{
value.putConvert(info.getHopr());
value.put(info.getHopr());
return S_cas_success;
}
@@ -336,7 +336,7 @@ caStatus exPV::getHighLimit(gdd &value)
//
caStatus exPV::getLowLimit(gdd &value)
{
value.putConvert(info.getLopr());
value.put(info.getLopr());
return S_cas_success;
}
@@ -350,6 +350,14 @@ caStatus exPV::getUnits(gdd &units)
return S_cas_success;
}
//
// exPV::getEnums()
//
caStatus exPV::getEnums(gdd &)
{
return S_cas_noConvert;
}
//
// exPV::getValue()
//

View File

@@ -7,9 +7,7 @@
// Example EPICS CA server
//
#include <exServer.h>
#include <fdMgr.h>
const pvInfo exServer::pvList[] = {
pvInfo (1.0e-1, "jane", 10.0f, 0.0f, excasIoSync),
@@ -18,68 +16,11 @@ const pvInfo exServer::pvList[] = {
pvInfo (2.0, "freddy", 10.0f, -10.0f, excasIoAsync)
};
//
// static data for exServer
//
gddAppFuncTable<exPV> exServer::ft;
//
// main()
//
int main (int argc, const char **argv)
{
osiTime begin(osiTime::getCurrent());
exServer *pCAS;
unsigned debugLevel = 0u;
float executionTime;
aitBool forever = aitTrue;
int i;
pCAS = new exServer(32u,5u,500u);
if (!pCAS) {
return (-1);
}
for (i=1; i<argc; i++) {
if (sscanf(argv[i], "-d %u", &debugLevel)==1) {
continue;
}
if (sscanf(argv[i],"-t %f", &executionTime)==1) {
forever = aitFalse;
continue;
}
printf ("usage: %s -d<debug level> -t<execution time>\n",
argv[0]);
return (1);
}
pCAS->setDebugLevel(debugLevel);
if (forever) {
osiTime delay(1000u,0u);
//
// loop here forever
//
while (aitTrue) {
fileDescriptorManager.process(delay);
}
}
else {
osiTime total(executionTime);
osiTime delay(osiTime::getCurrent() - begin);
//
// loop here untime the specified execution time
// expires
//
while (delay < total) {
fileDescriptorManager.process(delay);
delay = osiTime::getCurrent() - begin;
}
}
return (0);
}
//
// exServer::exServer()
//
@@ -102,6 +43,7 @@ exServer::exServer(unsigned pvMaxNameLength, unsigned pvCountEstimate,
ft.installReadFunc("alarmLowWarning",exPV::getLowLimit);
ft.installReadFunc("units",exPV::getUnits);
ft.installReadFunc("value",exPV::getValue);
ft.installReadFunc("enums",exPV::getEnums);
}
//

View File

@@ -62,6 +62,17 @@ public:
{
}
//
// for use when MSVC++ will not build a defualt copy constructor
// for this class
//
pvInfo (const pvInfo &copyIn) :
scanRate(copyIn.scanRate), name(copyIn.name),
hopr(copyIn.hopr), lopr(copyIn.lopr),
ioType(copyIn.ioType)
{
}
const double getScanRate () const { return this->scanRate; }
const aitString &getName () const { return this->name; }
const double getHopr () const { return this->hopr; }
@@ -77,29 +88,6 @@ private:
class exPV;
//
// exServer
//
class exServer : public caServer {
public:
exServer(unsigned pvMaxNameLength, unsigned pvCountEstimate=0x3ff,
unsigned maxSimultaneousIO=1u);
void show (unsigned level);
caStatus pvExistTest (const casCtx &ctxIn, const char *pPVName,
gdd &canonicalPVName);
casPV *createPV (const casCtx &ctxIn, const char *pPVName);
static const pvInfo *findPV(const char *pName);
static gddAppFuncTableStatus read(exPV &pv, gdd &value)
{
return exServer::ft.read(pv, value);
}
private:
static const pvInfo pvList[];
static gddAppFuncTable<exPV> ft;
};
//
// exScanTimer
@@ -172,6 +160,7 @@ public:
gddAppFuncTableStatus getLowLimit(gdd &value);
gddAppFuncTableStatus getUnits(gdd &value);
gddAppFuncTableStatus getValue(gdd &value);
gddAppFuncTableStatus getEnums(gdd &value);
//
//
@@ -191,6 +180,29 @@ private:
static osiTime currentTime;
};
//
// exServer
//
class exServer : public caServer {
public:
exServer(unsigned pvMaxNameLength, unsigned pvCountEstimate=0x3ff,
unsigned maxSimultaneousIO=1u);
void show (unsigned level);
caStatus pvExistTest (const casCtx &ctxIn, const char *pPVName,
gdd &canonicalPVName);
casPV *createPV (const casCtx &ctxIn, const char *pPVName);
static const pvInfo *findPV(const char *pName);
static gddAppFuncTableStatus read(exPV &pv, gdd &value)
{
return exServer::ft.read(pv, value);
}
private:
static const pvInfo pvList[];
static gddAppFuncTable<exPV> ft;
};
//
// exSyncPV
//

61
src/cas/example/main.cc Normal file
View File

@@ -0,0 +1,61 @@
#include <exServer.h>
#include <fdManager.h>
//
// main()
//
int main (int argc, const char **argv)
{
osiTime begin(osiTime::getCurrent());
exServer *pCAS;
unsigned debugLevel = 0u;
float executionTime;
aitBool forever = aitTrue;
int i;
pCAS = new exServer(32u,5u,500u);
if (!pCAS) {
return (-1);
}
for (i=1; i<argc; i++) {
if (sscanf(argv[i], "-d %u", &debugLevel)==1) {
continue;
}
if (sscanf(argv[i],"-t %f", &executionTime)==1) {
forever = aitFalse;
continue;
}
printf ("usage: %s -d<debug level> -t<execution time>\n",
argv[0]);
return (1);
}
pCAS->setDebugLevel(debugLevel);
if (forever) {
osiTime delay(1000u,0u);
//
// loop here forever
//
while (aitTrue) {
fileDescriptorManager.process(delay);
}
}
else {
osiTime total(executionTime);
osiTime delay(osiTime::getCurrent() - begin);
//
// loop here untime the specified execution time
// expires
//
while (delay < total) {
fileDescriptorManager.process(delay);
delay = osiTime::getCurrent() - begin;
}
}
delete pCAS;
return (0);
}

View File

@@ -0,0 +1,70 @@
//
// $Id$
// Author: Jeff HIll (LANL)
//
// $Log$
//
#include <exServer.h>
#include <taskLib.h>
//
// so we can call this from the vxWorks shell
//
extern "C" {
exServer *pExampleCAS;
//
// excas ()
// (vxWorks example server entry point)
//
int excas (unsigned debugLevel, unsigned delaySec)
{
osiTime begin(osiTime::getCurrent());
exServer *pCAS;
pCAS = new exServer(32u,5u,500u);
if (!pCAS) {
return (-1);
}
pCAS->setDebugLevel(debugLevel);
pExampleCAS = pCAS;
if (delaySec==0u) {
//
// loop here forever
//
while (1) {
taskDelay(10);
}
}
else {
osiTime total( ((float)delaySec) );
osiTime delay(osiTime::getCurrent() - begin);
//
// loop here untill the specified execution time
// expires
//
while (delay < total) {
taskDelay(10);
delay = osiTime::getCurrent() - begin;
}
}
pCAS->show(debugLevel);
pExampleCAS = NULL;
delete pCAS;
return 0;
}
int excasShow(unsigned level)
{
if (pExampleCAS!=NULL) {
pExampleCAS->show(level);
}
return 0;
}
} // extern "C"

View File

@@ -1,6 +1,6 @@
this directory contains the generic source for
the EPICS ca server
this directory contains the generic (os and io independent) source for
the EPICS ca server library

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
* ca server installation
*
*
*/
@@ -48,14 +51,6 @@
#define TRUE 1
#endif
#ifndef OK
#define OK 0
#endif
#ifndef ERROR
#define ERROR (-1)
#endif
#ifndef NELEMENTS
#define NELEMENTS(array) (sizeof(array)/sizeof((array)[0]))
#endif

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.2 1996/06/21 02:30:52 jhill
* solaris port
*
* Revision 1.1.1.1 1996/06/20 00:28:14 jhill
* ca server installation
*
@@ -115,6 +118,9 @@ void caServer::show(unsigned level)
if (this->pCAS) {
this->pCAS->show(level);
}
else {
printf("caServer:: no server internals attached\n");
}
}
//

View File

@@ -29,6 +29,18 @@
*
* History
* $Log$
* Revision 1.4 1996/09/04 20:12:04 jhill
* added arg to serverToolDebugFunc()
*
* Revision 1.3 1996/08/13 22:56:12 jhill
* added init for mutex class
*
* Revision 1.2 1996/08/05 19:25:17 jhill
* removed unused code
*
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
* ca server installation
*
*
*/
@@ -52,13 +64,15 @@ void caServerI::show (unsigned level)
printf( "Channel Access Server Status V%d.%d\n",
CA_PROTOCOL_VERSION, CA_MINOR_VERSION);
this->lock();
this->osiMutex::show(level);
this->osiLock();
while ( (pClient = iter()) ) {
pClient->show(level);
}
this->dgClient.show(level);
this->unlock();
this->osiUnlock();
bytes_reserved = 0u;
#if 0
@@ -85,14 +99,14 @@ void caServerI::show (unsigned level)
#endif
printf(
"The server's integer resource id conversion table:\n");
this->lock();
this->osiLock();
this->uintResTable<casRes>::show(level);
this->unlock();
this->osiUnlock();
printf(
"The server's character string resource id conversion table:\n");
this->lock();
this->osiLock();
this->stringResTbl.show(level);
this->unlock();
this->osiUnlock();
}
// @@@@@@ caPrintAddrList(&destAddr);
@@ -135,6 +149,10 @@ caStatus caServerI::init()
int status;
int resLibStatus;
if (this->osiMutex::init()) {
return S_cas_noMemory;
}
status = caServerIO::init();
if (status) {
return status;
@@ -180,7 +198,7 @@ caServerI::~caServerI()
{
casClient *pClient;
this->lock();
this->osiLock();
//
// delete all clients
@@ -189,6 +207,8 @@ caServerI::~caServerI()
delete pClient;
}
this->osiUnlock();
//
// verify that we didnt leak a PV
//
@@ -201,9 +221,9 @@ caServerI::~caServerI()
//
void caServerI::installClient(casStrmClient *pClient)
{
this->lock();
this->osiLock();
this->clientList.add(*pClient);
this->unlock();
this->osiUnlock();
}
@@ -212,9 +232,9 @@ void caServerI::installClient(casStrmClient *pClient)
//
void caServerI::removeClient(casStrmClient *pClient)
{
this->lock();
this->osiLock();
this->clientList.remove(*pClient);
this->unlock();
this->osiUnlock();
}
@@ -253,75 +273,6 @@ void caServerI::connectCB()
}
}
#if 0
//
// caServerI::elapsedTimeCompare()
//
int caServerI::elapsedTimeCompare(
const caTime &stamp1, const caTime &stamp2)
{
if (stamp1.sec == stamp2.sec) {
if (stamp1.nsec == stamp2.nsec) {
return 0;
}
else if (stamp1.nsec > stamp2.nsec) {
return 1;
}
return -1;
}
else if (stamp1.sec > stamp2.sec) {
return 1;
}
return -1;
}
#endif
#if 0
//
// caServerI::getElapsedTime()
//
caTime caServerI::getElapsedTime (const caTime &stamp)
{
caTime elapsed;
caTime current;
caTime local = stamp;
//
// OS dependent function - see casOSDInLine.h
//
current = caServerI::getTime();
//
// this indicates wrap around
//
if (local.sec>current.sec) {
unsigned long tmp;
tmp = ULONG_MAX - local.sec;
assert (tmp < ULONG_MAX - current.sec);
current.sec += tmp;
local.sec = 0;
}
//
// borrow
//
if (local.nsec > current.nsec) {
assert (current.sec>0);
assert (current.sec>=local.sec);
current.sec--;
assert (2*CAServerNSecInSec < ULONG_MAX);
current.nsec += CAServerNSecInSec;
}
elapsed.sec = current.sec - local.sec;
elapsed.nsec = current.nsec - local.nsec;
return elapsed;
}
#endif
//
// caServerI::advanceBeaconPeriod()
@@ -359,10 +310,10 @@ void casVerifyFunc(const char *pFile, unsigned line, const char *pExp)
//
// serverToolDebugFunc()
//
void serverToolDebugFunc(const char *pFile, unsigned line)
void serverToolDebugFunc(const char *pFile, unsigned line, const char *pComment)
{
fprintf(stderr,
"Bad server tool response detected at line %u in \"%s\"\n",
line, pFile);
"Bad server tool response detected at line %u in \"%s\" because \"%s\"\n",
line, pFile, pComment);
}

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:16 jhill
* ca server installation
*
*
*/
@@ -110,10 +113,10 @@ inline void caServerI::installPV (casPVI &pv)
{
int resLibStatus;
this->lock ();
this->osiLock ();
this->pvCount++;
resLibStatus = this->stringResTbl.add (pv);
this->unlock ();
this->osiUnlock ();
assert (resLibStatus==0);
}
@@ -124,11 +127,11 @@ inline void caServerI::removePV(casPVI &pv)
{
casPVI *pPV;
this->lock();
this->osiLock();
casVerify (this->pvCount>=1u);
this->pvCount--;
pPV = this->stringResTbl.remove (pv);
this->unlock();
this->osiUnlock();
casVerify (pPV!=0);
casVerify (pPV==&pv);
}

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.2 1996/06/26 21:18:50 jhill
* now matches gdd api revisions
*
* Revision 1.1.1.1 1996/06/20 00:28:14 jhill
* ca server installation
*
@@ -45,7 +48,9 @@
// casAsyncIOI::casAsyncIOI()
//
casAsyncIOI::casAsyncIOI(const casCtx &ctx, casAsyncIO &ioIn, gdd *pDD) :
msg(*ctx.getMsg()), client(*ctx.getClient()),
msg(*ctx.getMsg()),
client(*ctx.getClient()),
asyncIO(ioIn),
pChan(ctx.getChannel()),
pDesc(pDD),
completionStatus(S_cas_internal),
@@ -56,10 +61,7 @@ casAsyncIOI::casAsyncIOI(const casCtx &ctx, casAsyncIO &ioIn, gdd *pDD) :
{
assert (&this->client);
assert (&this->msg);
//
// casAsyncIOI must be a base of casAsyncIO
//
assert (this == (casAsyncIOI *)&ioIn);
assert (&this->asyncIO);
if (this->pChan) {
this->pChan->installAsyncIO(*this);

View File

@@ -29,6 +29,12 @@
*
* History
* $Log$
* Revision 1.2 1996/09/04 20:16:24 jhill
* moved operator -> here
*
* Revision 1.1.1.1 1996/06/20 00:28:16 jhill
* ca server installation
*
*
*/
@@ -41,7 +47,7 @@
//
inline void casAsyncIOI::lock()
{
client.lock();
client.osiLock();
}
//
@@ -49,7 +55,15 @@ inline void casAsyncIOI::lock()
//
inline void casAsyncIOI::unlock()
{
client.unlock();
client.osiUnlock();
}
//
// casAsyncIO * casAsyncIOI::operator -> ()
//
inline casAsyncIO * casAsyncIOI::operator -> ()
{
return &this->asyncIO;
}
#endif // casAsyncIOIIL_h

View File

@@ -29,6 +29,12 @@
*
* History
* $Log$
* Revision 1.3 1996/08/13 22:52:31 jhill
* changes for MVC++
*
* Revision 1.2 1996/07/01 19:56:09 jhill
* one last update prior to first release
*
* Revision 1.1.1.1 1996/06/20 00:28:14 jhill
* ca server installation
*
@@ -57,10 +63,10 @@ casChannel::~casChannel()
casPV *casChannel::getPV()
{
casPVI &pvi(this->casChannelI::getPVI());
casPVI *pPVI = &this->casChannelI::getPVI();
if (&pvi!=NULL) {
return pvi.intefaceObjectPointer();
if (pPVI!=NULL) {
return pPVI->interfaceObjectPointer();
}
else {
return NULL;

View File

@@ -29,11 +29,15 @@
*
* History
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:14 jhill
* ca server installation
*
*
*/
#include <server.h>
#include <casEventSysIL.h> // casEventSys inline func
#include <casAsyncIOIIL.h> // casAsyncIOI inline func
#include <casPVIIL.h> // casPVI inline func
@@ -43,14 +47,12 @@
casChannelI::casChannelI(const casCtx &ctx, casChannel &chanAdapter) :
client(* (casStrmClient *) ctx.getClient()),
pv(*ctx.getPV()),
chan(chanAdapter),
cid(ctx.getMsg()->m_cid)
{
assert(&this->client);
assert(&this->pv);
//
// enforce that casChannelI is always a base of casChannel
//
assert(&chanAdapter == (casChannel *) this);
assert(&this->chan);
this->client.installChannel(*this);
}

View File

@@ -29,6 +29,12 @@
*
* History
* $Log$
* Revision 1.3 1996/09/04 20:18:27 jhill
* moved operator -> here
*
* Revision 1.2 1996/07/01 19:56:10 jhill
* one last update prior to first release
*
* Revision 1.1.1.1 1996/06/20 00:28:16 jhill
* ca server installation
*
@@ -39,12 +45,20 @@
#ifndef casChannelIIL_h
#define casChannelIIL_h
//
// casChannelI::operator -> ()
//
inline casChannel * casChannelI::operator -> ()
{
return &this->chan;
}
//
// casChannelI::lock()
//
inline void casChannelI::lock()
{
this->client.lock();
this->client.osiLock();
}
//
@@ -52,7 +66,7 @@ inline void casChannelI::lock()
//
inline void casChannelI::unlock()
{
this->client.unlock();
this->client.osiUnlock();
}
//
@@ -162,5 +176,6 @@ inline const caResId casChannelI::getSID()
return this->uintId::getId();
}
#endif // casChannelIIL_h

View File

@@ -29,6 +29,12 @@
*
* History
* $Log$
* Revision 1.3 1996/08/13 22:56:13 jhill
* added init for mutex class
*
* Revision 1.2 1996/07/09 22:54:31 jhill
* store msg copy in the ctx
*
* Revision 1.1.1.1 1996/06/20 00:28:14 jhill
* ca server installation
*
@@ -38,6 +44,7 @@
#include <server.h>
#include <casClientIL.h> // inline func for casClient
#include <db_access.h>
VERSIONID(camsgtaskc,"%W% %G%")
@@ -87,6 +94,10 @@ caStatus casClient::init()
if (status) {
return status;
}
status = this->casCoreClient::init();
if (status) {
return status;
}
serverDebugLevel = this->ctx.getServer()->getDebugLevel();
if (serverDebugLevel>0u) {

View File

@@ -29,6 +29,12 @@
*
* History
* $Log$
* Revision 1.2 1996/08/13 22:53:14 jhill
* changes for MVC++
*
* Revision 1.1.1.1 1996/06/20 00:28:16 jhill
* ca server installation
*
*
*/
@@ -104,6 +110,8 @@ casCoreClient::~casCoreClient()
ca_printf ("CAS: Connection Terminated\n");
}
this->osiLock();
//
// cancel any pending asynchronous IO
//
@@ -117,6 +125,8 @@ casCoreClient::~casCoreClient()
delete pCurIO;
pCurIO = pNextIO;
}
this->osiUnlock();
}
//
@@ -219,7 +229,7 @@ caStatus casCoreClient::asyncIOCompletion(casChannelI *pChan,
pAsyncIoCallBack pCB;
pCB = casCoreClient::asyncIOJumpTable[msg.m_cmmd];
if (!pCB) {
if (pCB==NULL) {
return S_casApp_noSupport;
}

View File

@@ -29,6 +29,18 @@
*
* History
* $Log$
* Revision 1.5 1996/09/04 20:19:47 jhill
* added missing byte swap on search reply port no
*
* Revision 1.4 1996/08/13 22:54:20 jhill
* fixed little endian problem
*
* Revision 1.3 1996/08/05 19:26:15 jhill
* made os specific code smaller
*
* Revision 1.2 1996/06/26 21:18:52 jhill
* now matches gdd api revisions
*
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
* ca server installation
*
@@ -89,8 +101,7 @@ caStatus casDGClient::searchAction()
// longest PV name then just ignore this request
// (and let the client to try again later)
//
// set correct appl type here !!!!
pCanonicalName = new gddAtomic(0u, aitEnumString, 1u);
pCanonicalName = new gddScalar(gddAppType_name, aitEnumString);
if (!pCanonicalName) {
return S_cas_success;
}
@@ -290,3 +301,54 @@ void casDGClient::ioBlockedSignal()
//
}
//
// casDGClient::process()
//
void casDGClient::process()
{
caStatus status;
casFlushCondition flushCond;
casFillCondition fillCond;
//
// force all replies to be sent to the client
// that made the request
//
this->inBuf::clear();
this->outBuf::clear();
//
// read in new input
//
fillCond = this->fill();
if (fillCond == casFillDisconnect) {
casVerify(0);
}
//
// verify that we have a message to process
//
else if (this->inBuf::bytesPresent()>0u) {
//
// process the message
//
status = this->processMsg();
if (status) {
errMessage (status,
"unexpected error processing stateless protocol");
}
//
// force all replies to go to the sender
//
flushCond = this->flush();
if (flushCond!=casFlushCompleted) {
casVerify(0);
}
}
//
// clear the input/output buffers so replies
// are always sent to the sender of the request
//
this->inBuf::clear();
this->outBuf::clear();
}

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:16 jhill
* ca server installation
*
*
*/
@@ -91,7 +94,7 @@ inline casEventMask casEventRegistry::maskAllocator()
{
casEventMask evMask;
if (this->allocator>=CHAR_BIT*sizeof(casEventMask::mask)) {
if (this->allocator>=CHAR_BIT*sizeof(evMask.mask)) {
return evMask;
}
evMask.mask = 1u<<(this->allocator++);

View File

@@ -29,6 +29,12 @@
*
* History
* $Log$
* Revision 1.2 1996/07/24 22:00:49 jhill
* added pushOnToEventQueue()
*
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
* ca server installation
*
*
*/
@@ -76,16 +82,18 @@ casEventSys::~casEventSys()
{
casEvent *pE;
this->mutex.lock();
/*
* They must cancel all active event blocks first
* all active event blocks must be canceled first
*/
assert (this->numEventBlocks==0);
this->mutex.osiLock();
while ( (pE = this->eventLogQue.get()) ) {
delete pE;
}
this->mutex.osiUnlock();
}
@@ -94,10 +102,10 @@ casEventSys::~casEventSys()
//
void casEventSys::installMonitor()
{
this->mutex.lock();
this->mutex.osiLock();
this->numEventBlocks++;
this->maxLogEntries += averageEventEntries;
this->mutex.unlock();
this->mutex.osiUnlock();
}
//
@@ -105,11 +113,11 @@ void casEventSys::installMonitor()
//
void casEventSys::removeMonitor()
{
this->mutex.lock();
this->mutex.osiLock();
assert (this->numEventBlocks>=1u);
this->numEventBlocks--;
this->maxLogEntries -= averageEventEntries;
this->mutex.unlock();
this->mutex.osiUnlock();
}
@@ -123,7 +131,7 @@ casProcCond casEventSys::process()
casProcCond cond = casProcOk;
unsigned long nAccepted = 0u;
this->mutex.lock();
this->mutex.osiLock();
while ( (pEvent = this->eventLogQue.get()) ) {
@@ -140,7 +148,7 @@ casProcCond casEventSys::process()
* not accepted so return to the head of the list
* (we will try again later)
*/
this->insertEventQueue(*pEvent);
this->pushOnToEventQueue(*pEvent);
cond = casProcOk;
break;
}
@@ -163,7 +171,7 @@ casProcCond casEventSys::process()
this->coreClient.eventFlush();
}
this->mutex.unlock();
this->mutex.osiUnlock();
return cond;
}

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:16 jhill
* ca server installation
*
*
*/
@@ -41,9 +44,9 @@
//
inline void casEventSys::addToEventQueue(casEvent &event)
{
this->mutex.lock();
this->mutex.osiLock();
this->eventLogQue.add(event);
this->mutex.unlock();
this->mutex.osiUnlock();
//
// wakes up the event queue consumer
//

View File

@@ -29,6 +29,12 @@
*
* History
* $Log$
* Revision 1.6 1996/09/04 20:21:41 jhill
* removed operator -> and added member pv
*
* Revision 1.5 1996/07/01 19:56:11 jhill
* one last update prior to first release
*
* Revision 1.4 1996/06/26 23:32:17 jhill
* changed where caProto.h comes from (again)
*
@@ -125,7 +131,7 @@ inline ioBlockedList::~ioBlockedList ()
// ioBlockedList::signal ()
//
// works from a temporary list to avoid problems
// where the virtual function adds ites to the
// where the virtual function adds items to the
// list
//
inline void ioBlockedList::signal ()
@@ -353,14 +359,7 @@ public:
caServer *getCAS();
//
// casAsyncIOI must always be a base for casAsyncIO
// (the constructor assert fails if this isnt the case)
//
casAsyncIO * operator -> ()
{
return (casAsyncIO *) this;
}
inline casAsyncIO * operator -> ();
void setServerDelete()
{
@@ -393,6 +392,7 @@ private:
caHdr const msg;
casCoreClient &client;
casAsyncIO &asyncIO;
casChannelI *pChan; // optional
gdd *pDesc; // optional
caStatus completionStatus;
@@ -461,24 +461,19 @@ public:
return casChanT;
}
//
// casChannelI must always be a base for casPV
// (the constructor assert fails if this isnt the case)
//
casChannel * operator -> ()
{
return (casChannel *) this;
}
inline void lock();
inline void unlock();
inline void clientDestroy();
inline casChannel * operator -> ();
protected:
tsDLList<casMonitor> monitorList;
tsDLList<casAsyncIOI> ioInProgList;
casCoreClient &client;
casPVI &pv;
casChannel &chan;
caResId const cid; // client id
unsigned clientDestroyPending:1;
};
@@ -493,7 +488,6 @@ public:
inline ~casPVListChan();
};
class caServer;
class caServerI;
class casCtx;
class casChannel;
@@ -509,7 +503,7 @@ public:
// The PV name here must be the canonical and unique name
// for the PV in this system
//
casPVI (caServerI &cas, const char * const pName, casPV &pvAdapter);
casPVI (caServerI &cas, const char * const pNameIn, casPV &pvAdapter);
~casPVI();
//
@@ -556,23 +550,12 @@ public:
inline void postEvent (const casEventMask &select, gdd &event);
casPV *intefaceObjectPointer() const
{
return (casPV *) this;
}
inline casPV *interfaceObjectPointer() const;
//
// casPVI must always be a base for casPV
// (the constructor assert fails if this isnt the case)
//
casPV * operator -> () const
{
return intefaceObjectPointer();
}
inline casPV * operator -> () const;
caServer *getExtServer();
//
// bestDBRType()
//
@@ -580,12 +563,14 @@ public:
inline aitBool okToBeginNewIO() const;
inline void lock();
inline void unlock();
private:
tsDLList<casPVListChan> chanList;
caServerI &cas;
casPV &pv;
unsigned nMonAttached;
unsigned nIOAttached;
inline void lock();
inline void unlock();
};

View File

@@ -29,6 +29,12 @@
*
* History
* $Log$
* Revision 1.4 1996/07/24 22:00:49 jhill
* added pushOnToEventQueue()
*
* Revision 1.3 1996/07/01 19:56:11 jhill
* one last update prior to first release
*
* Revision 1.2 1996/06/26 21:18:56 jhill
* now matches gdd api revisions
*
@@ -79,7 +85,7 @@ casMonitor::~casMonitor()
{
casCoreClient &client = this->ciu.getClient();
this->mutex.lock();
this->mutex.osiLock();
this->disable();
@@ -94,6 +100,8 @@ casMonitor::~casMonitor()
this->pModifiedValue = NULL;
}
this->ciu.deleteMonitor(*this);
this->mutex.osiUnlock();
}
//
@@ -103,24 +111,16 @@ void casMonitor::enable()
{
caStatus status;
this->mutex.lock();
if (this->enabled) {
this->mutex.unlock();
return;
this->mutex.osiLock();
if (!this->enabled && this->ciu->readAccess()) {
this->enabled = TRUE;
status = this->ciu.getPVI().registerEvent();
if (status) {
errMessage(status,
"Server tool failed to register event\n");
}
}
if (!this->ciu->readAccess()) {
this->mutex.unlock();
return;
}
this->enabled = TRUE;
status = this->ciu.getPVI().registerEvent();
if (status) {
errMessage(status,
"Server tool failed to register event\n");
}
this->mutex.unlock();
this->mutex.osiUnlock();
}
//
@@ -128,14 +128,12 @@ void casMonitor::enable()
//
void casMonitor::disable()
{
this->mutex.lock();
if (!this->enabled) {
this->mutex.unlock();
return;
this->mutex.osiLock();
if (this->enabled) {
this->enabled = FALSE;
this->ciu.getPVI().unregisterEvent();
}
this->enabled = FALSE;
this->ciu.getPVI().unregisterEvent();
this->mutex.unlock();
this->mutex.osiUnlock();
}
//
@@ -147,7 +145,7 @@ void casMonitor::push(gdd &newValue)
casMonEvent *pLog = NULL;
char full;
this->mutex.lock();
this->mutex.osiLock();
//
// get a new block if we havent exceeded quotas
@@ -177,7 +175,7 @@ void casMonitor::push(gdd &newValue)
pLog->assign(*this, pValue);
gddStatus = pValue->unreference();
assert(!gddStatus);
client.insertEventQueue(*pLog, &this->overFlowEvent);
client.insertEventQueue(*pLog, this->overFlowEvent);
}
else {
//
@@ -202,7 +200,7 @@ void casMonitor::push(gdd &newValue)
client.addToEventQueue(*pLog);
this->mutex.unlock();
this->mutex.osiUnlock();
}
//
@@ -216,7 +214,7 @@ caStatus casMonitor::executeEvent(casMonEvent *pEV)
pVal = pEV->getValue ();
assert (pVal);
this->mutex.lock();
this->mutex.osiLock();
if (this->ciu.getClient().getEventsOff()==aitFalse) {
status = this->callBack (*pVal);
}
@@ -233,7 +231,7 @@ caStatus casMonitor::executeEvent(casMonEvent *pEV)
this->pModifiedValue = pVal;
status = S_cas_success;
}
this->mutex.unlock();
this->mutex.osiUnlock();
//
// if the event isnt accepted we will try
@@ -282,12 +280,12 @@ void casMonitor::show(unsigned level)
//
void casMonitor::postIfModified()
{
this->mutex.lock();
this->mutex.osiLock();
if (this->pModifiedValue) {
this->callBack (*this->pModifiedValue);
this->pModifiedValue->unreference ();
this->pModifiedValue = NULL;
}
this->mutex.unlock();
this->mutex.osiUnlock();
}

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
* ca server installation
*
*
*/
@@ -39,8 +42,9 @@
casMsgIO::casMsgIO()
{
elapsedAtLastSend = this->elapsedAtLastRecv
this->elapsedAtLastSend = this->elapsedAtLastRecv
= osiTime::getCurrent ();
this->blockingStatus = xIsBlocking;
}
casMsgIO::~casMsgIO()
@@ -81,15 +85,41 @@ xRecvStatus casMsgIO::xRecv(char *pBuf, bufSizeT nBytes, bufSizeT &nActualBytes)
return stat;
}
xSendStatus casMsgIO::xSend(char *pBuf, bufSizeT nBytes, bufSizeT &nActualBytes)
xSendStatus casMsgIO::xSend(char *pBuf, bufSizeT nBytesAvailableToSend,
bufSizeT nBytesNeedToBeSent, bufSizeT &nActualBytes)
{
xSendStatus stat;
bufSizeT nActualBytesDelta;
stat = this->osdSend(pBuf, nBytes, nActualBytes);
if (stat == xSendOK) {
this->elapsedAtLastSend = osiTime::getCurrent();
assert (nBytesAvailableToSend>=nBytesNeedToBeSent);
nActualBytes = 0u;
if (this->blockingStatus == xIsntBlocking) {
stat = this->osdSend(pBuf, nBytesAvailableToSend,
nActualBytes);
if (stat == xSendOK) {
this->elapsedAtLastSend = osiTime::getCurrent();
}
return stat;
}
return stat;
while (nBytesNeedToBeSent) {
stat = this->osdSend(pBuf, nBytesAvailableToSend,
nActualBytesDelta);
if (stat != xSendOK) {
return stat;
}
this->elapsedAtLastSend = osiTime::getCurrent();
nActualBytes += nActualBytesDelta;
if (nBytesNeedToBeSent>nActualBytesDelta) {
nBytesNeedToBeSent -= nActualBytesDelta;
}
else {
break;
}
}
return xSendOK;
}
void casMsgIO::sendBeacon(char & /*msg*/, bufSizeT /*length*/,
@@ -103,9 +133,9 @@ int casMsgIO::getFileDescriptor() const
return -1; // some os will not have file descriptors
}
void casMsgIO::setNonBlocking()
void casMsgIO::xSetNonBlocking()
{
printf("virtual base setNonBlocking() called?\n");
printf("virtual base casMsgIO::xSetNonBlocking() called?\n");
}
bufSizeT casMsgIO::incommingBytesPresent() const

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.3 1996/07/01 19:56:13 jhill
* one last update prior to first release
*
* Revision 1.2 1996/06/26 21:18:57 jhill
* now matches gdd api revisions
*
@@ -49,16 +52,14 @@
//
casPVI::casPVI(caServerI &casIn, const char * const pNameIn,
casPV &pvAdapterIn) :
cas(casIn),
stringId(pNameIn),
cas(casIn),
pv(pvAdapterIn),
nMonAttached(0u),
nIOAttached(0u)
{
assert(&cas);
//
// casPVI must always be a base of casPV
//
assert(&pvAdapterIn == (casPV *)this);
assert(&this->cas);
assert(&this->pv);
this->cas.installPV(*this);
}
@@ -108,22 +109,22 @@ caStatus casPVI::verifyPVName(gdd &name)
//
gddStatus = name.reference();
if (gddStatus) {
serverToolDebug();
serverToolDebug("GDD PV name must not be \"no ref\"");
return S_cas_badPVName;
}
gddStatus = name.unreference();
if (gddStatus) {
serverToolDebug();
serverToolDebug("corruption expected");
return S_cas_badPVName;
}
if (name.primitiveType() != aitEnumString) {
serverToolDebug();
serverToolDebug("GDD PV name must be stored as an aitString");
return S_cas_badPVName;
}
if (name.dimension() != 1u) {
serverToolDebug();
if (name.dimension() != 0u) {
serverToolDebug("GDD Dimension must be zero (gddScaler)");
return S_cas_badPVName;
}

View File

@@ -29,6 +29,12 @@
*
* History
* $Log$
* Revision 1.5 1996/09/04 20:23:59 jhill
* added operator ->
*
* Revision 1.4 1996/07/01 19:56:13 jhill
* one last update prior to first release
*
* Revision 1.3 1996/06/26 21:18:58 jhill
* now matches gdd api revisions
*
@@ -47,12 +53,38 @@
#include <dbMapper.h>
//
// casPVI::interfaceObjectPointer()
//
// casPVI must always be a base for casPV
// (the constructor assert fails if this isnt the case)
//
inline casPV *casPVI::interfaceObjectPointer() const
{
return &this->pv;
}
//
// casPVI::operator -> ()
//
casPV * casPVI::operator -> () const
{
return interfaceObjectPointer();
}
//
// casPVI::lock()
//
inline void casPVI::lock()
{
this->cas.lock();
//
// NOTE:
// if this lock becomes something else besides the
// server's lock then look carefully at the
// comment in casPVI::deleteSignal()
//
this->cas.osiLock();
}
//
@@ -60,7 +92,7 @@ inline void casPVI::lock()
//
inline void casPVI::unlock()
{
this->cas.unlock();
this->cas.osiUnlock();
}
//
@@ -88,8 +120,7 @@ inline void casPVI::removeChannel(casPVListChan &chan)
//
inline aitBool casPVI::okToBeginNewIO() const
{
if (this->nIOAttached >= (*this)->maxSimultAsyncOps())
{
if (this->nIOAttached >= (*this)->maxSimultAsyncOps()) {
return aitFalse;
}
else {
@@ -126,13 +157,29 @@ inline void casPVI::unregisterIO()
//
inline void casPVI::deleteSignal()
{
this->lock();
caServerI &localCASRef(this->cas);
//
// We dont take the PV lock here because
// the PV may be destroyed and we must
// keep the lock unlock pairs consistent
// (because the PV's lock is really a ref
// to the server's lock)
//
// This is safe to do because we take the PV
// lock when we add a new channel (and the
// PV lock is realy the server's lock)
//
localCASRef.osiLock();
if (this->chanList.count()==0u) {
(*this)->destroy();
//
// !! dont access self after destroy !!
//
}
else {
this->unlock();
}
localCASRef.osiUnlock();
}
//
@@ -178,7 +225,6 @@ inline void casPVI::postEvent (const casEventMask &select, gdd &event)
}
}
#endif // casPVIIL_h

View File

@@ -29,6 +29,19 @@
*
* History
* $Log$
* Revision 1.9 1996/09/04 20:25:53 jhill
* use correct app type for exist test gdd, correct byte
* oder for mon mask, and efficient use of PV name gdd
*
* Revision 1.8 1996/08/05 23:22:57 jhill
* gddScaler => gddScalar
*
* Revision 1.7 1996/08/05 19:26:51 jhill
* doc
*
* Revision 1.5 1996/07/09 22:53:33 jhill
* init stat and sev in gdd
*
* Revision 1.4 1996/07/01 19:56:14 jhill
* one last update prior to first release
*
@@ -110,8 +123,7 @@ inline caStatus casStrmClient::createChannel (const char *pName)
int gddStatus;
gdd *pCanonicalName;
// set correct appl type here !!!!
pCanonicalName = new gddAtomic(0u, aitEnumString, 1u);
pCanonicalName = new gddScalar(gddAppType_name, aitEnumString);
if (!pCanonicalName) {
return S_cas_noMemory;
}
@@ -206,7 +218,7 @@ casStrmClient::~casStrmClient()
delete [] this->pHostName;
}
this->lock();
this->osiLock();
//
// delete all channel attached
@@ -220,6 +232,10 @@ casStrmClient::~casStrmClient()
pChan->clientDestroy();
pChan = pNextChan;
}
delete &this->msgIO;
this->osiUnlock();
}
//
@@ -804,7 +820,7 @@ caStatus casStrmClient::hostNameAction()
size-1);
pMalloc[size-1]='\0';
this->lock();
this->osiLock();
if (this->pHostName) {
delete [] this->pHostName;
@@ -815,7 +831,7 @@ caStatus casStrmClient::hostNameAction()
(*pciu)->setOwner(this->pUserName, this->pHostName);
}
this->unlock();
this->osiUnlock();
return S_cas_success;
}
@@ -849,7 +865,7 @@ caStatus casStrmClient::clientNameAction()
size-1);
pMalloc[size-1]='\0';
this->lock();
this->osiLock();
if (this->pUserName) {
delete [] this->pUserName;
}
@@ -858,7 +874,7 @@ caStatus casStrmClient::clientNameAction()
while ( (pciu = iter()) ) {
(*pciu)->setOwner(this->pUserName, this->pHostName);
}
this->unlock();
this->osiUnlock();
return S_cas_success;
}
@@ -1007,11 +1023,11 @@ caStatus casStrmClient::eventsOnAction ()
// perhaps this is to slow - perhaps there
// should be a queue of modified events
//
this->lock();
this->osiLock();
while ( (pciu = iter()) ) {
pciu->postAllModifiedEvents();
}
this->unlock();
this->osiUnlock();
return S_cas_success;
}
@@ -1052,6 +1068,11 @@ caStatus casStrmClient::eventAddAction ()
return S_cas_success;
}
//
// place monitor mask in correct byte order
//
pMonInfo->m_mask = ntohs (pMonInfo->m_mask);
if (pMonInfo->m_mask&DBE_VALUE) {
mask |= this->getCAS().getAdapter()->valueEventMask;
}
@@ -1346,7 +1367,7 @@ caStatus casStrmClient::write()
status = this->writeArrayData();
}
else {
status = this->writeScalerData();
status = this->writeScalarData();
}
(*pPV)->endTransaction();
@@ -1356,9 +1377,9 @@ caStatus casStrmClient::write()
//
// casStrmClient::writeScalerData()
// casStrmClient::writeScalarData()
//
caStatus casStrmClient::writeScalerData()
caStatus casStrmClient::writeScalarData()
{
gdd *pDD;
const caHdr *pHdr = this->ctx.getMsg();
@@ -1371,7 +1392,7 @@ caStatus casStrmClient::writeScalerData()
return S_cas_badType;
}
pDD = new gddScaler (gddAppType_value, type);
pDD = new gddScalar (gddAppType_value, type);
if (!pDD) {
return S_cas_noMemory;
}
@@ -1560,15 +1581,15 @@ caStatus createDBRDD (unsigned dbrType, aitIndex dbrCount, gdd *&pDescRet)
pVal = pCont->getDD(valIndex);
assert (pVal);
gddStatus = pVal->setBound (0, 0u, dbrCount);
assert (gddStatus==0)
assert (gddStatus==0);
}
else if (pDescRet->isAtomic()) {
gddAtomic *pAtomic = (gddAtomic *) pDescRet;
gddStatus = pAtomic->setBound(0, 0u, dbrCount);
assert (gddStatus==0)
assert (gddStatus==0);
}
else {
assert(dbrCount==1u);
assert (dbrCount==1u);
}
}
@@ -1626,13 +1647,13 @@ caStatus casStrmClient::createChanResponse(casChannelI *,
// prevent problems such as the PV being deleted before the
// channel references it
//
this->lock();
this->osiLock();
pCanonicalName->markConstant();
pPV = this->ctx.getServer()->createPV(*pCanonicalName);
if (!pPV) {
this->unlock();
this->osiUnlock();
return this->channelCreateFailed(&msg, S_cas_noMemory);
}
@@ -1643,12 +1664,12 @@ caStatus casStrmClient::createChanResponse(casChannelI *,
pChan = (*pPV)->createChannel(this->ctx,
this->pUserName, this->pHostName);
if (!pChan) {
this->unlock();
this->osiUnlock();
pPV->deleteSignal();
return this->channelCreateFailed(&msg, S_cas_noMemory);
}
this->unlock();
this->osiUnlock();
pChanI = (casChannelI *) pChan;
@@ -1677,6 +1698,7 @@ casPVI *caServerI::createPV (gdd &name)
{
casPVI *pPVI;
caStatus status;
aitString *pNameStr;
//
// dont proceed unless its a valid PV name
@@ -1694,15 +1716,15 @@ casPVI *caServerI::createPV (gdd &name)
// way currently to test) it will prove fatal
// to the server
//
aitString aitStr(name);
stringId id (aitStr.string());
name.getRef(pNameStr);
stringId id (pNameStr->string());
this->lock ();
this->osiLock ();
pPVI = this->stringResTbl.lookup (id);
if (!pPVI) {
casPV *pPV;
pPV = (*this)->createPV (this->ctx, aitStr.string());
pPV = (*this)->createPV (this->ctx, pNameStr->string());
if (pPV) {
pPVI = (casPVI *) pPV;
}
@@ -1712,7 +1734,7 @@ casPVI *caServerI::createPV (gdd &name)
// lock shouldnt be released until we finish creating and
// installing the PV
//
this->unlock ();
this->osiUnlock ();
return pPVI;
}
@@ -1730,10 +1752,10 @@ inline aitBool caServerI::roomForNewChannel() const
//
void casStrmClient::installChannel(casChannelI &chan)
{
this->lock();
this->osiLock();
this->getCAS().installItem(chan);
this->chanList.add(chan);
this->unlock();
this->osiUnlock();
}
//
@@ -1743,10 +1765,10 @@ void casStrmClient::removeChannel(casChannelI &chan)
{
casRes *pRes;
this->lock();
this->osiLock();
pRes = this->getCAS().removeItem(chan);
assert (&chan == (casChannelI *)pRes);
this->chanList.remove(chan);
this->unlock();
this->osiUnlock();
}

View File

@@ -30,6 +30,12 @@
* Modification Log:
* -----------------
* $Log$
* Revision 1.5 1996/08/13 22:54:42 jhill
* doc
*
* Revision 1.4 1996/07/01 19:56:15 jhill
* one last update prior to first release
*
* Revision 1.3 1996/06/26 23:08:55 jhill
* took path out of casInternal.h include
*
@@ -249,6 +255,8 @@ public:
}
};
class caServerI;
//
// caServer - Channel Access Server API Class
//
@@ -268,10 +276,6 @@ public:
unsigned maxSimultaneousIO=1u);
virtual ~caServer();
//
// Need VF that returns pointer to derived type ?
//
//caStatus enableClients ();
//caStatus disableClients ();
@@ -477,6 +481,10 @@ public:
casChannel(const casCtx &ctx);
virtual ~casChannel();
//
// Called when the user name and the host name are changed
// for a live connection.
//
virtual void setOwner(const char * const pUserName,
const char * const pHostName);
@@ -535,5 +543,5 @@ public:
casPV *getPV();
};
#endif /* ifdef includecasdefh (this must be the last line in this file) */
#endif // ifdef includecasdefh (this must be the last line in this file)

View File

@@ -29,6 +29,15 @@
*
* History
* $Log$
* Revision 1.3 1996/09/04 20:27:01 jhill
* doccasdef.h
*
* Revision 1.2 1996/08/13 22:53:59 jhill
* fixed little endian problem
*
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
* ca server installation
*
*
*/
@@ -41,13 +50,12 @@
//
outBuf::outBuf(casMsgIO &virtualCircuit, osiMutex &mutexIn) :
io(virtualCircuit),
mutex(mutexIn)
mutex(mutexIn),
pBuf(NULL),
bufSize(io.optimumBufferSize()),
stack(0u)
{
assert(&io);
this->stack = 0u;
this->bufSize = 0u;
this->pBuf = NULL;
}
//
@@ -55,10 +63,8 @@ outBuf::outBuf(casMsgIO &virtualCircuit, osiMutex &mutexIn) :
//
caStatus outBuf::init()
{
this->bufSize = io.optimumBufferSize();
this->pBuf = new char [this->bufSize];
if (!this->pBuf) {
this->bufSize = 0u;
return S_cas_noMemory;
}
return S_cas_success;
@@ -88,30 +94,32 @@ caHdr **ppMsg
)
{
bufSizeT msgsize;
bufSizeT stackNeeded;
extsize = CA_MESSAGE_ALIGN(extsize);
msgsize = extsize + sizeof(caHdr);
if (msgsize>this->bufSize) {
if (msgsize>this->bufSize || this->pBuf==NULL) {
return S_cas_hugeRequest;
}
stackNeeded = this->bufSize - msgsize;
this->mutex.lock();
this->mutex.osiLock();
if (this->stack + msgsize > this->bufSize) {
if (this->stack > stackNeeded) {
/*
* Try to flush the output queue
*/
this->flush();
this->flush(casFlushSpecified, msgsize);
/*
* If this failed then the fd is nonblocking
* and we will let select() take care of it
*/
if (this->stack + msgsize > this->bufSize) {
this->mutex.unlock();
if (this->stack > stackNeeded) {
this->mutex.osiUnlock();
this->sendBlockSignal();
return S_cas_sendBlocked;
}
@@ -133,16 +141,12 @@ caHdr **ppMsg
void outBuf::commitMsg ()
{
caHdr *mp;
bufSizeT size;
bufSizeT extSize;
bufSizeT diff;
assert (this->bufSize);
mp = (caHdr *) &this->pBuf[this->stack];
extSize = CA_MESSAGE_ALIGN(mp->m_postsize);
assert((extSize&0x7)==0);
//
// Guarantee that all portions of outgoing messages
@@ -173,51 +177,77 @@ assert((extSize&0x7)==0);
*/
mp->m_cmmd = htons (mp->m_cmmd);
mp->m_postsize = htons (mp->m_postsize);
mp->m_type = htons (mp->m_type);
mp->m_count = htons (mp->m_count);
mp->m_cid = htonl (mp->m_cid);
mp->m_available = htonl (mp->m_available);
size = sizeof(caHdr) + mp->m_postsize;
this->stack += size;
this->stack += sizeof(caHdr) + extSize;
assert (this->stack <= this->bufSize);
this->mutex.unlock();
this->mutex.osiUnlock();
}
//
// outBuf::flush()
//
casFlushCondition outBuf::flush()
casFlushCondition outBuf::flush(casFlushRequest req,
bufSizeT spaceRequired)
{
bufSizeT nBytes;
xSendStatus stat;
bufSizeT nBytes;
bufSizeT stackNeeded;
bufSizeT nBytesNeeded;
xSendStatus stat;
casFlushCondition cond;
if (this->stack<=0u) {
return casFlushCompleted;
}
stat = this->io.xSend(this->pBuf, this->stack, nBytes);
if (stat!=xSendOK) {
if (!this->pBuf) {
return casFlushDisconnect;
}
else if (nBytes >= this->stack) {
this->stack=0u;
return casFlushCompleted;
}
else if (nBytes) {
bufSizeT len;
len = this->stack-nBytes;
//
// memmove() is ok with overlapping buffers
//
memmove (this->pBuf, &this->pBuf[nBytes], len);
this->stack = len;
return casFlushPartial;
this->mutex.osiLock();
if (req==casFlushAll) {
nBytesNeeded = this->stack;
}
else {
return casFlushNone;
stackNeeded = this->bufSize - spaceRequired;
if (this->stack>stackNeeded) {
nBytesNeeded = this->stack - stackNeeded;
}
else {
nBytesNeeded = 0u;
}
}
stat = this->io.xSend(this->pBuf, this->stack,
nBytesNeeded, nBytes);
if (nBytes) {
bufSizeT len;
if (nBytes >= this->stack) {
this->stack=0u;
cond = casFlushCompleted;
}
else {
len = this->stack-nBytes;
//
// memmove() is ok with overlapping buffers
//
memmove (this->pBuf, &this->pBuf[nBytes], len);
this->stack = len;
cond = casFlushPartial;
}
}
else {
cond = casFlushNone;
}
if (stat!=xSendOK) {
cond = casFlushDisconnect;
}
this->mutex.osiUnlock();
return cond;
}
//

View File

@@ -29,6 +29,24 @@
*
* History
* $Log$
* Revision 1.10 1996/09/04 20:27:02 jhill
* doccasdef.h
*
* Revision 1.9 1996/08/13 22:56:14 jhill
* added init for mutex class
*
* Revision 1.8 1996/08/05 23:22:58 jhill
* gddScaler => gddScalar
*
* Revision 1.7 1996/08/05 19:27:28 jhill
* added process()
*
* Revision 1.5 1996/07/24 22:00:50 jhill
* added pushOnToEventQueue()
*
* Revision 1.4 1996/07/09 22:51:14 jhill
* store copy of msg in ctx
*
* Revision 1.3 1996/06/26 21:19:04 jhill
* now matches gdd api revisions
*
@@ -63,21 +81,13 @@ HDRVERSIONID(serverh, "%W% %G%")
//
// ANSI C
//
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#include <limits.h>
//
// EPICS
//
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
#include <epicsAssert.h>
#include <db_access.h>
//
// CA
@@ -87,20 +97,13 @@ HDRVERSIONID(serverh, "%W% %G%")
#include <casdef.h>
#include <osiTime.h>
//
// gdd
//
#if 0
#include <dbMapper.h>
#include <gddApps.h>
#endif
//
// CAS
//
void casVerifyFunc(const char *pFile, unsigned line, const char *pExp);
void serverToolDebugFunc(const char *pFile, unsigned line);
#define serverToolDebug() {serverToolDebugFunc(__FILE__, __LINE__); }
void serverToolDebugFunc(const char *pFile, unsigned line, const char *pComment);
#define serverToolDebug(COMMENT) \
{serverToolDebugFunc(__FILE__, __LINE__, COMMENT); }
#define casVerify(EXP) {if ((EXP)==0) casVerifyFunc(__FILE__, __LINE__, #EXP); }
caStatus createDBRDD(unsigned dbrType, aitIndex dbrCount, gdd *&pDescRet);
caStatus copyBetweenDD(gdd &dest, gdd &src);
@@ -110,6 +113,7 @@ caStatus copyBetweenDD(gdd &dest, gdd &src);
//
enum xRecvStatus {xRecvOK, xRecvDisconnect};
enum xSendStatus {xSendOK, xSendDisconnect};
enum xBlockingStatus {xIsBlocking, xIsntBlocking};
enum casIOState {casOnLine, casOffLine};
typedef unsigned bufSizeT;
class casMsgIO {
@@ -129,8 +133,8 @@ public:
//
// device dependent recv
//
xSendStatus xSend (char *pBuf, bufSizeT nBytesToSend,
bufSizeT &nBytesSent);
xSendStatus xSend (char *pBuf, bufSizeT nBytesAvailableToSend,
bufSizeT nBytesNeedToBeSent, bufSizeT &nBytesSent);
xRecvStatus xRecv (char *pBuf, bufSizeT nBytesToRecv,
bufSizeT &nByesRecv);
@@ -140,7 +144,11 @@ public:
virtual casIOState state() const=0;
virtual void hostNameFromAddr (char *pBuf, unsigned bufSize)=0;
virtual int getFileDescriptor() const;
virtual void setNonBlocking();
void setNonBlocking()
{
this->xSetNonBlocking();
this->blockingStatus = xIsntBlocking;
}
//
// only for use with DG io
@@ -154,16 +162,18 @@ private:
//
osiTime elapsedAtLastSend;
osiTime elapsedAtLastRecv;
xBlockingStatus blockingStatus;
virtual xSendStatus osdSend (const char *pBuf,
bufSizeT nBytesReq, bufSizeT &nBytesActual) =0;
virtual xRecvStatus osdRecv (char *pBuf,
bufSizeT nBytesReq, bufSizeT &nBytesActual) =0;
virtual void osdShow (unsigned level) const = 0;
virtual void xSetNonBlocking();
};
#include <casIOD.h> // IO dependent
#include <casOSD.h> // OS dependent
#include <casIOD.h> // IO dependent
enum casProcCond {casProcOk, casProcDisconnect};
@@ -200,6 +210,13 @@ public:
eventsOff(aitFalse)
{
}
init()
{
if (mutex.init()) {
return S_cas_noMemory;
}
return S_cas_success;
}
~casEventSys();
void show(unsigned level);
@@ -212,7 +229,9 @@ public:
void removeFromEventQueue(casEvent &);
inline void addToEventQueue(casEvent &);
void insertEventQueue(casEvent &insert, casEvent *pPrev=NULL);
void insertEventQueue(casEvent &insert, casEvent &prevEvent);
void pushOnToEventQueue(casEvent &event);
aitBool full();
@@ -249,11 +268,21 @@ private:
//
// casEventSys::insertEventQueue()
//
inline void casEventSys::insertEventQueue(casEvent &insert, casEvent *pPrevEvent)
inline void casEventSys::insertEventQueue(casEvent &insert, casEvent &prevEvent)
{
this->mutex.lock();
this->eventLogQue.insert(insert, pPrevEvent);
this->mutex.unlock();
this->mutex.osiLock();
this->eventLogQue.insertAfter(insert, prevEvent);
this->mutex.osiUnlock();
}
//
// casEventSys::pushOnToEventQueue()
//
inline void casEventSys::pushOnToEventQueue(casEvent &event)
{
this->mutex.osiLock();
this->eventLogQue.push(event);
this->mutex.osiUnlock();
}
//
@@ -261,9 +290,9 @@ inline void casEventSys::insertEventQueue(casEvent &insert, casEvent *pPrevEvent
//
inline void casEventSys::removeFromEventQueue(casEvent &event)
{
this->mutex.lock();
this->mutex.osiLock();
this->eventLogQue.remove(event);
this->mutex.unlock();
this->mutex.osiUnlock();
}
//
@@ -303,11 +332,6 @@ public:
private:
};
//
// ndim == 0 => scaler
// otherwise pIndexArray points to an array of ndim items
//
#define nDimScaler 0U
class casCtx {
public:
casCtx() :
@@ -455,6 +479,9 @@ enum casFlushCondition{
casFlushPartial,
casFlushCompleted,
casFlushDisconnect};
enum casFlushRequest{
casFlushAll,
casFlushSpecified};
class outBuf {
public:
@@ -466,13 +493,24 @@ public:
// number of bytes in the output queue?
//
bufSizeT bytesPresent() const
{ return this->stack; }
{
return this->stack;
}
//
// number of bytes unused in the output queue?
//
bufSizeT bytesFree() const
{
return this->bufSize - this->stack;
}
//
// flush output queue
// (returns the number of bytes sent)
//
casFlushCondition flush();
casFlushCondition flush(casFlushRequest req = casFlushAll,
bufSizeT spaceRequired=0u);
//
// allocate message buffer space
@@ -488,18 +526,25 @@ public:
//
// release an allocated message (but dont send it)
//
void discardMsg () { this->mutex.unlock(); };
void discardMsg ()
{
this->mutex.osiUnlock();
};
void show(unsigned level);
virtual unsigned getDebugLevel()=0;
virtual void sendBlockSignal()=0;
void clear()
{
this->stack = 0u;
}
private:
casMsgIO &io;
osiMutex &mutex;
char *pBuf;
bufSizeT bufSize;
const bufSizeT bufSize;
bufSizeT stack;
};
@@ -519,6 +564,13 @@ class casCoreClient : public osiMutex, public ioBlocked,
public casEventSys {
public:
casCoreClient(caServerI &serverInternal);
caStatus init()
{
if (this->osiMutex::init()) {
return S_cas_noMemory;
}
return this->casEventSys::init();
}
virtual ~casCoreClient();
virtual void destroy();
virtual caStatus disconnectChan(caResId id);
@@ -531,16 +583,16 @@ public:
void installAsyncIO(casAsyncIOI &ioIn)
{
this->lock();
this->osiLock();
this->ioInProgList.add(ioIn);
this->unlock();
this->osiUnlock();
}
void removeAsyncIO(casAsyncIOI &ioIn)
{
this->lock();
this->osiLock();
this->ioInProgList.remove(ioIn);
this->unlock();
this->osiUnlock();
}
casRes *lookupRes(const caResId &idIn, casResType type);
@@ -647,8 +699,8 @@ protected:
const void *dp, const char *pFileName,
const unsigned lineno);
private:
casMsgIO &msgIO;
private:
//
// dump message to stderr
@@ -793,7 +845,7 @@ private:
caStatus channelCreateFailed (const caHdr *mp, caStatus createStatus);
caStatus writeArrayData();
caStatus writeScalerData();
caStatus writeScalarData();
caStatus writeString();
};
@@ -801,7 +853,7 @@ private:
//
// casDGClient
//
class casDGClient : private casDGIO, public casClient {
class casDGClient : private casDGIO, private casClient {
public:
casDGClient (caServerI &serverIn);
@@ -835,6 +887,25 @@ public:
}
void destroy();
int getFD() const
{
return this->casClient::getFD();
}
protected:
void process();
casProcCond eventSysProcess()
{
return this->casEventSys::process();
}
casFlushCondition flush(casFlushRequest req = casFlushAll,
bufSizeT spaceRequired=0u)
{
return this->outBuf::flush(req,spaceRequired);
}
private:
void ioBlockedSignal(); // dummy
@@ -856,10 +927,8 @@ private:
class casClientMon;
//
// caServerI
//
class caServerI : public caServerOS, public caServerIO,
class caServerI :
public caServerOS, public caServerIO,
public osiMutex, public ioBlockedList,
private uintResTable<casRes>,
public casEventRegistry {
@@ -895,11 +964,6 @@ public:
void removeClient(casStrmClient *pClient);
casStrmClient *firstClient() const
{
return clientList.first();
}
unsigned getMaxSimultaneousIO() const {return this->maxSimultaneousIO;}
//
@@ -951,7 +1015,7 @@ public:
return &this->adapter;
}
uintResTable<casRes> &getResTable() {return *this;}
//uintResTable<casRes> &getResTable() {return *this;}
void installItem(casRes &res)
{

View File

@@ -176,9 +176,9 @@ void casDGIO::osdShow (unsigned level) const
}
//
// casDGIO::setNonBlocking()
// casDGIO::xSetNonBlocking()
//
void casDGIO::setNonBlocking()
void casDGIO::xSetNonBlocking()
{
int status;
int yes = TRUE;
@@ -276,7 +276,10 @@ xSendStatus casDGIO::osdSend(const char *pBuf, bufSizeT size,
return xSendOK;
}
status = sendto(this->sock, pBuf, size, 0,
//
// (char *) cast below is for brain dead wrs prototype
//
status = sendto(this->sock, (char *) pBuf, size, 0,
&this->lastRecvAddr.sa,
sizeof(this->lastRecvAddr.sa));
if (status>0) {

View File

@@ -7,48 +7,31 @@
// Some BSD calls have crept in here
//
// $Log$
// Revision 1.4 1996/09/04 20:29:08 jhill
// removed os depen stuff
//
// Revision 1.3 1996/08/13 23:00:29 jhill
// removed include of netdb.h
//
// Revision 1.2 1996/07/24 22:03:36 jhill
// fixed net proto for gnu compiler
//
// Revision 1.1.1.1 1996/06/20 00:28:18 jhill
// ca server installation
//
//
#ifndef includeCASIODH
#define includeCASIODH
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#if 0 // func proto do not have args for C++
#include <arpa/inet.h>
#include <netdb.h>
#endif
#ifdef __cplusplus
}
#endif
#include <bsdProto.h>
typedef int SOCKET;
#define SOCKERRNO errno
#define socket_close(S) close(S)
#define socket_ioctl(A,B,C) ioctl(A,B,C)
#include <osiSock.h>
// ca
#include <addrList.h>
void hostNameFromIPAddr (const caAddr *pAddr,
char *pBuf, unsigned bufSize);
//
// assuming al posix machines are IEEE fload will be wrong
//
#define ntohf(A) (A)
#define ntohd(A) (A)
#define htonf(A) (A)
#define htond(A) (A)
class caServerIO {
public:
@@ -104,7 +87,7 @@ public:
~casStreamIO();
int getFileDescriptor() const;
void setNonBlocking();
void xSetNonBlocking();
bufSizeT optimumBufferSize ();
casIOState state() const;
@@ -130,7 +113,7 @@ public:
~casDGIO();
int getFileDescriptor() const;
void setNonBlocking();
void xSetNonBlocking();
bufSizeT optimumBufferSize ();
void sendBeacon(char &msg, bufSizeT length,
aitUint32 &m_avail);

View File

@@ -5,6 +5,12 @@
//
//
// $Log$
// Revision 1.4 1996/07/24 22:03:36 jhill
// fixed net proto for gnu compiler
//
// Revision 1.3 1996/07/09 22:55:22 jhill
// added cast
//
// Revision 1.2 1996/06/21 02:18:11 jhill
// SOLARIS port
//
@@ -20,17 +26,25 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
//
// the SUNOS4 and vxWorks5.2 prototypes are trad C
//
#if !defined(SUNOS4) && !defined(vxWorks)
#include <arpa/inet.h>
#else
extern "C" {
char * inet_ntoa(struct in_addr);
}
#endif
//
// casStreamIO::casStreamIO()
//
casStreamIO::casStreamIO(const SOCKET s, const caAddr &a) :
sock(s), addr(a)
sockState(casOffLine), sock(s), addr(a)
{
assert (sock>=0);
this->sockState = casOffLine;
}
@@ -119,7 +133,8 @@ caStatus casStreamIO::init()
casStreamIO::~casStreamIO()
{
if (sock>=0) {
close(sock);
close(this->sock);
printf("closing sock=%d\n", this->sock);
}
}
@@ -127,7 +142,7 @@ casStreamIO::~casStreamIO()
//
// casStreamIO::osdSend()
//
xSendStatus casStreamIO::osdSend(const char *pBuf, bufSizeT nBytes,
xSendStatus casStreamIO::osdSend(const char *pBuf, bufSizeT nBytesReq,
bufSizeT &nBytesActual)
{
int status;
@@ -151,31 +166,29 @@ xSendStatus casStreamIO::osdSend(const char *pBuf, bufSizeT nBytes,
return xSendDisconnect;
}
if (nBytes<=0u) {
if (nBytesReq<=0u) {
nBytesActual = 0u;
return xSendOK;
}
status = send (
this->sock,
pBuf,
nBytes,
0);
if (status == 0) {
this->sockState = casOffLine;
status = send (
this->sock,
(char *) pBuf,
nBytesReq,
0);
if (status == 0) {
this->sockState = casOffLine;
return xSendDisconnect;
}
else if (status<0) {
int anerrno = SOCKERRNO;
}
else if (status<0) {
int anerrno = SOCKERRNO;
if (anerrno != EWOULDBLOCK) {
this->sockState = casOffLine;
if (anerrno != EWOULDBLOCK) {
this->sockState = casOffLine;
}
nBytesActual = 0u;
return xSendOK;
}
nBytesActual = (bufSizeT) status;
return xSendOK;
}
@@ -242,9 +255,9 @@ void casStreamIO::osdShow (unsigned level) const
//
// casStreamIO::setNonBlocking()
// casStreamIO::xSsetNonBlocking()
//
void casStreamIO::setNonBlocking()
void casStreamIO::xSetNonBlocking()
{
int status;
int yes = TRUE;

View File

@@ -6,6 +6,9 @@
*
*
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:06 jhill
* ca server installation
*
*
*/
@@ -108,6 +111,6 @@ casServerReg::~casServerReg()
//
int caServerOS::getFD()
{
return cas.caServerIO::getFD();
return cas.caServerIO::getFD();
}

View File

@@ -6,6 +6,12 @@
*
*
* $Log$
* Revision 1.2 1996/08/05 19:29:25 jhill
* os depen code now smaller
*
* Revision 1.1.1.1 1996/06/20 00:28:06 jhill
* ca server installation
*
*
*/
@@ -49,7 +55,7 @@ void casDGEvWakeup::show(unsigned level)
void casDGEvWakeup::expire()
{
casProcCond cond;
cond = this->os.casEventSys::process();
cond = this->os.eventSysProcess();
if (cond != casProcOk) {
//
// if "this" is being used above this
@@ -166,54 +172,9 @@ casProcCond casDGOS::processInput ()
//
void casDGReadReg::callBack()
{
caStatus status;
casFlushCondition flushCond;
casFillCondition fillCond;
assert (os.pRdReg);
//
// force all replies to be sent to the client
// that made the request
//
os.clear();
//
// read in new input
//
fillCond = os.fill();
if (fillCond == casFillDisconnect) {
casVerify(0);
return;
}
//
// verify that we have a message to process
//
if (os.inBuf::bytesPresent()>0u) {
//
// process the message
//
status = os.processMsg();
if (status) {
errMessage (status,
"unexpected error processing stateless protocol");
//
// clear the input buffer so this will
// not effect future input
//
os.clear();
}
else {
//
// force all replies to go to the sender
//
flushCond = os.flush();
if (flushCond!=casFlushCompleted) {
os.clear();
casVerify(0);
}
}
}
os.process();
}
//

View File

@@ -7,6 +7,12 @@
// Some BSD calls have crept in here
//
// $Log$
// Revision 1.2 1996/08/13 22:58:15 jhill
// fdMgr.h => fdmanager.h
//
// Revision 1.1.1.1 1996/06/20 00:28:06 jhill
// ca server installation
//
//
#ifndef includeCASOSDH
@@ -22,11 +28,18 @@ extern "C" {
//
# include <netinet/in.h>
//
// g++ 2.7.2 does not fix this file under sunos4 so I
// have provided the prototype elsewhere (in osiSock.h for now)
//
#if !(defined(SUNOS4) && defined(__GNUC__))
# include <netdb.h>
#endif
} // extern "C"
#include <osiMutex.h>
#include <osiTimer.h>
#include <fdMgr.h>
#include <fdManager.h>
class caServerI;

View File

@@ -1,46 +0,0 @@
/*
* $Id$
* Some of this isnt posix - its BSD
*
* $Log$
*/
#ifndef includeCasSpecificOSH
#define includeCasSpecificOSH
#include <singleThread.h>
#include <unistd.h>
#include <errno.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <bsdProto.h>
#ifdef __cplusplus
}
#endif
typedef int SOCKET;
#define SOCKERRNO errno
#define socket_close(S) close(S)
#define socket_ioctl(A,B,C) ioctl(A,B,C)
#define ntohf(A) (A)
#define ntohd(A) (A)
#define htonf(A) (A)
#define htond(A) (A)
#endif /* ifndef includeCasSpecificOSH (no new code below this line) */

View File

@@ -1,13 +1,18 @@
//
// osiMutex - OS independent mutex
// (NOOP on single threaded OS)
//
class osiMutex {
public:
void lock() {};
void unlock() {};
//
// constructor that returns status
// (since g++ does not have exceptions)
//
int init() {return 0;}
void osiLock() {}
void osiUnlock() {}
void show (unsigned) {}
private:
};

View File

@@ -2,6 +2,7 @@
WORK IN PROGRESS
this directory contains the vxWorks os dependent source for
the EPICS ca server
the EPICS ca server. This is a multi-threaded port of the
server.

View File

@@ -0,0 +1,127 @@
/*
*
* caServerOS.c
* $Id$
*
*
* $Log$
* Revision 1.1 1996/09/04 22:06:43 jhill
* installed
*
* Revision 1.1.1.1 1996/06/20 00:28:06 jhill
* ca server installation
*
*
*/
#include <taskLib.h>
#include <task_params.h>
//
// CA server
//
#include <server.h>
//
// aServerOS::operator -> ()
//
inline caServerI * caServerOS::operator -> ()
{
return &this->cas;
}
//
// casBeaconTimer::expire()
//
void casBeaconTimer::expire()
{
os->sendBeacon ();
}
//
// casBeaconTimer::again()
//
osiBool casBeaconTimer::again()
{
return osiTrue;
}
//
// casBeaconTimer::delay()
//
const osiTime casBeaconTimer::delay()
{
return os->getBeaconPeriod();
}
//
// caServerOS::init()
//
caStatus caServerOS::init()
{
this->pBTmr = new casBeaconTimer((*this)->getBeaconPeriod(), *this);
if (!this->pBTmr) {
ca_printf("CAS: Unable to start server beacon\n");
return S_cas_noMemory;
}
//
// WRS still passes pointers in ints
//
assert (sizeof(int)==sizeof(&this->cas));
this->tid = taskSpawn (
REQ_SRVR_NAME,
REQ_SRVR_PRI,
REQ_SRVR_OPT,
REQ_SRVR_STACK,
(FUNCPTR) caServerEntry, // get your act together WRS
(int) &this->cas, // get your act together WRS
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->tid==ERROR) {
return S_cas_noMemory;
}
return S_cas_success;
}
//
// caServerOS::~caServerOS()
//
caServerOS::~caServerOS()
{
if (this->pBTmr) {
delete this->pBTmr;
}
if (taskIdVerify(this->tid)==OK)
{
taskDelete(this->tid);
}
}
//
// caServerEntry()
//
void caServerEntry(caServerI *pCAS)
{
//
// forever
//
while (TRUE) {
pCAS->connectCB();
printf("process timer q here?\n");
}
}

View File

@@ -0,0 +1,77 @@
class casStreamEvWakeup;
//
// casStreamOS
//
class casStreamOS : public casStrmClient {
friend int casStrmServer (casStreamOS *);
friend int casStrmEvent (casStreamOS *);
public:
casStreamOS(caServerI &, casMsgIO &);
caStatus init();
~casStreamOS();
//
// process any incomming messages
//
casProcCond processInput();
caStatus start();
void sendBlockSignal();
void ioBlockedSignal();
void eventSignal();
void eventFlush();
void show(unsigned level);
private:
SEM_ID eventSignalSem;
int clientTId;
int eventTId;
};
//
// vxWorks task entry
//
int casStrmServer (casStreamOS *);
int casStrmEvent (casStreamOS *);
class casDGEvWakeup;
//
// casDGOS
//
class casDGOS : public casDGClient {
friend int casDGServer (casDGOS *);
friend int casDGEvent (casDGOS *);
public:
casDGOS(caServerI &cas);
caStatus init();
~casDGOS();
//
// process any incomming messages
//
casProcCond processInput();
caStatus start();
void sendBlockSignal() {}
void eventSignal();
void eventFlush();
void show(unsigned level);
private:
SEM_ID eventSignalSem;
int clientTId;
int eventTId;
};
//
// vxWorks task entry
//
int casDGServer (casDGOS *);
int casDGEvent (casDGOS *);

View File

@@ -0,0 +1,209 @@
/*
*
* casDGOS.c
* $Id$
*
*
* $Log$
* Revision 1.1 1996/09/04 22:06:45 jhill
* installed
*
* Revision 1.1.1.1 1996/06/20 00:28:06 jhill
* ca server installation
*
*
*/
//
// CA server
//
#include <taskLib.h> // vxWorks
#include <server.h>
#include <casClientIL.h> // casClient inline func
#include <task_params.h> // EPICS task priorities
//
// casDGOS::eventSignal()
//
void casDGOS::eventSignal()
{
STATUS st;
st = semGive(this->eventSignalSem);
assert (st==OK);
}
//
// casDGOS::eventFlush()
//
void casDGOS::eventFlush()
{
this->flush();
}
//
// casDGOS::casDGOS()
//
casDGOS::casDGOS(caServerI &cas) :
eventSignalSem(NULL),
casDGClient(cas),
clientTId(ERROR),
eventTId(ERROR)
{
}
//
// casDGOS::init()
//
caStatus casDGOS::init()
{
caStatus status;
this->eventSignalSem = semBCreate(SEM_Q_PRIORITY, SEM_EMPTY);
if (this->eventSignalSem == NULL) {
return S_cas_noMemory;
}
//
// init the base classes
//
status = this->casDGClient::init();
return status;
}
//
// casDGOS::~casDGOS()
//
casDGOS::~casDGOS()
{
if (taskIdVerify(this->clientTId)==OK) {
taskDelete(this->clientTId);
}
if (taskIdVerify(this->eventTId)==OK) {
taskDelete(this->eventTId);
}
if (this->eventSignalSem) {
semDelete(this->eventSignalSem);
}
}
//
// casDGOS::show()
//
void casDGOS::show(unsigned level)
{
this->casDGClient::show(level);
printf ("casDGOS at %x\n", (unsigned) this);
if (taskIdVerify(this->clientTId) == OK) {
taskShow(this->clientTId, level);
}
if (taskIdVerify(this->eventTId) == OK) {
printf("casDGOS task id = %x\n", this->eventTId);
}
if (this->eventSignalSem) {
semShow(this->eventSignalSem, level);
}
}
/*
* casClientStart ()
*/
caStatus casDGOS::start()
{
//
// no (void *) vxWorks task arg
//
assert (sizeof(int) >= sizeof(this));
this->clientTId = taskSpawn(
CAST_SRVR_NAME,
CAST_SRVR_PRI,
CAST_SRVR_OPT,
CAST_SRVR_STACK,
(FUNCPTR) casDGServer, // get your act together wrs
(int) this, // get your act together wrs
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->clientTId==ERROR) {
return S_cas_noMemory;
}
this->eventTId = taskSpawn(
CA_EVENT_NAME,
CA_CLIENT_PRI,
CA_CLIENT_OPT,
CAST_SRVR_STACK,
(FUNCPTR) casDGEvent, // get your act together wrs
(int) this, // get your act together wrs
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->eventTId==ERROR) {
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* casDGOS::processInput ()
* - a noop
*/
casProcCond casDGOS::processInput ()
{
return casProcOk;
}
//
// casDGServer()
//
int casDGServer (casDGOS *pDGOS)
{
//
// block for the next DG until the connection closes
//
while (TRUE) {
pDGOS->process();
}
}
//
// casDGEvent()
//
int casDGEvent (casDGOS *pDGOS)
{
STATUS status;
casProcCond cond;
//
// Wait for event queue entry
//
while (TRUE) {
status = semTake(pDGOS->eventSignalSem, WAIT_FOREVER);
assert (status!=OK);
cond = pDGOS->eventSysProcess();
if (cond != casProcOk) {
printf("DG event sys process failed\n");
}
}
}

View File

@@ -0,0 +1,95 @@
//
// $Id$
//
// casOSD.h - Channel Access Server OS Dependent for posix
//
//
// Some BSD calls have crept in here
//
// $Log$
// Revision 1.1 1996/09/04 22:06:46 jhill
// installed
//
// Revision 1.1.1.1 1996/06/20 00:28:06 jhill
// ca server installation
//
//
#ifndef includeCASOSDH
#define includeCASOSDH
#include <unistd.h>
#include <errno.h>
extern "C" {
//
// for htons() etc
//
# include <netinet/in.h>
# include <ioLib.h>
} // extern "C"
#include <osiMutex.h>
#include <osiTimer.h>
class caServerI;
class caServerOS;
//
// casBeaconTimer
//
class casBeaconTimer : public osiTimer {
public:
casBeaconTimer (const osiTime &delay, caServerOS &osIn) :
os (osIn), osiTimer(delay) {}
void expire();
const osiTime delay();
osiBool again();
const char *name()
{
return "casBeaconTimer";
}
private:
caServerOS &os;
int taskId;
};
class casServerReg;
class caServerOS;
//
// vxWorks task entry
//
void caServerEntry(caServerI *pCAS);
//
// caServerOS
//
class caServerOS {
friend class casServerReg;
friend void caServerEntry(caServerI *pCAS);
public:
caServerOS (caServerI &casIn) :
cas (casIn), pBTmr (NULL), tid(ERROR) {}
caStatus init ();
~caServerOS ();
//caStatus start ();
inline caServerI * operator -> ();
//int getFD();
private:
caServerI &cas;
casBeaconTimer *pBTmr;
int tid;
};
// no additions below this line
#endif // includeCASOSDH

View File

@@ -0,0 +1,275 @@
//
// casStreamOS.cc
// $Id$
//
//
// $Log$
// Revision 1.1 1996/09/04 22:06:46 jhill
// installed
//
// Revision 1.1.1.1 1996/06/20 00:28:06 jhill
// ca server installation
//
//
//
//
// CA server
//
#include<server.h>
#include <casClientIL.h> // casClient inline func
#include <task_params.h> // EPICS task priorities
//
// casStreamOS::ioBlockedSignal()
//
void casStreamOS::ioBlockedSignal()
{
printf("in casStreamOS::ioBlockedSignal() ?\n");
}
//
// casStreamOS::eventSignal()
//
void casStreamOS::eventSignal()
{
STATUS st;
st = semGive(this->eventSignalSem);
assert (st==OK);
}
//
// casStreamOS::eventFlush()
//
void casStreamOS::eventFlush()
{
this->flush();
}
//
// casStreamOS::casStreamOS()
//
casStreamOS::casStreamOS(caServerI &cas, casMsgIO &ioIn) :
casStrmClient(cas, ioIn),
eventSignalSem(NULL),
clientTId(NULL),
eventTId(NULL)
{
}
//
// casStreamOS::init()
//
caStatus casStreamOS::init()
{
caStatus status;
this->eventSignalSem = semBCreate(SEM_Q_PRIORITY, SEM_EMPTY);
if (this->eventSignalSem == NULL) {
return S_cas_noMemory;
}
//
// init the base classes
//
status = this->casStrmClient::init();
if (status) {
return status;
}
return S_cas_success;
}
//
// casStreamOS::~casStreamOS()
//
casStreamOS::~casStreamOS()
{
//
// attempt to flush out any remaining messages
//
this->flush();
if (taskIdVerify(this->clientTId)==OK &&
this->clientTId != taskIdSelf()) {
taskDelete(this->clientTId);
}
if (taskIdVerify(this->eventTId)==OK &&
this->eventTId != taskIdSelf()) {
taskDelete(this->eventTId);
}
if (this->eventSignalSem) {
semDelete(this->eventSignalSem);
}
}
//
// casStreamOS::show()
//
void casStreamOS::show(unsigned level)
{
this->casStrmClient::show(level);
printf("casStreamOS at %x\n", (unsigned) this);
if (taskIdVerify(this->clientTId)==OK) {
taskShow(this->clientTId, level);
}
if (taskIdVerify(this->eventTId)==OK) {
printf("casStreamOS task id %x\n", this->eventTId);
}
if (this->eventSignalSem) {
semShow(this->eventSignalSem, level);
}
}
//
// casClientStart ()
//
caStatus casStreamOS::start()
{
//
// no (void *) vxWorks task arg
//
assert (sizeof(int) >= sizeof(this));
this->clientTId = taskSpawn(
CA_CLIENT_NAME,
CA_CLIENT_PRI,
CA_CLIENT_OPT,
CA_CLIENT_STACK,
(FUNCPTR) casStrmServer, // get your act together wrs
(int) this, // get your act together wrs
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->clientTId==ERROR) {
return S_cas_noMemory;
}
this->eventTId = taskSpawn(
CA_EVENT_NAME,
CA_CLIENT_PRI,
CA_CLIENT_OPT,
CA_CLIENT_STACK,
(FUNCPTR) casStrmEvent, // get your act together wrs
(int) this, // get your act together wrs
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->eventTId==ERROR) {
return S_cas_noMemory;
}
return S_cas_success;
}
//
// casStreamOS::sendBlockSignal()
//
void casStreamOS::sendBlockSignal()
{
printf("in casStreamOS::sendBlockSignal()\n");
}
//
// casStreamOS::processInput()
//
casProcCond casStreamOS::processInput()
{
caStatus status;
# ifdef DEBUG
printf(
"Resp bytes to send=%d, Req bytes pending %d\n",
this->outBuf::bytesPresent(),
this->inBuf::bytesPresent());
# endif
status = this->processMsg();
switch (status) {
case S_cas_partialMessage:
case S_cas_ioBlocked:
case S_cas_success:
return casProcOk;
default:
errMessage (status,
"unexpected error processing client's input");
return casProcDisconnect;
}
}
//
// casStrmServer()
//
int casStrmServer (casStreamOS *pStrmOS)
{
casFillCondition fillCond;
casProcCond procCond;
//
// block for the next message until the connection closes
//
while (TRUE) {
//
// copy in new messages
//
fillCond = pStrmOS->fill();
procCond = pStrmOS->processInput();
if (fillCond == casFillDisconnect ||
procCond == casProcDisconnect) {
delete pStrmOS;
//
// NO CODE HERE
// (see delete above)
//
return OK;
}
//
// force the output buffer to flush prior to
// blocking for more input (if no input bytes are
// pending)
//
if (pStrmOS->bytesAvailable()<=0u) {
pStrmOS->flush();
}
}
}
//
// casStrmEvent()
//
int casStrmEvent(casStreamOS *pStrmOS)
{
STATUS status;
casProcCond cond;
//
// Wait for event queue entry
//
while (TRUE) {
status = semTake(pStrmOS->eventSignalSem, WAIT_FOREVER);
assert (status==OK);
cond = pStrmOS->casEventSys::process();
if (cond != casProcOk) {
printf("Stream event sys process failed\n");
}
}
}

View File

@@ -0,0 +1,113 @@
//
// osiMutex - OS independent mutex
// (vxWorks version)
//
//
// NOTES:
// 1) epicsPrintf() is used in this file because we cant stand
// the logMsg() 8 arg API amd we dont want the messages from different
// tasks to co-mingle
//
#include <semLib.h>
#include <epicsAssert.h>
#include <epicsPrint.h>
#ifdef DEBUG_OSIMUTEX
#include <stdio.h>
#endif
#ifdef DEBUG_OSIMUTEX
#define osiLock() osiLockI (__FILE__, __LINE__)
#define osiUnlock() osiUnlockI (__FILE__, __LINE__)
#endif
class osiMutex {
public:
osiMutex()
{
mutex = NULL;
}
//
// constructor that returns status
// (since g++ does not have exceptions)
//
int init ()
{
this->mutex = semMCreate(SEM_Q_PRIORITY|SEM_INVERSION_SAFE);
if (this->mutex==NULL)
{
return -1;
}
# ifdef DEBUG_OSIMUTEX
epicsPrintf("created mutex at %lx\n",
(unsigned long) this->mutex);
# endif
return 0;
}
~osiMutex()
{
STATUS s;
s = semDelete (this->mutex);
assert (s==OK);
# ifdef DEBUG_OSIMUTEX
epicsPrintf("destroyed mutex at %lx\n",
(unsigned long) this->mutex);
# endif
}
#ifdef DEBUG_OSIMUTEX
void osiLockI(const char *pFN, unsigned ln)
#else
void osiLock()
#endif
{
STATUS s;
if (!this->mutex) {
epicsPrintf(
"osiMutex: lock request before init was ignored\n");
return;
}
assert(this->mutex);
s = semTake (this->mutex, WAIT_FOREVER);
assert (s==OK);
# ifdef DEBUG_OSIMUTEX
epicsPrintf("L%lx in %s at %u\n",
(unsigned long) this->mutex,
pFN, ln);
# endif
}
#ifdef DEBUG_OSIMUTEX
void osiUnlockI(const char *pFN, unsigned ln)
#else
void osiUnlock()
#endif
{
STATUS s;
if (!this->mutex) {
epicsPrintf(
"osiMutex: unlock request before init was ignored\n");
return;
}
s = semGive (this->mutex);
assert (s==OK);
# ifdef DEBUG_OSIMUTEX
epicsPrintf("U%lx in %s at %d\n",
(unsigned long) this->mutex,
pFN, ln);
# endif
}
void show(unsigned level)
{
semShow(this->mutex, (int) level);
}
private:
SEM_ID mutex;
};

View File

@@ -1,659 +0,0 @@
/*
*
* vxWorks_depen.c
* %W% %G%
*
* vxWorks dependent routines for the CA server
*
*
*/
#include <server.h>
#include <inetLib.h>
VERSIONID(vxWorks_depenc,"%W% %G%")
#define MUTEX_SEM_OPTIONS \
(SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE)
LOCAL int event_task(
struct event_user *evuser,
void (*init_func)(int arg),
int init_func_arg
);
LOCAL void osDepenTimerCB(void *pciu);
LOCAL void osDepenSendCB(void *pClient);
int caServerTask(struct rsrv *pRsrv);
LOCAL int caMaxFreeBlockPoll(void);
size_t caMaxFreeBlock;
###### no event flush currently (only needed in multi thread env) ####
status = caeqAddFlushEvent (client->evuser, XXXX, client);
assert (status==OK);
/*
* caGetElapsedTime()
*/
caStatus caGetElapsedTime(caElapsedTimeVal *pElapsed)
{
ULONG ticks;
ULONG rate;
ticks = tickGet();
rate = sysClkRateGet();
pElapsed->tv_sec = ticks * rate;
pElapsed->tv_usec = ((ticks % rate)*CAServerUSecInSec)/rate;
return S_cas_success;
}
/*
* caOutOfMemory()
*/
int caOutOfMemory(void)
{
int status;
static int pollTaskStarted;
if(!pollTaskStarted){
caMaxFreeBlock = memFindMax();
status = taskSpawn(
MAXFREEBLOCKTASKNAME,
MAXFREEBLOCKTASKPRI,
MAXFREEBLOCKTASKOPT,
MAXFREEBLOCKTASKSTACK,
caMaxFreeBlockPoll,
0,0,0,0,0,0,0,0,0,0);
if(status>=0){
pollTaskStarted = TRUE;
}
}
return (caMaxFreeBlock<MAX_BLOCK_THRESHOLD);
}
/*
* caMaxFreeBlockPoll()
*/
LOCAL int caMaxFreeBlockPoll(void)
{
while(TRUE){
caMaxFreeBlock = memFindMax();
taskDelay(MAXFREEBLOCKPOLL*sysClkRateGet());
}
}
/*
* casPutCBStartTimer()
*/
caStatus casPutCBStartTimer(
casChanInUse *pciu,
unsigned timeOutSec
)
{
struct client *pClient = pciu->client;
caserver *pRsrv = pClient->cc.pRsrv;
struct timeval tv;
if(pClient->cc.osSpecific.pPutCBAlarm){
tv.tv_sec = timeOutSec;
tv.tv_usec = 0;
pClient->cc.osSpecific.pPutCBAlarm
= fdmgr_add_timeout(
pRsrv->osSpecific.pfdctx,
&tv,
osDepenTimerCB,
pciu);
if(!pClient->cc.osSpecific.pPutCBAlarm){
return S_cas_noMemory;
}
}
return S_cas_success;
}
/*
* osDepenTimerCB()
*/
LOCAL void osDepenTimerCB(void *pParam)
{
casChanInUse *pciu = (casChanInUse *)pParam;
pciu->client->cc.osSpecific.pPutCBAlarm = NULL;
casPutCBTimer(pciu);
}
/*
* casPutCBCancelTimer()
*/
void casPutCBCancelTimer(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(pClient->cc.osSpecific.pPutCBAlarm){
status = fdmgr_clear_timeout(
pRsrv->osSpecific.pfdctx,
pClient->cc.osSpecific.pPutCBAlarm);
assert(status==0);
pClient->cc.osSpecific.pPutCBAlarm = NULL;
}
}
/*
* casDisableSocketRecvIOCallback()
*/
caStatus casDisableSocketRecvIOCallback(struct client *pClient)
{
int status;
if(pClient->cc.osSpecific.sockRecvIOCallbackEnabled){
status = fdmgr_clear_callback(
pClient->cc.pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_read);
assert(status==0);
pClient->cc.osSpecific.sockRecvIOCallbackEnabled = FALSE;
}
return S_cas_success;
}
/*
* casEnableSocketRecvIOCallback()
*/
caStatus casEnableSocketRecvIOCallback(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(!pClient->cc.osSpecific.sockRecvIOCallbackEnabled){
status = fdmgr_add_callback(
pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_read,
pClient->cc.pCB,
pClient);
if(status){
return S_cas_noMemory;
}
pClient->cc.osSpecific.sockRecvIOCallbackEnabled = TRUE;
}
return S_cas_success;
}
/*
* casWaitForIO ()
*/
caStatus casWaitForIO (struct rsrv *pRsrv, caTime *pDelay)
{
struct timeval tv;
tv.tv_sec = caTime->sec;
tv.tv_usec = caTime->nsec / NSecPerUsec;
status = fdmgr_pend_event(pRsrv->osSpecific.pfdctx, &tv);
if (status) {
return S_cas_internal;
}
return S_cas_success;
}
/*
* casArmSocketSendIOCallback()
*/
caStatus casArmSocketSendIOCallback(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(!pClient->cc.osSpecific.sockSendIOCallbackEnabled){
status = fdmgr_add_callback(
pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_write,
osDepenSendCB,
pClient);
if(status){
return S_cas_noMemory;
}
pClient->cc.osSpecific.sockSendIOCallbackEnabled = TRUE;
}
return S_cas_success;
}
/*
* casCancelSocketSendIOCallback()
*/
caStatus casCancelSocketSendIOCallback(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(pClient->cc.osSpecific.sockSendIOCallbackEnabled){
status = fdmgr_clear_callback(
pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_write);
assert(status==0);
pClient->cc.osSpecific.sockSendIOCallbackEnabled = FALSE;
}
return S_cas_success;
}
/*
* osDepenSendCB()
*/
LOCAL void osDepenSendCB(void *pParam)
{
struct client *pClient = (struct client *) pParam;
pClient->cc.osSpecific.sockSendIOCallbackEnabled = FALSE;
(*pClient->sendHandler)(pClient);
}
/*
* casOSSpecificDelete()
*/
void casOSSpecificDelete(struct rsrv *pRsrv)
{
int status;
if(taskIdVerify(pRsrv->osSpecific.selectTask) == OK){
taskwdRemove(taskDelete(pRsrv->osSpecific.selectTask));
taskDelete(pRsrv->osSpecific.selectTask);
}
if(pRsrv->osSpecific.clientQLock){
status = semDelete(pRsrv->osSpecific.clientQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.freeChanQLock){
status = semDelete(pRsrv->osSpecific.freeChanQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.freeEventQLock){
status = semDelete(pRsrv->osSpecific.freeEventQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.pvQLock){
status = semDelete(pRsrv->osSpecific.pvQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.pfdctx){
status = fdmgr_delete(pRsrv->osSpecific.pfdctx);
assert(status==OK);
}
}
/*
* casOSSpecificInit()
*/
caStatus casOSSpecificInit(struct rsrv *pRsrv)
{
pRsrv->osSpecific.clientQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.clientQLock){
return S_cas_noMemory;
}
pRsrv->osSpecific.freeChanQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.freeChanQLock){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.freeEventQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.freeEventQLock){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.pvQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.pvQLock){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.pfdctx = fdmgr_init();
if(!pRsrv->osSpecific.pfdctx){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* casOSSpecificStartServer()
*/
caStatus casOSSpecificStartServer(caserver *pRsrv)
{
int status;
status = fdmgr_add_callback(
pRsrv->osSpecific.pfdctx,
pRsrv->server_sock,
fdi_read,
rsrv_connect,
pRsrv);
if(status < 0){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
status = taskSpawn(
REQ_SRVR_NAME,
REQ_SRVR_PRI,
REQ_SRVR_OPT,
RSP_SRVR_STACK,
caServerTask,
(int)pRsrv,
0,0,0,0,0,0,0,0,0);
if(status == ERROR){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.selectTask = status;
return S_cas_success;
}
/*
* caServerTask()
*/
int caServerTask(caserver *pRsrv)
{
struct timeval tv;
caTime delay;
struct client *pClient;
int nchars;
int status;
taskwdInsert((int)taskIdCurrent,NULL,NULL);
while(TRUE){
delay.sec = 100;
delay.usec = 0;
status = caServerProcess (pRsrv, &delay);
assert (status == S_cas_success);
}
}
/*
* casSchedualBeacon()
*/
void casSchedualBeacon(struct rsrv *pRsrv)
{
fdmgrAlarm *tmp;
struct timeval tv;
tv.tv_sec = pRsrv->delayToNextBeacon.tv_sec;
tv.tv_usec = pRsrv->delayToNextBeacon.tv_usec;
tmp = fdmgr_add_timeout(
pRsrv->osSpecific.pfdctx,
&tv,
casSendBeacon,
pRsrv);
if(!tmp){
ca_printf("CAS: Unable to keep beacon going\n");
}
}
/*
* casOSSpecificClientInit()
*/
caStatus casOSSpecificClientInit(struct client *client)
{
client->cc.osSpecific.eventQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.eventQLock){
return S_cas_noMemory;
}
client->cc.osSpecific.chanQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.chanQLock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
client->cc.osSpecific.putNotifyLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.putNotifyLock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
client->cc.osSpecific.lock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.lock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
client->cc.osSpecific.accessRightsQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.accessRightsQLock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* casOSSpecificClientDelete()
*/
void casOSSpecificClientDelete(struct client *client)
{
int status;
if(client->cc.osSpecific.eventQLock){
status = semDelete(client->cc.osSpecific.eventQLock);
assert(status==OK);
}
if(client->cc.osSpecific.chanQLock){
status = semDelete(client->cc.osSpecific.chanQLock);
assert(status==OK);
}
if(client->cc.osSpecific.putNotifyLock){
status = semDelete(client->cc.osSpecific.putNotifyLock);
assert(status==OK);
}
if(client->cc.osSpecific.lock){
status = semDelete(client->cc.osSpecific.lock);
assert(status==OK);
}
if(client->cc.osSpecific.accessRightsQLock){
status = semDelete(client->cc.osSpecific.accessRightsQLock);
assert(status==OK);
}
}
/*
* caeqOSSpecificInit()
*/
caStatus caeqOSSpecificInit(caEventUser *evuser)
{
evuser->osSpecific.lock = semMCreate(MUTEX_SEM_OPTIONS);
if(!evuser->osSpecific.lock){
return S_cas_noMemory;
}
evuser->osSpecific.ppendsem = semBCreate(SEM_Q_PRIORITY, SEM_EMPTY);
if(!evuser->osSpecific.ppendsem){
semDelete(evuser->osSpecific.lock);
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* caeqOSSpecificDelete()
*/
void caeqOSSpecificDelete(caEventUser *evuser)
{
int status;
if(taskIdVerify(evuser->osSpecific.taskid)==OK){
taskwdRemove(evuser->osSpecific.taskid);
taskDelete(evuser->osSpecific.taskid);
}
status = semDelete(evuser->osSpecific.lock);
assert(status == OK);
status = semDelete(evuser->osSpecific.ppendsem);
assert(status == OK);
}
/*
* caeqOSSpecificPVInit ()
*/
caStatus caeqOSSpecificPVInit (casPVInUse *pPV)
{
pPV->osSpecific.lock = semMCreate(MUTEX_SEM_OPTIONS);
if (!pPV->osSpecific.lock) {
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* caeqOSSpecificPVDelete ()
*/
void caeqOSSpecificPVDelete (casPVInUse *pPV)
{
int status;
status = semDelete (pPV->osSpecific.lock);
assert (status == OK);
}
/*
* caeqOSSpecificEventNotify()
*/
void caeqOSSpecificEventNotify(caEventUser *evuser)
{
int status;
status = semGive(evuser->osSpecific.ppendsem);
assert(status == OK);
}
/*
* caeqStartEvents()
*/
int caeqStartEvents(
struct event_user *evuser,
char *taskname, /* defaulted if NULL */
void (*init_func)(),
int init_func_arg,
int priority_offset
)
{
int status;
int taskpri;
/* only one ca_pend_event thread may be started for each evuser ! */
while(!vxTas(&evuser->osSpecific.pendlck))
return ERROR;
status = taskPriorityGet(taskIdSelf(), &taskpri);
if(status == ERROR){
return ERROR;
}
taskpri += priority_offset;
if(!taskname){
taskname = EVENT_PEND_NAME;
}
status = taskSpawn(
taskname,
taskpri,
EVENT_PEND_OPT,
EVENT_PEND_STACK,
event_task,
(int)evuser,
(int)init_func,
(int)init_func_arg,
0,0,0,0,0,0,0);
if(status == ERROR){
return ERROR;
}
evuser->osSpecific.taskid = status;
return OK;
}
/*
* EVENT_TASK()
*/
LOCAL int event_task(
struct event_user *evuser,
void (*init_func)(int init_func_arg),
int init_func_arg
)
{
int status;
taskwdInsert((int)taskIdCurrent,NULL,NULL);
/* init hook */
if(init_func){
(*init_func)(init_func_arg);
}
/*
* No need to lock getix as I only allow one thread to call this
* routine at a time
*/
while(TRUE){
caeqEventProcess(evuser);
status = semTake(evuser->osSpecific.ppendsem, WAIT_FOREVER);
assert(status == OK);
}
}
/*
* caeqOSSpecificClose()
*/
void caeqOSSpecificClose(caEventUser *pEvUser)
{
return;
}
/*
* asciiIPAddr
*/
void asciiIPAddr (struct in_addr addr, char *pBuf, unsigned bufSize)
{
char pName[INET_ADDR_LEN];
inet_ntoa_b (addr, pName);
strncpy (pBuf, pName, bufSize);
pBuf[bufSize-1] = '\0';
}

View File

@@ -1,659 +0,0 @@
/*
*
* vxWorks_depen.c
* %W% %G%
*
* vxWorks dependent routines for the CA server
*
*
*/
#include<casdef.h>
#include <inetLib.h>
VERSIONID(vxWorks_depenc,"%W% %G%")
#define MUTEX_SEM_OPTIONS \
(SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE)
LOCAL int event_task(
struct event_user *evuser,
void (*init_func)(int arg),
int init_func_arg
);
LOCAL void osDepenTimerCB(void *pciu);
LOCAL void osDepenSendCB(void *pClient);
int caServerTask(struct rsrv *pRsrv);
LOCAL int caMaxFreeBlockPoll(void);
size_t caMaxFreeBlock;
###### no event flush currently (only needed in multi thread env) ####
status = caeqAddFlushEvent (client->evuser, XXXX, client);
assert (status==OK);
/*
* caGetElapsedTime()
*/
caStatus caGetElapsedTime(caElapsedTimeVal *pElapsed)
{
ULONG ticks;
ULONG rate;
ticks = tickGet();
rate = sysClkRateGet();
pElapsed->tv_sec = ticks * rate;
pElapsed->tv_usec = ((ticks % rate)*CAServerUSecInSec)/rate;
return S_cas_success;
}
/*
* caOutOfMemory()
*/
int caOutOfMemory(void)
{
int status;
static int pollTaskStarted;
if(!pollTaskStarted){
caMaxFreeBlock = memFindMax();
status = taskSpawn(
MAXFREEBLOCKTASKNAME,
MAXFREEBLOCKTASKPRI,
MAXFREEBLOCKTASKOPT,
MAXFREEBLOCKTASKSTACK,
caMaxFreeBlockPoll,
0,0,0,0,0,0,0,0,0,0);
if(status>=0){
pollTaskStarted = TRUE;
}
}
return (caMaxFreeBlock<MAX_BLOCK_THRESHOLD);
}
/*
* caMaxFreeBlockPoll()
*/
LOCAL int caMaxFreeBlockPoll(void)
{
while(TRUE){
caMaxFreeBlock = memFindMax();
taskDelay(MAXFREEBLOCKPOLL*sysClkRateGet());
}
}
/*
* casPutCBStartTimer()
*/
caStatus casPutCBStartTimer(
casChanInUse *pciu,
unsigned timeOutSec
)
{
struct client *pClient = pciu->client;
caserver *pRsrv = pClient->cc.pRsrv;
struct timeval tv;
if(pClient->cc.osSpecific.pPutCBAlarm){
tv.tv_sec = timeOutSec;
tv.tv_usec = 0;
pClient->cc.osSpecific.pPutCBAlarm
= fdmgr_add_timeout(
pRsrv->osSpecific.pfdctx,
&tv,
osDepenTimerCB,
pciu);
if(!pClient->cc.osSpecific.pPutCBAlarm){
return S_cas_noMemory;
}
}
return S_cas_success;
}
/*
* osDepenTimerCB()
*/
LOCAL void osDepenTimerCB(void *pParam)
{
casChanInUse *pciu = (casChanInUse *)pParam;
pciu->client->cc.osSpecific.pPutCBAlarm = NULL;
casPutCBTimer(pciu);
}
/*
* casPutCBCancelTimer()
*/
void casPutCBCancelTimer(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(pClient->cc.osSpecific.pPutCBAlarm){
status = fdmgr_clear_timeout(
pRsrv->osSpecific.pfdctx,
pClient->cc.osSpecific.pPutCBAlarm);
assert(status==0);
pClient->cc.osSpecific.pPutCBAlarm = NULL;
}
}
/*
* casDisableSocketRecvIOCallback()
*/
caStatus casDisableSocketRecvIOCallback(struct client *pClient)
{
int status;
if(pClient->cc.osSpecific.sockRecvIOCallbackEnabled){
status = fdmgr_clear_callback(
pClient->cc.pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_read);
assert(status==0);
pClient->cc.osSpecific.sockRecvIOCallbackEnabled = FALSE;
}
return S_cas_success;
}
/*
* casEnableSocketRecvIOCallback()
*/
caStatus casEnableSocketRecvIOCallback(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(!pClient->cc.osSpecific.sockRecvIOCallbackEnabled){
status = fdmgr_add_callback(
pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_read,
pClient->cc.pCB,
pClient);
if(status){
return S_cas_noMemory;
}
pClient->cc.osSpecific.sockRecvIOCallbackEnabled = TRUE;
}
return S_cas_success;
}
/*
* casWaitForIO ()
*/
caStatus casWaitForIO (struct rsrv *pRsrv, caTime *pDelay)
{
struct timeval tv;
tv.tv_sec = caTime->sec;
tv.tv_usec = caTime->nsec / NSecPerUsec;
status = fdmgr_pend_event(pRsrv->osSpecific.pfdctx, &tv);
if (status) {
return S_cas_internal;
}
return S_cas_success;
}
/*
* casArmSocketSendIOCallback()
*/
caStatus casArmSocketSendIOCallback(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(!pClient->cc.osSpecific.sockSendIOCallbackEnabled){
status = fdmgr_add_callback(
pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_write,
osDepenSendCB,
pClient);
if(status){
return S_cas_noMemory;
}
pClient->cc.osSpecific.sockSendIOCallbackEnabled = TRUE;
}
return S_cas_success;
}
/*
* casCancelSocketSendIOCallback()
*/
caStatus casCancelSocketSendIOCallback(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(pClient->cc.osSpecific.sockSendIOCallbackEnabled){
status = fdmgr_clear_callback(
pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_write);
assert(status==0);
pClient->cc.osSpecific.sockSendIOCallbackEnabled = FALSE;
}
return S_cas_success;
}
/*
* osDepenSendCB()
*/
LOCAL void osDepenSendCB(void *pParam)
{
struct client *pClient = (struct client *) pParam;
pClient->cc.osSpecific.sockSendIOCallbackEnabled = FALSE;
(*pClient->sendHandler)(pClient);
}
/*
* casOSSpecificDelete()
*/
void casOSSpecificDelete(struct rsrv *pRsrv)
{
int status;
if(taskIdVerify(pRsrv->osSpecific.selectTask) == OK){
taskwdRemove(taskDelete(pRsrv->osSpecific.selectTask));
taskDelete(pRsrv->osSpecific.selectTask);
}
if(pRsrv->osSpecific.clientQLock){
status = semDelete(pRsrv->osSpecific.clientQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.freeChanQLock){
status = semDelete(pRsrv->osSpecific.freeChanQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.freeEventQLock){
status = semDelete(pRsrv->osSpecific.freeEventQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.pvQLock){
status = semDelete(pRsrv->osSpecific.pvQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.pfdctx){
status = fdmgr_delete(pRsrv->osSpecific.pfdctx);
assert(status==OK);
}
}
/*
* casOSSpecificInit()
*/
caStatus casOSSpecificInit(struct rsrv *pRsrv)
{
pRsrv->osSpecific.clientQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.clientQLock){
return S_cas_noMemory;
}
pRsrv->osSpecific.freeChanQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.freeChanQLock){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.freeEventQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.freeEventQLock){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.pvQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.pvQLock){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.pfdctx = fdmgr_init();
if(!pRsrv->osSpecific.pfdctx){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* casOSSpecificStartServer()
*/
caStatus casOSSpecificStartServer(caserver *pRsrv)
{
int status;
status = fdmgr_add_callback(
pRsrv->osSpecific.pfdctx,
pRsrv->server_sock,
fdi_read,
rsrv_connect,
pRsrv);
if(status < 0){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
status = taskSpawn(
REQ_SRVR_NAME,
REQ_SRVR_PRI,
REQ_SRVR_OPT,
RSP_SRVR_STACK,
caServerTask,
(int)pRsrv,
0,0,0,0,0,0,0,0,0);
if(status == ERROR){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.selectTask = status;
return S_cas_success;
}
/*
* caServerTask()
*/
int caServerTask(caserver *pRsrv)
{
struct timeval tv;
caTime delay;
struct client *pClient;
int nchars;
int status;
taskwdInsert((int)taskIdCurrent,NULL,NULL);
while(TRUE){
delay.sec = 100;
delay.usec = 0;
status = caServerProcess (pRsrv, &delay);
assert (status == S_cas_success);
}
}
/*
* casSchedualBeacon()
*/
void casSchedualBeacon(struct rsrv *pRsrv)
{
fdmgrAlarm *tmp;
struct timeval tv;
tv.tv_sec = pRsrv->delayToNextBeacon.tv_sec;
tv.tv_usec = pRsrv->delayToNextBeacon.tv_usec;
tmp = fdmgr_add_timeout(
pRsrv->osSpecific.pfdctx,
&tv,
casSendBeacon,
pRsrv);
if(!tmp){
ca_printf("CAS: Unable to keep beacon going\n");
}
}
/*
* casOSSpecificClientInit()
*/
caStatus casOSSpecificClientInit(struct client *client)
{
client->cc.osSpecific.eventQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.eventQLock){
return S_cas_noMemory;
}
client->cc.osSpecific.chanQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.chanQLock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
client->cc.osSpecific.putNotifyLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.putNotifyLock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
client->cc.osSpecific.lock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.lock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
client->cc.osSpecific.accessRightsQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.accessRightsQLock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* casOSSpecificClientDelete()
*/
void casOSSpecificClientDelete(struct client *client)
{
int status;
if(client->cc.osSpecific.eventQLock){
status = semDelete(client->cc.osSpecific.eventQLock);
assert(status==OK);
}
if(client->cc.osSpecific.chanQLock){
status = semDelete(client->cc.osSpecific.chanQLock);
assert(status==OK);
}
if(client->cc.osSpecific.putNotifyLock){
status = semDelete(client->cc.osSpecific.putNotifyLock);
assert(status==OK);
}
if(client->cc.osSpecific.lock){
status = semDelete(client->cc.osSpecific.lock);
assert(status==OK);
}
if(client->cc.osSpecific.accessRightsQLock){
status = semDelete(client->cc.osSpecific.accessRightsQLock);
assert(status==OK);
}
}
/*
* caeqOSSpecificInit()
*/
caStatus caeqOSSpecificInit(caEventUser *evuser)
{
evuser->osSpecific.lock = semMCreate(MUTEX_SEM_OPTIONS);
if(!evuser->osSpecific.lock){
return S_cas_noMemory;
}
evuser->osSpecific.ppendsem = semBCreate(SEM_Q_PRIORITY, SEM_EMPTY);
if(!evuser->osSpecific.ppendsem){
semDelete(evuser->osSpecific.lock);
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* caeqOSSpecificDelete()
*/
void caeqOSSpecificDelete(caEventUser *evuser)
{
int status;
if(taskIdVerify(evuser->osSpecific.taskid)==OK){
taskwdRemove(evuser->osSpecific.taskid);
taskDelete(evuser->osSpecific.taskid);
}
status = semDelete(evuser->osSpecific.lock);
assert(status == OK);
status = semDelete(evuser->osSpecific.ppendsem);
assert(status == OK);
}
/*
* caeqOSSpecificPVInit ()
*/
caStatus caeqOSSpecificPVInit (casPVInUse *pPV)
{
pPV->osSpecific.lock = semMCreate(MUTEX_SEM_OPTIONS);
if (!pPV->osSpecific.lock) {
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* caeqOSSpecificPVDelete ()
*/
void caeqOSSpecificPVDelete (casPVInUse *pPV)
{
int status;
status = semDelete (pPV->osSpecific.lock);
assert (status == OK);
}
/*
* caeqOSSpecificEventNotify()
*/
void caeqOSSpecificEventNotify(caEventUser *evuser)
{
int status;
status = semGive(evuser->osSpecific.ppendsem);
assert(status == OK);
}
/*
* caeqStartEvents()
*/
int caeqStartEvents(
struct event_user *evuser,
char *taskname, /* defaulted if NULL */
void (*init_func)(),
int init_func_arg,
int priority_offset
)
{
int status;
int taskpri;
/* only one ca_pend_event thread may be started for each evuser ! */
while(!vxTas(&evuser->osSpecific.pendlck))
return ERROR;
status = taskPriorityGet(taskIdSelf(), &taskpri);
if(status == ERROR){
return ERROR;
}
taskpri += priority_offset;
if(!taskname){
taskname = EVENT_PEND_NAME;
}
status = taskSpawn(
taskname,
taskpri,
EVENT_PEND_OPT,
EVENT_PEND_STACK,
event_task,
(int)evuser,
(int)init_func,
(int)init_func_arg,
0,0,0,0,0,0,0);
if(status == ERROR){
return ERROR;
}
evuser->osSpecific.taskid = status;
return OK;
}
/*
* EVENT_TASK()
*/
LOCAL int event_task(
struct event_user *evuser,
void (*init_func)(int init_func_arg),
int init_func_arg
)
{
int status;
taskwdInsert((int)taskIdCurrent,NULL,NULL);
/* init hook */
if(init_func){
(*init_func)(init_func_arg);
}
/*
* No need to lock getix as I only allow one thread to call this
* routine at a time
*/
while(TRUE){
caeqEventProcess(evuser);
status = semTake(evuser->osSpecific.ppendsem, WAIT_FOREVER);
assert(status == OK);
}
}
/*
* caeqOSSpecificClose()
*/
void caeqOSSpecificClose(caEventUser *pEvUser)
{
return;
}
/*
* asciiIPAddr
*/
void asciiIPAddr (struct in_addr addr, char *pBuf, unsigned bufSize)
{
char pName[INET_ADDR_LEN];
inet_ntoa_b (addr, pName);
strncpy (pBuf, pName, bufSize);
pBuf[bufSize-1] = '\0';
}

View File

@@ -1,256 +0,0 @@
#include <vxWorks.h>
#include <taskLib.h>
#include <errnoLib.h>
#include <logLib.h>
#include <tickLib.h>
#include <sysLib.h>
#include <vxLib.h>
#include <ioLib.h>
#include <usrLib.h>
#include <semLib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sockLib.h> /* for sendto() setsockopt() etc */
#include <netinet/in.h>
#include <netinet/tcp.h>
/*
* EPICS on vxWorks
*/
#include <task_params.h>
#include <taskwd.h>
#include <fdmgr.h>
extern size_t caMaxFreeBlock;
#define MAXFREEBLOCKPOLL 5 /* sec */
#define MAXFREEBLOCKTASKNAME "caMemPoll"
#define MAXFREEBLOCKTASKPRI 255
#define MAXFREEBLOCKTASKOPT (VX_FP_TASK)
#define MAXFREEBLOCKTASKSTACK 4095
/*
* per server locks
* ================
*/
#define LOCK_CLIENTQ(PRSRV) \
{ \
int status; \
status = semTake((PRSRV)->osSpecific.clientQLock, WAIT_FOREVER); \
assert(status==OK); \
}
#define UNLOCK_CLIENTQ(PRSRV) \
{ \
int status; \
status = semGive((PRSRV)->osSpecific.clientQLock); \
assert(status==OK); \
}
#define LOCK_FREE_CHAN_Q(PRSRV) \
{\
int status;\
status = semTake((PRSRV)->osSpecific.freeChanQLock, WAIT_FOREVER);\
assert(status==OK);\
}
#define UNLOCK_FREE_CHAN_Q(PRSRV) \
{ \
int status;\
status = semGive((PRSRV)->osSpecific.freeChanQLock);\
assert(status==OK);\
}
#define LOCK_FREE_EVENT_Q(PRSRV) \
{\
int status;\
status = semTake((PRSRV)->osSpecific.freeEventQLock, WAIT_FOREVER);\
assert(status==OK);\
}
#define UNLOCK_FREE_EVENT_Q(PRSRV) \
{ \
int status;\
status = semGive((PRSRV)->osSpecific.freeEventQLock);\
assert(status==OK);\
}
#define LOCK_PVQ(PRSRV) \
{ \
int status; \
status = semTake((PRSRV)->osSpecific.pvQLock, WAIT_FOREVER); \
assert(status==OK); \
}
#define UNLOCK_PVQ(PRSRV) \
{ \
int status;\
status = semGive((PRSRV)->osSpecific.pvQLock);\
assert(status==OK);\
}
/*
* per client locks
* ================
*/
#define SEND_LOCK(CLIENT) \
{\
int status;\
status = semTake((CLIENT)->cc.osSpecific.lock, WAIT_FOREVER);\
assert(status==OK);\
}
#define SEND_UNLOCK(CLIENT) \
{ \
int status;\
status = semGive((CLIENT)->cc.osSpecific.lock);\
assert(status==OK);\
}
#define LOCK_CHAN_Q(PCLIENT) \
{\
int status;\
status = semTake((PCLIENT)->cc.osSpecific.chanQLock, WAIT_FOREVER);\
assert(status==OK);\
}
#define UNLOCK_CHAN_Q(PCLIENT) \
{ \
int status;\
status = semGive((PCLIENT)->cc.osSpecific.chanQLock);\
assert(status==OK);\
}
#define LOCK_EVENT_Q(PCLIENT) \
{\
int status;\
status = semTake((PCLIENT)->cc.osSpecific.eventQLock, WAIT_FOREVER);\
assert(status==OK);\
}
#define UNLOCK_EVENT_Q(PCLIENT) \
{ \
int status;\
status = semGive((PCLIENT)->cc.osSpecific.eventQLock);\
assert(status==OK);\
}
#define LOCK_PUT_NOTIFY(PCLIENT) \
{\
int status;\
status = semTake((PCLIENT)->cc.osSpecific.putNotifyLock, WAIT_FOREVER);\
assert(status==OK);\
}
#define UNLOCK_PUT_NOTIFY(PCLIENT) \
{ \
int status;\
status = semGive((PCLIENT)->cc.osSpecific.putNotifyLock);\
assert(status==OK);\
}
#define LOCK_ACCESS_RIGHTS_Q(PCLIENT) \
{\
int status;\
status = semTake((PCLIENT)->cc.osSpecific.accessRightsQLock, \
WAIT_FOREVER);\
assert(status==OK);\
}
#define UNLOCK_ACCESS_RIGHTS_Q(PCLIENT) \
{ \
int status;\
status = semGive((PCLIENT)->cc.osSpecific.accessRightsQLock);\
assert(status==OK);\
}
/*
* event system locks
* ==================
*/
#define CA_EVENT_LOCK(PEVUSER) \
{ \
int status;\
status = semTake((PEVUSER)->osSpecific.lock, WAIT_FOREVER);\
assert(status==OK);\
}
#define CA_EVENT_UNLOCK(PEVUSER) \
{ \
int status;\
status = semGive((PEVUSER)->osSpecific.lock);\
assert(status==OK);\
}
#define LOCK_PV(PPV) \
{ \
int status;\
status = semTake((PPV)->osSpecific.lock, WAIT_FOREVER);\
assert(status==OK);\
}
#define UNLOCK_PV(PPV) \
{ \
int status;\
status = semGive((PPV)->osSpecific.lock);\
assert(status==OK);\
}
/*
* vxWorks specific addition to event_user struct
*/
typedef struct {
SEM_ID lock;
SEM_ID ppendsem;
int taskid;
char pendlck;
}caeqOsSpecific;
typedef struct {
SEM_ID lock;
}caPVOsSpecific;
/*
* vxWorks specific addition to rsrv struct
*/
typedef struct {
fdctx *pfdctx;
SEM_ID clientQLock;
SEM_ID pvQLock;
SEM_ID freeChanQLock;
SEM_ID freeEventQLock;
int selectTask;
}rsrvOsSpecific;
/*
* vxWorks specific addition to client struct
*/
typedef struct {
SEM_ID lock;
SEM_ID putNotifyLock;
SEM_ID chanQLock;
SEM_ID eventQLock;
SEM_ID accessRightsQLock;
fdmgrAlarm *pPutCBAlarm;
unsigned sockSendIOCallbackEnabled:1;
unsigned sockRecvIOCallbackEnabled:1;
}clientOsSpecific;
typedef int SOCKET;
#define SOCKERRNO errno
#define socket_close(S) close(S)
/* vxWorks still has brain dead func proto for ioctl() */
#define socket_ioctl(A,B,C) ioctl(A,B,(int)C)
/* leave task around for debugging if we fail */
#define abort(A) taskSuspend(0)

View File

@@ -49,5 +49,5 @@ sf2db: sf2dbYacc.o
sf2dbYacc.o: sf2dbLex.c
clean::
/bin/rm -f sf2dbYacc.c sf2dbLex.c
$(RM) -f sf2dbYacc.c sf2dbLex.c

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