dxecore.h

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

H
2,531
字号

Routine Description:

  Return the first Protocol Interface that matches the Protocol GUID. If
  Registration is pasased in return a Protocol Instance that was just add
  to the system. If Retistration is NULL return the first Protocol Interface
  you find.

Arguments:

  Protocol     - The protocol to search for
  
  Registration - Optional Registration Key returned from RegisterProtocolNotify() 

  Interface    - Return the Protocol interface (instance).

Returns:

  EFI_SUCCESS                 - If a valid Interface is returned
  
  EFI_INVALID_PARAMETER       - Invalid parameter
  
  EFI_NOT_FOUND               - Protocol interface not found

--*/
;

UINT64
CoreGetHandleDatabaseKey (
  VOID
  )
/*++

Routine Description:

  return handle database key.

Arguments:

  None
  
Returns:
  
  Handle database key.
  
--*/
;

VOID
CoreConnectHandlesByKey (
  UINT64  Key
  )
/*++

Routine Description:

  Go connect any handles that were created or modified while a image executed.

Arguments:

  Key  -  The Key to show that the handle has been created/modified

Returns:
  
  None
--*/
;

EFI_BOOTSERVICE11
EFI_STATUS 
EFIAPI
CoreConnectController (
  IN  EFI_HANDLE                ControllerHandle,
  IN  EFI_HANDLE                *DriverImageHandle    OPTIONAL,
  IN  EFI_DEVICE_PATH_PROTOCOL  *RemainingDevicePath  OPTIONAL,
  IN  BOOLEAN                   Recursive
  )
/*++

Routine Description:

  Connects one or more drivers to a controller.

Arguments:

  ControllerHandle            - Handle of the controller to be connected.

  DriverImageHandle           - DriverImageHandle A pointer to an ordered list of driver image handles.

  RemainingDevicePath         - RemainingDevicePath A pointer to the device path that specifies a child of the
                                controller specified by ControllerHandle.
    
  Recursive -                 - Whether the function would be called recursively or not.

Returns:

  Status code.

--*/
;

EFI_BOOTSERVICE11
EFI_STATUS 
EFIAPI
CoreDisconnectController (
  IN EFI_HANDLE  ControllerHandle,
  IN EFI_HANDLE  DriverImageHandle  OPTIONAL,
  IN EFI_HANDLE  ChildHandle        OPTIONAL
  )
