X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FLibrary%2FUefiBootManagerLib%2FInternalBm.h;h=0224bd34a9ed92fbfc7e4bcdfe29bae91916d1f0;hb=4344a788c472fccd9af559891363374868fb6275;hp=c1514c3ee48171f19858b39224753e2dd2d5a892;hpb=1f2e80af229d06a59d99a7882ab1872ba72e0654;p=mirror_edk2.git diff --git a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h index c1514c3ee4..0224bd34a9 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h +++ b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h @@ -1,7 +1,7 @@ /** @file BDS library definition, include the file and data structure -Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.
(C) Copyright 2015 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -22,6 +22,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include #include @@ -38,13 +39,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include #include #include #include #include +#include +#include -#include #include #include #include @@ -92,8 +95,6 @@ typedef enum { BmMessageSataBoot, BmMessageUsbBoot, BmMessageScsiBoot, - BmMessageNetworkBoot, - BmMessageHttpBoot, BmMiscBoot } BM_BOOT_TYPE; @@ -203,10 +204,11 @@ BmWriteBootToOsPerformanceData ( This routine adjust the memory information for different memory type and save them into the variables for next boot. It resets the system when memory information is updated and the current boot option belongs to - boot category instead of application category. + boot category instead of application category. It doesn't count the + reserved memory occupied by RAM Disk. - @param Boot TRUE if current boot option belongs to boot category instead of - application category. + @param Boot TRUE if current boot option belongs to boot + category instead of application category. **/ VOID BmSetMemoryTypeInformationVariable ( @@ -273,8 +275,7 @@ BmStopHotkeyService ( @param VendorGuid A unique identifier for the vendor. @param Attributes Attributes bitmask to set for the variable. @param DataSize The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE, - EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, or - EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero + or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is set, then a SetVariable() call with a DataSize of zero will not cause any change to the variable value (the timestamp associated with the variable may be updated however @@ -292,9 +293,8 @@ BmStopHotkeyService ( @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error. @retval EFI_WRITE_PROTECTED The variable in question is read-only. @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted. - @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS - or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo - does NOT pass the validation check carried out by the firmware. + @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS + being set, but the AuthInfo does NOT pass the validation check carried out by the firmware. @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found. **/ @@ -307,42 +307,6 @@ BmSetVariableAndReportStatusCodeOnError ( IN VOID *Data ); -/** - Get the load option by its device path. - - @param FilePath The device path pointing to a load option. - It could be a short-form device path. - @param FullPath Return the full device path of the load option after - short-form device path expanding. - Caller is responsible to free it. - @param FileSize Return the load option size. - - @return The load option buffer. Caller is responsible to free the memory. -**/ -VOID * -BmGetLoadOptionBuffer ( - IN EFI_DEVICE_PATH_PROTOCOL *FilePath, - OUT EFI_DEVICE_PATH_PROTOCOL **FullPath, - OUT UINTN *FileSize - ); - -/** - Return whether the PE header of the load option is valid or not. - - @param[in] Type The load option type. - @param[in] FileBuffer The PE file buffer of the load option. - @param[in] FileSize The size of the load option file. - - @retval TRUE The PE header of the load option is valid. - @retval FALSE The PE header of the load option is not valid. -**/ -BOOLEAN -BmIsLoadOptionPeHeaderValid ( - IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE Type, - IN VOID *FileBuffer, - IN UINTN FileSize - ); - /** Function compares a device path data structure to that of all the nodes of a second device path instance. @@ -412,23 +376,6 @@ BmCharToUint ( IN CHAR16 Char ); - -/** - Get the file buffer from the file system produced by Load File instance. - - @param LoadFileHandle The handle of LoadFile instance. - @param FullPath Return the full device path pointing to the load option. - @param FileSize Return the size of the load option. - - @return The load option buffer. -**/ -VOID * -BmGetFileBufferFromLoadFileFileSystem ( - IN EFI_HANDLE LoadFileHandle, - OUT EFI_DEVICE_PATH_PROTOCOL **FullPath, - OUT UINTN *FileSize - ); - /** Return the boot description for the controller. @@ -453,4 +400,89 @@ BmMakeBootOptionDescriptionUnique ( EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions, UINTN BootOptionCount ); + +/** + Get the file buffer from the specified Load File instance. + + @param LoadFileHandle The specified Load File instance. + @param FilePath The file path which will pass to LoadFile(). + + @return The full device path pointing to the load option buffer. +**/ +EFI_DEVICE_PATH_PROTOCOL * +BmExpandLoadFile ( + IN EFI_HANDLE LoadFileHandle, + IN EFI_DEVICE_PATH_PROTOCOL *FilePath + ); + +/** + Return the RAM Disk device path created by LoadFile. + + @param FilePath The source file path. + + @return Callee-to-free RAM Disk device path +**/ +EFI_DEVICE_PATH_PROTOCOL * +BmGetRamDiskDevicePath ( + IN EFI_DEVICE_PATH_PROTOCOL *FilePath + ); + +/** + Destroy the RAM Disk. + + The destroy operation includes to call RamDisk.Unregister to + unregister the RAM DISK from RAM DISK driver, free the memory + allocated for the RAM Disk. + + @param RamDiskDevicePath RAM Disk device path. +**/ +VOID +BmDestroyRamDisk ( + IN EFI_DEVICE_PATH_PROTOCOL *RamDiskDevicePath + ); + +/** + Get the next possible full path pointing to the load option. + + @param FilePath The device path pointing to a load option. + It could be a short-form device path. + @param FullPath The full path returned by the routine in last call. + Set to NULL in first call. + + @return The next possible full path pointing to the load option. + Caller is responsible to free the memory. +**/ +EFI_DEVICE_PATH_PROTOCOL * +BmGetNextLoadOptionDevicePath ( + IN EFI_DEVICE_PATH_PROTOCOL *FilePath, + IN EFI_DEVICE_PATH_PROTOCOL *FullPath + ); + +/** + Return the next matched load option buffer. + The routine keeps calling BmGetNextLoadOptionDevicePath() until a valid + load option is read. + + @param Type The load option type. + It's used to check whether the load option is valid. + When it's LoadOptionTypeMax, the routine only guarantees + the load option is a valid PE image but doesn't guarantee + the PE's subsystem type is valid. + @param FilePath The device path pointing to a load option. + It could be a short-form device path. + @param FullPath Return the next full device path of the load option after + short-form device path expanding. + Caller is responsible to free it. + NULL to return the first matched full device path. + @param FileSize Return the load option size. + + @return The load option buffer. Caller is responsible to free the memory. +**/ +VOID * +BmGetNextLoadOptionBuffer ( + IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE Type, + IN EFI_DEVICE_PATH_PROTOCOL *FilePath, + OUT EFI_DEVICE_PATH_PROTOCOL **FullPath, + OUT UINTN *FileSize + ); #endif // _INTERNAL_BM_H_