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

Go to the source code of this file.

Data Structures

struct  MM_CORE_MMI_HANDLERS
 
struct  EFI_MM_DRIVER_ENTRY
 
struct  IHANDLE
 
struct  PROTOCOL_ENTRY
 
struct  PROTOCOL_INTERFACE
 
struct  PROTOCOL_NOTIFY
 

Macros

#define EFI_MM_DRIVER_ENTRY_SIGNATURE   SIGNATURE_32('s', 'd','r','v')
 
#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 PROTOCOL_NOTIFY_SIGNATURE   SIGNATURE_32('p','r','t','n')
 
#define NEXT_MEMORY_DESCRIPTOR(MemoryDescriptor, Size)    ((EFI_MEMORY_DESCRIPTOR *)((UINT8 *)(MemoryDescriptor) + (Size)))
 

Functions

VOID MmInitializeMemoryServices (IN UINTN MmramRangeCount, IN EFI_MMRAM_DESCRIPTOR *MmramRanges)
 
EFI_STATUS EFIAPI MmInstallConfigurationTable (IN CONST EFI_MM_SYSTEM_TABLE *SystemTable, IN CONST EFI_GUID *Guid, IN VOID *Table, IN UINTN TableSize)
 
EFI_STATUS EFIAPI MmInstallProtocolInterface (IN OUT EFI_HANDLE *UserHandle, IN EFI_GUID *Protocol, IN EFI_INTERFACE_TYPE InterfaceType, IN VOID *Interface)
 
EFI_STATUS EFIAPI MmAllocatePages (IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN NumberOfPages, OUT EFI_PHYSICAL_ADDRESS *Memory)
 
EFI_STATUS EFIAPI MmInternalAllocatePages (IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN NumberOfPages, OUT EFI_PHYSICAL_ADDRESS *Memory)
 
EFI_STATUS EFIAPI MmFreePages (IN EFI_PHYSICAL_ADDRESS Memory, IN UINTN NumberOfPages)
 
EFI_STATUS EFIAPI MmInternalFreePages (IN EFI_PHYSICAL_ADDRESS Memory, IN UINTN NumberOfPages)
 
EFI_STATUS EFIAPI MmAllocatePool (IN EFI_MEMORY_TYPE PoolType, IN UINTN Size, OUT VOID **Buffer)
 
EFI_STATUS EFIAPI MmInternalAllocatePool (IN EFI_MEMORY_TYPE PoolType, IN UINTN Size, OUT VOID **Buffer)
 
EFI_STATUS EFIAPI MmFreePool (IN VOID *Buffer)
 
EFI_STATUS EFIAPI MmInternalFreePool (IN VOID *Buffer)
 
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)
 
EFI_STATUS EFIAPI MmHandleProtocol (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, OUT VOID **Interface)
 
EFI_STATUS EFIAPI MmRegisterProtocolNotify (IN CONST EFI_GUID *Protocol, IN EFI_MM_NOTIFY_FN Function, OUT VOID **Registration)
 
EFI_STATUS EFIAPI MmLocateHandle (IN EFI_LOCATE_SEARCH_TYPE SearchType, IN EFI_GUID *Protocol OPTIONAL, IN VOID *SearchKey OPTIONAL, IN OUT UINTN *BufferSize, OUT EFI_HANDLE *Buffer)
 
EFI_STATUS EFIAPI MmLocateHandleBuffer (IN EFI_LOCATE_SEARCH_TYPE SearchType, IN EFI_GUID *Protocol OPTIONAL, IN VOID *SearchKey OPTIONAL, IN OUT UINTN *NumberHandles, OUT EFI_HANDLE **Buffer)
 
EFI_STATUS EFIAPI MmLocateProtocol (IN EFI_GUID *Protocol, IN VOID *Registration OPTIONAL, OUT VOID **Interface)
 
EFI_STATUS EFIAPI MmiManage (IN CONST EFI_GUID *HandlerType, IN CONST VOID *Context OPTIONAL, IN OUT VOID *CommBuffer OPTIONAL, IN OUT UINTN *CommBufferSize OPTIONAL)
 
EFI_STATUS EFIAPI MmiHandlerRegister (IN EFI_MM_HANDLER_ENTRY_POINT Handler, IN CONST EFI_GUID *HandlerType OPTIONAL, OUT EFI_HANDLE *DispatchHandle)
 
EFI_STATUS EFIAPI MmiHandlerUnRegister (IN EFI_HANDLE DispatchHandle)
 
EFI_STATUS EFIAPI MmDriverDispatchHandler (IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context OPTIONAL, IN OUT VOID *CommBuffer OPTIONAL, IN OUT UINTN *CommBufferSize OPTIONAL)
 
EFI_STATUS EFIAPI MmExitBootServiceHandler (IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context OPTIONAL, IN OUT VOID *CommBuffer OPTIONAL, IN OUT UINTN *CommBufferSize OPTIONAL)
 
