Improve basic alarm clock test.
[pintos-anon] / src / threads / interrupt.c
index fca145e10b96244cd8ee2872f76f46c432528854..c886cc9d709ab71a3c4bc870eb758ea92321b1a5 100644 (file)
@@ -3,6 +3,7 @@
 #include <inttypes.h>
 #include <stdint.h>
 #include <stdio.h>
+#include "threads/flags.h"
 #include "threads/intr-stubs.h"
 #include "threads/io.h"
 #include "threads/mmu.h"
@@ -50,7 +51,7 @@ intr_get_level (void)
 {
   uint32_t flags;
   
-  asm ("pushfl; popl %0" : "=g" (flags));
+  asm volatile ("pushfl; popl %0" : "=g" (flags));
 
   return flags & FLAG_IF ? INTR_ON : INTR_OFF;
 }
@@ -117,6 +118,7 @@ intr_init (void)
   intr_names[11] = "#NP Segment Not Present";
   intr_names[12] = "#SS Stack Fault Exception";
   intr_names[13] = "#GP General Protection Exception";
+  intr_names[14] = "#PF Page-Fault Exception";
   intr_names[16] = "#MF x87 FPU Floating-Point Error";
   intr_names[17] = "#AC Alignment Check Exception";
   intr_names[18] = "#MC Machine-Check Exception";