]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/DxeMain.h
Clean up DEC files:
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / DxeMain.h
index a828da1e6e900fd0b9dc80b905509a91e11e5c37..e7ec3c856175928f40380d40f68bd51ef2eae9be 100644 (file)
@@ -2,8 +2,8 @@
   The internal header file includes the common header files, defines\r
   internal structure and functions used by DxeCore module.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2011, 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
@@ -25,6 +25,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/Runtime.h>\r
 #include <Protocol/LoadFile.h>\r
+#include <Protocol/LoadFile2.h>\r
 #include <Protocol/DriverBinding.h>\r
 #include <Protocol/VariableWrite.h>\r
 #include <Protocol/PlatformDriverOverride.h>\r
@@ -39,7 +40,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/StatusCode.h>\r
 #include <Protocol/Decompress.h>\r
 #include <Protocol/LoadPe32Image.h>\r
-#include <Protocol/FirmwareVolumeDispatch.h>\r
 #include <Protocol/Security.h>\r
 #include <Protocol/Ebc.h>\r
 #include <Protocol/Reset.h>\r
@@ -48,9 +48,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/FirmwareVolumeBlock.h>\r
 #include <Protocol/Capsule.h>\r
 #include <Protocol/BusSpecificDriverOverride.h>\r
-#include <Protocol/Performance.h>\r
 #include <Protocol/TcgService.h>\r
-#include <Protocol/TcgPlatform.h>\r
+#include <Protocol/HiiPackageList.h>\r
+#include <Protocol/SmmBase2.h>\r
 #include <Guid/MemoryTypeInformation.h>\r
 #include <Guid/FirmwareFileSystem2.h>\r
 #include <Guid/HobList.h>\r
@@ -61,7 +61,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Guid/MemoryAllocationHob.h>\r
 #include <Guid/EventLegacyBios.h>\r
 #include <Guid/EventGroup.h>\r
-\r
+#include <Guid/LoadModuleAtFixedAddress.h>\r
 \r
 #include <Library/DxeCoreEntryPoint.h>\r
 #include <Library/DebugLib.h>\r
@@ -74,24 +74,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/CacheMaintenanceLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/PeCoffLib.h>\r
+#include <Library/PeCoffGetEntryPointLib.h>\r
+#include <Library/PeCoffExtraActionLib.h>\r
 #include <Library/PcdLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
+#include <Library/DevicePathLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
+#include <Library/TimerLib.h>\r
+#include <Library/DxeServicesLib.h>\r
+#include <Library/DebugAgentLib.h>\r
 \r
-#include "DebugImageInfo.h"\r
-#include "Library.h"\r
-#include "FwVolBlock.h"\r
-#include "FwVolDriver.h"\r
-#include "Gcd.h"\r
-#include "Imem.h"\r
-#include "Image.h"\r
-#include "Exec.h"\r
-#include "Hand.h"\r
-\r
-\r
-//\r
-// Modifier for EFI DXE Services\r
-//\r
-#define EFI_DXESERVICE\r
 \r
 //\r
 // attributes for reserved memory before it is promoted to system memory\r
@@ -109,7 +102,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 ///\r
 /// EFI_DEP_REPLACE_TRUE - Used to dynamically patch the dependecy expression\r
 ///                        to save time.  A EFI_DEP_PUSH is evauated one an\r
-///                        replaced with EFI_DEP_REPLACE_TRUE\r
+///                        replaced with EFI_DEP_REPLACE_TRUE. If PI spec's Vol 2\r
+///                        Driver Execution Environment Core Interface use 0xff\r
+///                        as new DEPEX opcode. EFI_DEP_REPLACE_TRUE should be\r
+///                        defined to a new value that is not conflicting with PI spec.\r
 ///\r
 #define EFI_DEP_REPLACE_TRUE  0xff\r
 \r
