当前位置: 首页>>代码示例>>C++>>正文


C++ EFI_BOOT_SERVICES::WaitForEvent方法代码示例

本文整理汇总了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;
}
开发者ID:jief666,项目名称:clover,代码行数:13,代码来源:BootServices.c

示例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;
}
开发者ID:cirosantilli,项目名称:efi-example,代码行数:86,代码来源:gfx_example.c


注:本文中的EFI_BOOT_SERVICES::WaitForEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。