EFI_STATUS EFIAPI MmReadyToBootHandler (IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context OPTIONAL, IN OUT VOID *CommBuffer OPTIONAL, IN OUT UINTN *CommBufferSize OPTIONAL)
 
EFI_STATUS EFIAPI MmReadyToLockHandler (IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context OPTIONAL, IN OUT VOID *CommBuffer OPTIONAL, IN OUT UINTN *CommBufferSize OPTIONAL)
 
EFI_STATUS EFIAPI MmEndOfPeiHandler (IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context OPTIONAL, IN OUT VOID *CommBuffer OPTIONAL, IN OUT UINTN *CommBufferSize OPTIONAL)
 
EFI_STATUS EFIAPI MmEndOfDxeHandler (IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context OPTIONAL, IN OUT VOID *CommBuffer OPTIONAL, IN OUT UINTN *CommBufferSize OPTIONAL)
 
EFI_STATUS EFIAPI MmEfiNotAvailableYetArg5 (UINTN Arg1, UINTN Arg2, UINTN Arg3, UINTN Arg4, UINTN Arg5)
 
VOID MmDisplayDiscoveredNotDispatched (VOID)
 
VOID MmAddMemoryRegion (IN EFI_PHYSICAL_ADDRESS MemBase, IN UINT64 MemLength, IN EFI_MEMORY_TYPE Type, IN UINT64 Attributes)
 
PROTOCOL_ENTRYMmFindProtocolEntry (IN EFI_GUID *Protocol, IN BOOLEAN Create)
 
VOID MmNotifyProtocol (IN PROTOCOL_INTERFACE *Prot)
 
PROTOCOL_INTERFACEMmFindProtocolInterface (IN IHANDLE *Handle, IN EFI_GUID *Protocol, IN VOID *Interface)
 
PROTOCOL_INTERFACEMmRemoveInterfaceFromProtocol (IN IHANDLE *Handle, IN EFI_GUID *Protocol, IN VOID *Interface)
 
BOOLEAN MmIsSchedulable (IN EFI_MM_DRIVER_ENTRY *DriverEntry)
 
VOID DumpMmramInfo (VOID)
 
EFI_STATUS MmCoreFfsFindMmDriver (IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader, IN UINT32 Depth)
 
VOID EFIAPI MmCoreInitializeMemoryAttributesTable (VOID)
 
EFI_STATUS EFIAPI MmCoreGetMemoryMap (IN OUT UINTN *MemoryMapSize, IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap, OUT UINTN *MapKey, OUT UINTN *DescriptorSize, OUT UINT32 *DescriptorVersion)
 

Variables

EFI_MM_SYSTEM_TABLE gMmCoreMmst
 
LIST_ENTRY gHandleList
 
BOOLEAN mMmEntryPointRegistered
 
EFI_FIRMWARE_VOLUME_HEADERmBfv
 

Detailed Description

The internal header file includes the common header files, defines internal structure and functions used by MmCore module.

Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file StandaloneMmCore.h.

Macro Definition Documentation

◆ ASSERT_IS_HANDLE

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

Definition at line 121 of file StandaloneMmCore.h.

◆ EFI_HANDLE_SIGNATURE

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

Definition at line 107 of file StandaloneMmCore.h.

◆ EFI_MM_DRIVER_ENTRY_SIGNATURE

#define EFI_MM_DRIVER_ENTRY_SIGNATURE   SIGNATURE_32('s', 'd','r','v')

Definition at line 66 of file StandaloneMmCore.h.

◆ NEXT_MEMORY_DESCRIPTOR

#define NEXT_MEMORY_DESCRIPTOR (   MemoryDescriptor,
  Size 
)     ((EFI_MEMORY_DESCRIPTOR *)((UINT8 *)(MemoryDescriptor) + (Size)))

Definition at line 934 of file StandaloneMmCore.h.

◆ PROTOCOL_ENTRY_SIGNATURE

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

Definition at line 123 of file StandaloneMmCore.h.

◆ PROTOCOL_INTERFACE_SIGNATURE

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

Definition at line 142 of file StandaloneMmCore.h.

◆ PROTOCOL_NOTIFY_SIGNATURE

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

Definition at line 162 of file StandaloneMmCore.h.

Function Documentation

◆ DumpMmramInfo()

VOID DumpMmramInfo ( VOID  )

Dump MMRAM information.

◆ MmAddMemoryRegion()

VOID MmAddMemoryRegion ( IN EFI_PHYSICAL_ADDRESS  MemBase,
IN UINT64  MemLength,
IN EFI_MEMORY_TYPE  Type,
IN UINT64  Attributes 
)

Add free MMRAM region for use by memory service.

Parameters
MemBaseBase address of memory region.
MemLengthLength of the memory region.
TypeMemory type.
AttributesMemory region state.

