summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsc <rsc>2006-09-07 16:52:13 +0000
committerrsc <rsc>2006-09-07 16:52:13 +0000
commit5a71f9330162dd9f8a302c3ed1fa33539acdfdec (patch)
treed12e0f4307f807898b6e4b0610c6d03c5fc2102b
parentab17e3198be3ae4bf50bf02241c5c1abb3128915 (diff)
downloadxv6-labs-5a71f9330162dd9f8a302c3ed1fa33539acdfdec.tar.gz
xv6-labs-5a71f9330162dd9f8a302c3ed1fa33539acdfdec.tar.bz2
xv6-labs-5a71f9330162dd9f8a302c3ed1fa33539acdfdec.zip
debugging rearrangements
-rw-r--r--console.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/console.c b/console.c
index 52ccc10..449c03f 100644
--- a/console.c
+++ b/console.c
@@ -5,6 +5,7 @@
#include "spinlock.h"
#include "dev.h"
#include "param.h"
+#include "mmu.h"
struct spinlock console_lock;
int panicked = 0;
@@ -151,11 +152,17 @@ cprintf(char *fmt, ...)
void
panic(char *s)
{
+ int i;
+ uint pcs[10];
+
__asm __volatile("cli");
use_console_lock = 0;
cprintf("panic (%d): ", cpu());
cprintf(s, 0);
cprintf("\n", 0);
+ getcallerpcs(&s, pcs);
+ for(i=0; i<10; i++)
+ cprintf(" %p", pcs[i]);
panicked = 1; // freeze other CPU
for(;;)
;
@@ -323,22 +330,18 @@ kbd_intr()
acquire(&kbd_lock);
st = inb(KBSTATP);
- if((st & KBS_DIB) == 0){
- release(&kbd_lock);
- return;
- }
+ if((st & KBS_DIB) == 0)
+ goto out;
data = inb(KBDATAP);
if(data == 0xE0) {
shift |= E0ESC;
- release(&kbd_lock);
- return;
+ goto out;
} else if(data & 0x80) {
// Key released
data = (shift & E0ESC ? data : data & 0x7F);
shift &= ~(shiftcode[data] | E0ESC);
- release(&kbd_lock);
- return;
+ goto out;
} else if(shift & E0ESC) {
// Last character was an E0 escape; or with 0x80
data |= 0x80;
@@ -375,12 +378,11 @@ kbd_intr()
if(kbd_w >= KBD_BUF)
kbd_w = 0;
wakeup(&kbd_r);
- } else {
- cprintf("kbd overflow\n");
}
break;
}
+out:
release(&kbd_lock);
}