From 71e175c5795e7df54e3a73d156fe5dfbeff1b8a3 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 22 Aug 1992 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1992-08-22 --- port/segment.c | 3 +-- port/tcpoutput.c | 21 ++++++--------------- power/fptrap.c | 6 +++--- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/port/segment.c b/port/segment.c index c5c1f11dbcd1d918d50cb3a864d1bc885f0f8772..46f82ac7be74879671fa6247a075184057df6e7f 100644 --- a/port/segment.c +++ b/port/segment.c @@ -259,8 +259,7 @@ imagereclaim(void) lock(&palloc); for(p = palloc.head; p; p = p->next) { - if(p->image && p->ref == 0 && p->image != &swapimage) { - lock(p); + if(p->image && p->ref == 0 && p->image != &swapimage && canlock(p)) { if(p->ref == 0) uncachepage(p); unlock(p); diff --git a/port/tcpoutput.c b/port/tcpoutput.c index 4388b1b2cc42caa75acb37cb8a295d1aec015ff5..4dbb3cd9a9e64158b2d893cada10c9c2777b18d2 100644 --- a/port/tcpoutput.c +++ b/port/tcpoutput.c @@ -94,11 +94,7 @@ tcp_output(Ipconv *s) seg.ack = tcb->last_ack = tcb->rcv.nxt; seg.wnd = tcb->rcv.wnd; - /* Now try to extract some data from the send queue. - * Since SYN and FIN occupy sequence space and are reflected - * in sndcnt but don't actually sit in the send queue, - * dupb will return one less than dsize if a FIN needs to be sent. - */ + /* Pull out data to send */ dbp = 0; if(dsize != 0){ if(dupb(&dbp, sndq, sent, dsize) != dsize) { @@ -111,19 +107,14 @@ tcp_output(Ipconv *s) if(sent+dsize == qlen) seg.flags |= PSH; - /* If this transmission includes previously transmitted data, - * snd.nxt will already be past snd.ptr. In this case, - * compute the amount of retransmitted data and keep score - */ + /* + * keep track of balance of resent data */ if(tcb->snd.ptr < tcb->snd.nxt) tcb->resent += MIN((int)tcb->snd.nxt - (int)tcb->snd.ptr,(int)ssize); tcb->snd.ptr += ssize; - /* If this is the first transmission of a range of sequence - * numbers, record it so we'll accept acknowledgments - * for it later - */ + /* Pull up the send pointer so we can accept acks for this window */ if(seq_gt(tcb->snd.ptr,tcb->snd.nxt)) tcb->snd.nxt = tcb->snd.ptr; @@ -139,8 +130,8 @@ tcp_output(Ipconv *s) return; } - /* If we're sending some data or flags, start retransmission - * and round trip timers if they aren't already running. + /* Start the transmission timers if there is new data and we + * expect acknowledges */ if(ssize != 0){ tcb->timer.start = backoff(tcb->backoff) * diff --git a/power/fptrap.c b/power/fptrap.c index 7b8ff2e487e1d0e90e21c8626879ee6b62c4c7a6..efa8944bf974fc60f96d02d35cce3b9829e21880 100644 --- a/power/fptrap.c +++ b/power/fptrap.c @@ -47,8 +47,9 @@ fptrap(Ureg *ur, ulong fcr31) }else ur->pc += 4; u->fpsave.fpstatus = fcr31 & ~(1<<17); + return 1; } - return 1; + return 0; } static void @@ -158,8 +159,7 @@ fpunimp(ulong iw) sd = ss; break; - default: - /* shouldn't get here */ + default: /* probably a compare */ return 0; } if(ed <= -(maxe-4)){ /* guess: underflow */