X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Finterrupt.c;h=5227486f4212c3d6ccab71f1e998c39fbef9ec8c;hb=787ccae300cef13f0dabd4d6b0633b90d783dbc5;hp=dc4b31ba3d5a0256f57fd1a0bc84aae15419d7e8;hpb=8d75e156311e8224d1c54ae6912fefd4a5ff059d;p=pintos-anon diff --git a/src/threads/interrupt.c b/src/threads/interrupt.c index dc4b31b..5227486 100644 --- a/src/threads/interrupt.c +++ b/src/threads/interrupt.c @@ -88,10 +88,13 @@ pic_init (void) If we don't acknowledge the IRQ, we'll never get it again, so this is important. */ static void -pic_eoi (void) +pic_eoi (int irq) { /* FIXME? The Linux code is much more complicated. */ + ASSERT (irq >= 0x20 && irq < 0x30); outb (0x20, 0x20); + if (irq >= 0x28) + outb (0xa0, 0x20); } #define INTR_CNT 256 @@ -133,7 +136,7 @@ intr_handler (struct intr_frame *args) ASSERT (intr_get_level () == IF_OFF); ASSERT (intr_context ()); intr_in_progress = false; - pic_eoi (); + pic_eoi (args->vec_no); if (yield_on_return) thread_yield (); @@ -266,7 +269,7 @@ void intr_panic (struct intr_frame *regs) { dump_intr_frame (regs); - panic ("Panic!"); + PANIC ("Panic!"); } void @@ -275,8 +278,8 @@ intr_kill (struct intr_frame *f) switch (f->cs) { case SEL_UCSEG: - printk ("[%p] Interrupt %#04x (%s), killing process.\n", - thread_current (), f->vec_no, intr_name (f->vec_no)); + printk ("%s: dying due to interrupt %#04x (%s).\n", + thread_current ()->name, f->vec_no, intr_name (f->vec_no)); thread_exit (); case SEL_KCSEG: