Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / geekos / src / geekos / timer.c
index e287b6e..8409fd7 100644 (file)
@@ -22,6 +22,8 @@
 
 #include <geekos/io_defs.h>
 
+#include <geekos/vmm_stubs.h>
+
 /* PAD this currently is in nvram.c */
 /* JRL: This is completely broken
 extern void deliver_timer_interrupt_to_vmm(uint_t period_us);
@@ -133,11 +135,6 @@ timerEvent pendingTimerEvents[MAX_TIMER_EVENTS];
  */
 volatile ulong_t g_numTicks;
 
-ulong_t clock_time(void){
-       return g_numTicks;
-}
-
-
 /*
  * Number of times the spin loop can execute during one timer tick
  */
@@ -173,6 +170,10 @@ int g_Quantum = DEFAULT_MAX_TICKS;
 #  define Debug(args...)
 #endif
 
+ulong_t clock_time(void){//in millisec
+      return g_numTicks * (1000/HZ);
+}
+
 /* ----------------------------------------------------------------------
  * Private functions
  * ---------------------------------------------------------------------- */
@@ -219,9 +220,9 @@ static void Timer_Interrupt_Handler(struct Interrupt_State* state)
     
   }
   
-  /* JRL: Broken,  
-  deliver_timer_interrupt_to_vmm(1000000/HZ);
-  */
+
+  send_tick_to_vmm(1000000/HZ);
+
   End_IRQ(state);
 }
 
@@ -359,6 +360,8 @@ int Start_Timer(int ticks, timerCallback cb, void * arg)
 
     KASSERT(!Interrupts_Enabled());
 
+    PrintBoth ("there\n");
+
     if (timeEventCount == MAX_TIMER_EVENTS) {
        return -1;
     } else {