ReactOS 0.4.15-dev-6057-gd708c79
reboot.c File Reference
#include "halxbox.h"
#include <debug.h>
Include dependency graph for reboot.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI SMBusWriteByte (UCHAR Address, UCHAR Register, UCHAR Data)
 
VOID DECLSPEC_NORETURN NTAPI HalpXboxPowerAction (IN UCHAR Action)
 
VOID NTAPI HalReturnToFirmware (IN FIRMWARE_REENTRY Action)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 18 of file reboot.c.

Function Documentation

◆ HalpXboxPowerAction()

VOID DECLSPEC_NORETURN NTAPI HalpXboxPowerAction ( IN UCHAR  Action)

Definition at line 69 of file reboot.c.

70{
72
73 /* Halt the CPU */
74 __halt();
75
76 while (TRUE); /* 'noreturn' function */
77}
#define TRUE
Definition: types.h:120
VOID NTAPI SMBusWriteByte(UCHAR Address, UCHAR Register, UCHAR Data)
Definition: reboot.c:25
#define SMB_DEVICE_SMC_PIC16LC
Definition: halxbox.h:30
#define SMC_REG_POWER
Definition: halxbox.h:32
__INTRIN_INLINE void __halt(void)
Definition: intrin_x86.h:1714
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510

Referenced by HalReturnToFirmware().

◆ HalReturnToFirmware()

VOID NTAPI HalReturnToFirmware ( IN FIRMWARE_REENTRY  Action)

Definition at line 86 of file reboot.c.

87{
88 /* Check what kind of action this is */
89 switch (Action)
90 {
91 /* All recognized actions */
93 {
94 /* Call the internal power function */
96 }
98 {
100 }
101 case HalRebootRoutine:
102 {
104 }
105 /* Anything else */
106 default:
107 {
108 /* Print message and break */
109 DbgPrint("HalReturnToFirmware(%d) called!\n", Action);
111 }
112 }
113}
#define DbgPrint
Definition: hal.h:12
VOID DECLSPEC_NORETURN NTAPI HalpXboxPowerAction(IN UCHAR Action)
Definition: reboot.c:69
#define SMC_REG_POWER_CYCLE
Definition: halxbox.h:34
#define SMC_REG_POWER_RESET
Definition: halxbox.h:33
#define SMC_REG_POWER_SHUTDOWN
Definition: halxbox.h:35
NTSYSAPI void WINAPI DbgBreakPoint(void)
@ HalRestartRoutine
Definition: haltypes.h:36
@ HalPowerDownRoutine
Definition: haltypes.h:35
@ HalRebootRoutine
Definition: haltypes.h:37

◆ SMBusWriteByte()

VOID NTAPI SMBusWriteByte ( UCHAR  Address,
UCHAR  Register,
UCHAR  Data 
)

Definition at line 25 of file reboot.c.

26{
27 INT Retries = 50;
28
29 /* Wait while bus is busy with any master traffic */
31 {
32 NOTHING;
33 }
34
35 while (Retries--)
36 {
37 UCHAR b;
38
41
43
44 /* Clear down all preexisting errors */
46
47 /* Let I2C SMBus know we're sending a single byte here */
49
50 b = 0;
51
52 while (!(b & 0x36))
53 {
55 }
56
57 if (b & 0x10)
58 {
59 return;
60 }
61
63 }
64}
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:81
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
VOID NTAPI WRITE_PORT_USHORT(IN PUSHORT Port, IN USHORT Value)
Definition: portio.c:115
USHORT NTAPI READ_PORT_USHORT(IN PUSHORT Port)
Definition: portio.c:63
#define SMB_HOST_COMMAND
Definition: halxbox.h:28
#define SMB_GLOBAL_ENABLE
Definition: halxbox.h:25
#define SMB_GLOBAL_STATUS
Definition: halxbox.h:24
#define SMB_HOST_ADDRESS
Definition: halxbox.h:26
#define SMB_HOST_DATA
Definition: halxbox.h:27
#define NOTHING
Definition: input_list.c:10
#define b
Definition: ke_i.h:79
#define READ_PORT_UCHAR(p)
Definition: pc98vid.h:22
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
static WCHAR Address[46]
Definition: ping.c:68
int32_t INT
Definition: typedefs.h:58
uint16_t * PUSHORT
Definition: typedefs.h:56
unsigned char * PUCHAR
Definition: typedefs.h:53
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by HalpXboxPowerAction().