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


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

本文整理汇总了C++中EFI_BOOT_SERVICES::ExitBootServices方法的典型用法代码示例。如果您正苦于以下问题:C++ EFI_BOOT_SERVICES::ExitBootServices方法的具体用法?C++ EFI_BOOT_SERVICES::ExitBootServices怎么用?C++ EFI_BOOT_SERVICES::ExitBootServices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EFI_BOOT_SERVICES的用法示例。


在下文中一共展示了EFI_BOOT_SERVICES::ExitBootServices方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetMemoryMapKey

EFI_STATUS EFIAPI
OvrExitBootServices(
	IN EFI_HANDLE				ImageHandle,
	IN UINTN					MapKey
)
{
	EFI_STATUS					Status;
	UINTN					 	NewMapKey;
	
	PRINT("ExitBootServices called. Doing some more dumps ...\n");
	
	#if PRINT_DUMPS >= 1
	// Print ST
	PrintSystemTable(gST);
	
	// Print RT vars
	PrintRTVariables(&gOrgRS);
	#endif
	
	// Restore RT services if we should not log calls during runtime
	#if WORK_DURING_RUNTIME == 0
	RestoreRuntimeServices(gRT);
	#endif
	
	PRINT("->ExitBootServices(%p, 0x%x) ...\n", ImageHandle, MapKey);
	
	// Set flag to FALSE to stop some loggers from messing with memory
	InBootServices = FALSE;
	
	// Restore original OutputString
	#if CAPTURE_CONSOLE_OUTPUT >= 1
	gST->ConOut->OutputString = gOrgConOutOutputString;
	#endif
	
	// Notify loggers that boot services are over
	// Saving our log file can cause a vast amount of logging output on some firmwares, so do this after stopping loggers.
	LogOnExitBootServices();
	
	// Call original
	Status = gOrgBS.ExitBootServices(ImageHandle, MapKey);
	
	if (Status == EFI_SUCCESS) {
	
		PRINT("... ExitBootServices = %r\n", Status);
		
	} else {
		//
		// Error exiting boot services. Probably because
		// some of our loggers changed memory map state.
		// We'll just force exiting by obtaining new
		// MapKey and calling ExitBootServices again.
		//
		PRINT("... ExitBootServices = %r\n", Status);
		PRINT("Forcing ExitBootServices ...\n");
		
		Status = GetMemoryMapKey(&NewMapKey);
		if (Status == EFI_SUCCESS) {
			// we have latest mem map and NewMapKey
			// we'll try again ExitBootServices with NewMapKey
			Status = gOrgBS.ExitBootServices(ImageHandle, NewMapKey);
			PRINT("ExitBootServices: 2nd try = %r\n", Status);
		} else {
			PRINT("ERROR obtaining new map key: %r\n", Status);
			Status = EFI_INVALID_PARAMETER;
		}
	}
	
	return Status;
}
开发者ID:jief666,项目名称:clover,代码行数:69,代码来源:BootServices.c


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