]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/GenericBdsLib/InternalBdsLib.h
1.Change the behavior of BdsBoot, to enumerate Boot Options by EfiLoadFileProtocol...
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / GenericBdsLib / InternalBdsLib.h
index cb11b6e02d42791ea6c774585d00a65b1dadeb97..7b4a69494de4626ce17912167d34a5afcf6986f9 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   BDS library definition, include the file and data structure\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. <BR>\r
 All rights reserved. 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
@@ -15,14 +15,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef _INTERNAL_BDS_LIB_H_\r
 #define _INTERNAL_BDS_LIB_H_\r
 \r
-#include <PiDxe.h>\r
+#include <FrameworkDxe.h>\r
 \r
-#include <IndustryStandard/Pci22.h>\r
+#include <IndustryStandard/Pci.h>\r
+#include <IndustryStandard/PeImage.h>\r
 \r
 #include <Protocol/BlockIo.h>\r
 #include <Protocol/LoadedImage.h>\r
 #include <Protocol/Cpu.h>\r
 #include <Protocol/SimpleFileSystem.h>\r
+#include <Protocol/LoadFile.h>\r
 #include <Protocol/DebugPort.h>\r
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/SimpleTextIn.h>\r
@@ -33,23 +35,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/FirmwareVolume2.h>\r
 #include <Protocol/PciIo.h>\r
 #include <Protocol/AcpiS3Save.h>\r
-#include <Protocol/Performance.h>\r
-#include <Protocol/FirmwareVolumeDispatch.h>\r
 #include <Protocol/OEMBadging.h>\r
-#include <Protocol/ConsoleControl.h>\r
 #include <Protocol/GraphicsOutput.h>\r
 #include <Protocol/UgaDraw.h>\r
 #include <Protocol/HiiFont.h>\r
 #include <Protocol/HiiImage.h>\r
 \r
-\r
 #include <Guid/MemoryTypeInformation.h>\r
 #include <Guid/FileInfo.h>\r
 #include <Guid/GlobalVariable.h>\r
 #include <Guid/PcAnsi.h>\r
-#include <Guid/ShellFile.h>\r
-#include <Guid/GenericPlatformVariable.h>\r
-#include <Guid/Bmp.h>\r
+#include <Guid/Performance.h>\r
 \r
 #include <Library/PrintLib.h>\r
 #include <Library/DebugLib.h>\r
@@ -64,33 +60,23 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/DevicePathLib.h>\r
 #include <Library/PerformanceLib.h>\r
 #include <Library/PcdLib.h>\r
-#include <Library/IfrSupportLib.h>\r
 #include <Library/PeCoffGetEntryPointLib.h>\r
 #include <Library/GenericBdsLib.h>\r
 #include <Library/TimerLib.h>\r
 #include <Library/PcdLib.h>\r
 #include <Library/DxeServicesLib.h>\r
 \r
-#define PERFORMANCE_SIGNATURE   SIGNATURE_32 ('P', 'e', 'r', 'f')\r
-#define PERF_TOKEN_SIZE         28\r
-#define PERF_TOKEN_LENGTH       (PERF_TOKEN_SIZE - 1)\r
-#define PERF_PEI_ENTRY_MAX_NUM  50\r
-\r
-typedef struct {\r
-  CHAR8   Token[PERF_TOKEN_SIZE];\r
-  UINT32  Duration;\r
-} PERF_DATA;\r
-\r
-typedef struct {\r
-  UINT64        BootToOs;\r
-  UINT64        S3Resume;\r
-  UINT32        S3EntryNum;\r
-  PERF_DATA     S3Entry[PERF_PEI_ENTRY_MAX_NUM];\r
-  UINT64        CpuFreq;\r
-  UINT64        BDSRaw;\r
-  UINT32        Count;\r
-  UINT32        Signiture;\r
-} PERF_HEADER;\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
@@ -103,4 +89,26 @@ WriteBootToOsPerformanceData (
   VOID\r
   );\r
 \r
+/**\r
+  Get the headers (dos, image, optional header) from an image\r
+\r
+  @param  Device                SimpleFileSystem device handle\r
+  @param  FileName              File name for the image\r
+  @param  DosHeader             Pointer to dos header\r
+  @param  Hdr                   The buffer in which to return the PE32, PE32+, or TE header.\r
+\r
+  @retval EFI_SUCCESS           Successfully get the machine type.\r
+  @retval EFI_NOT_FOUND         The file is not found.\r
+  @retval EFI_LOAD_ERROR        File is not a valid image file.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+BdsLibGetImageHeader (\r
+  IN  EFI_HANDLE                  Device,\r
+  IN  CHAR16                      *FileName,\r
+  OUT EFI_IMAGE_DOS_HEADER        *DosHeader,\r
+  OUT EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION   Hdr\r
+  );\r
+\r
 #endif // _BDS_LIB_H_\r