/*++

Routine Description:

  Disonnects a controller from a driver

Arguments:

  ControllerHandle  - ControllerHandle The handle of the controller from which driver(s) 
                        are to be disconnected.
  DriverImageHandle - DriverImageHandle The driver to disconnect from ControllerHandle.
  ChildHandle       - ChildHandle The handle of the child to destroy.

Returns:

  EFI_SUCCESS           -  One or more drivers were disconnected from the controller.
  EFI_SUCCESS           -  On entry, no drivers are managing ControllerHandle.
  EFI_SUCCESS           -  DriverImageHandle is not NULL, and on entry DriverImageHandle is not managing ControllerHandle.
  EFI_INVALID_PARAMETER -  ControllerHandle is not a valid EFI_HANDLE.
  EFI_INVALID_PARAMETER -  DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.
  EFI_INVALID_PARAMETER -  ChildHandle is not NULL, and it is not a valid EFI_HANDLE.
  EFI_OUT_OF_RESOURCES  -  There are not enough resources available to disconnect any drivers from ControllerHandle.
  EFI_DEVICE_ERROR      -  The controller could not be disconnected because of a device error.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreAllocatePages (
  IN      EFI_ALLOCATE_TYPE       Type,
  IN      EFI_MEMORY_TYPE         MemoryType,
  IN      UINTN                   NumberOfPages,
  IN OUT  EFI_PHYSICAL_ADDRESS    *Memory
  )
/*++

Routine Description:

  Allocates pages from the memory map.

Arguments:

  Type          - The type of allocation to perform

  MemoryType    - The type of memory to turn the allocated pages into

  NumberOfPages - The number of pages to allocate

  Memory        - A pointer to receive the base allocated memory address

Returns:

  Status. On success, Memory is filled in with the base address allocated
  
  EFI_INVALID_PARAMETER     - Parameters violate checking rules defined in spec.
  
  EFI_NOT_FOUND             - Could not allocate pages match the requirement.
  
  EFI_OUT_OF_RESOURCES      - No enough pages to allocate.
  
  EFI_SUCCESS               - Pages successfully allocated.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS 
EFIAPI
CoreFreePages (
  IN EFI_PHYSICAL_ADDRESS   Memory,
  IN UINTN                  NumberOfPages
  )
/*++

Routine Description:

  Frees previous allocated pages.

Arguments:

  Memory        - Base address of memory being freed

  NumberOfPages - The number of pages to free

Returns:

  EFI_NOT_FOUND       - Could not find the entry that covers the range
  
  EFI_INVALID_PARAMETER   - Address not aligned
  
  EFI_SUCCESS         -Pages successfully freed.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreGetMemoryMap (
  IN OUT UINTN                       *MemoryMapSize,
  IN OUT EFI_MEMORY_DESCRIPTOR       *Desc,
  OUT    UINTN                       *MapKey,
  OUT    UINTN                       *DescriptorSize,
  OUT    UINT32                      *DescriptorVersion
  )
/*++

Routine Description:

  Returns the current memory map.

Arguments:

  MemoryMapSize     - On input the buffer size of MemoryMap allocated by caller
                      On output the required buffer size to contain the memory map 
                      
  Desc              - The buffer to return the current memory map

  MapKey            - The address to return the current map key

  DescriptorSize    - The size in bytes for an individual EFI_MEMORY_DESCRIPTOR

  DescriptorVersion - The version number associated with the EFI_MEMORY_DESCRIPTOR

Returns:

  EFI_SUCCESS           The current memory map was returned successfully

  EFI_BUFFER_TOO_SMALL  The MemoryMap buffer was too small

  EFI_INVALID_PARAMETER One of the parameters has an invalid value

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreAllocatePool (
  IN   EFI_MEMORY_TYPE  PoolType,
  IN   UINTN            Size,
  OUT  VOID             **Buffer
  )
/*++

Routine Description:

  Allocate pool of a particular type.

Arguments:

  PoolType    - Type of pool to allocate

  Size        - The amount of pool to allocate

  Buffer      - The address to return a pointer to the allocated pool

Returns:

  EFI_INVALID_PARAMETER     - PoolType not valid
  
  EFI_OUT_OF_RESOURCES      - Size exceeds max pool size or allocation failed.  
  
  EFI_SUCCESS               - Pool successfully allocated.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreFreePool (
  IN VOID      *Buffer
  )
/*++

Routine Description:

  Frees pool.

Arguments:

  Buffer      - The allocated pool entry to free

Returns:

  EFI_INVALID_PARAMETER   - Buffer is not a valid value.
  
  EFI_SUCCESS             - Pool successfully freed.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreLoadImage (
  IN  BOOLEAN                    BootPolicy,
  IN  EFI_HANDLE                 ParentImageHandle,
  IN  EFI_DEVICE_PATH_PROTOCOL   *FilePath,
  IN  VOID                       *SourceBuffer   OPTIONAL,
  IN  UINTN                      SourceSize,
  OUT EFI_HANDLE                 *ImageHandle
  )
/*++

Routine Description:

  Loads an EFI image into memory and returns a handle to the image.

Arguments:

  BootPolicy          - If TRUE, indicates that the request originates from the boot manager,
                        and that the boot manager is attempting to load FilePath as a boot selection.
  ParentImageHandle   - The caller's image handle.
  FilePath            - The specific file path from which the image is loaded.
  SourceBuffer        - If not NULL, a pointer to the memory location containing a copy of 
                        the image to be loaded.
  SourceSize          - The size in bytes of SourceBuffer.
  ImageHandle         - Pointer to the returned image handle that is created when the image 
                        is successfully loaded.

Returns:

  EFI_SUCCESS            - The image was loaded into memory.
  EFI_NOT_FOUND          - The FilePath was not found.
  EFI_INVALID_PARAMETER  - One of the parameters has an invalid value.
  EFI_UNSUPPORTED        - The image type is not supported, or the device path cannot be 
                           parsed to locate the proper protocol for loading the file.
  EFI_OUT_OF_RESOURCES   - Image was not loaded due to insufficient resources.
--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreUnloadImage (
  IN EFI_HANDLE  ImageHandle
  )
/*++

Routine Description:

  Unload the specified image.

Arguments:

  ImageHandle       - The specified image handle.

Returns:

  EFI_INVALID_PARAMETER       - Image handle is NULL.
  
  EFI_UNSUPPORTED             - Attempt to unload an unsupported image.
  
  EFI_SUCCESS                 - Image successfully unloaded.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreStartImage (
  IN  EFI_HANDLE  ImageHandle,
  OUT UINTN       *ExitDataSize,
  OUT CHAR16      **ExitData  OPTIONAL
  )
/*++

Routine Description:

  Transfer control to a loaded image's entry point.

Arguments:

  ImageHandle     - Handle of image to be started.
  
  ExitDataSize    - Pointer of the size to ExitData
  
  ExitData        - Pointer to a pointer to a data buffer that includes a Null-terminated
                    Unicode string, optionally followed by additional binary data. The string
                    is a description that the caller may use to further indicate the reason for
                    the image’s exit.

Returns:

  EFI_INVALID_PARAMETER     - Invalid parameter
  
  EFI_OUT_OF_RESOURCES       - No enough buffer to allocate
  
  EFI_SUCCESS               - Successfully transfer control to the image's entry point.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreExit (
  IN EFI_HANDLE  ImageHandle,
  IN EFI_STATUS  Status,
  IN UINTN       ExitDataSize,
  IN CHAR16      *ExitData  OPTIONAL
  )
/*++

Routine Description:

  Terminates the currently loaded EFI image and returns control to boot services.

Arguments:

  ImageHandle       - Handle that identifies the image. This parameter is passed to the image 
                      on entry.
  Status            - The image’s exit code.
  ExitDataSize      - The size, in bytes, of ExitData. Ignored if ExitStatus is
                      EFI_SUCCESS.
  ExitData          - Pointer to a data buffer that includes a Null-terminated Unicode string,
                      optionally followed by additional binary data. The string is a 
                      description that the caller may use to further indicate the reason for
                      the image’s exit.

Returns:

  EFI_INVALID_PARAMETER     - Image handle is NULL or it is not current image.
  
  EFI_SUCCESS               - Successfully terminates the currently loaded EFI image.
  
  EFI_ACCESS_DENIED         - Should never reach there.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreCreateEvent (
  IN  UINT32               Type,
  IN  EFI_TPL              NotifyTpl,
  IN  EFI_EVENT_NOTIFY     NotifyFunction,
  IN  VOID                 *NotifyContext,
  OUT EFI_EVENT            *pEvent
  )
/*++

Routine Description:

  Creates a general-purpose event structure

Arguments:

  Type                - The type of event to create and its mode and attributes
  NotifyTpl           - The task priority level of event notifications
  NotifyFunction      - Pointer to the event抯 notification function
  NotifyContext       - Pointer to the notification function抯 context; corresponds to
                        parameter "Context" in the notification function
  pEvent              - Pointer to the newly created event if the call succeeds; undefined otherwise

Returns:

  EFI_SUCCESS           - The event structure was created
  EFI_INVALID_PARAMETER - One of the parameters has an invalid value
  EFI_OUT_OF_RESOURCES  - The event could not be allocated

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreCreateEventEx (
  IN UINT32                   Type,
  IN EFI_TPL                  NotifyTpl,
  IN EFI_EVENT_NOTIFY         NotifyFunction,
  IN VOID                     *NotifyContext,
  IN CONST EFI_GUID           *EventGroup,    OPTIONAL
  OUT EFI_EVENT               *Event
  )
/*++

Routine Description:
  Creates a general-purpose event structure

Arguments:
  Type                - The type of event to create and its mode and attributes
  NotifyTpl           - The task priority level of event notifications
  NotifyFunction      - Pointer to the events notification function
  NotifyContext       - Pointer to the notification functions context; corresponds to
                        parameter "Context" in the notification function
  EventGrout          - GUID for EventGroup if NULL act the same as gBS->CreateEvent().
  Event               - Pointer to the newly created event if the call succeeds; undefined otherwise

Returns:
  EFI_SUCCESS           - The event structure was created
  EFI_INVALID_PARAMETER - One of the parameters has an invalid value
  EFI_OUT_OF_RESOURCES  - The event could not be allocated

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreSetTimer (
  IN EFI_EVENT            Event,
  IN EFI_TIMER_DELAY      Type,
  IN UINT64               TriggerTime
  )
/*++

Routine Description:

  Sets the type of timer and the trigger time for a timer event.

Arguments:

  UserEvent   - The timer event that is to be signaled at the specified time
  Type        - The type of time that is specified in TriggerTime
  TriggerTime - The number of 100ns units until the timer expires
  
Returns:

  EFI_SUCCESS           - The event has been set to be signaled at the requested time
  EFI_INVALID_PARAMETER - Event or Type is not valid

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreSignalEvent (
  IN EFI_EVENT            Event
  )
/*++

Routine Description:

  Signals the event.  Queues the event to be notified if needed
    
Arguments:

  Event - The event to signal
    
Returns:

  EFI_INVALID_PARAMETER - Parameters are not valid.
  
  EFI_SUCCESS - The event was signaled.

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreWaitForEvent (
  IN  UINTN        NumberOfEvents,
  IN  EFI_EVENT    *UserEvents,
  OUT UINTN        *UserIndex
  )
/*++

Routine Description:

  Stops execution until an event is signaled.
    
Arguments:

  NumberOfEvents  - The number of events in the UserEvents array
  UserEvents      - An array of EFI_EVENT
  UserIndex       - Pointer to the index of the event which satisfied the wait condition
    
Returns:

  EFI_SUCCESS           - The event indicated by Index was signaled.
  EFI_INVALID_PARAMETER - The event indicated by Index has a notification function or 
                          Event was not a valid type
  EFI_UNSUPPORTED       - The current TPL is not TPL_APPLICATION

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreCloseEvent (
  IN EFI_EVENT            Event
  )
/*++

Routine Description:

  Closes an event and frees the event structure.
    
Arguments:

  UserEvent - Event to close
    
Returns:

  EFI_INVALID_PARAMETER - Parameters are not valid.
  
  EFI_SUCCESS - The event has been closed

--*/
;

EFI_BOOTSERVICE
EFI_STATUS
EFIAPI
CoreCheckEvent (
  IN EFI_EVENT            Event
  )
/*++

Routine Description:

  Check the status of an event
    
Arguments:

⌨️ 快捷键说明

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