Pre R3.4 changes

This commit is contained in:
Janet B. Anderson
1992-02-04 15:56:43 +00:00
parent 74055aba80
commit 127d986a55
78 changed files with 1315 additions and 2379 deletions
+40 -30
View File
@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <types.h>
#include <semLib.h>
#include <rngLib.h>
#include <lstLib.h>
#include <dbDefs.h>
@@ -43,14 +44,14 @@
#include <taskwd.h>
#include <task_params.h>
#define QUEUESIZE 1000
static SEM_ID callbackSem[NUM_CALLBACK_PRIORITIES];
static RING_ID callbackQ[NUM_CALLBACK_PRIORITIES];
static int callbackTaskId[NUM_CALLBACK_PRIORITIES];
volatile int callbackRestart=FALSE;
static volatile CALLBACK *head[NUM_CALLBACK_PRIORITIES];
static volatile CALLBACK *tail[NUM_CALLBACK_PRIORITIES];
/* forward references */
void wdCallback(); /*callback from taskwd*/
void wdCallback(long); /*callback from taskwd*/
void start(); /*start or restart a callbackTask*/
/*public routines */
@@ -66,41 +67,50 @@ long callbackInit()
/* Routine which places requests into callback queue*/
/* This routine can be called from interrupt routine*/
long callbackRequest(struct callback *pcallback)
void callbackRequest(CALLBACK *pcallback)
{
int priority = pcallback->priority;
int lockKey;
int nput;
static int status;
if(priority<0 || priority>(NUM_CALLBACK_PRIORITIES)) {
logMsg("callbackRequest called with invalid priority");
return(-1);
return;
}
lockKey = intLock();
pcallback->next = NULL;
tail[priority]->next = pcallback;
if(head[priority]==NULL) head[priority] = pcallback;
nput = rngBufPut(callbackQ[priority],(void *)&pcallback,sizeof(pcallback));
intUnlock(lockKey);
if(semGive(callbackSem[priority])!=OK)
if(nput!=sizeof(pcallback)) logMsg("callbackRequest ring buffer full");
if((status=semGive(callbackSem[priority]))!=OK) {
/*semGive randomly returns garbage value*/
/*
logMsg("semGive returned error in callbackRequest\n");
return(0);
logMsg("status=%d\n",status);
*/
}
return;
}
/* General purpose callback task */
static void callbackTask(int priority)
/*static*/
void callbackTask(int priority)
{
volatile CALLBACK *pcallback,*next;
int lockKey;
volatile CALLBACK *pcallback;
int nget;
while(TRUE) {
/* wait for somebody to wake us up */
if(semTake(callbackSem[priority],WAIT_FOREVER)!=OK )
logMsg("semTake returned error in callbackRequest\n");
while(TRUE) {
lockKey = intLock();
if((pcallback=head[priority])==NULL) break;
if((head[priority]=pcallback->next)==NULL) tail[priority]=NULL;
intUnlock(lockKey);
if(semTake(callbackSem[priority],WAIT_FOREVER)!=OK ){
errMessage(0,"semTake returned error in callbackTask\n");
taskSuspend(0);
}
while(rngNBytes(callbackQ[priority])>=sizeof(pcallback)) {
nget = rngBufGet(callbackQ[priority],(void *)&pcallback,sizeof(pcallback));
if(nget!=sizeof(pcallback)) {
errMessage(0,"rngBufGet failed in callbackTask");
taskSuspend(0);
}
(*pcallback->callback)(pcallback);
}
}
@@ -108,21 +118,20 @@ static void callbackTask(int priority)
static void start(int ind)
{
char name[100];
int priority;
head[ind] = tail[ind] = 0;
if((callbackSem[ind] = semBCreate(SEM_Q_FIFO,SEM_EMPTY))==NULL)
logMsg("semBcreate failed while starting a callback task\n");
sprintf(name,"%s%2.2d",CALLBACK_NAME,ind);
errMessage(0,"semBcreate failed while starting a callback task\n");
if(ind==0) priority = CALLBACK_PRI_LOW;
else if(ind==1) priority = CALLBACK_PRI_MEDIUM;
else if(ind==2) priority = CALLBACK_PRI_HIGH;
else {
logMsg("semBcreate failed while starting a callback task\n");
errMessage(0,"semBcreate failed while starting a callback task\n");
return;
}
callbackTaskId[ind] = taskSpawn(name,priority,
if((callbackQ[ind] = rngCreate(sizeof(CALLBACK *) * QUEUESIZE)) == NULL)
errMessage(0,"rngCreate failed while starting a callback task");
callbackTaskId[ind] = taskSpawn(CALLBACK_NAME,priority,
CALLBACK_OPT,CALLBACK_STACK,
(FUNCPTR)callbackTask,ind);
if(callbackTaskId[ind]==ERROR) {
@@ -138,8 +147,9 @@ static void wdCallback(long ind)
taskwdRemove(callbackTaskId[ind]);
if(!callbackRestart)return;
if(taskDelete(callbackTaskId[ind])!=OK)
logMsg("taskDelete failed while restarting a callback task\n");
if(semFlush(callbackSem[ind])!=OK)
logMsg("semFlush failed while restarting a callback task\n");
errMessage(0,"taskDelete failed while restarting a callback task\n");
if(semDelete(callbackSem[ind])!=OK)
errMessage(0,"semDelete failed while restarting a callback task\n");
rngDelete(callbackQ[ind]);
start(ind);
}
+86 -90
View File
@@ -36,6 +36,7 @@
* .06 11-26-91 jba Added return to dbGetLink
* Fixed bug in special processing of SPC_MOD (100)
* .07 12-02-91 jba Writing to PROC will always force record process
* .08 02-05-92 jba Changed function arguments from paddr to precord
*/
/* This is a major revision of the original implementation of database access.*/
@@ -43,21 +44,21 @@
/* Global Database Access Routines
*
* dbScanLock(precord) Lock for scanning records
* caddr_t precord;
* struct dbCommon precord;
* returns void
*
* dbScanUnlock(precord) Unlock for scanning records
* caddr_t precord;
* struct dbCommon precord;
* returns void
*
* dbScanLockInit(nset) Initialize scan lock
* int nset;
*
* dbScanPassive(paddr) process if record is passively scanned
* struct dbAddr *paddr; pointer to database address structure
* dbScanPassive(precord) process if record is passively scanned
* struct dbCommon precord;
*
* dbProcess(paddr) process a database record
* struct dbAddr *paddr; pointer to database address structure
* dbProcess(precord) process a database record
* struct dbCommon precord;
*
* dbNameToAddr(pname,paddr) Given "pv<.field>" compute dbAddr
* char *pname
@@ -65,17 +66,17 @@
*
* dbGetLink(pdblink,pdest,dbrType,pbuffer,options,nRequest)
* struct db_link *pdblink;
* struct dbCommon *pdest;
* struct dbCommon *pdest;
* short dbrType; DBR_xxx
* caddr_t pbuffer; addr of returned data
* void pbuffer; addr of returned data
* long *options; addr of options
* long *nRequest; addr of number of elements
*
* dbPutLink(pdblink,psource,dbrType,pbuffer,nRequest)
* struct db_link *pdblink;
* struct dbCommon *psource;
* struct dbCommon *psource;
* short dbrType; DBR_xxx
* caddr_t pbuffer; addr of input data
* void pbuffer; addr of input data
* long nRequest;
*
* dbGetField(paddr,dbrType,pbuffer,options,nRequest,pfl)
@@ -102,6 +103,7 @@
#include <vxWorks.h>
#include <types.h>
#include <memLib.h>
#include <stdarg.h>
#include <fioLib.h>
#include <strLib.h>
#include <taskLib.h>
@@ -111,6 +113,7 @@
#include <choice.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbScan.h>
#include <dbCommon.h>
#include <dbFldTypes.h>
#include <dbRecDes.h>
@@ -118,7 +121,6 @@
#include <dbRecords.h>
#include <db_field_log.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <special.h>
@@ -142,8 +144,7 @@ static struct {
struct scanLock *pscanLock; /*addr of array of struct scanLock */
} dbScanPvt;
void dbScanLock(precord)
caddr_t precord;
void dbScanLock(struct dbCommon *precord)
{
struct scanLock *pscanLock;
short lset=((struct dbCommon *)precord)->lset - 1;
@@ -156,12 +157,11 @@ void dbScanLock(precord)
FASTLOCK(&pscanLock->lock);
pscanLock->start_time = tickGet();
pscanLock->task_id = taskIdSelf();
pscanLock->precord = precord;
pscanLock->precord = (void *)precord;
return;
}
void dbScanUnlock(precord)
caddr_t precord;
void dbScanUnlock(struct dbCommon *precord)
{
struct scanLock *pscanLock;
short lset=((struct dbCommon *)precord)->lset - 1;
@@ -177,13 +177,13 @@ void dbScanUnlock(precord)
}
void dbScanLockInit(nset)
int nset;
int nset;
{
struct scanLock *pscanLock;
int i;
dbScanPvt.nset = nset;
pscanLock = (struct scanLock *)calloc((size_t)nset,
pscanLock = calloc((size_t)nset,
(size_t)sizeof(struct scanLock));
dbScanPvt.pscanLock = pscanLock;
for (i=0; i<nset; i++, pscanLock++) {
@@ -195,23 +195,19 @@ void dbScanLockInit(nset)
return;
}
long dbScanPassive(paddr)
struct dbAddr *paddr;
long dbScanPassive(struct dbCommon *precord)
{
struct dbCommon *precord=(struct dbCommon *)(paddr->precord);
/* if not passive and field not PROC just return success */
if(precord->scan != 0 && paddr->pfield != (caddr_t)&precord->proc) return(0);
/* if not passive just return success */
if(precord->scan != 0) return(0);
/* return result of process */
return(dbProcess(paddr));
return(dbProcess(precord));
}
long dbProcess(paddr)
struct dbAddr *paddr;
long dbProcess(struct dbCommon *precord)
{
struct rset *prset;
struct dbCommon *precord=(struct dbCommon *)(paddr->precord);
unsigned char tpro=precord->tpro;
short lset = precord->lset;
long status = 0;
@@ -244,7 +240,7 @@ long dbProcess(paddr)
if(precord->mlis.count==0) goto all_done;
db_post_events(precord,&precord->stat,DBE_VALUE);
db_post_events(precord,&precord->sevr,DBE_VALUE);
prset=GET_PRSET(paddr->record_type);
prset=(struct rset *)precord->rset;
if( prset && prset->get_value ){
(*prset->get_value)(precord,&valueDes);
db_post_events(precord,valueDes.pvalue,DBE_VALUE|DBE_ALARM);
@@ -259,7 +255,7 @@ long dbProcess(paddr)
status = dbGetLink(&precord->sdis.value.db_link,precord,
DBR_SHORT,(caddr_t)(&(precord->disa)),&options,&nRequest);
if(!RTN_SUCCESS(status)) recGblDbaddrError(status,paddr,"dbProcess");
if(!RTN_SUCCESS(status)) recGblRecordError(status,precord,"dbProcess");
}
/* if disabled just return success */
if(precord->disa == precord->disv) {
@@ -269,9 +265,9 @@ long dbProcess(paddr)
}
/* locate record processing routine */
if(!(prset=GET_PRSET(paddr->record_type)) || !(prset->process)) {
if(!(prset=(struct rset *)precord->rset) || !(prset->process)) {
precord->pact=1;/*set pact TRUE so error is issued only once*/
recGblRecSupError(S_db_noRSET,paddr,"dbProcess","process");
recGblRecSupError(S_db_noRSET,precord,"dbProcess");
status = S_db_noRSET;
if(trace && trace_lset==lset)
printf("failure: %s\n",precord->name);
@@ -281,7 +277,7 @@ long dbProcess(paddr)
/* process record */
if(trace && trace_lset==lset)
printf("process: %s\n",precord->name);
status = (*prset->process)(paddr);
status = (*prset->process)(precord);
all_done:
if(set_trace) {
@@ -296,8 +292,8 @@ all_done:
struct fldDes *pvdGetFld();
long dbNameToAddr(pname,paddr)
char *pname;
struct dbAddr *paddr;
char *pname;
struct dbAddr *paddr;
{
char *precName;
char recName[PVNAME_SZ+1];
@@ -355,7 +351,7 @@ struct dbAddr *paddr;
recGblDbaddrError(S_db_notFound,paddr,"dbNameToAddr");
return(S_db_notFound);
}
paddr->precord=precord;
paddr->precord=(void *)precord;
paddr->pfield=precord+field_offset;
/*if special is SPC_DBADDR then call cvt_dbaddr */
@@ -370,65 +366,59 @@ struct dbAddr *paddr;
return(status);
}
long dbGetLink(pdblink,pdest,dbrType,pbuffer,options,nRequest)
struct db_link *pdblink;
struct dbCommon *pdest;
short dbrType;
caddr_t pbuffer;
long *options;
long *nRequest;
long dbGetLink(
struct db_link *pdblink,
struct dbCommon *pdest,
short dbrType,
void *pbuffer,
long *options,
long *nRequest
)
{
struct dbAddr *paddr=(struct dbAddr*)(pdblink->pdbAddr);
struct dbCommon *psource=paddr->precord;
long status;
if(pdblink->process_passive) {
status=dbScanPassive(paddr);
status=dbScanPassive(psource);
if(!RTN_SUCCESS(status)) return(status);
}
if(pdblink->maximize_sevr) {
struct dbCommon *pfrom=(struct dbCommon*)(paddr->precord);
if(pfrom->sevr>pdest->nsev) {
pdest->nsev = pfrom->sevr;
pdest->nsta = LINK_ALARM;
}
if(pdblink->maximize_sevr) recGblSetSevr(pdest,LINK_ALARM,psource->sevr);
}
status= dbGetField(paddr,dbrType,pbuffer,options,nRequest,NULL);
if(status) recGblRecordError(status,pdest,"dbGetLink");
return(status);
}
long dbPutLink(pdblink,psource,dbrType,pbuffer,nRequest)
struct db_link *pdblink;
struct dbCommon *psource;
short dbrType;
caddr_t pbuffer;
long nRequest;
long dbPutLink(
struct db_link *pdblink,
struct dbCommon *psource,
short dbrType,
void *pbuffer,
long nRequest
)
{
struct dbAddr *paddr=(struct dbAddr*)(pdblink->pdbAddr);
struct dbCommon *pdest=paddr->precord;
struct fldDes *pfldDes=(struct fldDes *)(paddr->pfldDes);
long status;
status=dbPut(paddr,dbrType,pbuffer,nRequest);
if(pdblink->maximize_sevr) {
struct dbCommon *pto=(struct dbCommon*)(paddr->precord);
if(pto->nsev<psource->sevr) {
pto->nsev = psource->sevr;
pto->nsta = LINK_ALARM;
}
}
if(pdblink->maximize_sevr) recGblSetSevr(pdest,LINK_ALARM,psource->sevr);
if(!RTN_SUCCESS(status)) return(status);
if(pdblink->process_passive) status=dbScanPassive(paddr);
if(paddr->pfield==(void *)&pdest->proc) status=dbProcess(pdest);
else if (pfldDes->process_passive) status=dbScanPassive(pdest);
if(status) recGblRecordError(status,psource,"dbPutLink");
return(status);
}
long dbPutField(paddr,dbrType,pbuffer,nRequest)
struct dbAddr *paddr;
short dbrType;
caddr_t pbuffer;
long nRequest;
long dbPutField(
struct dbAddr *paddr,
short dbrType,
void *pbuffer,
long nRequest
)
{
long status;
struct fldDes *pfldDes=(struct fldDes *)(paddr->pfldDes);
@@ -441,15 +431,19 @@ long dbPutField(paddr,dbrType,pbuffer,nRequest)
dbScanLock(paddr->precord);
status=dbPut(paddr,dbrType,pbuffer,nRequest);
if(status) recGblDbaddrError(status,paddr,"dbPutField");
if(RTN_SUCCESS(status) && pfldDes->process_passive) (void)dbScanPassive(paddr);
if(RTN_SUCCESS(status)){
if(paddr->pfield==(void *)precord->proc) status=dbProcess(precord);
else if (pfldDes->process_passive) status=dbScanPassive(precord);
}
dbScanUnlock(paddr->precord);
return(status);
}
long dbBufferSize(dbr_type,options,no_elements)
short dbr_type;
long options;
long no_elements;
long dbBufferSize(
short dbr_type,
long options,
long no_elements
)
{
long nbytes=0;
@@ -484,9 +478,9 @@ long dbBufferSize(dbr_type,options,no_elements)
*
*/
static void f_to_str(flt_value,pstr_value,precision)
double flt_value;
char *pstr_value;
int precision;
double flt_value;
char *pstr_value;
int precision;
{
unsigned short got_one;
double place;
@@ -566,8 +560,8 @@ int precision;
static char digit_to_ascii[10]={'0','1','2','3','4','5','6','7','8','9'};
static void char_to_str(source,pdest)
char source;
char *pdest;
char source;
char *pdest;
{
unsigned char val,temp;
char digit[3];
@@ -2981,14 +2975,16 @@ void get_graphics();
void get_control();
void get_alarm();
long dbGetField(paddr,dbrType,pbuffer,options,nRequest,pfl)
struct dbAddr *paddr;
short dbrType;
caddr_t pbuffer;
long *options;
long *nRequest;
db_field_log *pfl;
long dbGetField(
struct dbAddr *paddr,
short dbrType,
void *pbuffer,
long *options,
long *nRequest,
void *pflin
)
{
db_field_log *pfl= (db_field_log *)pflin;
long no_elements=paddr->no_elements;
long offset;
struct rset *prset;
@@ -5801,7 +5797,7 @@ long nRequest;
if(special) {
if(special<100) { /*global processing*/
if(special==SPC_NOMOD) return(S_db_noMod);
if(special==SPC_SCAN) delete_from_scan_list(paddr);
if(special==SPC_SCAN) scanDelete(precord);
}
else {
if( prset && (pspecial = (prset->special))) {
@@ -5835,7 +5831,7 @@ long nRequest;
/* check for special processing is required */
if(special) {
if(special<100) { /*global processing*/
if(special==SPC_SCAN) add_to_scan_list(paddr,0xffff);
if(special==SPC_SCAN) scanAdd(precord);
}
else {
status=(*pspecial)(paddr,1);
+3 -3
View File
@@ -409,7 +409,7 @@ register struct event_block *pevent; /* ptr to event blk (not required) */
pevent->valque = FALSE;
LOCKREC(precord);
lstAdd(&precord->mlis, pevent);
lstAdd((LIST*)&precord->mlis,(NODE*) pevent);
UNLOCKREC(precord);
return OK;
@@ -440,9 +440,9 @@ register struct event_block *pevent;
LOCKREC(precord);
/* dont let a misplaced event corrupt the queue */
status = lstFind( &precord->mlis, pevent);
status = lstFind((LIST*)&precord->mlis,(NODE*)pevent);
if(status!=ERROR)
lstDelete( &precord->mlis, pevent);
lstDelete((LIST*)&precord->mlis,(NODE*)pevent);
UNLOCKREC(precord);
if(status == ERROR)
return ERROR;
+572 -1704
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -32,6 +32,7 @@
* .01 08-13-91 mrk Added extra NULL arg to dbGetField calls
* .02 10-23-91 mrk Changed dbior so it also reports device support
* .03 11-26-91 jba Fixed initializations and added hex print to printBuffer
* .04 02-05-92 jba Changed function arguments from paddr to precord
*/
/* Global Database Test Routines - All can be invoked via vxWorks shell
@@ -89,7 +90,6 @@
#include <special.h>
#include <dbRecDes.h>
#include <dbPvd.h>
#include <link.h>
#define MAXLINE 80
struct msgBuff { /* line output structure */
@@ -308,7 +308,7 @@ long dbtr(pname) /* test record and print*/
printf("record locked\n");
return(1);
}
status=dbProcess(&addr);
status=dbProcess(precord);
if(!(RTN_SUCCESS(status)))
recGblRecSupError(S_db_noSupport,&addr,"dbtr","process");
dbpr(pname,3);
+3 -1
View File
@@ -31,6 +31,7 @@
* .01 06-25-91 joh inserted the RISC aligned db_access.h structures
* .02 08-06-91 mrk Make extra values 0
* .03 08-13-91 mrk Add pfl argument to dbGetField calls
* .04 02-05-92 jba Changed function arguments from paddr to precord
*/
@@ -43,6 +44,7 @@
#include <vxWorks.h>
#include <types.h>
#include <stdarg.h>
#include <fioLib.h>
#include <strLib.h>
#include <dbDefs.h>
@@ -485,7 +487,7 @@ register struct db_addr *pdb_addr;
{
long status;
status=dbProcess(pdb_addr);
status=dbProcess((void *)pdb_addr->precord);
if(!RTN_SUCCESS(status)) errMessage(status,"db_process failed");
return;
}
+78 -53
View File
@@ -51,10 +51,14 @@
#include <stdioLib.h>
#include <strLib.h>
#include <sdrHeader.h>
#include <fast_lock.h>
#include <choice.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbScan.h>
#include <taskwd.h>
#include <callback.h>
#include <dbCommon.h>
#include <dbFldTypes.h>
#include <dbRecDes.h>
@@ -63,12 +67,15 @@
#include <devSup.h>
#include <drvSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <envDefs.h>
static initialized=FALSE;
/* The following is for use by interrupt routines */
int interruptAccept=FALSE;
extern short wakeup_init; /*old IO_EVENT_SCAN*/
/* define forward references*/
extern long sdrLoad();
long initDrvSup();
@@ -89,7 +96,7 @@ char * pResourceFilename;
char name[40];
long rtnval;
void (*pdbUserExit)();
UTINY type;
SYM_TYPE type;
if(initialized) {
logMsg("iocInit can only be called once\n");
@@ -113,6 +120,7 @@ char * pResourceFilename;
logMsg("iocInit Failed to Initialize Ioc Log Client \n");
}
initialized = TRUE;
taskwdInit();
if(initDrvSup()!=0) logMsg("iocInit: Drivers Failed during Initialization\n");
if(initRecSup()!=0) logMsg("iocInit: Record Support Failed during Initialization\n");
if(initDevSup()!=0) logMsg("iocInit: Device Support Failed during Initialization\n");
@@ -123,13 +131,16 @@ char * pResourceFilename;
/* if user exit exists call it */
strcpy(name,"_");
strcat(name,"dbUserExit");
rtnval = symFindByName(sysSymTbl,name,&pdbUserExit,&type);
rtnval = symFindByName(sysSymTbl,name,(void *)&pdbUserExit,&type);
if(rtnval==OK && (type&N_TEXT!=0)) {
(*pdbUserExit)();
logMsg("User Exit was called\n");
}
callbackInit();
scanInit();
interruptAccept=TRUE;
wakeup_init=TRUE; /*old IO_EVENT_SCAN*/
if(initialProcess()!=0) logMsg("iocInit: initialProcess Failed\n");
scan_init();
rsrv_init();
logMsg("iocInit: All initialization complete\n");
@@ -141,10 +152,11 @@ static long initDrvSup() /* Locate all driver support entry tables */
char *pname;
char name[40];
int i;
UTINY type;
SYM_TYPE type;
char message[100];
long status;
long rtnval=0;
long status=0;
long rtnval;
STATUS vxstatus;
if(!drvSup) {
status = S_drv_noDrvSup;
@@ -155,30 +167,30 @@ static long initDrvSup() /* Locate all driver support entry tables */
if(!(pname = drvSup->drvetName[i])) continue;
strcpy(name,"_");
strcat(name,pname);
rtnval = symFindByName(sysSymTbl,name,&(drvSup->papDrvet[i]),&type);
if( rtnval!=OK || ( type&N_TEXT == 0) ) {
vxstatus = symFindByName(sysSymTbl,name,(void *)&(drvSup->papDrvet[i]),&type);
if( vxstatus!=OK || ( type&N_TEXT == 0) ) {
strcpy(message,"driver entry table not found for ");
strcat(message,pname);
status = S_drv_noDrvet;
errMessage(status,message);
if(rtnval==OK) rtnval=status;
continue;
}
if(!(drvSup->papDrvet[i]->init)) continue;
status = (*(drvSup->papDrvet[i]->init))();
if(rtnval==OK) rtnval=status;
rtnval = (*(drvSup->papDrvet[i]->init))();
if(status==0) status = rtnval;
}
return(rtnval);
return(status);
}
static long initRecSup()
{
char name[40];
int i;
UTINY type;
SYM_TYPE type;
char message[100];
long status;
long rtnval=0; /*rtnval will be 0 or first error found*/
long status=0;
long rtnval;
STATUS vxstatus;
int nbytes;
if(!dbRecType) {
@@ -187,7 +199,7 @@ static long initRecSup()
return(status);
}
nbytes = sizeof(struct recSup) + dbRecType->number*sizeof(caddr_t);
recSup = (struct recSup *)calloc(1,nbytes);
recSup = calloc(1,nbytes);
recSup->number = dbRecType->number;
(long)recSup->papRset = (long)recSup + (long)sizeof(struct recSup);
for(i=0; i< (recSup->number); i++) {
@@ -195,22 +207,22 @@ static long initRecSup()
strcpy(name,"_");
strcat(name,dbRecType->papName[i]);
strcat(name,"RSET");
rtnval = symFindByName(sysSymTbl,name,&(recSup->papRset[i]),&type);
if( rtnval!=OK || ( type&N_TEXT == 0) ) {
vxstatus = symFindByName(sysSymTbl,name,
(void *)(&recSup->papRset[i]),&type);
if( vxstatus!=OK || ( type&N_TEXT == 0) ) {
strcpy(message,"record support entry table not found for ");
strcat(message,name);
status = S_rec_noRSET;
errMessage(status,message);
if(rtnval==OK)rtnval=status;
continue;
}
if(!(recSup->papRset[i]->init)) continue;
else {
status = (*(recSup->papRset[i]->init))();
if(rtnval==OK)rtnval=status;
rtnval = (*(recSup->papRset[i]->init))();
if(status==0) status = rtnval;
}
}
return(rtnval);
return(status);
}
static long initDevSup() /* Locate all device support entry tables */
@@ -218,10 +230,11 @@ static long initDevSup() /* Locate all device support entry tables */
char *pname;
char name[40];
int i,j;
UTINY type;
SYM_TYPE type;
char message[100];
long status;
long rtnval=0; /*rtnval will be 0 or first error found*/
long status=0;
long rtnval;
STATUS vxstatus;
struct recLoc *precLoc;
struct devSup *pdevSup;
struct dbCommon *precord;
@@ -237,20 +250,19 @@ static long initDevSup() /* Locate all device support entry tables */
if(!(pname = pdevSup->dsetName[j])) continue;
strcpy(name,"_");
strcat(name,pname);
rtnval = (long)symFindByName(sysSymTbl,name,
&(pdevSup->papDset[j]),&type);
if( rtnval!=OK || ( type&N_TEXT == 0) ) {
vxstatus = (long)symFindByName(sysSymTbl,name,
(void *)&(pdevSup->papDset[j]),&type);
if( vxstatus!=OK || ( type&N_TEXT == 0) ) {
pdevSup->papDset[j]=NULL;
strcpy(message,"device support entry table not found for ");
strcat(message,pname);
status = S_dev_noDSET;
errMessage(status,message);
if(rtnval==OK)rtnval=status;
continue;
}
if(!(pdevSup->papDset[j]->init)) continue;
status = (*(pdevSup->papDset[j]->init))(0);
if(rtnval==OK)rtnval=status;
rtnval = (*(pdevSup->papDset[j]->init))(0);
if(status==0) status = rtnval;
}
/* Now initialize dset for each record */
@@ -265,7 +277,7 @@ static long initDevSup() /* Locate all device support entry tables */
precord->dset=(struct dset *)GET_PDSET(pdevSup,precord->dtyp);
}
}
return(rtnval);
return(status);
}
static long finishDevSup()
@@ -292,8 +304,8 @@ static long initDatabase()
char name[PVNAME_SZ+FLDNAME_SZ+2];
short i,j,k;
char message[120];
long status;
long rtnval=0; /*rtnval will be 0 or first error found*/
long status=0;
long rtnval;
short nset=0;
short lookAhead;
struct recLoc *precLoc;
@@ -318,7 +330,6 @@ static long initDatabase()
strcat(message,name);
status = S_rec_noRSET;
errMessage(status,message);
if(rtnval==OK) rtnval = status;
continue;
}
precTypDes = dbRecDes->papRecTypDes[i];
@@ -328,17 +339,8 @@ static long initDatabase()
/* If NAME is null then skip this record*/
if(!(precord->name[0])) continue;
/*initialize fields rset and pdba*/
/*initialize fields rset*/
(struct rset *)(precord->rset) = prset;
precord->pdba = (struct dbAddr *)calloc(1,sizeof(struct dbAddr));
strncpy(name,precord->name,PVNAME_SZ);
name[PVNAME_SZ]=0;
strcat(name,".VAL");
if(dbNameToAddr(name,precord->pdba)) {
status = S_db_notFound;
errMessage(status,
"initDatbase logic error: dbNameToAddr failed");
}
/* initialize mlok and mlis*/
FASTLOCKINIT(&precord->mlok);
@@ -366,7 +368,7 @@ static long initDatabase()
((struct dbCommon *)(dbAddr.precord))->lset= -1;
plink->type = DB_LINK;
plink->value.db_link.pdbAddr =
(caddr_t)calloc(1,sizeof(struct dbAddr));
calloc(1,sizeof(struct dbAddr));
*((struct dbAddr *)(plink->value.db_link.pdbAddr))=dbAddr;
}
else {
@@ -380,15 +382,14 @@ static long initDatabase()
strcat(message," not found");
status = S_db_notFound;
errMessage(status,message);
if(rtnval==OK) rtnval=status;
}
}
}
/* call record support init_record routine */
if(!(recSup->papRset[i]->init_record)) continue;
status = (*(recSup->papRset[i]->init_record))(precord);
if(rtnval==OK)rtnval=status;
rtnval = (*(recSup->papRset[i]->init_record))(precord);
if(status==0) status = rtnval;
}
}
@@ -410,12 +411,13 @@ static long initDatabase()
if(precord->lset > 0) continue; /*already in a lock set */
lookAhead = ( (precord->lset == -1) ? TRUE : FALSE);
nset++;
status = addToSet(precord,i,lookAhead,i,j,nset);
rtnval = addToSet(precord,i,lookAhead,i,j,nset);
if(status==0) status=rtnval;
if(status) return(status);
}
}
dbScanLockInit(nset);
return(rtnval);
return(status);
}
static long addToSet(precord,record_type,lookAhead,i,j,lset)
@@ -522,7 +524,7 @@ static long initialProcess()
/* If NAME is null then skip this record*/
if(!(precord->name[0])) continue;
if(!precord->pini) continue;
(void)dbProcess(precord->pdba);
(void)dbProcess(precord);
}
}
return(0);
@@ -543,6 +545,7 @@ static long getResources(fname) /* Resource Definition File interpreter */
char *fname;
{
int fd;
int fd2;
int len;
int len2;
int lineNum = 0;
@@ -563,6 +566,28 @@ static long getResources(fname) /* Resource Definition File interpreter */
long n_long;
float n_float;
double n_double;
if (sdrSum) {
if ((fd2 = open("default.sdrSum", READ, 0x0)) < 0) {
errMessage(0L, "Can't open default.sdrSum file");
return (-1);
}
fioRdString(fd2, buff, MAX);
close(fd2);
len2 = strlen(sdrSum->allSdrSums);
if ((strncmp(sdrSum->allSdrSums, buff, len2)) != SAME) {
errMessage(-1L, "WARNING WARNING WARNING WARNING WARNING WARNING WARNING");
errMessage(-1L, "WARNING WARNING WARNING WARNING WARNING WARNING WARNING");
errMessage(-1L, "WARNING WARNING WARNING WARNING WARNING WARNING WARNING");
errMessage(0L, "THIS DATABASE IS OUT_OF_DATE");
errMessage(-1L, "WARNING WARNING WARNING WARNING WARNING WARNING WARNING");
errMessage(-1L, "WARNING WARNING WARNING WARNING WARNING WARNING WARNING");
errMessage(-1L, "WARNING WARNING WARNING WARNING WARNING WARNING WARNING");
return (-1);
}
} else {
logMsg("Skipping Check for an out-of-date database\n");
}
if (!fname) return (0);
if ((fd = open(fname, READ, 0x0)) < 0) {
errMessage(0L, "getResources: No such Resource file");
+1 -2
View File
@@ -37,11 +37,10 @@
#include <strLib.h>
#include <choice.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbRecType.h>
#include <dbRecDes.h>
#include <link.h>
#include <dbAccess.h>
#include <devSup.h>
#include <dbCommon.h>
+2 -2
View File
@@ -137,7 +137,7 @@ static void taskwdTask()
pname = taskName(pt->tid);
if(!pt->suspended) {
sprintf(message,"task %d %s suspended",pt->tid,pname);
sprintf(message,"task %x %s suspended",pt->tid,pname);
errMessage(-1,message);
if(pt->callback) (pt->callback)(pt->arg);
}
@@ -159,7 +159,7 @@ struct task_list *allocList()
if(freeHead) {
(void *)pt = (void *)freeHead;
freeHead = freeHead->next;
} else pt = calloc(1,sizeof(struct task_list *));
} else pt = calloc(1,sizeof(struct task_list));
if(pt==NULL) {
errMessage(0,"taskwd failed on call to calloc\n");
exit(1);
+1 -1
View File
@@ -115,7 +115,7 @@ static long get_ioint_info(cmd,pai,io_type,card_type,card_number)
short *card_type;
short *card_number;
{
*cmd=0;
*cmd=-1;
if(pai->inp.type != VME_IO) return(S_dev_badInpType);
*io_type = IO_AI;
*card_type = DVX2502;
+1 -1
View File
@@ -111,7 +111,7 @@ static long read_ai(pai)
case (DB_LINK) :
options=0;
nRequest=1;
status = dbGetLink(&(pai->inp.value.db_link),pai,DBR_DOUBLE,
status = dbGetLink(&(pai->inp.value.db_link),(struct dbCommon *)pai,DBR_DOUBLE,
&(pai->val),&options,&nRequest);
if(status!=0) {
recGblSetSevr(pai,LINK_ALARM,VALID_ALARM);
+1 -1
View File
@@ -107,7 +107,7 @@ static long read_ai(pai)
case (DB_LINK) :
options=0;
nRequest=1;
status = dbGetLink(&(pai->inp.value.db_link),pai,DBR_LONG,
status = dbGetLink(&(pai->inp.value.db_link),(struct dbCommon *)pai,DBR_LONG,
&(pai->rval),&options,&nRequest);
if(status!=0) {
recGblSetSevr(pai,LINK_ALARM,VALID_ALARM);
+7 -4
View File
@@ -30,6 +30,8 @@
*
* Modification Log:
* -----------------
* .01 01-08-92 jba Added cast in call to wdStart to avoid compile warning msg
* .02 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -39,6 +41,7 @@
#include <wdLib.h>
#include <alarm.h>
#include <callback.h>
#include <cvtTable.h>
#include <dbDefs.h>
#include <dbAccess.h>
@@ -83,9 +86,9 @@ static void myCallback(pcallback)
struct aiRecord *pai=(struct aiRecord *)(pcallback->prec);
struct rset *prset=(struct rset *)(pai->rset);
dbScanLock(pai);
(*prset->process)(pai->pdba);
dbScanUnlock(pai);
dbScanLock((struct dbCommon *)pai);
(*prset->process)(pai);
dbScanUnlock((struct dbCommon *)pai);
}
@@ -135,7 +138,7 @@ static long read_ai(pai)
wait_time = (int)(pai->disv * vxTicksPerSecond);
if(wait_time<=0) return(0);
printf("%s Starting asynchronous processing\n",pai->name);
wdStart(pcallback->wd_id,wait_time,callbackRequest,pcallback);
wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback);
return(1);
}
default :
+1 -1
View File
@@ -113,7 +113,7 @@ static long get_ioint_info(cmd,pai,io_type,card_type,card_number)
short *card_type;
short *card_number;
{
*cmd=0;
*cmd=-1;
if(pai->inp.type != VME_IO) return(S_dev_badInpType);
*io_type = IO_AI;
*card_type = XY566DIL;
+2 -1
View File
@@ -31,6 +31,7 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
* .02 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -78,7 +79,7 @@ static long write_ao(pao)
case (CONSTANT) :
break;
case (DB_LINK) :
status = dbPutLink(&pao->out.value.db_link,pao,DBR_DOUBLE,
status = dbPutLink(&pao->out.value.db_link,(struct dbCommon *)pao,DBR_DOUBLE,
&pao->oval,1L);
if(status!=0) {
recGblSetSevr(pao,LINK_ALARM,VALID_ALARM);
+1 -1
View File
@@ -77,7 +77,7 @@ static long write_ao(pao)
case (CONSTANT) :
break;
case (DB_LINK) :
status = dbPutLink(&pao->out.value.db_link,pao,DBR_LONG,
status = dbPutLink(&pao->out.value.db_link,(struct dbCommon *)pao,DBR_LONG,
&pao->rval,1L);
if(status!=0) {
recGblSetSevr(pao,LINK_ALARM,VALID_ALARM);
+8 -5
View File
@@ -31,6 +31,8 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
* .02 01-08-92 jba Added cast in call to wdStart to avoid compile warning msg
* .03 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -41,6 +43,7 @@
#include <wdLib.h>
#include <alarm.h>
#include <callback.h>
#include <cvtTable.h>
#include <dbDefs.h>
#include <dbAccess.h>
@@ -82,11 +85,11 @@ static void myCallback(pcallback)
struct callback *pcallback;
{
struct aoRecord *pao=(struct aoRecord *)(pcallback->prec);
struct rset *prset=(struct rset *)(pao->rset);
struct rset *prset=(struct rset *)(pao->rset);
dbScanLock(pao);
(*prset->process)(pao->pdba);
dbScanUnlock(pao);
dbScanLock((struct dbCommon *)pao);
(*prset->process)(pao);
dbScanUnlock((struct dbCommon *)pao);
}
@@ -134,7 +137,7 @@ static long write_ao(pao)
wait_time = (int)(pao->disv * vxTicksPerSecond);
if(wait_time<=0) return(0);
printf("%s Starting asynchronous processing\n",pao->name);
wdStart(pcallback->wd_id,wait_time,callbackRequest,pcallback);
wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback);
return(1);
}
default :
+1 -2
View File
@@ -40,11 +40,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <special.h>
#include <module_types.h>
#include <aoRecord.h>
+1 -2
View File
@@ -40,11 +40,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <biRecord.h>
+2 -3
View File
@@ -40,11 +40,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <biRecord.h>
@@ -108,7 +107,7 @@ static long read_bi(pbi)
case (DB_LINK) :
options=0;
nRequest=1;
status = dbGetLink(&(pbi->inp.value.db_link),pbi,DBR_USHORT,
status = dbGetLink(&(pbi->inp.value.db_link),(struct dbCommon *)pbi,DBR_USHORT,
&pbi->val,&options,&nRequest);
if(status!=0) {
recGblSetSevr(pbi,LINK_ALARM,VALID_ALARM);
+3 -3
View File
@@ -31,6 +31,7 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
* .02 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -40,11 +41,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <biRecord.h>
@@ -107,7 +107,7 @@ static long read_bi(pbi)
case (DB_LINK) :
options=0;
nRequest=1;
status = dbGetLink(&(pbi->inp.value.db_link),pbi,DBR_ULONG,
status = dbGetLink(&(pbi->inp.value.db_link),(struct dbCommon *)pbi,DBR_ULONG,
&pbi->rval,&options,&nRequest);
if(status!=0) {
recGblSetSevr(pbi,LINK_ALARM,VALID_ALARM);
+7 -4
View File
@@ -31,6 +31,8 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
* .02 01-08-92 jba Added cast in call to wdStart to avoid compile warning msg
* .03 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -41,6 +43,7 @@
#include <wdLib.h>
#include <alarm.h>
#include <callback.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
@@ -85,9 +88,9 @@ static void myCallback(pcallback)
struct biRecord *pbi=(struct biRecord *)(pcallback->prec);
struct rset *prset=(struct rset *)(pbi->rset);
dbScanLock(pbi);
(*prset->process)(pbi->pdba);
dbScanUnlock(pbi);
dbScanLock((struct dbCommon *)pbi);
(*prset->process)(pbi);
dbScanUnlock((struct dbCommon *)pbi);
}
@@ -137,7 +140,7 @@ static long read_bi(pbi)
wait_time = (int)(pbi->disv * vxTicksPerSecond);
if(wait_time<=0) return(0);
printf("%s Starting asynchronous processing\n",pbi->name);
wdStart(pcallback->wd_id,wait_time,callbackRequest,pcallback);
wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback);
return(1);
}
default :
+1 -2
View File
@@ -40,11 +40,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <biRecord.h>
+1 -2
View File
@@ -40,11 +40,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <boRecord.h>
+2 -3
View File
@@ -40,11 +40,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <boRecord.h>
@@ -79,7 +78,7 @@ static long write_bo(pbo)
case (CONSTANT) :
break;
case (DB_LINK) :
status = dbPutLink(&pbo->out.value.db_link,pbo,DBR_USHORT,&pbo->val,1L);
status = dbPutLink(&pbo->out.value.db_link,(struct dbCommon *)pbo,DBR_USHORT,&pbo->val,1L);
if(status!=0) {
recGblSetSevr(pbo,LINK_ALARM,VALID_ALARM);
}
+7 -4
View File
@@ -31,6 +31,8 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
* .02 01-08-92 jba Added cast in call to wdStart to avoid compile warning msg
* .03 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -42,6 +44,7 @@
#include <wdLib.h>
#include <alarm.h>
#include <callback.h>
#include <cvtTable.h>
#include <dbDefs.h>
#include <dbAccess.h>
@@ -85,9 +88,9 @@ static void myCallback(pcallback)
struct boRecord *pbo=(struct boRecord *)(pcallback->prec);
struct rset *prset=(struct rset *)(pbo->rset);
dbScanLock(pbo);
(*prset->process)(pbo->pdba);
dbScanUnlock(pbo);
dbScanLock((struct dbCommon *)pbo);
(*prset->process)(pbo);
dbScanUnlock((struct dbCommon *)pbo);
}
@@ -135,7 +138,7 @@ static long write_bo(pbo)
wait_time = (int)(pbo->disv * vxTicksPerSecond);
if(wait_time<=0) return(0);
printf("%s Starting asynchronous processing\n",pbo->name);
wdStart(pcallback->wd_id,wait_time,callbackRequest,pcallback);
wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback);
return(1);
}
default :
+1 -2
View File
@@ -40,11 +40,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <boRecord.h>
+5 -6
View File
@@ -1,5 +1,5 @@
/* devEventSoft.c */
/* share/src/dev @(#)devEvent.c 1.1 12/17/91 */
/* share/src/dev $Id$ */
/* devEventSoft.c - Device Support Routines for Soft Event Input */
/*
@@ -38,11 +38,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <eventRecord.h>
@@ -76,7 +75,7 @@ static long init_record(pevent)
switch (pevent->inp.type) {
case (CONSTANT) :
if(pevent->inp.value.value!=0.0){
pevent->enum=pevent->inp.value.value;
pevent->val=pevent->inp.value.value;
}
pevent->udf= FALSE;
break;
@@ -108,8 +107,8 @@ static long read_event(pevent)
case (DB_LINK) :
options=0;
nRequest=1;
status = dbGetLink(&(pevent->inp.value.db_link),pevent,DBR_SHORT,
pevent->enum,&options,&nRequest);
status = dbGetLink(&(pevent->inp.value.db_link),(struct dbCommon *)pevent,DBR_USHORT,
&pevent->val,&options,&nRequest);
if(status!=0) {
recGblSetSevr(pevent,LINK_ALARM,VALID_ALARM);
} else pevent->udf = FALSE;
+44 -94
View File
@@ -1,11 +1,10 @@
/* devAiTestAsyn.c */
/* devEventTestIoEvent.c */
/* share/src/dev $Id$ */
/* devAiTestAsyn.c - Device Support Routines for testing asynchronous processing*/
/* devEventTestIoEvent.c - Device Support Routines for ioEvent*/
/*
* Original Author: Bob Dalesio
* Current Author: Marty Kraimer
* Date: 6-1-90
* Author: Marty Kraimer
* Date: 01/09/92
*
* Experimental Physics and Industrial Control System (EPICS)
*
@@ -30,123 +29,74 @@
*
* Modification Log:
* -----------------
* .00 12-13-91 jba Initial definition
* ...
*/
#include <vxWorks.h>
#include <types.h>
#include <stdioLib.h>
#include <wdLib.h>
#include <alarm.h>
#include <callback.h>
#include <cvtTable.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbScan.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <aiRecord.h>
/* Create the dset for devAiTestAsyn */
long init_record();
long read_ai();
#include <eventRecord.h>
/* Create the dset for devEventTestIoEvent */
long init();
long get_ioint_info();
long read_event();
struct {
long number;
DEVSUPFUN report;
DEVSUPFUN init;
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_ai;
DEVSUPFUN read_event;
DEVSUPFUN special_linconv;
}devAiTestAsyn={
}devEventTestIoEvent={
6,
NULL,
init,
NULL,
init_record,
NULL,
read_ai,
get_ioint_info,
read_event,
NULL};
/* control block for callback*/
struct callback {
void (*callback)();
int priority;
struct dbCommon *prec;
WDOG_ID wd_id;
};
IOSCANPVT ioscanpvt;
WDOG_ID wd_id=NULL;
void callbackRequest();
static void myCallback(pcallback)
struct callback *pcallback;
static long init()
{
struct aiRecord *pai=(struct aiRecord *)(pcallback->prec);
struct rset *prset=(struct rset *)(pai->rset);
dbScanLock(pai);
(*prset->process)(pai->pdba);
dbScanUnlock(pai);
}
static long init_record(pai)
struct aiRecord *pai;
{
char message[100];
struct callback *pcallback;
/* ai.inp must be a CONSTANT*/
switch (pai->inp.type) {
case (CONSTANT) :
pcallback = (struct callback *)(calloc(1,sizeof(struct callback)));
pai->dpvt = (caddr_t)pcallback;
pcallback->callback = myCallback;
pcallback->priority = priorityLow;
pcallback->prec = (struct dbCommon *)pai;
pcallback->wd_id = wdCreate();
pai->val = pai->inp.value.value;
pai->udf = FALSE;
break;
default :
strcpy(message,pai->name);
strcat(message,": devAiTestAsyn (init_record) Illegal INP field");
errMessage(S_db_badField,message);
return(S_db_badField);
}
scanIoInit(&ioscanpvt);
return(0);
}
static long read_ai(pai)
struct aiRecord *pai;
{
char message[100];
long status,options,nRequest;
struct callback *pcallback=(struct callback *)(pai->dpvt);
int wait_time;
/* ai.inp must be a CONSTANT*/
switch (pai->inp.type) {
case (CONSTANT) :
if(pai->pact) {
printf("%s Completed\n",pai->name);
return(2); /* don`t convert*/
} else {
wait_time = (int)(pai->disv * vxTicksPerSecond);
if(wait_time<=0) return(0);
printf("%s Starting asynchronous processing\n",pai->name);
wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback);
return(1);
}
default :
if(recGblSetSevr(pai,SOFT_ALARM,VALID_ALARM)){
if(pai->stat!=SOFT_ALARM) {
strcpy(message,pai->name);
strcat(message,": devAiTestAsyn (read_ai) Illegal INP field");
errMessage(S_db_badField,message);
}
}
}
static long get_ioint_info(
int *cmd,
struct eventRecord *pr,
IOSCANPVT *ppvt)
{
*ppvt = ioscanpvt;
return(0);
}
static long read_event(pevent)
struct eventRecord *pevent;
{
char message[100];
int wait_time;
wait_time = (int)(pevent->proc * vxTicksPerSecond);
if(wait_time<=0) return(0);
pevent->udf = FALSE;
if(wd_id==NULL) wd_id = wdCreate();
printf("%s Requesting Next ioEnevt\n",pevent->name);
wdStart(wd_id,wait_time,scanIoRequest,(int)ioscanpvt);
return(0);
}
+1 -1
View File
@@ -107,7 +107,7 @@ static long read_histogram(phistogram)
case (DB_LINK) :
options=0;
nRequest=1;
status = dbGetLink(&(phistogram->svl.value.db_link),phistogram,DBR_DOUBLE,
status = dbGetLink(&(phistogram->svl.value.db_link),(struct dbCommon *)phistogram,DBR_DOUBLE,
&(phistogram->sgnl),&options,&nRequest);
if(status!=0) {
if(phistogram->nsev<VALID_ALARM) {
+7 -4
View File
@@ -30,6 +30,8 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
* .02 01-08-92 jba Added cast in call to wdStart to avoid compile warning msg
* .03 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -39,6 +41,7 @@
#include <wdLib.h>
#include <alarm.h>
#include <callback.h>
#include <cvtTable.h>
#include <dbDefs.h>
#include <dbAccess.h>
@@ -83,9 +86,9 @@ static void myCallback(pcallback)
struct histogramRecord *phistogram=(struct histogramRecord *)(pcallback->prec);
struct rset *prset=(struct rset *)(phistogram->rset);
dbScanLock(phistogram);
(*prset->process)(phistogram->pdba);
dbScanUnlock(phistogram);
dbScanLock((struct dbCommon *)phistogram);
(*prset->process)(phistogram);
dbScanUnlock((struct dbCommon *)phistogram);
return;
}
@@ -133,7 +136,7 @@ static long read_histogram(phistogram)
wait_time = (int)(phistogram->disv * vxTicksPerSecond);
if(wait_time<=0) return(0);
printf("%s Starting asynchronous processing\n",phistogram->name);
wdStart(pcallback->wd_id,wait_time,callbackRequest,pcallback);
wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback);
return(1);
}
default :
+2 -3
View File
@@ -38,11 +38,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <longinRecord.h>
@@ -105,7 +104,7 @@ static long read_longin(plongin)
case (DB_LINK) :
options=0;
nRequest=1;
status = dbGetLink(&(plongin->inp.value.db_link),plongin,DBR_LONG,
status = dbGetLink(&(plongin->inp.value.db_link),(struct dbCommon *)plongin,DBR_LONG,
&plongin->val,&options,&nRequest);
if(status!=0) {
recGblSetSevr(plongin,LINK_ALARM,VALID_ALARM);
+2 -3
View File
@@ -37,11 +37,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <longoutRecord.h>
@@ -75,7 +74,7 @@ static long write_longout(plongout)
case (CONSTANT) :
break;
case (DB_LINK) :
status = dbPutLink(&plongout->out.value.db_link,plongout,DBR_LONG,
status = dbPutLink(&plongout->out.value.db_link,(struct dbCommon *)plongout,DBR_LONG,
&plongout->val,1L);
if(status!=0) {
recGblSetSevr(plongout,LINK_ALARM,VALID_ALARM);
+1 -2
View File
@@ -41,11 +41,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <mbbiRecord.h>
+2 -3
View File
@@ -40,11 +40,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <mbbiRecord.h>
@@ -107,7 +106,7 @@ static long read_mbbi(pmbbi)
case (DB_LINK) :
options=0;
nRequest=1;
status = dbGetLink(&(pmbbi->inp.value.db_link),pmbbi,DBR_USHORT,
status = dbGetLink(&(pmbbi->inp.value.db_link),(struct dbCommon *)pmbbi,DBR_USHORT,
&(pmbbi->val),&options,&nRequest);
if(status!=0) {
recGblSetSevr(pmbbi,LINK_ALARM,VALID_ALARM);
+3 -3
View File
@@ -31,6 +31,7 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
* .02 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -40,11 +41,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <mbbiRecord.h>
@@ -106,7 +106,7 @@ static long read_mbbi(pmbbi)
case (DB_LINK) :
options=0;
nRequest=1;
status = dbGetLink(&(pmbbi->inp.value.db_link),pmbbi,DBR_ULONG,
status = dbGetLink(&(pmbbi->inp.value.db_link),(struct dbCommon *)pmbbi,DBR_ULONG,
&(pmbbi->rval),&options,&nRequest);
if(status!=0) {
recGblSetSevr(pmbbi,LINK_ALARM,VALID_ALARM);
+7 -4
View File
@@ -31,6 +31,8 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
* .02 01-08-92 jba Added cast in call to wdStart to avoid compile warning msg
* .03 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -41,6 +43,7 @@
#include <wdLib.h>
#include <alarm.h>
#include <callback.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
@@ -84,9 +87,9 @@ static void myCallback(pcallback)
struct mbbiRecord *pmbbi=(struct mbbiRecord *)(pcallback->prec);
struct rset *prset=(struct rset *)(pmbbi->rset);
dbScanLock(pmbbi);
(*prset->process)(pmbbi->pdba);
dbScanUnlock(pmbbi);
dbScanLock((struct dbCommon *)pmbbi);
(*prset->process)(pmbbi);
dbScanUnlock((struct dbCommon *)pmbbi);
}
@@ -136,7 +139,7 @@ static long read_mbbi(pmbbi)
wait_time = (int)(pmbbi->disv * vxTicksPerSecond);
if(wait_time<=0) return(0);
printf("%s Starting asynchronous processing\n",pmbbi->name);
wdStart(pcallback->wd_id,wait_time,callbackRequest,pcallback);
wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback);
return(1);
}
default :
+1 -2
View File
@@ -41,11 +41,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <mbbiRecord.h>
+1 -2
View File
@@ -41,11 +41,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <mbboRecord.h>
+2 -3
View File
@@ -40,11 +40,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <mbboRecord.h>
@@ -81,7 +80,7 @@ static long write_mbbo(pmbbo)
case (CONSTANT) :
break;
case (DB_LINK) :
status = dbPutLink(&pmbbo->out.value.db_link,pmbbo,DBR_USHORT,
status = dbPutLink(&pmbbo->out.value.db_link,(struct dbCommon *)pmbbo,DBR_USHORT,
&pmbbo->val,1L);
if(status!=0) {
recGblSetSevr(pmbbo,LINK_ALARM,VALID_ALARM);
+7 -4
View File
@@ -31,6 +31,8 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
* .02 01-08-92 jba Added cast in call to wdStart to avoid compile warning msg
* .03 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -41,6 +43,7 @@
#include <wdLib.h>
#include <alarm.h>
#include <callback.h>
#include <cvtTable.h>
#include <dbDefs.h>
#include <dbAccess.h>
@@ -84,9 +87,9 @@ static void myCallback(pcallback)
struct mbboRecord *pmbbo=(struct mbboRecord *)(pcallback->prec);
struct rset *prset=(struct rset *)(pmbbo->rset);
dbScanLock(pmbbo);
(*prset->process)(pmbbo->pdba);
dbScanUnlock(pmbbo);
dbScanLock((struct dbCommon *)pmbbo);
(*prset->process)(pmbbo);
dbScanUnlock((struct dbCommon *)pmbbo);
}
@@ -134,7 +137,7 @@ static long write_mbbo(pmbbo)
wait_time = (int)(pmbbo->disv * vxTicksPerSecond);
if(wait_time<=0) return(0);
printf("%s Starting asynchronous processing\n",pmbbo->name);
wdStart(pcallback->wd_id,wait_time,callbackRequest,pcallback);
wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback);
return(1);
}
default :
+1 -2
View File
@@ -41,11 +41,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <mbboRecord.h>
+140 -51
View File
@@ -31,40 +31,44 @@
* -----------------
* .01 10-22-91 mrk Initial Implementation
* .02 11-26-91 jba Initialized clockDiv to 0
* .03 11-11-91 jba Moved set of alarm stat and sevr to macros
* .03 12-11-91 jba Moved set of alarm stat and sevr to macros
* .04 01-14-92 mrk Added interrupt support
* ...
*/
/* In order to understand the code in the file you must first */
/* In order to understand the code in this file you must first */
/* understand the MIZAR 8310 Users Manual. */
/* You must also understand Chapter 1 of the */
/* the Advanced Micro Devices Am9513 Technical Manual */
#include <vxWorks.h>
#include <vme.h>
#include <types.h>
#include <stdioLib.h>
#include <68k/iv.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbRecType.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbCommon.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <dbScan.h>
#include <special.h>
#include <module_types.h>
#include <eventRecord.h>
#include <pulseCounterRecord.h>
#include <pulseDelayRecord.h>
#include <pulseTrainRecord.h>
/* Create the dsets for devMz8310 */
long report();
long init();
long init_pc();
long init_pd();
long init_pt();
long get_ioint_info();
long cmd_pc();
long write_pd();
long write_pt();
@@ -76,35 +80,60 @@ typedef struct {
DEVSUPFUN init_record;
DEVSUPFUN get_ioint_info;
DEVSUPFUN write;} MZDSET;
MZDSET devPcMz8310={ 5, report, init, init_pc, NULL, cmd_pc};
MZDSET devPdMz8310={ 5, NULL, NULL, init_pd, NULL, write_pd};
MZDSET devPtMz8310={ 5, NULL, NULL, init_pt, NULL, write_pt};
/*It doesnt matter who honors report or init thus let 1st devSup do it*/
MZDSET devEventMz8310= { 5, report, init, NULL, get_ioint_info, NULL};
MZDSET devPcMz8310= { 5, NULL, NULL, init_pc, NULL, cmd_pc};
MZDSET devPdMz8310= { 5, NULL, NULL, init_pd, NULL, write_pd};
MZDSET devPtMz8310= { 5, NULL, NULL, init_pt, NULL, write_pt};
/*forward references */
void mz8310_int_service(IOSCANPVT);
volatile int mz8310Debug=0;
static unsigned short *shortaddr;
/* definitions related to fields of records*/
/* defs for gsrc and csrc fields */
#define INTERNAL 0
#define EXTERNAL 1
#define SOFTWARE 1
/* defs for counter commands */
#define CTR_READ 0
#define CTR_CLEAR 1
#define CTR_START 2
#define CTR_STOP 3
#define CTR_SETUP 4
/* defines specific to mz8310*/
#define MAXCARDS 4
static unsigned short BASE;
#define MAXCARDS 4
#define CARDSIZE 0x00000100
#define NUMINTVEC 4
#define CHIPSIZE 0x20
#define CHANONCHIP 5
#define NCHIP 2
/*static*/
unsigned short *shortaddr;
int mz8310Debug=0;
static struct {
unsigned char irq_lev; /*interrupt request level */
unsigned char vec_addr; /*offset from base register*/
}mz8310_strap_info[NUMINTVEC] = {
{1,0x41},{3,0x61},{5,0x81},{6,0xA1}};
/*keep information needed for reporting*/
static int ncards=0;
static struct mz8310_info {
short present;
struct {
short connected;
short nrec_using;
IOSCANPVT ioscanpvt;
} int_info[NUMINTVEC];
struct {
short nrec_using;
} chan_info[NCHIP][CHANONCHIP];
}mz8310_info[MAXCARDS];
#define PCMDREG(CARD,CHIP) \
( (unsigned char *)\
@@ -112,6 +141,14 @@ int mz8310Debug=0;
#define PDATAREG(CARD,CHIP) \
( (unsigned short *)\
((unsigned char*)shortaddr + BASE + (CARD)*CARDSIZE + (CHIP)*CHIPSIZE))
#define MZ8310INTVEC(CARD,INTVEC) \
( (unsigned char) \
(MZ8310_INT_VEC_BASE + (CARD)*NUMINTVEC + (INTVEC)))
#define PVECREG(CARD,INTVEC) \
( (unsigned char *)\
((unsigned char*)shortaddr + BASE + (CARD)*CARDSIZE + mz8310_strap_info[(INTVEC)].vec_addr))
/*definitions for am9513 stc chip */
/* Internal clock rate and rate divisor */
#define INT_CLOCK_RATE 4e6
@@ -145,7 +182,7 @@ int mz8310Debug=0;
#define ENAPRE 0xf8
#define DISPRE 0xf9
#define RESET 0xff
/* Count Source Selection */
#define SRC1 0x0100
#define SRC2 0x0200
@@ -159,19 +196,7 @@ static unsigned short externalCountSource[] = {SRC1,SRC2,SRC3,SRC4,SRC5};
#define F4 0x0e00
#define F5 0x0f00
static unsigned short internalCountSource[] = {F1,F2,F3,F4,F5};
/*static*/
int ncards=0;
/*static*/
struct mz8310_info {
short present;
struct {
short used;
short type;
} chan_info[NCHIP][CHANONCHIP];
}mz8310_info[MAXCARDS];
/*The following are used to communicate with the mz8310. */
/*The mz8310 can not keep up when commands are sent as rapidly as possible.*/
@@ -210,11 +235,9 @@ getData(preg,pdata)
static long init(after)
short after;
{
int card,chip,channel;
/*volatile*/
unsigned char *pcmd;
/*volatile*/
unsigned short *pdata;
int card,chip,channel,intvec;
volatile unsigned char *pcmd;
volatile unsigned short *pdata;
unsigned short data;
int dummy;
@@ -248,6 +271,12 @@ static long init(after)
}
}
}
/*Initialize I/O scanning for each interrupt vector */
/*Note that interrupt vectors are not initialized until the */
/*first record is attached via get_ioint_info. */
if(mz8310_info[card].present) for(intvec=0; intvec<NUMINTVEC; intvec++) {
scanIoInit(&mz8310_info[card].int_info[intvec].ioscanpvt);
}
}
return(0);
}
@@ -256,8 +285,7 @@ static long report(fp,interest)
FILE *fp;
int interest;
{
int card,chip,channel,type;
char *pstr;
int card,chip,channel,intvec;
for(card=0; card<MAXCARDS; card++) {
if(!mz8310_info[card].present) continue;
@@ -265,17 +293,23 @@ static long report(fp,interest)
if(interest==0)continue;
for(chip=0; chip<NCHIP; chip++) {
for(channel=0; channel<CHANONCHIP; channel++) {
short used;
short nrec_using;
used = mz8310_info[card].chan_info[chip][channel].used;
if(used==0) continue;
type = mz8310_info[card].chan_info[chip][channel].type;
pstr = GET_PRECTYPE(type);
if(!pstr) fprintf(fp," Illegal record type\n");
else fprintf(fp," chip: %d channel: %d used: %d recType: %s\n",
chip,channel,used,pstr);
nrec_using = mz8310_info[card].chan_info[chip][channel].nrec_using;
if(nrec_using==0) continue;
fprintf(fp," chip: %d channel: %d nrec_using: %d\n",
chip,channel,nrec_using);
}
}
for(intvec=0; intvec<NUMINTVEC; intvec++) {
short nrec_using,connected;
nrec_using = mz8310_info[card].int_info[intvec].nrec_using;
connected = mz8310_info[card].int_info[intvec].connected;
if(nrec_using==0 && !connected) continue;
fprintf(fp," intvec: %d connected: %d nrec_using: %d eventRecord\n",
intvec,connected,nrec_using);
}
}
}
@@ -316,16 +350,13 @@ static long init_common(pdbCommon,pout,nchan)
}
chip = (signal>=CHANONCHIP ? 1 : 0);
channel = signal - chip*CHANONCHIP;
if((mz8310_info[card].chan_info[chip][channel].used +=1)>1)
if((mz8310_info[card].chan_info[chip][channel].nrec_using +=1)>1)
recGblRecordError(S_dev_Conflict,pdbCommon,
"devMz8310 (init_record) signal already used");
mz8310_info[card].chan_info[chip][channel].type = pdbCommon->pdba->record_type;
if(nchan==2) {
if((mz8310_info[card].chan_info[chip][channel+1].used +=1)>1)
if((mz8310_info[card].chan_info[chip][channel+1].nrec_using +=1)>1)
recGblRecordError(S_dev_Conflict,pdbCommon,
"devMz8310 (init_record) signal already used");
mz8310_info[card].chan_info[chip][channel+1].type
= pdbCommon->pdba->record_type;
}
return(0);
}
@@ -362,6 +393,64 @@ static long init_pt(pr)
return(0);
}
static void mz8310_int_service(IOSCANPVT ioscanpvt)
{
scanIoRequest(ioscanpvt);
}
static long get_ioint_info(
short *cmd,
struct eventRecord *pr,
IOSCANPVT *ppvt)
{
struct vmeio *pvmeio = (struct vmeio *)(&pr->inp.value);
unsigned int card,intvec;
*ppvt = NULL; /*initialize pvt to null*/
card = pvmeio->card;
intvec = pvmeio->signal;
if(card>=MAXCARDS){
recGblRecordError(S_dev_badCard,pr,
"devMz8310 (get_ioint_info) exceeded maximum supported cards");
return(0);
}
if(intvec>=NUMINTVEC) {
recGblRecordError(S_dev_badSignal,pr,
"devMz8310 (get_ioint_info) Illegal SIGNAL field");
return(0);
}
if(!mz8310_info[card].present){
recGblRecordError(S_dev_badCard,pr,
"devMz8310 (get_ioint_info) card not found");
return(0);
}
*ppvt = mz8310_info[card].int_info[intvec].ioscanpvt;
if(*cmd!=0) {
if(*cmd==1) mz8310_info[card].int_info[intvec].nrec_using -= 1;
return(0);
}
mz8310_info[card].int_info[intvec].nrec_using +=1;
if(!mz8310_info[card].int_info[intvec].connected) {
unsigned char vector;
unsigned char *pvecreg;
vector=MZ8310INTVEC(card,intvec);
if(intConnect(INUM_TO_IVEC(vector),(FUNCPTR)mz8310_int_service,
(int)mz8310_info[card].int_info[intvec].ioscanpvt)!=OK) {
recGblRecordError(0,pr,"devMz8310 (get_ioint_info) intConnect failed");
return(0);
}
pvecreg = PVECREG(card,intvec);
if(vxMemProbe(pvecreg,WRITE,sizeof(char),&vector)!=OK) {
recGblRecordError(0,pr,"devMz8310 (get_ioint_info) vxMemProbe failed");
return(0);
}
sysIntEnable(mz8310_strap_info[intvec].irq_lev);
mz8310_info[card].int_info[intvec].connected = TRUE;
}
return(0);
}
static long cmd_pc(pr)
struct pulseCounterRecord *pr;
{
+2 -3
View File
@@ -39,11 +39,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <pulseTrainRecord.h>
@@ -78,7 +77,7 @@ static long write_pt(ppt)
case (CONSTANT) :
break;
case (DB_LINK) :
status = dbPutLink(&ppt->out.value.db_link,ppt,DBR_SHORT,&ppt->val,1L);
status = dbPutLink(&ppt->out.value.db_link,(struct dbCommon *)ppt,DBR_SHORT,&ppt->val,1L);
if(status!=0) {
recGblSetSevr(ppt,LINK_ALARM,VALID_ALARM);
} else ppt->udf=FALSE;
+2 -3
View File
@@ -38,11 +38,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <stringinRecord.h>
@@ -109,7 +108,7 @@ static long read_stringin(pstringin)
case (DB_LINK) :
options=0;
nRequest=1;
status = dbGetLink(&(pstringin->inp.value.db_link),pstringin,DBR_STRING,
status = dbGetLink(&(pstringin->inp.value.db_link),(struct dbCommon *)pstringin,DBR_STRING,
pstringin->val,&options,&nRequest);
if(status!=0) {
recGblSetSevr(pstringin,LINK_ALARM,VALID_ALARM);
+7 -4
View File
@@ -30,6 +30,8 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
* .02 01-08-92 jba Added cast in call to wdStart to avoid compile warning msg
* .03 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -40,6 +42,7 @@
#include <wdLib.h>
#include <alarm.h>
#include <callback.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
@@ -83,9 +86,9 @@ static void myCallback(pcallback)
struct stringinRecord *pstringin=(struct stringinRecord *)(pcallback->prec);
struct rset *prset=(struct rset *)(pstringin->rset);
dbScanLock(pstringin);
(*prset->process)(pstringin->pdba);
dbScanUnlock(pstringin);
dbScanLock((struct dbCommon *)pstringin);
(*prset->process)(pstringin);
dbScanUnlock((struct dbCommon *)pstringin);
}
@@ -137,7 +140,7 @@ static long read_stringin(pstringin)
wait_time = (int)(pstringin->disv * vxTicksPerSecond);
if(wait_time<=0) return(0);
printf("%s Starting asynchronous processing\n",pstringin->name);
wdStart(pcallback->wd_id,wait_time,callbackRequest,pcallback);
wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback);
return(1);
}
default :
+2 -3
View File
@@ -37,11 +37,10 @@
#include <stdioLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <module_types.h>
#include <stringoutRecord.h>
@@ -75,7 +74,7 @@ static long write_stringout(pstringout)
case (CONSTANT) :
break;
case (DB_LINK) :
status = dbPutLink(&pstringout->out.value.db_link,pstringout,DBR_STRING,
status = dbPutLink(&pstringout->out.value.db_link,(struct dbCommon *)pstringout,DBR_STRING,
pstringout->val,1L);
if(status!=0) {
recGblSetSevr(pstringout,LINK_ALARM,VALID_ALARM);
+7 -4
View File
@@ -30,6 +30,8 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
* .02 01-08-92 jba Added cast in call to wdStart to avoid compile warning msg
* .03 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -40,6 +42,7 @@
#include <wdLib.h>
#include <alarm.h>
#include <callback.h>
#include <cvtTable.h>
#include <dbDefs.h>
#include <dbAccess.h>
@@ -83,9 +86,9 @@ static void myCallback(pcallback)
struct stringoutRecord *pstringout=(struct stringoutRecord *)(pcallback->prec);
struct rset *prset=(struct rset *)(pstringout->rset);
dbScanLock(pstringout);
(*prset->process)(pstringout->pdba);
dbScanUnlock(pstringout);
dbScanLock((struct dbCommon *)pstringout);
(*prset->process)(pstringout);
dbScanUnlock((struct dbCommon *)pstringout);
}
@@ -133,7 +136,7 @@ static long write_stringout(pstringout)
wait_time = (int)(pstringout->disv * vxTicksPerSecond);
if(wait_time<=0) return(0);
printf("%s Starting asynchronous processing\n",pstringout->name);
wdStart(pcallback->wd_id,wait_time,callbackRequest,pcallback);
wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback);
return(1);
}
default :
+5 -4
View File
@@ -33,6 +33,7 @@
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
* .02 12-02-91 jba Added cmd control to io-interrupt processing
* .03 12-12-91 jba Set cmd to zero in io-interrupt processing
* .04 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -88,7 +89,7 @@ static void myCallback(pcallback,no_read,pdata)
long i;
if(!pwf->busy) return;
dbScanLock(pwf);
dbScanLock((struct dbCommon *)pwf);
pwf->busy = FALSE;
if(no_read>pwf->nelm)no_read = pwf->nelm;
if(ftvl==DBF_CHAR || ftvl==DBF_UCHAR) {
@@ -110,8 +111,8 @@ static void myCallback(pcallback,no_read,pdata)
"read_wf - illegal ftvl");
recGblSetSevr(pwf,READ_ALARM,VALID_ALARM);
}
(pcallback->process)(&pcallback->dbAddr);
dbScanUnlock(pwf);
(pcallback->process)(pwf);
dbScanUnlock((struct dbCommon *)pwf);
}
static long get_ioint_info(cmd,pwf,io_type,card_type,card_number)
@@ -121,7 +122,7 @@ static long get_ioint_info(cmd,pwf,io_type,card_type,card_number)
short *card_type;
short *card_number;
{
*cmd=0;
*cmd=-1;
if(pwf->inp.type != VME_IO) return(S_dev_badInpType);
*io_type = IO_WF;
*card_type = JGVTR1;
+1 -1
View File
@@ -104,7 +104,7 @@ static long read_wf(pwf)
case (DB_LINK) :
options=0;
nRequest=pwf->nelm;
if(dbGetLink(&(pwf->inp.value.db_link),pwf,pwf->ftvl,
if(dbGetLink(&(pwf->inp.value.db_link),(struct dbCommon *)pwf,pwf->ftvl,
pwf->bptr,&options,&nRequest)!=0){
recGblSetSevr(pwf,LINK_ALARM,VALID_ALARM);
}
+7 -4
View File
@@ -31,6 +31,8 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
* .02 01-08-92 jba Added cast in call to wdStart to avoid compile warning msg
* .03 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -41,6 +43,7 @@
#include <wdLib.h>
#include <alarm.h>
#include <callback.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
@@ -83,9 +86,9 @@ static void myCallback(pcallback)
struct waveformRecord *pwf=(struct waveformRecord *)(pcallback->prec);
struct rset *prset=(struct rset *)(pwf->rset);
dbScanLock(pwf);
(*prset->process)(pwf->pdba);
dbScanUnlock(pwf);
dbScanLock((struct dbCommon *)pwf);
(*prset->process)(pwf);
dbScanUnlock((struct dbCommon *)pwf);
}
static long init_record(pwf)
struct waveformRecord *pwf;
@@ -131,7 +134,7 @@ static long read_wf(pwf)
wait_time = (int)(pwf->disv * vxTicksPerSecond);
if(wait_time<=0) return(0);
printf("%s Starting asynchronous processing\n",pwf->name);
wdStart(pcallback->wd_id,wait_time,callbackRequest,pcallback);
wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback);
return(1);
}
default :
+4 -3
View File
@@ -31,6 +31,7 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set of alarm stat and sevr to macros
* .02 02-05-92 jba Changed function arguments from paddr to precord
* ...
*/
@@ -84,7 +85,7 @@ static void myCallback(pcallback,no_read,pdata)
short ftvl = pwf->ftvl;
if(!pwf->busy) return;
dbScanLock(pwf);
dbScanLock((struct dbCommon *)pwf);
pwf->busy = FALSE;
if(ftvl==DBF_SHORT || ftvl==DBF_USHORT) {
bcopy(pdata,pwf->bptr,no_read*2);
@@ -94,8 +95,8 @@ static void myCallback(pcallback,no_read,pdata)
"read_wf - illegal ftvl");
recGblSetSevr(pwf,READ_ALARM,VALID_ALARM);
}
(pcallback->process)(&pcallback->dbAddr);
dbScanUnlock(pwf);
(pcallback->process)(pwf);
dbScanUnlock((struct dbCommon *)pwf);
}
static long init_record(pwf,process)
+8 -9
View File
@@ -57,6 +57,8 @@
* .17 09-18-91 jba fixed bug in break point table conversion
* .18 09-30-91 jba Moved break point table conversion to libCom
* .19 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .20 12-18-91 jba Changed E_IO_INTERRUPT to SCAN_IO_EVENT
* .21 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -65,12 +67,12 @@
#include <lstLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbScan.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <special.h>
#include <aiRecord.h>
@@ -127,8 +129,6 @@ struct aidset { /* analog input dset */
};
/*NOTE FOLLOWING IS TAKEN FROM dbScan.c */
#define E_IO_INTERRUPT 7
/*Following from timing system */
extern unsigned int gts_trigger_counter;
@@ -160,10 +160,9 @@ static long init_record(pai)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(pai)
struct aiRecord *pai;
{
struct aiRecord *pai=(struct aiRecord *)(paddr->precord);
struct aidset *pdset = (struct aidset *)(pai->dset);
long status;
@@ -174,7 +173,7 @@ static long process(paddr)
}
/* event throttling */
if (pai->scan == E_IO_INTERRUPT){
if (pai->scan == SCAN_IO_EVENT){
if ((pai->evnt != 0) && (gts_trigger_counter != 0)){
if ((gts_trigger_counter % pai->evnt) != 0){
return(0);
@@ -196,7 +195,7 @@ static long process(paddr)
/* check event list */
monitor(pai);
/* process the forward scan link record */
if (pai->flnk.type==DB_LINK) dbScanPassive(pai->flnk.value.db_link.pdbAddr);
if (pai->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)pai->flnk.value.db_link.pdbAddr)->precord);
pai->init=FALSE;
pai->pact=FALSE;
+6 -7
View File
@@ -52,6 +52,7 @@
* .19 10-10-90 mrk extensible record and device support
* .20 09-25-91 jba added breakpoint table conversion
* .21 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .22 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -60,12 +61,11 @@
#include <lstLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <special.h>
#include <recSup.h>
#include <aoRecord.h>
@@ -185,10 +185,9 @@ static long init_record(pao)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(pao)
struct aoRecord *pao;
{
struct aoRecord *pao=(struct aoRecord *)(paddr->precord);
struct aodset *pdset = (struct aodset *)(pao->dset);
long status=0;
@@ -215,7 +214,7 @@ static long process(paddr)
monitor(pao);
/* process the forward scan link record */
if (pao->flnk.type==DB_LINK) dbScanPassive(pao->flnk.value.db_link.pdbAddr);
if (pao->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)pao->flnk.value.db_link.pdbAddr)->precord);
pao->init=FALSE;
pao->pact=FALSE;
@@ -369,7 +368,7 @@ static int convert(pao)
pao->pact = TRUE;
/* don't allow dbputs to val field */
pao->val=pao->pval;
status = dbGetLink(&pao->dol.value.db_link,pao,DBR_DOUBLE,
status = dbGetLink(&pao->dol.value.db_link,(struct dbCommon *)pao,DBR_DOUBLE,
&value,&options,&nRequest);
pao->pact = save_pact;
if(status) {
+5 -6
View File
@@ -46,6 +46,7 @@
* .12 10-10-90 mrk Made changes for new record and device support
* .13 10-24-91 jba Moved comment
* .14 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .15 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -55,12 +56,11 @@
#include <strLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <special.h>
#include <biRecord.h>
@@ -135,10 +135,9 @@ static long init_record(pbi)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(pbi)
struct biRecord *pbi;
{
struct biRecord *pbi=(struct biRecord *)(paddr->precord);
struct bidset *pdset = (struct bidset *)(pbi->dset);
long status;
@@ -164,7 +163,7 @@ static long process(paddr)
/* check event list */
monitor(pbi);
/* process the forward scan link record */
if (pbi->flnk.type==DB_LINK) dbScanPassive(pbi->flnk.value.db_link.pdbAddr);
if (pbi->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)pbi->flnk.value.db_link.pdbAddr)->precord);
pbi->pact=FALSE;
return(status);
+12 -11
View File
@@ -52,6 +52,8 @@
* .16 05-02-90 lrd fix initial value set in the DOL field
* .17 10-10-90 mrk Changes for record and device support
* .18 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .19 01-08-92 jba Added cast in call to wdStart to remove compile warning message
* .20 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -62,12 +64,12 @@
#include <wdLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <callback.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <special.h>
#include <boRecord.h>
@@ -141,10 +143,10 @@ static void myCallback(pcallback)
short value=0;
struct boRecord *pbo = (struct boRecord *)(pcallback->dbAddr.precord);
dbScanLock(pbo);
dbScanLock((struct dbCommon *)pbo);
pbo->val = 0;
(void)process(&(pcallback->dbAddr));
dbScanUnlock(pbo);
(void)process(pbo);
dbScanUnlock((struct dbCommon *)pbo);
}
static long init_record(pbo)
@@ -188,10 +190,9 @@ static long init_record(pbo)
return(status);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(pbo)
struct boRecord *pbo;
{
struct boRecord *pbo=(struct boRecord *)(paddr->precord);
struct bodset *pdset = (struct bodset *)(pbo->dset);
long status=0;
int wait_time;
@@ -208,7 +209,7 @@ static long process(paddr)
unsigned short val;
pbo->pact = TRUE;
status = dbGetLink(&pbo->dol.value.db_link,pbo,
status = dbGetLink(&pbo->dol.value.db_link,(struct dbCommon *)pbo,
DBR_USHORT,&val,&options,&nRequest);
pbo->pact = FALSE;
if(status==0){
@@ -236,14 +237,14 @@ static long process(paddr)
pcallback = (struct callback *)(pbo->dpvt);
if(pcallback->wd_id==NULL) pcallback->wd_id = wdCreate();
wdStart(pcallback->wd_id,wait_time,callbackRequest,pcallback);
wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback);
}
/* check for alarms */
alarm(pbo);
/* check event list */
monitor(pbo);
/* process the forward scan link record */
if (pbo->flnk.type==DB_LINK) dbScanPassive(pbo->flnk.value.db_link.pdbAddr);
if (pbo->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)pbo->flnk.value.db_link.pdbAddr)->precord);
pbo->pact=FALSE;
return(status);
+6 -7
View File
@@ -59,6 +59,7 @@
* Note that all calc specific details moved
* to libCalc
* .19 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .20 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -67,11 +68,10 @@
#include <lstLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <special.h>
#include <calcRecord.h>
@@ -143,10 +143,9 @@ static long init_record(pcalc)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(pcalc)
struct calcRecord *pcalc;
{
struct calcRecord *pcalc=(struct calcRecord *)(paddr->precord);
pcalc->pact = TRUE;
if(fetch_values(pcalc)==0) {
@@ -160,7 +159,7 @@ static long process(paddr)
/* check event list */
monitor(pcalc);
/* process the forward scan link record */
if (pcalc->flnk.type==DB_LINK) dbScanPassive(pcalc->flnk.value.db_link.pdbAddr);
if (pcalc->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)pcalc->flnk.value.db_link.pdbAddr)->precord);
pcalc->pact = FALSE;
return(0);
}
@@ -364,7 +363,7 @@ struct calcRecord *pcalc;
if(plink->type!=DB_LINK) continue;
options=0;
nRequest=1;
status = dbGetLink(&plink->value.db_link,pcalc,DBR_DOUBLE,
status = dbGetLink(&plink->value.db_link,(struct dbCommon *)pcalc,DBR_DOUBLE,
pvalue,&options,&nRequest);
if(status!=0) {
recGblSetSevr(pcalc,LINK_ALARM,VALID_ALARM);
+9 -9
View File
@@ -49,6 +49,7 @@
* value was not initialized
* .10 10-11-90 mrk Made changes for new record support
* .11 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .12 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -58,11 +59,10 @@
#include <math.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <link.h>
#include <special.h>
#include <recSup.h>
#include <compressRecord.h>
@@ -139,11 +139,10 @@ static long init_record(pcompress)
}
static long process(paddr)
struct dbAddr *paddr;
static long process(pcompress)
struct compressRecord *pcompress;
{
struct compressRecord *pcompress=(struct compressRecord *)(paddr->precord);
long status=0;
long status=0;
pcompress->pact = TRUE;
@@ -159,8 +158,8 @@ static long process(paddr)
long no_elements=pdbAddr->no_elements;
int alg=pcompress->alg;
if(dbGetLink(&pcompress->inp.value.db_link,pcompress,DBR_DOUBLE,pcompress->wptr,
&options,&no_elements)!=0){
if(dbGetLink(&pcompress->inp.value.db_link,(struct dbCommon *)pcompress,
DBR_DOUBLE,pcompress->wptr,&options,&no_elements)!=0){
recGblSetSevr(pcompress,LINK_ALARM,VALID_ALARM);
}
@@ -182,7 +181,8 @@ static long process(paddr)
tsLocalTime(&pcompress->time);
monitor(pcompress);
/* process the forward scan link record */
if (pcompress->flnk.type==DB_LINK) dbScanPassive(pcompress->flnk.value.db_link.pdbAddr);
if (pcompress->flnk.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pcompress->flnk.value.db_link.pdbAddr)->precord);
}
pcompress->pact=FALSE;
+16 -32
View File
@@ -38,12 +38,12 @@
#include <lstLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbScan.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <module_types.h>
#include <eventRecord.h>
@@ -101,43 +101,27 @@ static long init_record(pevent)
struct eventRecord *pevent;
{
struct eventdset *pdset;
long status;
long status=0;
if(!(pdset = (struct eventdset *)(pevent->dset))) {
recGblRecordError(S_dev_noDSET,pevent,"event: init_record");
return(S_dev_noDSET);
}
/* must have read_event function defined */
if( (pdset->number < 5) || (pdset->read_event == NULL) ) {
recGblRecordError(S_dev_missingSup,pevent,"event: init_record");
return(S_dev_missingSup);
}
if( pdset->init_record ) {
if((status=(*pdset->init_record)(pevent,process))) return(status);
}
return(0);
if( (pdset=(struct eventdset *)(pevent->dset)) && (pdset->init_record) )
status=(*pdset->init_record)(pevent,process);
return(status);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(pevent)
struct eventRecord *pevent;
{
struct eventRecord *pevent=(struct eventRecord *)(paddr->precord);
struct eventdset *pdset = (struct eventdset *)(pevent->dset);
long status;
long status=0;
if( (pdset==NULL) || (pdset->read_event==NULL) ) {
pevent->pact=TRUE;
recGblRecordError(S_dev_missingSup,pevent,"read_event");
return(S_dev_missingSup);
}
status=(*pdset->read_event)(pevent); /* read the new value */
if((pdset!=NULL) && (pdset->number >= 5) && pdset->read_event )
status=(*pdset->read_event)(pevent); /* read the new value */
pevent->pact = TRUE;
/* status is one if an asynchronous record is being processed*/
if (status==1) return(0);
if(pevent->enum>0) post_event(enum);
if(pevent->val>0) post_event((int)pevent->val);
tsLocalTime(&pevent->time);
@@ -145,7 +129,7 @@ static long process(paddr)
monitor(pevent);
/* process the forward scan link record */
if (pevent->flnk.type==DB_LINK) dbScanPassive(pevent->flnk.value.db_link.pdbAddr);
if (pevent->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)pevent->flnk.value.db_link.pdbAddr)->precord);
pevent->pact=FALSE;
return(status);
@@ -156,9 +140,9 @@ static long get_value(pevent,pvdes)
struct eventRecord *pevent;
struct valueDes *pvdes;
{
pvdes->field_type = DBF_SHORT;
pvdes->field_type = DBF_USHORT;
pvdes->no_elements=1;
pvdes->pvalue = (caddr_t)(&pevent->val;
pvdes->pvalue = (caddr_t)(&pevent->val);
return(0);
}
@@ -184,6 +168,6 @@ static void monitor(pevent)
db_post_events(pevent,&pevent->sevr,DBE_VALUE);
}
db_post_events(pevent,&(pevent->enum,monitor_mask|DBE_VALUE);
db_post_events(pevent,&pevent->val,monitor_mask|DBE_VALUE);
return;
}
+26 -16
View File
@@ -1,5 +1,4 @@
/* recFanout.c */
/* share/src/rec $Id$ */
/* recFanout.c */ /* share/src/rec $Id$ */
/* recFanout.c - Record Support Routines for Fanout records */
/*
@@ -40,6 +39,8 @@
* .08 09-25-91 jba added input link for seln
* .09 09-26-91 jba added select_mask option
* .10 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .11 02-05-92 jba Changed function arguments from paddr to precord
* .12 02-05-92 jba Added FWD scan link
*/
#include <vxWorks.h>
@@ -48,11 +49,10 @@
#include <lstLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <fanoutRecord.h>
@@ -111,10 +111,9 @@ static long init_record(pfanout)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(pfanout)
struct fanoutRecord *pfanout;
{
struct fanoutRecord *pfanout=(struct fanoutRecord *)(paddr->precord);
short stat,sevr,nsta,nsev;
@@ -129,7 +128,7 @@ static long process(paddr)
/* fetch link selection */
if(pfanout->sell.type == DB_LINK){
status=dbGetLink(&(pfanout->sell.value.db_link),pfanout,DBR_USHORT,
status=dbGetLink(&(pfanout->sell.value.db_link),(struct dbCommon *)pfanout,DBR_USHORT,
&(pfanout->seln),&options,&nRequest);
if(status!=0) {
recGblSetSevr(pfanout,LINK_ALARM,VALID_ALARM);
@@ -137,12 +136,18 @@ static long process(paddr)
}
switch (pfanout->selm){
case (SELECT_ALL):
if (pfanout->lnk1.type==DB_LINK) dbScanPassive(pfanout->lnk1.value.db_link.pdbAddr);
if (pfanout->lnk2.type==DB_LINK) dbScanPassive(pfanout->lnk2.value.db_link.pdbAddr);
if (pfanout->lnk3.type==DB_LINK) dbScanPassive(pfanout->lnk3.value.db_link.pdbAddr);
if (pfanout->lnk4.type==DB_LINK) dbScanPassive(pfanout->lnk4.value.db_link.pdbAddr);
if (pfanout->lnk5.type==DB_LINK) dbScanPassive(pfanout->lnk5.value.db_link.pdbAddr);
if (pfanout->lnk6.type==DB_LINK) dbScanPassive(pfanout->lnk6.value.db_link.pdbAddr);
if (pfanout->lnk1.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pfanout->lnk1.value.db_link.pdbAddr)->precord);
if (pfanout->lnk2.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pfanout->lnk2.value.db_link.pdbAddr)->precord);
if (pfanout->lnk3.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pfanout->lnk3.value.db_link.pdbAddr)->precord);
if (pfanout->lnk4.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pfanout->lnk4.value.db_link.pdbAddr)->precord);
if (pfanout->lnk5.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pfanout->lnk5.value.db_link.pdbAddr)->precord);
if (pfanout->lnk6.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pfanout->lnk6.value.db_link.pdbAddr)->precord);
break;
case (SELECTED):
if(pfanout->seln<0 || pfanout->seln>6) {
@@ -154,7 +159,7 @@ static long process(paddr)
}
plink=&(pfanout->lnk1);
plink += (pfanout->seln-1);
dbScanPassive(plink->value.db_link.pdbAddr);
dbScanPassive(((struct dbAddr *)plink->value.db_link.pdbAddr)->precord);
break;
case (SELECT_MASK):
if(pfanout->seln==0) {
@@ -167,7 +172,8 @@ static long process(paddr)
plink=&(pfanout->lnk1);
state=pfanout->seln;
for ( i=0; i<6; i++, state>>=1, plink++) {
if(state & 1 && plink->type==DB_LINK) dbScanPassive(plink->value.db_link.pdbAddr);
if(state & 1 && plink->type==DB_LINK)
dbScanPassive(((struct dbAddr *)plink->value.db_link.pdbAddr)->precord);
}
break;
default:
@@ -182,6 +188,10 @@ static long process(paddr)
db_post_events(pfanout,&pfanout->stat,DBE_VALUE);
db_post_events(pfanout,&pfanout->sevr,DBE_VALUE);
}
/* process the forward scan link record */
if (pfanout->flnk.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pfanout->flnk.value.db_link.pdbAddr)->precord);
pfanout->pact=FALSE;
return(0);
}
+11 -11
View File
@@ -30,6 +30,7 @@
* Modification Log:
* -----------------
* .01 10-14-91 jba Added dev sup crtl fld and wd timer
* .02 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -42,12 +43,12 @@
#include <wdLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <callback.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <special.h>
#include <recSup.h>
#include <histogramRecord.h>
@@ -56,7 +57,7 @@
#define report NULL
#define initialize NULL
long init_record();
long process();
static long process();
long special();
long get_value();
long cvt_dbaddr();
@@ -127,17 +128,17 @@ static void wdCallback(pcallback)
/* force post events for any count change */
if(phistogram->mcnt>0){
dbScanLock(phistogram);
dbScanLock((struct dbCommon *)phistogram);
tsLocalTime(&phistogram->time);
db_post_events(phistogram,&phistogram->bptr,DBE_VALUE);
phistogram->mcnt=0;
dbScanUnlock(phistogram);
dbScanUnlock((struct dbCommon *)phistogram);
}
if(phistogram->sdel>0) {
/* start new watchdog timer on monitor */
wait_time = (float)(phistogram->sdel * vxTicksPerSecond);
wdStart(pcallback->wd_id,wait_time,callbackRequest,pcallback);
wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback);
}
return;
@@ -169,7 +170,7 @@ static long init_record(phistogram)
/* start new watchdog timer on monitor */
wait_time = (float)(phistogram->sdel * vxTicksPerSecond);
wdStart(pcallback->wd_id,wait_time,callbackRequest,pcallback);
wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback);
}
/* allocate space for histogram array */
@@ -198,10 +199,9 @@ static long init_record(phistogram)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(phistogram)
struct histogramRecord *phistogram;
{
struct histogramRecord *phistogram=(struct histogramRecord *)(paddr->precord);
struct histogramdset *pdset = (struct histogramdset *)(phistogram->dset);
long status;
@@ -227,7 +227,7 @@ static long process(paddr)
monitor(phistogram);
/* process the forward scan link record */
if (phistogram->flnk.type==DB_LINK) dbScanPassive(phistogram->flnk.value.db_link.pdbAddr);
if (phistogram->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)phistogram->flnk.value.db_link.pdbAddr)->precord);
phistogram->pact=FALSE;
return(status);
+5 -6
View File
@@ -30,6 +30,7 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .02 02-05-92 jba Changed function arguments from paddr to precord
*/
@@ -39,12 +40,11 @@
#include <lstLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <longinRecord.h>
@@ -120,10 +120,9 @@ static long init_record(plongin)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(plongin)
struct longinRecord *plongin;
{
struct longinRecord *plongin=(struct longinRecord *)(paddr->precord);
struct longindset *pdset = (struct longindset *)(plongin->dset);
long status;
@@ -147,7 +146,7 @@ static long process(paddr)
monitor(plongin);
/* process the forward scan link record */
if (plongin->flnk.type==DB_LINK) dbScanPassive(plongin->flnk.value.db_link.pdbAddr);
if (plongin->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)plongin->flnk.value.db_link.pdbAddr)->precord);
plongin->pact=FALSE;
return(status);
+6 -7
View File
@@ -30,6 +30,7 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .02 02-05-92 jba Changed function arguments from paddr to precord
*/
@@ -39,12 +40,11 @@
#include <lstLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <longoutRecord.h>
@@ -126,10 +126,9 @@ static long init_record(plongout)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(plongout)
struct longoutRecord *plongout;
{
struct longoutRecord *plongout=(struct longoutRecord *)(paddr->precord);
struct longoutdset *pdset = (struct longoutdset *)(plongout->dset);
long status=0;
@@ -144,7 +143,7 @@ static long process(paddr)
long nRequest=1;
plongout->pact = TRUE;
status = dbGetLink(&plongout->dol.value.db_link,plongout,
status = dbGetLink(&plongout->dol.value.db_link,(struct dbCommon *)plongout,
DBR_LONG,&plongout->val,&options,&nRequest);
plongout->pact = FALSE;
if(status!=0){
@@ -169,7 +168,7 @@ static long process(paddr)
monitor(plongout);
/* process the forward scan link record */
if (plongout->flnk.type==DB_LINK) dbScanPassive(plongout->flnk.value.db_link.pdbAddr);
if (plongout->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)plongout->flnk.value.db_link.pdbAddr)->precord);
plongout->pact=FALSE;
return(status);
+5 -6
View File
@@ -47,6 +47,7 @@
* .12 02-08-90 lrd add Allen-Bradley PLC support
* .13 10-31-90 mrk changes for new record and device support
* .14 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .15 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -56,12 +57,11 @@
#include <strLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <special.h>
#include <mbbiRecord.h>
@@ -162,10 +162,9 @@ static long init_record(pmbbi)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(pmbbi)
struct mbbiRecord *pmbbi;
{
struct mbbiRecord *pmbbi=(struct mbbiRecord *)(paddr->precord);
struct mbbidset *pdset = (struct mbbidset *)(pmbbi->dset);
long status;
@@ -213,7 +212,7 @@ static long process(paddr)
monitor(pmbbi);
/* process the forward scan link record */
if (pmbbi->flnk.type==DB_LINK) dbScanPassive(pmbbi->flnk.value.db_link.pdbAddr);
if (pmbbi->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)pmbbi->flnk.value.db_link.pdbAddr)->precord);
pmbbi->pact=FALSE;
return(status);
+6 -7
View File
@@ -50,6 +50,7 @@
* .15 04-11-90 lrd make locals static
* .16 10-11-90 mrk make changes for new record and device support
* .17 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .18 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -59,12 +60,11 @@
#include <strLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <special.h>
#include <mbboRecord.h>
@@ -199,10 +199,9 @@ static long init_record(pmbbo)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(pmbbo)
struct mbboRecord *pmbbo;
{
struct mbboRecord *pmbbo=(struct mbboRecord *)(paddr->precord);
struct mbbodset *pdset = (struct mbbodset *)(pmbbo->dset);
long status=0;
unsigned short rbv;
@@ -221,7 +220,7 @@ static long process(paddr)
unsigned short val;
pmbbo->pact = TRUE;
status = dbGetLink(&pmbbo->dol.value.db_link,pmbbo,DBR_USHORT,
status = dbGetLink(&pmbbo->dol.value.db_link,(struct dbCommon *)pmbbo,DBR_USHORT,
&val,&options,&nRequest);
pmbbo->pact = FALSE;
if(status==0) {
@@ -261,7 +260,7 @@ DONT_WRITE:
monitor(pmbbo);
/* process the forward scan link record */
if(pmbbo->flnk.type==DB_LINK)
dbScanPassive(pmbbo->flnk.value.db_link.pdbAddr);
dbScanPassive(((struct dbAddr *)pmbbo->flnk.value.db_link.pdbAddr)->precord);
pmbbo->pact=FALSE;
return(status);
}
+5 -6
View File
@@ -32,6 +32,7 @@
* -----------------
* .01 10-10-90 mrk extensible record and device support
* .02 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .03 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -39,11 +40,10 @@
#include <stdioLib.h>
#include <lstLib.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <permissiveRecord.h>
@@ -88,17 +88,16 @@ struct rset permissiveRSET={
void monitor();
static long process(paddr)
struct dbAddr *paddr;
static long process(ppermissive)
struct permissiveRecord *ppermissive;
{
struct permissiveRecord *ppermissive=(struct permissiveRecord *)(paddr->precord);
ppermissive->pact=TRUE;
ppermissive->udf=FALSE;
tsLocalTime(&ppermissive->time);
monitor(ppermissive);
if (ppermissive->flnk.type==DB_LINK)
dbScanPassive(ppermissive->flnk.value.db_link.pdbAddr);
dbScanPassive(((struct dbAddr *)ppermissive->flnk.value.db_link.pdbAddr)->precord);
ppermissive->pact=FALSE;
return(0);
}
+7 -8
View File
@@ -32,6 +32,7 @@
* -----------------
* .01 10-15-90 mrk changes for new record support
* .02 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .03 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -42,11 +43,10 @@
unsigned long tickGet();
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <pidRecord.h>
@@ -106,10 +106,9 @@ static long init_record(ppid)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(ppid)
struct pidRecord *ppid;
{
struct pidRecord *ppid=(struct pidRecord *)(paddr->precord);
long status;
ppid->pact = TRUE;
@@ -128,7 +127,7 @@ static long process(paddr)
monitor(ppid);
/* process the forward scan link record */
if (ppid->flnk.type==DB_LINK) dbScanPassive(ppid->flnk.value.db_link.pdbAddr);
if (ppid->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)ppid->flnk.value.db_link.pdbAddr)->precord);
ppid->pact=FALSE;
return(status);
@@ -342,7 +341,7 @@ struct pidRecord *ppid;
}
options=0;
nRequest=1;
if(dbGetLink(&(ppid->cvl.value.db_link),ppid,DBR_FLOAT,
if(dbGetLink(&(ppid->cvl.value.db_link),(struct dbCommon *)ppid,DBR_FLOAT,
&cval,&options,&nRequest)!=NULL) {
recGblSetSevr(ppid,LINK_ALARM,VALID_ALARM);
return(0);
@@ -351,7 +350,7 @@ struct pidRecord *ppid;
if(ppid->stpl.type == DB_LINK && ppid->smsl == CLOSED_LOOP){
options=0;
nRequest=1;
if(dbGetLink(&(ppid->stpl.value.db_link),ppid,DBR_FLOAT,
if(dbGetLink(&(ppid->stpl.value.db_link),(struct dbCommon *)ppid,DBR_FLOAT,
&(ppid->val),&options,&nRequest)!=NULL) {
recGblSetSevr(ppid,LINK_ALARM,VALID_ALARM);
return(0);
+6 -7
View File
@@ -30,6 +30,7 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .02 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -38,13 +39,12 @@
#include <lstLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbRecDes.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <pulseCounterRecord.h>
@@ -137,10 +137,9 @@ static long init_record(ppc)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(ppc)
struct pulseCounterRecord *ppc;
{
struct pulseCounterRecord *ppc=(struct pulseCounterRecord *)(paddr->precord);
struct pcdset *pdset = (struct pcdset *)(ppc->dset);
long status=0;
long options,nRequest;
@@ -159,7 +158,7 @@ static long process(paddr)
options=0;
nRequest=1;
ppc->pact = TRUE;
status=dbGetLink(&ppc->sgl.value.db_link,ppc,DBR_SHORT,
status=dbGetLink(&ppc->sgl.value.db_link,(struct dbCommon *)ppc,DBR_SHORT,
&ppc->sgv,&options,&nRequest);
ppc->pact = FALSE;
if(status!=0) {
@@ -203,7 +202,7 @@ static long process(paddr)
monitor(ppc);
/* process the forward scan link record */
if (ppc->flnk.type==DB_LINK) dbScanPassive(ppc->flnk.value.db_link.pdbAddr);
if (ppc->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)ppc->flnk.value.db_link.pdbAddr)->precord);
ppc->pact=FALSE;
return(status);
+5 -6
View File
@@ -30,6 +30,7 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .02 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -38,13 +39,12 @@
#include <lstLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbRecDes.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <pulseDelayRecord.h>
@@ -122,10 +122,9 @@ static long init_record(ppd)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(ppd)
struct pulseDelayRecord *ppd;
{
struct pulseDelayRecord *ppd=(struct pulseDelayRecord *)(paddr->precord);
struct pddset *pdset = (struct pddset *)(ppd->dset);
long status=0;
long options,nRequest;
@@ -151,7 +150,7 @@ static long process(paddr)
monitor(ppd);
/* process the forward scan link record */
if (ppd->flnk.type==DB_LINK) dbScanPassive(ppd->flnk.value.db_link.pdbAddr);
if (ppd->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)ppd->flnk.value.db_link.pdbAddr)->precord);
ppd->pact=FALSE;
return(status);
+6 -7
View File
@@ -31,6 +31,7 @@
* -----------------
* .01 10-24-91 jba New device support changes
* .02 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .03 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -39,13 +40,12 @@
#include <lstLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbRecDes.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <pulseTrainRecord.h>
@@ -138,10 +138,9 @@ static long init_record(ppt)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(ppt)
struct pulseTrainRecord *ppt;
{
struct pulseTrainRecord *ppt=(struct pulseTrainRecord *)(paddr->precord);
struct ptdset *pdset = (struct ptdset *)(ppt->dset);
long status=0;
long options,nRequest;
@@ -161,7 +160,7 @@ static long process(paddr)
options=0;
nRequest=1;
ppt->pact = TRUE;
status=dbGetLink(&ppt->sgl.value.db_link,ppt,DBR_SHORT,
status=dbGetLink(&ppt->sgl.value.db_link,(struct dbCommon *)ppt,DBR_SHORT,
&ppt->sgv,&options,&nRequest);
ppt->pact = FALSE;
if(status!=0) {
@@ -201,7 +200,7 @@ static long process(paddr)
monitor(ppt);
/* process the forward scan link record */
if (ppt->flnk.type==DB_LINK) dbScanPassive(ppt->flnk.value.db_link.pdbAddr);
if (ppt->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)ppt->flnk.value.db_link.pdbAddr)->precord);
ppt->pact=FALSE;
return(status);
+10 -9
View File
@@ -34,6 +34,7 @@
* the previous value
* .02 10-12-90 mrk changes for new record support
* .03 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .04 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -42,11 +43,10 @@
#include <lstLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <selRecord.h>
@@ -118,10 +118,9 @@ static long init_record(psel)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(psel)
struct selRecord *psel;
{
struct selRecord *psel=(struct selRecord *)(paddr->precord);
psel->pact = TRUE;
if(fetch_values(psel)==0) {
@@ -140,7 +139,7 @@ static long process(paddr)
/* process the forward scan link record */
if (psel->flnk.type==DB_LINK)
dbScanPassive(psel->flnk.value.db_link.pdbAddr);
dbScanPassive(((struct dbAddr *)psel->flnk.value.db_link.pdbAddr)->precord);
psel->pact=FALSE;
return(0);
@@ -388,7 +387,7 @@ struct selRecord *psel;
if(psel->nvl.type == DB_LINK ){
options=0;
nRequest=1;
if(dbGetLink(&(psel->nvl.value.db_link),psel,DBR_USHORT,
if(dbGetLink(&(psel->nvl.value.db_link),(struct dbCommon *)psel,DBR_USHORT,
&(psel->seln),&options,&nRequest)!=NULL) {
recGblSetSevr(psel,LINK_ALARM,VALID_ALARM);
return(-1);
@@ -398,7 +397,8 @@ struct selRecord *psel;
pvalue += psel->seln;
if(plink->type==DB_LINK) {
nRequest=1;
status=dbGetLink(&plink->value.db_link,psel,DBR_DOUBLE,pvalue,&options,&nRequest);
status=dbGetLink(&plink->value.db_link,(struct dbCommon *)psel,DBR_DOUBLE,
pvalue,&options,&nRequest);
if(status!=0) {
recGblSetSevr(psel,LINK_ALARM,VALID_ALARM);
return(-1);
@@ -410,7 +410,8 @@ struct selRecord *psel;
for(i=0; i<SEL_MAX; i++, plink++, pvalue++) {
if(plink->type==DB_LINK) {
nRequest=1;
status = dbGetLink(&plink->value.db_link,psel,DBR_DOUBLE,pvalue,&options,&nRequest);
status = dbGetLink(&plink->value.db_link,(struct dbCommon *)psel,DBR_DOUBLE,
pvalue,&options,&nRequest);
if(status!=0) {
recGblSetSevr(psel,LINK_ALARM,VALID_ALARM);
return(-1);
+5 -6
View File
@@ -32,6 +32,7 @@
* -----------------
* .01 10-10-90 mrk extensible record and device support
* .02 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .03 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -39,12 +40,11 @@
#include <stdioLib.h>
#include <lstLib.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <stateRecord.h>
@@ -89,17 +89,16 @@ struct rset stateRSET={
void monitor();
static long process(paddr)
struct dbAddr *paddr;
static long process(pstate)
struct stateRecord *pstate;
{
struct stateRecord *pstate=(struct stateRecord *)(paddr->precord);
pstate->udf = FALSE;
pstate->pact=TRUE;
tsLocalTime(&pstate->time);
monitor(pstate);
/* process the forward scan link record */
if (pstate->flnk.type==DB_LINK) dbScanPassive(pstate->flnk.value.db_link.pdbAddr);
if (pstate->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)pstate->flnk.value.db_link.pdbAddr)->precord);
pstate->pact=FALSE;
return(0);
}
+13 -12
View File
@@ -72,12 +72,11 @@
#include <lstLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <special.h>
#include <steppermotorRecord.h>
@@ -158,10 +157,9 @@ static long init_record(psm)
}
static long process(paddr)
struct dbAddr *paddr;
static long process(psm)
struct steppermotorRecord *psm;
{
struct steppermotorRecord *psm=(struct steppermotorRecord *)(paddr->precord);
/* intialize the stepper motor record when the init bit is 0 */
/* the init is set when the readback returns */
@@ -185,7 +183,7 @@ static long process(paddr)
monitor(psm);
/* process the forward scan link record */
if (psm->flnk.type==DB_LINK) dbScanPassive(psm->flnk.value.db_link.pdbAddr);
if (psm->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)psm->flnk.value.db_link.pdbAddr)->precord);
psm->pact=FALSE;
return(0);
@@ -367,9 +365,9 @@ psm_data->accel
);
*/
if(not_init_record) {
dbScanLock(psm);
dbScanLock((struct dbCommon *)psm);
if(psm->pact) {
dbScanUnlock(psm);
dbScanUnlock((struct dbCommon *)psm);
return;
}
psm->pact = TRUE;
@@ -493,7 +491,7 @@ psm_data->accel
}
if(not_init_record) {
psm->pact = FALSE;
dbScanUnlock(psm);
dbScanUnlock((struct dbCommon *)psm);
}
return;
}
@@ -635,7 +633,8 @@ struct steppermotorRecord *psm;
long options=0;
long nRequest=1;
if(dbGetLink(&(psm->dol.value.db_link),psm,DBR_FLOAT,&(psm->val),&options,&nRequest)){
if(dbGetLink(&(psm->dol.value.db_link),(struct dbCommon *)psm,DBR_FLOAT,
&(psm->val),&options,&nRequest)){
recGblSetSevr(psm,LINK_ALARM,VALID_ALARM);
return;
} else psm->udf = FALSE;
@@ -737,7 +736,8 @@ struct steppermotorRecord *psm;
long options=0;
long nRequest=1;
if(dbGetLink(&(psm->dol.value.db_link),psm,DBR_FLOAT,&(psm->val),&options,&nRequest)) {
if(dbGetLink(&(psm->dol.value.db_link),(struct dbCommon *)psm,DBR_FLOAT,
&(psm->val),&options,&nRequest)) {
recGblSetSevr(psm,LINK_ALARM,VALID_ALARM);
return;
} else psm->udf=FALSE;
@@ -822,7 +822,8 @@ short moving;
reset = psm->init;
if (reset == 0) psm->init = 1;
if(dbGetLink(&(psm->rdbl.value.db_link),psm,DBR_FLOAT,&new_pos,&options,&nRequest)){
if(dbGetLink(&(psm->rdbl.value.db_link),(struct dbCommon *)psm,DBR_FLOAT,
&new_pos,&options,&nRequest)){
recGblSetSevr(psm,READ_ALARM,VALID_ALARM);
psm->init = reset;
return;
+6 -6
View File
@@ -30,6 +30,7 @@
* Modification Log:
* -----------------
* .01 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .02 02-05-92 jba Changed function arguments from paddr to precord
*/
@@ -40,12 +41,11 @@
#include <strLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <stringinRecord.h>
@@ -119,10 +119,9 @@ static long init_record(pstringin)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(pstringin)
struct stringinRecord *pstringin;
{
struct stringinRecord *pstringin=(struct stringinRecord *)(paddr->precord);
struct stringindset *pdset = (struct stringindset *)(pstringin->dset);
long status;
@@ -144,7 +143,8 @@ static long process(paddr)
monitor(pstringin);
/* process the forward scan link record */
if (pstringin->flnk.type==DB_LINK) dbScanPassive(pstringin->flnk.value.db_link.pdbAddr);
if (pstringin->flnk.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pstringin->flnk.value.db_link.pdbAddr)->precord);
pstringin->pact=FALSE;
return(status);
+8 -7
View File
@@ -31,6 +31,7 @@
* -----------------
* .01 10-24-91 jba Removed unused code
* .02 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .03 02-05-92 jba Changed function arguments from paddr to precord
*/
@@ -41,12 +42,11 @@
#include <strLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <stringoutRecord.h>
@@ -127,10 +127,9 @@ static long init_record(pstringout)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(pstringout)
struct stringoutRecord *pstringout;
{
struct stringoutRecord *pstringout=(struct stringoutRecord *)(paddr->precord);
struct stringoutdset *pdset = (struct stringoutdset *)(pstringout->dset);
long status=0;
@@ -145,7 +144,8 @@ static long process(paddr)
long nRequest=1;
pstringout->pact = TRUE;
status = dbGetLink(&pstringout->dol.value.db_link,pstringout,
status = dbGetLink(&pstringout->dol.value.db_link,
(struct dbCommon *)pstringout,
DBR_STRING,pstringout->val,&options,&nRequest);
pstringout->pact = FALSE;
if(!status==0){
@@ -168,7 +168,8 @@ static long process(paddr)
monitor(pstringout);
/* process the forward scan link record */
if (pstringout->flnk.type==DB_LINK) dbScanPassive(pstringout->flnk.value.db_link.pdbAddr);
if (pstringout->flnk.type==DB_LINK)
dbScanPassive(((struct dbAddr *)pstringout->flnk.value.db_link.pdbAddr)->precord);
pstringout->pact=FALSE;
return(status);
+10 -9
View File
@@ -32,6 +32,9 @@
* -----------------
* .01 10-10-90 mrk Made changes for new record support
* .02 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .03 01-08-92 jba Added casts in symFindByName to avoid compile warning messages
* .04 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -43,11 +46,10 @@
#include <a_out.h> /* for N_TEXT */
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <subRecord.h>
@@ -120,7 +122,7 @@ static long init_record(psub)
strcpy(temp,"_");
}
strcat(temp,psub->inam);
ret = symFindByName(sysSymTbl,temp,&psub->sadr,&sub_type);
ret = symFindByName(sysSymTbl,temp,&psub->sadr,(void *)&sub_type);
if ((ret !=OK) || ((sub_type & N_TEXT) == 0)){
recGblRecordError(S_db_BadSub,psub,"recSub(init_record)");
return(S_db_BadSub);
@@ -137,7 +139,7 @@ static long init_record(psub)
strcpy(temp,"_");
}
strcat(temp,psub->snam);
ret = symFindByName(sysSymTbl,temp,&psub->sadr,&sub_type);
ret = symFindByName(sysSymTbl,temp,&psub->sadr,(void *)&sub_type);
if ((ret < 0) || ((sub_type & N_TEXT) == 0)){
recGblRecordError(S_db_BadSub,psub,"recSub(init_record)");
return(S_db_BadSub);
@@ -146,10 +148,9 @@ static long init_record(psub)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(psub)
struct subRecord *psub;
{
struct subRecord *psub=(struct subRecord *)(paddr->precord);
long status=0;
if(!psub->pact){
@@ -166,7 +167,7 @@ static long process(paddr)
/* check event list */
monitor(psub);
/* process the forward scan link record */
if (psub->flnk.type==DB_LINK) dbScanPassive(psub->flnk.value.db_link.pdbAddr);
if (psub->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)psub->flnk.value.db_link.pdbAddr)->precord);
psub->pact = FALSE;
return(0);
}
@@ -346,7 +347,7 @@ struct subRecord *psub;
if(plink->type!=DB_LINK) continue;
options=0;
nRequest=1;
status=dbGetLink(&plink->value.db_link,psub,DBR_DOUBLE,
status=dbGetLink(&plink->value.db_link,(struct dbCommon *)psub,DBR_DOUBLE,
pvalue,&options,&nRequest);
if(status!=0) {
recGblSetSevr(psub,LINK_ALARM,VALID_ALARM);
+7 -8
View File
@@ -44,6 +44,7 @@
* .11 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .12 12-02-91 jba Added cmd control to io-interrupt processing
* .13 12-12-91 jba Set cmd to zero in io-interrupt processing
* .14 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -52,12 +53,11 @@
#include <lstLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <module_types.h>
#include <timerRecord.h>
@@ -113,7 +113,7 @@ static long get_ioint_info(cmd,ptimer,io_type,card_type,card_number)
short *card_type;
short *card_number;
{
*cmd=0;
*cmd=-1;
if(ptimer->out.type != VME_IO) return(S_dev_badInpType);
*io_type = IO_TIMER;
if(ptimer->dtyp==0)
@@ -148,10 +148,9 @@ static long init_record(ptimer)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(ptimer)
struct timerRecord *ptimer;
{
struct timerRecord *ptimer=(struct timerRecord *)(paddr->precord);
ptimer->pact=TRUE;
@@ -163,7 +162,7 @@ static long process(paddr)
/* check event list */
monitor(ptimer);
/* process the forward scan link record */
if (ptimer->flnk.type==DB_LINK) dbScanPassive(ptimer->flnk.value.db_link.pdbAddr);
if (ptimer->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)ptimer->flnk.value.db_link.pdbAddr)->precord);
ptimer->pact=FALSE;
return(0);
@@ -281,7 +280,7 @@ struct timerRecord *ptimer;
if (ptimer->torg.type == DB_LINK) {
options=0;
nRequest=1;
status = dbGetLink(&(ptimer->torg.value.db_link),ptimer,DBR_FLOAT,
status = dbGetLink(&(ptimer->torg.value.db_link),(struct dbCommon *)ptimer,DBR_FLOAT,
&(ptimer->trdl),&options,&nRequest);
if(status!=0){
recGblSetSevr(ptimer,LINK_ALARM,VALID_ALARM);
+8 -9
View File
@@ -49,6 +49,8 @@
* value was not initialized
* .10 10-11-90 mrk Made changes for new record support
* .11 11-11-91 jba Moved set and reset of alarm stat and sevr to macros
* .12 12-18-91 jba Changed E_IO_INTERRUPT to SCAN_IO_EVENT, added dbScan.h
* .13 02-05-92 jba Changed function arguments from paddr to precord
*/
#include <vxWorks.h>
@@ -57,12 +59,12 @@
#include <lstLib.h>
#include <alarm.h>
#include <dbAccess.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <dbFldTypes.h>
#include <dbScan.h>
#include <devSup.h>
#include <errMdef.h>
#include <link.h>
#include <recSup.h>
#include <waveformRecord.h>
@@ -120,8 +122,6 @@ static int sizeofTypes[] = {0,1,1,2,2,4,4,4,8,2};
void monitor();
/* The following is taken from dbScan.c */
#define E_IO_INTERRUPT 7
/*Following from timing system */
extern unsigned int gts_trigger_counter;
@@ -159,10 +159,9 @@ static long init_record(pwf)
return(0);
}
static long process(paddr)
struct dbAddr *paddr;
static long process(pwf)
struct waveformRecord *pwf;
{
struct waveformRecord *pwf=(struct waveformRecord *)(paddr->precord);
struct wfdset *pdset = (struct wfdset *)(pwf->dset);
long status;
@@ -172,7 +171,7 @@ static long process(paddr)
return(S_dev_missingSup);
}
/* event throttling */
if (pwf->scan == E_IO_INTERRUPT){
if (pwf->scan == SCAN_IO_EVENT){
if ((pwf->evnt != 0) && (gts_trigger_counter != 0)){
if ((gts_trigger_counter % pwf->evnt) != 0){
status=(*pdset->read_wf)(pwf);
@@ -191,7 +190,7 @@ static long process(paddr)
monitor(pwf);
/* process the forward scan link record */
if (pwf->flnk.type==DB_LINK) dbScanPassive(pwf->flnk.value.db_link.pdbAddr);
if (pwf->flnk.type==DB_LINK) dbScanPassive(((struct dbAddr *)pwf->flnk.value.db_link.pdbAddr)->precord);
pwf->pact=FALSE;
return(0);