TianoCore EDK2 master
Loading...
Searching...
No Matches
Handle.h File Reference

Go to the source code of this file.

Data Structures

struct  IHANDLE
 
struct  PROTOCOL_ENTRY
 
struct  PROTOCOL_INTERFACE
 
struct  OPEN_PROTOCOL_DATA
 
struct  PROTOCOL_NOTIFY
 

Macros

#define EFI_HANDLE_SIGNATURE   SIGNATURE_32('h','n','d','l')
 
#define ASSERT_IS_HANDLE(a)   ASSERT((a)->Signature == EFI_HANDLE_SIGNATURE)
 
#define PROTOCOL_ENTRY_SIGNATURE   SIGNATURE_32('p','r','t','e')
 
#define PROTOCOL_INTERFACE_SIGNATURE   SIGNATURE_32('p','i','f','c')
 
#define OPEN_PROTOCOL_DATA_SIGNATURE   SIGNATURE_32('p','o','d','l')
 
#define PROTOCOL_NOTIFY_SIGNATURE   SIGNATURE_32('p','r','t','n')
 

Functions

PROTOCOL_ENTRYCoreFindProtocolEntry (IN EFI_GUID *Protocol, IN BOOLEAN Create)
 
VOID CoreNotifyProtocolEntry (IN PROTOCOL_ENTRY *ProtEntry)
 
PROTOCOL_INTERFACECoreFindProtocolInterface (IN IHANDLE *Handle, IN EFI_GUID *Protocol, IN VOID *Interface)
 
PROTOCOL_INTERFACECoreRemoveInterfaceFromProtocol (IN IHANDLE *Handle, IN EFI_GUID *Protocol, IN VOID *Interface)
 
