From 521a945c90b0f5226cc96cda4ec2f4ec37d7443a Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Fri, 22 Aug 2008 07:57:50 +0000 Subject: [PATCH] (part of) a patch by Dustin Howett (GSOC) which implements HPET timers. I'm committing this work split in small patches, since HPET timers aren't working correctly yet, and I won't commit the parts which don't work. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27127 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/x86/arch_timer.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/system/kernel/arch/x86/arch_timer.c b/src/system/kernel/arch/x86/arch_timer.c index b9e0710f87..f1e8ce9ad6 100644 --- a/src/system/kernel/arch/x86/arch_timer.c +++ b/src/system/kernel/arch/x86/arch_timer.c @@ -37,9 +37,9 @@ extern timer_info gAPICTimer; extern timer_info gHPETTimer; static timer_info *sTimers[] = { - &gPITTimer, +// &gHPETTimer, &gAPICTimer, - &gHPETTimer, + &gPITTimer, NULL }; @@ -70,14 +70,18 @@ arch_init_timer(kernel_args *args) cpu_status state = disable_interrupts(); for (i = 0; (timer = sTimers[i]) != NULL; i++) { - int priority; + int priority = timer->get_priority(); + + if (priority < bestPriority) { + TRACE(("arch_init_timer: Skipping %s because there is a higher priority timer (%s) initialized.\n", timer->name, sTimer->name)); + continue; + } + if (timer->init(args) != B_OK) { TRACE(("arch_init_timer: %s failed init. Skipping.\n", timer->name)); continue; } - priority = timer->get_priority(); - if (priority > bestPriority) { bestPriority = priority; sTimer = timer;