From 6ec3bac45a8b4f87b7c1d35e8b4f8af47ed465af Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Fri, 11 Jan 2002 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2002-01-11 --- mtx/l.s | 2 ++ mtx/trap.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/mtx/l.s b/mtx/l.s index 96a56de7589a45064581f16da6ced6ff66b63b90..8862811f714a728f309db7bae8a8f3925512f8da 100644 --- a/mtx/l.s +++ b/mtx/l.s @@ -349,6 +349,7 @@ TEXT trapvec(SB), $-4 MOVW R0, R2 BL saveureg(SB) BL trap(SB) +// BL splhi(SB) /* BUG? */ BR restoreureg ktrap: MOVW R1, CR @@ -357,6 +358,7 @@ ktrap: SUB $UREGSPACE, R1 BL saveureg(SB) BL trap(SB) +// BL splhi(SB) /* BUG? */ BR restoreureg /* diff --git a/mtx/trap.c b/mtx/trap.c index ebc7270f2398c92da1b74401e966da71111b7c0f..d97ba1021edfc1dafa428c027b57ecb9dc58a390 100644 --- a/mtx/trap.c +++ b/mtx/trap.c @@ -208,6 +208,8 @@ char *regname[]={ "R30", "R31", }; +static int lastecode; + void trap(Ureg *ur) { @@ -272,6 +274,7 @@ trap(Ureg *ur) panic("%s", excname[ecode]); panic("unknown trap/intr: %d\n", ecode); } +lastecode = ecode; if(user && (up->procctl || up->nnote)){ splhi(); @@ -295,6 +298,8 @@ faultpower(Ureg *ureg, ulong addr, int read) dumpregs(ureg); panic("fault: 0x%lux", addr); } +dumpregs(ureg); +print("last ecode %x\n", lastecode); sprint(buf, "sys: trap: fault %s addr=0x%lux", read? "read" : "write", addr); postnote(up, 1, buf, NDebug); }