changes from mrk node
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
* .12 07-16-92 jba Added disable alarm severity, ansi c changes
|
||||
* .13 08-05-92 jba Removed all references to dbr_field_type
|
||||
* .14 09-18-92 jba replaced get of disa code with recGblGetLinkValue call
|
||||
* .15 07-15-93 mrk Changes for new dbStaticLib
|
||||
*/
|
||||
|
||||
/* This is a major revision of the original implementation of database access.*/
|
||||
@@ -69,14 +70,14 @@
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <memLib.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdioLib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <taskLib.h>
|
||||
#include <vxLib.h>
|
||||
#include <tickLib.h>
|
||||
#include <lstLib.h>
|
||||
|
||||
#include <fast_lock.h>
|
||||
#include <cvtFast.h>
|
||||
@@ -85,13 +86,12 @@
|
||||
#include <dbDefs.h>
|
||||
#include <dbBase.h>
|
||||
#include <dbAccess.h>
|
||||
#include <dbManipulate.h>
|
||||
#include <dbStaticLib.h>
|
||||
#include <dbScan.h>
|
||||
#include <dbCommon.h>
|
||||
#include <dbFldTypes.h>
|
||||
#include <dbRecDes.h>
|
||||
#include <dbRecType.h>
|
||||
#include <dbRecords.h>
|
||||
#include <db_field_log.h>
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
@@ -300,23 +300,23 @@ long dbNameToAddr(char *pname,struct dbAddr *paddr)
|
||||
DBENTRY dbEntry;
|
||||
long status=0;
|
||||
struct rset *prset;
|
||||
struct fldDes *pfldDes;
|
||||
struct fldDes *pflddes;
|
||||
|
||||
if(dbFindRecord(pdbBase,pname,&dbEntry)) return(S_db_notFound);
|
||||
if (!dbEntry.precord) return(S_db_notFound);
|
||||
paddr->precord = dbEntry.precord;
|
||||
if(dbFindRecord(&dbEntry,pname)) return(S_db_notFound);
|
||||
if (!dbEntry.precnode->precord) return(S_db_notFound);
|
||||
paddr->precord = dbEntry.precnode->precord;
|
||||
paddr->record_type = dbEntry.record_type;
|
||||
if(!dbEntry.pfield) {
|
||||
if ((dbFindField(pdbBase,"VAL",&dbEntry)) != 0) return(S_db_notFound);
|
||||
if ((dbFindField(&dbEntry,"VAL")) != 0) return(S_db_notFound);
|
||||
}
|
||||
paddr->pfield = dbEntry.pfield;
|
||||
pfldDes = dbEntry.pfldDes;
|
||||
paddr->pfldDes = (void *)pfldDes;
|
||||
paddr->field_type = pfldDes->field_type;
|
||||
paddr->dbr_field_type = mapDBFToDBR[pfldDes->field_type];
|
||||
paddr->field_size = pfldDes->size;
|
||||
paddr->choice_set = pfldDes->choice_set;
|
||||
paddr->special = pfldDes->special;
|
||||
pflddes = dbEntry.pflddes;
|
||||
paddr->pfldDes = (void *)pflddes;
|
||||
paddr->field_type = pflddes->field_type;
|
||||
paddr->dbr_field_type = mapDBFToDBR[pflddes->field_type];
|
||||
paddr->field_size = pflddes->size;
|
||||
paddr->choice_set = pflddes->choice_set;
|
||||
paddr->special = pflddes->special;
|
||||
|
||||
/*if special is SPC_DBADDR then call cvt_dbaddr */
|
||||
/*it may change pfield,no_elements,field_type,dbr_field_type,*/
|
||||
@@ -396,7 +396,7 @@ long dbPutField(
|
||||
status=dbPut(paddr,dbrType,pbuffer,nRequest);
|
||||
if(status) recGblDbaddrError(status,paddr,"dbPutField");
|
||||
if(RTN_SUCCESS(status)){
|
||||
if(paddr->pfield==(void *)precord->proc) status=dbProcess(precord);
|
||||
if(paddr->pfield==(void *)&precord->proc) status=dbProcess(precord);
|
||||
else if (pfldDes->process_passive) status=dbScanPassive(precord);
|
||||
}
|
||||
dbScanUnlock(paddr->precord);
|
||||
@@ -2677,10 +2677,14 @@ long (*get_convert_table[DBF_DEVCHOICE+1][DBR_ENUM+1])() = {
|
||||
|
||||
|
||||
/* forward references for private routines used by dbGetField */
|
||||
void get_enum_strs();
|
||||
void get_graphics();
|
||||
void get_control();
|
||||
void get_alarm();
|
||||
static void get_enum_strs(struct dbAddr *paddr,void **ppbuffer,
|
||||
struct rset *prset,long *options);
|
||||
static void get_graphics(struct dbAddr *paddr,void **ppbuffer,
|
||||
struct rset *prset,long *options);
|
||||
static void get_control(struct dbAddr *paddr,void **ppbuffer,
|
||||
struct rset *prset,long *options);
|
||||
static void get_alarm(struct dbAddr *paddr,void **ppbuffer,
|
||||
struct rset *prset,long *options);
|
||||
|
||||
long dbGetField(
|
||||
struct dbAddr *paddr,
|
||||
@@ -2803,11 +2807,8 @@ GET_DATA:
|
||||
return(status);
|
||||
}
|
||||
|
||||
static void get_enum_strs(paddr,ppbuffer,prset,options)
|
||||
struct dbAddr *paddr;
|
||||
char **ppbuffer;
|
||||
struct rset *prset;
|
||||
long *options;
|
||||
static void get_enum_strs(struct dbAddr *paddr,void **ppbuffer,
|
||||
struct rset *prset,long *options)
|
||||
{
|
||||
short field_type=paddr->field_type;
|
||||
struct choiceSet *pchoiceSet;
|
||||
@@ -2820,9 +2821,7 @@ long *options;
|
||||
int i;
|
||||
|
||||
memset(pdbr_enumStrs,'\0',dbr_enumStrs_size);
|
||||
switch(field_type) {
|
||||
case DBF_ENUM:
|
||||
if( prset && prset->get_enum_strs ) {
|
||||
switch(field_type) { case DBF_ENUM: if( prset && prset->get_enum_strs ) {
|
||||
(*prset->get_enum_strs)(paddr,pdbr_enumStrs);
|
||||
} else {
|
||||
*options = (*options)^DBR_ENUM_STRS;/*Turn off option*/
|
||||
@@ -2886,11 +2885,8 @@ choice_common:
|
||||
return;
|
||||
}
|
||||
|
||||
static void get_graphics(paddr,ppbuffer,prset,options)
|
||||
struct dbAddr *paddr;
|
||||
char **ppbuffer;
|
||||
struct rset *prset;
|
||||
long *options;
|
||||
static void get_graphics(struct dbAddr *paddr,void **ppbuffer,
|
||||
struct rset *prset,long *options)
|
||||
{
|
||||
struct dbr_grDouble grd;
|
||||
int got_data=FALSE;
|
||||
@@ -2928,11 +2924,8 @@ long *options;
|
||||
return;
|
||||
}
|
||||
|
||||
static void get_control(paddr,ppbuffer,prset,options)
|
||||
struct dbAddr *paddr;
|
||||
char **ppbuffer;
|
||||
struct rset *prset;
|
||||
long *options;
|
||||
static void get_control(struct dbAddr *paddr,void **ppbuffer,
|
||||
struct rset *prset,long *options)
|
||||
{
|
||||
struct dbr_ctrlDouble ctrld;
|
||||
int got_data=FALSE;
|
||||
@@ -2970,11 +2963,8 @@ long *options;
|
||||
return;
|
||||
}
|
||||
|
||||
static void get_alarm(paddr,ppbuffer,prset,options)
|
||||
struct dbAddr *paddr;
|
||||
char **ppbuffer;
|
||||
struct rset *prset;
|
||||
long *options;
|
||||
static void get_alarm(struct dbAddr *paddr,void **ppbuffer,
|
||||
struct rset *prset,long *options)
|
||||
{
|
||||
struct dbr_alDouble ald;
|
||||
int got_data=FALSE;
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
/* needed for sprintf */
|
||||
#include <stdioLib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* needed for vxTas */
|
||||
#include <vxLib.h>
|
||||
@@ -52,10 +52,6 @@
|
||||
/* needed for PVNAME_SZ and FLDNAME_SZ */
|
||||
#include <dbDefs.h>
|
||||
|
||||
/* needed for typedef of caddr_t which is used somehwhere in link.h */
|
||||
/* typedef char * caddr_t */
|
||||
#include <types.h>
|
||||
|
||||
/* needed for struct link */
|
||||
#include <link.h>
|
||||
|
||||
@@ -762,10 +758,12 @@ int count;
|
||||
if (count == 2)
|
||||
{
|
||||
taskSpawn(DB_CA_INPUT_NAME, DB_CA_INPUT_PRI, DB_CA_INPUT_OPT,
|
||||
DB_CA_INPUT_STACK, (FUNCPTR) dbCaProcessInlinks,0,0,0,0,0,0,0,0,0,0);
|
||||
DB_CA_INPUT_STACK, (FUNCPTR) dbCaProcessInlinks,
|
||||
0,0,0,0,0,0,0,0,0,0);
|
||||
|
||||
taskSpawn(DB_CA_OUTPUT_NAME, DB_CA_OUTPUT_PRI, DB_CA_OUTPUT_OPT,
|
||||
DB_CA_OUTPUT_STACK, (FUNCPTR) dbCaProcessOutlinks,0,0,0,0,0,0,0,0,0,0);
|
||||
DB_CA_OUTPUT_STACK, (FUNCPTR) dbCaProcessOutlinks,
|
||||
0,0,0,0,0,0,0,0,0,0);
|
||||
} /* endif */
|
||||
|
||||
} /* end dbCaLinkInit() */
|
||||
@@ -884,7 +882,8 @@ BOOL done;
|
||||
|
||||
taskSpawn(DB_CA_PROC_ASYNCH_EV_TASK_NAME, DB_CA_PROC_ASYNCH_EV_TASK_PRI,
|
||||
DB_CA_PROC_ASYNCH_EV_TASK_OPT, DB_CA_PROC_ASYNCH_EV_TASK_STACK,
|
||||
(FUNCPTR) process_asynch_events_task, taskIdSelf(),0,0,0,0,0,0,0,0,0);
|
||||
(FUNCPTR) process_asynch_events_task, taskIdSelf(),
|
||||
0,0,0,0,0,0,0,0,0);
|
||||
|
||||
/* queueing ca_build_and_connect()'s */
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* DB_EVENT.C */
|
||||
/* share/src/db $Id$ */
|
||||
/* share/src/db @(#)dbEvent.c 1.17 6/7/93 */
|
||||
|
||||
/* routines for scheduling events to lower priority tasks via the RT kernel */
|
||||
/*
|
||||
* Author: Jeffrey O. Hill
|
||||
@@ -51,8 +52,11 @@
|
||||
* ??? 11 ????91 anl turned off paddr sanity checking
|
||||
* joh 12 082091 db_event_get_field() comented out
|
||||
* joh 13 091191 updated for v5 vxWorks
|
||||
* jba 14 112691 Added 'return NULL;' to end of db_event_list
|
||||
* jba 15 022892 ANSI C changes
|
||||
* jba 14 112691 Added 'return NULL;' to end of db_event_list
|
||||
* jba 15 022892 ANSI C changes
|
||||
* joh 16 111992 removed unused taskpri var
|
||||
* joh 17 111992 added task priority offset arg to
|
||||
* db_start_events()
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
@@ -60,7 +64,6 @@
|
||||
#include <wdLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <semLib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <tsDefs.h>
|
||||
#include <dbDefs.h>
|
||||
@@ -162,7 +165,6 @@ struct event_que{
|
||||
|
||||
struct event_user{
|
||||
int taskid; /* event handler task id */
|
||||
int taskpri; /* event handler task pri */
|
||||
|
||||
char pendlck; /* Only one task can pend */
|
||||
SEM_ID ppendsem; /* Wait while empty */
|
||||
@@ -197,17 +199,6 @@ FASTUNLOCK(&(RECPTR)->mlok);
|
||||
|
||||
#define VXTASKIDSELF 0
|
||||
|
||||
/*
|
||||
* >> kernel dependent <<
|
||||
*
|
||||
* if we go to a kernel which has different priority order I can
|
||||
* switch all priority inc/dec at once -joh
|
||||
*
|
||||
* on VRTX a lower priority number runs first- hence the minus one
|
||||
*/
|
||||
#define HIGHERPRIORITYINC (-1)
|
||||
#define HIGHER_OR_SAME_PRIORITY_THAN <=
|
||||
|
||||
|
||||
/*
|
||||
* DB_EVENT_LIST()
|
||||
@@ -248,7 +239,8 @@ char *name;
|
||||
pevent->npend);
|
||||
}
|
||||
UNLOCKREC(precord);
|
||||
return NULL;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -411,7 +403,7 @@ register struct event_block *pevent; /* ptr to event blk (not required) */
|
||||
pevent->valque = FALSE;
|
||||
|
||||
LOCKREC(precord);
|
||||
lstAdd((LIST*)&precord->mlis,(NODE*) pevent);
|
||||
lstAdd((LIST*)&precord->mlis, (NODE*)pevent);
|
||||
UNLOCKREC(precord);
|
||||
|
||||
return OK;
|
||||
@@ -442,9 +434,9 @@ register struct event_block *pevent;
|
||||
|
||||
LOCKREC(precord);
|
||||
/* dont let a misplaced event corrupt the queue */
|
||||
status = lstFind((LIST*)&precord->mlis,(NODE*)pevent);
|
||||
status = lstFind((LIST*)&precord->mlis, (NODE*)pevent);
|
||||
if(status!=ERROR)
|
||||
lstDelete((LIST*)&precord->mlis,(NODE*)pevent);
|
||||
lstDelete((LIST*)&precord->mlis, (NODE*)pevent);
|
||||
UNLOCKREC(precord);
|
||||
if(status == ERROR)
|
||||
return ERROR;
|
||||
@@ -474,11 +466,11 @@ register struct event_block *pevent;
|
||||
flush_event.npend = 0;
|
||||
|
||||
if(db_post_single_event(&flush_event)==OK){
|
||||
# ifdef V5_vxWorks
|
||||
semTake(pflush_sem, sysClkRateGet()*10);
|
||||
# else
|
||||
semTake(pflush_sem);
|
||||
# endif
|
||||
# ifdef V5_vxWorks
|
||||
semTake(pflush_sem, sysClkRateGet()*10);
|
||||
# else
|
||||
semTake(pflush_sem);
|
||||
# endif
|
||||
}
|
||||
|
||||
semDelete(pflush_sem);
|
||||
@@ -563,12 +555,12 @@ register struct event_block *pevent;
|
||||
ev_que->valque[putix].sevr = sevr;
|
||||
ev_que->valque[putix].time = precord->time;
|
||||
/*
|
||||
* use memcpy to avoid a bus error on
|
||||
* use bcopy to avoid a bus error on
|
||||
* union copy of char in the db at an odd
|
||||
* address
|
||||
*/
|
||||
memcpy( &ev_que->valque[putix].field,
|
||||
pevent->paddr->pfield,
|
||||
bcopy( pevent->paddr->pfield,
|
||||
&ev_que->valque[putix].field,
|
||||
dbr_size[pevent->paddr->field_type]);
|
||||
|
||||
}
|
||||
@@ -603,7 +595,7 @@ register unsigned int select;
|
||||
register struct event_que *ev_que;
|
||||
register unsigned int putix;
|
||||
|
||||
if (precord->mlis.count == 0) return; /* no monitors set */
|
||||
if (precord->mlis.count == 0) return OK; /* no monitors set */
|
||||
|
||||
LOCKREC(precord);
|
||||
|
||||
@@ -641,12 +633,12 @@ register unsigned int select;
|
||||
ev_que->valque[putix].time = precord->time;
|
||||
|
||||
/*
|
||||
* use memcpy to avoid a bus error on
|
||||
* use bcopy to avoid a bus error on
|
||||
* union copy of char in the db at an odd
|
||||
* address
|
||||
*/
|
||||
memcpy( &ev_que->valque[putix].field,
|
||||
pvalue,
|
||||
bcopy( pvalue,
|
||||
&ev_que->valque[putix].field,
|
||||
dbr_size[event->paddr->field_type]);
|
||||
|
||||
}
|
||||
@@ -674,25 +666,27 @@ register unsigned int select;
|
||||
* DB_START_EVENTS()
|
||||
*
|
||||
*/
|
||||
db_start_events(evuser,taskname,init_func,init_func_arg)
|
||||
db_start_events(evuser,taskname,init_func,init_func_arg,priority_offset)
|
||||
struct event_user *evuser;
|
||||
char *taskname; /* defaulted if NULL */
|
||||
void (*init_func)();
|
||||
int init_func_arg;
|
||||
int priority_offset;
|
||||
{
|
||||
int myprio;
|
||||
int status;
|
||||
int taskpri;
|
||||
int event_task();
|
||||
|
||||
/* only one ca_pend_event thread may be started for each evuser ! */
|
||||
while(!vxTas(&evuser->pendlck))
|
||||
return ERROR;
|
||||
|
||||
status = taskPriorityGet(VXTASKIDSELF, &evuser->taskpri);
|
||||
status = taskPriorityGet(VXTASKIDSELF, &taskpri);
|
||||
if(status == ERROR)
|
||||
return ERROR;
|
||||
|
||||
evuser->taskpri += HIGHERPRIORITYINC;
|
||||
taskpri += priority_offset;
|
||||
|
||||
evuser->pendexit = FALSE;
|
||||
|
||||
@@ -701,13 +695,14 @@ int init_func_arg;
|
||||
status =
|
||||
taskSpawn(
|
||||
taskname,
|
||||
evuser->taskpri,
|
||||
taskpri,
|
||||
EVENT_PEND_OPT,
|
||||
EVENT_PEND_STACK,
|
||||
event_task,
|
||||
evuser,
|
||||
init_func,
|
||||
init_func_arg);
|
||||
(int)evuser,
|
||||
(int)init_func,
|
||||
(int)init_func_arg,
|
||||
0,0,0,0,0,0,0);
|
||||
if(status == ERROR)
|
||||
return ERROR;
|
||||
|
||||
@@ -781,15 +776,13 @@ register int init_func_arg;
|
||||
|
||||
nextque = ev_que->nextque;
|
||||
if(FASTLOCKFREE(&ev_que->writelock)<0)
|
||||
logMsg("evtsk: fast lock free fail 2\n");
|
||||
if(free(ev_que))
|
||||
logMsg("evtsk: sub queue free fail\n");
|
||||
logMsg("evtsk: fast lock free fail 2\n",0,0,0,0,0,0);
|
||||
free(ev_que);
|
||||
ev_que = nextque;
|
||||
}
|
||||
}
|
||||
|
||||
if(free(evuser))
|
||||
logMsg("evtsk: evuser free fail\n");
|
||||
free(evuser);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -41,12 +41,11 @@
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdioLib.h>
|
||||
#include <types.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <semLib.h>
|
||||
#include <rngLib.h>
|
||||
#include <lstLib.h>
|
||||
#include <string.h>
|
||||
#include <vxLib.h>
|
||||
#include <tickLib.h>
|
||||
|
||||
@@ -61,7 +60,7 @@
|
||||
#include <devSup.h>
|
||||
#include <task_params.h>
|
||||
#include <fast_lock.h>
|
||||
#include <dbManipulate.h>
|
||||
#include <dbStaticLib.h>
|
||||
|
||||
extern struct dbBase *pdbBase;
|
||||
extern volatile int interruptAccept;
|
||||
@@ -104,21 +103,20 @@ struct io_scan_list {
|
||||
static struct io_scan_list *iosl_head[NUM_CALLBACK_PRIORITIES]={NULL,NULL,NULL};
|
||||
|
||||
/* Private routines */
|
||||
void periodicTask(); /*Periodic scan task */
|
||||
void initPeriodic(); /*Initialize the periodic variables */
|
||||
void spawnPeriodic(); /*Spawn the periodTasks */
|
||||
void wdPeriodic(); /*watchdog callback for periodicTasks */
|
||||
void eventTask(); /*Periodic scan task */
|
||||
void initEvent(); /*Initialize the event variables */
|
||||
void spawnEvent(); /*Spawn the eventTask */
|
||||
void wdEvent(); /*watchdog callback for eventTask */
|
||||
void ioeventCallback(); /*ioevent callback */
|
||||
void printList(); /*print a scan list */
|
||||
|
||||
void scanList(); /*Scan a scan list */
|
||||
void buildScanLists(); /*Build scan lists */
|
||||
void addToList(); /*add element to a list */
|
||||
void deleteFromList(); /*delete element from a list */
|
||||
static void periodicTask(struct scan_list *psl);
|
||||
static void initPeriodic(void);
|
||||
static void spawnPeriodic(int ind);
|
||||
static void wdPeriodic(long ind);
|
||||
static void eventTask(void);
|
||||
static void initEvent(void);
|
||||
static void spawnEvent(void);
|
||||
static void wdEvent(void);
|
||||
static void ioeventCallback(struct io_scan_list *piosl);
|
||||
static void printList(struct scan_list *psl,char *message);
|
||||
static void scanList(struct scan_list *psl);
|
||||
static void buildScanLists(void);
|
||||
static void addToList(struct dbCommon *precord,struct scan_list *psl);
|
||||
static void deleteFromList(struct dbCommon *precord,struct scan_list *psl);
|
||||
|
||||
long scanInit()
|
||||
{
|
||||
@@ -176,7 +174,7 @@ void scanAdd(struct dbCommon *precord)
|
||||
evnt = (signed)precord->evnt;
|
||||
psl = papEvent[evnt];
|
||||
if(psl==NULL) {
|
||||
psl = calloc(1,sizeof(struct scan_list));
|
||||
psl = dbCalloc(1,sizeof(struct scan_list));
|
||||
papEvent[precord->evnt] = psl;
|
||||
FASTLOCKINIT(&psl->lock);
|
||||
lstInit(&psl->list);
|
||||
@@ -184,7 +182,7 @@ void scanAdd(struct dbCommon *precord)
|
||||
addToList(precord,psl);
|
||||
} else if(scan==SCAN_IO_EVENT) {
|
||||
struct io_scan_list *piosl=NULL;
|
||||
int priority,dummy1,dummy2;
|
||||
int priority;
|
||||
DEVSUPFUN get_ioint_info;
|
||||
|
||||
if(precord->dset==NULL){
|
||||
@@ -243,7 +241,7 @@ void scanDelete(struct dbCommon *precord)
|
||||
deleteFromList(precord,psl);
|
||||
} else if(scan==SCAN_IO_EVENT) {
|
||||
struct io_scan_list *piosl=NULL;
|
||||
int priority,dummy1,dummy2;
|
||||
int priority;
|
||||
DEVSUPFUN get_ioint_info;
|
||||
|
||||
if(precord->dset==NULL) {
|
||||
@@ -335,7 +333,7 @@ void scanIoInit(IOSCANPVT *ppioscanpvt)
|
||||
|
||||
/* allocate an array of io_scan_lists. One for each priority */
|
||||
/* IOSCANPVT will hold the address of this array of structures */
|
||||
*ppioscanpvt=calloc(NUM_CALLBACK_PRIORITIES,sizeof(struct io_scan_list));
|
||||
*ppioscanpvt=dbCalloc(NUM_CALLBACK_PRIORITIES,sizeof(struct io_scan_list));
|
||||
for(priority=0, piosl=*ppioscanpvt;
|
||||
priority<NUM_CALLBACK_PRIORITIES; priority++, piosl++){
|
||||
piosl->callback.callback = ioeventCallback;
|
||||
@@ -404,7 +402,7 @@ static void initPeriodic()
|
||||
for (i=0; i<precHeader->number; i++) {
|
||||
if((precLoc=precHeader->papRecLoc[i])==NULL) continue;
|
||||
for(precNode=(RECNODE *)lstFirst(precLoc->preclist);
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->next)) {
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->node)) {
|
||||
precord = precNode->precord;
|
||||
if(precord->name[0]!=0) goto got_record;
|
||||
}
|
||||
@@ -428,22 +426,10 @@ got_record:
|
||||
exit(1);
|
||||
}
|
||||
nPeriodic = scanChoices.no_str - SCAN_1ST_PERIODIC;
|
||||
papPeriodic = calloc(nPeriodic,sizeof(struct scan_list));
|
||||
if(papPeriodic==NULL) {
|
||||
errMessage(0,"initPeriodic calloc failure");
|
||||
exit(1);
|
||||
}
|
||||
periodicTaskId = calloc(nPeriodic,sizeof(int));
|
||||
if(periodicTaskId==NULL) {
|
||||
errMessage(0,"initPeriodic calloc failure");
|
||||
exit(1);
|
||||
}
|
||||
papPeriodic = dbCalloc(nPeriodic,sizeof(struct scan_list));
|
||||
periodicTaskId = dbCalloc(nPeriodic,sizeof(int));
|
||||
for(i=0; i<nPeriodic; i++) {
|
||||
psl = calloc(1,sizeof(struct scan_list));
|
||||
if(psl==NULL) {
|
||||
errMessage(0,"initPeriodic calloc failure");
|
||||
exit(1);
|
||||
}
|
||||
psl = dbCalloc(1,sizeof(struct scan_list));
|
||||
papPeriodic[i] = psl;
|
||||
FASTLOCKINIT(&psl->lock);
|
||||
lstInit(&psl->list);
|
||||
@@ -459,7 +445,8 @@ static void spawnPeriodic(int ind)
|
||||
psl = papPeriodic[ind];
|
||||
periodicTaskId[ind] = taskSpawn(PERIODSCAN_NAME,PERIODSCAN_PRI-ind,
|
||||
PERIODSCAN_OPT,PERIODSCAN_STACK,
|
||||
(FUNCPTR )periodicTask,psl);
|
||||
(FUNCPTR )periodicTask,(int)psl,
|
||||
0,0,0,0,0,0,0,0,0);
|
||||
taskwdInsert(periodicTaskId[ind],wdPeriodic,(void *)(long)ind);
|
||||
}
|
||||
|
||||
@@ -474,7 +461,7 @@ static void wdPeriodic(long ind)
|
||||
spawnPeriodic(ind);
|
||||
}
|
||||
|
||||
static void eventTask()
|
||||
static void eventTask(void)
|
||||
{
|
||||
unsigned char event;
|
||||
struct scan_list *psl;
|
||||
@@ -485,7 +472,7 @@ static void eventTask()
|
||||
while (rngNBytes(eventQ)>=sizeof(unsigned char)){
|
||||
if(rngBufGet(eventQ,(void *)&event,sizeof(unsigned char))!=sizeof(unsigned char))
|
||||
errMessage(0,"rngBufGet returned error in eventTask");
|
||||
if(event<0 || event>MAX_EVENTS-1) {
|
||||
if(event>MAX_EVENTS-1) {
|
||||
errMessage(-1,"eventTask received an illegal event");
|
||||
continue;
|
||||
}
|
||||
@@ -496,7 +483,7 @@ static void eventTask()
|
||||
}
|
||||
}
|
||||
|
||||
static void initEvent()
|
||||
static void initEvent(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -510,15 +497,16 @@ static void initEvent()
|
||||
errMessage(0,"semBcreate failed in initEvent");
|
||||
}
|
||||
|
||||
static void spawnEvent()
|
||||
static void spawnEvent(void)
|
||||
{
|
||||
|
||||
eventTaskId = taskSpawn(EVENTSCAN_NAME,EVENTSCAN_PRI,EVENTSCAN_OPT,
|
||||
EVENTSCAN_STACK,(FUNCPTR)eventTask);
|
||||
EVENTSCAN_STACK,(FUNCPTR)eventTask,
|
||||
0,0,0,0,0,0,0,0,0,0);
|
||||
taskwdInsert(eventTaskId,wdEvent,0L);
|
||||
}
|
||||
|
||||
static void wdEvent()
|
||||
static void wdEvent(void)
|
||||
{
|
||||
int i;
|
||||
struct scan_list *psl;
|
||||
@@ -619,7 +607,7 @@ static void scanList(struct scan_list *psl)
|
||||
}
|
||||
}
|
||||
|
||||
static void buildScanLists()
|
||||
static void buildScanLists(void)
|
||||
{
|
||||
struct recHeader *precHeader;
|
||||
struct recLoc *precLoc;
|
||||
@@ -636,7 +624,7 @@ static void buildScanLists()
|
||||
for (i=0; i<precHeader->number; i++) {
|
||||
if((precLoc=precHeader->papRecLoc[i])==NULL) continue;
|
||||
for(precNode=(RECNODE *)lstFirst(precLoc->preclist);
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->next)) {
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->node)) {
|
||||
precord = precNode->precord;
|
||||
if(precord->name[0]==0) continue;
|
||||
scanAdd(precord);
|
||||
@@ -651,11 +639,7 @@ static void addToList(struct dbCommon *precord,struct scan_list *psl)
|
||||
FASTLOCK(&psl->lock);
|
||||
pse = (struct scan_element *)(precord->spvt);
|
||||
if(pse==NULL) {
|
||||
pse = calloc(1,sizeof(struct scan_element));
|
||||
if(pse==NULL) {
|
||||
recGblRecordError(-1,(void *)precord,"addToList calloc error");
|
||||
exit(1);
|
||||
}
|
||||
pse = dbCalloc(1,sizeof(struct scan_element));
|
||||
precord->spvt = (void *)pse;
|
||||
(void *)pse->precord = precord;
|
||||
}
|
||||
|
||||
226
src/db/dbTest.c
226
src/db/dbTest.c
@@ -77,9 +77,9 @@
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdioLib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <lstLib.h>
|
||||
#include <fast_lock.h>
|
||||
@@ -95,7 +95,7 @@
|
||||
#include <choice.h>
|
||||
#include <special.h>
|
||||
#include <dbRecDes.h>
|
||||
#include <dbManipulate.h>
|
||||
#include <dbStaticLib.h>
|
||||
|
||||
extern struct dbBase *pdbBase;
|
||||
|
||||
@@ -113,24 +113,36 @@ typedef struct msgBuff TAB_BUFFER;
|
||||
#define MAX(x,y) ((x > y)?x:y)
|
||||
|
||||
/* Local Routines */
|
||||
void printDbAddr();
|
||||
void printBuffer();
|
||||
int dbpr_report();
|
||||
void dbpr_msgOut();
|
||||
void dbpr_init_msg();
|
||||
void dbpr_insert_msg();
|
||||
void dbpr_msg_flush();
|
||||
void dbprReportLink();
|
||||
void dbprReportCvtChoice();
|
||||
int dbprReportGblChoice();
|
||||
void dbprReportRecChoice();
|
||||
void dbprReportDevChoice();
|
||||
struct fldDes *dbprGetFldRec();
|
||||
struct recTypDes *dbprGetRecTypDes();
|
||||
|
||||
static void printDbAddr(long status,struct dbAddr *paddr);
|
||||
static void printBuffer(
|
||||
long status,short dbr_type,void *pbuffer,long reqOptions,
|
||||
long retOptions,long no_elements,TAB_BUFFER *pMsgBuff,int tab_size);
|
||||
static int dbpr_report(
|
||||
char *pname,struct dbAddr *paddr,int interest_level,
|
||||
TAB_BUFFER *pMsgBuff,int tab_size);
|
||||
static void dbpr_msgOut(TAB_BUFFER *pMsgBuff,int tab_size);
|
||||
static void dbpr_init_msg(TAB_BUFFER *pMsgBuff,int tab_size);
|
||||
static void dbpr_insert_msg(TAB_BUFFER *pMsgBuff,int len,int tab_size);
|
||||
static void dbpr_msg_flush(TAB_BUFFER *pMsgBuff,int tab_size);
|
||||
static void dbprReportLink(
|
||||
TAB_BUFFER *pMsgBuff,char *pfield_name,struct link *plink,
|
||||
short field_type,int tab_size);
|
||||
static void dbprReportCvtChoice(
|
||||
TAB_BUFFER *pMsgBuff,char *pfield_name,
|
||||
unsigned short choice_value,int tab_size);
|
||||
static int dbprReportGblChoice(
|
||||
TAB_BUFFER *pMsgBuff,struct dbCommon *precord,char *pfield_name,
|
||||
unsigned short choice_value,int tab_size);
|
||||
static void dbprReportRecChoice(
|
||||
TAB_BUFFER *pMsgBuff,struct dbCommon *precord,char *pfield_name,
|
||||
unsigned short choice_value,int tab_size);
|
||||
static void dbprReportDevChoice(
|
||||
TAB_BUFFER *pMsgBuff,struct dbAddr *paddr,
|
||||
char *pfield_name,int tab_size);
|
||||
static struct fldDes * dbprGetFldRec(short type,short fldNum);
|
||||
static struct recTypDes *dbprGetRecTypDes(short type);
|
||||
|
||||
long dba(pname) /* get and print dbAddr info */
|
||||
char *pname;
|
||||
long dba(char*pname)
|
||||
{
|
||||
struct dbAddr addr;
|
||||
long status;
|
||||
@@ -140,8 +152,7 @@ long dba(pname) /* get and print dbAddr info */
|
||||
if(status) return(1); else return(0);
|
||||
}
|
||||
|
||||
long dbl(ptypeName) /* list process variables for specified record type*/
|
||||
char *ptypeName;
|
||||
long dbl(char *ptypeName)
|
||||
{
|
||||
int rectype,beg,end;
|
||||
struct recLoc *precLoc;
|
||||
@@ -178,7 +189,7 @@ got_it:
|
||||
for(rectype=beg; rectype<=end; rectype++) {
|
||||
if(!(precLoc=GET_PRECLOC(precHeader,rectype))) continue;
|
||||
for(precNode=(RECNODE *)lstFirst(precLoc->preclist);
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->next)) {
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->node)) {
|
||||
precord = precNode->precord;
|
||||
if(precord->name[0] == 0) continue; /*deleted record*/
|
||||
strncpy(name,precord->name,PVNAME_SZ);
|
||||
@@ -189,8 +200,7 @@ got_it:
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbgf(pname) /* get field value*/
|
||||
char *pname;
|
||||
long dbgf(char *pname)
|
||||
{
|
||||
/* declare buffer long just to ensure correct alignment */
|
||||
long buffer[100];
|
||||
@@ -223,31 +233,8 @@ long dbgf(pname) /* get field value*/
|
||||
dbpr_msgOut(pMsgBuff, tab_size);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
/* vxWorks 4.x does not support strspn. Here it is*/
|
||||
static int strspn(ps,pp)
|
||||
char *ps; /* pointer to source*/
|
||||
char *pp; /* pointer to pattern*/
|
||||
{
|
||||
int i;
|
||||
char *p1=ps;
|
||||
char *p2;
|
||||
|
||||
for (i=0; *p1; i++, p1++) {
|
||||
for (p2=pp; *p2; p2++) {
|
||||
if(*p1==*p2) goto ok;
|
||||
}
|
||||
return(i);
|
||||
ok:
|
||||
continue;
|
||||
}
|
||||
return strlen(ps);
|
||||
}
|
||||
|
||||
long dbpf(pname,pvalue) /* put field value*/
|
||||
char *pname;
|
||||
char *pvalue;
|
||||
long dbpf(char *pname,char *pvalue)
|
||||
{
|
||||
/* declare buffer long just to ensure correct alignment */
|
||||
struct dbAddr addr;
|
||||
@@ -278,14 +265,11 @@ long dbpf(pname,pvalue) /* put field value*/
|
||||
errMessage(status,"dbPutField error");
|
||||
return(1);
|
||||
}
|
||||
if(status!=0) errPrint(status);
|
||||
else status=dbgf(pname);
|
||||
status=dbgf(pname);
|
||||
return(status);
|
||||
}
|
||||
|
||||
long dbpr(pname, interest_level) /* print record */
|
||||
char *pname;
|
||||
int interest_level;
|
||||
long dbpr(char *pname,int interest_level)
|
||||
{
|
||||
static TAB_BUFFER msg_Buff;
|
||||
TAB_BUFFER *pMsgBuff = &msg_Buff;
|
||||
@@ -309,8 +293,7 @@ long dbpr(pname, interest_level) /* print record */
|
||||
return (0);
|
||||
}
|
||||
|
||||
long dbtr(pname) /* test record and print*/
|
||||
char *pname;
|
||||
long dbtr(char *pname)
|
||||
{
|
||||
struct dbAddr addr;
|
||||
long status;
|
||||
@@ -332,13 +315,12 @@ long dbtr(pname) /* test record and print*/
|
||||
}
|
||||
status=dbProcess(precord);
|
||||
if(!(RTN_SUCCESS(status)))
|
||||
recGblRecSupError(S_db_noSupport,&addr,"dbtr","process");
|
||||
recGblRecordError(status,precord,"dbtr(dbProcess)");
|
||||
dbpr(pname,3);
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbtgf(pname) /* test all options for dbGetField */
|
||||
char *pname;
|
||||
long dbtgf(char *pname)
|
||||
{
|
||||
/* declare buffer long just to ensure correct alignment */
|
||||
long buffer[400];
|
||||
@@ -413,9 +395,7 @@ long dbtgf(pname) /* test all options for dbGetField */
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbtpf(pname,pvalue)/* test all options for dbPutField */
|
||||
char *pname;
|
||||
char *pvalue;
|
||||
long dbtpf(char *pname,char *pvalue)
|
||||
{
|
||||
/* declare buffer long just to ensure correct alignment */
|
||||
long buffer[100];
|
||||
@@ -445,7 +425,7 @@ long dbtpf(pname,pvalue)/* test all options for dbPutField */
|
||||
}
|
||||
/* DBR_STRING */
|
||||
status=dbPutField(&addr,DBR_STRING,pvalue,1L);
|
||||
if(status!=0) errPrint(status);
|
||||
if(status!=0) errMessage(status,"DBR_STRING Failed");
|
||||
else {
|
||||
printf("DBR_STRING ok\n");
|
||||
no_elements=MIN(addr.no_elements,((sizeof(buffer))/addr.field_size));
|
||||
@@ -458,7 +438,7 @@ long dbtpf(pname,pvalue)/* test all options for dbPutField */
|
||||
if(sscanf(pvalue,"%hd",&svalue)==1) {
|
||||
cvalue = (char)svalue;
|
||||
status=dbPutField(&addr,DBR_CHAR,&cvalue,1L);
|
||||
if(status!=0) errPrint(status);
|
||||
if(status!=0) errMessage(status,"DBR_UCHAR failed");
|
||||
else {
|
||||
printf("DBR_UCHAR ok\n");
|
||||
no_elements=MIN(addr.no_elements,((sizeof(buffer))/addr.field_size));
|
||||
@@ -472,7 +452,7 @@ long dbtpf(pname,pvalue)/* test all options for dbPutField */
|
||||
if(sscanf(pvalue,"%hu",&usvalue)==1) {
|
||||
ucvalue = (unsigned char)usvalue;
|
||||
status=dbPutField(&addr,DBR_UCHAR,&ucvalue,1L);
|
||||
if(status!=0) errPrint(status);
|
||||
if(status!=0) errMessage(status,"DBR_UCHAR failed");
|
||||
else {
|
||||
printf("DBR_UCHAR ok\n");
|
||||
no_elements=MIN(addr.no_elements,((sizeof(buffer))/addr.field_size));
|
||||
@@ -485,7 +465,7 @@ long dbtpf(pname,pvalue)/* test all options for dbPutField */
|
||||
/* DBR_SHORT */
|
||||
if(sscanf(pvalue,"%hd",&svalue)==1) {
|
||||
status=dbPutField(&addr,DBR_SHORT,&svalue,1L);
|
||||
if(status!=0) errPrint(status);
|
||||
if(status!=0) errMessage(status,"DBR_SHORT failed");
|
||||
else {
|
||||
printf("DBR_SHORT ok\n");
|
||||
no_elements=MIN(addr.no_elements,((sizeof(buffer))/addr.field_size));
|
||||
@@ -498,7 +478,7 @@ long dbtpf(pname,pvalue)/* test all options for dbPutField */
|
||||
/* DBR_USHORT */
|
||||
if(sscanf(pvalue,"%hu",&usvalue)==1) {
|
||||
status=dbPutField(&addr,DBR_USHORT,&usvalue,1L);
|
||||
if(status!=0) errPrint(status);
|
||||
if(status!=0) errMessage(status,"DBR_USHORT failed");
|
||||
else {
|
||||
printf("DBR_USHORT ok\n");
|
||||
no_elements=MIN(addr.no_elements,((sizeof(buffer))/addr.field_size));
|
||||
@@ -511,7 +491,7 @@ long dbtpf(pname,pvalue)/* test all options for dbPutField */
|
||||
/* DBR_LONG */
|
||||
if(sscanf(pvalue,"%ld",&lvalue)==1) {
|
||||
status=dbPutField(&addr,DBR_LONG,&lvalue,1L);
|
||||
if(status!=0) errPrint(status);
|
||||
if(status!=0) errMessage(status,"DBR_LONG failed");
|
||||
else {
|
||||
printf("DBR_LONG ok\n");
|
||||
no_elements=MIN(addr.no_elements,((sizeof(buffer))/addr.field_size));
|
||||
@@ -524,7 +504,7 @@ long dbtpf(pname,pvalue)/* test all options for dbPutField */
|
||||
/* DBR_ULONG */
|
||||
if(sscanf(pvalue,"%lu",&ulvalue)==1) {
|
||||
status=dbPutField(&addr,DBR_ULONG,&ulvalue,1L);
|
||||
if(status!=0) errPrint(status);
|
||||
if(status!=0) errMessage(status,"DBR_ULONG failed");
|
||||
else {
|
||||
printf("DBR_ULONG ok\n");
|
||||
no_elements=MIN(addr.no_elements,((sizeof(buffer))/addr.field_size));
|
||||
@@ -537,7 +517,7 @@ long dbtpf(pname,pvalue)/* test all options for dbPutField */
|
||||
/* DBR_FLOAT */
|
||||
if(sscanf(pvalue,"%e",&fvalue)==1) {
|
||||
status=dbPutField(&addr,DBR_FLOAT,&fvalue,1L);
|
||||
if(status!=0) errPrint(status);
|
||||
if(status!=0) errMessage(status,"DBR_FLOAT failed");
|
||||
else {
|
||||
printf("DBR_FLOAT ok\n");
|
||||
no_elements=MIN(addr.no_elements,((sizeof(buffer))/addr.field_size));
|
||||
@@ -550,7 +530,7 @@ long dbtpf(pname,pvalue)/* test all options for dbPutField */
|
||||
/* DBR_DOUBLE */
|
||||
if(sscanf(pvalue,"%le",&dvalue)==1) {
|
||||
status=dbPutField(&addr,DBR_DOUBLE,&dvalue,1L);
|
||||
if(status!=0) errPrint(status);
|
||||
if(status!=0) errMessage(status,"DBR_DOUBLE failed");
|
||||
else {
|
||||
printf("DBR_DOUBLE ok\n");
|
||||
no_elements=MIN(addr.no_elements,((sizeof(buffer))/addr.field_size));
|
||||
@@ -563,7 +543,7 @@ long dbtpf(pname,pvalue)/* test all options for dbPutField */
|
||||
/* DBR_ENUM */
|
||||
if(sscanf(pvalue,"%hu",&svalue)==1) {
|
||||
status=dbPutField(&addr,DBR_ENUM,&svalue,1L);
|
||||
if(status!=0) errPrint(status);
|
||||
if(status!=0) errMessage(status,"DBR_ENUM failed");
|
||||
else {
|
||||
printf("DBR_ENUM ok\n");
|
||||
no_elements=MIN(addr.no_elements,((sizeof(buffer))/addr.field_size));
|
||||
@@ -578,9 +558,7 @@ long dbtpf(pname,pvalue)/* test all options for dbPutField */
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dbior(pdrvName,type)
|
||||
char *pdrvName;
|
||||
int type;
|
||||
long dbior(char *pdrvName,int type)
|
||||
{
|
||||
int i,j;
|
||||
char *pname;
|
||||
@@ -634,8 +612,7 @@ long dbior(pdrvName,type)
|
||||
return(0);
|
||||
}
|
||||
|
||||
long dblls(lockset) /* list lock set for specified record type*/
|
||||
int lockset;
|
||||
long dblls(int lockset)
|
||||
{
|
||||
int rectype,beg,end;
|
||||
struct recLoc *precLoc;
|
||||
@@ -653,7 +630,7 @@ long dblls(lockset) /* list lock set for specified record type*/
|
||||
for(rectype=beg; rectype<=end; rectype++) {
|
||||
if(!(precLoc=GET_PRECLOC(precHeader,rectype))) continue;
|
||||
for(precNode=(RECNODE *)lstFirst(precLoc->preclist);
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->next)) {
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->node)) {
|
||||
precord = precNode->precord;
|
||||
if(precord->name[0] == 0) continue; /*deleted record*/
|
||||
if(lockset>0 && lockset!=precord->lset) continue;
|
||||
@@ -680,9 +657,7 @@ static char *dbr[DBR_ENUM+2]={
|
||||
"STRING","CHAR","UCHAR","SHORT","USHORT","LONG","ULONG",
|
||||
"FLOAT","DOUBLE","ENUM","NOACCESS"};
|
||||
|
||||
static void printDbAddr(status,paddr)
|
||||
long status;
|
||||
struct dbAddr *paddr;
|
||||
static void printDbAddr(long status,struct dbAddr *paddr)
|
||||
{
|
||||
char *pstr;
|
||||
short field_type;
|
||||
@@ -719,16 +694,9 @@ static void printDbAddr(status,paddr)
|
||||
}
|
||||
|
||||
|
||||
static void printBuffer(status, dbr_type, pbuffer, reqOptions,
|
||||
retOptions, no_elements, pMsgBuff, tab_size)
|
||||
long status;
|
||||
short dbr_type;
|
||||
char *pbuffer;
|
||||
long reqOptions;
|
||||
long retOptions;
|
||||
long no_elements;
|
||||
TAB_BUFFER *pMsgBuff;
|
||||
int tab_size;
|
||||
static void printBuffer(
|
||||
long status,short dbr_type,void *pbuffer,long reqOptions,
|
||||
long retOptions,long no_elements,TAB_BUFFER *pMsgBuff,int tab_size)
|
||||
{
|
||||
unsigned short stat,
|
||||
severity;
|
||||
@@ -1000,12 +968,9 @@ static void printBuffer(status, dbr_type, pbuffer, reqOptions,
|
||||
return;
|
||||
}
|
||||
|
||||
static int dbpr_report(pname, paddr, interest_level, pMsgBuff, tab_size)
|
||||
char *pname;
|
||||
struct dbAddr *paddr; /* requested PV name */
|
||||
int interest_level;
|
||||
TAB_BUFFER *pMsgBuff;
|
||||
int tab_size;
|
||||
static int dbpr_report(
|
||||
char *pname,struct dbAddr *paddr,int interest_level,
|
||||
TAB_BUFFER *pMsgBuff,int tab_size)
|
||||
{
|
||||
|
||||
char *pmsg;
|
||||
@@ -1219,9 +1184,7 @@ static int dbpr_report(pname, paddr, interest_level, pMsgBuff, tab_size)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void dbpr_msgOut(pMsgBuff, tab_size)
|
||||
TAB_BUFFER *pMsgBuff;
|
||||
int tab_size;
|
||||
static void dbpr_msgOut(TAB_BUFFER *pMsgBuff,int tab_size)
|
||||
{
|
||||
int len;
|
||||
int err = 0;
|
||||
@@ -1264,9 +1227,7 @@ static void dbpr_msgOut(pMsgBuff, tab_size)
|
||||
return;
|
||||
}
|
||||
|
||||
static void dbpr_init_msg(pMsgBuff, tab_size)
|
||||
TAB_BUFFER *pMsgBuff;
|
||||
int tab_size;
|
||||
static void dbpr_init_msg(TAB_BUFFER *pMsgBuff,int tab_size)
|
||||
{
|
||||
pMsgBuff->pNext = pMsgBuff->out_buff;
|
||||
pMsgBuff->pLast = pMsgBuff->out_buff + MAXLINE;
|
||||
@@ -1274,10 +1235,7 @@ static void dbpr_init_msg(pMsgBuff, tab_size)
|
||||
return;
|
||||
}
|
||||
|
||||
static void dbpr_insert_msg(pMsgBuff, len, tab_size)
|
||||
TAB_BUFFER *pMsgBuff;
|
||||
int len;
|
||||
int tab_size;
|
||||
static void dbpr_insert_msg(TAB_BUFFER *pMsgBuff,int len,int tab_size)
|
||||
{
|
||||
int current_len;
|
||||
int n;
|
||||
@@ -1310,9 +1268,7 @@ static void dbpr_insert_msg(pMsgBuff, len, tab_size)
|
||||
|
||||
}
|
||||
|
||||
static void dbpr_msg_flush(pMsgBuff, tab_size)
|
||||
TAB_BUFFER *pMsgBuff;
|
||||
int tab_size;
|
||||
static void dbpr_msg_flush(TAB_BUFFER *pMsgBuff,int tab_size)
|
||||
{
|
||||
/* skip print if buffer empty */
|
||||
if (pMsgBuff->pNext != pMsgBuff->out_buff)
|
||||
@@ -1323,12 +1279,9 @@ static void dbpr_msg_flush(pMsgBuff, tab_size)
|
||||
return;
|
||||
}
|
||||
|
||||
static void dbprReportLink(pMsgBuff,pfield_name,plink,field_type, tab_size)
|
||||
TAB_BUFFER *pMsgBuff;
|
||||
char *pfield_name;
|
||||
struct link *plink;
|
||||
short field_type;
|
||||
int tab_size;
|
||||
static void dbprReportLink(
|
||||
TAB_BUFFER *pMsgBuff,char *pfield_name,struct link *plink,
|
||||
short field_type,int tab_size)
|
||||
{
|
||||
char *pmsg = pMsgBuff->message;
|
||||
switch(plink->type) {
|
||||
@@ -1433,11 +1386,9 @@ static void dbprReportLink(pMsgBuff,pfield_name,plink,field_type, tab_size)
|
||||
return;
|
||||
}
|
||||
|
||||
static void dbprReportCvtChoice(pMsgBuff,pfield_name,choice_value,tab_size)
|
||||
TAB_BUFFER *pMsgBuff;
|
||||
char *pfield_name;
|
||||
unsigned short choice_value;
|
||||
int tab_size;
|
||||
static void dbprReportCvtChoice(
|
||||
TAB_BUFFER *pMsgBuff,char *pfield_name,
|
||||
unsigned short choice_value,int tab_size)
|
||||
{
|
||||
char *pchoice;
|
||||
char *pmsg = pMsgBuff->message;
|
||||
@@ -1453,12 +1404,9 @@ static void dbprReportCvtChoice(pMsgBuff,pfield_name,choice_value,tab_size)
|
||||
return;
|
||||
}
|
||||
|
||||
static int dbprReportGblChoice(pMsgBuff,precord,pfield_name,choice_value, tab_size)
|
||||
TAB_BUFFER *pMsgBuff;
|
||||
struct dbCommon *precord;
|
||||
char *pfield_name;
|
||||
unsigned short choice_value;
|
||||
int tab_size;
|
||||
static int dbprReportGblChoice(
|
||||
TAB_BUFFER *pMsgBuff,struct dbCommon *precord,char *pfield_name,
|
||||
unsigned short choice_value,int tab_size)
|
||||
{
|
||||
char name[PVNAME_SZ+1+FLDNAME_SZ+1];
|
||||
struct dbAddr dbAddr;
|
||||
@@ -1487,12 +1435,9 @@ static int dbprReportGblChoice(pMsgBuff,precord,pfield_name,choice_value, tab_si
|
||||
return(0);
|
||||
}
|
||||
|
||||
static void dbprReportRecChoice(pMsgBuff,precord,pfield_name,choice_value,tab_size)
|
||||
TAB_BUFFER *pMsgBuff;
|
||||
struct dbCommon *precord;
|
||||
char *pfield_name;
|
||||
unsigned short choice_value;
|
||||
int tab_size;
|
||||
static void dbprReportRecChoice(
|
||||
TAB_BUFFER *pMsgBuff,struct dbCommon *precord,char *pfield_name,
|
||||
unsigned short choice_value,int tab_size)
|
||||
{
|
||||
char name[PVNAME_SZ+1+FLDNAME_SZ+1];
|
||||
struct dbAddr dbAddr;
|
||||
@@ -1522,11 +1467,9 @@ static void dbprReportRecChoice(pMsgBuff,precord,pfield_name,choice_value,tab_si
|
||||
return;
|
||||
}
|
||||
|
||||
static void dbprReportDevChoice(pMsgBuff,paddr,pfield_name, tab_size)
|
||||
TAB_BUFFER *pMsgBuff;
|
||||
struct dbAddr *paddr;
|
||||
char *pfield_name;
|
||||
int tab_size;
|
||||
static void dbprReportDevChoice(
|
||||
TAB_BUFFER *pMsgBuff,struct dbAddr *paddr,
|
||||
char *pfield_name,int tab_size)
|
||||
{
|
||||
short choice_ind= *((short*)paddr->pfield);
|
||||
struct devChoiceSet *pdevChoiceSet;
|
||||
@@ -1558,9 +1501,7 @@ static void dbprReportDevChoice(pMsgBuff,paddr,pfield_name, tab_size)
|
||||
return;
|
||||
}
|
||||
|
||||
static struct fldDes * dbprGetFldRec(type, fldNum)
|
||||
short type; /* record type */
|
||||
short fldNum; /* field number */
|
||||
static struct fldDes * dbprGetFldRec(short type,short fldNum)
|
||||
{
|
||||
struct fldDes *pfield;
|
||||
struct recDes *precDes;
|
||||
@@ -1577,8 +1518,7 @@ static struct fldDes * dbprGetFldRec(type, fldNum)
|
||||
}
|
||||
|
||||
|
||||
static struct recTypDes * dbprGetRecTypDes(type)
|
||||
short type; /* record type */
|
||||
static struct recTypDes *dbprGetRecTypDes(short type)
|
||||
{
|
||||
struct recDes *precDes;
|
||||
struct recTypDes *precTypDes;
|
||||
|
||||
@@ -87,18 +87,18 @@ extern struct dbBase *pdbBase;
|
||||
#endif
|
||||
|
||||
/* forward references */
|
||||
void DbRecType();
|
||||
void DrvSup();
|
||||
void DevSup();
|
||||
void DbRecDes();
|
||||
void CvtTable();
|
||||
void ChoiceRec();
|
||||
void ChoiceDev();
|
||||
void ChoiceCvt();
|
||||
void ChoiceGbl();
|
||||
void DbErrDes();
|
||||
void DbRecords();
|
||||
void RecSup();
|
||||
static void DbRecType();
|
||||
static void DrvSup();
|
||||
static void DevSup();
|
||||
static void DbRecDes();
|
||||
static void CvtTable();
|
||||
static void ChoiceRec();
|
||||
static void ChoiceDev();
|
||||
static void ChoiceCvt();
|
||||
static void ChoiceGbl();
|
||||
static void DbErrDes();
|
||||
static void DbRecords();
|
||||
static void RecSup();
|
||||
int getSelection();
|
||||
|
||||
static char buffer[512];
|
||||
|
||||
130
src/db/iocInit.c
130
src/db/iocInit.c
@@ -52,21 +52,22 @@
|
||||
* .22 09-10-92 rcz added many initHooks - INITHOOK*<place> argument
|
||||
* .23 09-10-92 rcz changed funcptr pinitHooks from ret long to void
|
||||
* .24 09-11-92 rcz moved setMasterTimeToSelf to a seperate C file
|
||||
* .25 07-15-93 mrk Changed dbLoad for new dbStaticLib support
|
||||
*
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <types.h>
|
||||
#include <memLib.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <lstLib.h>
|
||||
#include <sysLib.h>
|
||||
#include <symLib.h>
|
||||
#include <sysSymTbl.h> /* for sysSymTbl*/
|
||||
#include <a_out.h> /* for N_TEXT */
|
||||
#include <stdarg.h>
|
||||
#include <stdioLib.h>
|
||||
#include <string.h>
|
||||
#include <logLib.h>
|
||||
#include <taskLib.h>
|
||||
|
||||
#include <sdrHeader.h>
|
||||
#include <fast_lock.h>
|
||||
@@ -87,7 +88,7 @@
|
||||
#include <errMdef.h>
|
||||
#include <recSup.h>
|
||||
#include <envDefs.h>
|
||||
#include <dbManipulate.h>
|
||||
#include <dbStaticLib.h>
|
||||
#include <initHooks.h>
|
||||
/*This module will declare and initilize module_type variables*/
|
||||
#define MODULE_TYPES_INIT 1
|
||||
@@ -104,22 +105,26 @@ struct dbBase *pdbBase=NULL;
|
||||
long dbCommonInit();
|
||||
|
||||
/* define forward references*/
|
||||
extern long dbRead();
|
||||
static long initDrvSup();
|
||||
static long initRecSup();
|
||||
static long initDevSup();
|
||||
static long finishDevSup();
|
||||
static long initDatabase();
|
||||
static long addToSet();
|
||||
static long initialProcess();
|
||||
static long getResources();
|
||||
static void setMasterTimeToSelf();
|
||||
static long initDrvSup(void);
|
||||
static long initRecSup(void);
|
||||
static long initDevSup(void);
|
||||
static long finishDevSup(void);
|
||||
static long initDatabase(void);
|
||||
static long addToSet(
|
||||
struct dbCommon *precord, /* record being added to lock set*/
|
||||
short record_type, /* record being added to lock set*/
|
||||
short lookAhead, /*should following records be checked*/
|
||||
short i, /*record before 1st following: index into papRecLoc*/
|
||||
RECNODE *prootNod, /*precNode before 1st following */
|
||||
short lset /* current lock set */
|
||||
);
|
||||
static long initialProcess(void);
|
||||
static long getResources(char *fname);
|
||||
void setMasterTimeToSelf(void);
|
||||
|
||||
int iocInit(pResourceFilename)
|
||||
char * pResourceFilename;
|
||||
int iocInit(char * pResourceFilename)
|
||||
{
|
||||
long status;
|
||||
long hookrtn=0;
|
||||
char name[40];
|
||||
long rtnval;
|
||||
void (*pinitHooks)() = NULL;
|
||||
@@ -197,7 +202,7 @@ char * pResourceFilename;
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long initDrvSup() /* Locate all driver support entry tables */
|
||||
static long initDrvSup(void) /* Locate all driver support entry tables */
|
||||
{
|
||||
char *pname;
|
||||
char name[40];
|
||||
@@ -233,7 +238,7 @@ static long initDrvSup() /* Locate all driver support entry tables */
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long initRecSup()
|
||||
static long initRecSup(void)
|
||||
{
|
||||
char name[40];
|
||||
int i;
|
||||
@@ -252,10 +257,7 @@ static long initRecSup()
|
||||
return(status);
|
||||
}
|
||||
nbytes = sizeof(struct recSup) + precType->number*sizeof(void *);
|
||||
if(!(precSup = (struct recSup *)calloc(1,nbytes))) {
|
||||
errMessage(0,"Could not allocate structures for record support");
|
||||
return(-1);
|
||||
}
|
||||
precSup = dbCalloc(1,nbytes);
|
||||
pdbBase->precSup = precSup;
|
||||
precSup->number = precType->number;
|
||||
precSup->papRset = (void *)((long)precSup + (long)sizeof(struct recSup));
|
||||
@@ -283,7 +285,7 @@ static long initRecSup()
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long initDevSup() /* Locate all device support entry tables */
|
||||
static long initDevSup(void) /* Locate all device support entry tables */
|
||||
{
|
||||
char *pname;
|
||||
char name[40];
|
||||
@@ -325,7 +327,7 @@ static long initDevSup() /* Locate all device support entry tables */
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long finishDevSup()
|
||||
static long finishDevSup(void)
|
||||
{
|
||||
int i,j;
|
||||
struct recDevSup *precDevSup;
|
||||
@@ -344,8 +346,7 @@ static long finishDevSup()
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
static long initDatabase()
|
||||
static long initDatabase(void)
|
||||
{
|
||||
char name[PVNAME_SZ+FLDNAME_SZ+2];
|
||||
short i,j;
|
||||
@@ -394,7 +395,7 @@ static long initDatabase()
|
||||
precTypDes = precDes->papRecTypDes[i];
|
||||
pdevSup = GET_PDEVSUP(pdbBase->precDevSup,i);
|
||||
for(precNode=(RECNODE *)lstFirst(precLoc->preclist);
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->next)) {
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->node)) {
|
||||
precord = precNode->precord;
|
||||
/* If NAME is null then skip this record*/
|
||||
if(!(precord->name[0])) continue;
|
||||
@@ -420,7 +421,7 @@ static long initDatabase()
|
||||
if(!(precLoc = precHeader->papRecLoc[i]))continue;
|
||||
precTypDes = precDes->papRecTypDes[i];
|
||||
for(precNode=(RECNODE *)lstFirst(precLoc->preclist);
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->next)) {
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->node)) {
|
||||
precord = precNode->precord;
|
||||
/* If NAME is null then skip this record*/
|
||||
if(!(precord->name[0])) continue;
|
||||
@@ -443,7 +444,7 @@ static long initDatabase()
|
||||
((struct dbCommon *)(dbAddr.precord))->lset= -1;
|
||||
plink->type = DB_LINK;
|
||||
plink->value.db_link.pdbAddr =
|
||||
(struct dbAddr *)calloc(1,sizeof(struct dbAddr));
|
||||
dbCalloc(1,sizeof(struct dbAddr));
|
||||
*((struct dbAddr *)(plink->value.db_link.pdbAddr))=dbAddr;
|
||||
}
|
||||
else {
|
||||
@@ -479,7 +480,7 @@ static long initDatabase()
|
||||
if(!(prset=GET_PRSET(precSup,i))) continue;
|
||||
precTypDes = precDes->papRecTypDes[i];
|
||||
for(precNode=(RECNODE *)lstFirst(precLoc->preclist);
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->next)) {
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->node)) {
|
||||
precord = precNode->precord;
|
||||
/* If NAME is null then skip this record*/
|
||||
if(!(precord->name[0])) continue;
|
||||
@@ -504,7 +505,7 @@ static long initDatabase()
|
||||
if(!(precLoc = precHeader->papRecLoc[i]))continue;
|
||||
precTypDes = precDes->papRecTypDes[i];
|
||||
for(precNode=(RECNODE *)lstFirst(precLoc->preclist);
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->next)) {
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->node)) {
|
||||
precord = precNode->precord;
|
||||
/* If NAME is null then skip this record*/
|
||||
if(!(precord->name[0])) continue;
|
||||
@@ -520,13 +521,14 @@ static long initDatabase()
|
||||
return(status);
|
||||
}
|
||||
|
||||
static long addToSet(precord,record_type,lookAhead,i,prootNode,lset)
|
||||
struct dbCommon *precord; /* record being added to lock set*/
|
||||
short record_type; /* record being added to lock set*/
|
||||
short lookAhead; /*should following records be checked*/
|
||||
short i; /*record before 1st following: index into papRecLoc*/
|
||||
RECNODE *prootNode; /*precNode before 1st following */
|
||||
short lset; /* current lock set */
|
||||
static long addToSet(
|
||||
struct dbCommon *precord, /* record being added to lock set*/
|
||||
short record_type, /* record being added to lock set*/
|
||||
short lookAhead, /*should following records be checked*/
|
||||
short i, /*record before 1st following: index into papRecLoc*/
|
||||
RECNODE *prootNode, /*precNode before 1st following */
|
||||
short lset /* current lock set */
|
||||
)
|
||||
{
|
||||
short k,in;
|
||||
long status;
|
||||
@@ -574,7 +576,7 @@ static long addToSet(precord,record_type,lookAhead,i,prootNode,lset)
|
||||
/* unless (!process_passive && !maximize_sevr) or no_elements>1*/
|
||||
/* remember that all earlier records already have lock set determined*/
|
||||
if(!lookAhead) return(0);
|
||||
precNode = (RECNODE *)lstNext(&prootNode->next);
|
||||
precNode = (RECNODE *)lstNext(&prootNode->node);
|
||||
if(!(precHeader = pdbBase->precHeader)) return(0);
|
||||
for(in=i; in<precHeader->number; in++) {
|
||||
struct dbCommon *pn;
|
||||
@@ -609,14 +611,14 @@ static long addToSet(precord,record_type,lookAhead,i,prootNode,lset)
|
||||
status = addToSet(pn,in,TRUE,i,prootNode,lset);
|
||||
if(status) return(status);
|
||||
}
|
||||
precNode = (RECNODE *)lstNext(&precNode->next);
|
||||
precNode = (RECNODE *)lstNext(&precNode->node);
|
||||
}
|
||||
precNode = NULL;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long initialProcess()
|
||||
static long initialProcess(void)
|
||||
{
|
||||
short i;
|
||||
struct recHeader *precHeader;
|
||||
@@ -628,7 +630,7 @@ static long initialProcess()
|
||||
for(i=0; i< (precHeader->number); i++) {
|
||||
if(!(precLoc = precHeader->papRecLoc[i]))continue;
|
||||
for(precNode=(RECNODE *)lstFirst(precLoc->preclist);
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->next)) {
|
||||
precNode; precNode = (RECNODE *)lstNext(&precNode->node)) {
|
||||
precord = precNode->precord;
|
||||
/* If NAME is null then skip this record*/
|
||||
if(!(precord->name[0])) continue;
|
||||
@@ -649,8 +651,7 @@ static char *cvt_str[] = {
|
||||
"DBF_DOUBLE"
|
||||
};
|
||||
#define CVT_COUNT (sizeof(cvt_str) / sizeof(char*))
|
||||
static long getResources(fname) /* Resource Definition File interpreter */
|
||||
char *fname;
|
||||
static long getResources(char *fname)
|
||||
{
|
||||
FILE *fp;
|
||||
int len;
|
||||
@@ -667,7 +668,7 @@ static long getResources(fname) /* Resource Definition File interpreter */
|
||||
char s3[MAX];
|
||||
char message[100];
|
||||
long rtnval = 0;
|
||||
UINT8 type;
|
||||
UINT8 type;
|
||||
char *pSymAddr;
|
||||
short n_short;
|
||||
long n_long;
|
||||
@@ -830,13 +831,36 @@ CLEAR: memset(buff, '\0', MAX);
|
||||
return (0);
|
||||
}
|
||||
|
||||
long dbLoad(pfilename)
|
||||
char * pfilename;
|
||||
static gotSdrSum=FALSE;
|
||||
static struct sdrSum sdrSum;
|
||||
int dbLoad(char * pfilename)
|
||||
{
|
||||
long status;
|
||||
status=dbRead(&pdbBase, pfilename);
|
||||
long status;
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen(pfilename,"r");
|
||||
if(!fp) {
|
||||
errMessage(-1,"dbLoad: Error opening file");
|
||||
return(-1);
|
||||
}
|
||||
status=dbRead(pdbBase, fp);
|
||||
fclose(fp);
|
||||
if(status!=0) {
|
||||
logMsg("dbLoad aborting because dbRead failed\n",0,0,0,0,0,0);
|
||||
errMessage(status,"dbLoad aborting because dbRead failed");
|
||||
return(-1);
|
||||
}
|
||||
if(!gotSdrSum) {
|
||||
fp = fopen("default.sdrSum","r");
|
||||
if(!fp) {
|
||||
errMessage(-1,"dbLoad: Error opening default.sdrSum");
|
||||
return(-1);
|
||||
}
|
||||
fclose(fp);
|
||||
fgets(sdrSum.allSdrSums,sizeof(sdrSum.allSdrSums),fp);
|
||||
gotSdrSum = TRUE;
|
||||
}
|
||||
if(strcmp(pdbBase->psdrSum->allSdrSums,sdrSum.allSdrSums)!=0) {
|
||||
errMessage(-1,"dbLoad: check sdrSum Error: Database out of date");
|
||||
return(-1);
|
||||
}
|
||||
return (0);
|
||||
|
||||
@@ -44,10 +44,14 @@
|
||||
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sysLib.h>
|
||||
#include <symLib.h>
|
||||
#include <sysSymTbl.h>
|
||||
#include <a_out.h> /* for N_TEXT */
|
||||
#include <errMdef.h>
|
||||
|
||||
|
||||
|
||||
@@ -58,7 +62,7 @@ void setMasterTimeToSelf()
|
||||
char *pnext;
|
||||
char name[] = "_EPICS_IOCMCLK_INET";
|
||||
char message[100];
|
||||
UTINY type;
|
||||
UINT8 type;
|
||||
long rtnval = 0;
|
||||
char *pSymAddr;
|
||||
int len = 0;
|
||||
|
||||
@@ -47,12 +47,14 @@
|
||||
*/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <vxLib.h>
|
||||
#include <stdlib.h>
|
||||
#include <types.h>
|
||||
#include <stdio.h>
|
||||
#include <lstLib.h>
|
||||
#include <taskLib.h>
|
||||
|
||||
#include <dbDefs.h>
|
||||
#include <errMdef.h>
|
||||
#include <taskwd.h>
|
||||
#include <task_params.h>
|
||||
#include <fast_lock.h>
|
||||
@@ -75,16 +77,17 @@ struct freeList{
|
||||
static struct freeList *freeHead=NULL;
|
||||
|
||||
/*forward definitions*/
|
||||
void taskwdTask();
|
||||
struct task_list *allocList();
|
||||
void freeList(struct task_list *);
|
||||
static void taskwdTask(void);
|
||||
static struct task_list *allocList(void);
|
||||
static void freeList(struct task_list *pt);
|
||||
|
||||
void taskwdInit()
|
||||
{
|
||||
FASTLOCKINIT(&lock);
|
||||
lstInit(&list);
|
||||
taskwdid = taskSpawn(TASKWD_NAME,TASKWD_PRI,
|
||||
TASKWD_OPT,TASKWD_STACK,(FUNCPTR )taskwdTask);
|
||||
TASKWD_OPT,TASKWD_STACK,(FUNCPTR )taskwdTask,
|
||||
0,0,0,0,0,0,0,0,0,0);
|
||||
}
|
||||
|
||||
void taskwdInsert(int tid,VOIDFUNCPTR callback,void *arg)
|
||||
@@ -103,7 +106,6 @@ void taskwdInsert(int tid,VOIDFUNCPTR callback,void *arg)
|
||||
|
||||
void taskwdRemove(int tid)
|
||||
{
|
||||
int i;
|
||||
struct task_list *pt;
|
||||
|
||||
FASTLOCK(&lock);
|
||||
@@ -121,7 +123,7 @@ void taskwdRemove(int tid)
|
||||
errMessage(-1,"taskwdRemove failed");
|
||||
}
|
||||
|
||||
static void taskwdTask()
|
||||
static void taskwdTask(void)
|
||||
{
|
||||
struct task_list *pt,*next;
|
||||
|
||||
@@ -152,7 +154,7 @@ static void taskwdTask()
|
||||
}
|
||||
|
||||
|
||||
struct task_list *allocList()
|
||||
static struct task_list *allocList(void)
|
||||
{
|
||||
struct task_list *pt;
|
||||
|
||||
@@ -167,7 +169,7 @@ struct task_list *allocList()
|
||||
return(pt);
|
||||
}
|
||||
|
||||
void freeList(struct task_list *pt)
|
||||
static void freeList(struct task_list *pt)
|
||||
{
|
||||
|
||||
((struct freeList *)pt)->next = freeHead;
|
||||
|
||||
Reference in New Issue
Block a user