From 4b4e08cc672e6ef5d9554c7a78483aaa5ea42deb Mon Sep 17 00:00:00 2001 From: Marcus Overhagen Date: Tue, 25 Dec 2007 14:52:49 +0000 Subject: [PATCH] added more debug output git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23155 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/x86/arch_timer.c | 9 +++++++++ src/system/kernel/timer.c | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/src/system/kernel/arch/x86/arch_timer.c b/src/system/kernel/arch/x86/arch_timer.c index c1ef853ea4..94578a4818 100644 --- a/src/system/kernel/arch/x86/arch_timer.c +++ b/src/system/kernel/arch/x86/arch_timer.c @@ -25,6 +25,13 @@ #include "interrupts.h" +//#define TRACE_TIMER +#ifdef TRACE_TIMER +# define TRACE(x) dprintf x +#else +# define TRACE(x) ; +#endif + #define PIT_CLOCK_RATE 1193180 #define PIT_MAX_TIMER_INTERVAL (0xffff * 1000000ll / PIT_CLOCK_RATE) @@ -75,6 +82,7 @@ apic_timer_interrupt(void) void arch_timer_set_hardware_timer(bigtime_t timeout) { + TRACE(("arch_timer_set_hardware_timer: timeout %lld\n", timeout)); // try the apic timer first if (arch_smp_set_apic_timer(timeout) != B_OK) set_isa_hardware_timer(timeout); @@ -84,6 +92,7 @@ arch_timer_set_hardware_timer(bigtime_t timeout) void arch_timer_clear_hardware_timer(void) { + TRACE(("arch_timer_clear_hardware_timer\n")); if (arch_smp_clear_apic_timer() != B_OK) clear_isa_hardware_timer(); } diff --git a/src/system/kernel/timer.c b/src/system/kernel/timer.c index 73c6a1f303..099ebd09a7 100644 --- a/src/system/kernel/timer.c +++ b/src/system/kernel/timer.c @@ -93,6 +93,8 @@ restart_scan: release_spinlock(spinlock); + TRACE(("timer_interrupt: calling hook %p for event %p\n", event->hook, event)); + // call the callback // note: if the event is not periodic, it is ok // to delete the event structure inside the callback @@ -140,6 +142,8 @@ add_timer(timer *event, timer_hook hook, bigtime_t period, int32 flags) if (event == NULL || hook == NULL || period < 0) return B_BAD_VALUE; + TRACE(("add_timer: event %p\n", event)); + scheduleTime = period; if (flags != B_ONE_SHOT_ABSOLUTE_TIMER) scheduleTime += currentTime; @@ -214,6 +218,8 @@ cancel_timer(timer *event) int currentCPU = smp_get_current_cpu(); cpu_status state; + TRACE(("cancel_timer: event %p\n", event)); + state = disable_interrupts(); // walk through all of the cpu's timer queues