Definition at line 874 of file Page.c.

◆ MmAllocatePages()

EFI_STATUS EFIAPI MmAllocatePages ( IN EFI_ALLOCATE_TYPE  Type,
IN EFI_MEMORY_TYPE  MemoryType,
IN UINTN  NumberOfPages,
OUT EFI_PHYSICAL_ADDRESS Memory 
)

Allocates pages from the memory map.

Parameters
TypeThe type of allocation to perform
MemoryTypeThe type of memory to turn the allocated pages into
NumberOfPagesThe number of pages to allocate
MemoryA pointer to receive the base allocated memory address
Return values
EFI_INVALID_PARAMETERParameters violate checking rules defined in spec.
EFI_NOT_FOUNDCould not allocate pages match the requirement.
EFI_OUT_OF_RESOURCESNo enough pages to allocate.
EFI_SUCCESSPages successfully allocated.

Allocates pages from the memory map.

Parameters
TypeThe type of allocation to perform.
MemoryTypeThe type of memory to turn the allocated pages into.
NumberOfPagesThe number of pages to allocate.
MemoryA pointer to receive the base allocated memory address.
Return values
EFI_INVALID_PARAMETERParameters violate checking rules defined in spec.
EFI_NOT_FOUNDCould not allocate pages match the requirement.
EFI_OUT_OF_RESOURCESNo enough pages to allocate.
EFI_SUCCESSPages successfully allocated.

Definition at line 702 of file Page.c.

◆ MmAllocatePool()

EFI_STATUS EFIAPI MmAllocatePool ( IN EFI_MEMORY_TYPE  PoolType,
IN UINTN  Size,
OUT VOID **  Buffer 
)

Allocate pool of a particular type.

Parameters
PoolTypeType of pool to allocate
SizeThe amount of pool to allocate
BufferThe address to return a pointer to the allocated pool
Return values
EFI_INVALID_PARAMETERPoolType not valid
EFI_OUT_OF_RESOURCESSize exceeds max pool size or allocation failed.
EFI_SUCCESSPool successfully allocated.

Allocate pool of a particular type.

Parameters
PoolTypeType of pool to allocate.
SizeThe amount of pool to allocate.
BufferThe address to return a pointer to the allocated pool.
Return values
EFI_INVALID_PARAMETERPoolType not valid.
EFI_OUT_OF_RESOURCESSize exceeds max pool size or allocation failed.
EFI_SUCCESSPool successfully allocated.

Definition at line 253 of file Pool.c.

◆ MmCoreFfsFindMmDriver()

EFI_STATUS MmCoreFfsFindMmDriver ( IN EFI_FIRMWARE_VOLUME_HEADER FwVolHeader,
IN UINT32  Depth 
)

Given the pointer to the Firmware Volume Header find the MM driver and return its PE32 image.

Parameters
[in]FwVolHeaderPointer to memory mapped FV
[in]DepthNesting depth of encapsulation sections. Callers different from MmCoreFfsFindMmDriver() are responsible for passing in a zero Depth.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_NOT_FOUNDCould not find section data.
EFI_OUT_OF_RESOURCESOut of resources.
EFI_VOLUME_CORRUPTEDFirmware volume is corrupted.
EFI_UNSUPPORTEDOperation not supported.
EFI_ABORTEDRecursion aborted because Depth has been greater than or equal to PcdFwVolMmMaxEncapsulationDepth.

Definition at line 55 of file FwVol.c.

◆ MmCoreGetMemoryMap()

EFI_STATUS EFIAPI MmCoreGetMemoryMap ( IN OUT UINTN MemoryMapSize,
IN OUT EFI_MEMORY_DESCRIPTOR MemoryMap,
OUT UINTN MapKey,
OUT UINTN DescriptorSize,
OUT UINT32 *  DescriptorVersion 
)

This function returns a copy of the current memory map. The map is an array of memory descriptors, each of which describes a contiguous block of memory.

Parameters
[in,out]MemoryMapSizeA pointer to the size, in bytes, of the MemoryMap buffer. On input, this is the size of the buffer allocated by the caller. On output, it is the size of the buffer returned by the firmware if the buffer was large enough, or the size of the buffer needed to contain the map if the buffer was too small.
[in,out]MemoryMapA pointer to the buffer in which firmware places the current memory map.
[out]MapKeyA pointer to the location in which firmware returns the key for the current memory map.
[out]DescriptorSizeA pointer to the location in which firmware returns the size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR.
[out]DescriptorVersionA pointer to the location in which firmware returns the version number associated with the EFI_MEMORY_DESCRIPTOR.
Return values
EFI_SUCCESSThe memory map was returned in the MemoryMap buffer.
EFI_BUFFER_TOO_SMALLThe MemoryMap buffer was too small. The current buffer size needed to hold the memory map is returned in MemoryMapSize.
EFI_INVALID_PARAMETEROne of the parameters has an invalid value.

