summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-04-26 21:03:27 +0000
committered <ed@FreeBSD.org>2009-04-26 21:03:27 +0000
commit151f899628ad49224d1a8f06ef68d7e75bd6a9cf (patch)
tree7d5f59beee437466612414138ae7bc20dc6b27d6
parent3bb993c3f7bf41a691efb6c6c953b1601bfa85b3 (diff)
downloadFreeBSD-src-151f899628ad49224d1a8f06ef68d7e75bd6a9cf.zip
FreeBSD-src-151f899628ad49224d1a8f06ef68d7e75bd6a9cf.tar.gz
Make the SPX code use its own copies of insque()/remque().
Instead of using the antique insque()/remque() functions from sys/queue.h, make this code use its own versions. Eventually the code should just use the regular TAILQ/LIST macros.
-rw-r--r--sys/netipx/spx_usrreq.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c
index 86882cb..7bfa88e 100644
--- a/sys/netipx/spx_usrreq.c
+++ b/sys/netipx/spx_usrreq.c
@@ -180,6 +180,25 @@ struct pr_usrreqs spx_usrreq_sps = {
.pru_close = spx_usr_close,
};
+static __inline void
+spx_insque(struct spx_q *element, struct spx_q *head)
+{
+
+ element->si_next = head->si_next;
+ element->si_prev = head;
+ head->si_next = element;
+ element->si_next->si_prev = element;
+}
+
+static __inline void
+spx_remque(struct spx_q *element)
+{
+
+ element->si_next->si_prev = element->si_prev;
+ element->si_prev->si_next = element->si_next;
+ element->si_prev = NULL;
+}
+
void
spx_init(void)
{
@@ -649,7 +668,7 @@ update_window:
break;
}
}
- insque(si, q->si_prev);
+ spx_insque((struct spx_q *)si, q->si_prev);
/*
* If this packet is urgent, inform process
@@ -680,7 +699,7 @@ present:
so->so_rcv.sb_state |= SBS_RCVATMARK;
}
q = q->si_prev;
- remque(q->si_next);
+ spx_remque(q->si_next);
wakeup = 1;
spxstat.spxs_rcvpack++;
#ifdef SF_NEWCALL
@@ -1458,7 +1477,7 @@ spx_pcbdetach(struct ipxpcb *ipxp)
s = cb->s_q.si_next;
while (s != &(cb->s_q)) {
s = s->si_next;
- remque(s);
+ spx_remque(s);
m = dtom(s);
m_freem(m);
}
OpenPOWER on IntegriCloud