changed dll/lst to ellLib stuff

This commit is contained in:
Janet B. Anderson
1993-08-05 05:53:55 +00:00
parent 4bd08d898b
commit 4d12e39b19
4 changed files with 62 additions and 64 deletions

View File

@@ -763,7 +763,7 @@ ca_process_exit()
# ifdef vxWorks
chix = (chid) & ca_temp->ca_local_chidlist.node;
while (chix = (chid) chix->node.next){
while (monix = (evid) dllGet(&chix->eventq)) {
while (monix = (evid) ellGet(&chix->eventq)) {
status = db_cancel_event(monix + 1);
if (status == ERROR)
abort();
@@ -785,7 +785,7 @@ ca_process_exit()
"could not close event facility by id");
}
dllFree(&ca_temp->ca_lcl_buff_list);
ellFree(&ca_temp->ca_lcl_buff_list);
# endif
/*
@@ -809,8 +809,8 @@ ca_process_exit()
* remove remote chid blocks and event blocks
*/
for (i = 0; i < ca_temp->ca_nxtiiu; i++) {
while (chix = (chid) dllGet(&ca_temp->ca_iiu[i].chidlist)) {
while (monix = (evid) dllGet(&chix->eventq)) {
while (chix = (chid) ellGet(&ca_temp->ca_iiu[i].chidlist)) {
while (monix = (evid) ellGet(&chix->eventq)) {
free((char *)monix);
}
free((char *)chix);
@@ -821,15 +821,15 @@ ca_process_exit()
* remove local chid blocks, paddr blocks, waiting ev blocks
*/
# ifdef vxWorks
while (chix = (chid) dllGet(&ca_temp->ca_local_chidlist))
while (chix = (chid) ellGet(&ca_temp->ca_local_chidlist))
free((char *)chix);
dllFree(&ca_temp->ca_dbfree_ev_list);
ellFree(&ca_temp->ca_dbfree_ev_list);
# endif
/* remove remote waiting ev blocks */
dllFree(&ca_temp->ca_free_event_list);
ellFree(&ca_temp->ca_free_event_list);
/* remove any pending read blocks */
dllFree(&ca_temp->ca_pend_read_list);
ellFree(&ca_temp->ca_pend_read_list);
/*
* force this macro to use ca_temp
@@ -972,7 +972,7 @@ int ca_build_and_connect
chix->paddr)->no_elements;
chix->iocix = LOCAL_IIU;
chix->state = cs_conn;
dllInit(&chix->eventq);
ellInit(&chix->eventq);
strncpy(chix + 1, name_str, strcnt);
/* check for just a search */
@@ -990,7 +990,7 @@ int ca_build_and_connect
}
}
LOCK;
dllAdd(&local_chidlist, chix);
ellAdd(&local_chidlist, chix);
UNLOCK;
if (chix->connection_func) {
@@ -1039,12 +1039,12 @@ int ca_build_and_connect
chix->build_value = (void *) pvalue;
chix->name_length = strcnt;
chix->state = cs_never_conn;
dllInit(&chix->eventq);
ellInit(&chix->eventq);
/* Save this channels name for retry if required */
strncpy(chix + 1, name_str, strcnt);
dllAdd(&iiu[BROADCAST_IIU].chidlist, chix);
ellAdd(&iiu[BROADCAST_IIU].chidlist, chix);
/*
* set the conn tries back to zero so this channel's location
* can be found
@@ -1268,7 +1268,7 @@ ca_array_get_callback
#endif
LOCK;
if (!(monix = (evid) dllGet(&free_event_list)))
if (!(monix = (evid) ellGet(&free_event_list)))
monix = (evid) malloc(sizeof *monix);
if (monix) {
@@ -1279,7 +1279,7 @@ ca_array_get_callback
monix->type = type;
monix->count = count;
dllAdd(&pend_read_list, monix);
ellAdd(&pend_read_list, monix);
issue_get_callback(monix);
@@ -1622,7 +1622,7 @@ void *astarg;
return ECA_ALLOCMEM;
pioe->io_done_arg = astarg;
pioe->io_done_sub = ast;
dllAdd(&ioeventlist,pioe);
ellAdd(&ioeventlist,pioe);
UNLOCK;
}
@@ -1692,15 +1692,15 @@ long mask;
dbevsize = db_sizeof_event_block();
if(!(monix = (evid)dllGet(&dbfree_ev_list)))
if(!(monix = (evid)ellGet(&dbfree_ev_list)))
monix = (evid)malloc(sizeof(*monix)+dbevsize);
}
else
if(!(monix = (evid)dllGet(&free_event_list)))
if(!(monix = (evid)ellGet(&free_event_list)))
monix = (evid)malloc(sizeof *monix);
}
# else
if(!(monix = (evid)dllGet(&free_event_list)))
if(!(monix = (evid)ellGet(&free_event_list)))
monix = (evid) malloc(sizeof *monix);
# endif
@@ -1745,7 +1745,7 @@ long mask;
is no chance that it will be deleted
at exit before it is completely created
*/
dllAdd(&chix->eventq, monix);
ellAdd(&chix->eventq, monix);
/*
force event to be called at least once
@@ -1766,7 +1766,7 @@ long mask;
/* It can be added to the list any place if it is remote */
/* Place in the channel list */
dllAdd(&chix->eventq, monix);
ellAdd(&chix->eventq, monix);
ca_request_event(monix);
@@ -1862,7 +1862,7 @@ void *pfl;
void *pval;
register unsigned size;
struct tmp_buff{
NODE node;
ELLNODE node;
unsigned size;
};
struct tmp_buff *pbuf = NULL;
@@ -1901,7 +1901,7 @@ void *pfl;
pbuf = (struct tmp_buff *)
lcl_buff_list.node.next;
if(pbuf->size >= size){
dllDelete(
ellDelete(
&lcl_buff_list,
pbuf);
}else
@@ -1981,7 +1981,7 @@ void *pfl;
if(ptbuf)
ptbuf = (struct tmp_buff *) ptbuf->node.previous;
dllInsert(
ellInsert(
&lcl_buff_list,
ptbuf,
pbuf);
@@ -2033,16 +2033,16 @@ evid monix;
* dont allow two threads to delete the same moniitor at once
*/
LOCK;
status = dllFind(&chix->eventq, monix);
status = ellFind(&chix->eventq, monix);
if (status != ERROR) {
dllDelete(&chix->eventq, monix);
ellDelete(&chix->eventq, monix);
status = db_cancel_event(monix + 1);
}
UNLOCK;
if (status == ERROR)
return ECA_BADMONID;
dllAdd(&dbfree_ev_list, monix);
ellAdd(&dbfree_ev_list, monix);
return ECA_NORMAL;
}
@@ -2086,7 +2086,7 @@ evid monix;
piiu->outstanding_ack_count++;
}
else{
dllDelete(&monix->chan->eventq, monix);
ellDelete(&monix->chan->eventq, monix);
}
UNLOCK;
@@ -2150,17 +2150,17 @@ chid chix;
/*
* clear out the events for this channel
*/
while (monix = (evid) dllGet(&chix->eventq)) {
while (monix = (evid) ellGet(&chix->eventq)) {
status = db_cancel_event(monix + 1);
if (status == ERROR)
abort();
dllAdd(&dbfree_ev_list, monix);
ellAdd(&dbfree_ev_list, monix);
}
/*
* clear out this channel
*/
dllDelete(&local_chidlist, chix);
ellDelete(&local_chidlist, chix);
free((char *) chix);
break; /* to unlock exit */
@@ -2174,8 +2174,8 @@ chid chix;
* check for conn state while locked to avoid a race
*/
if(old_chan_state != cs_conn){
dllConcat(&free_event_list, &chix->eventq);
dllDelete(&piiu->chidlist, chix);
ellConcat(&free_event_list, &chix->eventq);
ellDelete(&piiu->chidlist, chix);
if (chix->iocix != BROADCAST_IIU &&
!piiu->chidlist.count){
close_ioc(piiu);

View File

@@ -74,9 +74,7 @@ static char *iocinfhSccsId = "@(#)iocinf.h 1.15\t6/2/93";
DONT_COMPILE
#endif
#ifndef INCdllLibh
# include <dllLib.h>
#endif
# include <ellLib.h>
#ifndef INCos_depenh
# include <os_depen.h>
@@ -114,7 +112,7 @@ struct buffer{
#define BROADCAST_IIU 0
struct pending_io_event{
NODE node;
ELLNODE node;
void (*io_done_sub)();
void *io_done_arg;
};
@@ -171,7 +169,7 @@ typedef unsigned long ca_time;
struct ca_static{
unsigned short ca_nxtiiu;
long ca_pndrecvcnt;
LIST ca_ioeventlist;
ELLLIST ca_ioeventlist;
void (*ca_exception_func)();
void *ca_exception_arg;
void (*ca_connection_func)();
@@ -180,8 +178,8 @@ struct ca_static{
void *ca_fd_register_arg;
short ca_exit_in_progress;
unsigned short ca_post_msg_active;
LIST ca_free_event_list;
LIST ca_pend_read_list;
ELLLIST ca_free_event_list;
ELLLIST ca_pend_read_list;
short ca_repeater_contacted;
unsigned short ca_send_msg_active;
short ca_cast_available;
@@ -200,9 +198,9 @@ struct ca_static{
FAST_LOCK ca_client_lock;
FAST_LOCK ca_event_lock; /* dont allow events to preempt */
int ca_tid;
LIST ca_local_chidlist;
LIST ca_dbfree_ev_list;
LIST ca_lcl_buff_list;
ELLLIST ca_local_chidlist;
ELLLIST ca_dbfree_ev_list;
ELLLIST ca_lcl_buff_list;
int ca_event_tid;
unsigned ca_local_ticks;
#else
@@ -223,7 +221,7 @@ struct ca_static{
struct buffer *recv;
unsigned read_seq;
unsigned cur_read_seq;
LIST chidlist; /* chans on this connection */
ELLLIST chidlist; /* chans on this connection */
short conn_up; /* boolean: T-conn /F-disconn */
short send_needed; /* CA needs a send */
char host_name_str[32];

View File

@@ -82,7 +82,7 @@ static char *sccsId = "$Id$\t$Date$";
@@@@ dont compile @@@@
#endif
#include <dllLib.h>
#include <ellLib.h>
#include <iocmsg.h>
#include <os_depen.h>
@@ -91,12 +91,12 @@ static char *sccsId = "$Id$\t$Date$";
* per machine so we dont care about reentrancy
*/
struct one_client{
NODE node;
ELLNODE node;
struct sockaddr_in from;
};
static
LIST client_list;
ELLLIST client_list;
static
char buf[MAX_UDP];
@@ -172,7 +172,7 @@ ca_repeater()
struct one_client *pclient;
struct one_client *pnxtclient;
dllInit(&client_list);
ellInit(&client_list);
/* allocate a socket */
sock = socket( AF_INET, /* domain */
@@ -274,7 +274,7 @@ ca_repeater()
malloc(sizeof *pclient);
if(pclient){
pclient->from = from;
dllAdd(&client_list, pclient);
ellAdd(&client_list, pclient);
#ifdef DEBUG
ca_printf("Added %x %d\n", from.sin_port, size);
#endif
@@ -356,7 +356,7 @@ struct one_client *pclient;
socket_close(sock);
if(!present){
dllDelete(&client_list, pclient);
ellDelete(&client_list, pclient);
free(pclient);
#ifdef DEBUG
ca_printf("Deleted\n");

View File

@@ -200,8 +200,8 @@ post_msg(hdrptr, pbufcnt, pnet_addr, piiu)
UNLOCKEVENTS;
}
LOCK;
dllDelete(&pend_read_list, monix);
dllAdd(&free_event_list, monix);
ellDelete(&pend_read_list, monix);
ellAdd(&free_event_list, monix);
UNLOCK;
piiu->outstanding_ack_count--;
@@ -225,8 +225,8 @@ post_msg(hdrptr, pbufcnt, pnet_addr, piiu)
*/
if (!t_postsize) {
LOCK;
dllDelete(&monix->chan->eventq, monix);
dllAdd(&free_event_list, monix);
ellDelete(&monix->chan->eventq, monix);
ellAdd(&free_event_list, monix);
UNLOCK;
piiu->outstanding_ack_count--;
@@ -438,8 +438,8 @@ post_msg(hdrptr, pbufcnt, pnet_addr, piiu)
struct ioc_in_use *piiu = &iiu[chix->iocix];
LOCK;
dllDelete(&piiu->chidlist, chix);
dllAdd(&iiu[BROADCAST_IIU].chidlist, chix);
ellDelete(&piiu->chidlist, chix);
ellAdd(&iiu[BROADCAST_IIU].chidlist, chix);
chix->iocix = BROADCAST_IIU;
if (!piiu->chidlist.count)
close_ioc(piiu);
@@ -471,11 +471,11 @@ post_msg(hdrptr, pbufcnt, pnet_addr, piiu)
monix;
monix = (evid) monix->node.next)
if (monix->chan == chix) {
dllDelete(&pend_read_list, monix);
dllAdd(&free_event_list, monix);
ellDelete(&pend_read_list, monix);
ellAdd(&free_event_list, monix);
}
dllConcat(&free_event_list, &chix->eventq);
dllDelete(&piiu->chidlist, chix);
ellConcat(&free_event_list, &chix->eventq);
ellDelete(&piiu->chidlist, chix);
free(chix);
piiu->outstanding_ack_count--;
if (!piiu->chidlist.count)
@@ -625,9 +625,9 @@ struct in_addr *pnet_addr;
if(chan->iocix != BROADCAST_IIU)
ca_signal(ECA_NEWADDR, (char *)(chan+1));
chpiiu = &iiu[chan->iocix];
dllDelete(&chpiiu->chidlist, chan);
ellDelete(&chpiiu->chidlist, chan);
chan->iocix = newiocix;
dllAdd(&iiu[newiocix].chidlist, chan);
ellAdd(&iiu[newiocix].chidlist, chan);
}
/*
@@ -708,7 +708,7 @@ int lock;
LOCK;
}
while(pioe = (struct pending_io_event *) dllGet(&ioeventlist)){
while(pioe = (struct pending_io_event *) ellGet(&ioeventlist)){
(*pioe->io_done_sub)(pioe->io_done_arg);
free(pioe);
}
@@ -740,9 +740,9 @@ client_channel_exists(chan)
for (piiu = iiu; piiu < pnext_iiu; piiu++) {
/*
* dllFind returns the node number or ERROR
* ellFind returns the node number or ERROR
*/
status = dllFind(&piiu->chidlist, chan);
status = ellFind(&piiu->chidlist, chan);
if (status != ERROR) {
return TRUE;
}