Definition at line 938 of file Page.c.

◆ MmCoreInitializeMemoryAttributesTable()

VOID EFIAPI MmCoreInitializeMemoryAttributesTable ( VOID  )

Initialize MemoryAttributesTable support.

Definition at line 470 of file MemoryAttributesTable.c.

◆ MmDisplayDiscoveredNotDispatched()

VOID MmDisplayDiscoveredNotDispatched ( VOID  )

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

Definition at line 785 of file Dispatcher.c.

◆ MmDriverDispatchHandler()

EFI_STATUS EFIAPI MmDriverDispatchHandler ( IN EFI_HANDLE  DispatchHandle,
IN CONST VOID *Context  OPTIONAL,
IN OUT VOID *CommBuffer  OPTIONAL,
IN OUT UINTN *CommBufferSize  OPTIONAL 
)

This function is the main entry point for an MM handler dispatch or communicate-based callback.

Parameters
DispatchHandleThe unique handle assigned to this handler by MmiHandlerRegister().
ContextPoints to an optional handler context which was specified when the handler was registered.
CommBufferA pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment.
CommBufferSizeThe size of the CommBuffer.
Returns
Status Code

Event notification that is fired MM IPL to dispatch the previously discovered MM drivers.

Parameters
[in]DispatchHandleThe unique handle assigned to this handler by MmiHandlerRegister().
[in]ContextPoints to an optional handler context which was specified when the handler was registered.
[in,out]CommBufferA pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment.
[in,out]CommBufferSizeThe size of the CommBuffer.
Returns
EFI_SUCCESS Dispatcher is executed.

Definition at line 736 of file Dispatcher.c.

◆ MmEfiNotAvailableYetArg5()

EFI_STATUS EFIAPI MmEfiNotAvailableYetArg5 ( UINTN  Arg1,
UINTN  Arg2,
UINTN  Arg3,
UINTN  Arg4,
UINTN  Arg5 
)

Place holder function until all the MM System Table Service are available.

Parameters
Arg1Undefined
Arg2Undefined
Arg3Undefined
Arg4Undefined
Arg5Undefined
Returns
EFI_NOT_AVAILABLE_YET

Place holder function until all the MM System Table Service are available.

Note: This function is only used by MMRAM invocation. It is never used by DXE invocation.

Parameters
Arg1Undefined
Arg2Undefined
Arg3Undefined
Arg4Undefined
Arg5Undefined
Returns
EFI_NOT_AVAILABLE_YET

Definition at line 107 of file StandaloneMmCore.c.

◆ MmEndOfDxeHandler()

EFI_STATUS EFIAPI MmEndOfDxeHandler ( IN EFI_HANDLE  DispatchHandle,
IN CONST VOID *Context  OPTIONAL,
IN OUT VOID *CommBuffer  OPTIONAL,
IN OUT UINTN *CommBufferSize  OPTIONAL 
)

This function is the main entry point for an MM handler dispatch or communicate-based callback.

Parameters
DispatchHandleThe unique handle assigned to this handler by MmiHandlerRegister().
ContextPoints to an optional handler context which was specified when the handler was registered.
CommBufferA pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment.
CommBufferSizeThe size of the CommBuffer.
Returns
Status Code

Software MMI handler that is called when the EndOfDxe event is signaled. This function installs the MM EndOfDxe Protocol so MM Drivers are informed that platform code will invoke 3rd part code.

Parameters
DispatchHandleThe unique handle assigned to this handler by MmiHandlerRegister().
ContextPoints to an optional handler context which was specified when the handler was registered.
CommBufferA pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment.
CommBufferSizeThe size of the CommBuffer.
Returns
Status Code

Definition at line 335 of file StandaloneMmCore.c.

◆ MmEndOfPeiHandler()

EFI_STATUS EFIAPI MmEndOfPeiHandler ( IN EFI_HANDLE  DispatchHandle,
IN CONST VOID *Context  OPTIONAL,
IN OUT VOID *CommBuffer  OPTIONAL,
IN OUT UINTN *CommBufferSize  OPTIONAL 
)

Software MMI handler that is called when the EndOfPei event is signaled. This function installs the MM EndOfPei Protocol so MM Drivers are informed that EndOfPei event is signaled.

Parameters
DispatchHandleThe unique handle assigned to this handler by MmiHandlerRegister().
ContextPoints to an optional handler context which was specified when the handler was registered.
CommBufferA pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment.
CommBufferSizeThe size of the CommBuffer.
Returns
Status Code

Definition at line 295 of file StandaloneMmCore.c.

◆ MmExitBootServiceHandler()

EFI_STATUS EFIAPI MmExitBootServiceHandler ( IN EFI_HANDLE  DispatchHandle,
IN CONST VOID *Context  OPTIONAL,
IN OUT VOID *CommBuffer  OPTIONAL,
IN OUT UINTN *CommBufferSize  OPTIONAL 
)

