ReactOS  0.4.15-dev-2528-g5506091
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 
17 static VOID
19 NTAPI
21 {
23 
24  while (TRUE)
25  NOTHING;
26 }
27 
28 VOID
29 NTAPI
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 
49 VOID
50 NTAPI
53 {
54  switch (Action)
55  {
58 
59  case HalHaltRoutine:
60  case HalRebootRoutine:
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");
73  DbgBreakPoint();
74  }
75 }
#define DbgPrint
Definition: loader.c:25
#define TRUE
Definition: types.h:120
unsigned char * PUCHAR
Definition: retypes.h:3
__INTRIN_INLINE void __halt(void)
Definition: intrin_x86.h:1715
void DbgBreakPoint()
Definition: mach.c:553
#define DECLSPEC_NORETURN
Definition: ntbasedef.h:176
#define CPU_IO_o_RESET
Definition: cpu.h:10
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID NTAPI HalpReboot(VOID)
Definition: reboot.c:28
VOID NTAPI HaliHaltSystem(VOID)
Definition: processor.c:21
static VOID DECLSPEC_NORETURN NTAPI HalpFreezeSystem(VOID)
Definition: reboot.c:20
enum _FIRMWARE_REENTRY FIRMWARE_REENTRY
VOID NTAPI HalReturnToFirmware(IN FIRMWARE_REENTRY Action)
Definition: reboot.c:22
#define PPI_IO_o_CONTROL
Definition: sysport.h:12
VOID NTAPI InbvAcquireDisplayOwnership(VOID)
Definition: inbv.c:528
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
#define NOTHING
Definition: env_spec_w32.h:461
VOID NTAPI KeFlushWriteBuffer(VOID)
Definition: misc.c:39
#define _In_
Definition: no_sal2.h:158
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:506
#define PPI_SHUTDOWN_0_ENABLE
Definition: sysport.h:16
void __cdecl _disable(void)
Definition: intrin_arm.h:365
#define PPI_SHUTDOWN_1_ENABLE
Definition: sysport.h:15