M alphapc/devether.c => alphapc/devether.c +4 -4
@@ 110,12 110,12 @@ etherrtrace(Netfile* f, Etherpkt* pkt, int len)
if(qwindow(f->in) <= 0)
return;
- if(len > 64)
- n = 64;
+ if(len > 58)
+ n = 58;
else
n = len;
- bp = iallocb(n);
- if(bp == 0)
+ bp = iallocb(64);
+ if(bp == nil)
return;
memmove(bp->wp, pkt->d, n);
i = TK2MS(MACHP(0)->ticks);
M carrera/devether.c => carrera/devether.c +4 -4
@@ 110,12 110,12 @@ etherrtrace(Netfile* f, Etherpkt* pkt, int len)
if(qwindow(f->in) <= 0)
return;
- if(len > 64)
- n = 64;
+ if(len > 58)
+ n = 58;
else
n = len;
- bp = iallocb(n);
- if(bp == 0)
+ bp = iallocb(64);
+ if(bp == nil)
return;
memmove(bp->wp, pkt->d, n);
i = TK2MS(MACHP(0)->ticks);
M mpc/devether.c => mpc/devether.c +4 -4
@@ 110,12 110,12 @@ etherrtrace(Netfile* f, Etherpkt* pkt, int len)
if(qwindow(f->in) <= 0)
return;
- if(len > 64)
- n = 64;
+ if(len > 58)
+ n = 58;
else
n = len;
- bp = iallocb(n);
- if(bp == 0)
+ bp = iallocb(64);
+ if(bp == nil)
return;
memmove(bp->wp, pkt->d, n);
i = TK2MS(MACHP(0)->ticks);
M pc/devether.c => pc/devether.c +4 -4
@@ 110,12 110,12 @@ etherrtrace(Netfile* f, Etherpkt* pkt, int len)
if(qwindow(f->in) <= 0)
return;
- if(len > 64)
- n = 64;
+ if(len > 58)
+ n = 58;
else
n = len;
- bp = iallocb(n);
- if(bp == 0)
+ bp = iallocb(64);
+ if(bp == nil)
return;
memmove(bp->wp, pkt->d, n);
i = TK2MS(MACHP(0)->ticks);
M pc/i8253.c => pc/i8253.c +9 -2
@@ 55,6 55,7 @@ enum
static struct
{
Lock;
+ int havecyc;
int enabled;
int mode;
vlong when; /* next fastticks a clock interrupt should occur */
@@ 72,6 73,7 @@ i8253init(int aalcycles, int havecycleclock)
if(initialised == 0){
initialised = 1;
+ i8253.havecyc = havecycleclock;
ioalloc(T0cntr, 4, 0, "i8253");
ioalloc(T2ctl, 1, 0, "i8253.cntr2ctl");
@@ 204,7 206,7 @@ clockintrsched0(vlong next)
int
havecycintr(void)
{
- return i8253.enabled;
+ return i8253.havecyc && i8253.enabled;
}
void
@@ 213,7 215,7 @@ clockintrsched(void)
vlong next;
ilock(&i8253);
- if(i8253.enabled){
+ if(i8253.enabled && i8253.havecyc){
next = cycintrnext();
if(next != i8253.cycwhen)
clockintrsched0(next);
@@ 226,6 228,11 @@ clockintr0(Ureg* ureg, void *v)
{
vlong now, when;
+ if(!i8253.havecyc){
+ clockintr(ureg, v);
+ return;
+ }
+
now = fastticks(nil);
when = i8253.when;
if(now >= i8253.when){