From c7d265a94a3ee2517430e4f19f5b24482e5e7132 Mon Sep 17 00:00:00 2001 From: yshang1 Date: Fri, 22 Jun 2007 16:22:26 +0000 Subject: Checked in part of MDE library instances following PI and UEFI. It includes: 1) UefiLib adds features of RFC 3066/Iso639 language string and driver model protocols installation. 2) PeiCoreEntryPoint following PI. 3) UefiDriverEntryPoint following UEFI/EFI. 4) PeiServicesTablePointerLib following PI for IPF and x86. 5) Remove many CommonHeader.h. If there is only one C file in module, we should add the common headers in C file instead of creating a new CommonHeader.h. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2723 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/Library/BaseLib.h | 2 + MdePkg/Include/Library/HiiLib.h | 11 +- MdePkg/Include/Library/PeiCoreEntryPoint.h | 34 +++++-- MdePkg/Include/Library/ReportStatusCodeLib.h | 146 +-------------------------- MdePkg/Include/Library/ScsiLib.h | 2 + MdePkg/Include/Library/UefiLib.h | 128 +++++++++++++++++++++++ MdePkg/Include/Library/UsbLib.h | 1 + 7 files changed, 164 insertions(+), 160 deletions(-) (limited to 'MdePkg/Include/Library') diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h index 5fbcb10d58..5d87fc9c2b 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -17,6 +17,8 @@ #ifndef __BASE_LIB__ #define __BASE_LIB__ +#include + // // Definitions for architecture specific types // These include SPIN_LOCK and BASE_LIBRARY_JUMP_BUFFER diff --git a/MdePkg/Include/Library/HiiLib.h b/MdePkg/Include/Library/HiiLib.h index 4d3e18db62..9da8d292ce 100644 --- a/MdePkg/Include/Library/HiiLib.h +++ b/MdePkg/Include/Library/HiiLib.h @@ -32,15 +32,12 @@ The allocated and initialized packages. **/ -EFI_HII_PACKAGE_LIST_HEADER* +EFI_HII_PACKAGE_LIST_HEADER * EFIAPI PreparePackages ( - IN UINTN NumberOfPackages, - IN CONST EFI_GUID *Guid OPTIONAL, + IN CONST UINTN NumberOfPackages, + IN CONST EFI_GUID *Guid OPTIONAL, ... - ) -; - - + ); #endif diff --git a/MdePkg/Include/Library/PeiCoreEntryPoint.h b/MdePkg/Include/Library/PeiCoreEntryPoint.h index 76afc594cb..00105f5d0b 100644 --- a/MdePkg/Include/Library/PeiCoreEntryPoint.h +++ b/MdePkg/Include/Library/PeiCoreEntryPoint.h @@ -16,19 +16,35 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define __MODULE_ENTRY_POINT_H__ /** + Enrty point to PEI core. - @param PeiStartupDescriptor Pointer of start up information. - - @return Status returned by entry points of core and drivers. + @param SecCoreData Points to a data structure containing + information about the PEI core's + operating environment, such as the size + and location of temporary RAM, the stack + location and the BFV location. The type + EFI_SEC_PEI_HAND_OFF is + + @param PpiList Points to a list of one or more PPI + descriptors to be installed initially by + the PEI core. An empty PPI list consists + of a single descriptor with the end-tag + EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. + As part of its initialization phase, the + PEI Foundation will add these SEC-hosted + PPIs to its PPI database such that both + the PEI Foundation and any modules can + leverage the associated service calls + and/or code in these early PPIs. **/ -EFI_STATUS -EFIAPI -_ModuleEntryPoint ( +VOID +EFIAPI +_ModuleEntryPoint( IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList - ); +); /** Wrapper of enrty point to PEI core. @@ -38,7 +54,7 @@ _ModuleEntryPoint ( @return Status returned by entry points of core and drivers. **/ -EFI_STATUS +VOID EFIAPI EfiMain ( IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, @@ -69,7 +85,7 @@ ProcessLibraryConstructorList ( @return Status returned by entry points of drivers. **/ -EFI_STATUS +VOID EFIAPI ProcessModuleEntryPointList ( IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, diff --git a/MdePkg/Include/Library/ReportStatusCodeLib.h b/MdePkg/Include/Library/ReportStatusCodeLib.h index 6b32ddb137..626ad11e28 100644 --- a/MdePkg/Include/Library/ReportStatusCodeLib.h +++ b/MdePkg/Include/Library/ReportStatusCodeLib.h @@ -15,6 +15,8 @@ #ifndef __REPORT_STATUS_CODE_LIB_H__ #define __REPORT_STATUS_CODE_LIB_H__ +#include + // // Declare bits for PcdReportStatusCodePropertyMask // @@ -26,150 +28,6 @@ // Extended Data structure definitions with EFI_STATUS_CODE_DATA headers removed // -/// -/// Voltage Extended Error Data -/// -typedef struct { - EFI_EXP_BASE10_DATA Voltage; - EFI_EXP_BASE10_DATA Threshold; -} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_VOLTAGE_ERROR_DATA; - -/// -/// Microcode Update Extended Error Data -/// -typedef struct { - UINT32 Version; -} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_MICROCODE_UPDATE_ERROR_DATA; - -/// -/// Asynchronous Timer Extended Error Data -/// -typedef struct { - EFI_EXP_BASE10_DATA TimerLimit; -} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_TIMER_EXPIRED_ERROR_DATA; - -/// -/// Host Processor Mismatch Extended Error Data -/// -typedef struct { - UINT32 Instance; - UINT16 Attributes; -} REPORT_STATUS_CODE_LIBRARY_HOST_PROCESSOR_MISMATCH_ERROR_DATA; - -/// -/// Thermal Extended Error Data -/// -typedef struct { - EFI_EXP_BASE10_DATA Temperature; - EFI_EXP_BASE10_DATA Threshold; -} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_THERMAL_ERROR_DATA; - -/// -/// Processor Disabled Extended Error Data -/// -typedef struct { - UINT32 Cause; - BOOLEAN SoftwareDisabled; -} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_CPU_DISABLED_ERROR_DATA; - -/// -/// Embedded cache init extended data -/// -typedef struct { - UINT32 Level; - EFI_INIT_CACHE_TYPE Type; -} REPORT_STATUS_CODE_LIBRARY_CACHE_INIT_DATA; - -/// -/// Memory Extended Error Data -/// -typedef struct { - EFI_MEMORY_ERROR_GRANULARITY Granularity; - EFI_MEMORY_ERROR_OPERATION Operation; - UINTN Syndrome; - EFI_PHYSICAL_ADDRESS Address; - UINTN Resolution; -} REPORT_STATUS_CODE_LIBRARY_MEMORY_EXTENDED_ERROR_DATA; - -/// -/// DIMM number -/// -typedef struct { - UINT16 Array; - UINT16 Device; -} REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_DIMM_NUMBER; - -/// -/// Memory Module Mismatch Extended Error Data -/// -typedef struct { - EFI_STATUS_CODE_DIMM_NUMBER Instance; -} REPORT_STATUS_CODE_LIBRARY_MEMORY_MODULE_MISMATCH_ERROR_DATA; - -/// -/// Memory Range Extended Data -/// -typedef struct { - EFI_PHYSICAL_ADDRESS Start; - EFI_PHYSICAL_ADDRESS Length; -} REPORT_STATUS_CODE_LIBRARY_MEMORY_RANGE_EXTENDED_DATA; - -/// -/// Device handle Extended Data. Used for many -/// errors and progress codes to point to the device. -/// -typedef struct { - EFI_HANDLE Handle; -} REPORT_STATUS_CODE_LIBRARY_DEVICE_HANDLE_EXTENDED_DATA; - -typedef struct { - UINT8 *DevicePath; -} REPORT_STATUS_CODE_LIBRARY_DEVICE_PATH_EXTENDED_DATA; - -typedef struct { - EFI_HANDLE ControllerHandle; - EFI_HANDLE DriverBindingHandle; - UINT16 DevicePathSize; - UINT8 *RemainingDevicePath; -} REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_START_EXTENDED_DATA; - -/// -/// Resource Allocation Failure Extended Error Data -/// -typedef struct { - UINT32 Bar; - UINT16 DevicePathSize; - UINT16 ReqResSize; - UINT16 AllocResSize; - UINT8 *DevicePath; - UINT8 *ReqRes; - UINT8 *AllocRes; -} REPORT_STATUS_CODE_LIBRARY_RESOURCE_ALLOC_FAILURE_ERROR_DATA; - -/// -/// Extended Error Data for Assert -/// -typedef struct { - UINT32 LineNumber; - UINT32 FileNameSize; - EFI_STATUS_CODE_STRING_DATA *FileName; -} REPORT_STATUS_CODE_LIBRARY_DEBUG_ASSERT_DATA; - -/// -/// System Context Data EBC/IA32/IPF -/// -typedef struct { - EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT Context; -} REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_EXCEP_EXTENDED_DATA; - -/// -/// Legacy Oprom extended data -/// -typedef struct { - EFI_HANDLE DeviceHandle; - EFI_PHYSICAL_ADDRESS RomImageBase; -} REPORT_STATUS_CODE_LIBRARY_LEGACY_OPROM_EXTENDED_DATA; - // // Extern for the modules Caller ID GUID // diff --git a/MdePkg/Include/Library/ScsiLib.h b/MdePkg/Include/Library/ScsiLib.h index bb1a1adbb3..239cd1c304 100644 --- a/MdePkg/Include/Library/ScsiLib.h +++ b/MdePkg/Include/Library/ScsiLib.h @@ -24,6 +24,8 @@ Module Name: #ifndef _SCSI_LIB_H #define _SCSI_LIB_H +#include + // // the time unit is 100ns, since the SCSI I/O defines timeout in 100ns unit. // diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/UefiLib.h index 9eaf48cace..ef231f1774 100644 --- a/MdePkg/Include/Library/UefiLib.h +++ b/MdePkg/Include/Library/UefiLib.h @@ -15,6 +15,13 @@ #ifndef __UEFI_LIB_H__ #define __UEFI_LIB_H__ +#include +#include +#include +#include +#include +#include + // // Unicode String Table // @@ -708,4 +715,125 @@ AsciiErrorPrint ( ... ); +/** + Intialize a driver by installing the Driver Binding Protocol onto the + driver's DriverBindingHandle. This is typically the same as the driver's + ImageHandle, but it can be different if the driver produces multiple + DriverBinding Protocols. This function also initializes the EFI Driver + Library that initializes the global variables gST, gBS, gRT. + + @param ImageHandle The image handle of the driver + @param SystemTable The EFI System Table that was passed to the driver's entry point + @param DriverBinding A Driver Binding Protocol instance that this driver is producing + @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this + parameter is NULL, then a new handle is created. + + @retval EFI_SUCCESS DriverBinding is installed onto DriverBindingHandle + @retval Other Status from gBS->InstallProtocolInterface() + +**/ +EFI_STATUS +EFIAPI +EfiLibInstallDriverBinding ( + IN CONST EFI_HANDLE ImageHandle, + IN CONST EFI_SYSTEM_TABLE *SystemTable, + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, + IN EFI_HANDLE DriverBindingHandle + ); + +/** + Intialize a driver by installing the Driver Binding Protocol onto the + driver's DriverBindingHandle. This is typically the same as the driver's + ImageHandle, but it can be different if the driver produces multiple + DriverBinding Protocols. This function also initializes the EFI Driver + Library that initializes the global variables gST, gBS, gRT. + + @ImageHandle The image handle of the driver + @SystemTable The EFI System Table that was passed to the driver's entry point + @DriverBinding A Driver Binding Protocol instance that this driver is producing + @DriverBindingHandle The handle that DriverBinding is to be installe onto. If this + parameter is NULL, then a new handle is created. + @ComponentName A Component Name Protocol instance that this driver is producing + @DriverConfiguration A Driver Configuration Protocol instance that this driver is producing + @DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing + + @retval EFI_SUCCESS DriverBinding is installed onto DriverBindingHandle + @retval Other Status from gBS->InstallProtocolInterface() + +**/ +EFI_STATUS +EFIAPI +EfiLibInstallAllDriverProtocols ( + IN CONST EFI_HANDLE ImageHandle, + IN CONST EFI_SYSTEM_TABLE *SystemTable, + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, + IN EFI_HANDLE DriverBindingHandle, + IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL + IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL + IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL + ); + + +/** + Intialize a driver by installing the Driver Binding Protocol + onto the driver's DriverBindingHandle. This is typically the + same as the driver's ImageHandle, but it can be different if + the driver produces multiple DriverBinding Protocols. This + function also initializes the EFI Driver Library that + initializes the global variables gST, gBS, gRT. + + @ImageHandle The image handle of the driver + + @SystemTable The EFI System Table that was + passed to the driver's entry + point + + @DriverBinding A Driver Binding Protocol + instance that this driver is + producing + + @DriverBindingHandle The handle that DriverBinding is + to be installe onto. If this + parameter is NULL, then a new + handle is created. + + @ComponentName A Component Name Protocol + instance that this driver is + producing + + @ComponentName2 A Component Name 2 Protocol + instance that this driver is + producing + + @DriverConfiguration A Driver Configuration Protocol + instance that this driver is + producing + + @DriverDiagnostics A Driver Diagnostics Protocol + instance that this driver is + producing + + @DriverDiagnostics2 A Driver Diagnostics 2 Protocol + instance that this driver is + producing + + @retval EFI_SUCCESS DriverBinding is installed onto DriverBindingHandle + @retval Other Status from gBS->InstallProtocolInterface() + +**/ +EFI_STATUS +EFIAPI +EfiLibInstallAllDriverProtocols2 ( + IN CONST EFI_HANDLE ImageHandle, + IN CONST EFI_SYSTEM_TABLE *SystemTable, + IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, + IN EFI_HANDLE DriverBindingHandle, + IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL + IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2, OPTIONAL + IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL + IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics, OPTIONAL + IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL + ); + + #endif diff --git a/MdePkg/Include/Library/UsbLib.h b/MdePkg/Include/Library/UsbLib.h index 005e045aac..6e00c1ce32 100644 --- a/MdePkg/Include/Library/UsbLib.h +++ b/MdePkg/Include/Library/UsbLib.h @@ -25,6 +25,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #ifndef _USB_DXE_LIB_H #define _USB_DXE_LIB_H +#include // // define the timeout time as 3ms // -- cgit v1.2.3