3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: hal/halx86/generic/misc.c
5 * PURPOSE: Miscellanous Routines
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 * Eric Kohl (ekohl@abo.rhein-zeitung.de)
10 /* INCLUDES ******************************************************************/
16 /* PRIVATE FUNCTIONS *********************************************************/
20 HalpCheckPowerButton(VOID
)
22 /* Nothing to do on non-ACPI */
28 HalpMapPhysicalMemory64(IN PHYSICAL_ADDRESS PhysicalAddress
,
31 /* Use kernel memory manager I/O map facilities */
32 return MmMapIoSpace(PhysicalAddress
,
33 NumberPage
<< PAGE_SHIFT
,
39 HalpUnmapVirtualAddress(IN PVOID VirtualAddress
,
42 /* Use kernel memory manager I/O map facilities */
43 MmUnmapIoSpace(VirtualAddress
, NumberPages
<< PAGE_SHIFT
);
48 HalpSetInterruptGate(ULONG Index
, PVOID address
)
53 /* Set the IDT Access Bits */
56 Access
.Dpl
= 0; /* Kernel-Mode */
57 Access
.SystemSegmentFlag
= 0;
58 Access
.SegmentType
= I386_INTERRUPT_GATE
;
60 idt
= (KIDTENTRY
*)((ULONG
)KeGetPcr()->IDT
+ index
* sizeof(KIDTENTRY
));
61 idt
->Offset
= (USHORT
)((ULONG_PTR
)address
& 0xffff);
62 idt
->Selector
= KGDT_R0_CODE
;
63 idt
->Access
= Access
.Value
;
64 idt
->ExtendedOffset
= (USHORT
)((ULONG_PTR
)address
>> 16);
67 /* FUNCTIONS *****************************************************************/
74 HalHandleNMI(IN PVOID NmiInfo
)
78 /* Get the NMI Flag */
79 ucStatus
= READ_PORT_UCHAR((PUCHAR
)0x61);
81 /* Display NMI failure string */
82 HalDisplayString ("\n*** Hardware Malfunction\n\n");
83 HalDisplayString ("Call your hardware vendor for support\n\n");
85 /* Check for parity error */
89 HalDisplayString ("NMI: Parity Check / Memory Parity Error\n");
92 /* Check for I/O failure */
96 HalDisplayString ("NMI: Channel Check / IOCHK\n");
100 HalDisplayString("\n*** The system has halted ***\n");
101 //KeEnterKernelDebugger();
109 HalSystemVectorDispatchEntry(IN ULONG Vector
,
110 OUT PKINTERRUPT_ROUTINE
**FlatDispatch
,
111 OUT PKINTERRUPT_ROUTINE
*NoConnection
)
113 /* Not implemented on x86 */
122 KeFlushWriteBuffer(VOID
)
124 /* Not implemented on x86 */