OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
HandleParsingMin.c File Reference
#include <Uefi.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Protocol/LoadedImage.h>
#include "HandleParsingMin.h"

Go to the source code of this file.

Functions

STATIC EFI_STATUS InternalShellInitHandleList (VOID)
 
UINTN EFIAPI InternalConvertHandleToHandleIndex (IN CONST EFI_HANDLE TheHandle)
 
STATIC EFI_STATUS EFIAPI ParseHandleDatabaseByRelationshipWithType (IN CONST EFI_HANDLE DriverBindingHandle OPTIONAL, IN CONST EFI_HANDLE ControllerHandle OPTIONAL, IN UINTN *HandleCount, OUT EFI_HANDLE **HandleBuffer, OUT UINTN **HandleType)
 
EFI_STATUS EFIAPI InternalParseHandleDatabaseByRelationship (IN CONST EFI_HANDLE DriverBindingHandle OPTIONAL, IN CONST EFI_HANDLE ControllerHandle OPTIONAL, IN CONST UINTN Mask, IN UINTN *MatchingHandleCount, OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL)
 

Variables

STATIC HANDLE_INDEX_LIST mHandleList
 

Detailed Description

Provides interface to shell functionality for shell commands and applications.

(C) Copyright 2016 Hewlett Packard Enterprise Development LP
Copyright 2016-2018 Dell Technologies.
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file HandleParsingMin.c.

Function Documentation

◆ InternalConvertHandleToHandleIndex()

UINTN EFIAPI InternalConvertHandleToHandleIndex ( IN CONST EFI_HANDLE TheHandle)

Function to retrieve the human-friendly index of a given handle. If the handle does not have a index one will be automatically assigned. The index value is valid until the termination of the shell application.

Parameters
[in]TheHandleThe handle to retrieve an index for.
Return values
0A memory allocation failed.
Returns
The index of the handle.

Definition at line 89 of file HandleParsingMin.c.

◆ InternalParseHandleDatabaseByRelationship()

EFI_STATUS EFIAPI InternalParseHandleDatabaseByRelationship ( IN CONST EFI_HANDLE DriverBindingHandle OPTIONAL,
IN CONST EFI_HANDLE ControllerHandle OPTIONAL,
IN CONST UINTN Mask,
IN UINTN * MatchingHandleCount,
OUT EFI_HANDLE **MatchingHandleBuffer OPTIONAL )

Gets all the related EFI_HANDLEs based on the single EFI_HANDLE and the mask supplied.

This function will scan all EFI_HANDLES in the UEFI environment's handle database and return all the ones with the specified relationship (Mask) to the specified controller handle.

If both DriverBindingHandle and ControllerHandle are NULL, then ASSERT. If MatchingHandleCount is NULL, then ASSERT.

If MatchingHandleBuffer is not NULL upon a sucessful return the memory must be caller freed.

Parameters
[in]DriverBindingHandleHandle to a object with Driver Binding protocol on it.
[in]ControllerHandleHandle to a device with Device Path protocol on it.
[in]MaskMask of what relationship(s) is desired.
[in]MatchingHandleCountPoitner to UINTN specifying number of HANDLES in MatchingHandleBuffer.
[out]MatchingHandleBufferOn a sucessful return a buffer of MatchingHandleCount EFI_HANDLEs and a terminating NULL EFI_HANDLE.
Return values
EFI_SUCCESSThe operation was sucessful and any related handles are in MatchingHandleBuffer;
EFI_NOT_FOUNDNo matching handles were found.
EFI_INVALID_PARAMETERA parameter was invalid or out of range.

Definition at line 431 of file HandleParsingMin.c.

◆ InternalShellInitHandleList()

STATIC EFI_STATUS InternalShellInitHandleList ( VOID )

Function to initialize the file global mHandleList object for use in vonverting handles to index and index to handle.

Return values
EFI_SUCCESSThe operation was successful.

Definition at line 36 of file HandleParsingMin.c.

◆ ParseHandleDatabaseByRelationshipWithType()

STATIC EFI_STATUS EFIAPI ParseHandleDatabaseByRelationshipWithType ( IN CONST EFI_HANDLE DriverBindingHandle OPTIONAL,
IN CONST EFI_HANDLE ControllerHandle OPTIONAL,
IN UINTN * HandleCount,
OUT EFI_HANDLE ** HandleBuffer,
OUT UINTN ** HandleType )

Gets all the related EFI_HANDLEs based on the mask supplied.

This function scans all EFI_HANDLES in the UEFI environment's handle database and returns the ones with the specified relationship (Mask) to the specified controller handle.

If both DriverBindingHandle and ControllerHandle are NULL, then ASSERT. If MatchingHandleCount is NULL, then ASSERT.

If MatchingHandleBuffer is not NULL upon a successful return the memory must be caller freed.

Parameters
[in]DriverBindingHandleThe handle with Driver Binding protocol on it.
[in]ControllerHandleThe handle with Device Path protocol on it.
[in]MatchingHandleCountThe pointer to UINTN that specifies the number of HANDLES in MatchingHandleBuffer.
[out]MatchingHandleBufferOn a successful return, a buffer of MatchingHandleCount EFI_HANDLEs with a terminating NULL EFI_HANDLE.
[out]HandleTypeAn array of type information.
Return values
EFI_SUCCESSThe operation was successful, and any related handles are in MatchingHandleBuffer.
EFI_NOT_FOUNDNo matching handles were found.
EFI_INVALID_PARAMETERA parameter was invalid or out of range.

Definition at line 180 of file HandleParsingMin.c.

Variable Documentation

◆ mHandleList

STATIC HANDLE_INDEX_LIST mHandleList
Initial value:
= {
{
{ NULL, NULL }, 0, 0
}, 0
}

Definition at line 22 of file HandleParsingMin.c.