dxecore.h

来自「EFI BIOS是Intel提出的下一代的BIOS标准。这里上传的Edk源代码是」· C头文件 代码 · 共 2,531 行 · 第 1/4 页

H
2,531
字号

  UserEvent - The event to check
    
Returns:

  EFI_SUCCESS           - The event is in the signaled state
  EFI_NOT_READY         - The event is not in the signaled state
  EFI_INVALID_PARAMETER - Event is of type EVT_NOTIFY_SIGNAL

--*/
;

EFI_STATUS
CoreAddMemorySpace (
  IN EFI_GCD_MEMORY_TYPE   GcdMemoryType,
  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
  IN UINT64                Length,
  IN UINT64                Capabilities
  )
/*++

Routine Description:

  Add a segment of memory space to GCD map and add all available pages in this segment 
  as memory descriptors.

Arguments:
    
  GcdMemoryType     - Memory type of the segment.
  
  BaseAddress       - Base address of the segment.
  
  Length            - Length of the segment.
  
  Capabilities      - alterable attributes of the segment.

Returns:

  EFI_SUCCESS       - Merged this segment into GCD map.

--*/
;

EFI_STATUS
CoreAllocateMemorySpace (
  IN     EFI_GCD_ALLOCATE_TYPE  GcdAllocateType,
  IN     EFI_GCD_MEMORY_TYPE    GcdMemoryType,
  IN     UINTN                  Alignment,
  IN     UINT64                 Length,
  IN OUT EFI_PHYSICAL_ADDRESS   *BaseAddress,
  IN     EFI_HANDLE             ImageHandle,
  IN     EFI_HANDLE             DeviceHandle OPTIONAL
  )
/*++

Routine Description:

  Allocate memory space on GCD map.

Arguments:
  
  GcdAllocateType   - The type of allocate operation
  
  GcdMemoryType     - The desired memory type
  
  Alignment         - Align with 2^Alignment
  
  Length            - Length to allocate
  
  BaseAddress       - Base address to allocate
  
  ImageHandle       - The image handle consume the allocated space.
  
  DeviceHandle      - The device handle consume the allocated space.

Returns:

  EFI_INVALID_PARAMETER       - Invalid parameter.
  
  EFI_NOT_FOUND               - No descriptor contains the desired space.
  
  EFI_SUCCESS                 - Memory space successfully allocated.

--*/
;

EFI_STATUS
CoreFreeMemorySpace (
  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
  IN UINT64                Length
  )
/*++

Routine Description:Routine Description:

  Free a segment of memory space in GCD map.

Arguments:
    
  BaseAddress       - Base address of the segment.
  
  Length            - Length of the segment.
  
Returns:

  EFI_SUCCESS       - Space successfully freed.

--*/
;

EFI_STATUS
CoreRemoveMemorySpace (
  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
  IN UINT64                Length
  )
/*++

Routine Description:Routine Description:

  Remove a segment of memory space in GCD map.

Arguments:
    
  BaseAddress       - Base address of the segment.
  
  Length            - Length of the segment.
  
Returns:

  EFI_SUCCESS       - Successfully a segment of memory space.

--*/
;

EFI_STATUS
CoreGetMemorySpaceDescriptor (
  IN  EFI_PHYSICAL_ADDRESS             BaseAddress,
  OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR  *Descriptor
  )
/*++

Routine Description:

  Search all entries in GCD map which contains specified segment and build it to a descriptor.

Arguments:

  BaseAddress       - Specified start address
  
  Descriptor        - Specified length

Returns:

  EFI_INVALID_PARAMETER       - Invalid parameter
  
  EFI_SUCCESS                 - Successfully get memory space descriptor.

--*/
;

EFI_STATUS
CoreSetMemorySpaceAttributes (
  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
  IN UINT64                Length,
  IN UINT64                Attributes
  )
/*++

Routine Description:

  Set memory space with specified attributes.

Arguments:

  BaseAddress       - Specified start address
  
  Length            - Specified length
  
  Attributes        - Specified attributes

Returns:

  EFI_SUCCESS       - Successfully set attribute of a segment of memory space.

--*/
;

EFI_STATUS
CoreGetMemorySpaceMap (
  OUT UINTN                            *NumberOfDescriptors,
  OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR  **MemorySpaceMap
  )
/*++

Routine Description:

  Transer all entries of GCD memory map into memory descriptors and pass to caller.

Arguments:

  NumberOfDescriptors       - Number of descriptors.
  
  MemorySpaceMap            - Descriptor array

Returns:

  EFI_INVALID_PARAMETER     - Invalid parameter
  
  EFI_OUT_OF_RESOURCES      - No enough buffer to allocate
  
  EFI_SUCCESS               - Successfully get memory space map.

--*/
;

