More R3.14 changes.
This commit is contained in:
@@ -7,8 +7,8 @@ TOP = ../..
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
DIRS += include
|
||||
DIRS += db
|
||||
DIRS += libvxWorks
|
||||
DIRS += db
|
||||
DIRS += drv
|
||||
DIRS += dev
|
||||
DIRS += devOpt
|
||||
|
||||
@@ -3,14 +3,14 @@ TOP=../../..
|
||||
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
INC += drvTS.h
|
||||
#INC += drvTS.h moved header to src/include
|
||||
INC += devLib.h
|
||||
|
||||
vxDbLib_SRCS += drvTS.c
|
||||
vxDbLib_SRCS += devLib.c
|
||||
vxDbLib_SRCS += devLibVxWorks.c
|
||||
|
||||
IOC_LIBRARY_vxWorks = vxDbLib
|
||||
LIBRARY_vxWorks = vxDbLib
|
||||
|
||||
include $(TOP)/configure/RULES_BUILD
|
||||
|
||||
|
||||
@@ -1,252 +0,0 @@
|
||||
#ifndef __DRVTS_h__
|
||||
#define __DRVTS_h__
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.2 1998/03/19 20:41:16 mrk
|
||||
* Checked for Y2K complience. It turns out it was even ok when NTP time overflows
|
||||
* in 2036. However it was modified so that no overflows should occur while convert
|
||||
* ing between NTP, UNIX, and EPICS epochs.
|
||||
* In addition the conversion of fractions of a second to nanaoseconds was changed
|
||||
* Formatting was changed so that interesting code does not run off right side of page.
|
||||
* Hopefully EPICS base is now fine for Y2K.
|
||||
* In fact it should be fine (as far as time is converned) until the Unix epoch
|
||||
* overflows a 32 unsigned integer in the year 2106.
|
||||
*
|
||||
* Revision 1.1 1996/01/25 21:11:56 mrk
|
||||
* moved includes; .ascii=> .db; path changes
|
||||
*
|
||||
* Revision 1.12 1995/08/30 15:39:07 jbk
|
||||
* Added global variables for force accurate time stamps and direct time.
|
||||
*
|
||||
* Revision 1.11 1995/08/18 13:18:13 mrk
|
||||
* Added function prototypes for ansi c
|
||||
*
|
||||
* Revision 1.10 1995/08/17 20:35:52 jbk
|
||||
* fixed the debug macro to work with -pendantic option (yuck)
|
||||
*
|
||||
* Revision 1.9 1995/08/17 19:44:08 jbk
|
||||
* Added a new utility function to get the first of the year time stamp.
|
||||
*
|
||||
* Revision 1.8 1995/08/16 19:04:20 jbk
|
||||
* corrected vxworks time troubles
|
||||
*
|
||||
* Revision 1.7 1995/05/22 15:22:24 jbk
|
||||
* changes TS_EXTERN thing
|
||||
*
|
||||
* Revision 1.6 1995/02/01 15:30:17 winans
|
||||
* Added a type field to the configure command to disable the use of the event
|
||||
* system hardware if desired.
|
||||
*
|
||||
* Revision 1.5 1994/10/31 20:36:17 jbk
|
||||
* added new stuff
|
||||
*
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Author: Jim Kowalkowski
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 01-06-94 jbk initial version
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
/*****************************************************************
|
||||
COPYRIGHT NOTIFICATION
|
||||
*****************************************************************
|
||||
|
||||
(C) COPYRIGHT 1993 UNIVERSITY OF CHICAGO
|
||||
|
||||
This software was developed under a United States Government license
|
||||
described on the COPYRIGHT_UniversityOfChicago file included as part
|
||||
of this distribution.
|
||||
**********************************************************************/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <timers.h>
|
||||
#include <semLib.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <tsDefs.h>
|
||||
|
||||
#ifdef TS_DRIVER
|
||||
#define TS_EXTERN
|
||||
#else
|
||||
#define TS_EXTERN extern
|
||||
#endif
|
||||
|
||||
#define ER_EVENT_RESET_TICK 0x7d /* Reset the tick counter */
|
||||
|
||||
#define TS_MAGIC ('T'<<24|'S'<<16|'d'<<8|'r')
|
||||
#define TS_SLAVE_PORT 18322
|
||||
#define TS_MASTER_PORT 18323
|
||||
#define TS_RETRY_COUNT 4
|
||||
#define TS_TIME_OUT_MS 250
|
||||
#define TS_SECS_ASYNC_TRY_MASTER (60*5) /* every five minutes */
|
||||
#define TS_SECS_SYNC_TRY_MASTER (60*1) /* every one minute */
|
||||
|
||||
#define UDP_TIME_PORT 37
|
||||
#define UDP_NTP_PORT 123
|
||||
|
||||
#define TS_BILLION 1000000000
|
||||
#define TS_SYNC_RATE_SEC 10
|
||||
#define TS_CLOCK_RATE_HZ 1000
|
||||
#define TS_TOTAL_EVENTS 128
|
||||
/*Following is (SEC_IN_YEAR*90)+(22*SEC_IN_DAY) */
|
||||
/*22 is leap years from 1900 to 1990*/
|
||||
#define TS_1900_TO_EPICS_EPOCH 2840140800UL
|
||||
/*Following is (SEC_IN_YEAR*70)+(17*SEC_IN_DAY) */
|
||||
/*17 is leap years from 1900 to 1970*/
|
||||
#define TS_1900_TO_VXWORKS_EPOCH 2208988800UL
|
||||
/*Following is (SEC_IN_YEAR*20)+(5*SEC_IN_DAY) */
|
||||
/*5 is leap years from 1970 to 1990*/
|
||||
#define TS_VXWORKS_TO_EPICS_EPOCH 631152000UL
|
||||
|
||||
#define TS_STAMP_SERVER_PRI 70
|
||||
#define TS_SYNC_SERVER_PRI 70
|
||||
#define TS_SYNC_CLIENT_PRI 70
|
||||
#define TS_ASYNC_CLIENT_PRI 70
|
||||
|
||||
typedef enum { TS_time_request, TS_sync_request, TS_sync_msg } TStype;
|
||||
typedef enum { TS_master_alive, TS_master_dead } TSstate;
|
||||
typedef enum { TS_async_none, TS_async_private,
|
||||
TS_async_ntp, TS_async_time } TStime_protocol;
|
||||
typedef enum { TS_sync_master, TS_async_master,
|
||||
TS_sync_slave, TS_async_slave,
|
||||
TS_direct_master, TS_direct_slave} TStime_type;
|
||||
|
||||
struct TSstampTransStruct {
|
||||
unsigned long magic; /* identifier */
|
||||
TStype type; /* transaction type */
|
||||
struct timespec master_time; /* master time stamp - last sync time */
|
||||
struct timespec current_time; /* master current time stamp 1990 epoch */
|
||||
struct timespec unix_time; /* time using 1900 epoch */
|
||||
unsigned long sync_rate; /* master sends sync at this rate */
|
||||
unsigned long clock_hz; /* master clock this frequency (tick rate) */
|
||||
};
|
||||
typedef struct TSstampTransStruct TSstampTrans;
|
||||
|
||||
struct TSinfoStruct {
|
||||
TSstate state;
|
||||
TStime_type type;
|
||||
TStime_protocol async_type;
|
||||
int ts_sync_valid;
|
||||
|
||||
struct timespec *event_table; /* timestamp table */
|
||||
|
||||
unsigned long sync_rate; /* master send sync at this rate */
|
||||
unsigned long clock_hz; /* master clock is this frequency */
|
||||
unsigned long clock_conv;/* conversion factor for tick_rate->ns */
|
||||
unsigned long time_out; /* udp packet time-out in milliseconds */
|
||||
int master_timing_IOC; /* 1=master, 0=slave */
|
||||
int master_port; /* port that master listens on */
|
||||
int slave_port; /* port that slave listens on */
|
||||
int total_events; /* this is the total event in the event system*/
|
||||
int sync_event; /* this is the sync event number */
|
||||
int has_event_system; /* 1=has event system, 0=no event system */
|
||||
int has_direct_time; /* 1=has direct time, 0=no direct time */
|
||||
int UserRequestedType; /* let user force the setting of type */
|
||||
|
||||
SEM_ID sync_occurred;
|
||||
|
||||
struct sockaddr hunt; /* broadcast address info */
|
||||
struct sockaddr master; /* socket info for contacting master */
|
||||
};
|
||||
typedef struct TSinfoStruct TSinfo;
|
||||
|
||||
/* global functions */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
TS_EXTERN long TSinit(void);
|
||||
TS_EXTERN long TSgetTimeStamp(int event_number,struct timespec* ts);
|
||||
TS_EXTERN unsigned long TSepochNtpToUnix(struct timespec* ts);
|
||||
TS_EXTERN unsigned long TSfractionToNano(unsigned long fraction);
|
||||
TS_EXTERN unsigned long TSepochNtpToEpics(struct timespec* ts);
|
||||
TS_EXTERN unsigned long TSepochUnixToEpics(struct timespec* ts);
|
||||
TS_EXTERN unsigned long TSepochEpicsToUnix(struct timespec* ts);
|
||||
TS_EXTERN long TScurrentTimeStamp(struct timespec* ts);
|
||||
TS_EXTERN long TSaccurateTimeStamp(struct timespec* ts);
|
||||
TS_EXTERN long TSgetFirstOfYearVx(struct timespec* ts);
|
||||
TS_EXTERN void TSconfigure(int master, int sync_rate_sec, int clock_rate_hz,
|
||||
int master_port, int slave_port,
|
||||
unsigned long millisecond_request_time_out, int type);
|
||||
TS_EXTERN long TSsetClockFromUnix(void);
|
||||
|
||||
#ifndef TS_DRIVER
|
||||
TS_EXTERN TSinfo TSdata;
|
||||
TS_EXTERN TSdirectTimeVar; /* set to !=0 to indicate direct time available*/
|
||||
TS_EXTERN TSgoodTimeStamps; /* force best time stamps by setting != 0 */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
/* NTP information - all this is backwards and documentation only */
|
||||
#define VN_SHIFT 2 /* Version - 3 bits */
|
||||
#define VN_version 3<<VN_SHIFT
|
||||
|
||||
#define LI_SHIFT 0 /* Leap Indicator LI - 2 bits */
|
||||
#define LI_no_warning (0x00<<LI_SHIFT)
|
||||
#define LI_61_sec_minute (0x01<<LI_SHIFT)
|
||||
#define LI_59_sec_minute (0x02<<LI_SHIFT)
|
||||
#define LI_alarm_condition (0x03<<LI_SHIFT)
|
||||
|
||||
#define MODE_SHIFT 5 /* Mode MODE - 3 bits */
|
||||
#define MODE_reserved (0x00<<MODE_SHIFT)
|
||||
#define MODE_sym_active (0x01<<MODE_SHIFT)
|
||||
#define MODE_sym_passive (0x02<<MODE_SHIFT)
|
||||
#define MODE_client (0x03<<MODE_SHIFT)
|
||||
#define MODE_server (0x04<<MODE_SHIFT)
|
||||
#define MODE_broadcast (0x05<<MODE_SHIFT)
|
||||
#define MODE_reserved_NTP (0x06<<MODE_SHIFT)
|
||||
#define MODE_reserved_pvt (0x07<<MODE_SHIFT)
|
||||
|
||||
#define STRAT_SHIFT 8 /* Stratum STRAT - 8 bits */
|
||||
#define STRAT_unspecified (0x00<<STRAT_SHIFT)
|
||||
#define STRAT_ascii (0x00<<STRAT_SHIFT)
|
||||
#define STRAT_GPS (0x01<<STRAT_SHIFT)
|
||||
#define STRAT_ATOM (0x01<<STRAT_SHIFT)
|
||||
#define STRAT_address (0x02<<STRAT_SHIFT)
|
||||
|
||||
#define POLL_SHIFT 16 /* eight bits */
|
||||
#define PREC_SHIFT 24 /* eight bits */
|
||||
|
||||
struct TS_ntp {
|
||||
/* unsigned int info; */
|
||||
unsigned char info[4];
|
||||
unsigned int root_delay;
|
||||
unsigned int root_disp;
|
||||
unsigned int reference_id;
|
||||
struct timespec reference_ts;
|
||||
struct timespec originate_ts;
|
||||
struct timespec receive_ts;
|
||||
struct timespec transmit_ts;
|
||||
/* char authenticator[96]; (optional) */
|
||||
};
|
||||
typedef struct TS_ntp TS_NTP;
|
||||
|
||||
|
||||
/* debug macro creation */
|
||||
#ifdef NODEBUG
|
||||
#define Debug(l,f,v) ;
|
||||
#else
|
||||
#ifdef MAKE_DEBUG
|
||||
volatile int MAKE_DEBUG = 0;
|
||||
#define Debug(l,f,v) { if(l<= MAKE_DEBUG ) \
|
||||
{ printf("%s:%d: ",__FILE__,__LINE__); printf(f,v); }}
|
||||
#define Debug0(l,f) { if(l<= MAKE_DEBUG ) \
|
||||
{ printf("%s:%d: ",__FILE__,__LINE__); printf(f); }}
|
||||
#else
|
||||
#define Debug(l,f,v) { if(l) \
|
||||
{ printf("%s:%d: ",__FILE__,__LINE__); printf(f,v); }}
|
||||
#define Debug0(l,f) { if(l) \
|
||||
{ printf("%s:%d: ",__FILE__,__LINE__); printf(f); }}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -4,10 +4,10 @@ include $(TOP)/configure/CONFIG
|
||||
|
||||
INC += devApsEr.h
|
||||
|
||||
SRCS += devApsEg.c
|
||||
SRCS += devApsEr.c
|
||||
MYMYSRCS += devApsEg.c
|
||||
MYMYSRCS += devApsEr.c
|
||||
|
||||
IOC_PROD_vxWorks = $(SRCS:%.c=%.o)
|
||||
PROD_vxWorks = $(MYMYSRCS:%.c=%.o)
|
||||
|
||||
include $(TOP)/configure/RULES_BUILD
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ TOP=../../../..
|
||||
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
SRCS += devAt5Vxi.c
|
||||
SRCS += devAt8Fp.c
|
||||
MYSRCS += devAt5Vxi.c
|
||||
MYSRCS += devAt8Fp.c
|
||||
|
||||
IOC_PROD_vxWorks = $(SRCS:%.c=%.o)
|
||||
PROD_vxWorks = $(MYSRCS:%.c=%.o)
|
||||
|
||||
include $(TOP)/configure/RULES_BUILD
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ TOP=../../../..
|
||||
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
SRCS += devSmCompumotor1830.c
|
||||
MYSRCS += devSmCompumotor1830.c
|
||||
|
||||
IOC_PROD_vxWorks = $(SRCS:%.c=%.o)
|
||||
PROD_vxWorks = $(MYSRCS:%.c=%.o)
|
||||
|
||||
include $(TOP)/configure/RULES_BUILD
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ include $(TOP)/configure/CONFIG
|
||||
|
||||
INC += devCommonGpib.h
|
||||
|
||||
SRCS += devCommonGpib.c
|
||||
MYSRCS += devCommonGpib.c
|
||||
|
||||
IOC_PROD_vxWorks = $(SRCS:%.c=%.o)
|
||||
PROD_vxWorks = $(MYSRCS:%.c=%.o)
|
||||
|
||||
include $(TOP)/configure/RULES_BUILD
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ TOP=../../../..
|
||||
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
SRCS += devWfJoergerVtr1.c
|
||||
MYSRCS += devWfJoergerVtr1.c
|
||||
|
||||
IOC_PROD_vxWorks = $(SRCS:%.c=%.o)
|
||||
PROD_vxWorks = $(MYSRCS:%.c=%.o)
|
||||
|
||||
include $(TOP)/configure/RULES_BUILD
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ devLibOpt_SRCS+= devXxDc5009Gpib.c
|
||||
devLibOpt_SRCS+= devXxK263Gpib.c
|
||||
devLibOpt_SRCS+= devXxSkeletonGpib.c
|
||||
|
||||
IOC_PROD_vxWorks = $(devLibOpt_SRCS:%.c=%.o)
|
||||
PROD_vxWorks = $(devLibOpt_SRCS:%.c=%.o)
|
||||
|
||||
IOC_LIBRARY_vxWorks = devLibOpt
|
||||
LIBRARY_vxWorks = devLibOpt
|
||||
|
||||
include $(TOP)/configure/RULES_BUILD
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ SRCS.c += ../drvIpac.c
|
||||
SRCS.c += ../drvTip810.c
|
||||
#SRCS.c += ../drvVmic2534.c
|
||||
|
||||
IOC_PROD_vxWorks = $(SRCS.c:../%.c=%.o)
|
||||
PROD_vxWorks = $(SRCS.c:../%.c=%.o)
|
||||
|
||||
MAN3 = drvEpvxi.3
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ SRCS.c += ../drvXy220.c
|
||||
SRCS.c += ../drvXy240.c
|
||||
SRCS.c += ../drvXy566.c
|
||||
|
||||
IOC_PROD_vxWorks = $(SRCS.c:../%.c=%.o)
|
||||
PROD_vxWorks = $(SRCS.c:../%.c=%.o)
|
||||
|
||||
include $(TOP)/configure/RULES_BUILD
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ include $(TOP)/configure/CONFIG
|
||||
|
||||
INC += camacLib.h
|
||||
INC += module_types.h
|
||||
INC += task_params.h
|
||||
INC += fast_lock.h
|
||||
#INC += task_params.h moved header to src/include
|
||||
#INC += fast_lock. moved header to src/includeh
|
||||
|
||||
include $(TOP)/configure/RULES_BUILD
|
||||
|
||||
|
||||
@@ -1,191 +0,0 @@
|
||||
/* fast_lock.h */
|
||||
/* share/epicsH $Id$ */
|
||||
|
||||
/*
|
||||
* Author: Jeff Hill
|
||||
* Date: 4-11-89
|
||||
*
|
||||
* 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 joh 041189 initial release into middle age
|
||||
* .02 joh 071989 added fast lock test
|
||||
* .03 joh 090391 VRTX kernel ifdef for V5 vxWorks
|
||||
* .04 joh 091091 Now uses V5 vxWorks binary semaphore
|
||||
* .05 joh 092491 Dont use V5 semaphore on V3 EPICS yet
|
||||
* .06 jba 030692 added cast to vxTas arg in FASTLOCK vxWorks5
|
||||
* .07 jba 081092 added cast to vxTas arg in FASTLOCKNOWAIT
|
||||
* .08 mgb 082493 Removed V5/V4 conditional defines
|
||||
* .09 joh 082493 include vxLib.h for vxWorks V5.1
|
||||
* .10 joh 082593 made lock char as vxTas expects
|
||||
* (padded structure to identical size)
|
||||
* .11 joh 082593 made fast lock structure fields volatile
|
||||
* .12 joh 091493 added sem and task lock based fast locks
|
||||
* with ifdefs - removed volatile
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
* Macros and data structures for a much faster (than vrtx semaphore)
|
||||
* mutual exclusion lock/unlock.
|
||||
* (semaphore in this case is only used to wait for unlock)
|
||||
*
|
||||
* On a 68020 the following times include lock and unlock
|
||||
*
|
||||
* FASTLOCK-FASTUNLOCK 8 microsecs
|
||||
* semTake-semGive(Macro) 80 microsecs
|
||||
* semTake-semGive 92 microsecs
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef INCLfast_lockh
|
||||
#define INCLfast_lockh
|
||||
|
||||
#ifndef INCLsemLibh
|
||||
#include <semLib.h>
|
||||
#endif
|
||||
#ifndef INCLvxLibh
|
||||
#include <vxLib.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macro equivalent of vxWorks glue for better performance
|
||||
*/
|
||||
#ifdef VRTX_KERNEL
|
||||
# define semGive(SEMID)\
|
||||
{ if ((SEMID)->count == 0)vrtxPost (&((SEMID)->count), 1); }
|
||||
|
||||
# define semTake(SEMID)\
|
||||
{int dummy; vrtxPend (&((SEMID)->count), 0, &dummy); }
|
||||
#endif
|
||||
|
||||
typedef struct{
|
||||
SEM_ID ppend; /* wait for lock sem */
|
||||
unsigned short count; /* cnt of tasks waiting for lock */
|
||||
unsigned char lock; /* test and set lock bit */
|
||||
char pad; /* structure alignment */
|
||||
}FAST_LOCK;
|
||||
|
||||
#define SEM_FAST_LOCK
|
||||
|
||||
#if defined(SEM_FAST_LOCK) /* no lock test */
|
||||
|
||||
#define FASTLOCKINIT(PFAST_LOCK)\
|
||||
(((FAST_LOCK *)(PFAST_LOCK))->ppend = \
|
||||
semMCreate(SEM_DELETE_SAFE|SEM_INVERSION_SAFE|SEM_Q_PRIORITY))
|
||||
#define FASTLOCKFREE(PFAST_LOCK)\
|
||||
semDelete( ((FAST_LOCK *)(PFAST_LOCK))->ppend )
|
||||
#define FASTLOCK(PFAST_LOCK)\
|
||||
semTake(((FAST_LOCK *)(PFAST_LOCK))->ppend, WAIT_FOREVER);
|
||||
#define FASTUNLOCK(PFAST_LOCK)\
|
||||
semGive(((FAST_LOCK *)(PFAST_LOCK))->ppend);
|
||||
#define FASTLOCKNOWAIT(PFAST_LOCK) \
|
||||
((semTake(((FAST_LOCK *)(PFAST_LOCK))->ppend,NO_WAIT)==0) ? TRUE : FALSE)
|
||||
#define FASTLOCKTEST(PFAST_LOCK) \
|
||||
(\
|
||||
(semTake(((FAST_LOCK *)(PFAST_LOCK))->ppend,NO_WAIT)==0 )\
|
||||
? (semGive(((FAST_LOCK *)(PFAST_LOCK))->ppend),FALSE)\
|
||||
: TRUE \
|
||||
)
|
||||
|
||||
|
||||
#elif defined(TASK_LOCK_FAST_LOCK)
|
||||
|
||||
#define FASTLOCKINIT(PFAST_LOCK)\
|
||||
(\
|
||||
((FAST_LOCK *)(PFAST_LOCK))->count =0, \
|
||||
((FAST_LOCK *)(PFAST_LOCK))->lock =0, \
|
||||
((FAST_LOCK *)(PFAST_LOCK))->ppend = \
|
||||
semBCreate(SEM_Q_PRIORITY, SEM_EMPTY) \
|
||||
)
|
||||
#define FASTLOCKFREE(PFAST_LOCK)\
|
||||
semDelete( ((FAST_LOCK *)(PFAST_LOCK))->ppend )
|
||||
|
||||
#define FASTLOCK(PFAST_LOCK)\
|
||||
{\
|
||||
TASK_LOCK;\
|
||||
while( ((FAST_LOCK *)(PFAST_LOCK))->lock ){\
|
||||
((FAST_LOCK *)(PFAST_LOCK))->count++;\
|
||||
TASK_UNLOCK;\
|
||||
semTake(((FAST_LOCK *)(PFAST_LOCK))->ppend, WAIT_FOREVER);\
|
||||
TASK_LOCK;\
|
||||
(((FAST_LOCK *)(PFAST_LOCK))->count)--;\
|
||||
}\
|
||||
((FAST_LOCK *)(PFAST_LOCK))->lock= TRUE;
|
||||
TASK_UNLOCK;
|
||||
}
|
||||
|
||||
#define FASTUNLOCK(PFAST_LOCK)\
|
||||
{\
|
||||
((FAST_LOCK *)(PFAST_LOCK))->lock = FALSE;\
|
||||
if( ((FAST_LOCK *)(PFAST_LOCK))->count )\
|
||||
semGive(((FAST_LOCK *)(PFAST_LOCK))->ppend);\
|
||||
};
|
||||
|
||||
#define FASTLOCKTEST(PFAST_LOCK)\
|
||||
( ((FAST_LOCK *)(PFAST_LOCK))->lock )
|
||||
|
||||
#else /* vxTas() fast lock */
|
||||
|
||||
/*
|
||||
* extra paren avoids order of ops problems
|
||||
* (returns what semBCreate returns on v5 vxWorks)
|
||||
*/
|
||||
#define FASTLOCKINIT(PFAST_LOCK)\
|
||||
(\
|
||||
((FAST_LOCK *)(PFAST_LOCK))->count =0, \
|
||||
((FAST_LOCK *)(PFAST_LOCK))->lock =0, \
|
||||
((FAST_LOCK *)(PFAST_LOCK))->ppend = \
|
||||
semBCreate(SEM_Q_PRIORITY, SEM_EMPTY) \
|
||||
)
|
||||
|
||||
/*
|
||||
* new requirement with v5 vxWorks
|
||||
*/
|
||||
#define FASTLOCKFREE(PFAST_LOCK)\
|
||||
semDelete( ((FAST_LOCK *)(PFAST_LOCK))->ppend )
|
||||
|
||||
#define FASTLOCK(PFAST_LOCK)\
|
||||
{\
|
||||
((FAST_LOCK *)(PFAST_LOCK))->count++;\
|
||||
while(!vxTas( (char *)&( ((FAST_LOCK *)(PFAST_LOCK))->lock ) ))\
|
||||
semTake(((FAST_LOCK *)(PFAST_LOCK))->ppend, WAIT_FOREVER);\
|
||||
( ((FAST_LOCK *)(PFAST_LOCK))->count)--;\
|
||||
}
|
||||
|
||||
#define FASTUNLOCK(PFAST_LOCK)\
|
||||
{\
|
||||
((FAST_LOCK *)(PFAST_LOCK))->lock = FALSE;\
|
||||
if( ((FAST_LOCK *)(PFAST_LOCK))->count )\
|
||||
semGive(((FAST_LOCK *)(PFAST_LOCK))->ppend);\
|
||||
};
|
||||
|
||||
#define FASTLOCKNOWAIT(PFAST_LOCK) (vxTas((char *)&(((FAST_LOCK *)(PFAST_LOCK))->lock)))
|
||||
|
||||
#define FASTLOCKTEST(PFAST_LOCK)\
|
||||
( ((FAST_LOCK *)(PFAST_LOCK))->lock )
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* Nothing after this endif */
|
||||
@@ -1,267 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Parameters for tasks on IOC */
|
||||
/*
|
||||
* Authors: Andy Kozubal, Jeff Hill, and Bob Dalesio
|
||||
* Date: 2-24-89
|
||||
*
|
||||
* 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 07-23-91 ges Add time-stamp task.
|
||||
* .02 09-12-91 joh stack sizes increased for v5 vxWorks.
|
||||
* .03 10-24-91 lrd Increased stack sizes for scan tasks
|
||||
* .04 12-12-91 joh Increased stack size for the
|
||||
* wfDoneTask
|
||||
* .05 12-18-91 mrk Added callback task priorities
|
||||
* Changed def of PERIODSCAN_PRI and SEQUENCER_PRI
|
||||
* Shortened length of task names
|
||||
* .06 12-18-91 jba Global change of WDSCAN to TASKWD
|
||||
* .07 01-21-92 rcz Increased all stack sizes by 1000 for V5
|
||||
* .08 01-21-92 jrw added the GPIB & BB driver task info
|
||||
* .09 01-04-92 jba Added callback task priorities
|
||||
* .10 03-16-92 jrw added BB rx and tx specific task info
|
||||
* .11 05-22-92 lrd added the allen-bradley binary input Change of State scanner
|
||||
* .12 08-26-92 joh added xy 240 stuff
|
||||
* .13 08-26-92 joh added FP to CA repeater and on line to be safe
|
||||
* .14 02-16-92 joh removed historical items
|
||||
* .15 11-19-93 joh moved CA client priority up by one notch
|
||||
* .16 09-13-93 joh incresed CA on line beacon maximum delay
|
||||
* to 60 sec
|
||||
* .17 03-18-94 mcn added entries for breakpoint tasks
|
||||
* $Log$
|
||||
* Revision 1.3 1998/05/20 21:00:43 mrk
|
||||
* raised DB_CA_PRI to just higher than sequencer
|
||||
*
|
||||
* Revision 1.2 1998/01/20 21:49:54 mrk
|
||||
* added the arch_stack_factor for 64 bit architectures; changes for errlog
|
||||
*
|
||||
* Revision 1.1 1996/11/22 20:49:43 jhill
|
||||
* installed
|
||||
*
|
||||
* Revision 1.1 1996/06/24 13:32:35 mrk
|
||||
* added task_params.h
|
||||
*
|
||||
* Revision 1.3 1996/06/19 20:48:44 jhill
|
||||
* dounled ca stack for each ca cleint in the server
|
||||
*
|
||||
* Revision 1.2 1996/04/22 14:31:08 mrk
|
||||
* Changes for dynamic link modification
|
||||
*
|
||||
* Revision 1.1 1996/01/25 21:13:29 mrk
|
||||
* moved includes; .ascii=> .db; path changes
|
||||
*
|
||||
* Revision 1.27 1995/11/29 19:27:59 jhill
|
||||
* added $Log$
|
||||
* added Revision 1.3 1998/05/20 21:00:43 mrk
|
||||
* added raised DB_CA_PRI to just higher than sequencer
|
||||
* added
|
||||
* added Revision 1.2 1998/01/20 21:49:54 mrk
|
||||
* added added the arch_stack_factor for 64 bit architectures; changes for errlog
|
||||
* added
|
||||
* added Revision 1.1 1996/11/22 20:49:43 jhill
|
||||
* added installed
|
||||
* added
|
||||
* added Revision 1.1 1996/06/24 13:32:35 mrk
|
||||
* added added task_params.h
|
||||
* added
|
||||
* added Revision 1.3 1996/06/19 20:48:44 jhill
|
||||
* added dounled ca stack for each ca cleint in the server
|
||||
* added
|
||||
* added Revision 1.2 1996/04/22 14:31:08 mrk
|
||||
* added Changes for dynamic link modification
|
||||
* added
|
||||
* added Revision 1.1 1996/01/25 21:13:29 mrk
|
||||
* added moved includes; .ascii=> .db; path changes
|
||||
* added
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef INCtaskLibh
|
||||
#include <taskLib.h>
|
||||
#endif
|
||||
|
||||
#define VXTASKIDSELF 0
|
||||
|
||||
/* Task Names */
|
||||
#define EVENTSCAN_NAME "scanEvent"
|
||||
#define SCANONCE_NAME "scanOnce"
|
||||
#define SMCMD_NAME "smCommand"
|
||||
#define SMRESP_NAME "smResponse"
|
||||
#define ABDONE_NAME "abDone"
|
||||
#define ABSCAN_NAME "abScan"
|
||||
#define ABCOS_NAME "abBiCosScanner"
|
||||
#define MOMENTARY_NAME "momentary"
|
||||
#define WFDONE_NAME "wfDone"
|
||||
#define SEQUENCER_NAME "sequencer"
|
||||
#define BKPT_CONT_NAME "bkptCont"
|
||||
#define SCANNER_NAME "scanner"
|
||||
#define REQ_SRVR_NAME "CA TCP"
|
||||
#define CA_CLIENT_NAME "CA client"
|
||||
#define CA_EVENT_NAME "CA event"
|
||||
#define CAST_SRVR_NAME "CA UDP"
|
||||
#define CA_REPEATER_NAME "CA repeater"
|
||||
#define CA_ONLINE_NAME "CA online"
|
||||
#define TASKWD_NAME "taskwd"
|
||||
#define SMIOTEST_NAME "smInout"
|
||||
#define SMROTTEST_NAME "smRotate"
|
||||
#define EVENT_PEND_NAME "event task"
|
||||
#define XY240_NAME "xy 240 scan"
|
||||
#define GPIBLINK_NAME "gpibLink"
|
||||
#define BBLINK_NAME "bbLinkTask"
|
||||
#define BBTXLINK_NAME "bbTx"
|
||||
#define BBRXLINK_NAME "bbRx"
|
||||
#define BBWDTASK_NAME "bbwd"
|
||||
#define ERRLOG_NAME "errlog"
|
||||
#define LOG_RESTART_NAME "logRestart"
|
||||
|
||||
/* Task priorities */
|
||||
#define SCANONCE_PRI 85 /* scan one time */
|
||||
/*DO NOT RUN ANY RECORD PROCESSING TASKS AT HIGHER PRIORITY THAN _netTask=50*/
|
||||
#define CALLBACK_PRI_LOW 85 /* callback task - generall callback task */
|
||||
#define CALLBACK_PRI_MEDIUM 75 /* callback task - generall callback task */
|
||||
#define CALLBACK_PRI_HIGH 71 /* callback task - generall callback task */
|
||||
#define EVENTSCAN_PRI 72 /* Event Scanner - Runs on a global event */
|
||||
#define SMCMD_PRI 62 /* Stepper Motor Command Task - Waits for cmds */
|
||||
#define SMRESP_PRI 63 /* Stepper Motor Resp Task - Waits for resps */
|
||||
#define ABCOS_PRI 63 /* Allen-Bradley Binary Input COS io_event wakeup */
|
||||
#define ABDONE_PRI 64 /* Allen-Bradley Resp Task - Interrupt Driven */
|
||||
#define ABSCAN_PRI 65 /* Allen-Bradley Scan Task - Base Rate .1 secs */
|
||||
#define BBLINK_PRI 66
|
||||
#define BBWDTASK_PRI 65 /* BitBus watchdog task */
|
||||
#define BBRXLINK_PRI 66 /* BitBus link task */
|
||||
#define BBTXLINK_PRI 67 /* BitBus link task */
|
||||
#define GPIBLINK_PRI 67 /* GPIB link task */
|
||||
#define MOMENTARY_PRI 68 /* Momentary output - posted from watchdog */
|
||||
#define WFDONE_PRI 69 /* Waveform Task - Base Rate of .1 second */
|
||||
#define PERIODSCAN_PRI 78 /* Periodic Scanners - Slowest rate */
|
||||
#define DB_CA_PRI 88 /*database to channel access*/
|
||||
#define SEQUENCER_PRI 90
|
||||
#define XY240_PRI 111 /* xy 240 dio scanner */
|
||||
#define SCANNER_PRI 150
|
||||
#define REQ_SRVR_PRI 181 /* Channel Access TCP request server*/
|
||||
#define CA_CLIENT_PRI 180 /* Channel Access clients */
|
||||
#define CA_REPEATER_PRI 181 /* Channel Access repeater */
|
||||
#define ERRLOG_PRI CA_REPEATER_PRI /*error logger task*/
|
||||
#define CAST_SRVR_PRI 182 /* Channel Access broadcast server */
|
||||
#define CA_ONLINE_PRI 183 /* Channel Access server online notify */
|
||||
#define TASKWD_PRI 200 /* Watchdog Scan Task - runs every 6 seconds */
|
||||
#define SMIOTEST_PRI 205 /* Stepper Mtr in/out test - runs every .1 sec */
|
||||
#define SMROTTEST_PRI 205 /* Stepper Mtr rotate test - runs every .1 sec */
|
||||
#define LOG_RESTART_PRI 200 /* Log server connection watch dog */
|
||||
|
||||
/* Task delay times (seconds) */
|
||||
#define TASKWD_DELAY 6
|
||||
|
||||
/* Task delay times (tics) */
|
||||
#define ABSCAN_RATE (sysClkRateGet()/6)
|
||||
#define SEQUENCER_DELAY (sysClkRateGet()/5)
|
||||
#define SCANNER_DELAY (sysClkRateGet()/5)
|
||||
#define CA_ONLINE_DELAY (sysClkRateGet()*15)
|
||||
#define LOG_RESTART_DELAY (sysClkRateGet()*30)
|
||||
|
||||
/* Task creation options */
|
||||
#define ERRLOG_OPT VX_FP_TASK
|
||||
#define EVENTSCAN_OPT VX_FP_TASK
|
||||
#define SCANONCE_OPT VX_FP_TASK
|
||||
#define CALLBACK_OPT VX_FP_TASK
|
||||
#define SMCMD_OPT VX_FP_TASK
|
||||
#define SMRESP_OPT VX_FP_TASK
|
||||
#define ABDONE_OPT VX_FP_TASK
|
||||
#define ABCOS_OPT VX_FP_TASK
|
||||
#define ABSCAN_OPT VX_FP_TASK
|
||||
#define MOMENTARY_OPT VX_FP_TASK
|
||||
#define PERIODSCAN_OPT VX_FP_TASK
|
||||
#define WFDONE_OPT VX_FP_TASK
|
||||
#define SEQUENCER_OPT VX_FP_TASK | VX_STDIO
|
||||
#define BKPT_CONT_OPT VX_FP_TASK
|
||||
#define SCANNER_OPT VX_FP_TASK
|
||||
#define REQ_SRVR_OPT VX_FP_TASK
|
||||
#define CAST_SRVR_OPT VX_FP_TASK
|
||||
#define CA_CLIENT_OPT VX_FP_TASK
|
||||
#define CA_REPEATER_OPT VX_FP_TASK
|
||||
#define CA_ONLINE_OPT VX_FP_TASK
|
||||
#define TASKWD_OPT VX_FP_TASK
|
||||
#define SMIOTEST_OPT VX_FP_TASK
|
||||
#define SMROTTEST_OPT VX_FP_TASK
|
||||
#define EVENT_PEND_OPT VX_FP_TASK
|
||||
#define GPIBLINK_OPT VX_FP_TASK|VX_STDIO
|
||||
#define BBLINK_OPT VX_FP_TASK|VX_STDIO
|
||||
#define BBTXLINK_OPT VX_FP_TASK|VX_STDIO
|
||||
#define BBRXLINK_OPT VX_FP_TASK|VX_STDIO
|
||||
#define BBWDTASK_OPT VX_FP_TASK|VX_STDIO
|
||||
#define DB_CA_OPT (VX_FP_TASK | VX_STDIO)
|
||||
#define XY_240_OPT (0) /* none */
|
||||
#define LOG_RESTART_OPT (VX_FP_TASK)
|
||||
|
||||
|
||||
/*
|
||||
* Task stack sizes
|
||||
*
|
||||
* (original stack sizes are appropriate for the 68k)
|
||||
* ARCH_STACK_FACTOR allows scaling the stacks on particular
|
||||
* processor architectures
|
||||
*/
|
||||
#if CPU_FAMILY == MC680X0
|
||||
#define ARCH_STACK_FACTOR 1
|
||||
#elif CPU_FAMILY == SPARC
|
||||
#define ARCH_STACK_FACTOR 2
|
||||
#else
|
||||
#define ARCH_STACK_FACTOR 2
|
||||
#endif
|
||||
|
||||
#define ERRLOG_STACK (4000*ARCH_STACK_FACTOR)
|
||||
#define EVENTSCAN_STACK (11000*ARCH_STACK_FACTOR)
|
||||
#define SCANONCE_STACK (11000*ARCH_STACK_FACTOR)
|
||||
#define CALLBACK_STACK (11000*ARCH_STACK_FACTOR)
|
||||
#define SMCMD_STACK (3000*ARCH_STACK_FACTOR)
|
||||
#define SMRESP_STACK (3000*ARCH_STACK_FACTOR)
|
||||
#define ABCOS_STACK (3000*ARCH_STACK_FACTOR)
|
||||
#define ABDONE_STACK (3000*ARCH_STACK_FACTOR)
|
||||
#define ABSCAN_STACK (3000*ARCH_STACK_FACTOR)
|
||||
#define MOMENTARY_STACK (2000*ARCH_STACK_FACTOR)
|
||||
#define PERIODSCAN_STACK (11000*ARCH_STACK_FACTOR)
|
||||
#define WFDONE_STACK (9000*ARCH_STACK_FACTOR)
|
||||
#define SEQUENCER_STACK (5500*ARCH_STACK_FACTOR)
|
||||
#define BKPT_CONT_STACK (11000*ARCH_STACK_FACTOR)
|
||||
#define SCANNER_STACK (3048*ARCH_STACK_FACTOR)
|
||||
#define RSP_SRVR_STACK (5096*ARCH_STACK_FACTOR)
|
||||
#define REQ_SRVR_STACK (5096*ARCH_STACK_FACTOR)
|
||||
#define CAST_SRVR_STACK (5096*ARCH_STACK_FACTOR)
|
||||
#define CA_CLIENT_STACK (11000*ARCH_STACK_FACTOR)
|
||||
#define CA_REPEATER_STACK (5096*ARCH_STACK_FACTOR)
|
||||
#define CA_ONLINE_STACK (3048*ARCH_STACK_FACTOR)
|
||||
#define TASKWD_STACK (2000*ARCH_STACK_FACTOR)
|
||||
#define SMIOTEST_STACK (2000*ARCH_STACK_FACTOR)
|
||||
#define SMROTTEST_STACK (2000*ARCH_STACK_FACTOR)
|
||||
#define EVENT_PEND_STACK (5096*ARCH_STACK_FACTOR)
|
||||
#define TIMESTAMP_STACK (4000*ARCH_STACK_FACTOR)
|
||||
#define GPIBLINK_STACK (5000*ARCH_STACK_FACTOR)
|
||||
#define BBLINK_STACK (5000*ARCH_STACK_FACTOR)
|
||||
#define BBRXLINK_STACK (5000*ARCH_STACK_FACTOR)
|
||||
#define BBTXLINK_STACK (5000*ARCH_STACK_FACTOR)
|
||||
#define BBWDTASK_STACK (5000*ARCH_STACK_FACTOR)
|
||||
#define DB_CA_STACK (11000*ARCH_STACK_FACTOR)
|
||||
#define XY_240_STACK (4096*ARCH_STACK_FACTOR)
|
||||
#define LOG_RESTART_STACK (0x1000*ARCH_STACK_FACTOR)
|
||||
|
||||
@@ -3,7 +3,7 @@ TOP=../../..
|
||||
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
IOC_LIBRARY_vxWorks = iocCore
|
||||
LIBRARY_vxWorks = iocCore
|
||||
|
||||
include $(TOP)/configure/RULES_BUILD
|
||||
|
||||
@@ -14,7 +14,6 @@ LIBOBJS = \
|
||||
$(INSTALL_BIN)/libCom \
|
||||
$(INSTALL_BIN)/dbStaticLib \
|
||||
$(INSTALL_BIN)/miscLib \
|
||||
$(INSTALL_BIN)/osiLibrary \
|
||||
$(INSTALL_BIN)/bptLibrary \
|
||||
$(INSTALL_BIN)/registryLibrary \
|
||||
$(INSTALL_BIN)/rsrvLib \
|
||||
|
||||
@@ -9,7 +9,7 @@ vxComLib_SRCS += iocLogClient.c
|
||||
vxComLib_SRCS += veclist.c
|
||||
vxComLib_SRCS += epicsDynLink.c
|
||||
|
||||
IOC_LIBRARY_vxWorks = vxComLib
|
||||
LIBRARY_vxWorks = vxComLib
|
||||
|
||||
include $(TOP)/configure/RULES_BUILD
|
||||
|
||||
|
||||
Reference in New Issue
Block a user