X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Ftimer.c;h=7c15550fd4100b0bb481965f884788559fc4571a;hb=23da9980e2369687e86d381a13b4a00544dca4da;hp=e0311a42577e27b8945f95abc8a83aad2ef992f2;hpb=d8fc6aa4bc2a5d9cec50923e9d2bd30f867dd50a;p=palacios.releases.git diff --git a/palacios/src/geekos/timer.c b/palacios/src/geekos/timer.c index e0311a4..7c15550 100644 --- a/palacios/src/geekos/timer.c +++ b/palacios/src/geekos/timer.c @@ -2,7 +2,7 @@ * GeekOS timer interrupt support * Copyright (c) 2001,2003 David H. Hovemeyer * Copyright (c) 2003, Jeffrey K. Hollingsworth - * $Revision: 1.4 $ + * $Revision: 1.9 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -19,6 +19,9 @@ #include +/* PAD this currently is in nvram.c */ +extern void deliver_timer_interrupt_to_vmm(uint_t period_us); + /* JRL Add a cpu frequency measurement */ uint_t cpu_khz_freq; @@ -202,27 +205,38 @@ int g_Quantum = DEFAULT_MAX_TICKS; static void Timer_Interrupt_Handler(struct Interrupt_State* state) { - struct Kernel_Thread* current = g_currentThread; + struct Kernel_Thread* current = g_currentThread; Begin_IRQ(state); - SerialPrintLevel(1,"Host Timer Interrupt Handler Running\n"); + +#if 0 +#define STACK_LEN 256 + + SerialPrint("Host Timer Interrupt Handler running\n"); + SerialPrint("Timer====\n"); + Dump_Interrupt_State(state); + // SerialMemDump((unsigned char*)(¤t),STACK_LEN); + SerialPrint("Timer done===\n"); + +#endif /* Update global and per-thread number of ticks */ ++g_numTicks; ++current->numTicks; - /* * If thread has been running for an entire quantum, * inform the interrupt return code that we want * to choose a new thread. */ if (current->numTicks >= g_Quantum) { - g_needReschedule = true; + g_needReschedule = true; } + deliver_timer_interrupt_to_vmm(1000000/HZ); + End_IRQ(state); }