projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adopt consistent style in asm statements.
[pintos-anon]
/
src
/
threads
/
interrupt.c
diff --git
a/src/threads/interrupt.c
b/src/threads/interrupt.c
index 29aea870ba547e4e67a5534c36c2f498e82c03e6..075962f5081cc09b4295ff87a35b8d9f057148e3 100644
(file)
--- a/
src/threads/interrupt.c
+++ b/
src/threads/interrupt.c
@@
-6,8
+6,8
@@
#include "threads/flags.h"
#include "threads/intr-stubs.h"
#include "threads/io.h"
#include "threads/flags.h"
#include "threads/intr-stubs.h"
#include "threads/io.h"
-#include "threads/mmu.h"
#include "threads/thread.h"
#include "threads/thread.h"
+#include "threads/vaddr.h"
#include "devices/timer.h"
/* Number of x86 interrupts. */
#include "devices/timer.h"
/* Number of x86 interrupts. */
@@
-95,7
+95,7
@@
intr_disable (void)
/* Disable interrupts by clearing the interrupt flag.
See [IA32-v2b] "CLI" and [IA32-v3a] 5.8.1 "Masking Maskable
Hardware Interrupts". */
/* Disable interrupts by clearing the interrupt flag.
See [IA32-v2b] "CLI" and [IA32-v3a] 5.8.1 "Masking Maskable
Hardware Interrupts". */
- asm volatile ("cli");
+ asm volatile ("cli"
: : : "memory"
);
return old_level;
}
return old_level;
}
@@
-118,7
+118,7
@@
intr_init (void)
See [IA32-v2a] "LIDT" and [IA32-v3a] 5.10 "Interrupt
Descriptor Table (IDT)". */
idtr_operand = make_idtr_operand (sizeof idt - 1, idt);
See [IA32-v2a] "LIDT" and [IA32-v3a] 5.10 "Interrupt
Descriptor Table (IDT)". */
idtr_operand = make_idtr_operand (sizeof idt - 1, idt);
- asm volatile ("lidt %0" :: "m" (idtr_operand));
+ asm volatile ("lidt %0" :
: "m" (idtr_operand));
/* Initialize intr_names. */
for (i = 0; i < INTR_CNT; i++)
/* Initialize intr_names. */
for (i = 0; i < INTR_CNT; i++)
@@
-355,16
+355,23
@@
intr_handler (struct intr_frame *frame)
yield_on_return = false;
}
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];
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);
intr_dump_frame (frame);
- PANIC ("Unexpected interrupt");
+ PANIC ("Unexpected interrupt");
}
}
- handler (frame);
/* Complete the processing of an external interrupt. */
if (external)
/* Complete the processing of an external interrupt. */
if (external)