Small cleanups, undef TRACE_HPET. Still at priority 0.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35661 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,22 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright 2009-2010, Stefano Ceccherini ([email protected])
|
||||||
* Copyright 2008, Dustin Howett, [email protected]. All rights reserved.
|
* Copyright 2008, Dustin Howett, [email protected]. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
#include <int.h>
|
||||||
|
#include <smp.h>
|
||||||
#include <timer.h>
|
#include <timer.h>
|
||||||
|
|
||||||
|
#include <arch/int.h>
|
||||||
|
#include <arch/cpu.h>
|
||||||
#include <arch/x86/timer.h>
|
#include <arch/x86/timer.h>
|
||||||
#include <arch/x86/arch_hpet.h>
|
#include <arch/x86/arch_hpet.h>
|
||||||
|
|
||||||
#include <boot/kernel_args.h>
|
#include <boot/kernel_args.h>
|
||||||
|
|
||||||
#include <arch/int.h>
|
|
||||||
#include <arch/cpu.h>
|
|
||||||
#include <int.h>
|
|
||||||
#include <vm/vm.h>
|
#include <vm/vm.h>
|
||||||
|
|
||||||
|
|
||||||
#define TRACE_HPET
|
//#define TRACE_HPET
|
||||||
#ifdef TRACE_HPET
|
#ifdef TRACE_HPET
|
||||||
#define TRACE(x) dprintf x
|
#define TRACE(x) dprintf x
|
||||||
#else
|
#else
|
||||||
@@ -47,7 +49,13 @@ struct timer_info gHPETTimer = {
|
|||||||
static int
|
static int
|
||||||
hpet_get_priority()
|
hpet_get_priority()
|
||||||
{
|
{
|
||||||
return 0; // TODO: Should have the highest priority
|
// TODO: Fix HPET in SMP mode.
|
||||||
|
if (smp_get_num_cpus() > 1)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// HPET timers, being off-chip, are more expensive to setup
|
||||||
|
// than the LAPIC.
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -67,6 +75,8 @@ hpet_convert_timeout(const bigtime_t &relativeTimeout)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define MIN_TIMEOUT 3000
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
hpet_set_hardware_timer(bigtime_t relativeTimeout)
|
hpet_set_hardware_timer(bigtime_t relativeTimeout)
|
||||||
{
|
{
|
||||||
@@ -76,8 +86,8 @@ hpet_set_hardware_timer(bigtime_t relativeTimeout)
|
|||||||
sTimer->config |= HPET_CONF_TIMER_INT_ENABLE;
|
sTimer->config |= HPET_CONF_TIMER_INT_ENABLE;
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
if (relativeTimeout < 3000)
|
if (relativeTimeout < MIN_TIMEOUT)
|
||||||
relativeTimeout = 3000;
|
relativeTimeout = MIN_TIMEOUT;
|
||||||
|
|
||||||
bigtime_t timerValue = hpet_convert_timeout(relativeTimeout);
|
bigtime_t timerValue = hpet_convert_timeout(relativeTimeout);
|
||||||
|
|
||||||
@@ -268,8 +278,6 @@ hpet_init(struct kernel_args *args)
|
|||||||
|
|
||||||
int32 configuredIRQ = HPET_GET_CONF_TIMER_INT_ROUTE(sTimer);
|
int32 configuredIRQ = HPET_GET_CONF_TIMER_INT_ROUTE(sTimer);
|
||||||
|
|
||||||
//install_io_interrupt_handler(0xfb - ARCH_INTERRUPT_BASE,
|
|
||||||
//&hpet_timer_interrupt, NULL, B_NO_LOCK_VECTOR);
|
|
||||||
install_io_interrupt_handler(configuredIRQ, &hpet_timer_interrupt,
|
install_io_interrupt_handler(configuredIRQ, &hpet_timer_interrupt,
|
||||||
NULL, B_NO_LOCK_VECTOR);
|
NULL, B_NO_LOCK_VECTOR);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user