From 01bdd87036073b6318b64b0dcd3089f9fa2c6948 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 2 Dec 1992 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1992-12-02 --- power/dat.h | 1 + power/debugger.c | 14 +++++++++++--- power/trap.c | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/power/dat.h b/power/dat.h index 36eec58d9a7fec588ccb388cef63be0b2cbf9592..15d2ce1a3617e993a6ef42d78cba76f4b1ad08a3 100644 --- a/power/dat.h +++ b/power/dat.h @@ -100,6 +100,7 @@ struct Mach int lastpid; /* last pid allocated on this machine */ Proc *pidproc[NTLBPID]; /* process that owns this tlbpid on this mach */ Page *ufreeme; /* address of upage of exited process */ + Ureg *ur; int tlbfault; /* this offset known in l.s/utlbmiss() */ int tlbpurge; diff --git a/power/debugger.c b/power/debugger.c index 175099c58ad99c203e7be108ca03aef08f19d707..c22a0dc0ba448d2fde7cc1008fc60e72a8ef5b61 100644 --- a/power/debugger.c +++ b/power/debugger.c @@ -4,6 +4,7 @@ #include "dat.h" #include "fns.h" #include "io.h" +#include "ureg.h" IOQ dkbdq; IOQ dprintq; @@ -133,6 +134,7 @@ printinfo(void) Mach *mp; Proc *p; Page *pg; + Ureg *ur; ulong l; int i; @@ -141,8 +143,8 @@ printinfo(void) continue; mp = (void*)(MACHADDR+i*BY2PG); l = (ulong)(mp->proc); - dprint("mach[%d]->proc/ %lux\r\n", i, l); - dprint("mach[%d]->splpc/ %lux\r\n", i, mp->splpc); + dprint("mach[%d] proc/%lux\r\n", i, l); + dprint("mach[%d] splpc/%lux\r\n", i, mp->splpc); if(l & KZERO){ p = (Proc*)l; @@ -150,9 +152,15 @@ printinfo(void) if(l & KZERO){ pg = (Page*)l; l = pg->pa; - dprint("mach[%d]->proc->upage->pa/ %lux\r\n", i, l); + dprint("mach[%d] proc->upage->pa/%lux\r\n", i, l); } } + l = (ulong)(mp->ur); + dprint("mach[%d] ur/%lux", i, l); + ur = (Ureg*)l; + dprint(" &status/%lux &cause/%lux &sp/%lux &pc/%lux", + &ur->status, &ur->cause, &ur->sp, &ur->pc); + dprint("\r\n"); } } diff --git a/power/trap.c b/power/trap.c index 50ec99ef1f47885d0a47fd46878b01b2c57894e4..e641fb8af88d7fcbc6e7f2f54e517fd8f5fe54ed 100644 --- a/power/trap.c +++ b/power/trap.c @@ -72,6 +72,8 @@ trap(Ureg *ur) int user, cop, x, fpchk; char buf[2*ERRLEN], buf1[ERRLEN], *fpexcep; +m->ur = ur; + ecode = (ur->cause>>2)&0xf; user = ur->status&KUP; if(user)