This function is the main entry point for an MM handler dispatch or communicate-based callback.

Parameters
DispatchHandleThe unique handle assigned to this handler by MmiHandlerRegister().
ContextPoints to an optional handler context which was specified when the handler was registered.
CommBufferA pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment.
CommBufferSizeThe size of the CommBuffer.
Returns
Status Code

Software MMI handler that is called when a ExitBoot Service event is signaled.

Parameters
DispatchHandleThe unique handle assigned to this handler by MmiHandlerRegister().
ContextPoints to an optional handler context which was specified when the handler was registered.
CommBufferA pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment.
CommBufferSizeThe size of the CommBuffer.
Returns
Status Code

Definition at line 136 of file StandaloneMmCore.c.

◆ 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.

◆ MmFreePages()

EFI_STATUS EFIAPI MmFreePages ( IN EFI_PHYSICAL_ADDRESS  Memory,
IN UINTN  NumberOfPages 
)

Frees previous allocated pages.

Parameters
MemoryBase address of memory being freed
NumberOfPagesThe number of pages to free
Return values
EFI_NOT_FOUNDCould not find the entry that covers the range
EFI_INVALID_PARAMETERAddress not aligned, Address is zero or NumberOfPages is zero.
Returns
EFI_SUCCESS Pages successfully freed.

Frees previous allocated pages.

Parameters
MemoryBase address of memory being freed.
NumberOfPagesThe number of pages to free.
Return values
EFI_NOT_FOUNDCould not find the entry that covers the range.
EFI_INVALID_PARAMETERAddress not aligned, Address is zero or NumberOfPages is zero.
Returns
EFI_SUCCESS Pages successfully freed.

Definition at line 853 of file Page.c.

◆ MmFreePool()

EFI_STATUS EFIAPI MmFreePool ( IN VOID *  Buffer)

Frees pool.

Parameters
BufferThe allocated pool entry to free
Return values
EFI_INVALID_PARAMETERBuffer is not a valid value.
EFI_SUCCESSPool successfully freed.

Frees pool.

Parameters
BufferThe allocated pool entry to free.
Return values
EFI_INVALID_PARAMETERBuffer is not a valid value.
EFI_SUCCESSPool successfully freed.

Definition at line 312 of file Pool.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.
Returns
The requested protocol interface for the handle

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.

◆ MmiHandlerRegister()

EFI_STATUS EFIAPI MmiHandlerRegister ( IN EFI_MM_HANDLER_ENTRY_POINT  Handler,
IN CONST EFI_GUID *HandlerType  OPTIONAL,
OUT EFI_HANDLE DispatchHandle 
)

Registers a handler to execute within MM.

Parameters
HandlerHandler service function pointer.
HandlerTypePoints to the handler type or NULL for root MMI handlers.
DispatchHandleOn return, contains a unique handle which can be used to later unregister the handler function.
Return values
EFI_SUCCESSHandler register success.
EFI_INVALID_PARAMETERHandler or DispatchHandle is NULL.

Definition at line 356 of file Mmi.c.

◆ MmiHandlerUnRegister()

EFI_STATUS EFIAPI MmiHandlerUnRegister ( IN EFI_HANDLE  DispatchHandle)

Unregister a handler in MM.

Parameters
DispatchHandleThe handle that was specified when the handler was registered.
Return values
EFI_SUCCESSHandler function was successfully unregistered.
EFI_INVALID_PARAMETERDispatchHandle does not refer to a valid handle.

Definition at line 416 of file Mmi.c.

◆ MmiManage()

EFI_STATUS EFIAPI MmiManage ( IN CONST EFI_GUID HandlerType,
IN CONST VOID *Context  OPTIONAL,
IN OUT VOID *CommBuffer  OPTIONAL,
IN OUT UINTN *CommBufferSize  OPTIONAL 
)

Manage MMI of a particular type.

Parameters
HandlerTypePoints to the handler type or NULL for root MMI handlers.
ContextPoints to an optional context buffer.
CommBufferPoints to the optional communication buffer.
CommBufferSizePoints to the size of the optional communication buffer.
Return values
EFI_SUCCESSInterrupt source was processed successfully but not quiesced.
EFI_INTERRUPT_PENDINGOne or more MMI sources could not be quiesced.
EFI_WARN_INTERRUPT_SOURCE_PENDINGInterrupt source was not handled or quiesced.
EFI_WARN_INTERRUPT_SOURCE_QUIESCEDInterrupt source was handled and quiesced.

Manage MMI of a particular type.

