ReactOS  0.4.13-dev-563-g0561610
misc.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS HAL
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: hal/halppc/generic/misc.c
5  * PURPOSE: Miscellanous Routines
6  * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7  * Eric Kohl
8  */
9 
10 /* INCLUDES ******************************************************************/
11 
12 #include <hal.h>
13 #define NDEBUG
14 #include <debug.h>
15 
16 /* PRIVATE FUNCTIONS *********************************************************/
17 
18 VOID
19 NTAPI
21 {
22  /* Nothing to do on non-ACPI */
23  return;
24 }
25 
26 PVOID
27 NTAPI
29  IN ULONG NumberPage)
30 {
31  /* Use kernel memory manager I/O map facilities */
33  NumberPage << PAGE_SHIFT,
34  MmNonCached);
35 }
36 
37 VOID
38 NTAPI
40  IN ULONG NumberPages)
41 {
42  /* Use kernel memory manager I/O map facilities */
43  MmUnmapIoSpace(VirtualAddress, NumberPages << PAGE_SHIFT);
44 }
45 
46 /* FUNCTIONS *****************************************************************/
47 
48 /*
49  * @implemented
50  */
51 VOID
52 NTAPI
54 {
55  UCHAR ucStatus;
56 
57  /* Get the NMI Flag */
58  ucStatus = READ_PORT_UCHAR((PUCHAR)0x61);
59 
60  /* Display NMI failure string */
61  HalDisplayString ("\r\n*** Hardware Malfunction\r\n\r\n");
62  HalDisplayString ("Call your hardware vendor for support\r\n\r\n");
63 
64  /* Check for parity error */
65  if (ucStatus & 0x80)
66  {
67  /* Display message */
68  HalDisplayString ("NMI: Parity Check / Memory Parity Error\r\n");
69  }
70 
71  /* Check for I/O failure */
72  if (ucStatus & 0x40)
73  {
74  /* Display message */
75  HalDisplayString ("NMI: Channel Check / IOCHK\r\n");
76  }
77 
78  /* Halt the system */
79  HalDisplayString("\r\n*** The system has halted ***\r\n");
80  //KeEnterKernelDebugger();
81 }
82 
83 /*
84  * @implemented
85  */
86 UCHAR
89  OUT PKINTERRUPT_ROUTINE **FlatDispatch,
90  OUT PKINTERRUPT_ROUTINE *NoConnection)
91 {
92  /* Not implemented on x86 */
93  return FALSE;
94 }
95 
96 /*
97  * @implemented
98  */
99 VOID
100 NTAPI
102 {
103  /* Not implemented on x86 */
104  return;
105 }
#define PAGE_SHIFT
Definition: env_spec_w32.h:45
#define IN
Definition: typedefs.h:38
VOID NTAPI HalpCheckPowerButton(VOID)
Definition: misc.c:20
unsigned char * PUCHAR
Definition: retypes.h:3
UCHAR NTAPI READ_PORT_UCHAR(PUCHAR Address)
Definition: mach.c:535
PVOID NTAPI MmMapIoSpace(IN PHYSICAL_ADDRESS PhysicalAddress, IN SIZE_T NumberOfBytes, IN MEMORY_CACHING_TYPE CacheType)
Definition: iosup.c:47
#define FASTCALL
Definition: nt_native.h:50
VOID NTAPI HalHandleNMI(IN PVOID NmiInfo)
Definition: misc.c:53
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
PVOID NTAPI HalpMapPhysicalMemory64(IN PHYSICAL_ADDRESS PhysicalAddress, IN ULONG NumberPage)
Definition: misc.c:28
VOID(NTAPI * PKINTERRUPT_ROUTINE)(VOID)
Definition: ketypes.h:490
UCHAR FASTCALL HalSystemVectorDispatchEntry(IN ULONG Vector, OUT PKINTERRUPT_ROUTINE **FlatDispatch, OUT PKINTERRUPT_ROUTINE *NoConnection)
Definition: misc.c:24
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
Definition: iotypes.h:1060
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID NTAPI HalpUnmapVirtualAddress(IN PVOID VirtualAddress, IN ULONG NumberPages)
Definition: misc.c:39
_In_ ULONG _In_ BOOLEAN _Must_inspect_result_ PVOID * VirtualAddress
Definition: ndis.h:3791
VOID NTAPI KeFlushWriteBuffer(VOID)
Definition: misc.c:39
VOID NTAPI MmUnmapIoSpace(IN PVOID BaseAddress, IN SIZE_T NumberOfBytes)
Definition: iosup.c:193
NTHALAPI VOID NTAPI HalDisplayString(PUCHAR String)
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1