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.
static int efi_poweroff (void)
 Power off system.
 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 ( GPL2_OR_LATER_OR_UBDL  )
static void efi_reboot ( int  warm) [static]

Reboot system.

Parameters:
warmPerform a warm reboot

Definition at line 42 of file efi_reboot.c.

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

                                    {
        EFI_RUNTIME_SERVICES *rs = efi_systab->RuntimeServices;

        /* Use runtime services to reset system */
        rs->ResetSystem ( ( warm ? EfiResetWarm : EfiResetCold ), 0, 0, NULL );
}
static int efi_poweroff ( void  ) [static]

Power off system.

Return values:
rcReturn status code

Definition at line 54 of file efi_reboot.c.

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

                                 {
        EFI_RUNTIME_SERVICES *rs = efi_systab->RuntimeServices;

        /* Use runtime services to power off system */
        rs->ResetSystem ( EfiResetShutdown, 0, 0, NULL );

        /* Should never happen */
        return -ECANCELED;
}
PROVIDE_REBOOT ( efi  ,
reboot  ,
efi_reboot   
)
PROVIDE_REBOOT ( efi  ,
poweroff  ,
efi_poweroff   
)