Parameters
HandlerTypePoints to the handler type or NULL for root MMI handlers.
ContextPoints to an optional context buffer.
CommBufferPoints to the optional communication buffer.
CommBufferSizePoints to the size of the optional communication buffer.
Return values
EFI_WARN_INTERRUPT_SOURCE_PENDINGInterrupt source was processed successfully but not quiesced.
EFI_INTERRUPT_PENDINGOne or more MMI sources could not be quiesced.
EFI_NOT_FOUNDInterrupt source was not handled or quiesced.
EFI_SUCCESSInterrupt source was handled and quiesced.

Definition at line 160 of file Mmi.c.

◆ MmInitializeMemoryServices()

VOID MmInitializeMemoryServices ( IN UINTN  MmramRangeCount,
IN EFI_MMRAM_DESCRIPTOR MmramRanges 
)

Called to initialize the memory service.

Parameters
MmramRangeCountNumber of MMRAM Regions
MmramRangesPointer to MMRAM Descriptors

Definition at line 27 of file Pool.c.

◆ MmInstallConfigurationTable()

EFI_STATUS EFIAPI MmInstallConfigurationTable ( IN CONST EFI_MM_SYSTEM_TABLE SystemTable,
IN CONST EFI_GUID Guid,
IN VOID *  Table,
IN UINTN  TableSize 
)

The MmInstallConfigurationTable() function is used to maintain the list of configuration tables that are stored in the System Management System Table. The list is stored as an array of (GUID, Pointer) pairs. The list must be allocated from pool memory with PoolType set to EfiRuntimeServicesData.

Parameters
SystemTableA pointer to the MM System Table (SMST).
GuidA pointer to the GUID for the entry to add, update, or remove.
TableA pointer to the buffer of the table to add.
TableSizeThe size of the table to install.
Return values
EFI_SUCCESSThe (Guid, Table) pair was added, updated, or removed.
EFI_INVALID_PARAMETERGuid is not valid.
EFI_NOT_FOUNDAn attempt was made to delete a non-existent entry.
EFI_OUT_OF_RESOURCESThere is not enough memory available to complete the operation.

The MmInstallConfigurationTable() function is used to maintain the list of configuration tables that are stored in the System Management System Table. The list is stored as an array of (GUID, Pointer) pairs. The list must be allocated from pool memory with PoolType set to EfiRuntimeServicesData.

Parameters
SystemTableA pointer to the SMM System Table (SMST).
GuidA pointer to the GUID for the entry to add, update, or remove.
TableA pointer to the buffer of the table to add.
TableSizeThe size of the table to install.
Return values
EFI_SUCCESSThe (Guid, Table) pair was added, updated, or removed.
EFI_INVALID_PARAMETERGuid is not valid.
EFI_NOT_FOUNDAn attempt was made to delete a non-existent entry.
EFI_OUT_OF_RESOURCESThere is not enough memory available to complete the operation.

Definition at line 35 of file InstallConfigurationTable.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.

◆ MmInternalAllocatePages()

EFI_STATUS EFIAPI MmInternalAllocatePages ( IN EFI_ALLOCATE_TYPE  Type,
IN EFI_MEMORY_TYPE  MemoryType,
IN UINTN  NumberOfPages,
OUT EFI_PHYSICAL_ADDRESS Memory 
)

Allocates pages from the memory map.

Parameters
TypeThe type of allocation to perform
MemoryTypeThe type of memory to turn the allocated pages into
NumberOfPagesThe number of pages to allocate
MemoryA pointer to receive the base allocated memory address
Return values
EFI_INVALID_PARAMETERParameters violate checking rules defined in spec.
EFI_NOT_FOUNDCould not allocate pages match the requirement.
EFI_OUT_OF_RESOURCESNo enough pages to allocate.
EFI_SUCCESSPages successfully allocated.

Allocates pages from the memory map.

Parameters
[in]TypeThe type of allocation to perform.
[in]MemoryTypeThe type of memory to turn the allocated pages into.
[in]NumberOfPagesThe number of pages to allocate.
[out]MemoryA pointer to receive the base allocated memory address.
Return values
EFI_INVALID_PARAMETERParameters violate checking rules defined in spec.
EFI_NOT_FOUNDCould not allocate pages match the requirement.
EFI_OUT_OF_RESOURCESNo enough pages to allocate.
EFI_SUCCESSPages successfully allocated.

Definition at line 668 of file Page.c.

◆ MmInternalAllocatePool()

EFI_STATUS EFIAPI MmInternalAllocatePool ( IN EFI_MEMORY_TYPE  PoolType,
IN UINTN  Size,
OUT VOID **  Buffer 
)

Allocate pool of a particular type.

Parameters
PoolTypeType of pool to allocate
SizeThe amount of pool to allocate
BufferThe address to return a pointer to the allocated pool
Return values
EFI_INVALID_PARAMETERPoolType not valid
EFI_OUT_OF_RESOURCESSize exceeds max pool size or allocation failed.
EFI_SUCCESSPool successfully allocated.

Allocate pool of a particular type.

