3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: hal/halx86/generic/reboot.c
5 * PURPOSE: Reboot functions
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 * Eric Kohl (ekohl@abo.rhein-zeitung.de)
10 /* INCLUDES ******************************************************************/
16 /* PRIVATE FUNCTIONS *********************************************************/
20 HalpWriteResetCommand(VOID
)
22 /* Generate RESET signal via keyboard controller */
23 WRITE_PORT_UCHAR((PUCHAR
)0x64, 0xFE);
31 PVOID HalpZeroPageMapping
;
32 PHYSICAL_ADDRESS Null
= {{0, 0}};
34 /* Enable warm reboot */
35 HalpZeroPageMapping
= MmMapIoSpace(Null
, PAGE_SIZE
, MmNonCached
);
36 ((PUSHORT
)HalpZeroPageMapping
)[0x239] = 0x1234;
38 /* FIXME: Lock CMOS Access */
40 /* Disable interrupts */
43 /* Setup control register B */
44 WRITE_PORT_UCHAR((PUCHAR
)0x70, 0x0B);
45 KeStallExecutionProcessor(1);
47 /* Read periodic register and clear the interrupt enable */
48 Data
= READ_PORT_UCHAR((PUCHAR
)0x71);
49 WRITE_PORT_UCHAR((PUCHAR
)0x71, Data
& ~0x40);
50 KeStallExecutionProcessor(1);
52 /* Setup control register A */
53 WRITE_PORT_UCHAR((PUCHAR
)0x70, 0x0A);
54 KeStallExecutionProcessor(1);
56 /* Read divider rate and reset it */
57 Data
= READ_PORT_UCHAR((PUCHAR
)0x71);
58 WRITE_PORT_UCHAR((PUCHAR
)0x71, (Data
& ~0x9) | 0x06);
59 KeStallExecutionProcessor(1);
61 /* Reset neutral CMOS address */
62 WRITE_PORT_UCHAR((PUCHAR
)0x70, 0x15);
63 KeStallExecutionProcessor(1);
65 /* Flush write buffers and send the reset command */
67 HalpWriteResetCommand();
73 /* PUBLIC FUNCTIONS **********************************************************/
80 HalReturnToFirmware(IN FIRMWARE_REENTRY Action
)
82 /* Check the kind of action this is */
85 /* All recognized actions */
87 case HalRebootRoutine
:
89 /* Call the internal reboot function */
95 /* Print message and break */
96 DbgPrint("HalReturnToFirmware called!\n");