From 50fa3f78d8d465222664f8a18b138b87a54e91cd Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Thu, 15 Jan 1998 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1998-01-15 --- pc/archgeneric.c | 1 + pc/dat.h | 3 +++ pc/devata.c | 5 ----- pc/trap.c | 22 ++++++++++++++++------ 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/pc/archgeneric.c b/pc/archgeneric.c index 6f237494d0a9a185587523baac67814a718837fb..c81b83756d58f3a352f755974012ba8901aa881a 100644 --- a/pc/archgeneric.c +++ b/pc/archgeneric.c @@ -59,6 +59,7 @@ static X86type x86type[] = { 5, 4, 23, "P55C MMX", }, { 5, 7, 23, "P54C VRT", }, { 6, 1, 16, "PentiumPro", },/* determined by trial and error */ + { 6, 3, 16, "PentiumII", }, /* determined by trial and error */ { 3, -1, 32, "386", }, /* family defaults */ { 4, -1, 22, "486", }, diff --git a/pc/dat.h b/pc/dat.h index 800e82ab143a32b7179ca2001a33d3acaf03ef7e..c9683944a5924f6e0ad6c307264068994f3e7f9e 100644 --- a/pc/dat.h +++ b/pc/dat.h @@ -167,6 +167,9 @@ struct Mach int load; int intr; + ulong spuriousintr; + ulong lastintr; + int loopconst; int cpumhz; diff --git a/pc/devata.c b/pc/devata.c index aa0baa6ba8e0e369651ff5dd0b638d358ad2b5af..c4a83d88c1260bd758fbeccc076b221148086184 100644 --- a/pc/devata.c +++ b/pc/devata.c @@ -1820,11 +1820,6 @@ retry: cp->count, cp->status, cp->error); error(Eio); } -{ int i; - for(i = 0; i < 18; i++) - print("%2.2uX ", buf[i]); - print("\n"); -} cp->len = 8; cp->count = 0; diff --git a/pc/trap.c b/pc/trap.c index cc54a14cba250a19d83c0b0748f595a237a3238e..c54a8597200c5e90363fd6da251797d981a3fec2 100644 --- a/pc/trap.c +++ b/pc/trap.c @@ -121,8 +121,6 @@ char *excname[] = { [18] "machine check", }; -static int nspuriousintr; - /* * All traps come here. It is slower to have all traps call trap() rather than * directly vectoring the handler. However, this avoids a lot of code duplication @@ -132,10 +130,11 @@ static int nspuriousintr; void trap(Ureg* ureg) { - int v, user; + int i, v, user; char buf[ERRLEN]; Irqctl *ctl; Irq *irq; + Mach *mach; user = 0; if((ureg->cs & 0xFFFF) == UESEL){ @@ -149,6 +148,8 @@ trap(Ureg* ureg) m->intr++; if(ctl->isr) ctl->isr(v); + if(v >= VectorPIC && v <= MaxVectorPIC) + m->lastintr = v-VectorPIC; } for(irq = ctl->irq; irq; irq = irq->next) @@ -171,9 +172,18 @@ trap(Ureg* ureg) * the corresponding bit in the ISR isn't set. * In fact, just ignore all such interrupts. */ - if(nspuriousintr < 2) - print("spurious interrupt %d\n", v-VectorPIC); - nspuriousintr++; + print("cpu%d: spurious interrupt %d, last %d", + m->machno, v-VectorPIC, m->lastintr); + for(i = 0; i < 32; i++){ + if(!(active.machs & (1<machno == mach->machno) + continue; + print(": cpu%d: last %d", mach->machno, mach->lastintr); + } + print("\n"); + m->spuriousintr++; return; } else{