Compare commits

...

17 Commits

Author SHA1 Message Date
Jim Kowalkowski
a655930baf added ability to include files without substitution in the pattern file. 1995-04-07 11:50:21 +00:00
Jeff Hill
84773e71a0 init unintialized (and unused) fields in the protocol 1995-04-06 17:11:02 +00:00
Jeff Hill
214b9ae5c1 Use copyin structure to avoid VAX fp except when ieee is in VAX fp type
- also use dbr_ types
1995-04-06 17:06:14 +00:00
Jeff Hill
420249caac removed USEC_PER_SEC def 1995-04-06 17:01:52 +00:00
Jeff Hill
17a0f487a8 Increment the search resp count 1995-04-06 16:53:28 +00:00
Jeff Hill
bbfcd9ff78 Use dbr_ types 1995-04-06 16:51:20 +00:00
Jeff Hill
b9dc0dad91 added caIOBlockListFree() declaration 1995-04-06 16:49:51 +00:00
Jeff Hill
50be068a02 free outstanding get/put cb requests when the IOC disconnects 1995-04-06 16:47:41 +00:00
Jeff Hill
a90bdf0098 exponentially increase delay between search requests only when we get
no responses
1995-04-06 16:33:02 +00:00
Jeff Hill
a58a2439cd removed debug code (that was already commented out) 1995-04-06 16:28:45 +00:00
Jeff Hill
962b520be8 removed unused variables 1995-04-06 16:25:09 +00:00
Jeff Hill
6747d4e0e9 restored call to ca_flush_io() in ca_pend_event()
also now uses caIOBlockListFree()
1995-04-06 16:00:31 +00:00
Jeff Hill
043eeb6a7c added ASSERTUNIX 1995-04-06 15:48:52 +00:00
Janet B. Anderson
6b50908dd6 Portability changes. 1995-04-05 15:52:30 +00:00
Jim Kowalkowski
2d9514e8ad updated to use the new db format without the database() section 1995-04-05 15:28:03 +00:00
John Winans
2e7e1416d3 Only do a sysIntEnable() for those cards that are found with the probe. 1995-04-05 14:13:43 +00:00
cvs2svn
ed2f5648b2 This commit was manufactured by cvs2svn to create tag 'R3.12.0-beta11'. 1995-03-31 15:05:08 +00:00
17 changed files with 305 additions and 307 deletions

View File

@@ -73,6 +73,7 @@ BUCKETLIB, -
ENVSUBR, -
TSSUBR, -
NEXTFIELDSUBR, -
ASSERTUNIX, -
CATIME, -
ACCTST
$ endif
@@ -96,6 +97,7 @@ BUCKETLIB, -
TSSUBR, -
ENVSUBR, -
NEXTFIELDSUBR, -
ASSERTUNIX, -
ELLLIB
$! Link the test programs
$ call link acctst

View File

