Compare commits
35 Commits
R3.12.0-be
...
R3.12.0-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4f720482b | ||
|
|
8f3b1cce16 | ||
|
|
a94db92c29 | ||
|
|
b6a46820e9 | ||
|
|
cf7307f399 | ||
|
|
fb0a164de1 | ||
|
|
8d9d7a126a | ||
|
|
67378ebaa1 | ||
|
|
0859173047 | ||
|
|
0f1c9c357a | ||
|
|
a4cfb43ba1 | ||
|
|
6c620894f5 | ||
|
|
b7451c7a5d | ||
|
|
a2331c9d0e | ||
|
|
f44ce3dbb0 | ||
|
|
d9066673ef | ||
|
|
82867f0684 | ||
|
|
6fb928ea9d | ||
|
|
ad41921414 | ||
|
|
17c54db7f7 | ||
|
|
a60cba8671 | ||
|
|
1066acd60c | ||
|
|
4c546a0299 | ||
|
|
d6fe343a88 | ||
|
|
94c6314dc9 | ||
|
|
1657a97783 | ||
|
|
36fb04f13a | ||
|
|
2ea3005498 | ||
|
|
885e9e829f | ||
|
|
5f53ebb4c2 | ||
|
|
6bc97431bc | ||
|
|
0b50562f67 | ||
|
|
523c0c37c6 | ||
|
|
52eba44ac4 | ||
|
|
d6aa5a4dac |
287
src/ca/access.c
287
src/ca/access.c
@@ -281,28 +281,45 @@ void *pext
|
||||
if(extsize+sizeof(msg)>piiu->send.max_msg){
|
||||
return ECA_TOLARGE;
|
||||
}
|
||||
while(TRUE){
|
||||
struct timeval itimeout;
|
||||
|
||||
bytesAvailable = cacRingBufferWriteSize(&piiu->send, FALSE);
|
||||
|
||||
if (bytesAvailable<extsize+sizeof(msg)) {
|
||||
/*
|
||||
* try to send first so that we avoid the
|
||||
* overhead of select() in high throughput
|
||||
* situations
|
||||
*/
|
||||
(*piiu->sendBytes)(piiu);
|
||||
bytesAvailable =
|
||||
cacRingBufferWriteSize(&piiu->send, FALSE);
|
||||
if(bytesAvailable>=extsize+sizeof(msg)){
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* if connection drops request
|
||||
* cant be completed
|
||||
*/
|
||||
if(!piiu->conn_up){
|
||||
|
||||
while(bytesAvailable<extsize+sizeof(msg)){
|
||||
struct timeval itimeout;
|
||||
|
||||
/*
|
||||
* if connection drops request
|
||||
* cant be completed
|
||||
*/
|
||||
if(!piiu->conn_up){
|
||||
UNLOCK;
|
||||
return ECA_BADCHID;
|
||||
}
|
||||
|
||||
UNLOCK;
|
||||
return ECA_BADCHID;
|
||||
|
||||
LD_CA_TIME (SELECT_POLL, &itimeout);
|
||||
cac_mux_io(&itimeout);
|
||||
|
||||
LOCK;
|
||||
|
||||
bytesAvailable = cacRingBufferWriteSize(
|
||||
&piiu->send,
|
||||
FALSE);
|
||||
if(bytesAvailable>=extsize+sizeof(msg)){
|
||||
break;
|
||||
}
|
||||
}
|
||||
UNLOCK;
|
||||
|
||||
LD_CA_TIME (SELECT_POLL, &itimeout);
|
||||
cac_mux_io(&itimeout);
|
||||
|
||||
LOCK;
|
||||
}
|
||||
|
||||
|
||||
@@ -424,23 +441,37 @@ struct extmsg **ppMsg
|
||||
}
|
||||
|
||||
bytesAvailable = cacRingBufferWriteSize(&piiu->send, TRUE);
|
||||
while(bytesAvailable<msgsize){
|
||||
struct timeval itimeout;
|
||||
|
||||
UNLOCK;
|
||||
LD_CA_TIME (SELECT_POLL, &itimeout);
|
||||
cac_mux_io(&itimeout);
|
||||
LOCK;
|
||||
|
||||
if (bytesAvailable<msgsize) {
|
||||
/*
|
||||
* if connection drops request
|
||||
* cant be completed
|
||||
* try to send first so that we avoid the
|
||||
* overhead of select() in high throughput
|
||||
* situations
|
||||
*/
|
||||
if(!piiu->conn_up){
|
||||
return ECA_BADCHID;
|
||||
}
|
||||
(*piiu->sendBytes)(piiu);
|
||||
bytesAvailable = cacRingBufferWriteSize(
|
||||
&piiu->send,
|
||||
TRUE);
|
||||
|
||||
bytesAvailable = cacRingBufferWriteSize(&piiu->send, TRUE);
|
||||
while (bytesAvailable<msgsize) {
|
||||
struct timeval itimeout;
|
||||
|
||||
/*
|
||||
* if connection drops request
|
||||
* cant be completed
|
||||
*/
|
||||
if(!piiu->conn_up){
|
||||
return ECA_BADCHID;
|
||||
}
|
||||
|
||||
UNLOCK;
|
||||
LD_CA_TIME (SELECT_POLL, &itimeout);
|
||||
cac_mux_io(&itimeout);
|
||||
LOCK;
|
||||
|
||||
bytesAvailable = cacRingBufferWriteSize(
|
||||
&piiu->send,
|
||||
TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
pmsg = (struct extmsg *) &piiu->send.buf[piiu->send.wtix];
|
||||
@@ -1188,6 +1219,12 @@ void *pvalue
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* lock around io block create and list add
|
||||
* so that we are not deleted without
|
||||
* reclaiming the resource
|
||||
*/
|
||||
LOCK;
|
||||
monix = caIOBlockCreate();
|
||||
if (monix) {
|
||||
|
||||
@@ -1196,14 +1233,21 @@ void *pvalue
|
||||
monix->count = count;
|
||||
monix->usr_arg = pvalue;
|
||||
|
||||
LOCK;
|
||||
ellAdd(&pend_read_list, &monix->node);
|
||||
UNLOCK;
|
||||
}
|
||||
UNLOCK;
|
||||
|
||||
if (monix) {
|
||||
status = issue_get_callback(monix, IOC_READ);
|
||||
if (status == ECA_NORMAL) {
|
||||
SETPENDRECV;
|
||||
}
|
||||
else {
|
||||
LOCK;
|
||||
ellDelete (&pend_read_list, &monix->node);
|
||||
caIOBlockFree (monix);
|
||||
UNLOCK;
|
||||
}
|
||||
}
|
||||
else {
|
||||
status = ECA_ALLOCMEM;
|
||||
@@ -1255,8 +1299,13 @@ void *arg
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* lock around io block create and list add
|
||||
* so that we are not deleted without
|
||||
* reclaiming the resource
|
||||
*/
|
||||
LOCK;
|
||||
monix = caIOBlockCreate();
|
||||
|
||||
if (monix) {
|
||||
|
||||
monix->chan = chix;
|
||||
@@ -1265,11 +1314,18 @@ void *arg
|
||||
monix->type = type;
|
||||
monix->count = count;
|
||||
|
||||
LOCK;
|
||||
ellAdd(&pend_read_list, &monix->node);
|
||||
UNLOCK;
|
||||
}
|
||||
UNLOCK;
|
||||
|
||||
if (monix) {
|
||||
status = issue_get_callback (monix, IOC_READ_NOTIFY);
|
||||
if (status != ECA_NORMAL) {
|
||||
LOCK;
|
||||
ellDelete (&pend_read_list, &monix->node);
|
||||
caIOBlockFree (monix);
|
||||
UNLOCK;
|
||||
}
|
||||
}
|
||||
else {
|
||||
status = ECA_ALLOCMEM;
|
||||
@@ -1428,20 +1484,8 @@ void *usrarg
|
||||
return ECA_NOSUPPORT;
|
||||
}
|
||||
|
||||
if(piiu){
|
||||
monix = (evid) caIOBlockCreate();
|
||||
if (!monix){
|
||||
return ECA_ALLOCMEM;
|
||||
}
|
||||
|
||||
monix->chan = chix;
|
||||
monix->usr_func = pfunc;
|
||||
monix->usr_arg = usrarg;
|
||||
monix->type = type;
|
||||
monix->count = count;
|
||||
}
|
||||
#ifdef vxWorks
|
||||
else{
|
||||
if (!piiu) {
|
||||
CACLIENTPUTNOTIFY *ppn;
|
||||
int size;
|
||||
|
||||
@@ -1513,6 +1557,26 @@ void *usrarg
|
||||
}
|
||||
#endif /*vxWorks*/
|
||||
|
||||
/*
|
||||
* lock around io block create and list add
|
||||
* so that we are not deleted without
|
||||
* reclaiming the resource
|
||||
*/
|
||||
LOCK;
|
||||
monix = (evid) caIOBlockCreate();
|
||||
if (!monix) {
|
||||
UNLOCK;
|
||||
return ECA_ALLOCMEM;
|
||||
}
|
||||
ellAdd(&pend_write_list, &monix->node);
|
||||
UNLOCK;
|
||||
|
||||
monix->chan = chix;
|
||||
monix->usr_func = pfunc;
|
||||
monix->usr_arg = usrarg;
|
||||
monix->type = type;
|
||||
monix->count = count;
|
||||
|
||||
status = issue_ca_array_put(
|
||||
IOC_WRITE_NOTIFY,
|
||||
monix->id,
|
||||
@@ -1521,19 +1585,14 @@ void *usrarg
|
||||
chix,
|
||||
pvalue);
|
||||
if(status != ECA_NORMAL){
|
||||
if(chix->piiu){
|
||||
caIOBlockFree(monix);
|
||||
}
|
||||
LOCK;
|
||||
ellDelete (&pend_write_list, &monix->node);
|
||||
caIOBlockFree(monix);
|
||||
UNLOCK;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
if(piiu){
|
||||
LOCK;
|
||||
ellAdd(&pend_write_list, &monix->node);
|
||||
UNLOCK;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -1995,30 +2054,31 @@ long mask
|
||||
if(!mask)
|
||||
return ECA_BADMASK;
|
||||
|
||||
/*
|
||||
* lock around io block create and list add
|
||||
* so that we are not deleted without
|
||||
* reclaiming the resource
|
||||
*/
|
||||
LOCK;
|
||||
|
||||
/* event descriptor */
|
||||
# ifdef vxWorks
|
||||
{
|
||||
if (!chix->piiu) {
|
||||
# ifdef vxWorks
|
||||
static int dbevsize;
|
||||
|
||||
if(!chix->piiu){
|
||||
|
||||
if(!dbevsize){
|
||||
dbevsize = db_sizeof_event_block();
|
||||
}
|
||||
size = sizeof(*monix)+dbevsize;
|
||||
if(!(monix = (evid)ellGet(&dbfree_ev_list))){
|
||||
monix = (evid)malloc(size);
|
||||
}
|
||||
}
|
||||
else{
|
||||
monix = caIOBlockCreate();
|
||||
}
|
||||
if(!dbevsize){
|
||||
dbevsize = db_sizeof_event_block();
|
||||
}
|
||||
size = sizeof(*monix)+dbevsize;
|
||||
if(!(monix = (evid)ellGet(&dbfree_ev_list))){
|
||||
monix = (evid)malloc(size);
|
||||
}
|
||||
# else
|
||||
assert (0);
|
||||
# endif
|
||||
}
|
||||
# else
|
||||
else {
|
||||
monix = caIOBlockCreate();
|
||||
# endif
|
||||
}
|
||||
|
||||
if(!monix){
|
||||
UNLOCK;
|
||||
@@ -2041,42 +2101,40 @@ long mask
|
||||
monix->mask = mask;
|
||||
|
||||
# ifdef vxWorks
|
||||
{
|
||||
if(!chix->piiu){
|
||||
status = db_add_event(
|
||||
evuser,
|
||||
chix->id.paddr,
|
||||
ca_event_handler,
|
||||
monix,
|
||||
mask,
|
||||
monix+1);
|
||||
if(status == ERROR){
|
||||
UNLOCK;
|
||||
return ECA_DBLCLFAIL;
|
||||
}
|
||||
if(!chix->piiu){
|
||||
status = db_add_event(
|
||||
evuser,
|
||||
chix->id.paddr,
|
||||
ca_event_handler,
|
||||
monix,
|
||||
mask,
|
||||
monix+1);
|
||||
if(status == ERROR){
|
||||
UNLOCK;
|
||||
return ECA_DBLCLFAIL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Place in the channel list
|
||||
* - do it after db_add_event so there
|
||||
* is no chance that it will be deleted
|
||||
* at exit before it is completely created
|
||||
*/
|
||||
ellAdd(&chix->eventq, &monix->node);
|
||||
/*
|
||||
* Place in the channel list
|
||||
* - do it after db_add_event so there
|
||||
* is no chance that it will be deleted
|
||||
* at exit before it is completely created
|
||||
*/
|
||||
ellAdd(&chix->eventq, &monix->node);
|
||||
|
||||
/*
|
||||
* force event to be called at least once
|
||||
* return warning msg if they have made the queue to full
|
||||
* to force the first (untriggered) event.
|
||||
*/
|
||||
if(db_post_single_event(monix+1)==ERROR){
|
||||
UNLOCK;
|
||||
return ECA_OVEVFAIL;
|
||||
}
|
||||
/*
|
||||
* force event to be called at least once
|
||||
* return warning msg if they have made the queue to full
|
||||
* to force the first (untriggered) event.
|
||||
*/
|
||||
if(db_post_single_event(monix+1)==ERROR){
|
||||
UNLOCK;
|
||||
return ECA_OVEVFAIL;
|
||||
}
|
||||
|
||||
UNLOCK;
|
||||
return ECA_NORMAL;
|
||||
}
|
||||
}
|
||||
UNLOCK;
|
||||
return ECA_NORMAL;
|
||||
}
|
||||
# endif
|
||||
|
||||
/* It can be added to the list any place if it is remote */
|
||||
@@ -2086,7 +2144,14 @@ long mask
|
||||
UNLOCK;
|
||||
|
||||
if(chix->state == cs_conn){
|
||||
return ca_request_event(monix);
|
||||
status = ca_request_event(monix);
|
||||
if (status != ECA_NORMAL) {
|
||||
LOCK;
|
||||
ellDelete (&chix->eventq, &monix->node);
|
||||
caIOBlockFree(monix);
|
||||
UNLOCK
|
||||
}
|
||||
return status;
|
||||
}
|
||||
else{
|
||||
return ECA_NORMAL;
|
||||
@@ -2939,7 +3004,7 @@ int echo_request(struct ioc_in_use *piiu, ca_time *pCurrentTime)
|
||||
struct extmsg *phdr;
|
||||
|
||||
status = cac_alloc_msg_no_flush (piiu, sizeof(*phdr), &phdr);
|
||||
if (status) {
|
||||
if (status != ECA_NORMAL) {
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,13 +9,12 @@ static char *sccsId = "@(#) $Id$";
|
||||
#include <LIB$ROUTINES.H>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "os_depen.h"
|
||||
|
||||
#include <cadef.h>
|
||||
#include "os_depen.h"
|
||||
|
||||
#include <cadef.h>
|
||||
|
||||
#define EVENT_ROUTINE null_event
|
||||
#define CONN_ROUTINE conn
|
||||
@@ -75,18 +74,20 @@ int doacctst(char *pname)
|
||||
chid chix2;
|
||||
chid chix3;
|
||||
chid chix4;
|
||||
struct dbr_gr_float *ptr;
|
||||
struct dbr_gr_float *pgrfloat;
|
||||
struct dbr_gr_float *ptr = NULL;
|
||||
struct dbr_gr_float *pgrfloat = NULL;
|
||||
float *pfloat = NULL;
|
||||
double *pdouble = NULL;
|
||||
long status;
|
||||
long i, j;
|
||||
evid monix;
|
||||
float *pfloat;
|
||||
double *pdouble;
|
||||
char pstring[NUM][MAX_STRING_SIZE];
|
||||
|
||||
|
||||
SEVCHK(ca_task_initialize(), "Unable to initialize");
|
||||
|
||||
conn_get_cb_count = 0;
|
||||
|
||||
printf("begin\n");
|
||||
#ifdef VMS
|
||||
lib$init_timer();
|
||||
@@ -198,8 +199,6 @@ int doacctst(char *pname)
|
||||
lib$show_timer();
|
||||
#endif /*VMS*/
|
||||
|
||||
pfloat = &ptr->value;
|
||||
|
||||
#ifdef VMS
|
||||
lib$init_timer();
|
||||
#endif /*VMS*/
|
||||
@@ -298,7 +297,6 @@ int doacctst(char *pname)
|
||||
printf("Skipped multiple get cb test - no read access\n");
|
||||
}
|
||||
|
||||
|
||||
if(ca_v42_ok(chix1)){
|
||||
test_sync_groups(chix1);
|
||||
}
|
||||
@@ -413,10 +411,10 @@ int doacctst(char *pname)
|
||||
&monix);
|
||||
SEVCHK(status, NULL);
|
||||
}
|
||||
pfloat = (float *) malloc(sizeof(float) * NUM);
|
||||
pdouble = (double *) malloc(sizeof(double) * NUM);
|
||||
pgrfloat = (struct dbr_gr_float *) malloc(sizeof(*pgrfloat) * NUM);
|
||||
|
||||
pfloat = (float *) calloc(sizeof(float),NUM);
|
||||
pdouble = (double *) calloc(sizeof(double),NUM);
|
||||
pgrfloat = (struct dbr_gr_float *) calloc(sizeof(*pgrfloat),NUM);
|
||||
|
||||
if (VALID_DB_REQ(chix1->type))
|
||||
if (pfloat)
|
||||
@@ -482,10 +480,18 @@ int doacctst(char *pname)
|
||||
SEVCHK(status, NULL);
|
||||
}
|
||||
|
||||
free(ptr);
|
||||
free(pfloat);
|
||||
free(pdouble);
|
||||
free(pgrfloat);
|
||||
if (ptr){
|
||||
free (ptr);
|
||||
}
|
||||
if (pfloat) {
|
||||
free(pfloat);
|
||||
}
|
||||
if (pdouble) {
|
||||
free(pdouble);
|
||||
}
|
||||
if (pgrfloat) {
|
||||
free(pgrfloat);
|
||||
}
|
||||
|
||||
status = ca_task_exit();
|
||||
SEVCHK(status,NULL);
|
||||
|
||||
@@ -48,6 +48,7 @@ int cac_select_io(struct timeval *ptimeout, int flags)
|
||||
int maxfd;
|
||||
caFDInfo *pfdi;
|
||||
|
||||
|
||||
LOCK;
|
||||
pfdi = (caFDInfo *) ellGet(&ca_static->fdInfoFreeList);
|
||||
|
||||
@@ -60,7 +61,6 @@ int cac_select_io(struct timeval *ptimeout, int flags)
|
||||
}
|
||||
}
|
||||
ellAdd (&ca_static->fdInfoList, &pfdi->node);
|
||||
UNLOCK;
|
||||
|
||||
FD_ZERO (&pfdi->readMask);
|
||||
FD_ZERO (&pfdi->writeMask);
|
||||
@@ -93,9 +93,7 @@ int cac_select_io(struct timeval *ptimeout, int flags)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pfdi->writeSave = pfdi->writeMask;
|
||||
pfdi->readSave = pfdi->readMask;
|
||||
UNLOCK;
|
||||
|
||||
#if 0
|
||||
printf( "max fd=%d tv_usec=%d tv_sec=%d\n",
|
||||
@@ -103,6 +101,15 @@ printf( "max fd=%d tv_usec=%d tv_sec=%d\n",
|
||||
ptimeout->tv_usec,
|
||||
ptimeout->tv_sec);
|
||||
#endif
|
||||
|
||||
#if defined(vxWorks) && 0
|
||||
if(client_lock->recurse>0){
|
||||
ca_printf("lock is on and we are going to sleep %d!",
|
||||
client_lock->recurse);
|
||||
taskSuspend(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
status = select(
|
||||
maxfd+1,
|
||||
&pfdi->readMask,
|
||||
@@ -141,19 +148,7 @@ printf("leaving select stat=%d errno=%d \n", status, MYERRNO);
|
||||
if (FD_ISSET(piiu->sock_chan,&pfdi->writeMask)) {
|
||||
(*piiu->sendBytes)(piiu);
|
||||
}
|
||||
#if 0
|
||||
else{
|
||||
if (FD_ISSET(piiu->sock_chan, &pfdi->writeSave)) {
|
||||
if(FD_ISSET(piiu->sock_chan, &pfdi->readSave) &&
|
||||
!FD_ISSET(piiu->sock_chan,&pfdi->readMask)) {
|
||||
printf("Still waiting to send on %d with recv empty\n", piiu->sock_chan);
|
||||
}
|
||||
if(!FD_ISSET(piiu->sock_chan, &pfdi->readSave)){
|
||||
printf("Still waiting to send on %d with no recv wait?\n", piiu->sock_chan);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (FD_ISSET(piiu->sock_chan,&pfdi->readMask)) {
|
||||
(*piiu->recvBytes)(piiu);
|
||||
}
|
||||
|
||||
@@ -1556,7 +1556,7 @@ void htonf(float *pHost, float *pNet)
|
||||
pIEEE->mant = mant;
|
||||
pIEEE->exp = exp;
|
||||
pIEEE->sign = sign;
|
||||
*(ca_uint32_t *)pIEEE = ntohl(*(ca_uint32_t *)pIEEE);
|
||||
*(ca_uint32_t *)pIEEE = htonl(*(ca_uint32_t *)pIEEE);
|
||||
}
|
||||
|
||||
|
||||
@@ -1570,7 +1570,7 @@ void ntohf(float *pNet, float *pHost)
|
||||
struct ieeeflt *pIEEE = pNet;
|
||||
long exp,mant2,mant1,sign;
|
||||
|
||||
*(ca_uint32_t *)pIEEE = htonl(*(ca_uint32_t *)pIEEE);
|
||||
*(ca_uint32_t *)pIEEE = ntohl(*(ca_uint32_t *)pIEEE);
|
||||
if( (short) pIEEE->exp > EXPMAXMIT + IEEE_SB){
|
||||
sign = pIEEE->sign;
|
||||
exp = EXPMAXMIT + MIT_SB;
|
||||
@@ -1600,24 +1600,68 @@ void ntohf(float *pNet, float *pHost)
|
||||
|
||||
#ifndef CA_FLOAT_MIT
|
||||
|
||||
void htond(double *IEEEhost, double *IEEEnet)
|
||||
/*
|
||||
* htond ()
|
||||
* performs only byte swapping
|
||||
*/
|
||||
void htond (double *IEEEhost, double *IEEEnet)
|
||||
{
|
||||
*IEEEnet = *IEEEhost;
|
||||
ca_uint32_t *pHost = (ca_uint32_t *) IEEEhost;
|
||||
ca_uint32_t *pNet = (ca_uint32_t *) IEEEnet;
|
||||
ca_uint32_t tmp;
|
||||
|
||||
/*
|
||||
* byte swap to net order
|
||||
* (assume that src and dest ptrs
|
||||
* may be identical)
|
||||
*/
|
||||
tmp = pHost[0];
|
||||
pNet[0] = htonl (pHost[1]);
|
||||
pNet[1] = htonl (tmp);
|
||||
}
|
||||
|
||||
void ntohd(double *IEEEnet, double *IEEEhost)
|
||||
/*
|
||||
* ntohd ()
|
||||
* performs only byte swapping
|
||||
*/
|
||||
void ntohd (double *IEEEnet, double *IEEEhost)
|
||||
{
|
||||
*IEEEhost = *IEEEnet;
|
||||
ca_uint32_t *pHost = (ca_uint32_t *) IEEEhost;
|
||||
ca_uint32_t *pNet = (ca_uint32_t *) IEEEnet;
|
||||
ca_uint32_t tmp;
|
||||
|
||||
/*
|
||||
* byte swap to net order
|
||||
* (assume that src and dest ptrs
|
||||
* may be identical)
|
||||
*/
|
||||
tmp = pNet[0];
|
||||
pHost[0] = ntohl (pNet[1]);
|
||||
pHost[1] = htonl (tmp);
|
||||
}
|
||||
|
||||
void ntohf(float *IEEEnet, float *IEEEhost)
|
||||
/*
|
||||
* ntohf ()
|
||||
* performs only byte swapping
|
||||
*/
|
||||
void ntohf (float *IEEEnet, float *IEEEhost)
|
||||
{
|
||||
*IEEEhost = *IEEEnet;
|
||||
ca_uint32_t *pHost = (ca_uint32_t *) IEEEhost;
|
||||
ca_uint32_t *pNet = (ca_uint32_t *) IEEEnet;
|
||||
|
||||
*pHost = ntohl (*pNet);
|
||||
}
|
||||
|
||||
void htonf(float *IEEEhost, float *IEEEnet)
|
||||
/*
|
||||
* htonf ()
|
||||
* performs only byte swapping
|
||||
*/
|
||||
void htonf (float *IEEEhost, float *IEEEnet)
|
||||
{
|
||||
*IEEEnet = *IEEEhost;
|
||||
ca_uint32_t *pHost = (ca_uint32_t *) IEEEhost;
|
||||
ca_uint32_t *pNet = (ca_uint32_t *) IEEEnet;
|
||||
|
||||
*pNet = htonl (*pHost);
|
||||
}
|
||||
|
||||
#endif /* not CA_MIT_FLOAT*/
|
||||
|
||||
@@ -54,6 +54,7 @@ static char *sccsId = "@(#) $Id$";
|
||||
*
|
||||
* Perhaps it is sufficient for this to return 127.0.0.1
|
||||
* (the loop back address)
|
||||
* See Below
|
||||
*/
|
||||
int local_addr(int s, struct sockaddr_in *plcladdr)
|
||||
{
|
||||
@@ -141,16 +142,46 @@ int local_addr(int s, struct sockaddr_in *plcladdr)
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* An alternate sloution
|
||||
* for os without the if routines
|
||||
*/
|
||||
/*
|
||||
* local_addr()
|
||||
*
|
||||
* return 127.0.0.1
|
||||
* (the loop back address)
|
||||
*/
|
||||
int local_addr (int s, struct sockaddr_in *plcladdr)
|
||||
{
|
||||
ca_uint32_t loopBackAddress = 0x7f000001;
|
||||
|
||||
plcladdr->sa_family = AF_INET;
|
||||
plcladdr->sin_port = 0;
|
||||
plcladdr->sin_addr.s_addr = ntohl (loopBackAddress);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* caDiscoverInterfaces()
|
||||
* caDiscoverInterfaces()
|
||||
*
|
||||
* Load the list with the broadcast address for all
|
||||
* interfaces found that support broadcast.
|
||||
* This routine is provided with the address of an ELLLIST a socket
|
||||
* and a destination port number. When the routine returns there
|
||||
* will be one additional inet address (a caAddrNode) in the list
|
||||
* for each inet interface found that is up and isnt a loop back
|
||||
* interface. If the interface supports broadcast then I add its
|
||||
* broadcast address to the list. If the interface is a point to
|
||||
* point link then I add the destination address of the point to
|
||||
* point link to the list. In either case I set the port number
|
||||
* in the address node to the port supplied in the argument
|
||||
* list.
|
||||
*
|
||||
* LOCK should be applied here for (pList)
|
||||
* (this is also called from the server)
|
||||
* LOCK should be applied here for (pList)
|
||||
* (this is also called from the server)
|
||||
*/
|
||||
void caDiscoverInterfaces(ELLLIST *pList, int socket, int port)
|
||||
{
|
||||
|
||||
@@ -380,8 +380,6 @@ typedef struct {
|
||||
ELLNODE node;
|
||||
fd_set readMask;
|
||||
fd_set writeMask;
|
||||
fd_set writeSave;
|
||||
fd_set readSave;
|
||||
}caFDInfo;
|
||||
|
||||
struct ca_static{
|
||||
|
||||
@@ -63,9 +63,10 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MIT_FLOAT
|
||||
#define htond(IEEEhost, IEEEnet) (*(IEEEnet) = *(IEEEhost))
|
||||
#define ntohd(IEEEnet, IEEEhost) (*(IEEEhost) = *(IEEEnet))
|
||||
#define htonf(IEEEhost, IEEEnet) (*(IEEEnet) = *(IEEEhost))
|
||||
#define ntohf(IEEEnet, IEEEhost) (*(IEEEhost) = *(IEEEnet))
|
||||
#if !defined(MIT_FLOAT) && !defined(CA_LITTLE_ENDIAN)
|
||||
#define htond(IEEEhost, IEEEnet) (*(double *)(IEEEnet) = *(double *)(IEEEhost))
|
||||
#define ntohd(IEEEnet, IEEEhost) (*(double *)(IEEEhost) = *(double *)(IEEEnet))
|
||||
#define htonf(IEEEhost, IEEEnet) (*(float *)(IEEEnet) = *(float *)(IEEEhost))
|
||||
#define ntohf(IEEEnet, IEEEhost) (*(float *)(IEEEhost) = *(float *)(IEEEnet))
|
||||
#endif
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ void ca_sg_init(void)
|
||||
void ca_sg_shutdown(struct ca_static *ca_temp)
|
||||
{
|
||||
CASG *pcasg;
|
||||
CASG *pnextcasg;
|
||||
int status;
|
||||
|
||||
/*
|
||||
@@ -69,16 +70,25 @@ void ca_sg_shutdown(struct ca_static *ca_temp)
|
||||
LOCK;
|
||||
pcasg = (CASG *) ellFirst (&ca_temp->activeCASG);
|
||||
while (pcasg) {
|
||||
status = bucketRemoveItemUnsignedId (
|
||||
ca_temp->ca_pSlowBucket, &pcasg->id);
|
||||
assert (status == BUCKET_SUCCESS);
|
||||
pcasg = (CASG *) ellNext(&pcasg->node);
|
||||
pnextcasg = (CASG *) ellNext (&pcasg->node);
|
||||
status = ca_sg_delete (pcasg->id);
|
||||
assert (status==ECA_NORMAL);
|
||||
pcasg = pnextcasg;
|
||||
}
|
||||
ellFree(&ca_temp->activeCASG);
|
||||
ellFree(&ca_temp->freeCASG);
|
||||
assert (ellCount(&ca_temp->activeCASG)==0);
|
||||
|
||||
/*
|
||||
* per sync group
|
||||
*/
|
||||
ellFree (&ca_temp->freeCASG);
|
||||
|
||||
/*
|
||||
* per sync group op
|
||||
*/
|
||||
ellFree (&ca_temp->activeCASGOP);
|
||||
ellFree (&ca_temp->freeCASGOP);
|
||||
|
||||
UNLOCK;
|
||||
ellInit(&ca_temp->activeCASGOP);
|
||||
ellInit(&ca_temp->freeCASGOP);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -104,6 +104,10 @@ void cac_mux_io(struct timeval *ptimeout)
|
||||
int count;
|
||||
struct timeval timeout;
|
||||
|
||||
#if NOASYNCRECV
|
||||
cac_clean_iiu_list();
|
||||
manage_conn(TRUE);
|
||||
#endif
|
||||
timeout = *ptimeout;
|
||||
do{
|
||||
count = cac_select_io(
|
||||
@@ -113,6 +117,10 @@ void cac_mux_io(struct timeval *ptimeout)
|
||||
timeout.tv_sec = 0;
|
||||
}
|
||||
while(count>0);
|
||||
|
||||
#if NOASYNCRECV
|
||||
ca_process_input_queue();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -125,6 +133,9 @@ void cac_block_for_io_completion(struct timeval *pTV)
|
||||
unsigned long ticks;
|
||||
unsigned long rate = sysClkRateGet();
|
||||
|
||||
#if NOASYNCRECV
|
||||
cac_mux_io(pTV);
|
||||
#else
|
||||
/*
|
||||
* flush outputs
|
||||
* (recv occurs in another thread)
|
||||
@@ -137,6 +148,7 @@ void cac_block_for_io_completion(struct timeval *pTV)
|
||||
ticks = min(LOCALTICKS, ticks);
|
||||
|
||||
semTake(io_done_sem, ticks);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +158,7 @@ void cac_block_for_io_completion(struct timeval *pTV)
|
||||
void os_specific_sg_create(CASG *pcasg)
|
||||
{
|
||||
pcasg->sem = semBCreate(SEM_Q_PRIORITY, SEM_EMPTY);
|
||||
assert(pcasg->sem);
|
||||
assert (pcasg->sem);
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +170,7 @@ void os_specific_sg_delete(CASG *pcasg)
|
||||
int status;
|
||||
|
||||
status = semDelete(pcasg->sem);
|
||||
assert(status == OK);
|
||||
assert (status == OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -170,7 +182,7 @@ void os_specific_sg_io_complete(CASG *pcasg)
|
||||
int status;
|
||||
|
||||
status = semGive(pcasg->sem);
|
||||
assert(status == OK);
|
||||
assert (status == OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -183,6 +195,9 @@ void cac_block_for_sg_completion(CASG *pcasg, struct timeval *pTV)
|
||||
unsigned long ticks;
|
||||
unsigned long rate = sysClkRateGet();
|
||||
|
||||
#if NOASYNCRECV
|
||||
cac_mux_io(pTV);
|
||||
#else
|
||||
/*
|
||||
* flush outputs
|
||||
* (recv occurs in another thread)
|
||||
@@ -194,7 +209,8 @@ void cac_block_for_sg_completion(CASG *pcasg, struct timeval *pTV)
|
||||
ticks = pTV->tv_sec*rate + (pTV->tv_usec*rate)/USEC_PER_SEC;
|
||||
ticks = min(LOCALTICKS, ticks);
|
||||
|
||||
semTake(pcasg->sem, ticks);
|
||||
semTake (pcasg->sem, ticks);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -440,14 +456,17 @@ LOCAL int cac_os_depen_exit_tid (struct ca_static *pcas, int tid)
|
||||
* Cancel all local events
|
||||
* (and put call backs)
|
||||
*
|
||||
* !! temp release lock so that the event task
|
||||
* can finish !!
|
||||
*/
|
||||
UNLOCK;
|
||||
chix = (chid) & pcas->ca_local_chidlist.node;
|
||||
while (chix = (chid) chix->node.next) {
|
||||
while (monix = (evid) ellGet(&chix->eventq)) {
|
||||
/*
|
||||
* temp release lock so that the event task
|
||||
* can finish
|
||||
*/
|
||||
UNLOCK;
|
||||
status = db_cancel_event(monix + 1);
|
||||
LOCK;
|
||||
assert(status == OK);
|
||||
free(monix);
|
||||
}
|
||||
@@ -461,7 +480,6 @@ LOCAL int cac_os_depen_exit_tid (struct ca_static *pcas, int tid)
|
||||
free (ppn);
|
||||
}
|
||||
}
|
||||
LOCK;
|
||||
|
||||
/*
|
||||
* set ca_static for access.c
|
||||
@@ -841,6 +859,9 @@ void cac_recv_task(int tid)
|
||||
* ca_task_exit() is called.
|
||||
*/
|
||||
while(TRUE){
|
||||
#if NOASYNCRECV
|
||||
taskDelay(60);
|
||||
#else
|
||||
manage_conn(TRUE);
|
||||
|
||||
timeout.tv_usec = 0;
|
||||
@@ -853,6 +874,7 @@ void cac_recv_task(int tid)
|
||||
CA_DO_RECVS);
|
||||
|
||||
ca_process_input_queue();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ junko: WORD
|
||||
yyerror(str)
|
||||
char *str;
|
||||
{
|
||||
sprintf(message,"Error line %d : %s\n",line_num, yytext);
|
||||
sprintf(message,"Error line %d : %s %s\n",line_num, yytext,str);
|
||||
errMessage(-1,message);
|
||||
}
|
||||
|
||||
|
||||
@@ -1270,13 +1270,15 @@ void *devLibA24Malloc(size_t size)
|
||||
void *ret;
|
||||
|
||||
if (devLibA24Debug)
|
||||
printf("devLibA24Malloc(%d) entered\n", size);
|
||||
logMsg("devLibA24Malloc(%d) entered\n", size, 0,0,0,0,0);
|
||||
|
||||
if (A24MallocFunc == NULL)
|
||||
{
|
||||
/* See if the sysA24Malloc() function is present. */
|
||||
if(symFindByName(sysSymTbl,"_sysA24Malloc", (char**)&A24MallocFunc,&stype)==ERROR)
|
||||
{ /* Could not find sysA24Malloc... use the malloc one and hope we are OK */
|
||||
if (devLibA24Debug)
|
||||
logMsg("devLibA24Malloc() using regular malloc\n",0,0,0,0,0,0);
|
||||
A24MallocFunc = malloc;
|
||||
A24FreeFunc = free;
|
||||
}
|
||||
@@ -1284,6 +1286,8 @@ void *devLibA24Malloc(size_t size)
|
||||
{
|
||||
if(symFindByName(sysSymTbl,"_sysA24Free", (char**)&A24FreeFunc, &stype) == ERROR)
|
||||
{ /* That's strange... we have malloc, but no free! */
|
||||
if (devLibA24Debug)
|
||||
logMsg("devLibA24Malloc() using regular malloc\n",0,0,0,0,0,0);
|
||||
A24MallocFunc = malloc;
|
||||
A24FreeFunc = free;
|
||||
}
|
||||
@@ -1301,5 +1305,8 @@ void *devLibA24Malloc(size_t size)
|
||||
|
||||
void devLibA24Free(void *pBlock)
|
||||
{
|
||||
if (devLibA24Debug)
|
||||
logMsg("devLibA24Free(%p) entered\n", (unsigned long)pBlock,0,0,0,0,0);
|
||||
|
||||
A24FreeFunc(pBlock);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.4 1994/10/28 20:15:10 jbk
|
||||
* increased the USP packet time-out to 250ms, added a parm to the configure()
|
||||
* routine to let user specify it.
|
||||
*
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
@@ -653,7 +657,23 @@ static void TSerrorHandler(int Card, int ErrorNum)
|
||||
Could put the slave on the vxworks timer until next sync
|
||||
*/
|
||||
|
||||
logMsg("***TSerrorHandler: error number %d=n",ErrorNum,0,0,0,0,0);
|
||||
if(MAKE_DEBUG)
|
||||
{
|
||||
switch(ErrorNum)
|
||||
{
|
||||
case 1:
|
||||
logMsg("***TSerrorHandler: event system error: TAXI violation",0,0,0,0,0,0);
|
||||
break;
|
||||
case 2:
|
||||
logMsg("***TSerrorHandler: event system error: lost heartbeat",0,0,0,0,0,0);
|
||||
break;
|
||||
case 3:
|
||||
logMsg("***TSerrorHandler: event system error: lost events",0,0,0,0,0,0);
|
||||
break;
|
||||
default:
|
||||
logMsg("***TSerrorHandler: unknown error %d from event system", ErrorNum,0,0,0,0,0);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
* .23 09-10-92 rcz changed funcptr pinitHooks from ret long to void
|
||||
* .24 09-11-92 rcz moved setMasterTimeToSelf to a seperate C file
|
||||
* .25 07-15-93 mrk Changed dbLoad for new dbStaticLib support
|
||||
<<<<<<< iocInit.c
|
||||
* .26 02-09-94 jbk changed to new time stamp support software ts_init()
|
||||
* .27 03-18-94 mcn added comments
|
||||
* .28 03-23-94 mrk Added asInit
|
||||
@@ -176,11 +175,6 @@ int iocInit(char * pResourceFilename)
|
||||
* Read EPICS resources.
|
||||
*/
|
||||
status = getResources(pResourceFilename);
|
||||
if (status != 0) {
|
||||
logMsg("iocInit aborting because getResources failed\n",0,0,0,0,0,0);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* Call hook for after resources are read. */
|
||||
if (pinitHooks) (*pinitHooks)(INITHOOKafterGetResources);
|
||||
|
||||
@@ -778,9 +772,10 @@ static long initDatabase(void)
|
||||
* Severity/No Maximize Severity(MS/NMS), and output NMS
|
||||
* links ... The following code checks for this.
|
||||
*/
|
||||
if (plink->value.db_link.process_passive
|
||||
if (errVerbose &&
|
||||
(plink->value.db_link.process_passive
|
||||
|| (pfldDes->field_type == DBF_OUTLINK
|
||||
&& plink->value.db_link.maximize_sevr))
|
||||
&& plink->value.db_link.maximize_sevr)))
|
||||
{
|
||||
/*
|
||||
* Link PP and/or Outlink MS ...
|
||||
@@ -795,7 +790,7 @@ static long initDatabase(void)
|
||||
strcat(message," PP and/or MS illegal");
|
||||
status = S_db_badField;
|
||||
errMessage(status,message);
|
||||
if(rtnval==OK) rtnval=status;
|
||||
status = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1078,7 +1073,7 @@ static long getResources(char *fname)
|
||||
sprintf(message,
|
||||
"getResources: Line too long - line=%d", lineNum);
|
||||
errMessage(-1L, message);
|
||||
return (-1);
|
||||
continue;
|
||||
}
|
||||
for (i = 0; i < len; i++) {
|
||||
if (buff[i] == '!') {
|
||||
@@ -1090,7 +1085,7 @@ static long getResources(char *fname)
|
||||
sprintf(message,
|
||||
"getResources: Not enough fields - line=%d", lineNum);
|
||||
errMessage(-1L, message);
|
||||
return (-1);
|
||||
continue;
|
||||
}
|
||||
found = 0;
|
||||
len2 = strlen(s2);
|
||||
@@ -1107,7 +1102,7 @@ static long getResources(char *fname)
|
||||
sprintf(message,
|
||||
"getResources: Field 2 not defined - line=%d", lineNum);
|
||||
errMessage(-1L, message);
|
||||
return (-1);
|
||||
continue;
|
||||
}
|
||||
strcpy(name, "_");
|
||||
strcat(name, s1);
|
||||
@@ -1116,7 +1111,7 @@ static long getResources(char *fname)
|
||||
sprintf(message,
|
||||
"getResources: Symbol name not found - line=%d", lineNum);
|
||||
errMessage(-1L, message);
|
||||
return (-1);
|
||||
continue;
|
||||
}
|
||||
if ( (strncmp(s1,"EPICS_",6)) == SAME)
|
||||
epicsFlag = 1;
|
||||
@@ -1143,7 +1138,7 @@ static long getResources(char *fname)
|
||||
sprintf(message,
|
||||
"getResources: conversion failed - line=%d", lineNum);
|
||||
errMessage(-1L, message);
|
||||
return (-1);
|
||||
continue;
|
||||
}
|
||||
if ( epicsFlag ) {
|
||||
sprintf(message,
|
||||
@@ -1160,7 +1155,7 @@ static long getResources(char *fname)
|
||||
sprintf(message,
|
||||
"getResources: conversion failed - line=%d", lineNum);
|
||||
errMessage(-1L, message);
|
||||
return (-1);
|
||||
continue;
|
||||
}
|
||||
if ( epicsFlag ) {
|
||||
sprintf(message,
|
||||
@@ -1176,7 +1171,7 @@ static long getResources(char *fname)
|
||||
sprintf(message,
|
||||
"getResources: conversion failed - line=%d", lineNum);
|
||||
errMessage(-1L, message);
|
||||
return (-1);
|
||||
continue;
|
||||
}
|
||||
if ( epicsFlag ) {
|
||||
sprintf(message,
|
||||
@@ -1193,7 +1188,7 @@ static long getResources(char *fname)
|
||||
sprintf(message,
|
||||
"getResources: conversion failed - line=%d", lineNum);
|
||||
errMessage(-1L, message);
|
||||
return (-1);
|
||||
continue;
|
||||
}
|
||||
if ( epicsFlag ) {
|
||||
sprintf(message,
|
||||
@@ -1209,7 +1204,7 @@ static long getResources(char *fname)
|
||||
sprintf(message,
|
||||
"getResources: switch default reached - line=%d", lineNum);
|
||||
errMessage(-1L, message);
|
||||
return (-1);
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
CLEAR: memset(buff, '\0', MAX);
|
||||
|
||||
@@ -172,6 +172,15 @@ gDset *dset; /* pointer to dset used to reference the init function */
|
||||
|
||||
return(OK);
|
||||
}
|
||||
|
||||
static void RegisterProcessCallback(CALLBACK *pCallback, int Priority, void *Parm)
|
||||
{
|
||||
callbackSetCallback(devGpibLib_processCallback, pCallback);
|
||||
callbackSetPriority(Priority, pCallback);
|
||||
callbackSetUser(Parm, pCallback);
|
||||
callbackRequest(pCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
@@ -1288,9 +1297,13 @@ struct gpibDpvt *pdpvt;
|
||||
{
|
||||
devGpibLib_setPvSevr(pai,READ_ALARM,VALID_ALARM);
|
||||
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1335,9 +1348,13 @@ int srqStatus;
|
||||
{
|
||||
devGpibLib_setPvSevr(pai,READ_ALARM,VALID_ALARM);
|
||||
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
}
|
||||
|
||||
devGpibLib_aiGpibFinish(pdpvt); /* and finish the processing */
|
||||
@@ -1382,9 +1399,13 @@ struct gpibDpvt *pdpvt;
|
||||
devGpibLib_setPvSevr(pai,READ_ALARM,VALID_ALARM);
|
||||
}
|
||||
}
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
|
||||
return(0);
|
||||
}
|
||||
@@ -1426,9 +1447,14 @@ struct gpibDpvt *pdpvt;
|
||||
devGpibLib_setPvSevr(pao,WRITE_ALARM,VALID_ALARM);
|
||||
}
|
||||
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
|
||||
return(IDLE);
|
||||
}
|
||||
|
||||
@@ -1458,9 +1484,13 @@ struct gpibDpvt *pdpvt;
|
||||
{
|
||||
devGpibLib_setPvSevr(pli,READ_ALARM,VALID_ALARM);
|
||||
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1505,9 +1535,13 @@ int srqStatus;
|
||||
{
|
||||
devGpibLib_setPvSevr(pli,READ_ALARM,VALID_ALARM);
|
||||
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
}
|
||||
|
||||
devGpibLib_liGpibFinish(pdpvt); /* and finish the processing */
|
||||
@@ -1551,9 +1585,13 @@ struct gpibDpvt *pdpvt;
|
||||
devGpibLib_setPvSevr(pli,READ_ALARM,VALID_ALARM);
|
||||
}
|
||||
}
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
|
||||
return(0);
|
||||
}
|
||||
@@ -1595,9 +1633,13 @@ struct gpibDpvt *pdpvt;
|
||||
devGpibLib_setPvSevr(plo,WRITE_ALARM,VALID_ALARM);
|
||||
}
|
||||
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
return(IDLE);
|
||||
}
|
||||
|
||||
@@ -1624,9 +1666,13 @@ struct gpibDpvt *pdpvt;
|
||||
{
|
||||
devGpibLib_setPvSevr(pbi,READ_ALARM,VALID_ALARM);
|
||||
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
}
|
||||
else /* interpret response that came back */
|
||||
{
|
||||
@@ -1669,9 +1715,13 @@ int srqStatus;
|
||||
{
|
||||
devGpibLib_setPvSevr(pbi,READ_ALARM,VALID_ALARM);
|
||||
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
}
|
||||
|
||||
devGpibLib_biGpibFinish(pdpvt); /* and finish the processing */
|
||||
@@ -1718,9 +1768,13 @@ struct gpibDpvt *pdpvt;
|
||||
devGpibLib_setPvSevr(pbi,READ_ALARM,VALID_ALARM);
|
||||
}
|
||||
}
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback); /* jrw */
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
|
||||
return(0);
|
||||
}
|
||||
@@ -1763,9 +1817,14 @@ struct gpibDpvt *pdpvt;
|
||||
devGpibLib_setPvSevr(pbo,WRITE_ALARM,VALID_ALARM);
|
||||
}
|
||||
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
|
||||
return(IDLE);
|
||||
}
|
||||
|
||||
@@ -1792,9 +1851,13 @@ struct gpibDpvt *pdpvt;
|
||||
{
|
||||
devGpibLib_setPvSevr(pmbbi,WRITE_ALARM,VALID_ALARM);
|
||||
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1839,9 +1902,13 @@ int srqStatus;
|
||||
{
|
||||
devGpibLib_setPvSevr(pmbbi,READ_ALARM,VALID_ALARM);
|
||||
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
}
|
||||
|
||||
devGpibLib_mbbiGpibFinish(pdpvt); /* and finish the processing */
|
||||
@@ -1888,9 +1955,13 @@ struct gpibDpvt *pdpvt;
|
||||
devGpibLib_setPvSevr(pmbbi,READ_ALARM,VALID_ALARM);
|
||||
}
|
||||
}
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
|
||||
return(0);
|
||||
}
|
||||
@@ -1934,9 +2005,13 @@ struct gpibDpvt *pdpvt;
|
||||
devGpibLib_setPvSevr(pmbbo,WRITE_ALARM,VALID_ALARM);
|
||||
}
|
||||
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback); /* jrw */
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
return(IDLE);
|
||||
}
|
||||
|
||||
@@ -1966,9 +2041,13 @@ struct gpibDpvt *pdpvt;
|
||||
{
|
||||
devGpibLib_setPvSevr(psi,READ_ALARM,VALID_ALARM);
|
||||
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback); /* jrw */
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2013,9 +2092,13 @@ int srqStatus;
|
||||
{
|
||||
devGpibLib_setPvSevr(psi,READ_ALARM,VALID_ALARM);
|
||||
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
}
|
||||
|
||||
devGpibLib_stringinGpibFinish(pdpvt); /* and finish the processing */
|
||||
@@ -2051,9 +2134,13 @@ struct gpibDpvt *pdpvt;
|
||||
psi->val[40] = '\0';
|
||||
psi->udf = FALSE;
|
||||
}
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback); /* jrw */
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
|
||||
return(0);
|
||||
}
|
||||
@@ -2094,9 +2181,13 @@ struct gpibDpvt *pdpvt;
|
||||
devGpibLib_setPvSevr(pso,WRITE_ALARM,VALID_ALARM);
|
||||
}
|
||||
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback); /* jrw */
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
return(IDLE);
|
||||
}
|
||||
|
||||
@@ -2279,14 +2370,16 @@ unsigned short val; /* used for EFAST operations only */
|
||||
*
|
||||
* The reason it is done this way is because the process() call may
|
||||
* recursively call itself when records are chained and the callback
|
||||
* task's stack is larger... just for this purpose.
|
||||
* task's stack is larger... just for that reason.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
devGpibLib_processCallback(pDpvt)
|
||||
struct gpibDpvt *pDpvt;
|
||||
devGpibLib_processCallback(CALLBACK *pCallback)
|
||||
{
|
||||
struct gpibDpvt *pDpvt;
|
||||
callbackGetUser(pDpvt, pCallback);
|
||||
|
||||
dbScanLock(pDpvt->precord);
|
||||
(*(struct rset *)(pDpvt->precord->rset)).process(pDpvt->precord);
|
||||
dbScanUnlock(pDpvt->precord);
|
||||
@@ -2462,9 +2555,13 @@ struct gpibDpvt *pdpvt;
|
||||
{
|
||||
devGpibLib_setPvSevr(pwf,READ_ALARM,VALID_ALARM);
|
||||
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest((void *)pdpvt);
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2509,9 +2606,13 @@ int srqStatus;
|
||||
{
|
||||
devGpibLib_setPvSevr(pwf,READ_ALARM,VALID_ALARM);
|
||||
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest((void *)pdpvt);
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
}
|
||||
|
||||
devGpibLib_wfGpibFinish(pdpvt); /* and finish the processing */
|
||||
@@ -2547,9 +2648,14 @@ struct gpibDpvt *pdpvt;
|
||||
{
|
||||
devGpibLib_setPvSevr(pwf,READ_ALARM,VALID_ALARM);
|
||||
}
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest((void *)pdpvt);
|
||||
|
||||
#if 1
|
||||
RegisterProcessCallback(&pdpvt->head.callback, priorityLow, pdpvt);
|
||||
#else
|
||||
pdpvt->head.header.callback.callback = devGpibLib_processCallback;
|
||||
pdpvt->head.header.callback.priority = priorityLow;
|
||||
callbackRequest(&pdpvt->head.header.callback);
|
||||
#endif
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ static long init_record(pmbbo)
|
||||
case (VME_IO) :
|
||||
pvmeio = &(pmbbo->out.value.vmeio);
|
||||
pmbbo->shft = pvmeio->signal;
|
||||
pmbbo->mask = pmbbo->shft;
|
||||
pmbbo->mask <<= pmbbo->shft;
|
||||
status = xy220_read(pvmeio->card,pmbbo->mask,&value);
|
||||
if(status==0) pmbbo->rbv = pmbbo->rval = value;
|
||||
else status = 2;
|
||||
|
||||
@@ -83,7 +83,7 @@ static long init_record(pmbbo)
|
||||
case (VME_IO) :
|
||||
pvmeio = &(pmbbo->out.value.vmeio);
|
||||
pmbbo->shft = pvmeio->signal;
|
||||
pmbbo->mask = pmbbo->shft;
|
||||
pmbbo->mask <<= pmbbo->shft;
|
||||
status = xy220_read(pvmeio->card,pmbbo->mask,&value);
|
||||
if(status==0) pmbbo->rbv = pmbbo->rval = value;
|
||||
else status = 2;
|
||||
|
||||
@@ -59,6 +59,9 @@
|
||||
* ...
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.4 1994/11/30 15:10:23 winans
|
||||
* Added IRQ mode stuff
|
||||
*
|
||||
* Revision 1.3 1994/11/17 21:11:58 winans
|
||||
* Major restructuring of init code.
|
||||
*
|
||||
@@ -601,7 +604,7 @@ STATIC long SysmonInitMbbiRec(struct mbbiRecord *pmbbi)
|
||||
|
||||
/* load temperature values up */
|
||||
|
||||
if (!strcmp(ParmTable[3].parm_name, pvmeio->parm))
|
||||
if (!strcmp(ParmTable[SYSMON_PARM_TEMP].parm_name, pvmeio->parm))
|
||||
{
|
||||
if (devSysmonDebug >= 10)
|
||||
printf("devSysmon: mbbi record is Temperature\n");
|
||||
|
||||
@@ -7,17 +7,20 @@ USR_INCLUDES = -I../../drv
|
||||
SRCS.c = \
|
||||
../devAnalytekGpib.c ../devXxDg535Gpib.c ../devBBInteract.c \
|
||||
../devGpibInteract.c ../devXxSr620Gpib.c ../devK486Gpib.c \
|
||||
../devXxK196Gpib.c ../devXxDc5009Gpib.c ../devXxK263Gpib.c
|
||||
../devXxK196Gpib.c ../devXxDc5009Gpib.c ../devXxK263Gpib.c \
|
||||
../devXxSkeletonGpib.c
|
||||
|
||||
OBJS = \
|
||||
devAnalytekGpib.o devXxDg535Gpib.o devBBInteract.o \
|
||||
devGpibInteract.o devXxSr620Gpib.o devK486Gpib.o \
|
||||
devXxK196Gpib.o devXxDc5009Gpib.o devXxK263Gpib.o
|
||||
devXxK196Gpib.o devXxDc5009Gpib.o devXxK263Gpib.o \
|
||||
devXxSkeletonGpib.o
|
||||
|
||||
PROD = devLibOpt
|
||||
PROD = devLibOpt $(OBJS)
|
||||
|
||||
include $(EPICS)/config/RULES.Vx
|
||||
|
||||
devLibOpt: $(OBJS)
|
||||
$(RM) $@
|
||||
$(LINK.c) $@ $(OBJS) $(LDLIBS)
|
||||
|
||||
|
||||
@@ -139,8 +139,10 @@ int GI(void)
|
||||
for (cnt=0; cnt < LIST_SIZE; cnt++)
|
||||
{ /* init the elements of the command table */
|
||||
|
||||
#if 0
|
||||
gpibIntCmds[cnt].head.header.list.list1 = NULL;
|
||||
gpibIntCmds[cnt].head.header.list.list2 = NULL;
|
||||
#endif
|
||||
gpibIntCmds[cnt].head.workStart = gpibWork;
|
||||
gpibIntCmds[cnt].head.link = 0;
|
||||
gpibIntCmds[cnt].head.device = 0;
|
||||
@@ -155,7 +157,7 @@ int GI(void)
|
||||
}
|
||||
|
||||
ans = 0; /* set loop not to exit */
|
||||
printf("\n\n");
|
||||
logMsg("\n\n");
|
||||
|
||||
while ((ans != 'q') && (ans != 'Q'))
|
||||
{
|
||||
@@ -380,6 +382,8 @@ static int sendMsg(void)
|
||||
|
||||
if (replyIsBack)
|
||||
{
|
||||
if (ibDebug)
|
||||
taskDelay(60); /* Allow debug printing to complete */
|
||||
showGpibMsg(msgNum);
|
||||
}
|
||||
else
|
||||
@@ -438,7 +442,7 @@ static int gpibWork(struct gpibIntCmd *pCmd)
|
||||
}
|
||||
else if (status > (MAX_MSG_LENGTH - 1)) /* check length of resp */
|
||||
{
|
||||
printf("GPIB Response length equaled allocated space !!!\n");
|
||||
logMsg("GPIB Response length equaled allocated space !!!\n");
|
||||
pCmd->resp[(MAX_MSG_LENGTH)] = '\0'; /* place \0 at end */
|
||||
}
|
||||
else
|
||||
|
||||
@@ -391,8 +391,8 @@ STATIC int srqHandler(struct hwpvt *phwpvt, int srqStatus)
|
||||
printf("dc5009 srqHandler: Unsolicited SRQ being handled from link %d, device %d, status = 0x%02.2X\n",
|
||||
phwpvt->link, phwpvt->device, srqStatus);
|
||||
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.header.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.header.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
callbackRequest((CALLBACK*)phwpvt->unsolicitedDpvt);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -404,9 +404,9 @@ STATIC int srqHandler(struct hwpvt *phwpvt, int srqStatus)
|
||||
printf("dc5009 srqHandler: Unsolicited SRQ being handled from link %d, device %d, status = 0x%02.2X\n",
|
||||
phwpvt->link, phwpvt->device, srqStatus);
|
||||
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.header.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.header.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
callbackRequest(phwpvt->unsolicitedDpvt);
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
callbackRequest((CALLBACK*)phwpvt->unsolicitedDpvt);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -282,8 +282,8 @@ STATIC int srqHandler(struct hwpvt *phwpvt, int srqStatus)
|
||||
logMsg("Unsolicited SRQ being handled from link %d, device %d, status = 0x%02.2X\n",
|
||||
phwpvt->link, phwpvt->device, srqStatus);
|
||||
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.header.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.header.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
callbackRequest((CALLBACK*)phwpvt->unsolicitedDpvt);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -65,6 +65,16 @@
|
||||
* This driver currently needs work on error message generation.
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.35 1994/12/12 16:02:57 winans
|
||||
* Rewrote the init code so that it always returns a zero (don't kill the
|
||||
* startup.cmd file.) It is possible that this could cause some confusion
|
||||
* to the database, should it decide to then use a link that did not init
|
||||
* properly.
|
||||
*
|
||||
* Revision 1.34 1994/10/19 18:31:22 winans
|
||||
* ANSIfied the bitbus driver so that the compiler stopped warning about
|
||||
* exery third line of code.
|
||||
*
|
||||
* Revision 1.33 1994/10/04 18:42:42 winans
|
||||
* Added an extensive debugging facility.
|
||||
*
|
||||
@@ -129,6 +139,8 @@ STATIC int bbKill(int link);
|
||||
STATIC void BBrebootFunc(void);
|
||||
|
||||
STATIC int txStuck(int link);
|
||||
int BBConfig(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
|
||||
int __BBConfig(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);
|
||||
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
int BBHistDump(int link);
|
||||
@@ -157,7 +169,7 @@ int XycomMaxOutstandMsgs = XYCOM_BB_MAX_OUTSTAND_MSGS;
|
||||
* To disable this feature, set one of them to -1.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int bbDebug = 0;
|
||||
int bbDebug = 1;
|
||||
int bbDebugLink=-1;
|
||||
int bbDebugNode=-1;
|
||||
|
||||
@@ -199,7 +211,16 @@ int BBConfig(unsigned long Link,
|
||||
unsigned long IrqVector,
|
||||
unsigned long IrqLevel)
|
||||
{
|
||||
__BBConfig(Link, LinkType, BaseAddr, IrqVector, IrqLevel);
|
||||
return(0);
|
||||
}
|
||||
|
||||
int __BBConfig(unsigned long Link,
|
||||
unsigned long LinkType,
|
||||
unsigned long BaseAddr,
|
||||
unsigned long IrqVector,
|
||||
unsigned long IrqLevel)
|
||||
{
|
||||
void *pVoid;
|
||||
int j;
|
||||
static int FirstTime = 1;
|
||||
@@ -419,7 +440,7 @@ STATIC long reportBB(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (bbDebug)
|
||||
if (bbDebug>1)
|
||||
printf("Bitbus debugging flag is set to %d\n", bbDebug);
|
||||
|
||||
for (i=0; i< BB_NUM_LINKS; i++)
|
||||
@@ -468,8 +489,10 @@ pepReset(int link)
|
||||
|
||||
taskDelay(20); /* give the 80152 time to self check */
|
||||
|
||||
if ((pBBLink[link]->l.PepLink.bbRegs->stat_ctl & 0x10) != 0x0) {
|
||||
printf("pepReset(%d): PB-BIT firmware reset failed!\n", link);
|
||||
if ((pBBLink[link]->l.PepLink.bbRegs->stat_ctl & 0x10) != 0x0)
|
||||
{
|
||||
if (bbDebug)
|
||||
printf("pepReset(%d): PB-BIT firmware reset failed!\n", link);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -480,7 +503,8 @@ pepReset(int link)
|
||||
|
||||
if (!j)
|
||||
{
|
||||
printf("pepReset(%d): receive fifo will not clear after reset!\n", link);
|
||||
if (bbDebug)
|
||||
printf("pepReset(%d): receive fifo will not clear after reset!\n", link);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -532,7 +556,8 @@ STATIC int xvmeReset(int link)
|
||||
|
||||
if (!j)
|
||||
{
|
||||
printf("xvmeReset(%d): Command buffer will not clear after reset!\n", link);
|
||||
if (bbDebug)
|
||||
printf("xvmeReset(%d): Command buffer will not clear after reset!\n", link);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -542,13 +567,15 @@ STATIC int xvmeReset(int link)
|
||||
|
||||
if (!j)
|
||||
{
|
||||
printf("xvmeReset(%d): Data buffer will not clear after reset!\n", link);
|
||||
if (bbDebug)
|
||||
printf("xvmeReset(%d): Data buffer will not clear after reset!\n", link);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
if ((pBBLink[link]->l.XycomLink.bbRegs->fifo_stat & XVME_FSVALID) != XVME_FSIDLE)
|
||||
{
|
||||
printf("xvmeReset(%d): XVME board not returning to idle status after reset!\n", link);
|
||||
if (bbDebug)
|
||||
printf("xvmeReset(%d): XVME board not returning to idle status after reset!\n", link);
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -846,7 +873,8 @@ xvmeRxTask(int link)
|
||||
{ /* something bad happened... inject a delay to the */
|
||||
/* requested timeout duration. */
|
||||
|
||||
printf("xvmeRxTask(%d): 0x91 from node %d, invoking synthetic delay\n", link, rxHead[2]);
|
||||
if (bbDebug)
|
||||
printf("xvmeRxTask(%d): 0x91 from node %d, invoking synthetic delay\n", link, rxHead[2]);
|
||||
(pBBLink[link]->syntheticDelay[rxDpvtHead->txMsg.node]) = rxDpvtHead->retire;
|
||||
pBBLink[link]->DelayCount++;
|
||||
}
|
||||
@@ -892,17 +920,6 @@ xvmeRxTask(int link)
|
||||
|
||||
rxDpvtHead->status = BB_OK; /* OK, unless BB_LENGTH */
|
||||
rxState = BBRX_DATA; /* finish reading till RCMD */
|
||||
|
||||
#if 0
|
||||
if (bbDebug)
|
||||
{
|
||||
printf("xvmeRxTask(%d): msg from node %d unsolicited!\nHeader:", link, rxHead[2]);
|
||||
rxDpvtHead->rxMsg.length = 7; /* we just have the header now */
|
||||
drvBitBusDumpMsg(&(rxDpvtHead->rxMsg));
|
||||
}
|
||||
semGive(pXvmeLink[link]->pbbLink->busyList.sem);
|
||||
rxState = BBRX_IGN; /* nothing waiting... toss it */
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -935,7 +952,8 @@ xvmeRxTask(int link)
|
||||
if (rxDpvtHead == NULL)
|
||||
{
|
||||
ch = pBBLink[link]->l.XycomLink.bbRegs->cmnd;
|
||||
printf("xvmeRxTask(%d): got unexpected XVME_RCMD\n", link);
|
||||
if (bbDebug)
|
||||
printf("xvmeRxTask(%d): got unexpected XVME_RCMD\n", link);
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
BBSetHistEvent(link, NULL, XACT_HIST_STATE_RX_URCMD);
|
||||
#endif
|
||||
@@ -945,7 +963,7 @@ xvmeRxTask(int link)
|
||||
rxDpvtHead->status = BB_OK;
|
||||
rxDpvtHead->rxCmd = pBBLink[link]->l.XycomLink.bbRegs->cmnd;
|
||||
|
||||
/* if (bbDebug) */
|
||||
if (bbDebug)
|
||||
{
|
||||
printf("xvmeRxTask(%d): msg from node %d unsolicited:", link, rxDpvtHead->rxMsg.node);
|
||||
drvBitBusDumpMsg(&(rxDpvtHead->rxMsg));
|
||||
@@ -1008,14 +1026,14 @@ xvmeRxTask(int link)
|
||||
/* Tell the watch dog I am ready for the reset (reset in the dog task) */
|
||||
pBBLink[link]->rxAbortAck = 1;
|
||||
|
||||
/* if (bbDebug) */
|
||||
if (bbDebug)
|
||||
printf("xvmeRxTask(%d): resetting due to abort status\n", link);
|
||||
|
||||
/* wait for link state to become active again */
|
||||
while (pBBLink[link]->abortFlag != 0)
|
||||
taskDelay(RESET_POLL_TIME);
|
||||
|
||||
/* if bbDebug) */
|
||||
if (bbDebug)
|
||||
printf("xvmeRxTask(%d): restarting after abort\n", link);
|
||||
}
|
||||
}
|
||||
@@ -1134,7 +1152,7 @@ xvmeWdTask(int link)
|
||||
/* Get rid of the request and set error status etc... */
|
||||
listDel(&(pBBLink[link]->busyList), pnode);
|
||||
|
||||
/*if (bbDebug)*/
|
||||
if (bbDebug)
|
||||
{
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
BBSetHistEvent(link, pnode, XACT_HIST_STATE_WD_TIMEOUT);
|
||||
@@ -1172,7 +1190,8 @@ xvmeWdTask(int link)
|
||||
{ /* Send out a RAC_NODE_OFFLINE to the controller */
|
||||
semGive(pBBLink[link]->busyList.sem);
|
||||
|
||||
printf("issuing a node offline for link %d node %d\n", link, resetNodeData);
|
||||
if (bbDebug)
|
||||
printf("issuing a node offline for link %d node %d\n", link, resetNodeData);
|
||||
|
||||
semTake(pBBLink[link]->queue[BB_Q_HIGH].sem, WAIT_FOREVER);
|
||||
listAddHead(&(pBBLink[link]->queue[BB_Q_HIGH]), &resetNode);
|
||||
@@ -1182,7 +1201,8 @@ printf("issuing a node offline for link %d node %d\n", link, resetNodeData);
|
||||
|
||||
if (semTake(syncSem, sysClkRateGet()/4) == ERROR)
|
||||
{
|
||||
printf("xvmeWdTask(%d): link dead, trying manual reboot\n", link);
|
||||
if (bbDebug)
|
||||
printf("xvmeWdTask(%d): link dead, trying manual reboot\n", link);
|
||||
pBBLink[link]->nukeEm = 1;
|
||||
|
||||
pBBLink[link]->abortFlag = 1; /* Start the abort sequence */
|
||||
@@ -1286,13 +1306,13 @@ xvmeTxTask(int link)
|
||||
BBSetHistEvent(link, NULL, XACT_HIST_STATE_TX_ABORT);
|
||||
#endif
|
||||
|
||||
/* if (bbDebug) */
|
||||
if (bbDebug)
|
||||
printf("xvmeTxTask(%d): resetting due to abort status\n", link);
|
||||
|
||||
while (pBBLink[link]->abortFlag != 0)
|
||||
taskDelay(RESET_POLL_TIME); /* wait for link to reset */
|
||||
|
||||
/* if (bbDebug) */
|
||||
if (bbDebug)
|
||||
printf("xvmeTxTask(%d): restarting after abort\n", link);
|
||||
}
|
||||
else
|
||||
@@ -1325,7 +1345,8 @@ xvmeTxTask(int link)
|
||||
if ((pBBLink[link]->syntheticDelay[pnode->txMsg.node] != 0)
|
||||
&& (pBBLink[link]->syntheticDelay[pnode->txMsg.node] < now))
|
||||
{
|
||||
printf("xvmeTxTask(%d): terminating synthetic idle on node %d\n", link, pnode->txMsg.node);
|
||||
if (bbDebug)
|
||||
printf("xvmeTxTask(%d): terminating synthetic idle on node %d\n", link, pnode->txMsg.node);
|
||||
(pBBLink[link]->deviceStatus[pnode->txMsg.node])--;
|
||||
pBBLink[link]->syntheticDelay[pnode->txMsg.node] = 0;
|
||||
pBBLink[link]-> DelayCount--;
|
||||
@@ -1397,7 +1418,7 @@ xvmeTxTask(int link)
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
BBSetHistEvent(link, pnode, XACT_HIST_STATE_TX_RESET);
|
||||
#endif
|
||||
/* if (bbDebug) */
|
||||
if (bbDebug)
|
||||
printf("xvmeTxTask(%d): RAC_RESET_SLAVE sent, resetting node %d\n", link, pnode->txMsg.node);
|
||||
|
||||
pnode->status = BB_OK;
|
||||
@@ -1471,8 +1492,11 @@ xvmeTxTask(int link)
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
BBSetHistEvent(link, pnode, XACT_HIST_STATE_TX_ABORT);
|
||||
#endif
|
||||
printf("Message in progress when abort issued:\n");
|
||||
drvBitBusDumpMsg(&pnode->txMsg);
|
||||
if (bbDebug)
|
||||
{
|
||||
printf("Message in progress when abort issued:\n");
|
||||
drvBitBusDumpMsg(&pnode->txMsg);
|
||||
}
|
||||
}
|
||||
/* BUG -- I don't really need this */
|
||||
/* break;*/ /* stop checking the fifo queues */
|
||||
@@ -1495,7 +1519,7 @@ xvmeTxTask(int link)
|
||||
******************************************************************************/
|
||||
STATIC int txStuck(int link)
|
||||
{
|
||||
/* if (bbDebug) */
|
||||
if (bbDebug)
|
||||
printf("bitbus transmitter task stuck, resetting link %d\n", link);
|
||||
|
||||
bbReset(link);
|
||||
@@ -1523,14 +1547,6 @@ STATIC long qBBReq(struct dpvtBitBusHead *pdpvt, int prio)
|
||||
errMessage(S_BB_badPrio, message);
|
||||
return(ERROR);
|
||||
}
|
||||
#if 0
|
||||
if (checkLink(pdpvt->link) == ERROR)
|
||||
{
|
||||
sprintf(message, "invalid link requested in call to qbbreq(%8.8X, %d)\n", pdpvt, prio);
|
||||
errMessage(S_BB_rfu1, message);
|
||||
return(ERROR);
|
||||
}
|
||||
#else
|
||||
if (checkLink(pdpvt->link) == ERROR)
|
||||
{
|
||||
if (pdpvt->link >= BB_NUM_LINKS)
|
||||
@@ -1546,7 +1562,6 @@ STATIC long qBBReq(struct dpvtBitBusHead *pdpvt, int prio)
|
||||
}
|
||||
return(ERROR);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
BBSetHistEvent(pdpvt->link, pdpvt, XACT_HIST_STATE_QUEUE);
|
||||
@@ -1945,7 +1960,8 @@ pepRxTask(int link)
|
||||
if (rxHead[6] == 0x91)
|
||||
{ /* something bad happened... inject a delay to the */
|
||||
/* requested timeout duration. */
|
||||
printf("pepRxTask(%d): 0x91 from node %d, invoking synthetic delay\n", link, rxHead[4]);
|
||||
if (bbDebug)
|
||||
printf("pepRxTask(%d): 0x91 from node %d, invoking synthetic delay\n", link, rxHead[4]);
|
||||
(pBBLink[link]->syntheticDelay[rxDpvtHead->txMsg.node]) = rxDpvtHead->retire;
|
||||
pBBLink[link]->DelayCount++;
|
||||
}
|
||||
@@ -1990,21 +2006,6 @@ pepRxTask(int link)
|
||||
|
||||
rxDpvtHead->status = BB_OK; /* OK, unless BB_LENGTH */
|
||||
rxState = BBRX_DATA; /* finish reading till RCMD */
|
||||
|
||||
#if 0 /* relocated to later spot in function */
|
||||
if (rxDpvtHead == NULL)
|
||||
{
|
||||
if (bbDebug > 9)
|
||||
{
|
||||
printf("pepRxTask(%d): msg from node %d unsolicited!\n",
|
||||
link, rxHead[4]);
|
||||
printf("contents: %2.2x %2.2x %2.2x %2.2x %2.2x\n",rxHead[2],
|
||||
rxHead[3],rxHead[4],rxHead[5],rxHead[6]);
|
||||
}
|
||||
semGive(pXvmeLink[link]->pbbLink->busyList.sem);
|
||||
rxState = BBRX_IGN; /* nothing waiting... toss it */
|
||||
}
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2044,7 +2045,7 @@ pepRxTask(int link)
|
||||
else if (rxDpvtHead == &UselessMsg)
|
||||
{
|
||||
rxDpvtHead->status = BB_OK;
|
||||
/* if (bbDebug) */
|
||||
if (bbDebug)
|
||||
{
|
||||
printf("pepRxTask(%d): msg from node %d unsolicited:\n", link, rxDpvtHead->rxMsg.node);
|
||||
drvBitBusDumpMsg(&(rxDpvtHead->rxMsg));
|
||||
@@ -2107,15 +2108,15 @@ pepRxTask(int link)
|
||||
/* Tell the watch dog I am ready for the reset (reset in the dog task) */
|
||||
pBBLink[link]->rxAbortAck = 1;
|
||||
|
||||
/* if (bbDebug) */
|
||||
printf("pepRxTask(%d): resetting due to abort status\n", link);
|
||||
if (bbDebug)
|
||||
printf("pepRxTask(%d): resetting due to abort status\n", link);
|
||||
|
||||
/* wait for link state to become active again */
|
||||
while (pBBLink[link]->abortFlag != 0)
|
||||
taskDelay(RESET_POLL_TIME);
|
||||
|
||||
/* if bbDebug) */
|
||||
printf("pepRxTask(%d): restarting after abort\n", link);
|
||||
if (bbDebug)
|
||||
printf("pepRxTask(%d): restarting after abort\n", link);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2233,9 +2234,11 @@ STATIC int pepWdTask(int link)
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
BBSetHistEvent(link, pnode, XACT_HIST_STATE_WD_TIMEOUT);
|
||||
#endif
|
||||
/* printf("pepWdTask(%d): TIMEOUT on xact 0x%8.8X\n", link, pnode);*/
|
||||
printf("pepWdTask(%d): TIMEOUT on bitbus message:\n", link);
|
||||
drvBitBusDumpMsg(&pnode->txMsg);
|
||||
if (bbDebug)
|
||||
{
|
||||
printf("pepWdTask(%d): TIMEOUT on bitbus message:\n", link);
|
||||
drvBitBusDumpMsg(&pnode->txMsg);
|
||||
}
|
||||
|
||||
/* BUG -- do this here or defer until RX gets a response? */
|
||||
(pBBLink[link]->deviceStatus[pnode->txMsg.node])--; /* fix device status */
|
||||
@@ -2284,8 +2287,11 @@ STATIC int pepWdTask(int link)
|
||||
|
||||
semGive(pBBLink[link]->linkEventSem); /* Tell TxTask to send the messages */
|
||||
|
||||
if (semTake(syncSem, (sysClkRateGet()) ) == ERROR) {
|
||||
printf("pepWdTask(%d): link dead, trying manual reboot\n", link);
|
||||
if (semTake(syncSem, (sysClkRateGet()) ) == ERROR)
|
||||
{
|
||||
if (bbDebug)
|
||||
printf("pepWdTask(%d): link dead, trying manual reboot\n", link);
|
||||
|
||||
pBBLink[link]->nukeEm = 1;
|
||||
pBBLink[link]->abortFlag = 1;
|
||||
semGive(pBBLink[link]->linkEventSem);
|
||||
@@ -2373,7 +2379,7 @@ STATIC int pepTxTask(int link)
|
||||
register int x;
|
||||
unsigned long now;
|
||||
|
||||
if (bbDebug)
|
||||
if (bbDebug>1)
|
||||
printf("pepTxTask started for link %d\n", link);
|
||||
|
||||
while(1) {
|
||||
@@ -2385,12 +2391,14 @@ STATIC int pepTxTask(int link)
|
||||
BBSetHistEvent(link, NULL, XACT_HIST_STATE_TX_ABORT);
|
||||
#endif
|
||||
|
||||
printf("pepTxTask(%d): resetting due to abort status\n", link);
|
||||
if (bbDebug)
|
||||
printf("pepTxTask(%d): resetting due to abort status\n", link);
|
||||
|
||||
while (pBBLink[link]->abortFlag != 0)
|
||||
taskDelay(RESET_POLL_TIME); /* wait for link to reset */
|
||||
|
||||
printf("pepTxTask(%d): restarting after abort\n", link);
|
||||
if (bbDebug)
|
||||
printf("pepTxTask(%d): restarting after abort\n", link);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2420,7 +2428,8 @@ STATIC int pepTxTask(int link)
|
||||
if ((pBBLink[link]->syntheticDelay[pnode->txMsg.node] != 0)
|
||||
&& (pBBLink[link]->syntheticDelay[pnode->txMsg.node] < now))
|
||||
{
|
||||
printf("pepTxTask(%d): terminating synthetic idle on node %d\n", link, pnode->txMsg.node);
|
||||
if (bbDebug)
|
||||
printf("pepTxTask(%d): terminating synthetic idle on node %d\n", link, pnode->txMsg.node);
|
||||
(pBBLink[link]->deviceStatus[pnode->txMsg.node])--;
|
||||
pBBLink[link]->syntheticDelay[pnode->txMsg.node] = 0;
|
||||
pBBLink[link]->DelayCount--;
|
||||
@@ -2504,7 +2513,8 @@ STATIC int pepTxTask(int link)
|
||||
#ifdef BB_SUPER_DEBUG
|
||||
BBSetHistEvent(link, pnode, XACT_HIST_STATE_TX_RESET);
|
||||
#endif
|
||||
printf("pepTxTask(%d): RAC_RESET_SLAVE sent\n", link);
|
||||
if (bbDebug)
|
||||
printf("pepTxTask(%d): RAC_RESET_SLAVE sent\n", link);
|
||||
|
||||
pnode->status = BB_OK;
|
||||
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
/* drvGpib.c */
|
||||
/* share/src/drv/drvGpib.c %W% %G% */
|
||||
|
||||
/* Author: John Winans
|
||||
/******************************************************************************
|
||||
*
|
||||
* TODO:
|
||||
* - Autodetect the need to use a bounce buffer (saves time on boards that have
|
||||
* "malloc"-able A24 space.
|
||||
*
|
||||
* - Launch campaign against the use of National Instruments hardware.
|
||||
*
|
||||
******************************************************************************
|
||||
*
|
||||
* Author: John Winans
|
||||
* Date: 09-10-91
|
||||
* GPIB driver for the NI-1014 and NI-1014D VME cards.
|
||||
*
|
||||
@@ -52,6 +62,15 @@
|
||||
*
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.26 1994/12/12 16:03:00 winans
|
||||
* Rewrote the init code so that it always returns a zero (don't kill the
|
||||
* startup.cmd file.) It is possible that this could cause some confusion
|
||||
* to the database, should it decide to then use a link that did not init
|
||||
* properly.
|
||||
*
|
||||
* Revision 1.25 1994/10/28 19:55:30 winans
|
||||
* Added VME bus violation prevention code/bug fix from LANL.
|
||||
*
|
||||
* Revision 1.24 1994/10/04 18:42:46 winans
|
||||
* Added an extensive debugging facility.
|
||||
*
|
||||
@@ -183,6 +202,11 @@ struct cc_ary
|
||||
short cc_TWO;
|
||||
};
|
||||
|
||||
typedef struct DmaStuffStruct
|
||||
{
|
||||
struct cc_ary cc_array;
|
||||
char cc_byte;
|
||||
}DmaStuffStruct;
|
||||
/******************************************************************************
|
||||
*
|
||||
* This structure is used to hold the hardware-specific information for a
|
||||
@@ -197,8 +221,12 @@ struct niLink {
|
||||
WDOG_ID watchDogId; /* watchdog for timeouts */
|
||||
struct ibregs *ibregs;/* pointer to board registers */
|
||||
|
||||
#if 0
|
||||
char cc_byte;
|
||||
struct cc_ary cc_array;
|
||||
#else
|
||||
DmaStuffStruct *DmaStuff;
|
||||
#endif
|
||||
|
||||
char r_isr1;
|
||||
char r_isr2;
|
||||
@@ -218,7 +246,7 @@ STATIC int pollInhibit[NIGPIB_NUM_LINKS][IBAPERLINK];
|
||||
/******************************************************************************
|
||||
*
|
||||
* This structure is used to hold the hardware-specific information for a
|
||||
* single Bit Bus GPIB link. They are dynamically allocated (and an ibLinkTask
|
||||
* single BitBus GPIB link. They are dynamically allocated (and an ibLinkTask
|
||||
* started for it) when an IOCTL command requests it.
|
||||
*
|
||||
* The IOCTL requests to initiate a BBGPIB_IO link comes from the device support
|
||||
@@ -372,9 +400,9 @@ initGpib(void)
|
||||
if (ibDebug)
|
||||
logMsg("GPIB card found at address 0x%08.8X\n", pibregs);
|
||||
|
||||
if ((pNiLink[i] = (struct niLink *) devLibA24Malloc(sizeof(struct niLink))) == NULL)
|
||||
if ((pNiLink[i] = (struct niLink *)malloc(sizeof(struct niLink))) == NULL)
|
||||
{ /* This better never happen! */
|
||||
logMsg("initGpib(): Can't malloc memory for NI-link data structures!");
|
||||
logMsg("initGpib(): Can't malloc memory for NI-link data structures!\n");
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
@@ -402,10 +430,15 @@ initGpib(void)
|
||||
pNiLink[i]->cmdSpins = 0;
|
||||
pNiLink[i]->maxSpins = 0;
|
||||
|
||||
pNiLink[i]->cc_array.cc_ccb = 0; /* DMAC array chained structure */
|
||||
pNiLink[i]->cc_array.cc_ONE = 1;
|
||||
pNiLink[i]->cc_array.cc_n_1addr = 0;
|
||||
pNiLink[i]->cc_array.cc_TWO = 2;
|
||||
if ((pNiLink[i]->DmaStuff = (DmaStuffStruct *)devLibA24Malloc(sizeof(DmaStuffStruct))) == NULL)
|
||||
{ /* This better never happen! */
|
||||
logMsg("initGpib(): Can't malloc A24 memory for DMAC control structures!\n");
|
||||
return(ERROR);
|
||||
}
|
||||
pNiLink[i]->DmaStuff->cc_array.cc_ccb = 0; /* DMAC chaining structure */
|
||||
pNiLink[i]->DmaStuff->cc_array.cc_ONE = 1;
|
||||
pNiLink[i]->DmaStuff->cc_array.cc_n_1addr = 0;
|
||||
pNiLink[i]->DmaStuff->cc_array.cc_TWO = 2;
|
||||
|
||||
pNiLink[i]->first_read = 1; /* used in physIo() */
|
||||
}
|
||||
@@ -970,9 +1003,9 @@ int time; /* time to wait on the DMA operation */
|
||||
b->auxmr = AUXRA | HR_HLDE; /* hold off on end */
|
||||
|
||||
if (cnt != 1)
|
||||
pNiLink[link]->cc_byte = AUXRA | HR_HLDA; /* (cc) holdoff on all */
|
||||
pNiLink[link]->DmaStuff->cc_byte = AUXRA | HR_HLDA; /* (cc) holdoff on all */
|
||||
else
|
||||
pNiLink[link]->cc_byte = b->auxmr = AUXRA | HR_HLDA; /* last byte, do now */
|
||||
pNiLink[link]->DmaStuff->cc_byte = b->auxmr = AUXRA | HR_HLDA; /* last byte, do now */
|
||||
b->ch0.ocr = D_DTM | D_XRQ;
|
||||
/* make sure I only alter the 1014D port-specific fields here! */
|
||||
b->cfg1 = D_ECC | D_IN | (NIGPIB_IRQ_LEVEL << 5) | D_BRG3 | D_DBM;
|
||||
@@ -989,7 +1022,7 @@ int time; /* time to wait on the DMA operation */
|
||||
memcpy(pNiLink[link]->A24BounceBuffer, buffer, length);
|
||||
|
||||
if (cnt != 1)
|
||||
pNiLink[link]->cc_byte = AUX_SEOI; /* send EOI with last byte */
|
||||
pNiLink[link]->DmaStuff->cc_byte = AUX_SEOI; /* send EOI with last byte */
|
||||
else
|
||||
b->auxmr = AUX_SEOI; /* last byte, do it now */
|
||||
|
||||
@@ -1006,28 +1039,28 @@ int time; /* time to wait on the DMA operation */
|
||||
/* setup channel 1 (carry cycle) */
|
||||
|
||||
if(ibDebug > 5)
|
||||
logMsg("PhysIO: readying to xlate cc pointers at %8.8X and %8.8X\n", &(pNiLink[link]->cc_byte), &pNiLink[link]->A24BounceBuffer[cnt - 1]);
|
||||
logMsg("PhysIO: readying to xlate cc pointers at %8.8X and %8.8X\n", &(pNiLink[link]->DmaStuff->cc_byte), &pNiLink[link]->A24BounceBuffer[cnt - 1]);
|
||||
|
||||
#ifdef USE_OLD_XLATION
|
||||
pNiLink[link]->cc_array.cc_ccb = &(pNiLink[link]->cc_byte) + (long) ram_base;
|
||||
pNiLink[link]->cc_array.cc_n_1addr = &(pNiLink[link]->A24BounceBuffer[cnt - 1]) + (long)ram_base;
|
||||
pNiLink[link]->DmaStuff->cc_array.cc_ccb = &(pNiLink[link]->DmaStuff->cc_byte) + (long) ram_base;
|
||||
pNiLink[link]->DmaStuff->cc_array.cc_n_1addr = &(pNiLink[link]->A24BounceBuffer[cnt - 1]) + (long)ram_base;
|
||||
#else
|
||||
|
||||
if (sysLocalToBusAdrs(VME_AM_STD_SUP_DATA, &(pNiLink[link]->cc_byte), &(pNiLink[link]->cc_array.cc_ccb)) == ERROR)
|
||||
if (sysLocalToBusAdrs(VME_AM_STD_SUP_DATA, &(pNiLink[link]->DmaStuff->cc_byte), &(pNiLink[link]->DmaStuff->cc_array.cc_ccb)) == ERROR)
|
||||
return(ERROR);
|
||||
|
||||
if (sysLocalToBusAdrs(VME_AM_STD_SUP_DATA, &(pNiLink[link]->A24BounceBuffer[cnt - 1]), &(pNiLink[link]->cc_array.cc_n_1addr)) == ERROR)
|
||||
if (sysLocalToBusAdrs(VME_AM_STD_SUP_DATA, &(pNiLink[link]->A24BounceBuffer[cnt - 1]), &(pNiLink[link]->DmaStuff->cc_array.cc_n_1addr)) == ERROR)
|
||||
return(ERROR);
|
||||
|
||||
#endif
|
||||
if(ibDebug > 5)
|
||||
logMsg("PhysIO: &cc_byte=%8.8X, &pNiLink[link]->A24BounceBuffer[cnt-1]=%8.8X, ", pNiLink[link]->cc_array.cc_ccb, pNiLink[link]->cc_array.cc_n_1addr);
|
||||
logMsg("PhysIO: &cc_byte=%8.8X, &pNiLink[link]->A24BounceBuffer[cnt-1]=%8.8X, ", pNiLink[link]->DmaStuff->cc_array.cc_ccb, pNiLink[link]->DmaStuff->cc_array.cc_n_1addr);
|
||||
|
||||
cnt--;
|
||||
#ifdef USE_OLD_XLATION
|
||||
temp_addr = (long) (&(pNiLink[link]->cc_array)) + (long)ram_base;
|
||||
temp_addr = (long) (&(pNiLink[link]->DmaStuff->cc_array)) + (long)ram_base;
|
||||
#else
|
||||
if (sysLocalToBusAdrs(VME_AM_STD_SUP_DATA, &(pNiLink[link]->cc_array), &temp_addr) == ERROR)
|
||||
if (sysLocalToBusAdrs(VME_AM_STD_SUP_DATA, &(pNiLink[link]->DmaStuff->cc_array), &temp_addr) == ERROR)
|
||||
return(ERROR);
|
||||
#endif
|
||||
if(ibDebug > 5)
|
||||
@@ -1079,7 +1112,7 @@ int time; /* time to wait on the DMA operation */
|
||||
if (ibDmaTimingError > ibDmaMaxError)
|
||||
ibDmaMaxError = ibDmaTimingError;
|
||||
if (ibDmaDebug)
|
||||
printf("DMA timing: error = %d, total = %d, max = %d\n",
|
||||
logMsg("DMA timing: error = %d, total = %d, max = %d\n",
|
||||
ibDmaTimingError, ibDmaTimingErrorTotal, ibDmaMaxError);
|
||||
/***************************************************************************/
|
||||
|
||||
@@ -1095,7 +1128,7 @@ int time; /* time to wait on the DMA operation */
|
||||
if (ibDmaTimingError > ibDmaMaxError)
|
||||
ibDmaMaxError = ibDmaTimingError;
|
||||
if (ibDmaDebug)
|
||||
printf("DMA timing: error = %d, total = %d, max = %d\n",
|
||||
logMsg("DMA timing: error = %d, total = %d, max = %d\n",
|
||||
ibDmaTimingError, ibDmaTimingErrorTotal, ibDmaMaxError);
|
||||
/***************************************************************************/
|
||||
|
||||
@@ -2008,6 +2041,102 @@ int length; /* number of bytes to write out from the data buffer */
|
||||
return(ERROR);
|
||||
}
|
||||
|
||||
#ifdef INCLUDE_HIDEOS_INTERFACE
|
||||
/******************************************************************************
|
||||
*
|
||||
* Interface functions for HiDEOS access.
|
||||
*
|
||||
******************************************************************************/
|
||||
/******************************************************************************
|
||||
*
|
||||
* Read up to <length> bytes into <*buffer>.
|
||||
*
|
||||
******************************************************************************/
|
||||
STATIC int
|
||||
HideosGpibRead(struct ibLink *pibLink, int device, char *buffer, int length, int time)
|
||||
{
|
||||
logMsg("HideosGpibRead() entered\n");
|
||||
return(bytes read | error);
|
||||
}
|
||||
/******************************************************************************
|
||||
*
|
||||
* Write <length> bytes from <*buffer> in data mode.
|
||||
*
|
||||
******************************************************************************/
|
||||
STATIC int
|
||||
HideosGpibWrite(struct ibLink *pibLink, int device, char *buffer, int length, int time)
|
||||
{
|
||||
logMsg("HideosGpibWrite() entered\n");
|
||||
return(bytes sent | error);
|
||||
}
|
||||
/******************************************************************************
|
||||
*
|
||||
* Write <length> bytes from <*buffer> in command mode.
|
||||
*
|
||||
******************************************************************************/
|
||||
STATIC int
|
||||
HideosGpibCmd(struct ibLink *pibLink, char *buffer, int length)
|
||||
{
|
||||
logMsg("HideosGpibCmd() entered\n");
|
||||
return(bytes sent | error);
|
||||
}
|
||||
/******************************************************************************
|
||||
*
|
||||
* Verify that the given GPIB port exists.
|
||||
*
|
||||
******************************************************************************/
|
||||
STATIC int
|
||||
HideosGpibCheckLink(int link, int bug)
|
||||
{
|
||||
logMsg("HideosGpibCheckLink() entered\n");
|
||||
return(OK | ERROR);
|
||||
}
|
||||
/******************************************************************************
|
||||
*
|
||||
* Prevent SRQs from being polled on a given GPIB port.
|
||||
*
|
||||
******************************************************************************/
|
||||
STATIC int
|
||||
HideosGpibSrqPollInhibit(int link, int bug, int gpibAddr)
|
||||
{
|
||||
logMsg("HideosGpibSrqPollInhibit() entered -- NOT SUPPORTED YET\n");
|
||||
return(ERROR);
|
||||
}
|
||||
/******************************************************************************
|
||||
*
|
||||
* Generate a GPIB link for a HiDEOS port.
|
||||
*
|
||||
******************************************************************************/
|
||||
STATIC int
|
||||
HideosGpibGenLink(int link, int bug)
|
||||
{
|
||||
logMsg("HideosGpibGenLink() entered\n");
|
||||
return(ibLinkStart() | ERROR);
|
||||
}
|
||||
/******************************************************************************
|
||||
*
|
||||
* Handle a GPIB IOCTL call.
|
||||
*
|
||||
******************************************************************************/
|
||||
STATIC int
|
||||
HideosGpibIoctl(int link, int bug, int cmd, int v, caddr_t p)
|
||||
{
|
||||
logMsg("HideosGpibIoctl() entered\n");
|
||||
return(OK | ERROR);
|
||||
}
|
||||
/******************************************************************************
|
||||
*
|
||||
* Given the port information, return a link structure.
|
||||
*
|
||||
******************************************************************************/
|
||||
struct bbIbLink *
|
||||
HideosGpibFindLink(int link, int bug)
|
||||
{
|
||||
logMsg("HideosGpibFindLink() entered\n");
|
||||
return(bbIbLink* | NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* These are the BitBus architecture specific functions.
|
||||
@@ -2524,13 +2653,13 @@ IBHistDump(int type, int link, int bug)
|
||||
{
|
||||
if (pibLink->linkType == GPIB_IO)
|
||||
{
|
||||
printf("%d GPIB-L%d-D%d: %s\n", pibLink->History.Hist[i].Time,
|
||||
logMsg("%d GPIB-L%d-D%d: %s\n", pibLink->History.Hist[i].Time,
|
||||
pibLink->linkId, pibLink->History.Hist[i].DevAddr,
|
||||
pibLink->History.Hist[i].Msg);
|
||||
}
|
||||
else if (pibLink->linkType == BBGPIB_IO)
|
||||
{
|
||||
printf("%d BBIB-l%d-B%d-D%d: %s\n", pibLink->History.Hist[i].Time,
|
||||
logMsg("%d BBIB-l%d-B%d-D%d: %s\n", pibLink->History.Hist[i].Time,
|
||||
pibLink->linkId, pibLink->bug, pibLink->History.Hist[i].DevAddr,
|
||||
pibLink->History.Hist[i].Msg);
|
||||
}
|
||||
@@ -2544,3 +2673,12 @@ IBHistDump(int type, int link, int bug)
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
/* A way to stop the CPU when idle... run from shell at prio 250 */
|
||||
BigFFT()
|
||||
{
|
||||
while (1)
|
||||
asm(" stop #0x3000");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -22,12 +22,12 @@ PROD = iocCore vxWorks vxWorks.sym
|
||||
include $(EPICS)/config/RULES.Vx
|
||||
|
||||
vxWorks: $(VX_IMAGE)
|
||||
$(RM) $@
|
||||
cp $< .
|
||||
chmod 444 $@
|
||||
|
||||
vxWorks.sym: $(VX_IMAGE_SYM)
|
||||
$(RM) $@
|
||||
cp $< .
|
||||
chmod 444 $@
|
||||
|
||||
iocCore: $(IOC_CORE_OBJS)
|
||||
$(LINK.c) $@ $(IOC_CORE_OBJS)
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
|
||||
#include <bucketLib.h>
|
||||
|
||||
|
||||
#ifndef NBBY
|
||||
#define NBBY 8
|
||||
#endif /* NBBY */
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
|
||||
#include <bucketLib.h>
|
||||
|
||||
|
||||
#ifndef NBBY
|
||||
#define NBBY 8
|
||||
#endif /* NBBY */
|
||||
|
||||
32
src/libCom/env/envSubr.c
vendored
32
src/libCom/env/envSubr.c
vendored
@@ -74,6 +74,7 @@
|
||||
|
||||
#define ENV_PRIVATE_DATA
|
||||
#include <envDefs.h>
|
||||
#include <epicsEnvParams.h>
|
||||
|
||||
|
||||
/*+/subr**********************************************************************
|
||||
@@ -378,3 +379,34 @@ char *value; /* I pointer to value string */
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*parameters meant to be modified in epicsEnvParams.h*/
|
||||
|
||||
epicsSetEnvParams()
|
||||
{
|
||||
printf("setting EPICS environment parameters\n");
|
||||
envSetConfigParam(&EPICS_TS_MIN_WEST, EPICS_TS_MIN_VALUE);
|
||||
envSetConfigParam(&EPICS_AR_PORT, "7002");
|
||||
envSetConfigParam(&EPICS_IOC_LOG_INET, EPICS_IOC_LOG_VALUE);
|
||||
envSetConfigParam(&EPICS_IOC_LOG_PORT, "7004");
|
||||
envSetConfigParam(&EPICS_IOC_LOG_FILE_LIMIT, EPICS_IOC_FILE_VALUE);
|
||||
envSetConfigParam(&EPICS_IOC_LOG_FILE_NAME, EPICS_IOC_LOG_FILE_TXT);
|
||||
return 0;
|
||||
}
|
||||
epicsPrtEnvParams()
|
||||
{
|
||||
envPrtConfigParam(&EPICS_TS_MIN_WEST);
|
||||
envPrtConfigParam(&EPICS_CMD_PROTO_PORT);
|
||||
envPrtConfigParam(&EPICS_AR_PORT);
|
||||
envPrtConfigParam(&EPICS_IOC_LOG_INET);
|
||||
envPrtConfigParam(&EPICS_IOC_LOG_PORT);
|
||||
envPrtConfigParam(&EPICS_IOC_LOG_FILE_LIMIT);
|
||||
envPrtConfigParam(&EPICS_IOC_LOG_FILE_NAME);
|
||||
envPrtConfigParam(&EPICS_CA_ADDR_LIST);
|
||||
envPrtConfigParam(&EPICS_CA_CONN_TMO);
|
||||
envPrtConfigParam(&EPICS_CA_BEACON_PERIOD);
|
||||
envPrtConfigParam(&EPICS_CA_AUTO_ADDR_LIST);
|
||||
envPrtConfigParam(&EPICS_CA_REPEATER_PORT);
|
||||
envPrtConfigParam(&EPICS_CA_SERVER_PORT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
|
||||
#define ENV_PRIVATE_DATA
|
||||
#include <envDefs.h>
|
||||
#include <epicsEnvParams.h>
|
||||
|
||||
|
||||
/*+/subr**********************************************************************
|
||||
@@ -378,3 +379,34 @@ char *value; /* I pointer to value string */
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*parameters meant to be modified in epicsEnvParams.h*/
|
||||
|
||||
epicsSetEnvParams()
|
||||
{
|
||||
printf("setting EPICS environment parameters\n");
|
||||
envSetConfigParam(&EPICS_TS_MIN_WEST, EPICS_TS_MIN_VALUE);
|
||||
envSetConfigParam(&EPICS_AR_PORT, "7002");
|
||||
envSetConfigParam(&EPICS_IOC_LOG_INET, EPICS_IOC_LOG_VALUE);
|
||||
envSetConfigParam(&EPICS_IOC_LOG_PORT, "7004");
|
||||
envSetConfigParam(&EPICS_IOC_LOG_FILE_LIMIT, EPICS_IOC_FILE_VALUE);
|
||||
envSetConfigParam(&EPICS_IOC_LOG_FILE_NAME, EPICS_IOC_LOG_FILE_TXT);
|
||||
return 0;
|
||||
}
|
||||
epicsPrtEnvParams()
|
||||
{
|
||||
envPrtConfigParam(&EPICS_TS_MIN_WEST);
|
||||
envPrtConfigParam(&EPICS_CMD_PROTO_PORT);
|
||||
envPrtConfigParam(&EPICS_AR_PORT);
|
||||
envPrtConfigParam(&EPICS_IOC_LOG_INET);
|
||||
envPrtConfigParam(&EPICS_IOC_LOG_PORT);
|
||||
envPrtConfigParam(&EPICS_IOC_LOG_FILE_LIMIT);
|
||||
envPrtConfigParam(&EPICS_IOC_LOG_FILE_NAME);
|
||||
envPrtConfigParam(&EPICS_CA_ADDR_LIST);
|
||||
envPrtConfigParam(&EPICS_CA_CONN_TMO);
|
||||
envPrtConfigParam(&EPICS_CA_BEACON_PERIOD);
|
||||
envPrtConfigParam(&EPICS_CA_AUTO_ADDR_LIST);
|
||||
envPrtConfigParam(&EPICS_CA_REPEATER_PORT);
|
||||
envPrtConfigParam(&EPICS_CA_SERVER_PORT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
18
src/libCom/epicsEnvParams.h
Normal file
18
src/libCom/epicsEnvParams.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* $Id$
|
||||
* $Log$
|
||||
* Revision 1.3 1994/11/01 14:55:15 jba
|
||||
* set values for ANL/APS/ASD
|
||||
*
|
||||
* Revision 1.2 1994/09/09 12:40:30 mrk
|
||||
* Removed env variables for old time support. New uses standard Unix methods.
|
||||
*
|
||||
* Revision 1.1 1994/07/17 07:14:24 bordua
|
||||
* Initial version.
|
||||
*
|
||||
*/
|
||||
/*These are env variables meant to be modified by each epics site*/
|
||||
|
||||
char *EPICS_TS_MIN_VALUE= "360";
|
||||
char *EPICS_IOC_LOG_VALUE= "164.54.8.167";
|
||||
char *EPICS_IOC_FILE_VALUE= "1000000";
|
||||
char *EPICS_IOC_LOG_FILE_TXT= "/home/phebos1/epics/apple/log/iocLog.text";
|
||||
@@ -49,17 +49,14 @@
|
||||
|
||||
unsigned memDebugLevel = 1;
|
||||
|
||||
#define debugMallocMagic 0xaaaaaaaa
|
||||
|
||||
typedef struct debugMallocFooter{
|
||||
unsigned long magic;
|
||||
}DMF;
|
||||
#define debugMallocMagic 0xaaaaaaaa
|
||||
#define debugMallocFooter "Dont Tread On Me"
|
||||
|
||||
typedef struct debugMallocHeader{
|
||||
ELLNODE node;
|
||||
char *pFile;
|
||||
char *pUser;
|
||||
DMF *pFoot;
|
||||
char *pFoot;
|
||||
unsigned long line;
|
||||
unsigned long size;
|
||||
unsigned long tick;
|
||||
@@ -99,14 +96,16 @@ unsigned long line;
|
||||
unsigned long size;
|
||||
#endif /*__STDC__*/
|
||||
{
|
||||
DMH *pHdr;
|
||||
DMH *pHdr;
|
||||
unsigned long totSize;
|
||||
|
||||
pHdr = (DMH *)calloc(1,sizeof(DMH)+sizeof(DMF)+size);
|
||||
totSize = sizeof(DMH)+strlen(debugMallocFooter)+1+size;
|
||||
pHdr = (DMH *)calloc(1, totSize);
|
||||
if(!pHdr){
|
||||
return NULL;
|
||||
}
|
||||
pHdr->pUser = (char *) (pHdr+1);
|
||||
pHdr->pFoot = (DMF *) (pHdr->pUser+size);
|
||||
pHdr->pFoot = (char *) (pHdr->pUser+size);
|
||||
pHdr->pFile = pFile;
|
||||
pHdr->line = line;
|
||||
pHdr->size = size;
|
||||
@@ -114,9 +113,9 @@ unsigned long size;
|
||||
#ifdef vxWorks
|
||||
pHdr->tick = tickGet();
|
||||
#else /*vxWorks*/
|
||||
pHdr->tick = 0;
|
||||
pHdr->tick = clock();
|
||||
#endif /*vxWorks*/
|
||||
pHdr->pFoot->magic = debugMallocMagic;
|
||||
strcpy (pHdr->pFoot, debugMallocFooter);
|
||||
|
||||
#ifdef LOCKS_REQUIRED
|
||||
if(!memDebugInit){
|
||||
@@ -217,7 +216,10 @@ DMH *pHdr;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(pHdr->magic != debugMallocMagic || pHdr->pFoot->magic != debugMallocMagic){
|
||||
strcpy (pHdr->pFoot, debugMallocFooter);
|
||||
if(pHdr->magic != debugMallocMagic ||
|
||||
strcmp(pHdr->pFoot, debugMallocFooter)){
|
||||
|
||||
fprintf(stderr, "block overwritten %x\n",
|
||||
(unsigned)pHdr->pUser);
|
||||
fprintf(stderr, "malloc occured at %s.%d\n",
|
||||
@@ -261,17 +263,17 @@ unsigned long ignoreBeforeThisTick;
|
||||
|
||||
FASTLOCK(&memDebugLock);
|
||||
pHdr = (DMH *) ellFirst(&memDebugList);
|
||||
while(pHdr = (DMH *) ellNext(pHdr)){
|
||||
if(pHdr->tick<ignoreBeforeThisTick){
|
||||
continue;
|
||||
while(pHdr){
|
||||
if(pHdr->tick>=ignoreBeforeThisTick){
|
||||
fprintf(stderr,
|
||||
"%8x = malloc(%d) at %s.%d tick=%d\n",
|
||||
(unsigned) pHdr->pUser,
|
||||
pHdr->size,
|
||||
pHdr->pFile,
|
||||
pHdr->line,
|
||||
pHdr->tick);
|
||||
}
|
||||
fprintf(stderr,
|
||||
"%8x = malloc(%d) at %s.%d tick=%d\n",
|
||||
(unsigned) pHdr->pUser,
|
||||
pHdr->size,
|
||||
pHdr->pFile,
|
||||
pHdr->line,
|
||||
pHdr->tick);
|
||||
pHdr = (DMH *) ellNext(pHdr);
|
||||
}
|
||||
FASTUNLOCK(&memDebugLock);
|
||||
return 0;
|
||||
|
||||
@@ -2,9 +2,9 @@ EPICS = ../../../..
|
||||
include Target.include
|
||||
include $(EPICS)/config/CONFIG_BASE
|
||||
|
||||
SRCS.c = ../epicsEnvParams.c ../epicsRelease.c
|
||||
SRCS.c = ../epicsRelease.c
|
||||
|
||||
OBJS = epicsEnvParams.o epicsRelease.o
|
||||
OBJS = epicsRelease.o
|
||||
|
||||
PROD = miscLib
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ static long get_enum_strs(paddr,pes)
|
||||
{
|
||||
struct biRecord *pbi=(struct biRecord *)paddr->precord;
|
||||
|
||||
pes->no_str = 0;
|
||||
pes->no_str = 2;
|
||||
memset(pes->strs,'\0',sizeof(pes->strs));
|
||||
strncpy(pes->strs[0],pbi->znam,sizeof(pbi->znam));
|
||||
if(*pbi->znam!=0) pes->no_str=1;
|
||||
|
||||
@@ -368,7 +368,8 @@ static long get_enum_strs(paddr,pes)
|
||||
{
|
||||
struct boRecord *pbo=(struct boRecord *)paddr->precord;
|
||||
|
||||
pes->no_str = 0;
|
||||
/*SETTING no_str=0 breaks channel access clients*/
|
||||
pes->no_str = 2;
|
||||
memset(pes->strs,'\0',sizeof(pes->strs));
|
||||
strncpy(pes->strs[0],pbo->znam,sizeof(pbo->znam));
|
||||
if(*pbo->znam!=0) pes->no_str=1;
|
||||
|
||||
@@ -43,9 +43,11 @@
|
||||
* .07 10-21-94 nda changed linear scan parameter algorithms so changing
|
||||
* start/end modifies step/width unless frozen. This
|
||||
* seems more intuitive.
|
||||
* .08 12-06-94 nda added support for .FFO .When set to 1, frzFlag values
|
||||
* are saved in recPvtStruct. Restored when FFO set to 0.
|
||||
*/
|
||||
|
||||
#define VERSION 1.07
|
||||
#define VERSION 1.08
|
||||
|
||||
|
||||
|
||||
@@ -144,6 +146,28 @@ struct recPvtStruct {
|
||||
struct p_limits *pP2Limits;
|
||||
struct p_limits *pP3Limits;
|
||||
struct p_limits *pP4Limits;
|
||||
short pffo; /* previouss state of ffo */
|
||||
short fpts; /* backup copy of all freeze flags */
|
||||
short p1fs;
|
||||
short p1fi;
|
||||
short p1fc;
|
||||
short p1fe;
|
||||
short p1fw;
|
||||
short p2fs;
|
||||
short p2fi;
|
||||
short p2fc;
|
||||
short p2fe;
|
||||
short p2fw;
|
||||
short p3fs;
|
||||
short p3fi;
|
||||
short p3fc;
|
||||
short p3fe;
|
||||
short p3fw;
|
||||
short p4fs;
|
||||
short p4fi;
|
||||
short p4fc;
|
||||
short p4fe;
|
||||
short p4fw;
|
||||
unsigned long tickStart; /* used to time the scan */
|
||||
unsigned char scanErr;
|
||||
unsigned char nptsCause; /* who caused the "# of points to change:
|
||||
@@ -208,6 +232,9 @@ static void adjLinParms();
|
||||
static void changedNpts();
|
||||
static void checkScanLimits();
|
||||
static void drawPos1Scan();
|
||||
static void saveFrzFlags();
|
||||
static void resetFrzFlags();
|
||||
static void restoreFrzFlags();
|
||||
/* variables ... */
|
||||
long scanRecDebug=0;
|
||||
long viewScanPos=0;
|
||||
@@ -286,6 +313,11 @@ static long init_record(pscan,pass)
|
||||
precPvt->nptsCause = 0; /* resolve all positioner parameters */
|
||||
changedNpts(pscan);
|
||||
|
||||
if(pscan->ffo) {
|
||||
saveFrzFlags(pscan);
|
||||
resetFrzFlags(pscan);
|
||||
}
|
||||
|
||||
/* init field values */
|
||||
pscan->exsc = 0;
|
||||
pscan->pxsc = 0;
|
||||
@@ -344,6 +376,7 @@ static long special(paddr,after)
|
||||
unsigned char prevAlrt;
|
||||
|
||||
if(!after) {
|
||||
precPvt->pffo = pscan->ffo; /* save previous ffo flag */
|
||||
return(0);
|
||||
}
|
||||
switch(special_type) {
|
||||
@@ -417,6 +450,25 @@ static long special(paddr,after)
|
||||
}
|
||||
break;
|
||||
|
||||
case(SPC_SC_FFO):
|
||||
/* Freeze Flag Override field */
|
||||
if((pscan->ffo) && (!precPvt->pffo)) {
|
||||
saveFrzFlags(pscan);
|
||||
resetFrzFlags(pscan);
|
||||
}
|
||||
else if(!pscan->ffo && precPvt->pffo) /* only on 1->0 */
|
||||
restoreFrzFlags(pscan);
|
||||
|
||||
break;
|
||||
|
||||
case(SPC_SC_F):
|
||||
/* Freeze Flag Override field */
|
||||
if(pscan->ffo)
|
||||
resetFrzFlags(pscan);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
/* recGblDbaddrError(S_db_badChoice,paddr,"scan: special");
|
||||
return(S_db_badChoice);
|
||||
@@ -1993,3 +2045,267 @@ static void drawPos1Scan(pscan)
|
||||
}
|
||||
|
||||
|
||||
static void saveFrzFlags(pscan)
|
||||
struct scanRecord *pscan;
|
||||
{
|
||||
|
||||
struct recPvtStruct *precPvt = (struct recPvtStruct *)pscan->rpvt;
|
||||
|
||||
/* save state of each freeze flag */
|
||||
precPvt->fpts = pscan->fpts;
|
||||
precPvt->p1fs = pscan->p1fs;
|
||||
precPvt->p1fi = pscan->p1fi;
|
||||
precPvt->p1fc = pscan->p1fc;
|
||||
precPvt->p1fe = pscan->p1fe;
|
||||
precPvt->p1fw = pscan->p1fw;
|
||||
precPvt->p2fs = pscan->p2fs;
|
||||
precPvt->p2fi = pscan->p2fi;
|
||||
precPvt->p2fc = pscan->p2fc;
|
||||
precPvt->p2fe = pscan->p2fe;
|
||||
precPvt->p2fw = pscan->p2fw;
|
||||
precPvt->p3fs = pscan->p3fs;
|
||||
precPvt->p3fi = pscan->p3fi;
|
||||
precPvt->p3fc = pscan->p3fc;
|
||||
precPvt->p3fe = pscan->p3fe;
|
||||
precPvt->p3fw = pscan->p3fw;
|
||||
precPvt->p4fs = pscan->p4fs;
|
||||
precPvt->p4fi = pscan->p4fi;
|
||||
precPvt->p4fc = pscan->p4fc;
|
||||
precPvt->p4fe = pscan->p4fe;
|
||||
precPvt->p4fw = pscan->p4fw;
|
||||
}
|
||||
|
||||
static void resetFrzFlags(pscan)
|
||||
struct scanRecord *pscan;
|
||||
{
|
||||
|
||||
struct recPvtStruct *precPvt = (struct recPvtStruct *)pscan->rpvt;
|
||||
|
||||
/* reset each frzFlag, post monitor if changed */
|
||||
|
||||
if(pscan->fpts) {
|
||||
pscan->fpts = 0;
|
||||
db_post_events(pscan,&pscan->fpts, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p1fs) {
|
||||
pscan->p1fs = 0;
|
||||
db_post_events(pscan,&pscan->p1fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p1fi) {
|
||||
pscan->p1fi = 0;
|
||||
db_post_events(pscan,&pscan->p1fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p1fc) {
|
||||
pscan->p1fc = 0;
|
||||
db_post_events(pscan,&pscan->p1fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p1fe) {
|
||||
pscan->p1fe = 0;
|
||||
db_post_events(pscan,&pscan->p1fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p1fw) {
|
||||
pscan->p1fw = 0;
|
||||
db_post_events(pscan,&pscan->p1fw, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p2fs) {
|
||||
pscan->p2fs = 0;
|
||||
db_post_events(pscan,&pscan->p2fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p2fi) {
|
||||
pscan->p2fi = 0;
|
||||
db_post_events(pscan,&pscan->p2fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p2fc) {
|
||||
pscan->p2fc = 0;
|
||||
db_post_events(pscan,&pscan->p2fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p2fe) {
|
||||
pscan->p2fe = 0;
|
||||
db_post_events(pscan,&pscan->p2fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p2fw) {
|
||||
pscan->p2fw = 0;
|
||||
db_post_events(pscan,&pscan->p2fw, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p3fs) {
|
||||
pscan->p3fs = 0;
|
||||
db_post_events(pscan,&pscan->p3fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p3fi) {
|
||||
pscan->p3fi = 0;
|
||||
db_post_events(pscan,&pscan->p3fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p3fc) {
|
||||
pscan->p3fc = 0;
|
||||
db_post_events(pscan,&pscan->p3fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p3fe) {
|
||||
pscan->p3fe = 0;
|
||||
db_post_events(pscan,&pscan->p3fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p3fw) {
|
||||
pscan->p3fw = 0;
|
||||
db_post_events(pscan,&pscan->p3fw, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p4fs) {
|
||||
pscan->p4fs = 0;
|
||||
db_post_events(pscan,&pscan->p4fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p4fi) {
|
||||
pscan->p4fi = 0;
|
||||
db_post_events(pscan,&pscan->p4fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p4fc) {
|
||||
pscan->p4fc = 0;
|
||||
db_post_events(pscan,&pscan->p4fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p4fe) {
|
||||
pscan->p4fe = 0;
|
||||
db_post_events(pscan,&pscan->p4fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
if(pscan->p4fw) {
|
||||
pscan->p4fw = 0;
|
||||
db_post_events(pscan,&pscan->p4fw, DBE_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Restores Freeze Flags to the state they were in */
|
||||
static void restoreFrzFlags(pscan)
|
||||
struct scanRecord *pscan;
|
||||
{
|
||||
|
||||
struct recPvtStruct *precPvt = (struct recPvtStruct *)pscan->rpvt;
|
||||
|
||||
/* restore state of each freeze flag, post if changed */
|
||||
pscan->fpts = precPvt->fpts;
|
||||
if(pscan->fpts) {
|
||||
db_post_events(pscan,&pscan->fpts, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p1fs = precPvt->p1fs;
|
||||
if(pscan->p1fs) {
|
||||
db_post_events(pscan,&pscan->p1fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p1fi = precPvt->p1fi;
|
||||
if(pscan->p1fi) {
|
||||
db_post_events(pscan,&pscan->p1fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p1fc = precPvt->p1fc;
|
||||
if(pscan->p1fc) {
|
||||
db_post_events(pscan,&pscan->p1fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p1fe = precPvt->p1fe;
|
||||
if(pscan->p1fe) {
|
||||
db_post_events(pscan,&pscan->p1fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p1fw = precPvt->p1fw;
|
||||
if(pscan->p1fw) {
|
||||
db_post_events(pscan,&pscan->p1fw, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p2fs = precPvt->p2fs;
|
||||
if(pscan->p2fs) {
|
||||
db_post_events(pscan,&pscan->p2fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p2fi = precPvt->p2fi;
|
||||
if(pscan->p2fi) {
|
||||
db_post_events(pscan,&pscan->p2fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p2fc = precPvt->p2fc;
|
||||
if(pscan->p2fc) {
|
||||
db_post_events(pscan,&pscan->p2fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p2fe = precPvt->p2fe;
|
||||
if(pscan->p2fe) {
|
||||
db_post_events(pscan,&pscan->p2fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p2fw = precPvt->p2fw;
|
||||
if(pscan->p2fw) {
|
||||
db_post_events(pscan,&pscan->p2fw, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p3fs = precPvt->p3fs;
|
||||
if(pscan->p3fs) {
|
||||
db_post_events(pscan,&pscan->p3fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p3fi = precPvt->p3fi;
|
||||
if(pscan->p3fi) {
|
||||
db_post_events(pscan,&pscan->p3fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p3fc = precPvt->p3fc;
|
||||
if(pscan->p3fc) {
|
||||
db_post_events(pscan,&pscan->p3fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p3fe = precPvt->p3fe;
|
||||
if(pscan->p3fe) {
|
||||
db_post_events(pscan,&pscan->p3fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p3fw = precPvt->p3fw;
|
||||
if(pscan->p3fw) {
|
||||
db_post_events(pscan,&pscan->p3fw, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p4fs = precPvt->p4fs;
|
||||
if(pscan->p4fs) {
|
||||
db_post_events(pscan,&pscan->p4fs, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p4fi = precPvt->p4fi;
|
||||
if(pscan->p4fi) {
|
||||
db_post_events(pscan,&pscan->p4fi, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p4fc = precPvt->p4fc;
|
||||
if(pscan->p4fc) {
|
||||
db_post_events(pscan,&pscan->p4fc, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p4fe = precPvt->p4fe;
|
||||
if(pscan->p4fe) {
|
||||
db_post_events(pscan,&pscan->p4fe, DBE_VALUE);
|
||||
}
|
||||
|
||||
pscan->p4fw = precPvt->p4fw;
|
||||
if(pscan->p4fw) {
|
||||
db_post_events(pscan,&pscan->p4fw, DBE_VALUE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1270,13 +1270,15 @@ void *devLibA24Malloc(size_t size)
|
||||
void *ret;
|
||||
|
||||
if (devLibA24Debug)
|
||||
printf("devLibA24Malloc(%d) entered\n", size);
|
||||
logMsg("devLibA24Malloc(%d) entered\n", size, 0,0,0,0,0);
|
||||
|
||||
if (A24MallocFunc == NULL)
|
||||
{
|
||||
/* See if the sysA24Malloc() function is present. */
|
||||
if(symFindByName(sysSymTbl,"_sysA24Malloc", (char**)&A24MallocFunc,&stype)==ERROR)
|
||||
{ /* Could not find sysA24Malloc... use the malloc one and hope we are OK */
|
||||
if (devLibA24Debug)
|
||||
logMsg("devLibA24Malloc() using regular malloc\n",0,0,0,0,0,0);
|
||||
A24MallocFunc = malloc;
|
||||
A24FreeFunc = free;
|
||||
}
|
||||
@@ -1284,6 +1286,8 @@ void *devLibA24Malloc(size_t size)
|
||||
{
|
||||
if(symFindByName(sysSymTbl,"_sysA24Free", (char**)&A24FreeFunc, &stype) == ERROR)
|
||||
{ /* That's strange... we have malloc, but no free! */
|
||||
if (devLibA24Debug)
|
||||
logMsg("devLibA24Malloc() using regular malloc\n",0,0,0,0,0,0);
|
||||
A24MallocFunc = malloc;
|
||||
A24FreeFunc = free;
|
||||
}
|
||||
@@ -1301,5 +1305,8 @@ void *devLibA24Malloc(size_t size)
|
||||
|
||||
void devLibA24Free(void *pBlock)
|
||||
{
|
||||
if (devLibA24Debug)
|
||||
logMsg("devLibA24Free(%p) entered\n", (unsigned long)pBlock,0,0,0,0,0);
|
||||
|
||||
A24FreeFunc(pBlock);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.4 1994/10/28 20:15:10 jbk
|
||||
* increased the USP packet time-out to 250ms, added a parm to the configure()
|
||||
* routine to let user specify it.
|
||||
*
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
@@ -653,7 +657,23 @@ static void TSerrorHandler(int Card, int ErrorNum)
|
||||
Could put the slave on the vxworks timer until next sync
|
||||
*/
|
||||
|
||||
logMsg("***TSerrorHandler: error number %d=n",ErrorNum,0,0,0,0,0);
|
||||
if(MAKE_DEBUG)
|
||||
{
|
||||
switch(ErrorNum)
|
||||
{
|
||||
case 1:
|
||||
logMsg("***TSerrorHandler: event system error: TAXI violation",0,0,0,0,0,0);
|
||||
break;
|
||||
case 2:
|
||||
logMsg("***TSerrorHandler: event system error: lost heartbeat",0,0,0,0,0,0);
|
||||
break;
|
||||
case 3:
|
||||
logMsg("***TSerrorHandler: event system error: lost events",0,0,0,0,0,0);
|
||||
break;
|
||||
default:
|
||||
logMsg("***TSerrorHandler: unknown error %d from event system", ErrorNum,0,0,0,0,0);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,8 +139,10 @@ int GI(void)
|
||||
for (cnt=0; cnt < LIST_SIZE; cnt++)
|
||||
{ /* init the elements of the command table */
|
||||
|
||||
#if 0
|
||||
gpibIntCmds[cnt].head.header.list.list1 = NULL;
|
||||
gpibIntCmds[cnt].head.header.list.list2 = NULL;
|
||||
#endif
|
||||
gpibIntCmds[cnt].head.workStart = gpibWork;
|
||||
gpibIntCmds[cnt].head.link = 0;
|
||||
gpibIntCmds[cnt].head.device = 0;
|
||||
@@ -155,7 +157,7 @@ int GI(void)
|
||||
}
|
||||
|
||||
ans = 0; /* set loop not to exit */
|
||||
printf("\n\n");
|
||||
logMsg("\n\n");
|
||||
|
||||
while ((ans != 'q') && (ans != 'Q'))
|
||||
{
|
||||
@@ -380,6 +382,8 @@ static int sendMsg(void)
|
||||
|
||||
if (replyIsBack)
|
||||
{
|
||||
if (ibDebug)
|
||||
taskDelay(60); /* Allow debug printing to complete */
|
||||
showGpibMsg(msgNum);
|
||||
}
|
||||
else
|
||||
@@ -438,7 +442,7 @@ static int gpibWork(struct gpibIntCmd *pCmd)
|
||||
}
|
||||
else if (status > (MAX_MSG_LENGTH - 1)) /* check length of resp */
|
||||
{
|
||||
printf("GPIB Response length equaled allocated space !!!\n");
|
||||
logMsg("GPIB Response length equaled allocated space !!!\n");
|
||||
pCmd->resp[(MAX_MSG_LENGTH)] = '\0'; /* place \0 at end */
|
||||
}
|
||||
else
|
||||
|
||||
@@ -391,8 +391,8 @@ STATIC int srqHandler(struct hwpvt *phwpvt, int srqStatus)
|
||||
printf("dc5009 srqHandler: Unsolicited SRQ being handled from link %d, device %d, status = 0x%02.2X\n",
|
||||
phwpvt->link, phwpvt->device, srqStatus);
|
||||
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.header.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.header.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
callbackRequest((CALLBACK*)phwpvt->unsolicitedDpvt);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -404,9 +404,9 @@ STATIC int srqHandler(struct hwpvt *phwpvt, int srqStatus)
|
||||
printf("dc5009 srqHandler: Unsolicited SRQ being handled from link %d, device %d, status = 0x%02.2X\n",
|
||||
phwpvt->link, phwpvt->device, srqStatus);
|
||||
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.header.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.header.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
callbackRequest(phwpvt->unsolicitedDpvt);
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
callbackRequest((CALLBACK*)phwpvt->unsolicitedDpvt);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -282,8 +282,8 @@ STATIC int srqHandler(struct hwpvt *phwpvt, int srqStatus)
|
||||
logMsg("Unsolicited SRQ being handled from link %d, device %d, status = 0x%02.2X\n",
|
||||
phwpvt->link, phwpvt->device, srqStatus);
|
||||
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.header.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.header.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
((struct gpibDpvt*)(phwpvt->unsolicitedDpvt))->head.callback.callback = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->process;
|
||||
((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->head.callback.priority = ((struct gpibDpvt *)(phwpvt->unsolicitedDpvt))->processPri;
|
||||
callbackRequest((CALLBACK*)phwpvt->unsolicitedDpvt);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user