]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/BdsDxe/Bds.h
MdeModulePkg/PciBusDxe: Fix small memory leak in FreePciDevice
[mirror_edk2.git] / MdeModulePkg / Universal / BdsDxe / Bds.h
index 56b709ecca94a10ec77fa1e7a40e08ffe0b5f258..6c250dd57788c42538799f0b72e8e963eecd877f 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Head file for BDS Architectural Protocol implementation\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -15,114 +15,45 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef _BDS_MODULE_H_\r
 #define _BDS_MODULE_H_\r
 \r
-#include <PiDxe.h>\r
-#include <MdeModuleHii.h>\r
-\r
-#include <Guid/FileSystemVolumeLabelInfo.h>\r
-#include <Protocol/DevicePath.h>\r
-#include <Guid/BootState.h>\r
-#include <Guid/DataHubRecords.h>\r
-#include <Protocol/LoadFile.h>\r
-#include <Protocol/CpuIo.h>\r
-#include <Guid/FileInfo.h>\r
-#include <Protocol/HiiConfigRouting.h>\r
-#include <Protocol/Bds.h>\r
-#include <Protocol/DataHub.h>\r
-#include <Protocol/UgaDraw.h>\r
-#include <Protocol/BlockIo.h>\r
+#include <Uefi.h>\r
 #include <Guid/GlobalVariable.h>\r
-#include <Guid/GenericPlatformVariable.h>\r
-#include <Guid/CapsuleVendor.h>\r
-#include <Protocol/ConsoleControl.h>\r
-#include <Protocol/GenericMemoryTest.h>\r
-#include <Protocol/FormBrowser2.h>\r
-#include <Protocol/HiiConfigAccess.h>\r
-#include <Protocol/GraphicsOutput.h>\r
-#include <Protocol/SimpleFileSystem.h>\r
-#include <Protocol/HiiDatabase.h>\r
-#include <Protocol/HiiString.h>\r
-#include <Protocol/SerialIo.h>\r
-#include <Protocol/LegacyBios.h>\r
-#include <Protocol/SimpleTextInEx.h>\r
-#include <Protocol/Performance.h>\r
+#include <Guid/ConnectConInEvent.h>\r
+#include <Guid/StatusCodeDataTypeVariable.h>\r
+#include <Guid/EventGroup.h>\r
+\r
+#include <Protocol/Bds.h>\r
+#include <Protocol/LoadedImage.h>\r
+#include <Protocol/VariableLock.h>\r
+#include <Protocol/DeferredImageLoad.h>\r
 \r
 #include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/PrintLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
-#include <Library/PerformanceLib.h>\r
 #include <Library/ReportStatusCodeLib.h>\r
-#include <Library/IfrSupportLib.h>\r
-#include <Library/ExtendedIfrSupportLib.h>\r
-#include <Library/UefiRuntimeServicesTableLib.h>\r
-#include <Library/HobLib.h>\r
 #include <Library/BaseLib.h>\r
-#include <Library/DevicePathLib.h>\r
 #include <Library/PcdLib.h>\r
-#include <Library/CapsuleLib.h>\r
-#include <Library/HiiLib.h>\r
-#include <Library/ExtendedHiiLib.h>\r
-\r
-\r
-#include <Library/GenericBdsLib.h>\r
-#include <Library/PlatformBdsLib.h>\r
-\r
-#define EFI_BDS_ARCH_PROTOCOL_INSTANCE_FROM_THIS(_this) \\r
-  CR ((_this),                                          \\r
-      EFI_BDS_ARCH_PROTOCOL_INSTANCE,                   \\r
-      Bds,                                              \\r
-      EFI_BDS_ARCH_PROTOCOL_INSTANCE_SIGNATURE          \\r
-      )\r
-\r
-/**\r
-\r
-  Show progress bar with title above it. It only works in Graphics mode.\r
-\r
-  @param TitleForeground Foreground color for Title.\r
-  @param TitleBackground Background color for Title.\r
-  @param Title           Title above progress bar.\r
-  @param ProgressColor   Progress bar color.\r
-  @param Progress        Progress (0-100)\r
-  @param PreviousValue   The previous value of the progress.\r
-\r
-  @retval  EFI_STATUS       Success update the progress bar\r
-\r
-**/\r
-EFI_STATUS\r
-PlatformBdsShowProgress (\r
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground,\r
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground,\r
-  IN CHAR16                        *Title,\r
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor,\r
-  IN UINTN                         Progress,\r
-  IN UINTN                         PreviousValue\r
-  );\r
-\r
-//\r
-// Prototypes\r
-//\r
-\r
-/**\r
-\r
-  Install Boot Device Selection Protocol\r
-\r
-  @param ImageHandle     The image handle.\r
-  @param SystemTable     The system table.\r
-\r
-  @retval  EFI_SUCEESS  BDS has finished initializing.\r
-                        Return the dispatcher and recall BDS.Entry\r
-  @retval  Other        Return status from AllocatePool() or gBS->InstallProtocolInterface\r
+#include <Library/PerformanceLib.h>\r
+#include <Library/DevicePathLib.h>\r
+#include <Library/PrintLib.h>\r
 \r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-BdsInitialize (\r
-  IN EFI_HANDLE                     ImageHandle,\r
-  IN EFI_SYSTEM_TABLE               *SystemTable\r
-  );\r
+#include <Library/UefiBootManagerLib.h>\r
+#include <Library/PlatformBootManagerLib.h>\r
+\r
+#if !defined (EFI_REMOVABLE_MEDIA_FILE_NAME)\r
+    #if defined (MDE_CPU_EBC)\r
+        //\r
+        // Uefi specification only defines the default boot file name for IA32, X64\r
+        // and IPF processor, so need define boot file name for EBC architecture here.\r
+        //\r
+        #define EFI_REMOVABLE_MEDIA_FILE_NAME L"\\EFI\\BOOT\\BOOTEBC.EFI"\r
+    #else\r
+        #error "Can not determine the default boot file name for unknown processor type!"\r
+    #endif\r
+#endif\r
 \r
 /**\r
 \r
@@ -138,4 +69,46 @@ BdsEntry (
   IN  EFI_BDS_ARCH_PROTOCOL *This\r
   );\r
 \r
+/**\r
+  Set the variable and report the error through status code upon failure.\r
+\r
+  @param  VariableName           A Null-terminated string that is the name of the vendor's variable.\r
+                                 Each VariableName is unique for each VendorGuid. VariableName must\r
+                                 contain 1 or more characters. If VariableName is an empty string,\r
+                                 then EFI_INVALID_PARAMETER is returned.\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
+                                 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
+                                 even if no new data value is provided,see the description of the\r
+                                 EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not\r
+                                 be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated).\r
+  @param  Data                   The contents for the variable.\r
+\r
+  @retval EFI_SUCCESS            The firmware has successfully stored the variable and its data as\r
+                                 defined by the Attributes.\r
+  @retval EFI_INVALID_PARAMETER  An invalid combination of attribute bits, name, and GUID was supplied, or the\r
+                                 DataSize exceeds the maximum allowed.\r
+  @retval EFI_INVALID_PARAMETER  VariableName is an empty string.\r
+  @retval EFI_OUT_OF_RESOURCES   Not enough storage is available to hold the variable and its data.\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_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
+EFI_STATUS\r
+BdsDxeSetVariableAndReportStatusCodeOnError (\r
+  IN CHAR16     *VariableName,\r
+  IN EFI_GUID   *VendorGuid,\r
+  IN UINT32     Attributes,\r
+  IN UINTN      DataSize,\r
+  IN VOID       *Data\r
+  );\r
+\r
 #endif\r