mirror of
https://github.com/ipxe/ipxe
synced 2026-02-03 06:34:32 +03:00
[reboot] Generalise warm reboot indicator to a flags bitmask
Allow for the possibility of additional reboot types by extending the reboot() function to use a flags bitmask rather than a single flag. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -37,13 +37,15 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
/**
|
||||
* Reboot system
|
||||
*
|
||||
* @v warm Perform a warm reboot
|
||||
* @v flags Reboot flags
|
||||
*/
|
||||
static void efi_reboot ( int warm ) {
|
||||
static void efi_reboot ( int flags ) {
|
||||
EFI_RUNTIME_SERVICES *rs = efi_systab->RuntimeServices;
|
||||
EFI_RESET_TYPE type;
|
||||
|
||||
/* Use runtime services to reset system */
|
||||
rs->ResetSystem ( ( warm ? EfiResetWarm : EfiResetCold ), 0, 0, NULL );
|
||||
type = ( ( flags & REBOOT_WARM ) ? EfiResetWarm : EfiResetCold );
|
||||
rs->ResetSystem ( type, 0, 0, NULL );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user