Parameters
PoolTypeType of pool to allocate.
SizeThe amount of pool to allocate.
BufferThe address to return a pointer to the allocated pool.
Return values
EFI_INVALID_PARAMETERPoolType not valid.
EFI_OUT_OF_RESOURCESSize exceeds max pool size or allocation failed.
EFI_SUCCESSPool successfully allocated.

Definition at line 191 of file Pool.c.

◆ MmInternalFreePages()

EFI_STATUS EFIAPI MmInternalFreePages ( IN EFI_PHYSICAL_ADDRESS  Memory,
IN UINTN  NumberOfPages 
)

Frees previous allocated pages.

Parameters
MemoryBase address of memory being freed
NumberOfPagesThe number of pages to free
Return values
EFI_NOT_FOUNDCould not find the entry that covers the range
EFI_INVALID_PARAMETERAddress not aligned, Address is zero or NumberOfPages is zero.
Returns
EFI_SUCCESS Pages successfully freed.

Frees previous allocated pages.

Parameters
[in]MemoryBase address of memory being freed.
[in]NumberOfPagesThe number of pages to free.
Return values
EFI_NOT_FOUNDCould not find the entry that covers the range.
EFI_INVALID_PARAMETERAddress not aligned, Address is zero or NumberOfPages is zero.
Returns
EFI_SUCCESS Pages successfully freed.

Definition at line 832 of file Page.c.

◆ MmInternalFreePool()

EFI_STATUS EFIAPI MmInternalFreePool ( IN VOID *  Buffer)

Frees pool.

Parameters
BufferThe allocated pool entry to free
Return values
EFI_INVALID_PARAMETERBuffer is not a valid value.
EFI_SUCCESSPool successfully freed.

Frees pool.

Parameters
BufferThe allocated pool entry to free.
Return values
EFI_INVALID_PARAMETERBuffer is not a valid value.
EFI_SUCCESSPool successfully freed.

Definition at line 276 of file Pool.c.

◆ MmIsSchedulable()

BOOLEAN MmIsSchedulable ( IN EFI_MM_DRIVER_ENTRY DriverEntry)

This is the POSTFIX version of the dependency evaluator. This code does not need to handle Before or After, as it is not valid to call this routine in this case. POSTFIX means all the math is done on top of the stack.

Parameters
DriverEntryDriverEntry element to update.
Return values
TRUEIf driver is ready to run.
FALSEIf driver is not ready to run or some fatal error was found.

Definition at line 159 of file Dependency.c.

◆ MmLocateHandle()

EFI_STATUS EFIAPI MmLocateHandle ( IN EFI_LOCATE_SEARCH_TYPE  SearchType,
IN EFI_GUID *Protocol  OPTIONAL,
IN VOID *SearchKey  OPTIONAL,
IN OUT UINTN BufferSize,
OUT EFI_HANDLE Buffer 
)

Locates the requested handle(s) and returns them in Buffer.

Parameters
SearchTypeThe type of search to perform to locate the handles
ProtocolThe protocol to search for
SearchKeyDependant on SearchType
BufferSizeOn input the size of Buffer. On output the size of data returned.
BufferThe buffer to return the results in
Return values
EFI_BUFFER_TOO_SMALLBuffer too small, required buffer size is returned in BufferSize.
EFI_INVALID_PARAMETERInvalid parameter
EFI_SUCCESSSuccessfully found the requested handle(s) and returns them in Buffer.

Definition at line 272 of file Locate.c.

◆ MmLocateHandleBuffer()

EFI_STATUS EFIAPI MmLocateHandleBuffer ( IN EFI_LOCATE_SEARCH_TYPE  SearchType,
IN EFI_GUID *Protocol  OPTIONAL,
IN VOID *SearchKey  OPTIONAL,
IN OUT UINTN NumberHandles,
OUT EFI_HANDLE **  Buffer 
)

Function returns an array of handles that support the requested protocol in a buffer allocated from pool. This is a version of MmLocateHandle() that allocates a buffer for the caller.

Parameters
SearchTypeSpecifies which handle(s) are to be returned.
ProtocolProvides the protocol to search by. This parameter is only valid for SearchType ByProtocol.
SearchKeySupplies the search key depending on the SearchType.
NumberHandlesThe number of handles returned in Buffer.
BufferA pointer to the buffer to return the requested array of handles that support Protocol.
Return values
EFI_SUCCESSThe result array of handles was returned.
EFI_NOT_FOUNDNo handles match the search.
EFI_OUT_OF_RESOURCESThere is not enough pool memory to store the matching results.
EFI_INVALID_PARAMETEROne or more parameters are not valid.

Definition at line 436 of file Locate.c.

◆ MmLocateProtocol()

EFI_STATUS EFIAPI MmLocateProtocol ( IN EFI_GUID Protocol,
IN VOID *Registration  OPTIONAL,
OUT VOID **  Interface 
)

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

