ReactOS  0.4.15-dev-3303-g1ade494
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
__INTRIN_INLINE void __halt(void)
Definition: intrin_x86.h:1715
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
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:506

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  }
97  case HalRestartRoutine:
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);
110  DbgBreakPoint();
111  }
112  }
113 }
#define SMC_REG_POWER_SHUTDOWN
Definition: halxbox.h:35
#define DbgPrint
Definition: hal.h:12
#define SMC_REG_POWER_CYCLE
Definition: halxbox.h:34
#define SMC_REG_POWER_RESET
Definition: halxbox.h:33
VOID NTAPI DbgBreakPoint(VOID)
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:506
VOID DECLSPEC_NORETURN NTAPI HalpXboxPowerAction(IN UCHAR Action)
Definition: reboot.c:69

◆ 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 WRITE_PORT_USHORT(IN PUSHORT Port, IN USHORT Value)
Definition: portio.c:115
#define READ_PORT_UCHAR(p)
Definition: pc98vid.h:22
unsigned char * PUCHAR
Definition: retypes.h:3
int32_t INT
Definition: typedefs.h:58
#define SMB_GLOBAL_STATUS
Definition: halxbox.h:24
static WCHAR Address[46]
Definition: ping.c:68
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define SMB_HOST_ADDRESS
Definition: halxbox.h:26
#define SMB_HOST_DATA
Definition: halxbox.h:27
unsigned char UCHAR
Definition: xmlstorage.h:181
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
#define NOTHING
Definition: env_spec_w32.h:461
#define SMB_HOST_COMMAND
Definition: halxbox.h:28
#define SMB_GLOBAL_ENABLE
Definition: halxbox.h:25
USHORT NTAPI READ_PORT_USHORT(IN PUSHORT Port)
Definition: portio.c:63
unsigned short * PUSHORT
Definition: retypes.h:2
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:96

Referenced by HalpXboxPowerAction().