Initial un-working code.
[pintos-anon] / src / devices / timer.c
index 67fe567b48366bae5ba4c965f2a3a6e2ef773611..4b8dd2a47865b8828b9a6f326d4a7f03d970e222 100644 (file)
@@ -3,10 +3,14 @@
 #include "interrupt.h"
 #include "io.h"
   
+#if TIMER_FREQ < 19
+#error 8254 timer requires TIMER_FREQ >= 19
+#endif
+
 static volatile uint64_t ticks;
 
 static void
-irq20_timer (struct intr_args *args UNUSED)
+irq20_timer (struct intr_frame *args UNUSED)
 {
   ticks++;
   intr_yield_on_return ();
@@ -26,7 +30,7 @@ timer_init (void)
   outb (0x40, count & 0xff);
   outb (0x40, count >> 8);
 
-  intr_register (0x20, 0, IF_OFF, irq20_timer);
+  intr_register (0x20, 0, IF_OFF, irq20_timer, "8254 Timer");
 }
 
 uint64_t