@@ -316,20 +316,13 @@ void *pext
* we can time out
*/
if (bytesAvailable>=extsize+sizeof(msg)) {
# if DEBUG
If (piiu->sendPending) {
printf ("-Unblocked-\n");
}
# endif /* DEBUG */
piiu->sendPending = FALSE;
break;
}
else {
if (!piiu->sendPending) {
# if DEBUG
printf ("-Blocked-\n");
# endif /* DEBUG */
piiu->timeAtSendBlock = ca_static->currentTime;
piiu->timeAtSendBlock =
ca_static->currentTime;
piiu->sendPending = TRUE;
}
}
@@ -506,6 +499,7 @@ int ca_os_independent_init (void)
* init broadcasted search counters
*/
ca_static->ca_search_retry = 0;
ca_static->ca_search_responses = 0;
ca_static->ca_conn_next_retry = CA_CURRENT_TIME;
sec = (unsigned) CA_RECAST_DELAY;
ca_static->ca_conn_retry_delay.tv_sec = sec;
@@ -761,8 +755,6 @@ void ca_process_exit()
{
chid chix;
chid chixNext;
evid monix;
evid monixNext;
IIU *piiu;
int status;
@@ -823,20 +815,10 @@ void ca_process_exit()
}
/* remove any pending read blocks */
monix = (evid) ellFirst(&ca_static->ca_pend_read_list);
while (monix) {
monixNext = (evid) ellNext (&monix->node);
caIOBlockFree (monix);
monix = monixNext;
}
caIOBlockListFree (&ca_static->ca_pend_read_list, NULL, FALSE, ECA_INTERNAL);
/* remove any pending write blocks */
monix = (evid) ellFirst(&ca_static->ca_pend_write_list);
while (monix) {
monixNext = (evid) ellNext (&monix->node);
caIOBlockFree (monix);
monix = monixNext;
}
caIOBlockListFree (&ca_static->ca_pend_write_list, NULL, FALSE, ECA_INTERNAL);
/* remove any pending io event blocks */
ellFree(&ca_static->ca_ioeventlist);
@@ -1357,6 +1339,46 @@ void caIOBlockFree(evid pIOBlock)
UNLOCK;
}
/*
* Free all io blocks on the list attached to the specified channel
*/
void caIOBlockListFree(
ELLLIST *pList,
chid chan,
int cbRequired,
int status)
{
evid monix;
evid next;
struct event_handler_args args;
for (monix = (evid) ellFirst (pList);
monix;
monix = next) {
next = (evid) ellNext (&monix->node);
if (chan == NULL || monix->chan == chan) {
ellDelete (pList, &monix->node);
args.usr = monix->usr_arg;
args.chid = monix->chan;
args.type = monix->type;
args.count = monix->count;
args.status = status;
args.dbr = NULL;
caIOBlockFree (monix);
if (cbRequired) {
(*monix->usr_func) (args);
}
}
}
}
/*
*
@@ -1755,11 +1777,11 @@ void *pvalue
break;
case DBR_FLOAT:
htonf(pvalue, pdest);
dbr_htonf(pvalue, pdest);
break;
case DBR_DOUBLE:
htond(pvalue, pdest);
dbr_htond(pvalue, pdest);
break;
case DBR_STRING:
@@ -2177,9 +2199,9 @@ int ca_request_event(evid monix)
p_delta = (ca_float32_t) monix->p_delta;
n_delta = (ca_float32_t) monix->n_delta;
tmo = (ca_float32_t) monix->timeout;
htonf(&p_delta, &msg.m_info.m_hval);
htonf(&n_delta, &msg.m_info.m_lval);
htonf(&tmo, &msg.m_info.m_toval);
dbr_htonf(&p_delta, &msg.m_info.m_hval);
dbr_htonf(&n_delta, &msg.m_info.m_lval);
dbr_htonf(&tmo, &msg.m_info.m_toval);
msg.m_info.m_mask = htons(monix->mask);
msg.m_info.m_pad = 0; /* allow future use */
@@ -2565,8 +2587,6 @@ void clearChannelResources(unsigned id)
{
struct ioc_in_use *piiu;
chid chix;
evid monix;
evid next;
int status;
LOCK;
@@ -2577,27 +2597,20 @@ void clearChannelResources(unsigned id)
piiu = chix->piiu;
/*
* remove any orphaned get callbacks for this
* channel
* remove any orphaned get callbacks for this channel
*/
for (monix = (evid) ellFirst (&ca_static->ca_pend_read_list);
monix;
monix = next) {
next = (evid) ellNext (&monix->node);
if (monix->chan == chix) {
ellDelete (
&ca_static->ca_pend_read_list,
&monix->node);
caIOBlockFree (monix);
}
}
for (monix = (evid) ellFirst (&chix->eventq);
monix;
monix = next){
assert (monix->chan == chix);
next = (evid) ellNext (&monix->node);
caIOBlockFree(monix);
}
caIOBlockListFree (&ca_static->ca_pend_read_list, chix, FALSE, ECA_INTERNAL);
/*
* remove any orphaned put callbacks for this channel
*/
caIOBlockListFree (&ca_static->ca_pend_write_list, chix, FALSE, ECA_INTERNAL);
/*
* remove any monitors still attached to this channel
*/
caIOBlockListFree (&chix->eventq, NULL, FALSE, ECA_INTERNAL);
ellDelete (&piiu->chidlist, &chix->node);
status = bucketRemoveItemUnsignedId (
ca_static->ca_pSlowBucket, &chix->cid);
@@ -2610,6 +2623,7 @@ void clearChannelResources(unsigned id)
UNLOCK;
}
/************************************************************************/
/* This routine pends waiting for channel events and calls the */
@@ -2636,13 +2650,13 @@ int APIENTRY ca_pend(ca_real timeout, int early)
/*
* Flush the send buffers
* (guarantees that we wait for all send buffer to be
* flushed even if this requires blocking)
*
* Also takes care of outstanding recvs
* for single threaded clients
*/
#if 0
ca_flush_io();
#endif
if(pndrecvcnt<1 && early){
return ECA_NORMAL;

View File

@@ -99,23 +99,6 @@ int cac_select_io(struct timeval *ptimeout, int flags)
}
UNLOCK;
# if 0
if (maxfd==0) {
printf( "max fd=%d tv_usec=%d tv_sec=%d\n",
maxfd,
ptimeout->tv_usec,
ptimeout->tv_sec);
}
# endif
# if 0 && defined(vxWorks)
if(client_lock->recurse>0){
ca_printf("lock is on and we are going to sleep %d!",
client_lock->recurse);
taskSuspend(0);
}
# endif
# if defined(__hpux)
status = select(
maxfd+1,
@@ -132,16 +115,6 @@ int cac_select_io(struct timeval *ptimeout, int flags)
&autoTimeOut);
# endif
# if 0
if(status<0){
printf("leaving select stat=%d - %s \n",
status, strerror(MYERRNO) );
}
else if (status==0) {
printf("tmo in select\n");
}
# endif
cac_gettimeval (&ca_static->currentTime);
if (status<0) {

View File

@@ -47,11 +47,11 @@ static char *sccsId = "@(#) $Id$";
#ifdef DEBUG
#define LOGRETRYINTERVAL logRetryInterval(__FILE__, __LINE__);
LOCAL void logRetryInterval(char *pFN, unsigned lineno);
#else
#define LOGRETRYINTERVAL
#endif
LOCAL void logRetryInterval(char *pFN, unsigned lineno);
LOCAL void retrySearchRequest(int silent);
@@ -275,8 +275,10 @@ LOCAL void retrySearchRequest (int silent)
if (chix==NULL) {
/*
* increment the retry sequence number
* (only if we get no responses during a sequence)
*/
if (ca_static->ca_search_retry<MAXCONNTRIES) {
if (ca_static->ca_search_retry<MAXCONNTRIES
&& ca_static->ca_search_responses==0) {
ca_static->ca_search_retry++;
}
@@ -285,6 +287,7 @@ LOCAL void retrySearchRequest (int silent)
*/
if (ca_static->ca_search_retry<min_retry_num) {
ca_static->ca_search_retry = min_retry_num;
ca_static->ca_search_responses = 0;
}
}

View File

@@ -131,20 +131,11 @@ CACVRTFUNC *cac_dbr_cvrt[]
cvrt_ctrl_double
};
/*
* Native types may not match EPICS types
*/
typedef short ca_short_tt;
typedef float ca_float_tt;
typedef short ca_enum_tt;
typedef char ca_char_tt;
typedef int ca_long_tt;
typedef double ca_double_tt;
#define dbr_ntohs(A) ntohs(A)
#define dbr_ntohl(A) ntohl(A)
#define dbr_htons(A) htons(A)
#define dbr_htonl(A) htonl(A)
#define dbr_ntohs(A) (ntohs(A))
#define dbr_ntohl(A) (ntohl(A))
#define dbr_htons(A) (htons(A))
#define dbr_htonl(A) (htonl(A))
@@ -162,8 +153,8 @@ int encode, /* cvrt HOST to NET if T */
unsigned long num /* number of values */
)
{
ca_char_tt *pSrc = s;
ca_char_tt *pDest = d;
char *pSrc = s;
char *pDest = d;
if(num == 1){
strcpy(pDest, pSrc);
@@ -188,8 +179,8 @@ int encode, /* cvrt HOST to NET if T */
unsigned long num /* number of values */
)
{
ca_short_tt *pSrc = s;
ca_short_tt *pDest = d;
dbr_short_t *pSrc = s;
dbr_short_t *pDest = d;
unsigned long i;
for(i=0; i<num; i++){
@@ -218,8 +209,8 @@ unsigned long num /* number of values */
)
{
unsigned long i;
ca_char_tt *pSrc = s;
ca_char_tt *pDest = d;
dbr_char_t *pSrc = s;
dbr_char_t *pDest = d;
for(i=0; i<num; i++){
*pDest++ = *pSrc++;
@@ -242,8 +233,8 @@ unsigned long num /* number of values */
)
{
unsigned long i;
ca_long_tt *pSrc = s;
ca_long_tt *pDest = d;
dbr_long_t *pSrc = s;
dbr_long_t *pDest = d;
for(i=0; i<num; i++){
*pDest = dbr_ntohl( *pSrc );
@@ -271,8 +262,8 @@ unsigned long num /* number of values */
)
{
unsigned long i;
ca_enum_tt *pSrc;
ca_enum_tt *pDest;
dbr_enum_t *pSrc;
dbr_enum_t *pDest;
pSrc = s;
pDest = d;
@@ -304,15 +295,15 @@ unsigned long num /* number of values */
)
{
unsigned long i;
ca_float_tt *pSrc = s;
ca_float_tt *pDest = d;
dbr_float_t *pSrc = s;
dbr_float_t *pDest = d;
for(i=0; i<num; i++){
if(encode){
htonf(pSrc, pDest);
dbr_htonf(pSrc, pDest);
}
else{
ntohf(pSrc, pDest);
dbr_ntohf(pSrc, pDest);
}
/*
* dont increment these inside the MACRO
@@ -338,15 +329,15 @@ unsigned long num /* number of values */
)
{
unsigned long i;
ca_double_tt *pSrc = s;
ca_double_tt *pDest = d;
dbr_double_t *pSrc = s;
dbr_double_t *pDest = d;
for(i=0; i<num; i++){
if(encode){
htond(pSrc,pDest);
dbr_htond(pSrc,pDest);
}
else{
ntohd(pSrc,pDest);
dbr_ntohd(pSrc,pDest);
}
/*
* dont increment these inside the MACRO
@@ -697,32 +688,32 @@ unsigned long num /* number of values */
if (encode) /* vax to ieee convert */
{
if (num == 1){
htond(&pSrc->value, &pDest->value);
dbr_htond(&pSrc->value, &pDest->value);
}
else {
cvrt_double(&pSrc->value, &pDest->value, encode,num);
}
htond(&pSrc->upper_disp_limit,&pDest->upper_disp_limit);
htond(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
htond(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
htond(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
htond(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
htond(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
dbr_htond(&pSrc->upper_disp_limit,&pDest->upper_disp_limit);
dbr_htond(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
dbr_htond(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
dbr_htond(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
dbr_htond(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
dbr_htond(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
}
else /* ieee to vax convert */
{
if (num == 1){
ntohd(&pSrc->value, &pDest->value);
dbr_ntohd(&pSrc->value, &pDest->value);
}
else {
cvrt_double(&pSrc->value, &pDest->value, encode,num);
}
ntohd(&pSrc->upper_disp_limit,&pDest->upper_disp_limit);
ntohd(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
ntohd(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
ntohd(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
ntohd(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
ntohd(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
dbr_ntohd(&pSrc->upper_disp_limit,&pDest->upper_disp_limit);
dbr_ntohd(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
dbr_ntohd(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
dbr_ntohd(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
dbr_ntohd(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
dbr_ntohd(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
}
}
@@ -760,32 +751,32 @@ unsigned long num /* number of values */
if (encode) /* vax to ieee convert */
{
if (num == 1){
htonf(&pSrc->value, &pDest->value);
dbr_htonf(&pSrc->value, &pDest->value);
}
else {
cvrt_float(&pSrc->value, &pDest->value, encode,num);
}
htonf(&pSrc->upper_disp_limit,&pDest->upper_disp_limit);
htonf(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
htonf(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
htonf(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
htonf(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
htonf(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
dbr_htonf(&pSrc->upper_disp_limit,&pDest->upper_disp_limit);
dbr_htonf(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
dbr_htonf(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
dbr_htonf(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
dbr_htonf(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
dbr_htonf(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
}
else /* ieee to vax convert */
{
if (num == 1){
ntohf(&pSrc->value, &pDest->value);
dbr_ntohf(&pSrc->value, &pDest->value);
}
else {
cvrt_float(&pSrc->value, &pDest->value, encode,num);
}
ntohf(&pSrc->upper_disp_limit,&pDest->upper_disp_limit);
ntohf(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
ntohf(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
ntohf(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
ntohf(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
ntohf(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
dbr_ntohf(&pSrc->upper_disp_limit,&pDest->upper_disp_limit);
dbr_ntohf(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
dbr_ntohf(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
dbr_ntohf(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
dbr_ntohf(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
dbr_ntohf(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
}
}
@@ -934,7 +925,7 @@ unsigned long num /* number of values */
struct dbr_ctrl_double *pSrc = s;
struct dbr_ctrl_double *pDest = d;
/* these are the same for ieee to vaax or vax to ieee */
/* these are the same for ieee to vax or vax to ieee */
pDest->status = dbr_ntohs(pSrc->status);
pDest->severity = dbr_ntohs(pSrc->severity);
pDest->precision = dbr_ntohs(pSrc->precision);
@@ -942,35 +933,36 @@ unsigned long num /* number of values */
if (encode) /* vax to ieee convert */
{
if (num == 1){
htond(&pSrc->value, &pDest->value);
dbr_htond(&pSrc->value, &pDest->value);
}
else {
cvrt_double(&pSrc->value, &pDest->value, encode, num);
}
htond(&pSrc->upper_disp_limit,&pDest->upper_disp_limit);
htond(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
htond(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
htond(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
htond(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
htond(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
htond(&pSrc->lower_ctrl_limit, &pDest->lower_ctrl_limit);
htond(&pSrc->upper_ctrl_limit, &pDest->upper_ctrl_limit);
dbr_htond(&pSrc->upper_disp_limit,&pDest->upper_disp_limit);
dbr_htond(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
dbr_htond(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
dbr_htond(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
dbr_htond(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
dbr_htond(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
dbr_htond(&pSrc->lower_ctrl_limit, &pDest->lower_ctrl_limit);
dbr_htond(&pSrc->upper_ctrl_limit, &pDest->upper_ctrl_limit);
}
else /* ieee to vax convert */
{
if (num == 1){
ntohd(&pSrc->value, &pDest->value);
dbr_ntohd(&pSrc->value, &pDest->value);
}
else {
cvrt_double(&pSrc->value, &pDest->value, encode, num);
}
ntohd(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
ntohd(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
ntohd(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
ntohd(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
ntohd(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
ntohd(&pSrc->lower_ctrl_limit, &pDest->lower_ctrl_limit);
ntohd(&pSrc->upper_ctrl_limit, &pDest->upper_ctrl_limit);
dbr_ntohd(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
dbr_ntohd(&pSrc->upper_disp_limit, &pDest->upper_disp_limit);
dbr_ntohd(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
dbr_ntohd(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
dbr_ntohd(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
dbr_ntohd(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
dbr_ntohd(&pSrc->lower_ctrl_limit, &pDest->lower_ctrl_limit);
dbr_ntohd(&pSrc->upper_ctrl_limit, &pDest->upper_ctrl_limit);
}
}
@@ -1006,35 +998,36 @@ unsigned long num /* number of values */
if (encode) /* vax to ieee convert */
{
if (num == 1){
htonf(&pSrc->value, &pDest->value);
dbr_htonf(&pSrc->value, &pDest->value);
}
else {
cvrt_float(&pSrc->value, &pDest->value, encode, num);
}
htonf(&pSrc->upper_disp_limit,&pDest->upper_disp_limit);
htonf(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
htonf(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
htonf(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
htonf(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
htonf(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
htonf(&pSrc->lower_ctrl_limit, &pDest->lower_ctrl_limit);
htonf(&pSrc->upper_ctrl_limit, &pDest->upper_ctrl_limit);
dbr_htonf(&pSrc->upper_disp_limit,&pDest->upper_disp_limit);
dbr_htonf(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
dbr_htonf(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
dbr_htonf(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
dbr_htonf(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
dbr_htonf(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
dbr_htonf(&pSrc->lower_ctrl_limit, &pDest->lower_ctrl_limit);
dbr_htonf(&pSrc->upper_ctrl_limit, &pDest->upper_ctrl_limit);
}
else /* ieee to vax convert */
{
if (num == 1){
ntohf(&pSrc->value, &pDest->value);
dbr_ntohf(&pSrc->value, &pDest->value);
}
else {
cvrt_float(&pSrc->value, &pDest->value, encode, num);
}
ntohf(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
ntohf(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
ntohf(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
ntohf(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
ntohf(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
ntohf(&pSrc->lower_ctrl_limit, &pDest->lower_ctrl_limit);
ntohf(&pSrc->upper_ctrl_limit, &pDest->upper_ctrl_limit);
dbr_ntohf(&pSrc->lower_disp_limit, &pDest->lower_disp_limit);
dbr_ntohf(&pSrc->upper_disp_limit, &pDest->upper_disp_limit);
dbr_ntohf(&pSrc->upper_alarm_limit, &pDest->upper_alarm_limit);
dbr_ntohf(&pSrc->upper_warning_limit, &pDest->upper_warning_limit);
dbr_ntohf(&pSrc->lower_alarm_limit, &pDest->lower_alarm_limit);
dbr_ntohf(&pSrc->lower_warning_limit, &pDest->lower_warning_limit);
dbr_ntohf(&pSrc->lower_ctrl_limit, &pDest->lower_ctrl_limit);
dbr_ntohf(&pSrc->upper_ctrl_limit, &pDest->upper_ctrl_limit);
}
}
@@ -1408,17 +1401,25 @@ struct mitdbl {
#define DBLEXPMAXMIT 126 /* max MIT exponent */
#define DBLEXPMINMIT -128 /* min MIT exponent */
void htond(double *pHost, double *pNet)
/*
* Converts VAX D floating point to IEEE double precision
* (D floating is the VAX C default)
*/
void dbr_htond(dbr_double_t *pHost, dbr_double_t *pNet)
{
double copyin;
dbr_double_t copyin;
struct mitdbl *pMIT;
struct ieeedbl *pIEEE;
ca_uint32_t *ptmp;
ca_uint32_t tmp;
/*
* Use internal buffer so the src and dest ptr
* can be identical
*/
copyin = *pHost;
pMIT = (struct mitdbl *)&copyin;
pIEEE = (struct ieeedbl *)pNet;
pMIT = (struct mitdbl *) &copyin;
pIEEE = (struct ieeedbl *) pNet;
if( ((int)pMIT->exp) < (DBLEXPMINMIT+MIT_DBL_SB) ){
pIEEE->mant1 = 0;
@@ -1438,34 +1439,43 @@ void htond(double *pHost, double *pNet)
* byte swap to net order
*/
ptmp = (ca_uint32_t *) pNet;
tmp = htonl(ptmp[0]);
ptmp[0] = htonl(ptmp[1]);
tmp = dbr_htonl(ptmp[0]);
ptmp[0] = dbr_htonl(ptmp[1]);
ptmp[1] = tmp;
}
/*
* Converts IEEE double precision to VAX D floating point
* (D floating is the VAX default)
*
* sign must be forced to zero if the exponent is zero to prevent a reserved
* operand fault- joh 9-13-90
*/
void ntohd(double *pNet, double *pHost)
void dbr_ntohd(dbr_double_t *pNet, dbr_double_t *pHost)
{
double copyin;
struct ieeedbl copyin;
struct mitdbl *pMIT;
struct ieeedbl *pIEEE;
ca_uint32_t *ptmp;
ca_uint32_t tmp;
copyin = *pNet;
pIEEE = (struct ieeedbl *)pNet;
pMIT = (struct mitdbl *)pHost;
pIEEE = (struct ieeedbl *)&copyin;
/*
* Use internal buffer so the src and dest ptr
* can be identical
*/
copyin = *pIEEE;
pIEEE = &copyin;
/*
* Byte swap from net order to host order
*/
ptmp = (ca_uint32_t *) pIEEE;
tmp = htonl(ptmp[0]);
ptmp[0] = htonl(ptmp[1]);
tmp = dbr_htonl(ptmp[0]);
ptmp[0] = dbr_htonl(ptmp[1]);
ptmp[1] = tmp;
if( ((int)pIEEE->exp) > (DBLEXPMAXMIT + IEEE_DBL_SB) ){
@@ -1527,10 +1537,14 @@ struct mitflt{
# define EXPMAXMIT 126 /* max MIT exponent */
# define EXPMINMIT -128 /* min MIT exponent */
/* (this includes mapping of fringe reals to zero or infinity) */
/* (byte swaps included in conversion */
void htonf(float *pHost, float *pNet)
/*
* (this includes mapping of fringe reals to zero or infinity)
* (byte swaps included in conversion
*
* Uses internal buffer so the src and dest ptr
* can be identical
*/
void dbr_htonf(dbr_float_t *pHost, dbr_float_t *pNet)
{
struct mitflt *pMIT = (struct mitflt *) pHost;
struct ieeeflt *pIEEE = (struct ieeeflt *) pNet;
@@ -1550,21 +1564,24 @@ void htonf(float *pHost, float *pNet)
pIEEE->mant = mant;
pIEEE->exp = exp;
pIEEE->sign = sign;
*(ca_uint32_t *)pIEEE = htonl(*(ca_uint32_t *)pIEEE);
*(ca_uint32_t *)pIEEE = dbr_htonl(*(ca_uint32_t *)pIEEE);
}
/*
* sign must be forced to zero if the exponent is zero to prevent a reserved
* operand fault- joh 9-13-90
*
* Uses internal buffer so the src and dest ptr
* can be identical
*/
void ntohf(float *pNet, float *pHost)
void dbr_ntohf(dbr_float_t *pNet, dbr_float_t *pHost)
{
struct mitflt *pMIT = (struct mitflt *) pHost;
struct ieeeflt *pIEEE = (struct ieeeflt *) pNet;
long exp,mant2,mant1,sign;
*(ca_uint32_t *)pIEEE = ntohl(*(ca_uint32_t *)pIEEE);
*(ca_uint32_t *)pIEEE = dbr_ntohl(*(ca_uint32_t *)pIEEE);
if( ((int)pIEEE->exp) > EXPMAXMIT + IEEE_SB){
sign = pIEEE->sign;
exp = EXPMAXMIT + MIT_SB;
@@ -1595,10 +1612,10 @@ void ntohf(float *pNet, float *pHost)
#if defined(CA_FLOAT_IEEE) && 0
/*
* htond ()
* dbr_htond ()
* performs only byte swapping
*/
void htond (double *IEEEhost, double *IEEEnet)
void dbr_htond (dbr_double_t *IEEEhost, dbr_double_t *IEEEnet)
{
#ifdef CA_LITTLE_ENDIAN
ca_uint32_t *pHost = (ca_uint32_t *) IEEEhost;
@@ -1611,18 +1628,18 @@ void htond (double *IEEEhost, double *IEEEnet)
* may be identical)
*/
tmp = pHost[0];
pNet[0] = htonl (pHost[1]);
pNet[1] = htonl (tmp);
pNet[0] = dbr_htonl (pHost[1]);
pNet[1] = dbr_htonl (tmp);
#else
*IEEEnet = *IEEEhost;
#endif
}
/*
* ntohd ()
* dbr_ntohd ()
* performs only byte swapping
*/
void ntohd (double *IEEEnet, double *IEEEhost)
void dbr_ntohd (dbr_double_t *IEEEnet, dbr_double_t *IEEEhost)
{
#ifdef CA_LITTLE_ENDIAN
ca_uint32_t *pHost = (ca_uint32_t *) IEEEhost;
@@ -1635,35 +1652,35 @@ void ntohd (double *IEEEnet, double *IEEEhost)
* may be identical)
*/
tmp = pNet[0];
pHost[0] = ntohl (pNet[1]);
pHost[1] = htonl (tmp);
pHost[0] = dbr_ntohl (pNet[1]);
pHost[1] = dbr_htonl (tmp);
#else
*IEEEhost = *IEEEnet;
#endif
}
/*
* ntohf ()
* dbr_ntohf ()
* performs only byte swapping
*/
void ntohf (float *IEEEnet, float *IEEEhost)
void dbr_ntohf (dbr_float_t *IEEEnet, dbr_float_t *IEEEhost)
{
ca_uint32_t *pHost = (ca_uint32_t *) IEEEhost;
ca_uint32_t *pNet = (ca_uint32_t *) IEEEnet;
*pHost = ntohl (*pNet);
*pHost = dbr_ntohl (*pNet);
}
/*
* htonf ()
* dbr_htonf ()
* performs only byte swapping
*/
void htonf (float *IEEEhost, float *IEEEnet)
void dbr_htonf (dbr_float_t *IEEEhost, dbr_float_t *IEEEnet)
{
ca_uint32_t *pHost = (ca_uint32_t *) IEEEhost;
ca_uint32_t *pNet = (ca_uint32_t *) IEEEnet;
*pNet = htonl (*pHost);
*pNet = dbr_htonl (*pHost);
}
#endif /* IEEE float and little endian */

View File

@@ -585,7 +585,7 @@ void notify_ca_repeater()
* and we are just porting there for 3.12 so
* we will use the new protocol for 3.12
*/
# ifdef SOLARIS
# ifdef SOLARIS
len = sizeof(msg);
# else /* SOLARIS */
len = 0;
@@ -733,11 +733,6 @@ LOCAL void cac_tcp_send_msg_piiu(struct ioc_in_use *piiu)
* return if nothing to send
*/
if(sendCnt == 0){
# ifdef DEBUG
if (piiu->sendPending) {
printf ("-Unblocked-\n");
}
# endif /* DEBUG */
piiu->sendPending = FALSE;
piiu->send_needed = FALSE;
UNLOCK;
@@ -873,9 +868,7 @@ void ca_process_input_queue()
UNLOCK;
#if 0
cac_flush_internal();
#endif
}
@@ -1233,6 +1226,16 @@ void close_ioc (struct ioc_in_use *piiu)
ca_signal (ECA_DISCONN,piiu->host_name_str);
}
/*
* clear outstanding get call backs
*/
caIOBlockListFree (&pend_read_list, chix, TRUE, ECA_DISCONN);
/*
* clear outstanding put call backs
*/
caIOBlockListFree (&pend_write_list, chix, TRUE, ECA_DISCONN);
/*
* call their connection handler as required
*/

View File

@@ -318,7 +318,7 @@ struct ca_buffer{
#define TAG_CONN_DOWN(PIIU) \
( \
/* ca_printf("Tagging connection down at %d in %s\n", __LINE__, __FILE__), */\
/* ca_printf("Tagging connection down at %d in %s\n", __LINE__, __FILE__), */ \
(PIIU)->conn_up = FALSE \
)
@@ -423,6 +423,7 @@ struct ca_static{
bhe *ca_beaconHash[BHT_INET_ADDR_MASK+1];
unsigned ca_repeater_tries;
unsigned ca_search_retry; /* search retry seq number */
unsigned ca_search_responses; /* num search resp within seq # */
unsigned short ca_server_port;
unsigned short ca_repeater_port;
char ca_sprintf_buf[256];
@@ -552,6 +553,12 @@ unsigned long cacRingBufferReadSize(
struct ca_buffer *pBuf,
int contiguous);
void caIOBlockListFree(
ELLLIST *pList,
chid chan,
int cbRequired,
int status);
char *localUserName(void);
char *localHostName(void);

View File

@@ -16,6 +16,8 @@
*
*/
#include <db_access.h>
#ifdef CA_LITTLE_ENDIAN
# ifndef ntohs
# define ntohs(SHORT)\
@@ -64,29 +66,29 @@
#endif
#if defined(CA_FLOAT_IEEE) && !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))
# define dbr_htond(IEEEhost, IEEEnet) \
(*(dbr_double_t *)(IEEEnet) = *(dbr_double_t *)(IEEEhost))
# define dbr_ntohd(IEEEnet, IEEEhost) \
(*(dbr_double_t *)(IEEEhost) = *(dbr_double_t *)(IEEEnet))
# define dbr_htonf(IEEEhost, IEEEnet) \
(*(dbr_float_t *)(IEEEnet) = *(dbr_float_t *)(IEEEhost))
# define dbr_ntohf(IEEEnet, IEEEhost) \
(*(dbr_float_t *)(IEEEhost) = *(dbr_float_t *)(IEEEnet))
#elif defined(CA_FLOAT_IEEE) && defined(CA_LITTLE_ENDIAN)
# define ntohf(NET,HOST) \
{*((u_long *)(HOST)) = ntohl(*((u_long *)(NET )));}
# define htonf(HOST,NET) \
{*((u_long *)(NET) ) = htonl(*((u_long *)(HOST)));}
# define ntohd(NET,HOST) \
{ ((u_long *)(HOST))[1] = ntohl(((u_long *)(NET))[0]) ; \
((u_long *)(HOST))[0] = ntohl(((u_long *)(NET))[1]) ;}
# define htond(HOST,NET) \
{ ((u_long *)(NET))[1] = htonl(((u_long *)(HOST))[0]) ; \
((u_long *)(NET))[0] = htonl(((u_long *)(HOST))[1]) ;}
# define dbr_ntohf(NET,HOST) \
{*((dbr_long_t *)(HOST)) = ntohl(*((dbr_long_t *)(NET )));}
# define dbr_htonf(HOST,NET) \
{*((dbr_long_t *)(NET) ) = htonl(*((dbr_long_t *)(HOST)));}
# define dbr_ntohd(NET,HOST) \
{ ((dbr_long_t *)(HOST))[1] = ntohl(((dbr_long_t *)(NET))[0]) ; \
((dbr_long_t *)(HOST))[0] = ntohl(((dbr_long_t *)(NET))[1]) ;}
# define dbr_htond(HOST,NET) \
{ ((dbr_long_t *)(NET))[1] = htonl(((dbr_long_t *)(HOST))[0]) ; \
((dbr_long_t *)(NET))[0] = htonl(((dbr_long_t *)(HOST))[1]) ;}
#else
void htond(double *pHost, double *pNet);
void ntohd(double *pNet, double *pHost);
void htonf(float *pHost, float *pNet);
void ntohf(float *pNet, float *pHost);
void dbr_htond(dbr_double_t *pHost, dbr_double_t *pNet);
void dbr_ntohd(dbr_double_t *pNet, dbr_double_t *pHost);
void dbr_htonf(dbr_float_t *pHost, dbr_float_t *pNet);
void dbr_ntohf(dbr_float_t *pNet, dbr_float_t *pHost);
#endif

View File

@@ -832,6 +832,7 @@ struct in_addr *pnet_addr
ellDelete(&chpiiu->chidlist, &chan->node);
chan->piiu = allocpiiu;
ellAdd(&allocpiiu->chidlist, &chan->node);
ca_static->ca_search_responses++;
/*
* If this is the first channel to be

View File

@@ -42,8 +42,6 @@ LOCAL int cac_os_depen_exit_tid (struct ca_static *pcas, int tid);
LOCAL int cac_add_task_variable (struct ca_static *ca_temp);
LOCAL void deleteCallBack(CALLBACK *pcb);
#define USEC_PER_SEC 1000000
/*
* cac_gettimeval()

View File

@@ -79,45 +79,14 @@ extern struct dbBase *pdbBase;
%%
database: DATABASE d_head d_body
{
#ifdef vxWorks
dbFreeEntry(pdbentry);
#endif
}
| DATABASE d_head /* jbk added for graphical thing */
{
#ifdef vxWorks
dbFreeEntry(pdbentry);
#endif
}
| db_components
;
d_head: O_PAREN WORD C_PAREN
{
#ifdef vxWorks
/*
fprintf(stderr,"Warning: No EPICS version information in db file\n");
*/
pdbentry=dbAllocEntry(pdbBase);
free($2);
#endif
}
{ free($2); }
| O_PAREN WORD COMMA VALUE C_PAREN
{
#ifdef vxWorks
int version,revision;
char* v;
v=strtok($4," ."); sscanf(v,"%d",&version);
v=strtok(NULL," ."); sscanf(v,"%d",&revision);
if(version!=EPICS_VERSION || revision!=EPICS_REVISION)
fprintf(stderr,"Warning: Database not created with same version\n");
pdbentry=dbAllocEntry(pdbBase);
free($2); free($4);
#endif
}
{ free($2); free($4); }
;
d_body: O_BRACE nowhere_records db_components C_BRACE
@@ -144,9 +113,7 @@ container: CONTAINER c_head c_body
;
c_head: O_PAREN WORD C_PAREN
{
free($2);
}
{ free($2); }
;
c_body: O_BRACE db_components C_BRACE
@@ -159,7 +126,7 @@ records: /* null */
record: RECORD r_head r_body
{
#ifndef vxWorks
printf(" }\n");
printf("}\n");
#endif
}
;
@@ -253,32 +220,24 @@ int dbLoadRecords(char* pfilename, char* pattern, char* container)
return -1;
}
#ifndef vxWorks
/* if(container) printf(" %s {\n",container); */
#endif
if(is_not_inited)
{
#ifdef ERROR_STUFF
fprintf(stderr,"initing parser\n");
#endif
yyin=fp;
is_not_inited=0;
}
else
{
#ifdef ERROR_STUFF
fprintf(stderr,"restarting parser\n");
#endif
yyrestart(fp);
}
#ifdef ERROR_STUFF
fprintf(stderr,"before parser startup\n");
#ifdef vxWorks
pdbentry=dbAllocEntry(pdbBase);
#endif
yyparse();
#ifndef vxWorks
/* if(container) printf(" }\n"); */
#ifdef vxWorks
dbFreeEntry(pdbentry);
#endif
if(subst_used) dbFreeSubst();
@@ -303,7 +262,7 @@ static void sub_pvname(char* type, char* name)
if( dbCreateRecord(pdbentry,subst_buffer) )
fprintf(stderr,"Cannot create record %s\n",subst_buffer);
#else
printf("\trecord(%s, \"%s\") {",type,subst_buffer);
printf("record(%s,\"%s\") {",type,subst_buffer);
#endif
}
else
@@ -312,7 +271,7 @@ static void sub_pvname(char* type, char* name)
if( dbCreateRecord(pdbentry,name) )
fprintf(stderr,"Cannot create record %s\n",name);
#else
printf("\trecord(%s, \"%s\") {",type,name);
printf("record(%s,\"%s\") {",type,name);
#endif
}
}

View File

@@ -7,7 +7,10 @@ value [a-zA-Z0-9_\,\^~\./\*#\[\]%: ;!|\'\-&\(\)@\?\+<>=\$\{\}]
%%
\#.*\n ;
"field" { return(FIELD); }
"grecord" { return(RECORD); }
"record" { return(RECORD); }
"container" { return(CONTAINER); }
"database" { return(DATABASE); }

View File

@@ -89,6 +89,17 @@ templs: templs templ
;
templ: templ_head O_BRACE subst C_BRACE
| templ_head
{
#ifndef SUB_TOOL
if(db_file_name)
dbLoadRecords(db_file_name,NULL,NULL);
else
fprintf(stderr,"Error: no db file name given\n");
#else
sub_it();
#endif
}
;
templ_head: DBFILE WORD
@@ -118,9 +129,7 @@ vars: vars var
;
var: WORD
{
vars[var_count++]=$1;
}
{ vars[var_count++]=$1; }
;
subs: subs sub
@@ -415,9 +424,7 @@ main(int argc, char** argv)
if(!name) name = "Composite";
printf("database(name,\"%d.%d\") {\n",EPICS_VERSION,EPICS_REVISION,name);
dbLoadTemplate(argv[1]);
printf("}\n");
}
#endif
#endif

View File

@@ -8,6 +8,8 @@ par [\"\']
%%
\#.*\n ;
"pattern" { return(PATTERN); }
"file" { return(DBFILE); }
"=" { return(EQUALS); }
@@ -16,8 +18,6 @@ par [\"\']
{word}+ { yylval.Str=(char *)malloc(strlen(yytext)+1); strcpy(yylval.Str,yytext); return(WORD); }
"(" { return(O_PAREN); }
")" { return(C_PAREN); }
"{" { return(O_BRACE); }
"}" { return(C_BRACE); }

View File

@@ -53,6 +53,9 @@
*****************************************************************
*
* $Log$
* Revision 1.1 1995/03/31 15:03:32 winans
* Machine protection system interface card
*
*
* 00:
* HBI OSC AND3 AND2 AND1 OUT2 OUT1 OUT x x x x T2 T1 RR TEST
@@ -583,10 +586,10 @@ STATIC long MpcInit(int flag)
cards[Card].Doggie = wdCreate();
wdStart(cards[Card].Doggie, MPC_DOG_POLL_RATE, (FUNCPTR)MpcDogWatcher, (int)(&cards[Card]));
#endif
}
#ifdef MPC_USE_IRQS
sysIntEnable(cards[Card].VMEintLevel);
#endif
}
}
}
return(OK);

View File

@@ -1579,6 +1579,8 @@ struct client *client
unsigned short *pMinorVersion;
int status;
unsigned sid;
unsigned long count;
int type;
/*
* set true if max memory block drops below MAX_BLOCK_THRESHOLD
@@ -1620,6 +1622,8 @@ struct client *client
*/
if (CA_V44(CA_PROTOCOL_VERSION,htons(mp->m_count))) {
sid = ~0U;
count = 0;
type = -1;
}
else {
struct channel_in_use *pchannel;
@@ -1638,6 +1642,8 @@ struct client *client
return;
}
sid = pchannel->sid;
count = tmp_addr.no_elements;
type = tmp_addr.field_type;
}
SEND_LOCK(client);
@@ -1650,8 +1656,8 @@ struct client *client
search_reply->m_postsize = sizeof(*pMinorVersion);
/* this field for rmt machines where paddr invalid */
search_reply->m_type = tmp_addr.field_type;
search_reply->m_count = tmp_addr.no_elements;
search_reply->m_type = type;
search_reply->m_count = count;
search_reply->m_cid = sid;
/*

View File

@@ -168,7 +168,7 @@ FPNUM (\-?(([0-9]+)(\.[0-9]*)?)|(\.[0-9]+))
}
<SNL>{NAME} {
nc = strlen(yytext);
bcopy(yytext, str_next, nc+1);
memcpy(str_next, yytext, nc+1);
yylval.pchar = str_next;
str_next += nc+1;
RETURN(NAME);
@@ -219,7 +219,7 @@ FPNUM (\-?(([0-9]+)(\.[0-9]*)?)|(\.[0-9]+))
<SNL>"," RETURN(COMMA);
<SNL>{FPNUM} {
nc = strlen(yytext);
bcopy(yytext, str_next, nc+1);
memcpy(str_next, yytext, nc+1);
yylval.pchar = str_next;
str_next += nc+1;
RETURN(NUMBER);