4339d8081b1d98f234d665033fb4a081289f2ea6
[reactos.git] / reactos / hal / halx86 / misc.c
1 /* $Id: misc.c,v 1.8 2004/11/28 01:30:01 hbirr Exp $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/hal/x86/misc.c
6 * PURPOSE: Miscellaneous hardware functions
7 * PROGRAMMER: Eric Kohl (ekohl@rz-online.de)
8 */
9
10 /* INCLUDES *****************************************************************/
11
12 #include <roscfg.h>
13 #include <ddk/ntddk.h>
14 #include <hal.h>
15
16 #ifdef MP
17 #include <apic.h>
18 #endif
19
20 #define NDEBUG
21 #include <internal/debug.h>
22
23 /* FUNCTIONS ****************************************************************/
24
25 #ifdef MP
26
27 VOID
28 HaliReconfigurePciInterrupts(VOID);
29
30 #endif
31
32 VOID STDCALL
33 HalHandleNMI(ULONG Unused)
34 {
35 UCHAR ucStatus;
36
37 ucStatus = READ_PORT_UCHAR((PUCHAR) 0x61);
38
39 HalDisplayString ("\n*** Hardware Malfunction\n\n");
40 HalDisplayString ("Call your hardware vendor for support\n\n");
41
42 if (ucStatus & 0x80)
43 HalDisplayString ("NMI: Parity Check / Memory Parity Error\n");
44
45 if (ucStatus & 0x40)
46 HalDisplayString ("NMI: Channel Check / IOCHK\n");
47
48 HalDisplayString ("\n*** The system has halted ***\n");
49 KeEnterKernelDebugger ();
50 }
51
52
53 VOID STDCALL
54 HalProcessorIdle(VOID)
55 {
56 #if 1
57 Ki386EnableInterrupts();
58 Ki386HaltProcessor();
59 #else
60
61 #endif
62 }
63
64 VOID STDCALL
65 HalRequestIpi(ULONG ProcessorNo)
66 {
67 DPRINT("HalRequestIpi(ProcessorNo %d)\n", ProcessorNo);
68 #ifdef MP
69 APICSendIPI(1 << ProcessorNo,
70 IPI_VECTOR|APIC_ICR0_LEVEL_DEASSERT|APIC_ICR0_DESTM);
71 #endif
72 }
73
74 ULONG FASTCALL
75 HalSystemVectorDispatchEntry (
76 ULONG Unknown1,
77 ULONG Unknown2,
78 ULONG Unknown3
79 )
80 {
81 return 0;
82 }
83
84
85 VOID STDCALL
86 KeFlushWriteBuffer(VOID)
87 {
88 return;
89 }
90
91
92 VOID STDCALL
93 HalReportResourceUsage(VOID)
94 {
95 /*
96 * FIXME: Report all resources used by hal.
97 * Calls IoReportHalResourceUsage()
98 */
99
100 /* Initialize PCI bus. */
101 HalpInitPciBus ();
102 #ifdef MP
103
104 HaliReconfigurePciInterrupts();
105 #endif
106
107 }
108
109 /* EOF */