addition of intLock()/intUnlock() (BESSY)

This commit is contained in:
William Lupton
1998-06-04 19:32:12 +00:00
parent fdb0b29c0a
commit 3995dbafdb
12 changed files with 96 additions and 38 deletions

View File

@@ -47,12 +47,13 @@
#include <types.h>
#include <stdioLib.h>
#include <string.h>
#include <intLib.h>
#include <alarm.h>
#include <cvtTable.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <aiRecord.h>
@@ -100,10 +101,13 @@ static long read_ai(pai)
{
long status;
struct vxSym *private = (struct vxSym *) pai->dpvt;
int lockKey;
if (private)
{
lockKey = intLock();
pai->val = *((double *)(*private->ppvar) + private->index);
intUnlock(lockKey);
status = 0;
}
else

View File

@@ -46,11 +46,12 @@
#include <types.h>
#include <stdioLib.h>
#include <string.h>
#include <intLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <special.h>
@@ -97,9 +98,14 @@ static long write_ao(pao)
struct aoRecord *pao;
{
struct vxSym *private = (struct vxSym *) pao->dpvt;
int lockKey;
if (private)
{
lockKey = intLock();
*((double *)(*private->ppvar) + private->index) = pao->val;
intUnlock(lockKey);
}
else
return(1);

View File

@@ -43,15 +43,16 @@
*/
#include <vxWorks.h>
#include <sysSymTbl.h>
#include <sysSymTbl.h>
#include <types.h>
#include <stdioLib.h>
#include <string.h>
#include <intLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <recSup.h>
#include <devSup.h>
#include <module_types.h>
#include <biRecord.h>
@@ -95,16 +96,19 @@ static long init_record(pbi)
static long read_bi(pbi)
struct biRecord *pbi;
{
int lockKey;
long status;
struct vxSym *private = (struct vxSym *) pbi->dpvt;
if (pbi->dpvt)
{
pbi->val = *((unsigned short *)(*private->ppvar) + private->index);
status = 0;
lockKey = intLock();
pbi->val = *((unsigned short *)(*private->ppvar) + private->index);
intUnlock(lockKey);
status = 0;
}
else
status = 1;
status = 1;
if(RTN_SUCCESS(status)) pbi->udf=FALSE;

View File

@@ -44,15 +44,16 @@
#include <vxWorks.h>
#include <sysSymTbl.h>
#include <sysSymTbl.h>
#include <types.h>
#include <stdioLib.h>
#include <string.h>
#include <intLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <recSup.h>
#include <devSup.h>
#include <module_types.h>
#include <boRecord.h>
@@ -96,12 +97,17 @@ static long init_record(pbo)
static long write_bo(pbo)
struct boRecord *pbo;
{
int lockKey;
struct vxSym *private = (struct vxSym *) pbo->dpvt;
if (private)
*((unsigned short *)(*private->ppvar) + private->index) = pbo->val;
{
lockKey = intLock();
*((unsigned short *)(*private->ppvar) + private->index) = pbo->val;
intUnlock(lockKey);
}
else
return(1);
return(1);
pbo->udf=FALSE;

View File

@@ -42,15 +42,16 @@
*/
#include <vxWorks.h>
#include <sysSymTbl.h>
#include <sysSymTbl.h>
#include <types.h>
#include <stdioLib.h>
#include <string.h>
#include <intLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <recSup.h>
#include <devSup.h>
#include <module_types.h>
#include <longinRecord.h>
@@ -96,10 +97,13 @@ static long read_longin(plongin)
{
long status;
struct vxSym *private = (struct vxSym *) plongin->dpvt;
int lockKey;
if (plongin->dpvt)
{
lockKey = intLock();
plongin->val = *((long *)(*private->ppvar) + private->index);
intUnlock(lockKey);
status = 0;
}
else

View File

@@ -43,15 +43,16 @@
#include <vxWorks.h>
#include <sysSymTbl.h>
#include <sysSymTbl.h>
#include <types.h>
#include <stdioLib.h>
#include <string.h>
#include <intLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <recSup.h>
#include <devSup.h>
#include <module_types.h>
#include <longoutRecord.h>
@@ -96,9 +97,14 @@ static long write_longout(plongout)
struct longoutRecord *plongout;
{
struct vxSym *private = (struct vxSym *) plongout->dpvt;
int lockKey;
if (private)
{
lockKey = intLock();
*((long *)(*private->ppvar) + private->index) = plongout->val;
intUnlock(lockKey);
}
else
return(1);

View File

@@ -43,15 +43,16 @@
*/
#include <vxWorks.h>
#include <sysSymTbl.h>
#include <sysSymTbl.h>
#include <types.h>
#include <stdioLib.h>
#include <string.h>
#include <intLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <recSup.h>
#include <devSup.h>
#include <module_types.h>
#include <mbbiRecord.h>
@@ -95,16 +96,19 @@ static long init_record(pmbbi)
static long read_mbbi(pmbbi)
struct mbbiRecord *pmbbi;
{
int lockKey;
long status;
struct vxSym *private = (struct vxSym *) pmbbi->dpvt;
if (pmbbi->dpvt)
{
pmbbi->val = *((long *)(*private->ppvar) + private->index);
status = 0;
lockKey = intLock();
pmbbi->val = *((long *)(*private->ppvar) + private->index);
intUnlock(lockKey);
status = 0;
}
else
status = 1;
status = 1;
if(RTN_SUCCESS(status)) pmbbi->udf=FALSE;

View File

@@ -44,15 +44,16 @@
#include <vxWorks.h>
#include <sysSymTbl.h>
#include <sysSymTbl.h>
#include <types.h>
#include <stdioLib.h>
#include <string.h>
#include <intLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <recSup.h>
#include <devSup.h>
#include <module_types.h>
#include <mbboRecord.h>
@@ -96,12 +97,17 @@ static long init_record(pmbbo)
static long write_mbbo(pmbbo)
struct mbboRecord *pmbbo;
{
int lockKey;
struct vxSym *private = (struct vxSym *) pmbbo->dpvt;
if (private)
*((long *)(*private->ppvar) + private->index) = pmbbo->val;
{
lockKey = intLock();
*((long *)(*private->ppvar) + private->index) = pmbbo->val;
intUnlock(lockKey);
}
else
return(1);
return(1);
pmbbo->udf=FALSE;

View File

@@ -43,15 +43,16 @@
#include <vxWorks.h>
#include <sysSymTbl.h>
#include <sysSymTbl.h>
#include <types.h>
#include <stdioLib.h>
#include <string.h>
#include <intLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <recSup.h>
#include <devSup.h>
#include <module_types.h>
#include <stringinRecord.h>
@@ -95,17 +96,20 @@ static long init_record(pstringin)
static long read_stringin(pstringin)
struct stringinRecord *pstringin;
{
int lockKey;
long status;
struct vxSym *private = (struct vxSym *) pstringin->dpvt;
if (private)
{
pstringin->val[39] = '\0';
strncpy(pstringin->val, (char *)(*private->ppvar) + private->index, 39);
status = 0;
pstringin->val[39] = '\0';
lockKey = intLock();
strncpy(pstringin->val, (char *)(*private->ppvar) + private->index, 39);
intUnlock(lockKey);
status = 0;
}
else
status = 1;
status = 1;
if(RTN_SUCCESS(status)) pstringin->udf=FALSE;

View File

@@ -43,15 +43,16 @@
#include <vxWorks.h>
#include <sysSymTbl.h>
#include <sysSymTbl.h>
#include <types.h>
#include <stdioLib.h>
#include <string.h>
#include <intLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <recSup.h>
#include <devSup.h>
#include <module_types.h>
#include <stringoutRecord.h>
@@ -95,15 +96,18 @@ static long init_record(pstringout)
static long write_stringout(pstringout)
struct stringoutRecord *pstringout;
{
int lockKey;
struct vxSym *private = (struct vxSym *) pstringout->dpvt;
if (private)
{
pstringout->val[39] = '\0';
strcpy((char *)(*private->ppvar) + private->index, pstringout->val);
pstringout->val[39] = '\0';
lockKey = intLock();
strcpy((char *)(*private->ppvar) + private->index, pstringout->val);
intUnlock(lockKey);
}
else
return(1);
return(1);
pstringout->udf = FALSE;

View File

@@ -8,6 +8,12 @@
/* Modification History:
* $Log$
* Revision 1.1.1.1 1998/03/16 16:57:06 franksen
* Imported using tkCVS
*
* Revision 1.1 1998/01/21 20:47:44 mrk
* restructure; new Symb support
*
* Revision 1.1 1996/10/24 18:29:20 wlupton
* Andrew Johnson's changes (upwards-compatible)
*

View File

@@ -38,11 +38,12 @@
#include <types.h>
#include <stdioLib.h>
#include <string.h>
#include <intLib.h>
#include <alarm.h>
#include <dbDefs.h>
#include <dbAccess.h>
#include <recSup.h>
#include <recSup.h>
#include <devSup.h>
#include <link.h>
#include <waveformRecord.h>
@@ -90,16 +91,19 @@ static long read_wf(pwf)
{
long status, typesize;
struct vxSym *private = (struct vxSym *) pwf->dpvt;
int lockKey;
if (private)
{
typesize = sizeofTypes[pwf->ftvl];
/* Copy the data */
lockKey = intLock();
memcpy(pwf->bptr,
(char *)(*private->ppvar) + typesize * private->index,
pwf->nelm * typesize);
intUnlock(lockKey);
pwf->nord = pwf->nelm; /* We always get it all */
pwf->udf = FALSE; /* Record also does this (but shouldn't) */
status = 0;