本文整理汇总了C++中EFI_BOOT_SERVICES::Exit方法的典型用法代码示例。如果您正苦于以下问题:C++ EFI_BOOT_SERVICES::Exit方法的具体用法?C++ EFI_BOOT_SERVICES::Exit怎么用?C++ EFI_BOOT_SERVICES::Exit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EFI_BOOT_SERVICES
的用法示例。
在下文中一共展示了EFI_BOOT_SERVICES::Exit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: die
/**
* Handle fatal errors
*
* @v fmt Error message format string
* @v ... Arguments
*/
void die ( const char *fmt, ... ) {
EFI_BOOT_SERVICES *bs;
EFI_RUNTIME_SERVICES *rs;
va_list args;
/* Print message */
va_start ( args, fmt );
vprintf ( fmt, args );
va_end ( args );
/* Reboot or exit as applicable */
if ( efi_systab ) {
/* Exit */
bs = efi_systab->BootServices;
bs->Exit ( efi_image_handle, EFI_LOAD_ERROR, 0, NULL );
printf ( "Failed to exit\n" );
rs = efi_systab->RuntimeServices;
rs->ResetSystem ( EfiResetWarm, 0, 0, NULL );
printf ( "Failed to reboot\n" );
} else {
/* Wait for keypress */
printf ( "Press a key to reboot..." );
getchar();
printf ( "\n" );
/* Reboot system */
reboot();
}
/* Should be impossible to reach this */
__builtin_unreachable();
}
示例2:
EFI_STATUS EFIAPI
OvrExit(
IN EFI_HANDLE ImageHandle,
IN EFI_STATUS ExitStatus,
IN UINTN ExitDataSize,
IN CHAR16 *ExitData
)
{
EFI_STATUS Status;
Status = gOrgBS.Exit(ImageHandle, ExitStatus, ExitDataSize, ExitData);
PRINT("->Exit(%p, %r, 0x%x, %s) = %r\n", ImageHandle, ExitStatus, ExitDataSize, ExitData, Status);
return Status;
}