EFI_STATUS
CoreAddIoSpace (
  IN EFI_GCD_IO_TYPE       GcdIoType,
  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
  IN UINT64                Length
  )
/*++

Routine Description:

  Add a segment of IO space to GCD map.

Arguments:
    
  GcdIoType         - IO type of the segment.
  
  BaseAddress       - Base address of the segment.
  
  Length            - Length of the segment.

Returns:

  EFI_SUCCESS       - Merged this segment into GCD map.

--*/
;

EFI_STATUS
CoreAllocateIoSpace (
  IN     EFI_GCD_ALLOCATE_TYPE  GcdAllocateType,
  IN     EFI_GCD_IO_TYPE        GcdIoType,
  IN     UINTN                  Alignment,
  IN     UINT64                 Length,
  IN OUT EFI_PHYSICAL_ADDRESS   *BaseAddress,
  IN     EFI_HANDLE             ImageHandle,
  IN     EFI_HANDLE             DeviceHandle OPTIONAL
  )
/*++

Routine Description:

  Allocate IO space on GCD map.

Arguments:
  
  GcdAllocateType   - The type of allocate operation
  
  GcdIoType         - The desired IO type
  
  Alignment         - Align with 2^Alignment
  
  Length            - Length to allocate
  
  BaseAddress       - Base address to allocate
  
  ImageHandle       - The image handle consume the allocated space.
  
  DeviceHandle      - The device handle consume the allocated space.

Returns:

  EFI_INVALID_PARAMETER       - Invalid parameter.
  
  EFI_NOT_FOUND               - No descriptor contains the desired space.
  
  EFI_SUCCESS                 - IO space successfully allocated.

--*/
;

EFI_STATUS
CoreFreeIoSpace (
  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
  IN UINT64                Length
  )
/*++

Routine Description:Routine Description:

  Free a segment of IO space in GCD map.

Arguments:
    
  BaseAddress       - Base address of the segment.
  
  Length            - Length of the segment.
  
Returns:

  EFI_SUCCESS       - Space successfully freed.

--*/
;

EFI_STATUS
CoreRemoveIoSpace (
  IN EFI_PHYSICAL_ADDRESS  BaseAddress,
  IN UINT64                Length
  )
/*++

Routine Description:Routine Description:

  Remove a segment of IO space in GCD map.

Arguments:
    
  BaseAddress       - Base address of the segment.
  
  Length            - Length of the segment.
  
Returns:

  EFI_SUCCESS       - Successfully removed a segment of IO space.

--*/
;

EFI_STATUS
CoreGetIoSpaceDescriptor (
  IN  EFI_PHYSICAL_ADDRESS         BaseAddress,
  OUT EFI_GCD_IO_SPACE_DESCRIPTOR  *Descriptor
  )
/*++

Routine Description:

  Search all entries in GCD map which contains specified segment and build it to a descriptor.

Arguments:

  BaseAddress       - Specified start address
  
  Descriptor        - Specified length

Returns:

  EFI_INVALID_PARAMETER       - Descriptor is NULL.
  
  EFI_SUCCESS                 - Successfully get the IO space descriptor.

--*/
;

EFI_STATUS
CoreGetIoSpaceMap (
  OUT UINTN                        *NumberOfDescriptors,
  OUT EFI_GCD_IO_SPACE_DESCRIPTOR  **IoSpaceMap
  )
/*++

Routine Description:

  Transer all entries of GCD IO map into IO descriptors and pass to caller.

Arguments:

  NumberOfDescriptors       - Number of descriptors.
  
  IoSpaceMap                - Descriptor array

Returns:

  EFI_INVALID_PARAMETER     - Invalid parameter
  
  EFI_OUT_OF_RESOURCES      - No enough buffer to allocate
  
  EFI_SUCCESS               - Successfully get IO space map.

--*/
;

EFI_DXESERVICE
EFI_STATUS
EFIAPI
CoreDispatcher (
  VOID
  )
/*++

Routine Description:

  This is the main Dispatcher for DXE and it exits when there are no more 
  drivers to run. Drain the mScheduledQueue and load and start a PE
  image for each driver. Search the mDiscoveredList to see if any driver can 
  be placed on the mScheduledQueue. If no drivers are placed on the
  mScheduledQueue exit the function. On exit it is assumed the Bds()
  will be called, and when the Bds() exits the Dispatcher will be called 
  again.

Arguments:

  NONE

Returns:

  EFI_ALREADY_STARTED - The DXE Dispatcher is already running

  EFI_NOT_FOUND       - No DXE Drivers were dispatched

  EFI_SUCCESS         - One or more DXE Drivers were dispatched

--*/
;
EFI_DXESERVICE
EFI_STATUS
EFIAPI
CoreSchedule (
  IN  EFI_HANDLE  FirmwareVolumeHandle,
  IN  EFI_GUID    *DriverName
  )
