2 * FILE: hal/halx86/generic/timer.S
3 * COPYRIGHT: See COPYING in the top level directory
4 * PURPOSE: System Timer Interrupt and Management
5 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
8 /* INCLUDES ******************************************************************/
11 #include <ndk/amd64/asmmacro.S>
13 /* GLOBALS *******************************************************************/
18 .asciz "\n\x7\x7!!! Unhandled or Unexpected Code at line: %lx!!!\n"
20 .global _MsgUnimplemented
22 .asciz "WARNING: %s at %s:%d is UNIMPLEMENTED!\n"
25 /* FUNCTIONS *****************************************************************/
30 .global _HalpReleaseCmosSpinLock
31 .func HalpReleaseCmosSpinLock
32 _HalpReleaseCmosSpinLock:
36 .global _HalpAcquireSystemHardwareSpinLock
37 .func HalpAcquireSystemHardwareSpinLock
38 _HalpAcquireSystemHardwareSpinLock:
42 .global _HalpCalibrateStallExecution@0
43 .func HalpCalibrateStallExecution@0
44 _HalpCalibrateStallExecution@0:
48 .globl _HalpProfileInterrupt
49 .func HalpProfileInterrupt
50 _HalpProfileInterrupt:
55 .globl _KeStallExecutionProcessor
56 .func KeStallExecutionProcessor
57 _KeStallExecutionProcessor:
59 /* Get the number of microseconds required */
62 /* Multiply by the stall factor */
63 mov eax, gs:[KPCR_STALL_SCALE_FACTOR]
66 /* Align to 16 bytes */
69 /* Jump to subtraction loop */
72 /* Align to 16 bytes */
75 /* Subtract one count */
86 .globl _HalpQuery8254Counter
87 .func HalpQuery8254Counter
88 _HalpQuery8254Counter:
90 /* Save EFLAGS and disable interrupts */
99 /* Read current timer */
106 /* Return it and restore interrupt state */
112 .globl _HalpClockInterrupt
113 .func HalpClockInterrupt
115 UNIMPLEMENTED _HalpClockInterrupt