EFI_STATUS CoreConnectSingleController (IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE *ContextDriverImageHandles OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
 
EFI_STATUS CoreDisconnectControllersUsingProtocolInterface (IN EFI_HANDLE UserHandle, IN PROTOCOL_INTERFACE *Prot)
 
VOID CoreAcquireProtocolLock (VOID)
 
VOID CoreReleaseProtocolLock (VOID)
 
EFI_STATUS CoreValidateHandle (IN EFI_HANDLE UserHandle)
 

Variables

EFI_LOCK gProtocolDatabaseLock
 
LIST_ENTRY gHandleList
 
UINT64 gHandleDatabaseKey
 

Detailed Description

Support functions for managing protocol.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Handle.h.

Macro Definition Documentation

◆ ASSERT_IS_HANDLE

#define ASSERT_IS_HANDLE (   a)    ASSERT((a)->Signature == EFI_HANDLE_SIGNATURE)

Definition at line 28 of file Handle.h.

◆ EFI_HANDLE_SIGNATURE

#define EFI_HANDLE_SIGNATURE   SIGNATURE_32('h','n','d','l')

Definition at line 12 of file Handle.h.

◆ OPEN_PROTOCOL_DATA_SIGNATURE

#define OPEN_PROTOCOL_DATA_SIGNATURE   SIGNATURE_32('p','o','d','l')

Definition at line 72 of file Handle.h.

◆ PROTOCOL_ENTRY_SIGNATURE

#define PROTOCOL_ENTRY_SIGNATURE   SIGNATURE_32('p','r','t','e')

Definition at line 30 of file Handle.h.

◆ PROTOCOL_INTERFACE_SIGNATURE

#define PROTOCOL_INTERFACE_SIGNATURE   SIGNATURE_32('p','i','f','c')

Definition at line 49 of file Handle.h.

◆ PROTOCOL_NOTIFY_SIGNATURE

#define PROTOCOL_NOTIFY_SIGNATURE   SIGNATURE_32('p','r','t','n')

Definition at line 85 of file Handle.h.

Function Documentation

◆ CoreAcquireProtocolLock()

VOID CoreAcquireProtocolLock ( VOID  )

Acquire lock on gProtocolDatabaseLock.

Definition at line 29 of file Handle.c.

◆ CoreConnectSingleController()

EFI_STATUS CoreConnectSingleController ( IN EFI_HANDLE  ControllerHandle,
IN EFI_HANDLE *ContextDriverImageHandles  OPTIONAL,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath  OPTIONAL 
)

Connects a controller to a driver.

Parameters
ControllerHandleHandle of the controller to be connected.
ContextDriverImageHandlesDriverImageHandle A pointer to an ordered list of driver image handles.
RemainingDevicePathRemainingDevicePath A pointer to the device path that specifies a child of the controller specified by ControllerHandle.
Return values
EFI_SUCCESSOne or more drivers were connected to ControllerHandle.
EFI_OUT_OF_RESOURCESNo enough system resources to complete the request.
EFI_NOT_FOUNDNo drivers were connected to ControllerHandle.

Definition at line 393 of file DriverSupport.c.

◆ CoreDisconnectControllersUsingProtocolInterface()

EFI_STATUS CoreDisconnectControllersUsingProtocolInterface ( IN EFI_HANDLE  UserHandle,
IN PROTOCOL_INTERFACE Prot 
)

Attempts to disconnect all drivers that are using the protocol interface being queried. If failed, reconnect all drivers disconnected. Note: This function doesn't do parameters checking, it's caller's responsibility to pass in valid parameters.

Parameters
UserHandleThe handle on which the protocol is installed
ProtThe protocol to disconnect drivers from
Return values
EFI_SUCCESSDrivers using the protocol interface are all disconnected
EFI_ACCESS_DENIEDFailed to disconnect one or all of the drivers

Definition at line 727 of file Handle.c.

◆ CoreFindProtocolEntry()

PROTOCOL_ENTRY * CoreFindProtocolEntry ( IN EFI_GUID Protocol,
IN BOOLEAN  Create 
)

Finds the protocol entry for the requested protocol. The gProtocolDatabaseLock must be owned

Parameters
ProtocolThe ID of the protocol
CreateCreate a new entry if not found
Returns
Protocol entry

Definition at line 144 of file Handle.c.

◆ CoreFindProtocolInterface()

PROTOCOL_INTERFACE * CoreFindProtocolInterface ( IN IHANDLE Handle,
IN EFI_GUID Protocol,
IN VOID *  Interface 
)

Finds the protocol instance for the requested handle and protocol. Note: This function doesn't do parameters checking, it's caller's responsibility to pass in valid parameters.

Parameters
HandleThe handle to search the protocol on
ProtocolGUID of the protocol
InterfaceThe interface for the protocol being searched
Returns
Protocol instance (NULL: Not found)

Definition at line 214 of file Handle.c.

◆ CoreNotifyProtocolEntry()

VOID CoreNotifyProtocolEntry ( IN PROTOCOL_ENTRY ProtEntry)

Signal event for every protocol in protocol entry.

Parameters
ProtEntryProtocol entry

Definition at line 21 of file Notify.c.

◆ CoreReleaseProtocolLock()

VOID CoreReleaseProtocolLock ( VOID  )

Release lock on gProtocolDatabaseLock.

Definition at line 41 of file Handle.c.

◆ CoreRemoveInterfaceFromProtocol()

PROTOCOL_INTERFACE * CoreRemoveInterfaceFromProtocol ( IN IHANDLE Handle,
IN EFI_GUID Protocol,
IN VOID *  Interface 
)

Removes Protocol from the protocol list (but not the handle list).

Parameters
HandleThe handle to remove protocol on.
ProtocolGUID of the protocol to be moved
InterfaceThe interface of the protocol
Returns
Protocol Entry

Definition at line 47 of file Notify.c.

◆ CoreValidateHandle()

EFI_STATUS CoreValidateHandle ( IN EFI_HANDLE  UserHandle)

Check whether a handle is a valid EFI_HANDLE The gProtocolDatabaseLock must be owned

Parameters
UserHandleThe handle to check
Return values
EFI_INVALID_PARAMETERThe handle is NULL or not a valid EFI_HANDLE.
EFI_SUCCESSThe handle is valid EFI_HANDLE.

Definition at line 113 of file Handle.c.

Variable Documentation

◆ gHandleDatabaseKey

UINT64 gHandleDatabaseKey
extern

Definition at line 21 of file Handle.c.

◆ gHandleList

LIST_ENTRY gHandleList
extern

Definition at line 19 of file Handle.c.

◆ gProtocolDatabaseLock

EFI_LOCK gProtocolDatabaseLock
extern

Definition at line 20 of file Handle.c.