From 8593bcad87981276728575b026417e2096d6c9eb Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Mon, 28 Sep 2009 13:14:16 +0000 Subject: [PATCH] Use the hpet defines in the source. Also shortened some defines using "TN" instead of "TIMER". It's also the same scheme used in the specs git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33334 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/arch/x86/arch_hpet.h | 17 +++++++++-------- src/system/kernel/arch/x86/timers/x86_hpet.cpp | 6 +++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/headers/private/kernel/arch/x86/arch_hpet.h b/headers/private/kernel/arch/x86/arch_hpet.h index 6c11ca629a..dec91399d4 100644 --- a/headers/private/kernel/arch/x86/arch_hpet.h +++ b/headers/private/kernel/arch/x86/arch_hpet.h @@ -33,14 +33,15 @@ #define HPET_IS_LEGACY(regs) (((regs)->config & HPET_CONF_MASK_LEGACY) >> 1) /* Timer Configuration */ -#define HPET_TIMER_INT_ENB_CNF 0x00000004 -#define HPET_TIMER_TYPE_CNF 0x00000008 -#define HPET_TIMER_PER_INT_CAP 0x00000010 -#define HPET_TIMER_SIZE_CAP 0x00000020 -#define HPET_TIMER_VAL_SET_CNF 0x00000040 -#define HPET_TIMER_32MODE_CNF 0x00000100 -#define HPET_TIMER_TN_FSB_EN_CNF 0x00004000 -#define HPET_TIMER_TN_FSB_INT_DEL_CAP 0x00008000 +#define HPET_TN_INT_TYPE_CNF 0x00000002 +#define HPET_TN_INT_ENB_CNF 0x00000004 +#define HPET_TN_TYPE_CNF 0x00000008 +#define HPET_TN_PER_INT_CAP 0x00000010 +#define HPET_TN_SIZE_CAP 0x00000020 +#define HPET_TN_VAL_SET_CNF 0x00000040 +#define HPET_TN_32MODE_CNF 0x00000100 +#define HPET_TN_FSB_EN_CNF 0x00004000 +#define HPET_TN_FSB_INT_DEL_CAP 0x00008000 #define ACPI_HPET_SIGNATURE "HPET" diff --git a/src/system/kernel/arch/x86/timers/x86_hpet.cpp b/src/system/kernel/arch/x86/timers/x86_hpet.cpp index d39f606617..2d5072cee7 100644 --- a/src/system/kernel/arch/x86/timers/x86_hpet.cpp +++ b/src/system/kernel/arch/x86/timers/x86_hpet.cpp @@ -71,10 +71,10 @@ hpet_set_hardware_timer(bigtime_t relativeTimeout) sHPETRegs->timer[2].config &= (~31 << 9); // Non-periodic mode, edge triggered - sHPETRegs->timer[2].config &= ~(0x8 & 0x2); + sHPETRegs->timer[2].config &= ~(HPET_TN_TYPE_CNF & HPET_TN_INT_TYPE_CNF); // Enable timer - sHPETRegs->timer[2].config |= 0x4; + sHPETRegs->timer[2].config |= HPET_TN_INT_ENB_CNF; restore_interrupts(state); @@ -86,7 +86,7 @@ static status_t hpet_clear_hardware_timer() { // Disable timer - sHPETRegs->timer[2].config &= ~0x4; + sHPETRegs->timer[2].config &= ~HPET_TN_INT_ENB_CNF; return B_OK; }