/*++

Routine Description:

  Check every driver and locate a matching one. If the driver is found, the Unrequested
  state flag is cleared.

Arguments:

  FirmwareVolumeHandle - The handle of the Firmware Volume that contains the firmware 
                         file specified by DriverName.

  DriverName           - The Driver name to put in the Dependent state.

Returns:

  EFI_SUCCESS   - The DriverName was found and it's SOR bit was cleared

  EFI_NOT_FOUND - The DriverName does not exist or it's SOR bit was not set.

--*/
;

EFI_DXESERVICE
EFI_STATUS
EFIAPI
CoreTrust (
  IN  EFI_HANDLE  FirmwareVolumeHandle,
  IN  EFI_GUID    *DriverName
  )
/*++

Routine Description:

  Convert a driver from the Untrused back to the Scheduled state

Arguments:

  FirmwareVolumeHandle - The handle of the Firmware Volume that contains the firmware 
                         file specified by DriverName.

  DriverName           - The Driver name to put in the Scheduled state

Returns:

  EFI_SUCCESS   - The file was found in the untrusted state, and it was promoted 
                  to the trusted state.

  EFI_NOT_FOUND - The file was not found in the untrusted state.

--*/
;

BOOLEAN
CoreGrowBuffer (
  IN OUT EFI_STATUS       *Status,
  IN OUT VOID             **Buffer,
  IN     UINTN            BufferSize
  )
/*++

Routine Description:

    Helper function called as part of the code needed
    to allocate the proper sized buffer for various 
    EFI interfaces.

Arguments:

    Status      - Current status

    Buffer      - Current allocated buffer, or NULL

    BufferSize  - Current buffer size needed
    
Returns:
    
    TRUE - if the buffer was reallocated and the caller 
    should try the API again.

    FALSE - buffer could not be allocated and the caller
    should not try the API again.

--*/
;

EFI_STATUS
EFIAPI
FwVolDriverInit (
  IN EFI_HANDLE                   ImageHandle,
  IN EFI_SYSTEM_TABLE             *SystemTable
  )
/*++

Routine Description:
    This routine is the driver initialization entry point.  It initializes the
    libraries, and registers two notification functions.  These notification
    functions are responsible for building the FV stack dynamically.
    
Arguments:
    ImageHandle   - The image handle.
    SystemTable   - The system table.
    
Returns:
    EFI_SUCCESS   - Function successfully returned.

--*/
;

EFI_STATUS
EFIAPI
InitializeSectionExtraction (
  IN EFI_HANDLE                   ImageHandle,
  IN EFI_SYSTEM_TABLE             *SystemTable
  )
/*++

Routine Description: 
  Entry point of the section extraction code. Initializes an instance of the 
  section extraction interface and installs it on a new handle.

Arguments:  
  ImageHandle   EFI_HANDLE: A handle for the image that is initializing this driver
  SystemTable   EFI_SYSTEM_TABLE: A pointer to the EFI system table        

Returns:  
  EFI_SUCCESS:  Driver initialized successfully
  EFI_OUT_OF_RESOURCES:   Could not allocate needed resources

--*/
;

EFI_STATUS
CoreProcessFirmwareVolume (
  IN  VOID                         *FvHeader,
  IN  UINTN                        Size, 
  OUT EFI_HANDLE                   *FVProtocolHandle
  )
/*++

Routine Description:
    This DXE service routine is used to process a firmware volume. In
    particular, it can be called by BDS to process a single firmware
    volume found in a capsule. 

Arguments:
    FvHeader              - pointer to a firmware volume header
    Size                  - the size of the buffer pointed to by FvHeader
    FVProtocolHandle      - the handle on which a firmware volume protocol
                            was produced for the firmware volume passed in.

Returns:
    EFI_OUT_OF_RESOURCES  - if an FVB could not be produced due to lack of 
                            system resources
    EFI_VOLUME_CORRUPTED  - if the volume was corrupted
    EFI_SUCCESS           - a firmware volume protocol was produced for the
                            firmware volume

--*/
;

//
//Functions used during debug buils
//
DEBUG_CODE (
  VOID
  CoreDisplayMissingArchProtocols (
    VOID
    )
  /*++

  Routine Description:
    Displays Architectural protocols that were not loaded and are required for DXE core to function
    Only used in Debug Builds

  Arguments:
    NONE

  Returns:
    NONE

  --*/;
  
  VOID
  CoreDisplayDiscoveredNotDispatched (
    VOID
    )
  /*++

  Routine Description:

    Traverse the discovered list for any drivers that were discovered but not loaded 
    because the dependency experessions evaluated to false

  Arguments:

    NONE

  Returns:

    NONE 

  --*/;
)
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?