-/*++\r
+/** @file\r
+ The internal header file includes the common header files, defines\r
+ internal structure and functions used by DxeCore module.\r
\r
-Copyright (c) 2006 - 2007, Intel Corporation \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
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
-Module Name:\r
-\r
- DxeMain.h\r
-\r
-Abstract:\r
-\r
-Revision History\r
-\r
---*/\r
+**/\r
\r
#ifndef _DXE_MAIN_H_\r
#define _DXE_MAIN_H_\r
\r
-\r
-\r
#include <PiDxe.h>\r
-#include <FrameworkPei.h>\r
\r
#include <Protocol/LoadedImage.h>\r
#include <Protocol/GuidedSectionExtraction.h>\r
-#include <Protocol/SectionExtraction.h>\r
-#include <Guid/DebugImageInfoTable.h>\r
#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
#include <Protocol/Variable.h>\r
-#include <Guid/MemoryTypeInformation.h>\r
-#include <Guid/FirmwareFileSystem2.h>\r
-#include <Guid/HobList.h>\r
#include <Protocol/Timer.h>\r
#include <Protocol/SimpleFileSystem.h>\r
#include <Protocol/Bds.h>\r
-#include <Guid/FileInfo.h>\r
#include <Protocol/RealTimeClock.h>\r
-#include <Guid/Apriori.h>\r
#include <Protocol/WatchdogTimer.h>\r
#include <Protocol/FirmwareVolume2.h>\r
#include <Protocol/MonotonicCounter.h>\r
-#include <Guid/DxeServices.h>\r
-#include <Guid/MemoryAllocationHob.h>\r
#include <Protocol/StatusCode.h>\r
-#include <Protocol/CustomizedDecompress.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 <Guid/EventLegacyBios.h>\r
+#include <Protocol/Security2.h>\r
#include <Protocol/Reset.h>\r
-#include <Protocol/EdkDecompress.h>\r
#include <Protocol/Cpu.h>\r
-#include <Guid/EventGroup.h>\r
#include <Protocol/Metronome.h>\r
#include <Protocol/FirmwareVolumeBlock.h>\r
#include <Protocol/Capsule.h>\r
#include <Protocol/BusSpecificDriverOverride.h>\r
-#include <Protocol/Performance.h>\r
-#include <Guid/StatusCodeDataTypeId.h>\r
+#include <Protocol/DriverFamilyOverride.h>\r
+#include <Protocol/TcgService.h>\r
+#include <Protocol/HiiPackageList.h>\r
+#include <Protocol/SmmBase2.h>\r
+#include <Protocol/PeCoffImageEmulator.h>\r
+#include <Guid/MemoryTypeInformation.h>\r
+#include <Guid/FirmwareFileSystem2.h>\r
+#include <Guid/FirmwareFileSystem3.h>\r
+#include <Guid/HobList.h>\r
+#include <Guid/DebugImageInfoTable.h>\r
+#include <Guid/FileInfo.h>\r
+#include <Guid/Apriori.h>\r
+#include <Guid/DxeServices.h>\r
+#include <Guid/MemoryAllocationHob.h>\r
+#include <Guid/EventLegacyBios.h>\r
+#include <Guid/EventGroup.h>\r
+#include <Guid/EventExitBootServiceFailed.h>\r
+#include <Guid/LoadModuleAtFixedAddress.h>\r
+#include <Guid/IdleLoopEvent.h>\r
+#include <Guid/VectorHandoffTable.h>\r
+#include <Ppi/VectorHandoffInfo.h>\r
+#include <Guid/MemoryProfile.h>\r
\r
#include <Library/DxeCoreEntryPoint.h>\r
#include <Library/DebugLib.h>\r
#include <Library/CacheMaintenanceLib.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/PeCoffLib.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
+#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/DxeServicesLib.h>\r
+#include <Library/DebugAgentLib.h>\r
+#include <Library/CpuExceptionHandlerLib.h>\r
\r
//\r
// attributes for reserved memory before it is promoted to system memory\r
//\r
#define EFI_MEMORY_PORT_IO 0x4000000000000000ULL\r
\r
-\r
///\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
+/// EFI_DEP_REPLACE_TRUE - Used to dynamically patch the dependency expression\r
+/// to save time. A EFI_DEP_PUSH is evaluated one an\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
#define DEPEX_STACK_SIZE_INCREMENT 0x1000\r
\r
typedef struct {\r
- EFI_GUID *ProtocolGuid;\r
- VOID **Protocol;\r
- EFI_EVENT Event;\r
- VOID *Registration;\r
- BOOLEAN Present;\r
-} ARCHITECTURAL_PROTOCOL_ENTRY;\r
-\r
+ EFI_GUID *ProtocolGuid;\r
+ VOID **Protocol;\r
+ EFI_EVENT Event;\r
+ VOID *Registration;\r
+ BOOLEAN Present;\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
- EFI_HANDLE Handle;\r
+ UINTN Signature;\r
+ LIST_ENTRY Link; // mFvHandleList\r
+ EFI_HANDLE Handle;\r
+ EFI_GUID FvNameGuid;\r
} 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
+ UINTN Signature;\r
+ LIST_ENTRY Link; // mDriverList\r
\r
- LIST_ENTRY ScheduledLink; // mScheduledQueue\r
+ LIST_ENTRY ScheduledLink; // mScheduledQueue\r
\r
- EFI_HANDLE FvHandle;\r
- EFI_GUID FileName;\r
- EFI_DEVICE_PATH_PROTOCOL *FvFileDevicePath;\r
- EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;\r
+ EFI_HANDLE FvHandle;\r
+ EFI_GUID FileName;\r
+ EFI_DEVICE_PATH_PROTOCOL *FvFileDevicePath;\r
+ EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;\r
\r
- VOID *Depex;\r
- UINTN DepexSize;\r
+ VOID *Depex;\r
+ UINTN DepexSize;\r
\r
- BOOLEAN Before;\r
- BOOLEAN After;\r
- EFI_GUID BeforeAfterGuid;\r
+ BOOLEAN Before;\r
+ BOOLEAN After;\r
+ EFI_GUID BeforeAfterGuid;\r
\r
- BOOLEAN Dependent;\r
- BOOLEAN Unrequested;\r
- BOOLEAN Scheduled;\r
- BOOLEAN Untrusted;\r
- BOOLEAN Initialized;\r
- BOOLEAN DepexProtocolError;\r
-\r
- EFI_HANDLE ImageHandle;\r
+ BOOLEAN Dependent;\r
+ BOOLEAN Unrequested;\r
+ BOOLEAN Scheduled;\r
+ BOOLEAN Untrusted;\r
+ BOOLEAN Initialized;\r
+ BOOLEAN DepexProtocolError;\r
\r
+ EFI_HANDLE ImageHandle;\r
+ BOOLEAN IsFvImage;\r
} EFI_CORE_DRIVER_ENTRY;\r
\r
//\r
-//The data structure of GCD memory map entry\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
- EFI_PHYSICAL_ADDRESS BaseAddress;\r
- UINT64 EndAddress;\r
- UINT64 Capabilities;\r
- UINT64 Attributes;\r
- EFI_GCD_MEMORY_TYPE GcdMemoryType;\r
- EFI_GCD_IO_TYPE GcdIoType;\r
- EFI_HANDLE ImageHandle;\r
- EFI_HANDLE DeviceHandle;\r
+ UINTN Signature;\r
+ LIST_ENTRY Link;\r
+ EFI_PHYSICAL_ADDRESS BaseAddress;\r
+ UINT64 EndAddress;\r
+ UINT64 Capabilities;\r
+ UINT64 Attributes;\r
+ EFI_GCD_MEMORY_TYPE GcdMemoryType;\r
+ EFI_GCD_IO_TYPE GcdIoType;\r
+ EFI_HANDLE ImageHandle;\r
+ EFI_HANDLE DeviceHandle;\r
} EFI_GCD_MAP_ENTRY;\r
\r
+#define LOADED_IMAGE_PRIVATE_DATA_SIGNATURE SIGNATURE_32('l','d','r','i')\r
+\r
+typedef struct {\r
+ UINTN Signature;\r
+ /// Image handle\r
+ EFI_HANDLE Handle;\r
+ /// Image type\r
+ UINTN Type;\r
+ /// If entrypoint has been called\r
+ BOOLEAN Started;\r
+ /// The image's entry point\r
+ EFI_IMAGE_ENTRY_POINT EntryPoint;\r
+ /// loaded image protocol\r
+ EFI_LOADED_IMAGE_PROTOCOL Info;\r
+ /// Location in memory\r
+ EFI_PHYSICAL_ADDRESS ImageBasePage;\r
+ /// Number of pages\r
+ UINTN NumberOfPages;\r
+ /// Original fixup data\r
+ CHAR8 *FixupData;\r
+ /// Tpl of started image\r
+ EFI_TPL Tpl;\r
+ /// Status returned by started image\r
+ EFI_STATUS Status;\r
+ /// Size of ExitData from started image\r
+ UINTN ExitDataSize;\r
+ /// Pointer to exit data from started image\r
+ VOID *ExitData;\r
+ /// Pointer to pool allocation for context save/restore\r
+ VOID *JumpBuffer;\r
+ /// Pointer to buffer for context save/restore\r
+ BASE_LIBRARY_JUMP_BUFFER *JumpContext;\r
+ /// Machine type from PE image\r
+ UINT16 Machine;\r
+ /// PE/COFF Image Emulator Protocol pointer\r
+ EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL *PeCoffEmu;\r
+ /// Runtime image list\r
+ EFI_RUNTIME_IMAGE_ENTRY *RuntimeData;\r
+ /// Pointer to Loaded Image Device Path Protocol\r
+ EFI_DEVICE_PATH_PROTOCOL *LoadedImageDevicePath;\r
+ /// PeCoffLoader ImageContext\r
+ PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;\r
+ /// Status returned by LoadImage() service.\r
+ EFI_STATUS LoadImageStatus;\r
+} LOADED_IMAGE_PRIVATE_DATA;\r
+\r
+#define LOADED_IMAGE_PRIVATE_DATA_FROM_THIS(a) \\r
+ CR(a, LOADED_IMAGE_PRIVATE_DATA, Info, LOADED_IMAGE_PRIVATE_DATA_SIGNATURE)\r
+\r
+#define IMAGE_PROPERTIES_RECORD_CODE_SECTION_SIGNATURE SIGNATURE_32 ('I','P','R','C')\r
+\r
+typedef struct {\r
+ UINT32 Signature;\r
+ LIST_ENTRY Link;\r
+ EFI_PHYSICAL_ADDRESS CodeSegmentBase;\r
+ UINT64 CodeSegmentSize;\r
+} IMAGE_PROPERTIES_RECORD_CODE_SECTION;\r
+\r
+#define IMAGE_PROPERTIES_RECORD_SIGNATURE SIGNATURE_32 ('I','P','R','D')\r
+\r
+typedef struct {\r
+ UINT32 Signature;\r
+ LIST_ENTRY Link;\r
+ EFI_PHYSICAL_ADDRESS ImageBase;\r
+ UINT64 ImageSize;\r
+ UINTN CodeSegmentCount;\r
+ LIST_ENTRY CodeSegmentList;\r
+} IMAGE_PROPERTIES_RECORD;\r
+\r
//\r
// 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
+extern EFI_SYSTEM_TABLE *gDxeCoreST;\r
+extern EFI_RUNTIME_SERVICES *gDxeCoreRT;\r
+extern EFI_DXE_SERVICES *gDxeCoreDS;\r
+extern EFI_HANDLE gDxeCoreImageHandle;\r
+\r
+extern BOOLEAN gMemoryMapTerminated;\r
\r
-extern EFI_DECOMPRESS_PROTOCOL gEfiDecompress;\r
+extern EFI_DECOMPRESS_PROTOCOL gEfiDecompress;\r
\r
-extern EFI_RUNTIME_ARCH_PROTOCOL *gRuntime;\r
-extern EFI_CPU_ARCH_PROTOCOL *gCpu;\r
-extern EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *gWatchdogTimer;\r
-extern EFI_METRONOME_ARCH_PROTOCOL *gMetronome;\r
-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_RUNTIME_ARCH_PROTOCOL *gRuntime;\r
+extern EFI_CPU_ARCH_PROTOCOL *gCpu;\r
+extern EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *gWatchdogTimer;\r
+extern EFI_METRONOME_ARCH_PROTOCOL *gMetronome;\r
+extern EFI_TIMER_ARCH_PROTOCOL *gTimer;\r
+extern EFI_SECURITY_ARCH_PROTOCOL *gSecurity;\r
+extern EFI_SECURITY2_ARCH_PROTOCOL *gSecurity2;\r
+extern EFI_BDS_ARCH_PROTOCOL *gBds;\r
+extern EFI_SMM_BASE2_PROTOCOL *gSmmBase2;\r
\r
-extern EFI_TPL gEfiCurrentTpl;\r
+extern EFI_TPL gEfiCurrentTpl;\r
\r
-extern EFI_GUID *gDxeCoreFileName;\r
-extern EFI_LOADED_IMAGE_PROTOCOL *gDxeCoreLoadedImage;\r
+extern EFI_GUID *gDxeCoreFileName;\r
+extern EFI_LOADED_IMAGE_PROTOCOL *gDxeCoreLoadedImage;\r
\r
-extern EFI_MEMORY_TYPE_INFORMATION gMemoryTypeInformation[EfiMaxMemoryType + 1];\r
+extern EFI_MEMORY_TYPE_INFORMATION gMemoryTypeInformation[EfiMaxMemoryType + 1];\r
\r
-extern BOOLEAN gDispatcherRunning;\r
-extern EFI_RUNTIME_ARCH_PROTOCOL gRuntimeTemplate;\r
+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
\r
+/**\r
+ Called to initialize the pool.\r
\r
+**/\r
VOID\r
CoreInitializePool (\r
VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Called to initialize the pool.\r
-\r
-Arguments:\r
-\r
- None\r
+ );\r
\r
-Returns:\r
+/**\r
+ Called to initialize the memory map and add descriptors to\r
+ the current descriptor list.\r
+ The first descriptor that is added must be general usable\r
+ memory as the addition allocates heap.\r
\r
- None\r
+ @param Type The type of memory to add\r
+ @param Start The starting address in the memory range Must be\r
+ page aligned\r
+ @param NumberOfPages The number of pages in the range\r
+ @param Attribute Attributes of the memory to add\r
\r
---*/\r
-;\r
+ @return None. The range is added to the memory map\r
\r
+**/\r
VOID\r
CoreAddMemoryDescriptor (\r
IN EFI_MEMORY_TYPE Type,\r
IN EFI_PHYSICAL_ADDRESS Start,\r
IN UINT64 NumberOfPages,\r
IN UINT64 Attribute\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Called to initialize the memory map and add descriptors to\r
- the current descriptor list.\r
-\r
- The first descriptor that is added must be general usable\r
- memory as the addition allocates heap.\r
-\r
-Arguments:\r
-\r
- Type - The type of memory to add\r
-\r
- Start - The starting address in the memory range\r
- Must be page aligned\r
-\r
- NumberOfPages - The number of pages in the range\r
-\r
- Attribute - Attributes of the memory to add\r
-\r
-Returns:\r
-\r
- None. The range is added to the memory map\r
+ );\r
\r
---*/\r
-;\r
+/**\r
+ Release memory lock on mGcdMemorySpaceLock.\r
\r
+**/\r
VOID\r
CoreReleaseGcdMemoryLock (\r
VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Release memory lock on mGcdMemorySpaceLock\r
-\r
-Arguments:\r
- None\r
-\r
-Returns:\r
- None\r
+ );\r
\r
---*/\r
-;\r
+/**\r
+ Acquire memory lock on mGcdMemorySpaceLock.\r
\r
+**/\r
VOID\r
CoreAcquireGcdMemoryLock (\r
VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Acquire memory lock on mGcdMemorySpaceLock\r
+ );\r
\r
-Arguments:\r
- None\r
+/**\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
-Returns:\r
- None\r
+ @param HobStart The start address of the HOB.\r
+ @param MemoryBaseAddress Start address of memory region found to init DXE\r
+ core.\r
+ @param MemoryLength Length of memory region found to init DXE core.\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS Memory services successfully initialized.\r
\r
+**/\r
EFI_STATUS\r
CoreInitializeMemoryServices (\r
- IN VOID **HobStart,\r
- IN EFI_PHYSICAL_ADDRESS *MemoryBaseAddress,\r
- IN UINT64 *MemoryLength\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+ IN VOID **HobStart,\r
+ OUT EFI_PHYSICAL_ADDRESS *MemoryBaseAddress,\r
+ OUT UINT64 *MemoryLength\r
+ );\r
\r
- External function. Initializes the GCD and memory services based on the memory \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
-\r
-Arguments:\r
-\r
- HobStart - The start address of the HOB.\r
- \r
- MemoryBaseAddress - Start address of memory region found to init DXE core.\r
- \r
- MemoryLength - Length of memory region found to init DXE core.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Memory services successfully initialized.\r
+ memory map, so memory allocations and resource allocations can be made. The\r
+ HobStart will be relocated to a pool buffer.\r
\r
---*/\r
-;\r
+ @param HobStart The start address of the HOB\r
+ @param MemoryBaseAddress Start address of memory region found to init DXE\r
+ core.\r
+ @param MemoryLength Length of memory region found to init DXE core.\r
\r
+ @retval EFI_SUCCESS GCD services successfully initialized.\r
\r
+**/\r
EFI_STATUS\r
CoreInitializeGcdServices (\r
- IN OUT VOID **HobStart,\r
+ IN OUT VOID **HobStart,\r
IN EFI_PHYSICAL_ADDRESS MemoryBaseAddress,\r
IN UINT64 MemoryLength\r
- )\r
-/*++\r
-\r
-Routine Description:\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. The HobStart will be relocated to a pool\r
- buffer.\r
-\r
-Arguments:\r
-\r
- HobStart - The start address of the HOB\r
- \r
- MemoryBaseAddress - Start address of memory region found to init DXE core.\r
- \r
- MemoryLength - Length of memory region found to init DXE core.\r
-\r
-\r
-Returns:\r
+ );\r
\r
- EFI_SUCCESS - GCD services successfully initialized.\r
+/**\r
+ Initializes "event" support.\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS Always return success\r
\r
+**/\r
EFI_STATUS\r
CoreInitializeEventServices (\r
VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Initializes "event" support and populates parts of the System and Runtime Table.\r
-\r
-Arguments:\r
-\r
- None\r
- \r
-Returns:\r
-\r
- EFI_SUCCESS - Always return success\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CoreInitializeImageServices (\r
- IN VOID *HobStart\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+ );\r
\r
+/**\r
Add the Image Services to EFI Boot Services Table and install the protocol\r
interfaces for this image.\r
\r
-Arguments:\r
+ @param HobStart The HOB to initialize\r
\r
- HobStart - The HOB to initialize\r
+ @return Status code.\r
\r
-Returns:\r
-\r
- Status code.\r
+**/\r
+EFI_STATUS\r
+CoreInitializeImageServices (\r
+ IN VOID *HobStart\r
+ );\r
\r
---*/\r
-;\r
+/**\r
+ Creates an event that is fired everytime a Protocol of a specific type is installed.\r
\r
+**/\r
VOID\r
-CoreNotifyOnArchProtocolInstallation (\r
+CoreNotifyOnProtocolInstallation (\r
VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Creates an event that is fired everytime a Protocol of a specific type is installed\r
-\r
-Arguments:\r
- NONE\r
+ );\r
\r
-Returns:\r
- NONE\r
+/**\r
+ Return TRUE if all AP services are available.\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS All AP services are available\r
+ @retval EFI_NOT_FOUND At least one AP service is not available\r
\r
+**/\r
EFI_STATUS\r
CoreAllEfiServicesAvailable (\r
VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Return TRUE if all AP services are availible.\r
-\r
-Arguments:\r
- NONE\r
-\r
-Returns:\r
- EFI_SUCCESS - All AP services are available\r
- EFI_NOT_FOUND - At least one AP service is not available \r
-\r
---*/\r
-;\r
-\r
-VOID\r
-CalculateEfiHdrCrc (\r
- IN OUT EFI_TABLE_HEADER *Hdr\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+ );\r
\r
+/**\r
Calcualte the 32-bit CRC in a EFI table using the service provided by the\r
gRuntime service.\r
\r
-Arguments:\r
+ @param Hdr Pointer to an EFI standard header\r
\r
- Hdr - Pointer to an EFI standard header\r
-\r
-Returns:\r
+**/\r
+VOID\r
+CalculateEfiHdrCrc (\r
+ IN OUT EFI_TABLE_HEADER *Hdr\r
+ );\r
\r
- None\r
+/**\r
+ Called by the platform code to process a tick.\r
\r
---*/\r
-;\r
+ @param Duration The number of 100ns elapsed since the last call\r
+ to TimerTick\r
\r
+**/\r
VOID\r
EFIAPI\r
CoreTimerTick (\r
- IN UINT64 Duration\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Called by the platform code to process a tick.\r
-\r
-Arguments:\r
-\r
- Duration - The number of 100ns elasped since the last call to TimerTick\r
- \r
-Returns:\r
-\r
- None\r
+ IN UINT64 Duration\r
+ );\r
\r
---*/\r
-;\r
+/**\r
+ Initialize the dispatcher. Initialize the notification function that runs when\r
+ an FV2 protocol is added to the system.\r
\r
+**/\r
VOID\r
CoreInitializeDispatcher (\r
VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Initialize the dispatcher. Initialize the notification function that runs when\r
- a FV protocol is added to the system.\r
-\r
-Arguments:\r
-\r
- NONE\r
-\r
-Returns:\r
-\r
- NONE \r
-\r
---*/\r
-;\r
-\r
-BOOLEAN\r
-CoreIsSchedulable (\r
- IN EFI_CORE_DRIVER_ENTRY *DriverEntry \r
- )\r
-/*++\r
-\r
-Routine Description:\r
+ );\r
\r
- This is the POSTFIX version of the dependency evaluator. This code does \r
- not need to handle Before or After, as it is not valid to call this \r
+/**\r
+ This is the POSTFIX version of the dependency evaluator. This code does\r
+ not need to handle Before or After, as it is not valid to call this\r
routine in this case. The SOR is just ignored and is a nop in the grammer.\r
-\r
POSTFIX means all the math is done on top of the stack.\r
\r
-Arguments:\r
-\r
- DriverEntry - DriverEntry element to update\r
- \r
-Returns:\r
+ @param DriverEntry DriverEntry element to update.\r
\r
- TRUE - If driver is ready to run.\r
+ @retval TRUE If driver is ready to run.\r
+ @retval FALSE If driver is not ready to run or some fatal error\r
+ was found.\r
\r
- FALSE - If driver is not ready to run or some fatal error was found.\r
-\r
---*/\r
-;\r
-\r
-EFI_STATUS\r
-CorePreProcessDepex (\r
- IN EFI_CORE_DRIVER_ENTRY *DriverEntry \r
- )\r
-/*++\r
-\r
-Routine Description:\r
+**/\r
+BOOLEAN\r
+CoreIsSchedulable (\r
+ IN EFI_CORE_DRIVER_ENTRY *DriverEntry\r
+ );\r
\r
+/**\r
Preprocess dependency expression and update DriverEntry to reflect the\r
state of Before, After, and SOR dependencies. If DriverEntry->Before\r
or DriverEntry->After is set it will never be cleared. If SOR is set\r
- it will be cleared by CoreSchedule(), and then the driver can be \r
+ it will be cleared by CoreSchedule(), and then the driver can be\r
dispatched.\r
\r
-Arguments:\r
+ @param DriverEntry DriverEntry element to update .\r
\r
- DriverEntry - DriverEntry element to update\r
+ @retval EFI_SUCCESS It always works.\r
\r
-Returns:\r
+**/\r
+EFI_STATUS\r
+CorePreProcessDepex (\r
+ IN EFI_CORE_DRIVER_ENTRY *DriverEntry\r
+ );\r
\r
- EFI_SUCCESS - It always works.\r
+/**\r
+ Terminates all boot services.\r
\r
---*/\r
-;\r
+ @param ImageHandle Handle that identifies the exiting image.\r
+ @param MapKey Key to the latest memory map.\r
\r
+ @retval EFI_SUCCESS Boot Services terminated\r
+ @retval EFI_INVALID_PARAMETER MapKey is incorrect.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreExitBootServices (\r
- IN EFI_HANDLE ImageHandle,\r
- IN UINTN MapKey\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- UEFI 2.0 API to terminate Boot Services\r
-\r
-Arguments:\r
-\r
- ImageHandle - Handle that represents the identity of the calling image\r
-\r
- MapKey -Key to the latest memory map.\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN UINTN MapKey\r
+ );\r
\r
-Returns:\r
+/**\r
+ Make sure the memory map is following all the construction rules,\r
+ it is the last time to check memory map error before exit boot services.\r
\r
- EFI_SUCCESS - Boot Services terminated\r
- EFI_INVALID_PARAMETER - MapKey is incorrect.\r
+ @param MapKey Memory map key\r
\r
---*/\r
-;\r
+ @retval EFI_INVALID_PARAMETER Memory map not consistent with construction\r
+ rules.\r
+ @retval EFI_SUCCESS Valid memory map.\r
\r
+**/\r
EFI_STATUS\r
CoreTerminateMemoryMap (\r
- IN UINTN MapKey\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Make sure the memory map is following all the construction rules, \r
- it is the last time to check memory map error before exit boot services.\r
-\r
-Arguments:\r
-\r
- MapKey - Memory map key\r
-\r
-Returns:\r
+ IN UINTN MapKey\r
+ );\r
\r
- EFI_INVALID_PARAMETER - Memory map not consistent with construction rules.\r
- \r
- EFI_SUCCESS - Valid memory map.\r
+/**\r
+ Signals all events in the EventGroup.\r
\r
---*/\r
-;\r
+ @param EventGroup The list to signal\r
\r
+**/\r
VOID\r
CoreNotifySignalList (\r
- IN EFI_GUID *EventGroup\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Signals all events on the requested list\r
-\r
-Arguments:\r
-\r
- SignalType - The list to signal\r
- \r
-Returns:\r
+ IN EFI_GUID *EventGroup\r
+ );\r
\r
- None\r
+/**\r
+ Boot Service called to add, modify, or remove a system configuration table from\r
+ the EFI System Table.\r
\r
---*/\r
-;\r
+ @param Guid Pointer to the GUID for the entry to add, update, or\r
+ remove\r
+ @param Table Pointer to the configuration table for the entry to add,\r
+ update, or remove, may be NULL.\r
\r
+ @return EFI_SUCCESS Guid, Table pair added, updated, or removed.\r
+ @return EFI_INVALID_PARAMETER Input GUID not valid.\r
+ @return EFI_NOT_FOUND Attempted to delete non-existant entry\r
+ @return EFI_OUT_OF_RESOURCES Not enough memory available\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreInstallConfigurationTable (\r
- IN EFI_GUID *Guid,\r
- IN VOID *Table\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Boot Service called to add, modify, or remove a system configuration table from \r
- the EFI System Table.\r
-\r
-Arguments:\r
-\r
- Guid: Pointer to the GUID for the entry to add, update, or remove\r
- Table: Pointer to the configuration table for the entry to add, update, or\r
- remove, may be NULL.\r
+ IN EFI_GUID *Guid,\r
+ IN VOID *Table\r
+ );\r
\r
-Returns:\r
- \r
- EFI_SUCCESS Guid, Table pair added, updated, or removed.\r
- EFI_INVALID_PARAMETER Input GUID not valid.\r
- EFI_NOT_FOUND Attempted to delete non-existant entry\r
- EFI_OUT_OF_RESOURCES Not enough memory available\r
+/**\r
+ Raise the task priority level to the new level.\r
+ High level is implemented by disabling processor interrupts.\r
\r
---*/\r
-;\r
+ @param NewTpl New task priority level\r
\r
+ @return The previous task priority level\r
\r
+**/\r
EFI_TPL\r
EFIAPI\r
CoreRaiseTpl (\r
IN EFI_TPL NewTpl\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Raise the task priority level to the new level.\r
- High level is implemented by disabling processor interrupts.\r
-\r
-Arguments:\r
-\r
- NewTpl - New task priority level\r
- \r
-Returns:\r
-\r
- The previous task priority level\r
+ );\r
\r
---*/\r
-;\r
+/**\r
+ Lowers the task priority to the previous value. If the new\r
+ priority unmasks events at a higher priority, they are dispatched.\r
\r
+ @param NewTpl New, lower, task priority\r
\r
+**/\r
VOID\r
EFIAPI\r
CoreRestoreTpl (\r
IN EFI_TPL NewTpl\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Lowers the task priority to the previous value. If the new \r
- priority unmasks events at a higher priority, they are dispatched.\r
-\r
-Arguments:\r
-\r
- NewTpl - New, lower, task priority\r
- \r
-Returns:\r
+ );\r
\r
- None\r
+/**\r
+ Introduces a fine-grained stall.\r
\r
---*/\r
-;\r
+ @param Microseconds The number of microseconds to stall execution.\r
\r
+ @retval EFI_SUCCESS Execution was stalled for at least the requested\r
+ amount of microseconds.\r
+ @retval EFI_NOT_AVAILABLE_YET gMetronome is not available yet\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreStall (\r
- IN UINTN Microseconds\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Introduces a fine-grained stall.\r
-\r
-Arguments:\r
-\r
- Microseconds The number of microseconds to stall execution\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS - Execution was stalled for at least the requested amount\r
- of microseconds.\r
-\r
- EFI_NOT_AVAILABLE_YET - gMetronome is not available yet\r
-\r
---*/\r
-;\r
+ IN UINTN Microseconds\r
+ );\r
\r
+/**\r
+ Sets the system's watchdog timer.\r
\r
+ @param Timeout The number of seconds to set the watchdog timer to.\r
+ A value of zero disables the timer.\r
+ @param WatchdogCode The numeric code to log on a watchdog timer timeout\r
+ event. The firmware reserves codes 0x0000 to 0xFFFF.\r
+ Loaders and operating systems may use other timeout\r
+ codes.\r
+ @param DataSize The size, in bytes, of WatchdogData.\r
+ @param WatchdogData A data buffer that includes a Null-terminated Unicode\r
+ string, optionally followed by additional binary data.\r
+ The string is a description that the call may use to\r
+ further indicate the reason to be logged with a\r
+ watchdog event.\r
+\r
+ @return EFI_SUCCESS Timeout has been set\r
+ @return EFI_NOT_AVAILABLE_YET WatchdogTimer is not available yet\r
+ @return EFI_UNSUPPORTED System does not have a timer (currently not used)\r
+ @return EFI_DEVICE_ERROR Could not complete due to hardware error\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreSetWatchdogTimer (\r
- IN UINTN Timeout,\r
- IN UINT64 WatchdogCode,\r
- IN UINTN DataSize,\r
- IN CHAR16 *WatchdogData OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Sets the system's watchdog timer.\r
-\r
-Arguments:\r
-\r
- Timeout The number of seconds. Zero disables the timer.\r
-\r
- ///////following three parameters are left for platform specific using \r
- \r
- WatchdogCode The numberic code to log. 0x0 to 0xffff are firmware\r
- DataSize Size of the optional data\r
- WatchdogData Optional Null terminated unicode string followed by binary \r
- data.\r
-\r
-Returns:\r
+ IN UINTN Timeout,\r
+ IN UINT64 WatchdogCode,\r
+ IN UINTN DataSize,\r
+ IN CHAR16 *WatchdogData OPTIONAL\r
+ );\r
\r
- EFI_SUCCESS Timeout has been set\r
- EFI_NOT_AVAILABLE_YET WatchdogTimer is not available yet \r
- EFI_UNSUPPORTED System does not have a timer (currently not used)\r
- EFI_DEVICE_ERROR Could not complete due to hardware error\r
+/**\r
+ Wrapper function to CoreInstallProtocolInterfaceNotify. This is the public API which\r
+ Calls the private one which contains a BOOLEAN parameter for notifications\r
\r
---*/\r
-;\r
+ @param UserHandle The handle to install the protocol handler on,\r
+ or NULL if a new handle is to be allocated\r
+ @param Protocol The protocol to add to the handle\r
+ @param InterfaceType Indicates whether Interface is supplied in\r
+ native form.\r
+ @param Interface The interface for the protocol being added\r
\r
+ @return Status code\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreInstallProtocolInterface (\r
- IN OUT EFI_HANDLE *UserHandle,\r
- IN EFI_GUID *Protocol,\r
- IN EFI_INTERFACE_TYPE InterfaceType,\r
- IN VOID *Interface\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Wrapper function to CoreInstallProtocolInterfaceNotify. This is the public API which\r
- Calls the private one which contains a BOOLEAN parameter for notifications\r
-\r
-Arguments:\r
-\r
- UserHandle - The handle to install the protocol handler on,\r
- or NULL if a new handle is to be allocated\r
-\r
- Protocol - The protocol to add to the handle\r
-\r
- InterfaceType - Indicates whether Interface is supplied in native form.\r
-\r
- Interface - The interface for the protocol being added\r
+ IN OUT EFI_HANDLE *UserHandle,\r
+ IN EFI_GUID *Protocol,\r
+ IN EFI_INTERFACE_TYPE InterfaceType,\r
+ IN VOID *Interface\r
+ );\r
\r
-Returns:\r
+/**\r
+ Installs a protocol interface into the boot services environment.\r
\r
- Status code \r
+ @param UserHandle The handle to install the protocol handler on,\r
+ or NULL if a new handle is to be allocated\r
+ @param Protocol The protocol to add to the handle\r
+ @param InterfaceType Indicates whether Interface is supplied in\r
+ native form.\r
+ @param Interface The interface for the protocol being added\r
+ @param Notify indicates whether notify the notification list\r
+ for this protocol\r
\r
---*/\r
-;\r
+ @retval EFI_INVALID_PARAMETER Invalid parameter\r
+ @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
+ @retval EFI_SUCCESS Protocol interface successfully installed\r
\r
+**/\r
EFI_STATUS\r
CoreInstallProtocolInterfaceNotify (\r
- IN OUT EFI_HANDLE *UserHandle,\r
- IN EFI_GUID *Protocol,\r
- IN EFI_INTERFACE_TYPE InterfaceType,\r
- IN VOID *Interface,\r
- IN BOOLEAN Notify\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Installs a protocol interface into the boot services environment.\r
-\r
-Arguments:\r
-\r
- UserHandle - The handle to install the protocol handler on,\r
- or NULL if a new handle is to be allocated\r
-\r
- Protocol - The protocol to add to the handle\r
-\r
- InterfaceType - Indicates whether Interface is supplied in native form.\r
-\r
- Interface - The interface for the protocol being added\r
- \r
- Notify - Whether to notify the notification list for this protocol \r
-\r
-Returns:\r
+ IN OUT EFI_HANDLE *UserHandle,\r
+ IN EFI_GUID *Protocol,\r
+ IN EFI_INTERFACE_TYPE InterfaceType,\r
+ IN VOID *Interface,\r
+ IN BOOLEAN Notify\r
+ );\r
\r
- EFI_INVALID_PARAMETER - Invalid parameter\r
- \r
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r
- \r
- EFI_SUCCESS - Protocol interface successfully installed\r
+/**\r
+ Installs a list of protocol interface into the boot services environment.\r
+ This function calls InstallProtocolInterface() in a loop. If any error\r
+ occures all the protocols added by this function are removed. This is\r
+ basically a lib function to save space.\r
\r
---*/\r
-;\r
+ @param Handle The handle to install the protocol handlers on,\r
+ or NULL if a new handle is to be allocated\r
+ @param ... EFI_GUID followed by protocol instance. A NULL\r
+ terminates the list. The pairs are the\r
+ arguments to InstallProtocolInterface(). All the\r
+ protocols are added to Handle.\r
\r
+ @retval EFI_SUCCESS All the protocol interface was installed.\r
+ @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.\r
+ @retval EFI_ALREADY_STARTED A Device Path Protocol instance was passed in that is already present in\r
+ the handle database.\r
+ @retval EFI_INVALID_PARAMETER Handle is NULL.\r
+ @retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreInstallMultipleProtocolInterfaces (\r
- IN OUT EFI_HANDLE *Handle,\r
+ IN OUT EFI_HANDLE *Handle,\r
...\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+ );\r
\r
- Installs a list of protocol interface into the boot services environment.\r
- This function calls InstallProtocolInterface() in a loop. If any error\r
- occures all the protocols added by this function are removed. This is \r
+/**\r
+ Uninstalls a list of protocol interface in the boot services environment.\r
+ This function calls UnisatllProtocolInterface() in a loop. This is\r
basically a lib function to save space.\r
\r
-Arguments:\r
-\r
- Handle - The handle to install the protocol handlers on,\r
- or NULL if a new handle is to be allocated\r
- ... - EFI_GUID followed by protocol instance. A NULL terminates the \r
- list. The pairs are the arguments to InstallProtocolInterface().\r
- All the protocols are added to Handle.\r
-\r
-Returns:\r
-\r
- EFI_INVALID_PARAMETER - Handle is NULL.\r
- \r
- EFI_SUCCESS - Protocol interfaces successfully installed.\r
-\r
---*/\r
-;\r
+ @param Handle The handle to uninstall the protocol\r
+ @param ... EFI_GUID followed by protocol instance. A NULL\r
+ terminates the list. The pairs are the\r
+ arguments to UninstallProtocolInterface(). All\r
+ the protocols are added to Handle.\r
\r
+ @return Status code\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreUninstallMultipleProtocolInterfaces (\r
- IN EFI_HANDLE Handle,\r
+ IN EFI_HANDLE Handle,\r
...\r
- )\r
-/*++\r
+ );\r
\r
-Routine Description:\r
+/**\r
+ Reinstall a protocol interface on a device handle. The OldInterface for Protocol is replaced by the NewInterface.\r
\r
- Uninstalls a list of protocol interface in the boot services environment. \r
- This function calls UnisatllProtocolInterface() in a loop. This is \r
- basically a lib function to save space.\r
-\r
-Arguments:\r
-\r
- Handle - The handle to uninstall the protocol\r
-\r
- ... - EFI_GUID followed by protocol instance. A NULL terminates the \r
- list. The pairs are the arguments to UninstallProtocolInterface().\r
- All the protocols are added to Handle.\r
-\r
-Returns:\r
-\r
- Status code \r
-\r
---*/\r
-;\r
+ @param UserHandle Handle on which the interface is to be\r
+ reinstalled\r
+ @param Protocol The numeric ID of the interface\r
+ @param OldInterface A pointer to the old interface\r
+ @param NewInterface A pointer to the new interface\r
\r
+ @retval EFI_SUCCESS The protocol interface was installed\r
+ @retval EFI_NOT_FOUND The OldInterface on the handle was not found\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreReinstallProtocolInterface (\r
- IN EFI_HANDLE UserHandle,\r
- IN EFI_GUID *Protocol,\r
- IN VOID *OldInterface,\r
- IN VOID *NewInterface\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Reinstall a protocol interface on a device handle. The OldInterface for Protocol is replaced by the NewInterface.\r
-\r
-Arguments:\r
-\r
- UserHandle - Handle on which the interface is to be reinstalled\r
- Protocol - The numeric ID of the interface\r
- OldInterface - A pointer to the old interface\r
- NewInterface - A pointer to the new interface \r
-\r
-\r
-Returns:\r
-\r
- Status code.\r
-\r
- On EFI_SUCCESS The protocol interface was installed\r
- On EFI_NOT_FOUND The OldInterface on the handle was not found\r
- On EFI_INVALID_PARAMETER One of the parameters has an invalid value\r
- \r
---*/\r
-;\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreUninstallProtocolInterface (\r
- IN EFI_HANDLE UserHandle,\r
- IN EFI_GUID *Protocol,\r
- IN VOID *Interface\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+ IN EFI_HANDLE UserHandle,\r
+ IN EFI_GUID *Protocol,\r
+ IN VOID *OldInterface,\r
+ IN VOID *NewInterface\r
+ );\r
\r
- Uninstalls all instances of a protocol:interfacer from a handle. \r
- If the last protocol interface is remove from the handle, the \r
+/**\r
+ Uninstalls all instances of a protocol:interfacer from a handle.\r
+ If the last protocol interface is remove from the handle, the\r
handle is freed.\r
\r
-Arguments:\r
-\r
- UserHandle - The handle to remove the protocol handler from\r
-\r
- Protocol - The protocol, of protocol:interface, to remove\r
-\r
- Interface - The interface, of protocol:interface, to remove\r
-\r
-Returns:\r
-\r
- EFI_INVALID_PARAMETER - Protocol is NULL.\r
- \r
- EFI_SUCCESS - Protocol interface successfully uninstalled.\r
-\r
---*/\r
-;\r
+ @param UserHandle The handle to remove the protocol handler from\r
+ @param Protocol The protocol, of protocol:interface, to remove\r
+ @param Interface The interface, of protocol:interface, to remove\r
\r
+ @retval EFI_INVALID_PARAMETER Protocol is NULL.\r
+ @retval EFI_SUCCESS Protocol interface successfully uninstalled.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
-CoreHandleProtocol (\r
- IN EFI_HANDLE UserHandle,\r
- IN EFI_GUID *Protocol,\r
- OUT VOID **Interface\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+CoreUninstallProtocolInterface (\r
+ IN EFI_HANDLE UserHandle,\r
+ IN EFI_GUID *Protocol,\r
+ IN VOID *Interface\r
+ );\r
\r
+/**\r
Queries a handle to determine if it supports a specified protocol.\r
\r
-Arguments:\r
-\r
- UserHandle - The handle being queried.\r
-\r
- Protocol - The published unique identifier of the protocol.\r
-\r
- Interface - Supplies the address where a pointer to the corresponding Protocol\r
- Interface is returned.\r
-\r
-Returns:\r
-\r
- The requested protocol interface for the handle\r
- \r
---*/ \r
-;\r
+ @param UserHandle The handle being queried.\r
+ @param Protocol The published unique identifier of the protocol.\r
+ @param Interface Supplies the address where a pointer to the\r
+ corresponding Protocol Interface is returned.\r
\r
+ @return The requested protocol interface for the handle\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
-CoreOpenProtocol (\r
- IN EFI_HANDLE UserHandle,\r
- IN EFI_GUID *Protocol,\r
- OUT VOID **Interface OPTIONAL,\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_HANDLE ControllerHandle,\r
- IN UINT32 Attributes\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+CoreHandleProtocol (\r
+ IN EFI_HANDLE UserHandle,\r
+ IN EFI_GUID *Protocol,\r
+ OUT VOID **Interface\r
+ );\r
\r
+/**\r
Locates the installed protocol handler for the handle, and\r
invokes it to obtain the protocol interface. Usage information\r
is registered in the protocol data base.\r
\r
-Arguments:\r
-\r
- UserHandle - The handle to obtain the protocol interface on\r
-\r
- Protocol - The ID of the protocol \r
-\r
- Interface - The location to return the protocol interface\r
-\r
- ImageHandle - The handle of the Image that is opening the protocol interface\r
- specified by Protocol and Interface.\r
- \r
- ControllerHandle - The controller handle that is requiring this interface.\r
-\r
- Attributes - The open mode of the protocol interface specified by Handle\r
- and Protocol.\r
-\r
-Returns:\r
-\r
- EFI_INVALID_PARAMETER - Protocol is NULL.\r
- \r
- EFI_SUCCESS - Get the protocol interface.\r
- \r
---*/\r
-;\r
+ @param UserHandle The handle to obtain the protocol interface on\r
+ @param Protocol The ID of the protocol\r
+ @param Interface The location to return the protocol interface\r
+ @param ImageHandle The handle of the Image that is opening the\r
+ protocol interface specified by Protocol and\r
+ Interface.\r
+ @param ControllerHandle The controller handle that is requiring this\r
+ interface.\r
+ @param Attributes The open mode of the protocol interface\r
+ specified by Handle and Protocol.\r
\r
+ @retval EFI_INVALID_PARAMETER Protocol is NULL.\r
+ @retval EFI_SUCCESS Get the protocol interface.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
-CoreOpenProtocolInformation (\r
- IN EFI_HANDLE UserHandle,\r
- IN EFI_GUID *Protocol,\r
- OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,\r
- OUT UINTN *EntryCount\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+CoreOpenProtocol (\r
+ IN EFI_HANDLE UserHandle,\r
+ IN EFI_GUID *Protocol,\r
+ OUT VOID **Interface OPTIONAL,\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_HANDLE ControllerHandle,\r
+ IN UINT32 Attributes\r
+ );\r
\r
+/**\r
Return information about Opened protocols in the system\r
\r
-Arguments:\r
-\r
- UserHandle - The handle to close the protocol interface on\r
-\r
- Protocol - The ID of the protocol \r
-\r
- EntryBuffer - A pointer to a buffer of open protocol information in the form of\r
- EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.\r
-\r
- EntryCount - Number of EntryBuffer entries\r
-\r
-Returns:\r
-\r
- \r
---*/\r
-;\r
+ @param UserHandle The handle to close the protocol interface on\r
+ @param Protocol The ID of the protocol\r
+ @param EntryBuffer A pointer to a buffer of open protocol\r
+ information in the form of\r
+ EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.\r
+ @param EntryCount Number of EntryBuffer entries\r
\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CoreOpenProtocolInformation (\r
+ IN EFI_HANDLE UserHandle,\r
+ IN EFI_GUID *Protocol,\r
+ OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,\r
+ OUT UINTN *EntryCount\r
+ );\r
\r
+/**\r
+ Closes a protocol on a handle that was opened using OpenProtocol().\r
+\r
+ @param UserHandle The handle for the protocol interface that was\r
+ previously opened with OpenProtocol(), and is\r
+ now being closed.\r
+ @param Protocol The published unique identifier of the protocol.\r
+ It is the caller's responsibility to pass in a\r
+ valid GUID.\r
+ @param AgentHandle The handle of the agent that is closing the\r
+ protocol interface.\r
+ @param ControllerHandle If the agent that opened a protocol is a driver\r
+ that follows the EFI Driver Model, then this\r
+ parameter is the controller handle that required\r
+ the protocol interface. If the agent does not\r
+ follow the EFI Driver Model, then this parameter\r
+ is optional and may be NULL.\r
+\r
+ @retval EFI_SUCCESS The protocol instance was closed.\r
+ @retval EFI_INVALID_PARAMETER Handle, AgentHandle or ControllerHandle is not a\r
+ valid EFI_HANDLE.\r
+ @retval EFI_NOT_FOUND Can not find the specified protocol or\r
+ AgentHandle.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreCloseProtocol (\r
- IN EFI_HANDLE UserHandle,\r
- IN EFI_GUID *Protocol,\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_HANDLE ControllerHandle\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Close Protocol\r
-\r
-Arguments:\r
-\r
- UserHandle - The handle to close the protocol interface on\r
-\r
- Protocol - The ID of the protocol \r
-\r
- ImageHandle - The user of the protocol to close\r
-\r
- ControllerHandle - The user of the protocol to close\r
-\r
-Returns:\r
-\r
- EFI_INVALID_PARAMETER - Protocol is NULL.\r
- \r
---*/\r
-;\r
-\r
+ IN EFI_HANDLE UserHandle,\r
+ IN EFI_GUID *Protocol,\r
+ IN EFI_HANDLE AgentHandle,\r
+ IN EFI_HANDLE ControllerHandle\r
+ );\r
\r
+/**\r
+ Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated\r
+ from pool.\r
+\r
+ @param UserHandle The handle from which to retrieve the list of\r
+ protocol interface GUIDs.\r
+ @param ProtocolBuffer A pointer to the list of protocol interface GUID\r
+ pointers that are installed on Handle.\r
+ @param ProtocolBufferCount A pointer to the number of GUID pointers present\r
+ in ProtocolBuffer.\r
+\r
+ @retval EFI_SUCCESS The list of protocol interface GUIDs installed\r
+ on Handle was returned in ProtocolBuffer. The\r
+ number of protocol interface GUIDs was returned\r
+ in ProtocolBufferCount.\r
+ @retval EFI_INVALID_PARAMETER Handle is NULL.\r
+ @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.\r
+ @retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL.\r
+ @retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL.\r
+ @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the\r
+ results.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreProtocolsPerHandle (\r
- IN EFI_HANDLE UserHandle,\r
- OUT EFI_GUID ***ProtocolBuffer,\r
- OUT UINTN *ProtocolBufferCount\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated\r
- from pool.\r
-\r
-Arguments:\r
-\r
- UserHandle - The handle from which to retrieve the list of protocol interface\r
- GUIDs.\r
-\r
- ProtocolBuffer - A pointer to the list of protocol interface GUID pointers that are\r
- installed on Handle.\r
+ IN EFI_HANDLE UserHandle,\r
+ OUT EFI_GUID ***ProtocolBuffer,\r
+ OUT UINTN *ProtocolBufferCount\r
+ );\r
\r
- ProtocolBufferCount - A pointer to the number of GUID pointers present in\r
- ProtocolBuffer.\r
+/**\r
+ Add a new protocol notification record for the request protocol.\r
\r
-Returns:\r
- EFI_SUCCESS - The list of protocol interface GUIDs installed on Handle was returned in\r
- ProtocolBuffer. The number of protocol interface GUIDs was\r
- returned in ProtocolBufferCount.\r
- EFI_INVALID_PARAMETER - Handle is NULL.\r
- EFI_INVALID_PARAMETER - Handle is not a valid EFI_HANDLE.\r
- EFI_INVALID_PARAMETER - ProtocolBuffer is NULL.\r
- EFI_INVALID_PARAMETER - ProtocolBufferCount is NULL.\r
- EFI_OUT_OF_RESOURCES - There is not enough pool memory to store the results.\r
- \r
---*/\r
-;\r
+ @param Protocol The requested protocol to add the notify\r
+ registration\r
+ @param Event The event to signal\r
+ @param Registration Returns the registration record\r
\r
+ @retval EFI_INVALID_PARAMETER Invalid parameter\r
+ @retval EFI_SUCCESS Successfully returned the registration record\r
+ that has been added\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreRegisterProtocolNotify (\r
- IN EFI_GUID *Protocol,\r
- IN EFI_EVENT Event,\r
- OUT VOID **Registration\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Add a new protocol notification record for the request protocol.\r
-\r
-Arguments:\r
-\r
- Protocol - The requested protocol to add the notify registration\r
-\r
- Event - The event to signal \r
-\r
- Registration - Returns the registration record\r
-\r
+ IN EFI_GUID *Protocol,\r
+ IN EFI_EVENT Event,\r
+ OUT VOID **Registration\r
+ );\r
\r
-Returns:\r
+/**\r
+ Removes all the events in the protocol database that match Event.\r
\r
- EFI_INVALID_PARAMETER - Invalid parameter\r
+ @param Event The event to search for in the protocol\r
+ database.\r
\r
- EFI_SUCCESS - Successfully returned the registration record that has been added\r
- \r
---*/\r
-;\r
- \r
+ @return EFI_SUCCESS when done searching the entire database.\r
\r
+**/\r
EFI_STATUS\r
-EFIAPI\r
-CoreLocateHandle (\r
- IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
- IN EFI_GUID *Protocol OPTIONAL,\r
- IN VOID *SearchKey OPTIONAL,\r
- IN OUT UINTN *BufferSize,\r
- OUT EFI_HANDLE *Buffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+CoreUnregisterProtocolNotify (\r
+ IN EFI_EVENT Event\r
+ );\r
\r
+/**\r
Locates the requested handle(s) and returns them in Buffer.\r
\r
-Arguments:\r
-\r
- SearchType - The type of search to perform to locate the handles\r
-\r
- Protocol - The protocol to search for\r
- \r
- SearchKey - Dependant on SearchType\r
-\r
- BufferSize - On input the size of Buffer. On output the \r
- size of data returned. \r
-\r
- Buffer - The buffer to return the results in\r
-\r
+ @param SearchType The type of search to perform to locate the\r
+ handles\r
+ @param Protocol The protocol to search for\r
+ @param SearchKey Dependant on SearchType\r
+ @param BufferSize On input the size of Buffer. On output the\r
+ size of data returned.\r
+ @param Buffer The buffer to return the results in\r
\r
-Returns:\r
-\r
- EFI_BUFFER_TOO_SMALL - Buffer too small, required buffer size is returned in BufferSize.\r
-\r
- EFI_INVALID_PARAMETER - Invalid parameter\r
- \r
- EFI_SUCCESS - Successfully found the requested handle(s) and returns them in Buffer.\r
- \r
---*/\r
-;\r
- \r
+ @retval EFI_BUFFER_TOO_SMALL Buffer too small, required buffer size is\r
+ returned in BufferSize.\r
+ @retval EFI_INVALID_PARAMETER Invalid parameter\r
+ @retval EFI_SUCCESS Successfully found the requested handle(s) and\r
+ returns them in Buffer.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
-CoreLocateDevicePath (\r
- IN EFI_GUID *Protocol,\r
- IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,\r
- OUT EFI_HANDLE *Device\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Locates the handle to a device on the device path that supports the specified protocol.\r
-\r
-Arguments:\r
-\r
- Protocol - The protocol to search for.\r
- FilePath - On input, a pointer to a pointer to the device path. On output, the device\r
- path pointer is modified to point to the remaining part of the devicepath.\r
- Device - A pointer to the returned device handle. \r
+CoreLocateHandle (\r
+ IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
+ IN EFI_GUID *Protocol OPTIONAL,\r
+ IN VOID *SearchKey OPTIONAL,\r
+ IN OUT UINTN *BufferSize,\r
+ OUT EFI_HANDLE *Buffer\r
+ );\r
\r
-Returns:\r
+/**\r
+ Locates the handle to a device on the device path that best matches the specified protocol.\r
\r
- EFI_SUCCESS - The resulting handle was returned.\r
- EFI_NOT_FOUND - No handles matched the search.\r
- EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r
+ @param Protocol The protocol to search for.\r
+ @param DevicePath On input, a pointer to a pointer to the device\r
+ path. On output, the device path pointer is\r
+ modified to point to the remaining part of the\r
+ devicepath.\r
+ @param Device A pointer to the returned device handle.\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS The resulting handle was returned.\r
+ @retval EFI_NOT_FOUND No handles matched the search.\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
\r
- \r
+**/\r
EFI_STATUS\r
EFIAPI\r
-CoreLocateHandleBuffer (\r
- IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
- IN EFI_GUID *Protocol OPTIONAL,\r
- IN VOID *SearchKey OPTIONAL,\r
- IN OUT UINTN *NumberHandles,\r
- OUT EFI_HANDLE **Buffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+CoreLocateDevicePath (\r
+ IN EFI_GUID *Protocol,\r
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,\r
+ OUT EFI_HANDLE *Device\r
+ );\r
\r
- Function returns an array of handles that support the requested protocol \r
+/**\r
+ Function returns an array of handles that support the requested protocol\r
in a buffer allocated from pool. This is a version of CoreLocateHandle()\r
that allocates a buffer for the caller.\r
\r
-Arguments:\r
-\r
- SearchType - Specifies which handle(s) are to be returned.\r
- Protocol - Provides the protocol to search by. \r
- This parameter is only valid for SearchType ByProtocol.\r
- SearchKey - Supplies the search key depending on the SearchType.\r
- NumberHandles - The number of handles returned in Buffer.\r
- Buffer - A pointer to the buffer to return the requested array of \r
- handles that support Protocol.\r
+ @param SearchType Specifies which handle(s) are to be returned.\r
+ @param Protocol Provides the protocol to search by. This\r
+ parameter is only valid for SearchType\r
+ ByProtocol.\r
+ @param SearchKey Supplies the search key depending on the\r
+ SearchType.\r
+ @param NumberHandles The number of handles returned in Buffer.\r
+ @param Buffer A pointer to the buffer to return the requested\r
+ array of handles that support Protocol.\r
\r
-Returns:\r
- \r
- EFI_SUCCESS - The result array of handles was returned.\r
- EFI_NOT_FOUND - No handles match the search. \r
- EFI_OUT_OF_RESOURCES - There is not enough pool memory to store the matching results.\r
- EFI_INVALID_PARAMETER - Invalid parameter\r
+ @retval EFI_SUCCESS The result array of handles was returned.\r
+ @retval EFI_NOT_FOUND No handles match the search.\r
+ @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the\r
+ matching results.\r
+ @retval EFI_INVALID_PARAMETER One or more parameters are not valid.\r
\r
---*/\r
-;\r
-\r
- \r
+**/\r
EFI_STATUS\r
EFIAPI\r
-CoreLocateProtocol (\r
- IN EFI_GUID *Protocol,\r
- IN VOID *Registration OPTIONAL,\r
- OUT VOID **Interface\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+CoreLocateHandleBuffer (\r
+ IN EFI_LOCATE_SEARCH_TYPE SearchType,\r
+ IN EFI_GUID *Protocol OPTIONAL,\r
+ IN VOID *SearchKey OPTIONAL,\r
+ IN OUT UINTN *NumberHandles,\r
+ OUT EFI_HANDLE **Buffer\r
+ );\r
\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
-Arguments:\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
- Protocol - The protocol to search for\r
- \r
- Registration - Optional Registration Key returned from RegisterProtocolNotify() \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
- Interface - Return the Protocol interface (instance).\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CoreLocateProtocol (\r
+ IN EFI_GUID *Protocol,\r
+ IN VOID *Registration OPTIONAL,\r
+ OUT VOID **Interface\r
+ );\r
\r
-Returns:\r
+/**\r
+ return handle database key.\r
\r
- EFI_SUCCESS - If a valid Interface is returned\r
- \r
- EFI_INVALID_PARAMETER - Invalid parameter\r
- \r
- EFI_NOT_FOUND - Protocol interface not found\r
\r
---*/\r
-;\r
+ @return Handle database key.\r
\r
+**/\r
UINT64\r
CoreGetHandleDatabaseKey (\r
VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- return handle database key.\r
+ );\r
\r
-Arguments:\r
+/**\r
+ Go connect any handles that were created or modified while a image executed.\r
\r
- None\r
- \r
-Returns:\r
- \r
- Handle database key.\r
- \r
---*/\r
-;\r
+ @param Key The Key to show that the handle has been\r
+ created/modified\r
\r
+**/\r
VOID\r
CoreConnectHandlesByKey (\r
UINT64 Key\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Go connect any handles that were created or modified while a image executed.\r
-\r
-Arguments:\r
-\r
- Key - The Key to show that the handle has been created/modified\r
-\r
-Returns:\r
- \r
- None\r
---*/\r
-;\r
+ );\r
\r
+/**\r
+ Connects one or more drivers to a controller.\r
\r
-EFI_STATUS \r
+ @param ControllerHandle The handle of the controller to which driver(s) are to be connected.\r
+ @param DriverImageHandle A pointer to an ordered list handles that support the\r
+ EFI_DRIVER_BINDING_PROTOCOL.\r
+ @param RemainingDevicePath A pointer to the device path that specifies a child of the\r
+ controller specified by ControllerHandle.\r
+ @param Recursive If TRUE, then ConnectController() is called recursively\r
+ until the entire tree of controllers below the controller specified\r
+ by ControllerHandle have been created. If FALSE, then\r
+ the tree of controllers is only expanded one level.\r
+\r
+ @retval EFI_SUCCESS 1) One or more drivers were connected to ControllerHandle.\r
+ 2) No drivers were connected to ControllerHandle, but\r
+ RemainingDevicePath is not NULL, and it is an End Device\r
+ Path Node.\r
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
+ @retval EFI_NOT_FOUND 1) There are no EFI_DRIVER_BINDING_PROTOCOL instances\r
+ present in the system.\r
+ 2) No drivers were connected to ControllerHandle.\r
+ @retval EFI_SECURITY_VIOLATION\r
+ The user has no permission to start UEFI device drivers on the device path\r
+ associated with the ControllerHandle or specified by the RemainingDevicePath.\r
+\r
+**/\r
+EFI_STATUS\r
EFIAPI\r
CoreConnectController (\r
IN EFI_HANDLE ControllerHandle,\r
IN EFI_HANDLE *DriverImageHandle OPTIONAL,\r
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,\r
IN BOOLEAN Recursive\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Connects one or more drivers to a controller.\r
-\r
-Arguments:\r
-\r
- ControllerHandle - Handle of the controller to be connected.\r
-\r
- DriverImageHandle - DriverImageHandle A pointer to an ordered list of driver image handles.\r
-\r
- RemainingDevicePath - RemainingDevicePath A pointer to the device path that specifies a child of the\r
- controller specified by ControllerHandle.\r
- \r
- Recursive - - Whether the function would be called recursively or not.\r
-\r
-Returns:\r
-\r
- Status code.\r
-\r
---*/\r
-;\r
+ );\r
\r
+/**\r
+ Disonnects a controller from a driver\r
\r
-EFI_STATUS \r
+ @param ControllerHandle ControllerHandle The handle of\r
+ the controller from which\r
+ driver(s) are to be\r
+ disconnected.\r
+ @param DriverImageHandle DriverImageHandle The driver to\r
+ disconnect from ControllerHandle.\r
+ @param ChildHandle ChildHandle The handle of the\r
+ child to destroy.\r
+\r
+ @retval EFI_SUCCESS One or more drivers were\r
+ disconnected from the controller.\r
+ @retval EFI_SUCCESS On entry, no drivers are managing\r
+ ControllerHandle.\r
+ @retval EFI_SUCCESS DriverImageHandle is not NULL,\r
+ and on entry DriverImageHandle is\r
+ not managing ControllerHandle.\r
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
+ @retval EFI_INVALID_PARAMETER DriverImageHandle is not NULL,\r
+ and it is not a valid EFI_HANDLE.\r
+ @retval EFI_INVALID_PARAMETER ChildHandle is not NULL, and it\r
+ is not a valid EFI_HANDLE.\r
+ @retval EFI_OUT_OF_RESOURCES There are not enough resources\r
+ available to disconnect any\r
+ drivers from ControllerHandle.\r
+ @retval EFI_DEVICE_ERROR The controller could not be\r
+ disconnected because of a device\r
+ error.\r
+\r
+**/\r
+EFI_STATUS\r
EFIAPI\r
CoreDisconnectController (\r
- IN EFI_HANDLE ControllerHandle,\r
- IN EFI_HANDLE DriverImageHandle OPTIONAL,\r
- IN EFI_HANDLE ChildHandle OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Disonnects a controller from a driver\r
-\r
-Arguments:\r
-\r
- ControllerHandle - ControllerHandle The handle of the controller from which driver(s) \r
- are to be disconnected.\r
- DriverImageHandle - DriverImageHandle The driver to disconnect from ControllerHandle.\r
- ChildHandle - ChildHandle The handle of the child to destroy.\r
-\r
-Returns:\r
+ IN EFI_HANDLE ControllerHandle,\r
+ IN EFI_HANDLE DriverImageHandle OPTIONAL,\r
+ IN EFI_HANDLE ChildHandle OPTIONAL\r
+ );\r
\r
- EFI_SUCCESS - One or more drivers were disconnected from the controller.\r
- EFI_SUCCESS - On entry, no drivers are managing ControllerHandle.\r
- EFI_SUCCESS - DriverImageHandle is not NULL, and on entry DriverImageHandle is not managing ControllerHandle.\r
- EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
- EFI_INVALID_PARAMETER - DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.\r
- EFI_INVALID_PARAMETER - ChildHandle is not NULL, and it is not a valid EFI_HANDLE.\r
- EFI_OUT_OF_RESOURCES - There are not enough resources available to disconnect any drivers from ControllerHandle.\r
- EFI_DEVICE_ERROR - The controller could not be disconnected because of a device error.\r
+/**\r
+ Allocates pages from the memory map.\r
\r
---*/\r
-;\r
+ @param Type The type of allocation to perform\r
+ @param MemoryType The type of memory to turn the allocated pages\r
+ into\r
+ @param NumberOfPages The number of pages to allocate\r
+ @param Memory A pointer to receive the base allocated memory\r
+ address\r
\r
+ @return Status. On success, Memory is filled in with the base address allocated\r
+ @retval EFI_INVALID_PARAMETER Parameters violate checking rules defined in\r
+ spec.\r
+ @retval EFI_NOT_FOUND Could not allocate pages match the requirement.\r
+ @retval EFI_OUT_OF_RESOURCES No enough pages to allocate.\r
+ @retval EFI_SUCCESS Pages successfully allocated.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreAllocatePages (\r
- IN EFI_ALLOCATE_TYPE Type,\r
- IN EFI_MEMORY_TYPE MemoryType,\r
- IN UINTN NumberOfPages,\r
- IN OUT EFI_PHYSICAL_ADDRESS *Memory\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Allocates pages from the memory map.\r
-\r
-Arguments:\r
-\r
- Type - The type of allocation to perform\r
-\r
- MemoryType - The type of memory to turn the allocated pages into\r
-\r
- NumberOfPages - The number of pages to allocate\r
-\r
- Memory - A pointer to receive the base allocated memory address\r
-\r
-Returns:\r
+ IN EFI_ALLOCATE_TYPE Type,\r
+ IN EFI_MEMORY_TYPE MemoryType,\r
+ IN UINTN NumberOfPages,\r
+ IN OUT EFI_PHYSICAL_ADDRESS *Memory\r
+ );\r
\r
- Status. On success, Memory is filled in with the base address allocated\r
- \r
- EFI_INVALID_PARAMETER - Parameters violate checking rules defined in spec.\r
- \r
- EFI_NOT_FOUND - Could not allocate pages match the requirement.\r
- \r
- EFI_OUT_OF_RESOURCES - No enough pages to allocate.\r
- \r
- EFI_SUCCESS - Pages successfully allocated.\r
+/**\r
+ Frees previous allocated pages.\r
\r
---*/\r
-;\r
+ @param Memory Base address of memory being freed\r
+ @param NumberOfPages The number of pages to free\r
\r
+ @retval EFI_NOT_FOUND Could not find the entry that covers the range\r
+ @retval EFI_INVALID_PARAMETER Address not aligned\r
+ @return EFI_SUCCESS -Pages successfully freed.\r
\r
-EFI_STATUS \r
+**/\r
+EFI_STATUS\r
EFIAPI\r
CoreFreePages (\r
- IN EFI_PHYSICAL_ADDRESS Memory,\r
- IN UINTN NumberOfPages\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Frees previous allocated pages.\r
-\r
-Arguments:\r
-\r
- Memory - Base address of memory being freed\r
-\r
- NumberOfPages - The number of pages to free\r
-\r
-Returns:\r
-\r
- EFI_NOT_FOUND - Could not find the entry that covers the range\r
- \r
- EFI_INVALID_PARAMETER - Address not aligned\r
- \r
- EFI_SUCCESS -Pages successfully freed.\r
-\r
---*/\r
-;\r
-\r
+ IN EFI_PHYSICAL_ADDRESS Memory,\r
+ IN UINTN NumberOfPages\r
+ );\r
\r
+/**\r
+ This function returns a copy of the current memory map. The map is an array of\r
+ memory descriptors, each of which describes a contiguous block of memory.\r
+\r
+ @param MemoryMapSize A pointer to the size, in bytes, of the\r
+ MemoryMap buffer. On input, this is the size of\r
+ the buffer allocated by the caller. On output,\r
+ it is the size of the buffer returned by the\r
+ firmware if the buffer was large enough, or the\r
+ size of the buffer needed to contain the map if\r
+ the buffer was too small.\r
+ @param MemoryMap A pointer to the buffer in which firmware places\r
+ the current memory map.\r
+ @param MapKey A pointer to the location in which firmware\r
+ returns the key for the current memory map.\r
+ @param DescriptorSize A pointer to the location in which firmware\r
+ returns the size, in bytes, of an individual\r
+ EFI_MEMORY_DESCRIPTOR.\r
+ @param DescriptorVersion A pointer to the location in which firmware\r
+ returns the version number associated with the\r
+ EFI_MEMORY_DESCRIPTOR.\r
+\r
+ @retval EFI_SUCCESS The memory map was returned in the MemoryMap\r
+ buffer.\r
+ @retval EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small. The current\r
+ buffer size needed to hold the memory map is\r
+ returned in MemoryMapSize.\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreGetMemoryMap (\r
- IN OUT UINTN *MemoryMapSize,\r
- IN OUT EFI_MEMORY_DESCRIPTOR *Desc,\r
- OUT UINTN *MapKey,\r
- OUT UINTN *DescriptorSize,\r
- OUT UINT32 *DescriptorVersion\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Returns the current memory map.\r
-\r
-Arguments:\r
-\r
- MemoryMapSize - On input the buffer size of MemoryMap allocated by caller\r
- On output the required buffer size to contain the memory map \r
- \r
- Desc - The buffer to return the current memory map\r
-\r
- MapKey - The address to return the current map key\r
-\r
- DescriptorSize - The size in bytes for an individual EFI_MEMORY_DESCRIPTOR\r
-\r
- DescriptorVersion - The version number associated with the EFI_MEMORY_DESCRIPTOR\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS The current memory map was returned successfully\r
-\r
- EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small\r
+ IN OUT UINTN *MemoryMapSize,\r
+ IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap,\r
+ OUT UINTN *MapKey,\r
+ OUT UINTN *DescriptorSize,\r
+ OUT UINT32 *DescriptorVersion\r
+ );\r
\r
- EFI_INVALID_PARAMETER One of the parameters has an invalid value\r
+/**\r
+ Allocate pool of a particular type.\r
\r
---*/\r
-;\r
+ @param PoolType Type of pool to allocate\r
+ @param Size The amount of pool to allocate\r
+ @param Buffer The address to return a pointer to the allocated\r
+ pool\r
\r
+ @retval EFI_INVALID_PARAMETER PoolType not valid or Buffer is NULL\r
+ @retval EFI_OUT_OF_RESOURCES Size exceeds max pool size or allocation failed.\r
+ @retval EFI_SUCCESS Pool successfully allocated.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreAllocatePool (\r
- IN EFI_MEMORY_TYPE PoolType,\r
- IN UINTN Size,\r
- OUT VOID **Buffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+ IN EFI_MEMORY_TYPE PoolType,\r
+ IN UINTN Size,\r
+ OUT VOID **Buffer\r
+ );\r
\r
+/**\r
Allocate pool of a particular type.\r
\r
-Arguments:\r
+ @param PoolType Type of pool to allocate\r
+ @param Size The amount of pool to allocate\r
+ @param Buffer The address to return a pointer to the allocated\r
+ pool\r
\r
- PoolType - Type of pool to allocate\r
+ @retval EFI_INVALID_PARAMETER PoolType not valid or Buffer is NULL\r
+ @retval EFI_OUT_OF_RESOURCES Size exceeds max pool size or allocation failed.\r
+ @retval EFI_SUCCESS Pool successfully allocated.\r
\r
- Size - The amount of pool to allocate\r
-\r
- Buffer - The address to return a pointer to the allocated pool\r
-\r
-Returns:\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CoreInternalAllocatePool (\r
+ IN EFI_MEMORY_TYPE PoolType,\r
+ IN UINTN Size,\r
+ OUT VOID **Buffer\r
+ );\r
\r
- EFI_INVALID_PARAMETER - PoolType not valid\r
- \r
- EFI_OUT_OF_RESOURCES - Size exceeds max pool size or allocation failed. \r
- \r
- EFI_SUCCESS - Pool successfully allocated.\r
+/**\r
+ Frees pool.\r
\r
---*/\r
-;\r
+ @param Buffer The allocated pool entry to free\r
\r
+ @retval EFI_INVALID_PARAMETER Buffer is not a valid value.\r
+ @retval EFI_SUCCESS Pool successfully freed.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreFreePool (\r
- IN VOID *Buffer\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+ IN VOID *Buffer\r
+ );\r
\r
+/**\r
Frees pool.\r
\r
-Arguments:\r
-\r
- Buffer - The allocated pool entry to free\r
-\r
-Returns:\r
-\r
- EFI_INVALID_PARAMETER - Buffer is not a valid value.\r
- \r
- EFI_SUCCESS - Pool successfully freed.\r
-\r
---*/\r
-;\r
+ @param Buffer The allocated pool entry to free\r
+ @param PoolType Pointer to pool type\r
\r
+ @retval EFI_INVALID_PARAMETER Buffer is not a valid value.\r
+ @retval EFI_SUCCESS Pool successfully freed.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
-CoreLoadImage (\r
- IN BOOLEAN BootPolicy,\r
- IN EFI_HANDLE ParentImageHandle,\r
- IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
- IN VOID *SourceBuffer OPTIONAL,\r
- IN UINTN SourceSize,\r
- OUT EFI_HANDLE *ImageHandle\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+CoreInternalFreePool (\r
+ IN VOID *Buffer,\r
+ OUT EFI_MEMORY_TYPE *PoolType OPTIONAL\r
+ );\r
\r
+/**\r
Loads an EFI image into memory and returns a handle to the image.\r
\r
-Arguments:\r
-\r
- BootPolicy - If TRUE, indicates that the request originates from the boot manager,\r
- and that the boot manager is attempting to load FilePath as a boot selection.\r
- ParentImageHandle - The caller's image handle.\r
- FilePath - The specific file path from which the image is loaded.\r
- SourceBuffer - If not NULL, a pointer to the memory location containing a copy of \r
- the image to be loaded.\r
- SourceSize - The size in bytes of SourceBuffer.\r
- ImageHandle - Pointer to the returned image handle that is created when the image \r
- is successfully loaded.\r
+ @param BootPolicy If TRUE, indicates that the request originates\r
+ from the boot manager, and that the boot\r
+ manager is attempting to load FilePath as a\r
+ boot selection.\r
+ @param ParentImageHandle The caller's image handle.\r
+ @param FilePath The specific file path from which the image is\r
+ loaded.\r
+ @param SourceBuffer If not NULL, a pointer to the memory location\r
+ containing a copy of the image to be loaded.\r
+ @param SourceSize The size in bytes of SourceBuffer.\r
+ @param ImageHandle Pointer to the returned image handle that is\r
+ created when the image is successfully loaded.\r
+\r
+ @retval EFI_SUCCESS The image was loaded into memory.\r
+ @retval EFI_NOT_FOUND The FilePath was not found.\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
+ @retval EFI_UNSUPPORTED The image type is not supported, or the device\r
+ path cannot be parsed to locate the proper\r
+ 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
+EFIAPI\r
+CoreLoadImage (\r
+ IN BOOLEAN BootPolicy,\r
+ IN EFI_HANDLE ParentImageHandle,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
+ IN VOID *SourceBuffer OPTIONAL,\r
+ IN UINTN SourceSize,\r
+ OUT EFI_HANDLE *ImageHandle\r
+ );\r
\r
-Returns:\r
+/**\r
+ Unloads an image.\r
\r
- EFI_SUCCESS - The image was loaded into memory.\r
- EFI_NOT_FOUND - The FilePath was not found.\r
- EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r
- EFI_UNSUPPORTED - The image type is not supported, or the device path cannot be \r
- parsed to locate the proper protocol for loading the file.\r
- EFI_OUT_OF_RESOURCES - Image was not loaded due to insufficient resources.\r
---*/\r
-;\r
+ @param ImageHandle Handle that identifies the image to be\r
+ unloaded.\r
\r
+ @retval EFI_SUCCESS The image has been unloaded.\r
+ @retval EFI_UNSUPPORTED The image has been started, and does not support\r
+ unload.\r
+ @retval EFI_INVALID_PARAMPETER ImageHandle is not a valid image handle.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreUnloadImage (\r
IN EFI_HANDLE ImageHandle\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Unload the specified image.\r
-\r
-Arguments:\r
-\r
- ImageHandle - The specified image handle.\r
-\r
-Returns:\r
+ );\r
\r
- EFI_INVALID_PARAMETER - Image handle is NULL.\r
- \r
- EFI_UNSUPPORTED - Attempt to unload an unsupported image.\r
- \r
- EFI_SUCCESS - Image successfully unloaded.\r
+/**\r
+ Transfer control to a loaded image's entry point.\r
\r
---*/\r
-;\r
+ @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 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
+ image's exit.\r
\r
+ @retval EFI_INVALID_PARAMETER Invalid parameter\r
+ @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
+ @retval EFI_SECURITY_VIOLATION The current platform policy specifies that the image should not be started.\r
+ @retval EFI_SUCCESS Successfully transfer control to the image's\r
+ entry point.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreStartImage (\r
- IN EFI_HANDLE ImageHandle,\r
- OUT UINTN *ExitDataSize,\r
- OUT CHAR16 **ExitData OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Transfer control to a loaded image's entry point.\r
-\r
-Arguments:\r
-\r
- ImageHandle - Handle of image to be started.\r
- \r
- ExitDataSize - Pointer of the size to ExitData\r
- \r
- ExitData - Pointer to a pointer to a data buffer that includes a Null-terminated\r
- Unicode string, optionally followed by additional binary data. The string\r
- is a description that the caller may use to further indicate the reason for\r
- the image's exit.\r
-\r
-Returns:\r
-\r
- EFI_INVALID_PARAMETER - Invalid parameter\r
- \r
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r
- \r
- EFI_SUCCESS - Successfully transfer control to the image's entry point.\r
-\r
---*/\r
-;\r
+ IN EFI_HANDLE ImageHandle,\r
+ OUT UINTN *ExitDataSize,\r
+ OUT CHAR16 **ExitData OPTIONAL\r
+ );\r
\r
+/**\r
+ Terminates the currently loaded EFI image and returns control to boot services.\r
\r
+ @param ImageHandle Handle that identifies the image. This\r
+ parameter is passed to the image on entry.\r
+ @param Status The image's exit code.\r
+ @param ExitDataSize The size, in bytes, of ExitData. Ignored if\r
+ ExitStatus is EFI_SUCCESS.\r
+ @param ExitData Pointer to a data buffer that includes a\r
+ Null-terminated Unicode string, optionally\r
+ followed by additional binary data. The string\r
+ is a description that the caller may use to\r
+ further indicate the reason for the image's\r
+ exit.\r
+\r
+ @retval EFI_INVALID_PARAMETER Image handle is NULL or it is not current\r
+ image.\r
+ @retval EFI_SUCCESS Successfully terminates the currently loaded\r
+ EFI image.\r
+ @retval EFI_ACCESS_DENIED Should never reach there.\r
+ @retval EFI_OUT_OF_RESOURCES Could not allocate pool\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreExit (\r
IN EFI_STATUS Status,\r
IN UINTN ExitDataSize,\r
IN CHAR16 *ExitData OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Terminates the currently loaded EFI image and returns control to boot services.\r
-\r
-Arguments:\r
-\r
- ImageHandle - Handle that identifies the image. This parameter is passed to the image \r
- on entry.\r
- Status - The image's exit code.\r
- ExitDataSize - The size, in bytes, of ExitData. Ignored if ExitStatus is\r
- EFI_SUCCESS.\r
- ExitData - Pointer to a data buffer that includes a Null-terminated Unicode string,\r
- optionally followed by additional binary data. The string is a \r
- description that the caller may use to further indicate the reason for\r
- the image's exit.\r
-\r
-Returns:\r
+ );\r
\r
- EFI_INVALID_PARAMETER - Image handle is NULL or it is not current image.\r
- \r
- EFI_SUCCESS - Successfully terminates the currently loaded EFI image.\r
- \r
- EFI_ACCESS_DENIED - Should never reach there.\r
+/**\r
+ Creates an event.\r
\r
---*/\r
-;\r
+ @param Type The type of event to create and its mode and\r
+ attributes\r
+ @param NotifyTpl The task priority level of event notifications\r
+ @param NotifyFunction Pointer to the events notification function\r
+ @param NotifyContext Pointer to the notification functions context;\r
+ corresponds to parameter "Context" in the\r
+ notification function\r
+ @param Event Pointer to the newly created event if the call\r
+ succeeds; undefined otherwise\r
\r
+ @retval EFI_SUCCESS The event structure was created\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value\r
+ @retval EFI_OUT_OF_RESOURCES The event could not be allocated\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreCreateEvent (\r
- IN UINT32 Type,\r
- IN EFI_TPL NotifyTpl,\r
- IN EFI_EVENT_NOTIFY NotifyFunction,\r
- IN VOID *NotifyContext,\r
- OUT EFI_EVENT *pEvent\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Creates a general-purpose event structure\r
-\r
-Arguments:\r
-\r
- Type - The type of event to create and its mode and attributes\r
- NotifyTpl - The task priority level of event notifications\r
- NotifyFunction - Pointer to the event's notification function\r
- NotifyContext - Pointer to the notification function's context; corresponds to\r
- parameter "Context" in the notification function\r
- pEvent - Pointer to the newly created event if the call succeeds; undefined otherwise\r
-\r
-Returns:\r
+ IN UINT32 Type,\r
+ IN EFI_TPL NotifyTpl,\r
+ IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL,\r
+ IN VOID *NotifyContext OPTIONAL,\r
+ OUT EFI_EVENT *Event\r
+ );\r
\r
- EFI_SUCCESS - The event structure was created\r
- EFI_INVALID_PARAMETER - One of the parameters has an invalid value\r
- EFI_OUT_OF_RESOURCES - The event could not be allocated\r
+/**\r
+ Creates an event in a group.\r
\r
---*/\r
-;\r
+ @param Type The type of event to create and its mode and\r
+ attributes\r
+ @param NotifyTpl The task priority level of event notifications\r
+ @param NotifyFunction Pointer to the events notification function\r
+ @param NotifyContext Pointer to the notification functions context;\r
+ corresponds to parameter "Context" in the\r
+ notification function\r
+ @param EventGroup GUID for EventGroup if NULL act the same as\r
+ gBS->CreateEvent().\r
+ @param Event Pointer to the newly created event if the call\r
+ succeeds; undefined otherwise\r
\r
+ @retval EFI_SUCCESS The event structure was created\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value\r
+ @retval EFI_OUT_OF_RESOURCES The event could not be allocated\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreCreateEventEx (\r
- IN UINT32 Type,\r
- IN EFI_TPL NotifyTpl,\r
- IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL\r
- IN CONST VOID *NotifyContext, OPTIONAL\r
- IN CONST EFI_GUID *EventGroup, OPTIONAL\r
- OUT EFI_EVENT *Event\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- Creates a general-purpose event structure\r
-\r
-Arguments:\r
- Type - The type of event to create and its mode and attributes\r
- NotifyTpl - The task priority level of event notifications\r
- NotifyFunction - Pointer to the events notification function\r
- NotifyContext - Pointer to the notification functions context; corresponds to\r
- parameter "Context" in the notification function\r
- EventGrout - GUID for EventGroup if NULL act the same as gBS->CreateEvent().\r
- Event - Pointer to the newly created event if the call succeeds; undefined otherwise\r
+ IN UINT32 Type,\r
+ IN EFI_TPL NotifyTpl,\r
+ IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL,\r
+ IN CONST VOID *NotifyContext OPTIONAL,\r
+ IN CONST EFI_GUID *EventGroup OPTIONAL,\r
+ OUT EFI_EVENT *Event\r
+ );\r
\r
-Returns:\r
- EFI_SUCCESS - The event structure was created\r
- EFI_INVALID_PARAMETER - One of the parameters has an invalid value\r
- EFI_OUT_OF_RESOURCES - The event could not be allocated\r
+/**\r
+ Creates a general-purpose event structure\r
\r
---*/\r
-;\r
+ @param Type The type of event to create and its mode and\r
+ attributes\r
+ @param NotifyTpl The task priority level of event notifications\r
+ @param NotifyFunction Pointer to the events notification function\r
+ @param NotifyContext Pointer to the notification functions context;\r
+ corresponds to parameter "Context" in the\r
+ notification function\r
+ @param EventGroup GUID for EventGroup if NULL act the same as\r
+ gBS->CreateEvent().\r
+ @param Event Pointer to the newly created event if the call\r
+ succeeds; undefined otherwise\r
\r
+ @retval EFI_SUCCESS The event structure was created\r
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value\r
+ @retval EFI_OUT_OF_RESOURCES The event could not be allocated\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
-CoreSetTimer (\r
- IN EFI_EVENT Event,\r
- IN EFI_TIMER_DELAY Type,\r
- IN UINT64 TriggerTime\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+CoreCreateEventInternal (\r
+ IN UINT32 Type,\r
+ IN EFI_TPL NotifyTpl,\r
+ IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL,\r
+ IN CONST VOID *NotifyContext OPTIONAL,\r
+ IN CONST EFI_GUID *EventGroup OPTIONAL,\r
+ OUT EFI_EVENT *Event\r
+ );\r
\r
+/**\r
Sets the type of timer and the trigger time for a timer event.\r
\r
-Arguments:\r
+ @param UserEvent The timer event that is to be signaled at the\r
+ specified time\r
+ @param Type The type of time that is specified in\r
+ TriggerTime\r
+ @param TriggerTime The number of 100ns units until the timer\r
+ expires\r
\r
- UserEvent - The timer event that is to be signaled at the specified time\r
- Type - The type of time that is specified in TriggerTime\r
- TriggerTime - The number of 100ns units until the timer expires\r
- \r
-Returns:\r
+ @retval EFI_SUCCESS The event has been set to be signaled at the\r
+ requested time\r
+ @retval EFI_INVALID_PARAMETER Event or Type is not valid\r
\r
- EFI_SUCCESS - The event has been set to be signaled at the requested time\r
- EFI_INVALID_PARAMETER - Event or Type is not valid\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CoreSetTimer (\r
+ IN EFI_EVENT UserEvent,\r
+ IN EFI_TIMER_DELAY Type,\r
+ IN UINT64 TriggerTime\r
+ );\r
\r
---*/\r
-;\r
+/**\r
+ Signals the event. Queues the event to be notified if needed.\r
\r
+ @param UserEvent The event to signal .\r
\r
+ @retval EFI_INVALID_PARAMETER Parameters are not valid.\r
+ @retval EFI_SUCCESS The event was signaled.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreSignalEvent (\r
- IN EFI_EVENT Event\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Signals the event. Queues the event to be notified if needed\r
- \r
-Arguments:\r
-\r
- Event - The event to signal\r
- \r
-Returns:\r
+ IN EFI_EVENT UserEvent\r
+ );\r
\r
- EFI_INVALID_PARAMETER - Parameters are not valid.\r
- \r
- EFI_SUCCESS - The event was signaled.\r
+/**\r
+ Stops execution until an event is signaled.\r
\r
---*/\r
-;\r
+ @param NumberOfEvents The number of events in the UserEvents array\r
+ @param UserEvents An array of EFI_EVENT\r
+ @param UserIndex Pointer to the index of the event which\r
+ satisfied the wait condition\r
\r
+ @retval EFI_SUCCESS The event indicated by Index was signaled.\r
+ @retval EFI_INVALID_PARAMETER The event indicated by Index has a notification\r
+ function or Event was not a valid type\r
+ @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreWaitForEvent (\r
- IN UINTN NumberOfEvents,\r
- IN EFI_EVENT *UserEvents,\r
- OUT UINTN *UserIndex\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Stops execution until an event is signaled.\r
- \r
-Arguments:\r
-\r
- NumberOfEvents - The number of events in the UserEvents array\r
- UserEvents - An array of EFI_EVENT\r
- UserIndex - Pointer to the index of the event which satisfied the wait condition\r
- \r
-Returns:\r
+ IN UINTN NumberOfEvents,\r
+ IN EFI_EVENT *UserEvents,\r
+ OUT UINTN *UserIndex\r
+ );\r
\r
- EFI_SUCCESS - The event indicated by Index was signaled.\r
- EFI_INVALID_PARAMETER - The event indicated by Index has a notification function or \r
- Event was not a valid type\r
- EFI_UNSUPPORTED - The current TPL is not TPL_APPLICATION\r
+/**\r
+ Closes an event and frees the event structure.\r
\r
---*/\r
-;\r
+ @param UserEvent Event to close\r
\r
+ @retval EFI_INVALID_PARAMETER Parameters are not valid.\r
+ @retval EFI_SUCCESS The event has been closed\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreCloseEvent (\r
- IN EFI_EVENT Event\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Closes an event and frees the event structure.\r
- \r
-Arguments:\r
-\r
- UserEvent - Event to close\r
- \r
-Returns:\r
+ IN EFI_EVENT UserEvent\r
+ );\r
\r
- EFI_INVALID_PARAMETER - Parameters are not valid.\r
- \r
- EFI_SUCCESS - The event has been closed\r
+/**\r
+ Check the status of an event.\r
\r
---*/\r
-;\r
+ @param UserEvent The event to check\r
\r
+ @retval EFI_SUCCESS The event is in the signaled state\r
+ @retval EFI_NOT_READY The event is not in the signaled state\r
+ @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreCheckEvent (\r
- IN EFI_EVENT Event\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Check the status of an event\r
- \r
-Arguments:\r
+ IN EFI_EVENT UserEvent\r
+ );\r
\r
- UserEvent - The event to check\r
- \r
-Returns:\r
+/**\r
+ Adds reserved memory, system memory, or memory-mapped I/O resources to the\r
+ global coherency domain of the processor.\r
\r
- EFI_SUCCESS - The event is in the signaled state\r
- EFI_NOT_READY - The event is not in the signaled state\r
- EFI_INVALID_PARAMETER - Event is of type EVT_NOTIFY_SIGNAL\r
+ @param GcdMemoryType Memory type of the memory space.\r
+ @param BaseAddress Base address of the memory space.\r
+ @param Length Length of the memory space.\r
+ @param Capabilities alterable attributes of the memory space.\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS Merged this memory space into GCD map.\r
\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
CoreAddMemorySpace (\r
IN EFI_GCD_MEMORY_TYPE GcdMemoryType,\r
IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
IN UINT64 Length,\r
IN UINT64 Capabilities\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Add a segment of memory space to GCD map and add all available pages in this segment \r
- as memory descriptors.\r
-\r
-Arguments:\r
- \r
- GcdMemoryType - Memory type of the segment.\r
- \r
- BaseAddress - Base address of the segment.\r
- \r
- Length - Length of the segment.\r
- \r
- Capabilities - alterable attributes of the segment.\r
+ );\r
\r
-Returns:\r
+/**\r
+ Allocates nonexistent memory, reserved memory, system memory, or memorymapped\r
+ I/O resources from the global coherency domain of the processor.\r
\r
- EFI_SUCCESS - Merged this segment into GCD map.\r
+ @param GcdAllocateType The type of allocate operation\r
+ @param GcdMemoryType The desired memory type\r
+ @param Alignment Align with 2^Alignment\r
+ @param Length Length to allocate\r
+ @param BaseAddress Base address to allocate\r
+ @param ImageHandle The image handle consume the allocated space.\r
+ @param DeviceHandle The device handle consume the allocated space.\r
\r
---*/\r
-;\r
+ @retval EFI_INVALID_PARAMETER Invalid parameter.\r
+ @retval EFI_NOT_FOUND No descriptor contains the desired space.\r
+ @retval EFI_SUCCESS Memory space successfully allocated.\r
\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
CoreAllocateMemorySpace (\r
IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,\r
IN EFI_GCD_MEMORY_TYPE GcdMemoryType,\r
IN UINTN Alignment,\r
IN UINT64 Length,\r
IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_HANDLE DeviceHandle OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Allocate memory space on GCD map.\r
-\r
-Arguments:\r
- \r
- GcdAllocateType - The type of allocate operation\r
- \r
- GcdMemoryType - The desired memory type\r
- \r
- Alignment - Align with 2^Alignment\r
- \r
- Length - Length to allocate\r
- \r
- BaseAddress - Base address to allocate\r
- \r
- ImageHandle - The image handle consume the allocated space.\r
- \r
- DeviceHandle - The device handle consume the allocated space.\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_HANDLE DeviceHandle OPTIONAL\r
+ );\r
\r
-Returns:\r
+/**\r
+ Frees nonexistent memory, reserved memory, system memory, or memory-mapped\r
+ I/O resources from the global coherency domain of the processor.\r
\r
- EFI_INVALID_PARAMETER - Invalid parameter.\r
- \r
- EFI_NOT_FOUND - No descriptor contains the desired space.\r
- \r
- EFI_SUCCESS - Memory space successfully allocated.\r
+ @param BaseAddress Base address of the memory space.\r
+ @param Length Length of the memory space.\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS Space successfully freed.\r
\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
CoreFreeMemorySpace (\r
IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
IN UINT64 Length\r
- )\r
-/*++\r
-\r
-Routine Description:Routine Description:\r
-\r
- Free a segment of memory space in GCD map.\r
+ );\r
\r
-Arguments:\r
- \r
- BaseAddress - Base address of the segment.\r
- \r
- Length - Length of the segment.\r
- \r
-Returns:\r
+/**\r
+ Removes reserved memory, system memory, or memory-mapped I/O resources from\r
+ the global coherency domain of the processor.\r
\r
- EFI_SUCCESS - Space successfully freed.\r
+ @param BaseAddress Base address of the memory space.\r
+ @param Length Length of the memory space.\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS Successfully remove a segment of memory space.\r
\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
CoreRemoveMemorySpace (\r
IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
IN UINT64 Length\r
- )\r
-/*++\r
-\r
-Routine Description:Routine Description:\r
-\r
- Remove a segment of memory space in GCD map.\r
+ );\r
\r
-Arguments:\r
- \r
- BaseAddress - Base address of the segment.\r
- \r
- Length - Length of the segment.\r
- \r
-Returns:\r
+/**\r
+ Retrieves the descriptor for a memory region containing a specified address.\r
\r
- EFI_SUCCESS - Successfully a segment of memory space.\r
+ @param BaseAddress Specified start address\r
+ @param Descriptor Specified length\r
\r
---*/\r
-;\r
+ @retval EFI_INVALID_PARAMETER Invalid parameter\r
+ @retval EFI_SUCCESS Successfully get memory space descriptor.\r
\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
CoreGetMemorySpaceDescriptor (\r
IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Search all entries in GCD map which contains specified segment and build it to a descriptor.\r
-\r
-Arguments:\r
-\r
- BaseAddress - Specified start address\r
- \r
- Descriptor - Specified length\r
-\r
-Returns:\r
-\r
- EFI_INVALID_PARAMETER - Invalid parameter\r
- \r
- EFI_SUCCESS - Successfully get memory space descriptor.\r
-\r
---*/\r
-;\r
+ );\r
\r
+/**\r
+ Modifies the attributes for a memory region in the global coherency domain of the\r
+ processor.\r
+\r
+ @param BaseAddress Specified start address\r
+ @param Length Specified length\r
+ @param Attributes Specified attributes\r
+\r
+ @retval EFI_SUCCESS The attributes were set for the memory region.\r
+ @retval EFI_INVALID_PARAMETER Length is zero.\r
+ @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory\r
+ resource range specified by BaseAddress and Length.\r
+ @retval EFI_UNSUPPORTED The bit mask of attributes is not support for the memory resource\r
+ range specified by BaseAddress and Length.\r
+ @retval EFI_ACCESS_DENIED The attributes for the memory resource range specified by\r
+ BaseAddress and Length cannot be modified.\r
+ @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of\r
+ the memory resource range.\r
+ @retval EFI_NOT_AVAILABLE_YET The attributes cannot be set because CPU architectural protocol is\r
+ not available yet.\r
+\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
CoreSetMemorySpaceAttributes (\r
IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
IN UINT64 Length,\r
IN UINT64 Attributes\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+ );\r
\r
- Set memory space with specified attributes.\r
+/**\r
+ Modifies the capabilities for a memory region in the global coherency domain of the\r
+ processor.\r
\r
-Arguments:\r
+ @param BaseAddress The physical address that is the start address of a memory region.\r
+ @param Length The size in bytes of the memory region.\r
+ @param Capabilities The bit mask of capabilities that the memory region supports.\r
\r
- BaseAddress - Specified start address\r
- \r
- Length - Specified length\r
- \r
- Attributes - Specified attributes\r
+ @retval EFI_SUCCESS The capabilities were set for the memory region.\r
+ @retval EFI_INVALID_PARAMETER Length is zero.\r
+ @retval EFI_UNSUPPORTED The capabilities specified by Capabilities do not include the\r
+ memory region attributes currently in use.\r
+ @retval EFI_ACCESS_DENIED The capabilities for the memory resource range specified by\r
+ BaseAddress and Length cannot be modified.\r
+ @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the capabilities\r
+ of the memory resource range.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CoreSetMemorySpaceCapabilities (\r
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
+ IN UINT64 Length,\r
+ IN UINT64 Capabilities\r
+ );\r
\r
-Returns:\r
+/**\r
+ Returns a map of the memory resources in the global coherency domain of the\r
+ processor.\r
\r
- EFI_SUCCESS - Successfully set attribute of a segment of memory space.\r
+ @param NumberOfDescriptors Number of descriptors.\r
+ @param MemorySpaceMap Descriptor array\r
\r
---*/\r
-;\r
+ @retval EFI_INVALID_PARAMETER Invalid parameter\r
+ @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
+ @retval EFI_SUCCESS Successfully get memory space map.\r
\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
CoreGetMemorySpaceMap (\r
OUT UINTN *NumberOfDescriptors,\r
OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Transer all entries of GCD memory map into memory descriptors and pass to caller.\r
-\r
-Arguments:\r
-\r
- NumberOfDescriptors - Number of descriptors.\r
- \r
- MemorySpaceMap - Descriptor array\r
+ );\r
\r
-Returns:\r
+/**\r
+ Adds reserved I/O or I/O resources to the global coherency domain of the processor.\r
\r
- EFI_INVALID_PARAMETER - Invalid parameter\r
- \r
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r
- \r
- EFI_SUCCESS - Successfully get memory space map.\r
+ @param GcdIoType IO type of the segment.\r
+ @param BaseAddress Base address of the segment.\r
+ @param Length Length of the segment.\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS Merged this segment into GCD map.\r
+ @retval EFI_INVALID_PARAMETER Parameter not valid\r
\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
CoreAddIoSpace (\r
IN EFI_GCD_IO_TYPE GcdIoType,\r
IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
IN UINT64 Length\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Add a segment of IO space to GCD map.\r
-\r
-Arguments:\r
- \r
- GcdIoType - IO type of the segment.\r
- \r
- BaseAddress - Base address of the segment.\r
- \r
- Length - Length of the segment.\r
+ );\r
\r
-Returns:\r
+/**\r
+ Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r
+ domain of the processor.\r
\r
- EFI_SUCCESS - Merged this segment into GCD map.\r
+ @param GcdAllocateType The type of allocate operation\r
+ @param GcdIoType The desired IO type\r
+ @param Alignment Align with 2^Alignment\r
+ @param Length Length to allocate\r
+ @param BaseAddress Base address to allocate\r
+ @param ImageHandle The image handle consume the allocated space.\r
+ @param DeviceHandle The device handle consume the allocated space.\r
\r
---*/\r
-;\r
+ @retval EFI_INVALID_PARAMETER Invalid parameter.\r
+ @retval EFI_NOT_FOUND No descriptor contains the desired space.\r
+ @retval EFI_SUCCESS IO space successfully allocated.\r
\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
CoreAllocateIoSpace (\r
IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,\r
IN EFI_GCD_IO_TYPE GcdIoType,\r
IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,\r
IN EFI_HANDLE ImageHandle,\r
IN EFI_HANDLE DeviceHandle OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Allocate IO space on GCD map.\r
-\r
-Arguments:\r
- \r
- GcdAllocateType - The type of allocate operation\r
- \r
- GcdIoType - The desired IO type\r
- \r
- Alignment - Align with 2^Alignment\r
- \r
- Length - Length to allocate\r
- \r
- BaseAddress - Base address to allocate\r
- \r
- ImageHandle - The image handle consume the allocated space.\r
- \r
- DeviceHandle - The device handle consume the allocated space.\r
+ );\r
\r
-Returns:\r
+/**\r
+ Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r
+ domain of the processor.\r
\r
- EFI_INVALID_PARAMETER - Invalid parameter.\r
- \r
- EFI_NOT_FOUND - No descriptor contains the desired space.\r
- \r
- EFI_SUCCESS - IO space successfully allocated.\r
+ @param BaseAddress Base address of the segment.\r
+ @param Length Length of the segment.\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS Space successfully freed.\r
\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
CoreFreeIoSpace (\r
IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
IN UINT64 Length\r
- )\r
-/*++\r
-\r
-Routine Description:Routine Description:\r
-\r
- Free a segment of IO space in GCD map.\r
+ );\r
\r
-Arguments:\r
- \r
- BaseAddress - Base address of the segment.\r
- \r
- Length - Length of the segment.\r
- \r
-Returns:\r
+/**\r
+ Removes reserved I/O or I/O resources from the global coherency domain of the\r
+ processor.\r
\r
- EFI_SUCCESS - Space successfully freed.\r
+ @param BaseAddress Base address of the segment.\r
+ @param Length Length of the segment.\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS Successfully removed a segment of IO space.\r
\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
CoreRemoveIoSpace (\r
IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
IN UINT64 Length\r
- )\r
-/*++\r
-\r
-Routine Description:Routine Description:\r
-\r
- Remove a segment of IO space in GCD map.\r
+ );\r
\r
-Arguments:\r
- \r
- BaseAddress - Base address of the segment.\r
- \r
- Length - Length of the segment.\r
- \r
-Returns:\r
+/**\r
+ Retrieves the descriptor for an I/O region containing a specified address.\r
\r
- EFI_SUCCESS - Successfully removed a segment of IO space.\r
+ @param BaseAddress Specified start address\r
+ @param Descriptor Specified length\r
\r
---*/\r
-;\r
+ @retval EFI_INVALID_PARAMETER Descriptor is NULL.\r
+ @retval EFI_SUCCESS Successfully get the IO space descriptor.\r
\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
CoreGetIoSpaceDescriptor (\r
IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Search all entries in GCD map which contains specified segment and build it to a descriptor.\r
-\r
-Arguments:\r
-\r
- BaseAddress - Specified start address\r
- \r
- Descriptor - Specified length\r
+ );\r
\r
-Returns:\r
+/**\r
+ Returns a map of the I/O resources in the global coherency domain of the processor.\r
\r
- EFI_INVALID_PARAMETER - Descriptor is NULL.\r
- \r
- EFI_SUCCESS - Successfully get the IO space descriptor.\r
+ @param NumberOfDescriptors Number of descriptors.\r
+ @param IoSpaceMap Descriptor array\r
\r
---*/\r
-;\r
+ @retval EFI_INVALID_PARAMETER Invalid parameter\r
+ @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
+ @retval EFI_SUCCESS Successfully get IO space map.\r
\r
+**/\r
EFI_STATUS\r
+EFIAPI\r
CoreGetIoSpaceMap (\r
OUT UINTN *NumberOfDescriptors,\r
OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Transer all entries of GCD IO map into IO descriptors and pass to caller.\r
-\r
-Arguments:\r
-\r
- NumberOfDescriptors - Number of descriptors.\r
- \r
- IoSpaceMap - Descriptor array\r
-\r
-Returns:\r
+ );\r
\r
- EFI_INVALID_PARAMETER - Invalid parameter\r
- \r
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate\r
- \r
- EFI_SUCCESS - Successfully get IO space map.\r
+/**\r
+ This is the main Dispatcher for DXE and it exits when there are no more\r
+ drivers to run. Drain the mScheduledQueue and load and start a PE\r
+ image for each driver. Search the mDiscoveredList to see if any driver can\r
+ be placed on the mScheduledQueue. If no drivers are placed on the\r
+ mScheduledQueue exit the function. On exit it is assumed the Bds()\r
+ will be called, and when the Bds() exits the Dispatcher will be called\r
+ again.\r
\r
---*/\r
-;\r
+ @retval EFI_ALREADY_STARTED The DXE Dispatcher is already running\r
+ @retval EFI_NOT_FOUND No DXE Drivers were dispatched\r
+ @retval EFI_SUCCESS One or more DXE Drivers were dispatched\r
\r
-EFI_DXESERVICE\r
+**/\r
EFI_STATUS\r
EFIAPI\r
CoreDispatcher (\r
VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+ );\r
\r
- This is the main Dispatcher for DXE and it exits when there are no more \r
- drivers to run. Drain the mScheduledQueue and load and start a PE\r
- image for each driver. Search the mDiscoveredList to see if any driver can \r
- be placed on the mScheduledQueue. If no drivers are placed on the\r
- mScheduledQueue exit the function. On exit it is assumed the Bds()\r
- will be called, and when the Bds() exits the Dispatcher will be called \r
- again.\r
+/**\r
+ Check every driver and locate a matching one. If the driver is found, the Unrequested\r
+ state flag is cleared.\r
\r
-Arguments:\r
+ @param FirmwareVolumeHandle The handle of the Firmware Volume that contains\r
+ the firmware file specified by DriverName.\r
+ @param DriverName The Driver name to put in the Dependent state.\r
\r
- NONE\r
+ @retval EFI_SUCCESS The DriverName was found and it's SOR bit was\r
+ cleared\r
+ @retval EFI_NOT_FOUND The DriverName does not exist or it's SOR bit was\r
+ not set.\r
\r
-Returns:\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CoreSchedule (\r
+ IN EFI_HANDLE FirmwareVolumeHandle,\r
+ IN EFI_GUID *DriverName\r
+ );\r
\r
- EFI_ALREADY_STARTED - The DXE Dispatcher is already running\r
+/**\r
+ Convert a driver from the Untrused back to the Scheduled state.\r
\r
- EFI_NOT_FOUND - No DXE Drivers were dispatched\r
+ @param FirmwareVolumeHandle The handle of the Firmware Volume that contains\r
+ the firmware file specified by DriverName.\r
+ @param DriverName The Driver name to put in the Scheduled state\r
\r
- EFI_SUCCESS - One or more DXE Drivers were dispatched\r
+ @retval EFI_SUCCESS The file was found in the untrusted state, and it\r
+ was promoted to the trusted state.\r
+ @retval EFI_NOT_FOUND The file was not found in the untrusted state.\r
\r
---*/\r
-;\r
-EFI_DXESERVICE\r
+**/\r
EFI_STATUS\r
EFIAPI\r
-CoreSchedule (\r
+CoreTrust (\r
IN EFI_HANDLE FirmwareVolumeHandle,\r
IN EFI_GUID *DriverName\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Check every driver and locate a matching one. If the driver is found, the Unrequested\r
- state flag is cleared.\r
+ );\r
\r
-Arguments:\r
+/**\r
+ This routine is the driver initialization entry point. It initializes the\r
+ libraries, and registers two notification functions. These notification\r
+ functions are responsible for building the FV stack dynamically.\r
\r
- FirmwareVolumeHandle - The handle of the Firmware Volume that contains the firmware \r
- file specified by DriverName.\r
+ @param ImageHandle The image handle.\r
+ @param SystemTable The system table.\r
\r
- DriverName - The Driver name to put in the Dependent state.\r
+ @retval EFI_SUCCESS Function successfully returned.\r
\r
-Returns:\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+FwVolDriverInit (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ );\r
\r
- EFI_SUCCESS - The DriverName was found and it's SOR bit was cleared\r
+/**\r
+ Entry point of the section extraction code. Initializes an instance of the\r
+ section extraction interface and installs it on a new handle.\r
\r
- EFI_NOT_FOUND - The DriverName does not exist or it's SOR bit was not set.\r
+ @param ImageHandle A handle for the image that is initializing this driver\r
+ @param SystemTable A pointer to the EFI system table\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS Driver initialized successfully\r
+ @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources\r
\r
-EFI_DXESERVICE\r
+**/\r
EFI_STATUS\r
EFIAPI\r
-CoreTrust (\r
- IN EFI_HANDLE FirmwareVolumeHandle,\r
- IN EFI_GUID *DriverName\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Convert a driver from the Untrused back to the Scheduled state\r
+InitializeSectionExtraction (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ );\r
\r
-Arguments:\r
+/**\r
+ This DXE service routine is used to process a firmware volume. In\r
+ particular, it can be called by BDS to process a single firmware\r
+ volume found in a capsule.\r
\r
- FirmwareVolumeHandle - The handle of the Firmware Volume that contains the firmware \r
- file specified by DriverName.\r
+ @param FvHeader pointer to a firmware volume header\r
+ @param Size the size of the buffer pointed to by FvHeader\r
+ @param FVProtocolHandle the handle on which a firmware volume protocol\r
+ was produced for the firmware volume passed in.\r
\r
- DriverName - The Driver name to put in the Scheduled state\r
+ @retval EFI_OUT_OF_RESOURCES if an FVB could not be produced due to lack of\r
+ system resources\r
+ @retval EFI_VOLUME_CORRUPTED if the volume was corrupted\r
+ @retval EFI_SUCCESS a firmware volume protocol was produced for the\r
+ firmware volume\r
\r
-Returns:\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CoreProcessFirmwareVolume (\r
+ IN VOID *FvHeader,\r
+ IN UINTN Size,\r
+ OUT EFI_HANDLE *FVProtocolHandle\r
+ );\r
\r
- EFI_SUCCESS - The file was found in the untrusted state, and it was promoted \r
- to the trusted state.\r
+//\r
+// Functions used during debug buils\r
+//\r
\r
- EFI_NOT_FOUND - The file was not found in the untrusted state.\r
+/**\r
+ Displays Architectural protocols that were not loaded and are required for DXE\r
+ core to function. Only used in Debug Builds.\r
\r
---*/\r
-;\r
+**/\r
+VOID\r
+CoreDisplayMissingArchProtocols (\r
+ VOID\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
+ Traverse the discovered list for any drivers that were discovered but not loaded\r
+ because the dependency experessions evaluated to false.\r
\r
-Routine Description:\r
+**/\r
+VOID\r
+CoreDisplayDiscoveredNotDispatched (\r
+ VOID\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
+ Place holder function until all the Boot Services and Runtime Services are\r
+ available.\r
\r
-Arguments:\r
+ @param Arg1 Undefined\r
\r
- Status - Current status\r
+ @return EFI_NOT_AVAILABLE_YET\r
\r
- Buffer - Current allocated buffer, or NULL\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CoreEfiNotAvailableYetArg1 (\r
+ UINTN Arg1\r
+ );\r
\r
- BufferSize - Current buffer size needed\r
- \r
-Returns:\r
- \r
- TRUE - if the buffer was reallocated and the caller \r
- should try the API again.\r
+/**\r
+ Place holder function until all the Boot Services and Runtime Services are available.\r
\r
- FALSE - buffer could not be allocated and the caller\r
- should not try the API again.\r
+ @param Arg1 Undefined\r
+ @param Arg2 Undefined\r
\r
---*/\r
-;\r
+ @return EFI_NOT_AVAILABLE_YET\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
-FwVolDriverInit (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-/*++\r
+CoreEfiNotAvailableYetArg2 (\r
+ UINTN Arg1,\r
+ UINTN Arg2\r
+ );\r
+\r
+/**\r
+ Place holder function until all the Boot Services and Runtime Services are available.\r
\r
-Routine Description:\r
- This routine is the driver initialization entry point. It initializes the\r
- libraries, and registers two notification functions. These notification\r
- functions are responsible for building the FV stack dynamically.\r
- \r
-Arguments:\r
- ImageHandle - The image handle.\r
- SystemTable - The system table.\r
- \r
-Returns:\r
- EFI_SUCCESS - Function successfully returned.\r
+ @param Arg1 Undefined\r
+ @param Arg2 Undefined\r
+ @param Arg3 Undefined\r
\r
---*/\r
-;\r
+ @return EFI_NOT_AVAILABLE_YET\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
-InitializeSectionExtraction (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-/*++\r
-\r
-Routine Description: \r
- Entry point of the section extraction code. Initializes an instance of the \r
- section extraction interface and installs it on a new handle.\r
+CoreEfiNotAvailableYetArg3 (\r
+ UINTN Arg1,\r
+ UINTN Arg2,\r
+ UINTN Arg3\r
+ );\r
\r
-Arguments: \r
- ImageHandle EFI_HANDLE: A handle for the image that is initializing this driver\r
- SystemTable EFI_SYSTEM_TABLE: A pointer to the EFI system table \r
+/**\r
+ Place holder function until all the Boot Services and Runtime Services are available.\r
\r
-Returns: \r
- EFI_SUCCESS: Driver initialized successfully\r
- EFI_OUT_OF_RESOURCES: Could not allocate needed resources\r
+ @param Arg1 Undefined\r
+ @param Arg2 Undefined\r
+ @param Arg3 Undefined\r
+ @param Arg4 Undefined\r
\r
---*/\r
-;\r
+ @return EFI_NOT_AVAILABLE_YET\r
\r
+**/\r
EFI_STATUS\r
-CoreProcessFirmwareVolume (\r
- IN VOID *FvHeader,\r
- IN UINTN Size, \r
- OUT EFI_HANDLE *FVProtocolHandle\r
- )\r
-/*++\r
-\r
-Routine Description:\r
- This DXE service routine is used to process a firmware volume. In\r
- particular, it can be called by BDS to process a single firmware\r
- volume found in a capsule. \r
-\r
-Arguments:\r
- FvHeader - pointer to a firmware volume header\r
- Size - the size of the buffer pointed to by FvHeader\r
- FVProtocolHandle - the handle on which a firmware volume protocol\r
- was produced for the firmware volume passed in.\r
-\r
-Returns:\r
- EFI_OUT_OF_RESOURCES - if an FVB could not be produced due to lack of \r
- system resources\r
- EFI_VOLUME_CORRUPTED - if the volume was corrupted\r
- EFI_SUCCESS - a firmware volume protocol was produced for the\r
- firmware volume\r
-\r
---*/\r
-;\r
+EFIAPI\r
+CoreEfiNotAvailableYetArg4 (\r
+ UINTN Arg1,\r
+ UINTN Arg2,\r
+ UINTN Arg3,\r
+ UINTN Arg4\r
+ );\r
\r
-//\r
-//Functions used during debug buils\r
-//\r
-VOID\r
-CoreDisplayMissingArchProtocols (\r
- VOID\r
- )\r
-/*++\r
+/**\r
+ Place holder function until all the Boot Services and Runtime Services are available.\r
\r
- Routine Description:\r
- Displays Architectural protocols that were not loaded and are required for DXE core to function\r
- Only used in Debug Builds\r
+ @param Arg1 Undefined\r
+ @param Arg2 Undefined\r
+ @param Arg3 Undefined\r
+ @param Arg4 Undefined\r
+ @param Arg5 Undefined\r
+\r
+ @return EFI_NOT_AVAILABLE_YET\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CoreEfiNotAvailableYetArg5 (\r
+ UINTN Arg1,\r
+ UINTN Arg2,\r
+ UINTN Arg3,\r
+ UINTN Arg4,\r
+ UINTN Arg5\r
+ );\r
\r
- Arguments:\r
- NONE\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
+ the compressed source buffer.\r
+\r
+ The GetInfo() function retrieves the size of the uncompressed buffer and the\r
+ temporary scratch buffer required to decompress the buffer specified by Source\r
+ and SourceSize. If the size of the uncompressed buffer or the size of the\r
+ scratch buffer cannot be determined from the compressed data specified by\r
+ Source and SourceData, then EFI_INVALID_PARAMETER is returned. Otherwise, the\r
+ size of the uncompressed buffer is returned in DestinationSize, the size of\r
+ the scratch buffer is returned in ScratchSize, and EFI_SUCCESS is returned.\r
+ The GetInfo() function does not have scratch buffer available to perform a\r
+ thorough checking of the validity of the source data. It just retrieves the\r
+ "Original Size" field from the beginning bytes of the source data and output\r
+ it as DestinationSize. And ScratchSize is specific to the decompression\r
+ implementation.\r
+\r
+ @param This A pointer to the EFI_DECOMPRESS_PROTOCOL instance.\r
+ @param Source The source buffer containing the compressed data.\r
+ @param SourceSize The size, in bytes, of the source buffer.\r
+ @param DestinationSize A pointer to the size, in bytes, of the\r
+ uncompressed buffer that will be generated when the\r
+ compressed buffer specified by Source and\r
+ SourceSize is decompressed.\r
+ @param ScratchSize A pointer to the size, in bytes, of the scratch\r
+ buffer that is required to decompress the\r
+ compressed buffer specified by Source and\r
+ SourceSize.\r
+\r
+ @retval EFI_SUCCESS The size of the uncompressed data was returned in\r
+ DestinationSize and the size of the scratch buffer\r
+ was returned in ScratchSize.\r
+ @retval EFI_INVALID_PARAMETER The size of the uncompressed data or the size of\r
+ the scratch buffer cannot be determined from the\r
+ compressed data specified by Source and\r
+ SourceSize.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+DxeMainUefiDecompressGetInfo (\r
+ IN EFI_DECOMPRESS_PROTOCOL *This,\r
+ IN VOID *Source,\r
+ IN UINT32 SourceSize,\r
+ OUT UINT32 *DestinationSize,\r
+ OUT UINT32 *ScratchSize\r
+ );\r
\r
- Returns:\r
- NONE\r
+/**\r
+ Decompresses a compressed source buffer.\r
+\r
+ The Decompress() function extracts decompressed data to its original form.\r
+ This protocol is designed so that the decompression algorithm can be\r
+ implemented without using any memory services. As a result, the Decompress()\r
+ Function is not allowed to call AllocatePool() or AllocatePages() in its\r
+ implementation. It is the caller's responsibility to allocate and free the\r
+ Destination and Scratch buffers.\r
+ If the compressed source data specified by Source and SourceSize is\r
+ sucessfully decompressed into Destination, then EFI_SUCCESS is returned. If\r
+ the compressed source data specified by Source and SourceSize is not in a\r
+ valid compressed data format, then EFI_INVALID_PARAMETER is returned.\r
+\r
+ @param This A pointer to the EFI_DECOMPRESS_PROTOCOL instance.\r
+ @param Source The source buffer containing the compressed data.\r
+ @param SourceSize SourceSizeThe size of source data.\r
+ @param Destination On output, the destination buffer that contains\r
+ the uncompressed data.\r
+ @param DestinationSize The size of the destination buffer. The size of\r
+ the destination buffer needed is obtained from\r
+ EFI_DECOMPRESS_PROTOCOL.GetInfo().\r
+ @param Scratch A temporary scratch buffer that is used to perform\r
+ the decompression.\r
+ @param ScratchSize The size of scratch buffer. The size of the\r
+ scratch buffer needed is obtained from GetInfo().\r
+\r
+ @retval EFI_SUCCESS Decompression completed successfully, and the\r
+ uncompressed buffer is returned in Destination.\r
+ @retval EFI_INVALID_PARAMETER The source buffer specified by Source and\r
+ SourceSize is corrupted (not in a valid\r
+ compressed format).\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+DxeMainUefiDecompress (\r
+ IN EFI_DECOMPRESS_PROTOCOL *This,\r
+ IN VOID *Source,\r
+ IN UINT32 SourceSize,\r
+ IN OUT VOID *Destination,\r
+ IN UINT32 DestinationSize,\r
+ IN OUT VOID *Scratch,\r
+ IN UINT32 ScratchSize\r
+ );\r
\r
---*/;\r
- \r
-VOID\r
-CoreDisplayDiscoveredNotDispatched (\r
- VOID\r
- )\r
-/*++\r
+/**\r
+ SEP member function. This function creates and returns a new section stream\r
+ handle to represent the new section stream.\r
\r
- Routine Description:\r
+ @param SectionStreamLength Size in bytes of the section stream.\r
+ @param SectionStream Buffer containing the new section stream.\r
+ @param SectionStreamHandle A pointer to a caller allocated UINTN that on\r
+ output contains the new section stream handle.\r
\r
- Traverse the discovered list for any drivers that were discovered but not loaded \r
- because the dependency experessions evaluated to false\r
+ @retval EFI_SUCCESS The section stream is created successfully.\r
+ @retval EFI_OUT_OF_RESOURCES memory allocation failed.\r
+ @retval EFI_INVALID_PARAMETER Section stream does not end concident with end\r
+ of last section.\r
\r
- Arguments:\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+OpenSectionStream (\r
+ IN UINTN SectionStreamLength,\r
+ IN VOID *SectionStream,\r
+ OUT UINTN *SectionStreamHandle\r
+ );\r
\r
- NONE\r
+/**\r
+ SEP member function. Retrieves requested section from section stream.\r
+\r
+ @param SectionStreamHandle The section stream from which to extract the\r
+ requested section.\r
+ @param SectionType A pointer to the type of section to search for.\r
+ @param SectionDefinitionGuid If the section type is EFI_SECTION_GUID_DEFINED,\r
+ then SectionDefinitionGuid indicates which of\r
+ these types of sections to search for.\r
+ @param SectionInstance Indicates which instance of the requested\r
+ section to return.\r
+ @param Buffer Double indirection to buffer. If *Buffer is\r
+ non-null on input, then the buffer is caller\r
+ allocated. If Buffer is NULL, then the buffer\r
+ is callee allocated. In either case, the\r
+ required buffer size is returned in *BufferSize.\r
+ @param BufferSize On input, indicates the size of *Buffer if\r
+ *Buffer is non-null on input. On output,\r
+ indicates the required size (allocated size if\r
+ callee allocated) of *Buffer.\r
+ @param AuthenticationStatus A pointer to a caller-allocated UINT32 that\r
+ indicates the authentication status of the\r
+ output buffer. If the input section's\r
+ GuidedSectionHeader.Attributes field\r
+ has the EFI_GUIDED_SECTION_AUTH_STATUS_VALID\r
+ bit as clear, AuthenticationStatus must return\r
+ zero. Both local bits (19:16) and aggregate\r
+ bits (3:0) in AuthenticationStatus are returned\r
+ by ExtractSection(). These bits reflect the\r
+ status of the extraction operation. The bit\r
+ pattern in both regions must be the same, as\r
+ the local and aggregate authentication statuses\r
+ have equivalent meaning at this level. If the\r
+ function returns anything other than\r
+ EFI_SUCCESS, the value of *AuthenticationStatus\r
+ is undefined.\r
+ @param IsFfs3Fv Indicates the FV format.\r
+\r
+ @retval EFI_SUCCESS Section was retrieved successfully\r
+ @retval EFI_PROTOCOL_ERROR A GUID defined section was encountered in the\r
+ section stream with its\r
+ EFI_GUIDED_SECTION_PROCESSING_REQUIRED bit set,\r
+ but there was no corresponding GUIDed Section\r
+ Extraction Protocol in the handle database.\r
+ *Buffer is unmodified.\r
+ @retval EFI_NOT_FOUND An error was encountered when parsing the\r
+ SectionStream. This indicates the SectionStream\r
+ is not correctly formatted.\r
+ @retval EFI_NOT_FOUND The requested section does not exist.\r
+ @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to process\r
+ the request.\r
+ @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.\r
+ @retval EFI_WARN_TOO_SMALL The size of the caller allocated input buffer is\r
+ insufficient to contain the requested section.\r
+ The input buffer is filled and section contents\r
+ are truncated.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetSection (\r
+ IN UINTN SectionStreamHandle,\r
+ IN EFI_SECTION_TYPE *SectionType,\r
+ IN EFI_GUID *SectionDefinitionGuid,\r
+ IN UINTN SectionInstance,\r
+ IN VOID **Buffer,\r
+ IN OUT UINTN *BufferSize,\r
+ OUT UINT32 *AuthenticationStatus,\r
+ IN BOOLEAN IsFfs3Fv\r
+ );\r
\r
- Returns:\r
+/**\r
+ SEP member function. Deletes an existing section stream\r
\r
- NONE \r
+ @param StreamHandleToClose Indicates the stream to close\r
+ @param FreeStreamBuffer TRUE - Need to free stream buffer;\r
+ FALSE - No need to free stream buffer.\r
\r
---*/;\r
+ @retval EFI_SUCCESS The section stream is closed sucessfully.\r
+ @retval EFI_OUT_OF_RESOURCES Memory allocation failed.\r
+ @retval EFI_INVALID_PARAMETER Section stream does not end concident with end\r
+ of last section.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
-CoreEfiNotAvailableYetArg0 (\r
- VOID\r
- )\r
-/*++\r
-\r
-Routine Description:\r
+CloseSectionStream (\r
+ IN UINTN StreamHandleToClose,\r
+ IN BOOLEAN FreeStreamBuffer\r
+ );\r
\r
- Place holder function until all the Boot Services and Runtime Services are available\r
+/**\r
+ Creates and initializes the DebugImageInfo Table. Also creates the configuration\r
+ table and registers it into the system table.\r
\r
-Arguments:\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
- None\r
+**/\r
+VOID\r
+CoreInitializeDebugImageInfoTable (\r
+ VOID\r
+ );\r
\r
-Returns:\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
- EFI_NOT_AVAILABLE_YET\r
+**/\r
+VOID\r
+CoreUpdateDebugTableCrc32 (\r
+ VOID\r
+ );\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
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg1 (\r
- UINTN Arg1\r
- )\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
-Routine Description:\r
+**/\r
+VOID\r
+CoreNewDebugImageInfoEntry (\r
+ IN UINT32 ImageInfoType,\r
+ IN EFI_LOADED_IMAGE_PROTOCOL *LoadedImage,\r
+ IN EFI_HANDLE ImageHandle\r
+ );\r
\r
- Place holder function until all the Boot Services and Runtime Services are available\r
+/**\r
+ Removes and frees an entry from the DebugImageInfo Table.\r
\r
-Arguments:\r
+ @param ImageHandle image handle for the image being unloaded\r
\r
- Arg1 - Undefined\r
+**/\r
+VOID\r
+CoreRemoveDebugImageInfoEntry (\r
+ EFI_HANDLE ImageHandle\r
+ );\r
\r
-Returns:\r
+/**\r
+ This routine consumes FV hobs and produces instances of FW_VOL_BLOCK_PROTOCOL as appropriate.\r
\r
- EFI_NOT_AVAILABLE_YET\r
+ @param ImageHandle The image handle.\r
+ @param SystemTable The system table.\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS Successfully initialized firmware volume block\r
+ driver.\r
\r
+**/\r
EFI_STATUS\r
EFIAPI\r
-CoreEfiNotAvailableYetArg2 (\r
- UINTN Arg1,\r
- UINTN Arg2\r
- )\r
-/*++\r
+FwVolBlockDriverInit (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ );\r
+\r
+/**\r
\r
-Routine Description:\r
+ Get FVB authentication status\r
\r
- Place holder function until all the Boot Services and Runtime Services are available\r
+ @param FvbProtocol FVB protocol.\r
\r
-Arguments:\r
+ @return Authentication status.\r
\r
- Arg1 - Undefined\r
- \r
- Arg2 - Undefined\r
+**/\r
+UINT32\r
+GetFvbAuthenticationStatus (\r
+ IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *FvbProtocol\r
+ );\r
\r
-Returns:\r
+/**\r
+ This routine produces a firmware volume block protocol on a given\r
+ buffer.\r
\r
- EFI_NOT_AVAILABLE_YET\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 and section in another firmware\r
+ volume (ala capsules)\r
+ @param AuthenticationStatus Authentication status inherited, if this image\r
+ came from an FV image file and section in another firmware volume.\r
+ @param FvProtocol Firmware volume block protocol produced.\r
\r
---*/\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
-EFIAPI\r
-CoreEfiNotAvailableYetArg3 (\r
- UINTN Arg1,\r
- UINTN Arg2,\r
- UINTN Arg3\r
- )\r
-/*++\r
+ProduceFVBProtocolOnBuffer (\r
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
+ IN UINT64 Length,\r
+ IN EFI_HANDLE ParentHandle,\r
+ IN UINT32 AuthenticationStatus,\r
+ OUT EFI_HANDLE *FvProtocol OPTIONAL\r
+ );\r
\r
-Routine Description:\r
+/**\r
+ Raising to the task priority level of the mutual exclusion\r
+ lock, and then acquires ownership of the lock.\r
\r
- Place holder function until all the Boot Services and Runtime Services are available\r
+ @param Lock The lock to acquire\r
\r
-Arguments:\r
+ @return Lock owned\r
\r
- Arg1 - Undefined\r
- \r
- Arg2 - Undefined\r
- \r
- Arg3 - Undefined\r
+**/\r
+VOID\r
+CoreAcquireLock (\r
+ IN EFI_LOCK *Lock\r
+ );\r
\r
-Returns:\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
- EFI_NOT_AVAILABLE_YET\r
+ @param Lock The EFI_LOCK structure to initialize\r
\r
---*/\r
-;\r
+ @retval EFI_SUCCESS Lock Owned.\r
+ @retval EFI_ACCESS_DENIED Reentrant Lock Acquisition, Lock not Owned.\r
\r
+**/\r
EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg4 (\r
- UINTN Arg1,\r
- UINTN Arg2,\r
- UINTN Arg3,\r
- UINTN Arg4\r
- )\r
-/*++\r
+CoreAcquireLockOrFail (\r
+ IN EFI_LOCK *Lock\r
+ );\r
\r
-Routine Description:\r
+/**\r
+ Releases ownership of the mutual exclusion lock, and\r
+ restores the previous task priority level.\r
\r
- Place holder function until all the Boot Services and Runtime Services are available\r
+ @param Lock The lock to release\r
\r
-Arguments:\r
+ @return Lock unowned\r
+\r
+**/\r
+VOID\r
+CoreReleaseLock (\r
+ IN EFI_LOCK *Lock\r
+ );\r
\r
- Arg1 - Undefined\r
- \r
- Arg2 - Undefined\r
- \r
- Arg3 - Undefined\r
- \r
- Arg4 - Undefined\r
+/**\r
+ Read data from Firmware Block by FVB protocol Read.\r
+ The data may cross the multi block ranges.\r
+\r
+ @param Fvb The FW_VOL_BLOCK_PROTOCOL instance from which to read data.\r
+ @param StartLba Pointer to StartLba.\r
+ On input, the start logical block index from which to read.\r
+ On output,the end logical block index after reading.\r
+ @param Offset Pointer to Offset\r
+ On input, offset into the block at which to begin reading.\r
+ On output, offset into the end block after reading.\r
+ @param DataSize Size of data to be read.\r
+ @param Data Pointer to Buffer that the data will be read into.\r
+\r
+ @retval EFI_SUCCESS Successfully read data from firmware block.\r
+ @retval others\r
+**/\r
+EFI_STATUS\r
+ReadFvbData (\r
+ IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb,\r
+ IN OUT EFI_LBA *StartLba,\r
+ IN OUT UINTN *Offset,\r
+ IN UINTN DataSize,\r
+ OUT UINT8 *Data\r
+ );\r
\r
-Returns:\r
+/**\r
+ Given the supplied FW_VOL_BLOCK_PROTOCOL, allocate a buffer for output and\r
+ copy the real length volume header into it.\r
\r
- EFI_NOT_AVAILABLE_YET\r
+ @param Fvb The FW_VOL_BLOCK_PROTOCOL instance from which to\r
+ read the volume header\r
+ @param FwVolHeader Pointer to pointer to allocated buffer in which\r
+ the volume header is returned.\r
\r
---*/\r
-;\r
+ @retval EFI_OUT_OF_RESOURCES No enough buffer could be allocated.\r
+ @retval EFI_SUCCESS Successfully read volume header to the allocated\r
+ buffer.\r
+ @retval EFI_INVALID_PARAMETER The FV Header signature is not as expected or\r
+ the file system could not be understood.\r
\r
+**/\r
EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg5 (\r
- UINTN Arg1,\r
- UINTN Arg2,\r
- UINTN Arg3,\r
- UINTN Arg4,\r
- UINTN Arg5\r
- )\r
-/*++\r
+GetFwVolHeader (\r
+ IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb,\r
+ OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader\r
+ );\r
\r
-Routine Description:\r
+/**\r
+ Verify checksum of the firmware volume header.\r
\r
- Place holder function until all the Boot Services and Runtime Services are available\r
+ @param FvHeader Points to the firmware volume header to be checked\r
\r
-Arguments:\r
+ @retval TRUE Checksum verification passed\r
+ @retval FALSE Checksum verification failed\r
\r
- Arg1 - Undefined\r
- \r
- Arg2 - Undefined\r
- \r
- Arg3 - Undefined\r
- \r
- Arg4 - Undefined\r
- \r
- Arg5 - Undefined\r
+**/\r
+BOOLEAN\r
+VerifyFvHeaderChecksum (\r
+ IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader\r
+ );\r
\r
-Returns:\r
+/**\r
+ Initialize memory profile.\r
\r
- EFI_NOT_AVAILABLE_YET\r
+ @param HobStart The start address of the HOB.\r
\r
---*/\r
-;\r
+**/\r
+VOID\r
+MemoryProfileInit (\r
+ IN VOID *HobStart\r
+ );\r
\r
-EFI_STATUS\r
-CoreGetPeiProtocol (\r
- IN EFI_GUID *ProtocolGuid,\r
- IN VOID **Interface\r
- )\r
-/*++\r
+/**\r
+ Install memory profile protocol.\r
\r
-Routine Description:\r
+**/\r
+VOID\r
+MemoryProfileInstallProtocol (\r
+ VOID\r
+ );\r
\r
- Searches for a Protocol Interface passed from PEI through a HOB\r
+/**\r
+ Register image to memory profile.\r
\r
-Arguments:\r
+ @param DriverEntry Image info.\r
+ @param FileType Image file type.\r
\r
- ProtocolGuid - The Protocol GUID to search for in the HOB List\r
+ @return EFI_SUCCESS Register successfully.\r
+ @return EFI_UNSUPPORTED Memory profile unsupported,\r
+ or memory profile for the image is not required.\r
+ @return EFI_OUT_OF_RESOURCES No enough resource for this register.\r
\r
- Interface - A pointer to the interface for the Protocol GUID\r
+**/\r
+EFI_STATUS\r
+RegisterMemoryProfileImage (\r
+ IN LOADED_IMAGE_PRIVATE_DATA *DriverEntry,\r
+ IN EFI_FV_FILETYPE FileType\r
+ );\r
\r
-Returns:\r
+/**\r
+ Unregister image from memory profile.\r
\r
- EFI_SUCCESS - The Protocol GUID was found and its interface is returned in Interface\r
+ @param DriverEntry Image info.\r
\r
- EFI_NOT_FOUND - The Protocol GUID was not found in the HOB List\r
+ @return EFI_SUCCESS Unregister successfully.\r
+ @return EFI_UNSUPPORTED Memory profile unsupported,\r
+ or memory profile for the image is not required.\r
+ @return EFI_NOT_FOUND The image is not found.\r
\r
---*/\r
-;\r
- \r
+**/\r
EFI_STATUS\r
-DxeMainUefiDecompressGetInfo (\r
- IN EFI_DECOMPRESS_PROTOCOL *This,\r
- IN VOID *Source,\r
- IN UINT32 SourceSize,\r
- OUT UINT32 *DestinationSize,\r
- OUT UINT32 *ScratchSize\r
+UnregisterMemoryProfileImage (\r
+ IN LOADED_IMAGE_PRIVATE_DATA *DriverEntry\r
);\r
\r
+/**\r
+ Update memory profile information.\r
+\r
+ @param CallerAddress Address of caller who call Allocate or Free.\r
+ @param Action This Allocate or Free action.\r
+ @param MemoryType Memory type.\r
+ EfiMaxMemoryType means the MemoryType is unknown.\r
+ @param Size Buffer size.\r
+ @param Buffer Buffer address.\r
+ @param ActionString String for memory profile action.\r
+ Only needed for user defined allocate action.\r
+\r
+ @return EFI_SUCCESS Memory profile is updated.\r
+ @return EFI_UNSUPPORTED Memory profile is unsupported,\r
+ or memory profile for the image is not required,\r
+ or memory profile for the memory type is not required.\r
+ @return EFI_ACCESS_DENIED It is during memory profile data getting.\r
+ @return EFI_ABORTED Memory profile recording is not enabled.\r
+ @return EFI_OUT_OF_RESOURCES No enough resource to update memory profile for allocate action.\r
+ @return EFI_NOT_FOUND No matched allocate info found for free action.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
-DxeMainUefiDecompress (\r
- IN EFI_DECOMPRESS_PROTOCOL *This,\r
- IN VOID *Source,\r
- IN UINT32 SourceSize,\r
- IN OUT VOID *Destination,\r
- IN UINT32 DestinationSize,\r
- IN OUT VOID *Scratch,\r
- IN UINT32 ScratchSize\r
+CoreUpdateProfile (\r
+ IN EFI_PHYSICAL_ADDRESS CallerAddress,\r
+ IN MEMORY_PROFILE_ACTION Action,\r
+ IN EFI_MEMORY_TYPE MemoryType,\r
+ IN UINTN Size, // Valid for AllocatePages/FreePages/AllocatePool\r
+ IN VOID *Buffer,\r
+ IN CHAR8 *ActionString OPTIONAL\r
);\r
\r
-EFI_STATUS\r
-DxeMainTianoDecompressGetInfo (\r
- IN EFI_TIANO_DECOMPRESS_PROTOCOL *This,\r
- IN VOID *Source,\r
- IN UINT32 SourceSize,\r
- OUT UINT32 *DestinationSize,\r
- OUT UINT32 *ScratchSize\r
+/**\r
+ Internal function. Converts a memory range to use new attributes.\r
+\r
+ @param Start The first address of the range Must be page\r
+ aligned\r
+ @param NumberOfPages The number of pages to convert\r
+ @param NewAttributes The new attributes value for the range.\r
+\r
+**/\r
+VOID\r
+CoreUpdateMemoryAttributes (\r
+ IN EFI_PHYSICAL_ADDRESS Start,\r
+ IN UINT64 NumberOfPages,\r
+ IN UINT64 NewAttributes\r
);\r
\r
-EFI_STATUS\r
+/**\r
+ Initialize MemoryAttrubutesTable support.\r
+**/\r
+VOID\r
EFIAPI\r
-DxeMainTianoDecompress (\r
- IN EFI_TIANO_DECOMPRESS_PROTOCOL *This,\r
- IN VOID *Source,\r
- IN UINT32 SourceSize,\r
- IN OUT VOID *Destination,\r
- IN UINT32 DestinationSize,\r
- IN OUT VOID *Scratch,\r
- IN UINT32 ScratchSize\r
+CoreInitializeMemoryAttributesTable (\r
+ VOID\r
);\r
\r
-EFI_STATUS\r
-DxeMainCustomDecompressGetInfo (\r
- IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This,\r
- IN VOID *Source,\r
- IN UINT32 SourceSize,\r
- OUT UINT32 *DestinationSize,\r
- OUT UINT32 *ScratchSize\r
+/**\r
+ Initialize Memory Protection support.\r
+**/\r
+VOID\r
+EFIAPI\r
+CoreInitializeMemoryProtection (\r
+ VOID\r
+ );\r
+\r
+/**\r
+ Install MemoryAttributesTable on memory allocation.\r
+\r
+ @param[in] MemoryType EFI memory type.\r
+**/\r
+VOID\r
+InstallMemoryAttributesTableOnMemoryAllocation (\r
+ IN EFI_MEMORY_TYPE MemoryType\r
+ );\r
+\r
+/**\r
+ Insert image record.\r
+\r
+ @param RuntimeImage Runtime image information\r
+**/\r
+VOID\r
+InsertImageRecord (\r
+ IN EFI_RUNTIME_IMAGE_ENTRY *RuntimeImage\r
+ );\r
+\r
+/**\r
+ Remove Image record.\r
+\r
+ @param RuntimeImage Runtime image information\r
+**/\r
+VOID\r
+RemoveImageRecord (\r
+ IN EFI_RUNTIME_IMAGE_ENTRY *RuntimeImage\r
+ );\r
+\r
+/**\r
+ Protect UEFI image.\r
+\r
+ @param[in] LoadedImage The loaded image protocol\r
+ @param[in] LoadedImageDevicePath The loaded image device path protocol\r
+**/\r
+VOID\r
+ProtectUefiImage (\r
+ IN EFI_LOADED_IMAGE_PROTOCOL *LoadedImage,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *LoadedImageDevicePath\r
+ );\r
+\r
+/**\r
+ Unprotect UEFI image.\r
+\r
+ @param[in] LoadedImage The loaded image protocol\r
+ @param[in] LoadedImageDevicePath The loaded image device path protocol\r
+**/\r
+VOID\r
+UnprotectUefiImage (\r
+ IN EFI_LOADED_IMAGE_PROTOCOL *LoadedImage,\r
+ IN EFI_DEVICE_PATH_PROTOCOL *LoadedImageDevicePath\r
+ );\r
+\r
+/**\r
+ ExitBootServices Callback function for memory protection.\r
+**/\r
+VOID\r
+MemoryProtectionExitBootServicesCallback (\r
+ VOID\r
);\r
\r
+/**\r
+ Manage memory permission attributes on a memory range, according to the\r
+ configured DXE memory protection policy.\r
+\r
+ @param OldType The old memory type of the range\r
+ @param NewType The new memory type of the range\r
+ @param Memory The base address of the range\r
+ @param Length The size of the range (in bytes)\r
+\r
+ @return EFI_SUCCESS If the the CPU arch protocol is not installed yet\r
+ @return EFI_SUCCESS If no DXE memory protection policy has been configured\r
+ @return EFI_SUCCESS If OldType and NewType use the same permission attributes\r
+ @return other Return value of gCpu->SetMemoryAttributes()\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
-DxeMainCustomDecompress (\r
- IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This,\r
- IN VOID *Source,\r
- IN UINT32 SourceSize,\r
- IN OUT VOID *Destination,\r
- IN UINT32 DestinationSize,\r
- IN OUT VOID *Scratch,\r
- IN UINT32 ScratchSize\r
+ApplyMemoryProtectionPolicy (\r
+ IN EFI_MEMORY_TYPE OldType,\r
+ IN EFI_MEMORY_TYPE NewType,\r
+ IN EFI_PHYSICAL_ADDRESS Memory,\r
+ IN UINT64 Length\r
+ );\r
+\r
+/**\r
+ Merge continous memory map entries whose have same attributes.\r
+\r
+ @param MemoryMap A pointer to the buffer in which firmware places\r
+ the current memory map.\r
+ @param MemoryMapSize A pointer to the size, in bytes, of the\r
+ MemoryMap buffer. On input, this is the size of\r
+ the current memory map. On output,\r
+ it is the size of new memory map after merge.\r
+ @param DescriptorSize Size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR.\r
+**/\r
+VOID\r
+MergeMemoryMap (\r
+ IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap,\r
+ IN OUT UINTN *MemoryMapSize,\r
+ IN UINTN DescriptorSize\r
);\r
\r
#endif\r