Return type KIRQL fixed to allow compilation.
[reactos.git] / reactos / ntoskrnl / hal / x86 / reboot.c
1 /* $Id: reboot.c,v 1.4 2000/03/19 13:34:47 ekohl Exp $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/hal/x86/reboot.c
6 * PURPOSE: Reboot functions.
7 * PROGRAMMER: Eric Kohl (ekohl@abo.rhein-zeitung.de)
8 * UPDATE HISTORY:
9 * Created 11/10/99
10 */
11
12
13 #include <ddk/ntddk.h>
14 #include <internal/hal.h>
15 #include <internal/i386/io.h>
16
17
18 static VOID
19 HalReboot (VOID)
20 {
21 char data;
22 BYTE *mem;
23
24 /* enable warm reboot */
25 mem = (BYTE *)(0xd0000000 + 0x0000);
26 // mem = HalMapPhysicalMemory (0, 1);
27 mem[0x472] = 0x34;
28 mem[0x473] = 0x12;
29
30 /* disable interrupts */
31 __asm__("cli\n");
32
33 /* disable periodic interrupt (RTC) */
34 outb_p (0x70, 0x0b);
35 data = inb_p (0x71);
36 outb_p (0x71, data & 0xbf);
37
38 /* */
39 outb_p (0x70, 0x0a);
40 data = inb_p (0x71);
41 outb_p (0x71, (data & 0xf0) | 0x06);
42
43 /* */
44 outb_p (0x70, 0x15);
45
46 /* generate RESET signal via keyboard controller */
47 outb_p (0x64, 0xfe);
48
49 /* stop the processor */
50 __asm__("hlt\n");
51 }
52
53
54 VOID
55 STDCALL
56 HalReturnToFirmware (
57 ULONG Action
58 )
59 {
60 if (Action == FIRMWARE_HALT)
61 {
62 DbgPrint ("HalReturnToFirmware called!\n");
63 DbgBreakPoint ();
64 }
65 else if (Action == FIRMWARE_REBOOT)
66 {
67 HalResetDisplay ();
68 HalReboot ();
69 }
70 }
71
72 /* EOF */