iPXE
Functions
efi_reboot.c File Reference

EFI reboot mechanism. More...

#include <errno.h>
#include <ipxe/efi/efi.h>
#include <ipxe/reboot.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
static void efi_reboot (int warm)
 Reboot system. More...
 
static int efi_poweroff (void)
 Power off system. More...
 
 PROVIDE_REBOOT (efi, reboot, efi_reboot)
 
 PROVIDE_REBOOT (efi, poweroff, efi_poweroff)
 

Detailed Description

EFI reboot mechanism.

Definition in file efi_reboot.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ efi_reboot()

static void efi_reboot ( int  warm)
static

Reboot system.

Parameters
warmPerform a warm reboot

Definition at line 42 of file efi_reboot.c.

42  {
44 
45  /* Use runtime services to reset system */
46  rs->ResetSystem ( ( warm ? EfiResetWarm : EfiResetCold ), 0, 0, NULL );
47 }
Used to induce a system-wide reset.
Used to induce a system-wide initialization.
EFI Runtime Services Table.
Definition: UefiSpec.h:1866
EFI_RESET_SYSTEM ResetSystem
Definition: UefiSpec.h:1897
EFI_RUNTIME_SERVICES * RuntimeServices
A pointer to the EFI Runtime Services Table.
Definition: UefiSpec.h:2077
EFI_SYSTEM_TABLE * efi_systab
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

References efi_systab, EfiResetCold, EfiResetWarm, NULL, EFI_RUNTIME_SERVICES::ResetSystem, and EFI_SYSTEM_TABLE::RuntimeServices.

◆ efi_poweroff()

static int efi_poweroff ( void  )
static

Power off system.

Return values
rcReturn status code

Definition at line 54 of file efi_reboot.c.

54  {
56 
57  /* Use runtime services to power off system */
58  rs->ResetSystem ( EfiResetShutdown, 0, 0, NULL );
59 
60  /* Should never happen */
61  return -ECANCELED;
62 }
#define ECANCELED
Operation canceled.
Definition: errno.h:343
EFI Runtime Services Table.
Definition: UefiSpec.h:1866
EFI_RESET_SYSTEM ResetSystem
Definition: UefiSpec.h:1897
Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G3 state.
EFI_RUNTIME_SERVICES * RuntimeServices
A pointer to the EFI Runtime Services Table.
Definition: UefiSpec.h:2077
EFI_SYSTEM_TABLE * efi_systab
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

References ECANCELED, efi_systab, EfiResetShutdown, NULL, EFI_RUNTIME_SERVICES::ResetSystem, and EFI_SYSTEM_TABLE::RuntimeServices.

◆ PROVIDE_REBOOT() [1/2]

PROVIDE_REBOOT ( efi  ,
reboot  ,
efi_reboot   
)

◆ PROVIDE_REBOOT() [2/2]

PROVIDE_REBOOT ( efi  ,
poweroff  ,
efi_poweroff   
)