X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=src%2Fthreads%2Finterrupt.c;h=72b37837dcf420f98110b4e1ab23c838b3704a29;hp=6d3f6bb2e269a909de1cce3cdc8ea9d14ae888b5;hb=2e8d8e1e1d4aa9c90b78c6d40bc315dd4e5270b9;hpb=9b71820d82e2a9e96ab57165861592b2d74e92e5 diff --git a/src/threads/interrupt.c b/src/threads/interrupt.c index 6d3f6bb..72b3783 100644 --- a/src/threads/interrupt.c +++ b/src/threads/interrupt.c @@ -355,16 +355,23 @@ intr_handler (struct intr_frame *frame) yield_on_return = false; } - /* Invoke the interrupt's handler. - If there is no handler, invoke the unexpected interrupt - handler. */ + /* Invoke the interrupt's handler. */ handler = intr_handlers[frame->vec_no]; - if (handler == NULL) + if (handler != NULL) + handler (frame); + else if (frame->vec_no == 0x27 || frame->vec_no == 0x2f) { + /* There is no handler, but this interrupt can trigger + spuriously due to a hardware fault or hardware race + condition. Ignore it. */ + } + else + { + /* No handler and not spurious. Invoke the unexpected + interrupt handler. */ intr_dump_frame (frame); - PANIC ("Unexpected interrupt"); + PANIC ("Unexpected interrupt"); } - handler (frame); /* Complete the processing of an external interrupt. */ if (external)