ReactOS 0.4.15-dev-8434-g155a7c7
reboot.c
Go to the documentation of this file.
1/*
2 * PROJECT: NEC PC-98 series HAL
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Reboot routine
5 * COPYRIGHT: Copyright 2020 Dmitry Borisov (di.sean@protonmail.com)
6 */
7
8/* INCLUDES ******************************************************************/
9
10#include <hal.h>
11
12/* PRIVATE FUNCTIONS *********************************************************/
13
14#ifndef _MINIHAL_
16VOID
18{
19 /* Disable interrupts and halt the CPU */
20 _disable();
21 __halt();
23}
24#endif
25
27VOID
29{
30 /* Disable interrupts */
31 _disable();
32
33 /* Flush write buffers */
35
36 /* Send the reset command */
40
41 /* Halt the CPU */
42 __halt();
44}
45
46/* PUBLIC FUNCTIONS **********************************************************/
47
48#ifndef _MINIHAL_
49VOID
53{
54 switch (Action)
55 {
56 /* All recognized actions */
57 case HalHaltRoutine:
60
63 {
64 /* Acquire the display */
66
67 /* Call the internal reboot function */
68 HalpReboot();
69 }
70
71 /* Anything else */
72 default:
73 {
74 /* Print message and break */
75 DbgPrint("HalReturnToFirmware called!\n");
77 }
78 }
79}
80#endif // _MINIHAL_
81
82/* EOF */
VOID NTAPI KeFlushWriteBuffer(VOID)
Definition: misc.c:39
#define DbgPrint
Definition: hal.h:12
VOID NTAPI HalReturnToFirmware(_In_ FIRMWARE_REENTRY Action)
Definition: reboot.c:21
DECLSPEC_NORETURN VOID HalpReboot(VOID)
Definition: reboot.c:25
static DECLSPEC_NORETURN VOID HalpFreezeSystem(VOID)
Definition: reboot.c:17
VOID NTAPI InbvAcquireDisplayOwnership(VOID)
Definition: inbv.c:290
NTSYSAPI void WINAPI DbgBreakPoint(void)
void __cdecl _disable(void)
Definition: intrin_arm.h:365
__INTRIN_INLINE void __halt(void)
Definition: intrin_x86.h:1714
#define _In_
Definition: ms_sal.h:308
enum _FIRMWARE_REENTRY FIRMWARE_REENTRY
@ HalRestartRoutine
Definition: haltypes.h:36
@ HalHaltRoutine
Definition: haltypes.h:34
@ HalPowerDownRoutine
Definition: haltypes.h:35
@ HalRebootRoutine
Definition: haltypes.h:37
#define UNREACHABLE
#define DECLSPEC_NORETURN
Definition: ntbasedef.h:176
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
#define CPU_IO_o_RESET
Definition: cpu.h:10
#define PPI_IO_o_CONTROL
Definition: sysport.h:12
#define PPI_SHUTDOWN_0_ENABLE
Definition: sysport.h:16
#define PPI_SHUTDOWN_1_ENABLE
Definition: sysport.h:15
#define NTAPI
Definition: typedefs.h:36
unsigned char * PUCHAR
Definition: typedefs.h:53
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510