/** @file\r
BDS library definition, include the file and data structure\r
\r
-Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
#include <IndustryStandard/PeImage.h>\r
#include <IndustryStandard/Atapi.h>\r
#include <IndustryStandard/Scsi.h>\r
+#include <IndustryStandard/Nvme.h>\r
\r
#include <Protocol/PciRootBridgeIo.h>\r
#include <Protocol/BlockIo.h>\r
#include <Protocol/GraphicsOutput.h>\r
#include <Protocol/UsbIo.h>\r
#include <Protocol/DiskInfo.h>\r
+#include <Protocol/NvmExpressPassthru.h>\r
#include <Protocol/IdeControllerInit.h>\r
#include <Protocol/BootLogo.h>\r
#include <Protocol/DriverHealth.h>\r
#include <Protocol/FormBrowser2.h>\r
#include <Protocol/VariableLock.h>\r
#include <Protocol/RamDisk.h>\r
+#include <Protocol/DeferredImageLoad.h>\r
\r
-#include <Guid/ZeroGuid.h>\r
#include <Guid/MemoryTypeInformation.h>\r
#include <Guid/FileInfo.h>\r
#include <Guid/GlobalVariable.h>\r
@param VendorGuid A unique identifier for the vendor.\r
@param Attributes Attributes bitmask to set for the variable.\r
@param DataSize The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE, \r
- EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, or \r
- EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero \r
+ or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero\r
causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is \r
set, then a SetVariable() call with a DataSize of zero will not cause any change to \r
the variable value (the timestamp associated with the variable may be updated however \r
@retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r
@retval EFI_WRITE_PROTECTED The variable in question is read-only.\r
@retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.\r
- @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS \r
- or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo \r
- does NOT pass the validation check carried out by the firmware.\r
+ @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS\r
+ being set, but the AuthInfo does NOT pass the validation check carried out by the firmware.\r
\r
@retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.\r
**/\r
IN VOID *Data\r
);\r
\r
-/**\r
- Return whether the PE header of the load option is valid or not.\r
-\r
- @param[in] Type The load option type.\r
- @param[in] FileBuffer The PE file buffer of the load option.\r
- @param[in] FileSize The size of the load option file.\r
-\r
- @retval TRUE The PE header of the load option is valid.\r
- @retval FALSE The PE header of the load option is not valid.\r
-**/\r
-BOOLEAN\r
-BmIsLoadOptionPeHeaderValid (\r
- IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE Type,\r
- IN VOID *FileBuffer,\r
- IN UINTN FileSize\r
- );\r
-\r
/**\r
Function compares a device path data structure to that of all the nodes of a\r
second device path instance.\r
\r
@param LoadFileHandle The specified Load File instance.\r
@param FilePath The file path which will pass to LoadFile().\r
- @param FullPath Return the full device path pointing to the load option.\r
- @param FileSize Return the size of the load option.\r
\r
- @return The load option buffer or NULL if fails.\r
+ @return The full device path pointing to the load option buffer.\r
+**/\r
+EFI_DEVICE_PATH_PROTOCOL *\r
+BmExpandLoadFile (\r
+ IN EFI_HANDLE LoadFileHandle,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath\r
+ );\r
+\r
+/**\r
+ Return the RAM Disk device path created by LoadFile.\r
+\r
+ @param FilePath The source file path.\r
+\r
+ @return Callee-to-free RAM Disk device path\r
+**/\r
+EFI_DEVICE_PATH_PROTOCOL *\r
+BmGetRamDiskDevicePath (\r
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath\r
+ );\r
+\r
+/**\r
+ Destroy the RAM Disk.\r
+\r
+ The destroy operation includes to call RamDisk.Unregister to\r
+ unregister the RAM DISK from RAM DISK driver, free the memory\r
+ allocated for the RAM Disk.\r
+\r
+ @param RamDiskDevicePath RAM Disk device path.\r
+**/\r
+VOID\r
+BmDestroyRamDisk (\r
+ IN EFI_DEVICE_PATH_PROTOCOL *RamDiskDevicePath\r
+ );\r
+\r
+/**\r
+ Get the next possible full path pointing to the load option.\r
+\r
+ @param FilePath The device path pointing to a load option.\r
+ It could be a short-form device path.\r
+ @param FullPath The full path returned by the routine in last call.\r
+ Set to NULL in first call.\r
+\r
+ @return The next possible full path pointing to the load option.\r
+ Caller is responsible to free the memory.\r
+**/\r
+EFI_DEVICE_PATH_PROTOCOL *\r
+BmGetNextLoadOptionDevicePath (\r
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *FullPath\r
+ );\r
+\r
+/**\r
+ Return the next matched load option buffer.\r
+ The routine keeps calling BmGetNextLoadOptionDevicePath() until a valid\r
+ load option is read.\r
+\r
+ @param Type The load option type.\r
+ It's used to check whether the load option is valid.\r
+ When it's LoadOptionTypeMax, the routine only guarantees\r
+ the load option is a valid PE image but doesn't guarantee\r
+ the PE's subsystem type is valid.\r
+ @param FilePath The device path pointing to a load option.\r
+ It could be a short-form device path.\r
+ @param FullPath Return the next full device path of the load option after\r
+ short-form device path expanding.\r
+ Caller is responsible to free it.\r
+ NULL to return the first matched full device path.\r
+ @param FileSize Return the load option size.\r
+\r
+ @return The load option buffer. Caller is responsible to free the memory.\r
**/\r
VOID *\r
-BmGetFileBufferFromLoadFile (\r
- EFI_HANDLE LoadFileHandle,\r
- IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
- OUT EFI_DEVICE_PATH_PROTOCOL **FullPath,\r
- OUT UINTN *FileSize\r
+BmGetNextLoadOptionBuffer (\r
+ IN EFI_BOOT_MANAGER_LOAD_OPTION_TYPE Type,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
+ OUT EFI_DEVICE_PATH_PROTOCOL **FullPath,\r
+ OUT UINTN *FileSize\r
);\r
#endif // _INTERNAL_BM_H_\r