ReactOS 0.4.15-dev-5666-gc548b97
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#define NDEBUG
13#include <debug.h>
14
15/* PRIVATE FUNCTIONS *********************************************************/
16
17static VOID
21{
23
24 while (TRUE)
25 NOTHING;
26}
27
28VOID
31{
32 /* Disable interrupts */
33 _disable();
34
35 /* Flush write buffers */
37
38 /* Send the reset command */
42
43 /* Halt the CPU */
44 __halt();
45}
46
47/* PUBLIC FUNCTIONS **********************************************************/
48
49VOID
53{
54 switch (Action)
55 {
58
59 case HalHaltRoutine:
61#ifndef _MINIHAL_
62 /* Acquire the display */
64#endif
65
66 /* Call the internal reboot function */
67 HalpReboot();
68
69 /* Anything else */
70 default:
71 /* Print message and break */
72 DbgPrint("HalReturnToFirmware called!\n");
74 }
75}
#define TRUE
Definition: types.h:120
VOID NTAPI KeFlushWriteBuffer(VOID)
Definition: misc.c:39
#define DbgPrint
Definition: hal.h:12
VOID NTAPI HaliHaltSystem(VOID)
Definition: processor.c:21
VOID NTAPI HalReturnToFirmware(IN FIRMWARE_REENTRY Action)
Definition: reboot.c:22
VOID NTAPI HalpReboot(VOID)
Definition: reboot.c:28
static VOID DECLSPEC_NORETURN NTAPI HalpFreezeSystem(VOID)
Definition: reboot.c:20
VOID NTAPI InbvAcquireDisplayOwnership(VOID)
Definition: inbv.c:289
NTSYSAPI void WINAPI DbgBreakPoint(void)
#define NOTHING
Definition: input_list.c:10
void __cdecl _disable(void)
Definition: intrin_arm.h:365
__INTRIN_INLINE void __halt(void)
Definition: intrin_x86.h:1714
unsigned char * PUCHAR
Definition: retypes.h:3
#define _In_
Definition: ms_sal.h:308
enum _FIRMWARE_REENTRY FIRMWARE_REENTRY
@ HalHaltRoutine
Definition: haltypes.h:34
@ HalPowerDownRoutine
Definition: haltypes.h:35
@ HalRebootRoutine
Definition: haltypes.h:37
#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
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510