ReactOS 0.4.15-dev-7918-g2a2556c
nmi.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Hardware Abstraction Layer
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * PURPOSE: NMI handling
5 * PROGRAMMERS: ReactOS Portable Systems Group
6 */
7
8/* INCLUDES *******************************************************************/
9
10#include <hal.h>
12
13#define NDEBUG
14#include <debug.h>
15
16/* GLOBALS *******************************************************************/
17
19
20/* FUNCTIONS *****************************************************************/
21
22/*
23 * @implemented
24 */
25VOID
28 IN PVOID NmiInfo)
29{
31#ifndef _MINIHAL_
33
34 /* Don't recurse */
37
38 /* Get NMI reason from hardware */
39#if defined(SARCH_PC98)
40 SystemControl.Bits = __inbyte(PPI_IO_i_PORT_B);
41#else
42 SystemControl.Bits = __inbyte(SYSTEM_CONTROL_PORT_B);
43#endif
44
45 /* Switch to boot video */
47 {
48 /* Acquire ownership */
51
52 /* Fill the screen */
55
56 /* Enable text */
60 }
61
62 /* Display NMI failure string */
63 InbvDisplayString("\r\n*** Hardware Malfunction\r\n\r\n");
64 InbvDisplayString("Call your hardware vendor for support\r\n\r\n");
65
66#if defined(SARCH_PC98)
67 /* Check for parity error */
68 if (SystemControl.MemoryParityCheck)
69 {
70 InbvDisplayString("NMI: Parity Check / Memory Parity Error\r\n");
71 }
72 if (SystemControl.ExtendedMemoryParityCheck)
73 {
74 InbvDisplayString("NMI: Parity Check / Extended Memory Parity Error\r\n");
75 }
76#else
77 /* Check for parity error */
78 if (SystemControl.ParityCheck)
79 {
80 InbvDisplayString("NMI: Parity Check / Memory Parity Error\r\n");
81 }
82
83 /* Check for I/O failure */
84 if (SystemControl.ChannelCheck)
85 {
86 InbvDisplayString("NMI: Channel Check / IOCHK\r\n");
87 }
88#endif
89
90 /* Check for EISA systems */
92 {
93 /* FIXME: Not supported */
95 }
96
97 /* Halt the system */
98 InbvDisplayString("\r\n*** The system has halted ***\r\n");
99
100 /* Enter the debugger if possible */
101 KiBugCheckData[0] = (ULONG_PTR)KeServiceDescriptorTable; /* NMI Corruption? */
104#endif /* !_MINIHAL_ */
105
106 /* Freeze the system */
107 while (TRUE)
108 NOTHING;
109}
unsigned char BOOLEAN
#define UNIMPLEMENTED
Definition: debug.h:115
VOID NTAPI KeEnterKernelDebugger(VOID)
Definition: bug.c:1442
ULONG_PTR KiBugCheckData[5]
Definition: bug.c:31
ULONG HalpBusType
Definition: pcibus.c:18
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define ULONG_PTR
Definition: config.h:101
#define SYSTEM_CONTROL_PORT_B
Definition: halhw.h:127
VOID NTAPI InbvAcquireDisplayOwnership(VOID)
Definition: inbv.c:290
VOID NTAPI InbvInstallDisplayStringFilter(_In_ INBV_DISPLAY_STRING_FILTER DisplayFilter)
Definition: inbv.c:387
VOID NTAPI InbvSetTextColor(_In_ ULONG Color)
Definition: inbv.c:460
BOOLEAN NTAPI InbvEnableDisplayString(_In_ BOOLEAN Enable)
Definition: inbv.c:370
BOOLEAN NTAPI InbvDisplayString(_In_ PCHAR String)
Definition: inbv.c:332
BOOLEAN NTAPI InbvResetDisplay(VOID)
Definition: inbv.c:431
VOID NTAPI InbvSetScrollRegion(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom)
Definition: inbv.c:448
VOID NTAPI InbvSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ ULONG Color)
Definition: inbv.c:485
BOOLEAN NTAPI InbvIsBootDriverInstalled(VOID)
Definition: inbv.c:396
#define NOTHING
Definition: input_list.c:10
PPC_QUAL unsigned char __inbyte(const unsigned long Port)
Definition: intrin_ppc.h:539
BOOLEAN KdDebuggerNotPresent
Definition: kddata.c:82
BOOLEAN KdDebuggerEnabled
Definition: kddata.c:83
#define MACHINE_TYPE_EISA
Definition: ketypes.h:114
BOOLEAN HalpNMIInProgress
Definition: nmi.c:18
VOID NTAPI HalHandleNMI(IN PVOID NmiInfo)
Definition: nmi.c:27
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define SCREEN_WIDTH
Definition: pc98video.c:27
#define SCREEN_HEIGHT
Definition: pc98video.c:28
KSERVICE_TABLE_DESCRIPTOR KeServiceDescriptorTable[SSDT_MAX_ENTRIES]
Definition: procobj.c:23
#define ERROR_DBGBREAK(...)
Definition: debug.h:221
#define BV_COLOR_WHITE
Definition: display.h:30
#define BV_COLOR_RED
Definition: display.h:16
#define PPI_IO_i_PORT_B
Definition: sysport.h:19
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39