From c269c1f512423d2b9bc103d57630780ec2e66b15 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 15 Oct 2009 21:40:00 +0000 Subject: [PATCH] [HAL] - Implement HalpQuery8254Counter - replace Ke386HaltProcessor() with __halt() - remove excess #endif svn path=/branches/ros-amd64-bringup/; revision=43504 --- reactos/hal/halamd64/generic/systimer.S | 28 +++++++++++++++++++++++++ reactos/hal/halamd64/up/processor.c | 2 +- reactos/hal/halx86/mp/apic.c | 1 - 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/reactos/hal/halamd64/generic/systimer.S b/reactos/hal/halamd64/generic/systimer.S index 298cea2619f..79d282a56ff 100644 --- a/reactos/hal/halamd64/generic/systimer.S +++ b/reactos/hal/halamd64/generic/systimer.S @@ -53,6 +53,34 @@ Done: ret 4 .endfunc + +.globl _HalpQuery8254Counter +.func HalpQuery8254Counter +_HalpQuery8254Counter: + + /* Save EFLAGS and disable interrupts */ + pushfq + cli + + /* Set timer data */ + mov al, 0 + out 0x43, al + jmp $+2 + + /* Read current timer */ + in al, 0x40 + jmp $+2 + movzx ecx, al + in al, 0x40 + mov ch, al + + /* Return it and restore interrupt state */ + mov eax, ecx + popfq + ret +.endfunc + + .global _KeQueryPerformanceCounter .func KeQueryPerformanceCounter _KeQueryPerformanceCounter: diff --git a/reactos/hal/halamd64/up/processor.c b/reactos/hal/halamd64/up/processor.c index 669c82b5910..1104ed3aa0c 100644 --- a/reactos/hal/halamd64/up/processor.c +++ b/reactos/hal/halamd64/up/processor.c @@ -70,7 +70,7 @@ HalProcessorIdle(VOID) { /* Enable interrupts and halt the processor */ _enable(); - Ke386HaltProcessor(); + __halt(); } /* diff --git a/reactos/hal/halx86/mp/apic.c b/reactos/hal/halx86/mp/apic.c index 0702a34e12d..f7c6e60f3fd 100644 --- a/reactos/hal/halx86/mp/apic.c +++ b/reactos/hal/halx86/mp/apic.c @@ -882,7 +882,6 @@ SetInterruptGate(ULONG index, ULONG_PTR address) idt->Access = Access.Value; idt->ExtendedOffset = (USHORT)(address >> 16); #endif -#endif } VOID HaliInitBSP(VOID)