本文整理汇总了C++中EFI_BOOT_SERVICES::WaitForEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ EFI_BOOT_SERVICES::WaitForEvent方法的具体用法?C++ EFI_BOOT_SERVICES::WaitForEvent怎么用?C++ EFI_BOOT_SERVICES::WaitForEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EFI_BOOT_SERVICES
的用法示例。
在下文中一共展示了EFI_BOOT_SERVICES::WaitForEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
EFI_STATUS EFIAPI
OvrWaitForEvent(
IN UINTN NumberOfEvents,
IN EFI_EVENT *Event,
OUT UINTN *Index
)
{
EFI_STATUS Status;
Status = gOrgBS.WaitForEvent(NumberOfEvents, Event, Index);
// PRINT("->WaitForEvent(%d, %p, %d) = %r\n", NumberOfEvents, *Event, *Index, Status);
return Status;
}
示例2: RGB
/**
* efi_main - The entry point for the EFI application
* @image: firmware-allocated handle that identifies the image
* @SystemTable: EFI system table
*/
EFI_STATUS
efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *systemTable)
{
EFI_BOOT_SERVICES *bs = systemTable->BootServices;
EFI_GRAPHICS_OUTPUT_PROTOCOL *graphicsProtocol;
SIMPLE_TEXT_OUTPUT_INTERFACE *conOut = systemTable->ConOut;
EFI_EVENT event = systemTable->ConIn->WaitForKey;
UINTN index;
int i, modeCount;
EFI_STATUS status = bs->LocateProtocol(&GraphicsOutputProtocolGUID, NULL,
(void**)&graphicsProtocol);
if (EFI_ERROR(status) || graphicsProtocol == NULL) {
conOut->OutputString(conOut, L"Failed to init gfx!\r\n");
return status;
}
//Switch to current mode so gfx is started.
status = graphicsProtocol->SetMode(graphicsProtocol, graphicsProtocol->Mode->Mode);
if (EFI_ERROR(status)) {
conOut->OutputString(conOut, L"Failed to set default mode!\r\n");
return status;
}
conOut->OutputString(conOut, L"Current mode: ");
printInt(conOut, graphicsProtocol->Mode->Mode);
conOut->OutputString(conOut, L"\r\n");
modeCount = graphicsProtocol->Mode->MaxMode;
for (i = 0; i < modeCount; i++) {
conOut->OutputString(conOut, L"\r\n");
printInt(conOut, i);
conOut->OutputString(conOut, L": ");
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info;
UINTN SizeOfInfo;
status = graphicsProtocol->QueryMode(graphicsProtocol, i, &SizeOfInfo, &info);
if (EFI_ERROR(status)) {
conOut->OutputString(conOut, L" Failure to query mode: ");
printInt(conOut, status);
continue;
}
printInt(conOut, info->HorizontalResolution);
conOut->OutputString(conOut, L" x ");
printInt(conOut, info->VerticalResolution);
switch(info->PixelFormat) {
case PixelRedGreenBlueReserved8BitPerColor:
conOut->OutputString(conOut, L" RGB(R)");
break;
case PixelBlueGreenRedReserved8BitPerColor:
conOut->OutputString(conOut, L" BGR(R)");
break;
case PixelBitMask:
conOut->OutputString(conOut, L" BitMask ");
printInt(conOut, info->PixelInformation.RedMask);
conOut->OutputString(conOut, L"R ");
printInt(conOut, info->PixelInformation.GreenMask);
conOut->OutputString(conOut, L"G ");
printInt(conOut, info->PixelInformation.BlueMask);
conOut->OutputString(conOut, L"B ");
printInt(conOut, info->PixelInformation.ReservedMask);
conOut->OutputString(conOut, L"Reserved ");
break;
case PixelBltOnly:
conOut->OutputString(conOut, L" (blt only)");
break;
default:
conOut->OutputString(conOut, L" (Invalid pixel format)");
break;
}
conOut->OutputString(conOut, L" Pixel per scanline: ");
printInt(conOut, info->PixelsPerScanLine);
}
bs->WaitForEvent(1, &event, &index);
return EFI_SUCCESS;
}