@@ -124,21 +120,13 @@ typedef struct {
   EFI_EVENT                   Event;\r
   VOID                        *Registration;\r
   BOOLEAN                     Present;\r
-} ARCHITECTURAL_PROTOCOL_ENTRY;\r
-\r
-typedef struct {\r
-  EFI_STATUS_CODE_DATA  DataHeader;\r
-  EFI_HANDLE            Handle;\r
-} EFI_DXE_DEVICE_HANDLE_EXTENDED_DATA;\r
-\r
-#define EFI_STATUS_CODE_DXE_CORE_GUID \\r
-  { 0x335984bd, 0xe805, 0x409a, { 0xb8, 0xf8, 0xd2, 0x7e, 0xce, 0x5f, 0xf7, 0xa6 } }\r
+} EFI_CORE_PROTOCOL_NOTIFY_ENTRY;\r
 \r
 //\r
 // DXE Dispatcher Data structures\r
 //\r
 \r
-#define KNOWN_HANDLE_SIGNATURE  EFI_SIGNATURE_32('k','n','o','w')\r
+#define KNOWN_HANDLE_SIGNATURE  SIGNATURE_32('k','n','o','w')\r
 typedef struct {\r
   UINTN           Signature;\r
   LIST_ENTRY      Link;         // mFvHandleList\r
@@ -146,7 +134,7 @@ typedef struct {
 } KNOWN_HANDLE;\r
 \r
 \r
-#define EFI_CORE_DRIVER_ENTRY_SIGNATURE EFI_SIGNATURE_32('d','r','v','r')\r
+#define EFI_CORE_DRIVER_ENTRY_SIGNATURE SIGNATURE_32('d','r','v','r')\r
 typedef struct {\r
   UINTN                           Signature;\r
   LIST_ENTRY                      Link;             // mDriverList\r
@@ -179,7 +167,7 @@ typedef struct {
 //\r
 //The data structure of GCD memory map entry\r
 //\r
-#define EFI_GCD_MAP_SIGNATURE  EFI_SIGNATURE_32('g','c','d','m')\r
+#define EFI_GCD_MAP_SIGNATURE  SIGNATURE_32('g','c','d','m')\r
 typedef struct {\r
   UINTN                 Signature;\r
   LIST_ENTRY            Link;\r
@@ -197,7 +185,6 @@ typedef struct {
 // DXE Core Global Variables\r
 //\r
 extern EFI_SYSTEM_TABLE                         *gDxeCoreST;\r
-extern EFI_BOOT_SERVICES                        *gDxeCoreBS;\r
 extern EFI_RUNTIME_SERVICES                     *gDxeCoreRT;\r
 extern EFI_DXE_SERVICES                         *gDxeCoreDS;\r
 extern EFI_HANDLE                               gDxeCoreImageHandle;\r
@@ -211,7 +198,7 @@ extern EFI_METRONOME_ARCH_PROTOCOL              *gMetronome;
 extern EFI_TIMER_ARCH_PROTOCOL                  *gTimer;\r
 extern EFI_SECURITY_ARCH_PROTOCOL               *gSecurity;\r
 extern EFI_BDS_ARCH_PROTOCOL                    *gBds;\r
-extern EFI_STATUS_CODE_PROTOCOL                 *gStatusCode;\r
+extern EFI_SMM_BASE2_PROTOCOL                   *gSmmBase2;\r
 \r
 extern EFI_TPL                                  gEfiCurrentTpl;\r
 \r
@@ -223,6 +210,8 @@ extern EFI_MEMORY_TYPE_INFORMATION              gMemoryTypeInformation[EfiMaxMem
 extern BOOLEAN                                  gDispatcherRunning;\r
 extern EFI_RUNTIME_ARCH_PROTOCOL                gRuntimeTemplate;\r
 \r
+extern EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE    gLoadModuleAtFixAddressConfigurationTable;\r
+extern BOOLEAN                                       gLoadFixedAddressCodeMemoryReady;\r
 //\r
 // Service Initialization Functions\r
 //\r
@@ -284,12 +273,11 @@ CoreAcquireGcdMemoryLock (
 \r
 \r
 /**\r
-  External function. Initializes the GCD and memory services based on the memory\r
-  descriptor HOBs.  This function is responsible for priming the GCD map and the\r
-  memory map, so memory allocations and resource allocations can be made.  The first\r
-  part of this function can not depend on any memory services until at least one\r
-  memory descriptor is provided to the memory services.  Then the memory services\r
-  can be used to intialize the GCD map.\r
+  External function. Initializes memory services based on the memory\r
+  descriptor HOBs.  This function is responsible for priming the memory\r
+  map, so memory allocations and resource allocations can be made.\r
+  The first part of this function can not depend on any memory services\r
+  until at least one memory descriptor is provided to the memory services.\r
 \r
   @param  HobStart               The start address of the HOB.\r
   @param  MemoryBaseAddress      Start address of memory region found to init DXE\r
@@ -311,11 +299,8 @@ CoreInitializeMemoryServices (
 /**\r
   External function. Initializes the GCD and memory services based on the memory\r
   descriptor HOBs.  This function is responsible for priming the GCD map and the\r
-  memory map, so memory allocations and resource allocations can be made.  The first\r
-  part of this function can not depend on any memory services until at least one\r
-  memory descriptor is provided to the memory services.  Then the memory services\r
-  can be used to intialize the GCD map. The HobStart will be relocated to a pool\r
-  buffer.\r
+  memory map, so memory allocations and resource allocations can be made. The\r
+  HobStart will be relocated to a pool buffer.\r
 \r
   @param  HobStart               The start address of the HOB\r
   @param  MemoryBaseAddress      Start address of memory region found to init DXE\r
@@ -334,7 +319,7 @@ CoreInitializeGcdServices (
 \r
 \r
 /**\r
-  Initializes "event" support and populates parts of the System and Runtime Table.\r
+  Initializes "event" support.\r
 \r
   @retval EFI_SUCCESS            Always return success\r
 \r
@@ -365,7 +350,7 @@ CoreInitializeImageServices (
 \r
 **/\r
 VOID\r
-CoreNotifyOnArchProtocolInstallation (\r
+CoreNotifyOnProtocolInstallation (\r
   VOID\r
   );\r
 \r
@@ -930,6 +915,20 @@ CoreRegisterProtocolNotify (
   );\r
 \r
 \r
+/**\r
+  Removes all the events in the protocol database that match Event.\r
+\r
+  @param  Event                  The event to search for in the protocol\r
+                                 database.\r
+\r
+  @return EFI_SUCCESS when done searching the entire database.\r
+\r
+**/\r
+EFI_STATUS\r
+CoreUnregisterProtocolNotify (\r
+  IN EFI_EVENT      Event\r
+  );\r
+\r
 \r
 /**\r
   Locates the requested handle(s) and returns them in Buffer.\r
@@ -1022,17 +1021,17 @@ CoreLocateHandleBuffer (
 \r
 /**\r
   Return the first Protocol Interface that matches the Protocol GUID. If\r
-  Registration is pasased in return a Protocol Instance that was just add\r
-  to the system. If Retistration is NULL return the first Protocol Interface\r
+  Registration is passed in, return a Protocol Instance that was just add\r
+  to the system. If Registration is NULL return the first Protocol Interface\r
   you find.\r
 \r
-  @param  Protocol               The protocol to search for \r
-  @param  Registration           Optional Registration Key returned from \r
-                                 RegisterProtocolNotify() \r
-  @param  Interface              Return the Protocol interface (instance). \r
+  @param  Protocol               The protocol to search for\r
+  @param  Registration           Optional Registration Key returned from\r
+                                 RegisterProtocolNotify()\r
+  @param  Interface              Return the Protocol interface (instance).\r
 \r
-  @retval EFI_SUCCESS            If a valid Interface is returned \r
-  @retval EFI_INVALID_PARAMETER  Invalid parameter \r
+  @retval EFI_SUCCESS            If a valid Interface is returned\r
+  @retval EFI_INVALID_PARAMETER  Invalid parameter\r
   @retval EFI_NOT_FOUND          Protocol interface not found\r
 \r
 **/\r
@@ -1299,6 +1298,14 @@ CoreFreePool (
                                   protocol for loading the file.\r
   @retval EFI_OUT_OF_RESOURCES    Image was not loaded due to insufficient\r
                                   resources.\r
+  @retval EFI_LOAD_ERROR          Image was not loaded because the image format was corrupt or not\r
+                                  understood.\r
+  @retval EFI_DEVICE_ERROR        Image was not loaded because the device returned a read error.\r
+  @retval EFI_ACCESS_DENIED       Image was not loaded because the platform policy prohibits the \r
+                                  image from being loaded. NULL is returned in *ImageHandle.\r
+  @retval EFI_SECURITY_VIOLATION  Image was loaded and an ImageHandle was created with a \r
+                                  valid EFI_LOADED_IMAGE_PROTOCOL. However, the current \r
+                                  platform policy specifies that the image should not be started.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1340,7 +1347,7 @@ CoreUnloadImage (
   @param  ImageHandle             Handle of image to be started.\r
   @param  ExitDataSize            Pointer of the size to ExitData\r
   @param  ExitData                Pointer to a pointer to a data buffer that\r
-                                  includes a Null-terminated Unicode string,\r
+                                  includes a Null-terminated string,\r
                                   optionally followed by additional binary data.\r
                                   The string is a description that the caller may\r
                                   use to further indicate the reason for the\r
@@ -1572,6 +1579,7 @@ CoreCheckEvent (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 CoreAddMemorySpace (\r
   IN EFI_GCD_MEMORY_TYPE   GcdMemoryType,\r
   IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
@@ -1598,6 +1606,7 @@ CoreAddMemorySpace (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 CoreAllocateMemorySpace (\r
   IN     EFI_GCD_ALLOCATE_TYPE  GcdAllocateType,\r
   IN     EFI_GCD_MEMORY_TYPE    GcdMemoryType,\r
@@ -1620,6 +1629,7 @@ CoreAllocateMemorySpace (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 CoreFreeMemorySpace (\r
   IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
   IN UINT64                Length\r
@@ -1637,6 +1647,7 @@ CoreFreeMemorySpace (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 CoreRemoveMemorySpace (\r
   IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
   IN UINT64                Length\r
@@ -1654,6 +1665,7 @@ CoreRemoveMemorySpace (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 CoreGetMemorySpaceDescriptor (\r
   IN  EFI_PHYSICAL_ADDRESS             BaseAddress,\r
   OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR  *Descriptor\r
@@ -1673,6 +1685,7 @@ CoreGetMemorySpaceDescriptor (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 CoreSetMemorySpaceAttributes (\r
   IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
   IN UINT64                Length,\r
@@ -1693,6 +1706,7 @@ CoreSetMemorySpaceAttributes (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 CoreGetMemorySpaceMap (\r
   OUT UINTN                            *NumberOfDescriptors,\r
   OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR  **MemorySpaceMap\r
@@ -1711,6 +1725,7 @@ CoreGetMemorySpaceMap (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 CoreAddIoSpace (\r
   IN EFI_GCD_IO_TYPE       GcdIoType,\r
   IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
@@ -1736,6 +1751,7 @@ CoreAddIoSpace (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 CoreAllocateIoSpace (\r
   IN     EFI_GCD_ALLOCATE_TYPE  GcdAllocateType,\r
   IN     EFI_GCD_IO_TYPE        GcdIoType,\r
@@ -1758,6 +1774,7 @@ CoreAllocateIoSpace (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 CoreFreeIoSpace (\r
   IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
   IN UINT64                Length\r
@@ -1775,6 +1792,7 @@ CoreFreeIoSpace (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 CoreRemoveIoSpace (\r
   IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
   IN UINT64                Length\r
@@ -1792,6 +1810,7 @@ CoreRemoveIoSpace (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 CoreGetIoSpaceDescriptor (\r
   IN  EFI_PHYSICAL_ADDRESS         BaseAddress,\r
   OUT EFI_GCD_IO_SPACE_DESCRIPTOR  *Descriptor\r
@@ -1810,6 +1829,7 @@ CoreGetIoSpaceDescriptor (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 CoreGetIoSpaceMap (\r
   OUT UINTN                        *NumberOfDescriptors,\r
   OUT EFI_GCD_IO_SPACE_DESCRIPTOR  **IoSpaceMap\r
@@ -1878,29 +1898,6 @@ CoreTrust (
   );\r
 \r
 \r
-/**\r
-  Helper function called as part of the code needed\r
-  to allocate the proper sized buffer for various\r
-  EFI interfaces.\r
-\r
-  @param  Status                 Current status\r
-  @param  Buffer                 Current allocated buffer, or NULL\r
-  @param  BufferSize             Current buffer size needed\r
-\r
-  @retval TRUE                   if the buffer was reallocated and the caller\r
-                                 should try the API again.\r
-  @retval FALSE                  buffer could not be allocated and the caller\r
-                                 should not try the API again.\r
-\r
-**/\r
-BOOLEAN\r
-CoreGrowBuffer (\r
-  IN OUT EFI_STATUS   *Status,\r
-  IN OUT VOID         **Buffer,\r
-  IN UINTN            BufferSize\r
-  );\r
-\r
-\r
 /**\r
   This routine is the driver initialization entry point.  It initializes the\r
   libraries, and registers two notification functions.  These notification\r
@@ -1957,6 +1954,7 @@ InitializeSectionExtraction (
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 CoreProcessFirmwareVolume (\r
   IN VOID                             *FvHeader,\r
   IN UINTN                            Size,\r
@@ -2099,24 +2097,6 @@ CoreEfiNotAvailableYetArg5 (
   );\r
 \r
 \r
-/**\r
-  Searches for a Protocol Interface passed from PEI through a HOB.\r
-\r
-  @param  ProtocolGuid           The Protocol GUID to search for in the HOB List\r
-  @param  Interface              A pointer to the interface for the Protocol GUID\r
-\r
-  @retval EFI_SUCCESS            The Protocol GUID was found and its interface is\r
-                                 returned in Interface\r
-  @retval EFI_NOT_FOUND          The Protocol GUID was not found in the HOB List\r
-\r
-**/\r
-EFI_STATUS\r
-CoreGetPeiProtocol (\r
-  IN EFI_GUID  *ProtocolGuid,\r
-  IN VOID      **Interface\r
-  );\r
-\r
-\r
 /**\r
   Given a compressed source buffer, this function retrieves the size of the\r
   uncompressed buffer and the size of the scratch buffer required to decompress\r
@@ -2325,4 +2305,157 @@ CloseSectionStream (
   IN  UINTN                                     StreamHandleToClose\r
   );\r
 \r
+/**\r
+  Creates and initializes the DebugImageInfo Table.  Also creates the configuration\r
+  table and registers it into the system table.\r
+\r
+  Note:\r
+    This function allocates memory, frees it, and then allocates memory at an\r
+    address within the initial allocation. Since this function is called early\r
+    in DXE core initialization (before drivers are dispatched), this should not\r
+    be a problem.\r
+\r
+**/\r
+VOID\r
+CoreInitializeDebugImageInfoTable (\r
+  VOID\r
+  );\r
+\r
+\r
+/**\r
+  Update the CRC32 in the Debug Table.\r
+  Since the CRC32 service is made available by the Runtime driver, we have to\r
+  wait for the Runtime Driver to be installed before the CRC32 can be computed.\r
+  This function is called elsewhere by the core when the runtime architectural\r
+  protocol is produced.\r
+\r
+**/\r
+VOID\r
+CoreUpdateDebugTableCrc32 (\r
+  VOID\r
+  );\r
+\r
+\r
+/**\r
+  Adds a new DebugImageInfo structure to the DebugImageInfo Table.  Re-Allocates\r
+  the table if it's not large enough to accomidate another entry.\r
+\r
+  @param  ImageInfoType  type of debug image information\r
+  @param  LoadedImage    pointer to the loaded image protocol for the image being\r
+                         loaded\r
+  @param  ImageHandle    image handle for the image being loaded\r
+\r
+**/\r
+VOID\r
+CoreNewDebugImageInfoEntry (\r
+  IN  UINT32                      ImageInfoType,\r
+  IN  EFI_LOADED_IMAGE_PROTOCOL   *LoadedImage,\r
+  IN  EFI_HANDLE                  ImageHandle\r
+  );\r
+\r
+\r
+/**\r
+  Removes and frees an entry from the DebugImageInfo Table.\r
+\r
+  @param  ImageHandle    image handle for the image being unloaded\r
+\r
+**/\r
+VOID\r
+CoreRemoveDebugImageInfoEntry (\r
+  EFI_HANDLE ImageHandle\r
+  );\r
+\r
+\r
+/**\r
+  This routine consumes FV hobs and produces instances of FW_VOL_BLOCK_PROTOCOL as appropriate.\r
+\r
+  @param  ImageHandle            The image handle.\r
+  @param  SystemTable            The system table.\r
+\r
+  @retval EFI_SUCCESS            Successfully initialized firmware volume block\r
+                                 driver.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+FwVolBlockDriverInit (\r
+  IN EFI_HANDLE                 ImageHandle,\r
+  IN EFI_SYSTEM_TABLE           *SystemTable\r
+  );\r
+\r
+\r
+/**\r
+  This routine produces a firmware volume block protocol on a given\r
+  buffer.\r
+\r
+  @param  BaseAddress            base address of the firmware volume image\r
+  @param  Length                 length of the firmware volume image\r
+  @param  ParentHandle           handle of parent firmware volume, if this image\r
+                                 came from an FV image file in another firmware\r
+                                 volume (ala capsules)\r
+  @param  FvProtocol             Firmware volume block protocol produced.\r
+\r
+  @retval EFI_VOLUME_CORRUPTED   Volume corrupted.\r
+  @retval EFI_OUT_OF_RESOURCES   No enough buffer to be allocated.\r
+  @retval EFI_SUCCESS            Successfully produced a FVB protocol on given\r
+                                 buffer.\r
+\r
+**/\r
+EFI_STATUS\r
+ProduceFVBProtocolOnBuffer (\r
+  IN EFI_PHYSICAL_ADDRESS   BaseAddress,\r
+  IN UINT64                 Length,\r
+  IN EFI_HANDLE             ParentHandle,\r
+  OUT EFI_HANDLE            *FvProtocol  OPTIONAL\r
+  );\r
+\r
+\r
+/**\r
+  Raising to the task priority level of the mutual exclusion\r
+  lock, and then acquires ownership of the lock.\r
+\r
+  @param  Lock               The lock to acquire\r
+\r
+  @return Lock owned\r
+\r
+**/\r
+VOID\r
+CoreAcquireLock (\r
+  IN EFI_LOCK  *Lock\r
+  );\r
+\r
+\r
+/**\r
+  Initialize a basic mutual exclusion lock.   Each lock\r
+  provides mutual exclusion access at it's task priority\r
+  level.  Since there is no-premption (at any TPL) or\r
+  multiprocessor support, acquiring the lock only consists\r
+  of raising to the locks TPL.\r
+\r
+  @param  Lock               The EFI_LOCK structure to initialize\r
+\r
+  @retval EFI_SUCCESS        Lock Owned.\r
+  @retval EFI_ACCESS_DENIED  Reentrant Lock Acquisition, Lock not Owned.\r
+\r
+**/\r
+EFI_STATUS\r
+CoreAcquireLockOrFail (\r
+  IN EFI_LOCK  *Lock\r
+  );\r
+\r
+\r
+/**\r
+  Releases ownership of the mutual exclusion lock, and\r
+  restores the previous task priority level.\r
+\r
+  @param  Lock               The lock to release\r
+\r
+  @return Lock unowned\r
+\r
+**/\r
+VOID\r
+CoreReleaseLock (\r
+  IN EFI_LOCK  *Lock\r
+  );\r
+\r
 #endif\r