TianoCore EDK2 master
Loading...
Searching...
No Matches
Handle.c File Reference
#include "StandaloneMmCore.h"

Go to the source code of this file.

Functions

EFI_STATUS MmValidateHandle (IN EFI_HANDLE UserHandle)
 
PROTOCOL_ENTRYMmFindProtocolEntry (IN EFI_GUID *Protocol, IN BOOLEAN Create)
 
PROTOCOL_INTERFACEMmFindProtocolInterface (IN IHANDLE *Handle, IN EFI_GUID *Protocol, IN VOID *Interface)
 
EFI_STATUS EFIAPI MmInstallProtocolInterface (IN OUT EFI_HANDLE *UserHandle, IN EFI_GUID *Protocol, IN EFI_INTERFACE_TYPE InterfaceType, IN VOID *Interface)
 
EFI_STATUS MmInstallProtocolInterfaceNotify (IN OUT EFI_HANDLE *UserHandle, IN EFI_GUID *Protocol, IN EFI_INTERFACE_TYPE InterfaceType, IN VOID *Interface, IN BOOLEAN Notify)
 
EFI_STATUS EFIAPI MmUninstallProtocolInterface (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, IN VOID *Interface)
 
PROTOCOL_INTERFACEMmGetProtocolInterface (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol)
 
EFI_STATUS EFIAPI MmHandleProtocol (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, OUT VOID **Interface)
 

Variables

LIST_ENTRY mProtocolDatabase = INITIALIZE_LIST_HEAD_VARIABLE (mProtocolDatabase)
 
LIST_ENTRY gHandleList = INITIALIZE_LIST_HEAD_VARIABLE (gHandleList)
 

Detailed Description

SMM handle & protocol handling.

Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Handle.c.

Function Documentation

◆ MmFindProtocolEntry()

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

Finds the protocol entry for the requested protocol.

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

Definition at line 57 of file Handle.c.

◆ MmFindProtocolInterface()

PROTOCOL_INTERFACE * MmFindProtocolInterface ( 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 123 of file Handle.c.

◆ MmGetProtocolInterface()

PROTOCOL_INTERFACE * MmGetProtocolInterface ( IN EFI_HANDLE  UserHandle,
IN EFI_GUID Protocol 
)

Locate a certain GUID protocol interface in a Handle's protocols.

Parameters
UserHandleThe handle to obtain the protocol interface on
ProtocolThe GUID of the protocol
Returns
The requested protocol interface for the handle

Definition at line 440 of file Handle.c.

◆ MmHandleProtocol()

EFI_STATUS EFIAPI MmHandleProtocol ( IN EFI_HANDLE  UserHandle,
IN EFI_GUID Protocol,
OUT VOID **  Interface 
)

Queries a handle to determine if it supports a specified protocol.

Parameters
UserHandleThe handle being queried.
ProtocolThe published unique identifier of the protocol.
InterfaceSupplies the address where a pointer to the corresponding Protocol Interface is returned.
Return values
EFI_SUCCESSThe interface information for the specified protocol was returned.
EFI_UNSUPPORTEDThe device does not support the specified protocol.
EFI_INVALID_PARAMETERHandle is not a valid EFI_HANDLE..
EFI_INVALID_PARAMETERProtocol is NULL.
EFI_INVALID_PARAMETERInterface is NULL.

Definition at line 489 of file Handle.c.

◆ MmInstallProtocolInterface()

EFI_STATUS EFIAPI MmInstallProtocolInterface ( IN OUT EFI_HANDLE UserHandle,
IN EFI_GUID Protocol,
IN EFI_INTERFACE_TYPE  InterfaceType,
IN VOID *  Interface 
)

Wrapper function to MmInstallProtocolInterfaceNotify. This is the public API which Calls the private one which contains a BOOLEAN parameter for notifications

Parameters
UserHandleThe handle to install the protocol handler on, or NULL if a new handle is to be allocated
ProtocolThe protocol to add to the handle
InterfaceTypeIndicates whether Interface is supplied in native form.
InterfaceThe interface for the protocol being added
Returns
Status code

Definition at line 175 of file Handle.c.

◆ MmInstallProtocolInterfaceNotify()

EFI_STATUS MmInstallProtocolInterfaceNotify ( IN OUT EFI_HANDLE UserHandle,
IN EFI_GUID Protocol,
IN EFI_INTERFACE_TYPE  InterfaceType,
IN VOID *  Interface,
IN BOOLEAN  Notify 
)

Installs a protocol interface into the boot services environment.

Parameters
UserHandleThe handle to install the protocol handler on, or NULL if a new handle is to be allocated
ProtocolThe protocol to add to the handle
InterfaceTypeIndicates whether Interface is supplied in native form.
InterfaceThe interface for the protocol being added
Notifyindicates whether notify the notification list for this protocol
Return values
EFI_INVALID_PARAMETERInvalid parameter
EFI_OUT_OF_RESOURCESNo enough buffer to allocate
EFI_SUCCESSProtocol interface successfully installed

Definition at line 209 of file Handle.c.

◆ MmUninstallProtocolInterface()

EFI_STATUS EFIAPI MmUninstallProtocolInterface ( IN EFI_HANDLE  UserHandle,
IN EFI_GUID Protocol,
IN VOID *  Interface 
)

Uninstalls all instances of a protocol:interfacer from a handle. If the last protocol interface is remove from the handle, the handle is freed.

Parameters
UserHandleThe handle to remove the protocol handler from
ProtocolThe protocol, of protocol:interface, to remove
InterfaceThe interface, of protocol:interface, to remove
Return values
EFI_INVALID_PARAMETERProtocol is NULL.
EFI_SUCCESSProtocol interface successfully uninstalled.

Definition at line 364 of file Handle.c.

◆ MmValidateHandle()

EFI_STATUS MmValidateHandle ( IN EFI_HANDLE  UserHandle)

Check whether a handle is a valid EFI_HANDLE

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 29 of file Handle.c.

Variable Documentation

◆ gHandleList

LIST_ENTRY gHandleList = INITIALIZE_LIST_HEAD_VARIABLE (gHandleList)

Definition at line 17 of file Handle.c.

◆ mProtocolDatabase

LIST_ENTRY mProtocolDatabase = INITIALIZE_LIST_HEAD_VARIABLE (mProtocolDatabase)

Definition at line 16 of file Handle.c.