Parameters
ProtocolThe protocol to search for
RegistrationOptional Registration Key returned from RegisterProtocolNotify()
InterfaceReturn the Protocol interface (instance).
Return values
EFI_SUCCESSIf a valid Interface is returned
EFI_INVALID_PARAMETERInvalid parameter
EFI_NOT_FOUNDProtocol interface not found

Definition at line 195 of file Locate.c.

◆ MmNotifyProtocol()

VOID MmNotifyProtocol ( IN PROTOCOL_INTERFACE Prot)

Signal event for every protocol in protocol entry.

Parameters
ProtProtocol interface

Definition at line 19 of file Notify.c.

◆ MmReadyToBootHandler()

EFI_STATUS EFIAPI MmReadyToBootHandler ( IN EFI_HANDLE  DispatchHandle,
IN CONST VOID *Context  OPTIONAL,
IN OUT VOID *CommBuffer  OPTIONAL,
IN OUT UINTN *CommBufferSize  OPTIONAL 
)

This function is the main entry point for an MM handler dispatch or communicate-based callback.

Parameters
DispatchHandleThe unique handle assigned to this handler by MmiHandlerRegister().
ContextPoints to an optional handler context which was specified when the handler was registered.
CommBufferA pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment.
CommBufferSizeThe size of the CommBuffer.
Returns
Status Code

Software MMI handler that is called when a ExitBoot Service event is signaled.

Parameters
DispatchHandleThe unique handle assigned to this handler by MmiHandlerRegister().
ContextPoints to an optional handler context which was specified when the handler was registered.
CommBufferA pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment.
CommBufferSizeThe size of the CommBuffer.
Returns
Status Code

Definition at line 176 of file StandaloneMmCore.c.

◆ MmReadyToLockHandler()

EFI_STATUS EFIAPI MmReadyToLockHandler ( IN EFI_HANDLE  DispatchHandle,
IN CONST VOID *Context  OPTIONAL,
IN OUT VOID *CommBuffer  OPTIONAL,
IN OUT UINTN *CommBufferSize  OPTIONAL 
)

This function is the main entry point for an MM handler dispatch or communicate-based callback.

Parameters
DispatchHandleThe unique handle assigned to this handler by MmiHandlerRegister().
ContextPoints to an optional handler context which was specified when the handler was registered.
CommBufferA pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment.
CommBufferSizeThe size of the CommBuffer.
Returns
Status Code

Software MMI handler that is called when the DxeMmReadyToLock protocol is added or if gEfiEventReadyToBootGuid is signaled. This function unregisters the Software SMIs that are nor required after MMRAM is locked and installs the MM Ready To Lock Protocol so MM Drivers are informed that MMRAM is about to be locked.

Parameters
DispatchHandleThe unique handle assigned to this handler by MmiHandlerRegister().
ContextPoints to an optional handler context which was specified when the handler was registered.
CommBufferA pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment.
CommBufferSizeThe size of the CommBuffer.
Returns
Status Code

Definition at line 220 of file StandaloneMmCore.c.

◆ MmRegisterProtocolNotify()

EFI_STATUS EFIAPI MmRegisterProtocolNotify ( IN CONST EFI_GUID Protocol,
IN EFI_MM_NOTIFY_FN  Function,
OUT VOID **  Registration 
)

Add a new protocol notification record for the request protocol.

Parameters
ProtocolThe requested protocol to add the notify registration
FunctionPoints to the notification function
RegistrationReturns the registration record
Return values
EFI_INVALID_PARAMETERInvalid parameter
EFI_SUCCESSSuccessfully returned the registration record that has been added

Add a new protocol notification record for the request protocol.

Parameters
ProtocolThe requested protocol to add the notify registration
FunctionPoints to the notification function
RegistrationReturns the registration record
Return values
EFI_SUCCESSSuccessfully returned the registration record that has been added or unhooked
EFI_INVALID_PARAMETERProtocol is NULL or Registration is NULL
EFI_OUT_OF_RESOURCESNot enough memory resource to finish the request
EFI_NOT_FOUNDIf the registration is not found when Function == NULL

Definition at line 97 of file Notify.c.

◆ MmRemoveInterfaceFromProtocol()

PROTOCOL_INTERFACE * MmRemoveInterfaceFromProtocol ( 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 45 of file Notify.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.

Variable Documentation

◆ gHandleList

LIST_ENTRY gHandleList
extern

Definition at line 19 of file Handle.c.

◆ gMmCoreMmst

EFI_MM_SYSTEM_TABLE gMmCoreMmst
extern

Definition at line 25 of file StandaloneMmCore.c.

◆ mBfv

Definition at line 89 of file StandaloneMmCore.c.

◆ mMmEntryPointRegistered

BOOLEAN mMmEntryPointRegistered
extern

Definition at line 86 of file StandaloneMmCore.c.