From 95ff76f4dfbb6518819f59a84567819dbdd5b3bd Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Fri, 3 Oct 1997 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1997-10-03 --- ip/il.c | 8 +++++--- pc/trap.c | 9 ++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ip/il.c b/ip/il.c index b5ec1fa34b45e40625ca6427f3692efedf2c2a3c..a48eb886234726deadb12ff60a040bed16fbffb1 100644 --- a/ip/il.c +++ b/ip/il.c @@ -1015,7 +1015,9 @@ loop: break; } if(ic->timeout >= ic->fasttime) { - ilrexmit(ic); + ilsendctl(p, nil, Ilquery, ic->next, ic->recvd, ilnextqt(ic)); + ic->querytime = Querytime; + ic->timeout = 0; ilbackoff(ic); } if(ic->timeout >= ic->slowtime) { @@ -1109,8 +1111,8 @@ iltimers(Ilcb *ic) int pt; ic->timeout = 0; - pt = (ic->delay>>LogAGain) + ic->unackedbytes/(ic->rate>>LogAGain) + ic->mdev; - ic->fasttime = Acktime + pt + Iltickms - 1; + pt = (ic->delay>>LogAGain) + ic->unackedbytes/(ic->rate>>LogAGain) + (ic->mdev>>(LogDGain-1)); + ic->fasttime = pt + Iltickms - 1; if(ic->fasttime > Fasttime) ic->fasttime = Fasttime; ic->slowtime = (Slowtime/Seconds)*pt; diff --git a/pc/trap.c b/pc/trap.c index 8a2950f3d35df091be686473905b08a74c0c406b..e7a28619c0d50577770967770c032533b6097966 100644 --- a/pc/trap.c +++ b/pc/trap.c @@ -492,10 +492,13 @@ noted(Ureg* ureg, ulong arg0) * Check the segment selectors are all valid, otherwise * a fault will be taken on attempting to return to the * user process. + * Take care with the comparisons as different processor + * generations push segment descriptors in different ways. */ - if(nureg->cs != UESEL || nureg->ss != UDSEL || nureg->ds != UDSEL - || nureg->es != UDSEL || nureg->fs != UDSEL || nureg->gs != UDSEL){ - pprint("bad segement selector in noted\n"); + if((nureg->cs & 0xFFFF) != UESEL || (nureg->ss & 0xFFFF) != UDSEL + || (nureg->ds & 0xFFFF) != UDSEL || (nureg->es & 0xFFFF) != UDSEL + || (nureg->fs & 0xFFFF) != UDSEL || (nureg->gs & 0xFFFF) != UDSEL){ + pprint("bad segment selector in noted\n"); qunlock(&up->debug); pexit("Suicide", 0); }