TianoCore EDK2 master
|
#include <PiMm.h>
#include <StandaloneMm.h>
#include <Protocol/DxeMmReadyToLock.h>
#include <Protocol/MmReadyToLock.h>
#include <Protocol/MmEndOfDxe.h>
#include <Protocol/MmCommunication2.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/MmConfiguration.h>
#include <Guid/Apriori.h>
#include <Guid/EventGroup.h>
#include <Guid/EventLegacyBios.h>
#include <Guid/ZeroGuid.h>
#include <Guid/MemoryProfile.h>
#include <Guid/HobList.h>
#include <Guid/MmFvDispatch.h>
#include <Guid/MmramMemoryReserve.h>
#include <Guid/MmCommBuffer.h>
#include <Guid/PiSmmMemoryAttributesTable.h>
#include <Library/StandaloneMmCoreEntryPoint.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/PeCoffLib.h>
#include <Library/CacheMaintenanceLib.h>
#include <Library/DebugLib.h>
#include <Library/ReportStatusCodeLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PcdLib.h>
#include <Library/HobPrintLib.h>
#include <Library/ImagePropertiesRecordLib.h>
#include <Library/PeCoffGetEntryPointLib.h>
#include <Library/StandaloneMmMemLib.h>
#include <Library/HobLib.h>
#include "StandaloneMmCorePrivateData.h"
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))) |
Variables | |
EFI_MM_SYSTEM_TABLE | gMmCoreMmst |
LIST_ENTRY | gHandleList |
BOOLEAN | mMmEntryPointRegistered |
EFI_FIRMWARE_VOLUME_HEADER * | mBfv |
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.
#define ASSERT_IS_HANDLE | ( | a | ) | ASSERT((a)->Signature == EFI_HANDLE_SIGNATURE) |
Definition at line 121 of file StandaloneMmCore.h.
#define EFI_HANDLE_SIGNATURE SIGNATURE_32('h','n','d','l') |
Definition at line 107 of file StandaloneMmCore.h.
#define EFI_MM_DRIVER_ENTRY_SIGNATURE SIGNATURE_32('s', 'd','r','v') |
Definition at line 66 of file StandaloneMmCore.h.
#define NEXT_MEMORY_DESCRIPTOR | ( | MemoryDescriptor, | |
Size | |||
) | ((EFI_MEMORY_DESCRIPTOR *)((UINT8 *)(MemoryDescriptor) + (Size))) |
Definition at line 934 of file StandaloneMmCore.h.
#define PROTOCOL_ENTRY_SIGNATURE SIGNATURE_32('p','r','t','e') |
Definition at line 123 of file StandaloneMmCore.h.
#define PROTOCOL_INTERFACE_SIGNATURE SIGNATURE_32('p','i','f','c') |
Definition at line 142 of file StandaloneMmCore.h.
#define PROTOCOL_NOTIFY_SIGNATURE SIGNATURE_32('p','r','t','n') |
Definition at line 162 of file StandaloneMmCore.h.
VOID DumpMmramInfo | ( | VOID | ) |
Dump MMRAM information.
VOID MmAddMemoryRegion | ( | IN EFI_PHYSICAL_ADDRESS | MemBase, |
IN UINT64 | MemLength, | ||
IN EFI_MEMORY_TYPE | Type, | ||
IN UINT64 | Attributes | ||
) |
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.
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 |
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. |
Allocates pages from the memory map.
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. |
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_STATUS EFIAPI MmAllocatePool | ( | IN EFI_MEMORY_TYPE | PoolType, |
IN UINTN | Size, | ||
OUT VOID ** | Buffer | ||
) |
Allocate pool of a particular type.
PoolType | Type of pool to allocate |
Size | The amount of pool to allocate |
Buffer | The address to return a pointer to the allocated pool |
EFI_INVALID_PARAMETER | PoolType not valid |
EFI_OUT_OF_RESOURCES | Size exceeds max pool size or allocation failed. |
EFI_SUCCESS | Pool successfully allocated. |
Allocate pool of a particular type.
PoolType | Type of pool to allocate. |
Size | The amount of pool to allocate. |
Buffer | The address to return a pointer to the allocated pool. |
EFI_INVALID_PARAMETER | PoolType not valid. |
EFI_OUT_OF_RESOURCES | Size exceeds max pool size or allocation failed. |
EFI_SUCCESS | Pool successfully allocated. |
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.
[in] | FwVolHeader | Pointer to memory mapped FV |
[in] | Depth | Nesting depth of encapsulation sections. Callers different from MmCoreFfsFindMmDriver() are responsible for passing in a zero Depth. |
EFI_SUCCESS | Success. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_NOT_FOUND | Could not find section data. |
EFI_OUT_OF_RESOURCES | Out of resources. |
EFI_VOLUME_CORRUPTED | Firmware volume is corrupted. |
EFI_UNSUPPORTED | Operation not supported. |
EFI_ABORTED | Recursion aborted because Depth has been greater than or equal to PcdFwVolMmMaxEncapsulationDepth. |
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.
[in,out] | MemoryMapSize | A 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] | MemoryMap | A pointer to the buffer in which firmware places the current memory map. |
[out] | MapKey | A pointer to the location in which firmware returns the key for the current memory map. |
[out] | DescriptorSize | A pointer to the location in which firmware returns the size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR. |
[out] | DescriptorVersion | A pointer to the location in which firmware returns the version number associated with the EFI_MEMORY_DESCRIPTOR. |
EFI_SUCCESS | The memory map was returned in the MemoryMap buffer. |
EFI_BUFFER_TOO_SMALL | The MemoryMap buffer was too small. The current buffer size needed to hold the memory map is returned in MemoryMapSize. |
EFI_INVALID_PARAMETER | One of the parameters has an invalid value. |
VOID EFIAPI MmCoreInitializeMemoryAttributesTable | ( | VOID | ) |
Initialize MemoryAttributesTable support.
Definition at line 470 of file MemoryAttributesTable.c.
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.
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.
DispatchHandle | The unique handle assigned to this handler by MmiHandlerRegister(). |
Context | Points to an optional handler context which was specified when the handler was registered. |
CommBuffer | A pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment. |
CommBufferSize | The size of the CommBuffer. |
Event notification that is fired MM IPL to dispatch the previously discovered MM drivers.
[in] | DispatchHandle | The unique handle assigned to this handler by MmiHandlerRegister(). |
[in] | Context | Points to an optional handler context which was specified when the handler was registered. |
[in,out] | CommBuffer | A pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment. |
[in,out] | CommBufferSize | The size of the CommBuffer. |
Definition at line 736 of file Dispatcher.c.
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.
Arg1 | Undefined |
Arg2 | Undefined |
Arg3 | Undefined |
Arg4 | Undefined |
Arg5 | Undefined |
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.
Arg1 | Undefined |
Arg2 | Undefined |
Arg3 | Undefined |
Arg4 | Undefined |
Arg5 | Undefined |
Definition at line 107 of file StandaloneMmCore.c.
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.
DispatchHandle | The unique handle assigned to this handler by MmiHandlerRegister(). |
Context | Points to an optional handler context which was specified when the handler was registered. |
CommBuffer | A pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment. |
CommBufferSize | The size of the CommBuffer. |
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.
DispatchHandle | The unique handle assigned to this handler by MmiHandlerRegister(). |
Context | Points to an optional handler context which was specified when the handler was registered. |
CommBuffer | A pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment. |
CommBufferSize | The size of the CommBuffer. |
Definition at line 335 of file StandaloneMmCore.c.
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.
DispatchHandle | The unique handle assigned to this handler by MmiHandlerRegister(). |
Context | Points to an optional handler context which was specified when the handler was registered. |
CommBuffer | A pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment. |
CommBufferSize | The size of the CommBuffer. |
Definition at line 295 of file StandaloneMmCore.c.
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.
DispatchHandle | The unique handle assigned to this handler by MmiHandlerRegister(). |
Context | Points to an optional handler context which was specified when the handler was registered. |
CommBuffer | A pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment. |
CommBufferSize | The size of the CommBuffer. |
Software MMI handler that is called when a ExitBoot Service event is signaled.
DispatchHandle | The unique handle assigned to this handler by MmiHandlerRegister(). |
Context | Points to an optional handler context which was specified when the handler was registered. |
CommBuffer | A pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment. |
CommBufferSize | The size of the CommBuffer. |
Definition at line 136 of file StandaloneMmCore.c.
PROTOCOL_ENTRY * MmFindProtocolEntry | ( | IN EFI_GUID * | Protocol, |
IN BOOLEAN | Create | ||
) |
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.
Handle | The handle to search the protocol on |
Protocol | GUID of the protocol |
Interface | The interface for the protocol being searched |
EFI_STATUS EFIAPI MmFreePages | ( | IN EFI_PHYSICAL_ADDRESS | Memory, |
IN UINTN | NumberOfPages | ||
) |
Frees previous allocated pages.
Memory | Base address of memory being freed |
NumberOfPages | The number of pages to free |
EFI_NOT_FOUND | Could not find the entry that covers the range |
EFI_INVALID_PARAMETER | Address not aligned, Address is zero or NumberOfPages is zero. |
Frees previous allocated pages.
Memory | Base address of memory being freed. |
NumberOfPages | The number of pages to free. |
EFI_NOT_FOUND | Could not find the entry that covers the range. |
EFI_INVALID_PARAMETER | Address not aligned, Address is zero or NumberOfPages is zero. |
EFI_STATUS EFIAPI MmFreePool | ( | IN VOID * | Buffer | ) |
Frees pool.
Buffer | The allocated pool entry to free |
EFI_INVALID_PARAMETER | Buffer is not a valid value. |
EFI_SUCCESS | Pool successfully freed. |
Frees pool.
Buffer | The allocated pool entry to free. |
EFI_INVALID_PARAMETER | Buffer is not a valid value. |
EFI_SUCCESS | Pool successfully freed. |
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.
UserHandle | The handle being queried. |
Protocol | The published unique identifier of the protocol. |
Interface | Supplies the address where a pointer to the corresponding Protocol Interface is returned. |
Queries a handle to determine if it supports a specified protocol.
UserHandle | The handle being queried. |
Protocol | The published unique identifier of the protocol. |
Interface | Supplies the address where a pointer to the corresponding Protocol Interface is returned. |
EFI_SUCCESS | The interface information for the specified protocol was returned. |
EFI_UNSUPPORTED | The device does not support the specified protocol. |
EFI_INVALID_PARAMETER | Handle is not a valid EFI_HANDLE.. |
EFI_INVALID_PARAMETER | Protocol is NULL. |
EFI_INVALID_PARAMETER | Interface is NULL. |
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.
Handler | Handler service function pointer. |
HandlerType | Points to the handler type or NULL for root MMI handlers. |
DispatchHandle | On return, contains a unique handle which can be used to later unregister the handler function. |
EFI_SUCCESS | Handler register success. |
EFI_INVALID_PARAMETER | Handler or DispatchHandle is NULL. |
EFI_STATUS EFIAPI MmiHandlerUnRegister | ( | IN EFI_HANDLE | DispatchHandle | ) |
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.
HandlerType | Points to the handler type or NULL for root MMI handlers. |
Context | Points to an optional context buffer. |
CommBuffer | Points to the optional communication buffer. |
CommBufferSize | Points to the size of the optional communication buffer. |
EFI_SUCCESS | Interrupt source was processed successfully but not quiesced. |
EFI_INTERRUPT_PENDING | One or more MMI sources could not be quiesced. |
EFI_WARN_INTERRUPT_SOURCE_PENDING | Interrupt source was not handled or quiesced. |
EFI_WARN_INTERRUPT_SOURCE_QUIESCED | Interrupt source was handled and quiesced. |
Manage MMI of a particular type.
HandlerType | Points to the handler type or NULL for root MMI handlers. |
Context | Points to an optional context buffer. |
CommBuffer | Points to the optional communication buffer. |
CommBufferSize | Points to the size of the optional communication buffer. |
EFI_WARN_INTERRUPT_SOURCE_PENDING | Interrupt source was processed successfully but not quiesced. |
EFI_INTERRUPT_PENDING | One or more MMI sources could not be quiesced. |
EFI_NOT_FOUND | Interrupt source was not handled or quiesced. |
EFI_SUCCESS | Interrupt source was handled and quiesced. |
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 | ||
) |
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.
SystemTable | A pointer to the MM System Table (SMST). |
Guid | A pointer to the GUID for the entry to add, update, or remove. |
Table | A pointer to the buffer of the table to add. |
TableSize | The size of the table to install. |
EFI_SUCCESS | The (Guid, Table) pair was added, updated, or removed. |
EFI_INVALID_PARAMETER | Guid is not valid. |
EFI_NOT_FOUND | An attempt was made to delete a non-existent entry. |
EFI_OUT_OF_RESOURCES | There 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.
SystemTable | A pointer to the SMM System Table (SMST). |
Guid | A pointer to the GUID for the entry to add, update, or remove. |
Table | A pointer to the buffer of the table to add. |
TableSize | The size of the table to install. |
EFI_SUCCESS | The (Guid, Table) pair was added, updated, or removed. |
EFI_INVALID_PARAMETER | Guid is not valid. |
EFI_NOT_FOUND | An attempt was made to delete a non-existent entry. |
EFI_OUT_OF_RESOURCES | There is not enough memory available to complete the operation. |
Definition at line 35 of file InstallConfigurationTable.c.
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
UserHandle | The handle to install the protocol handler on, or NULL if a new handle is to be allocated |
Protocol | The protocol to add to the handle |
InterfaceType | Indicates whether Interface is supplied in native form. |
Interface | The interface for the protocol being added |
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.
UserHandle | The handle to install the protocol handler on, or NULL if a new handle is to be allocated |
Protocol | The protocol to add to the handle |
InterfaceType | Indicates whether Interface is supplied in native form. |
Interface | The interface for the protocol being added |
Notify | indicates whether notify the notification list for this protocol |
EFI_INVALID_PARAMETER | Invalid parameter |
EFI_OUT_OF_RESOURCES | No enough buffer to allocate |
EFI_SUCCESS | Protocol interface successfully installed |
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.
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 |
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. |
Allocates pages from the memory map.
[in] | Type | The type of allocation to perform. |
[in] | MemoryType | The type of memory to turn the allocated pages into. |
[in] | NumberOfPages | The number of pages to allocate. |
[out] | Memory | A pointer to receive the base allocated memory address. |
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_STATUS EFIAPI MmInternalAllocatePool | ( | IN EFI_MEMORY_TYPE | PoolType, |
IN UINTN | Size, | ||
OUT VOID ** | Buffer | ||
) |
Allocate pool of a particular type.
PoolType | Type of pool to allocate |
Size | The amount of pool to allocate |
Buffer | The address to return a pointer to the allocated pool |
EFI_INVALID_PARAMETER | PoolType not valid |
EFI_OUT_OF_RESOURCES | Size exceeds max pool size or allocation failed. |
EFI_SUCCESS | Pool successfully allocated. |
Allocate pool of a particular type.
PoolType | Type of pool to allocate. |
Size | The amount of pool to allocate. |
Buffer | The address to return a pointer to the allocated pool. |
EFI_INVALID_PARAMETER | PoolType not valid. |
EFI_OUT_OF_RESOURCES | Size exceeds max pool size or allocation failed. |
EFI_SUCCESS | Pool successfully allocated. |
EFI_STATUS EFIAPI MmInternalFreePages | ( | IN EFI_PHYSICAL_ADDRESS | Memory, |
IN UINTN | NumberOfPages | ||
) |
Frees previous allocated pages.
Memory | Base address of memory being freed |
NumberOfPages | The number of pages to free |
EFI_NOT_FOUND | Could not find the entry that covers the range |
EFI_INVALID_PARAMETER | Address not aligned, Address is zero or NumberOfPages is zero. |
Frees previous allocated pages.
[in] | Memory | Base address of memory being freed. |
[in] | NumberOfPages | The number of pages to free. |
EFI_NOT_FOUND | Could not find the entry that covers the range. |
EFI_INVALID_PARAMETER | Address not aligned, Address is zero or NumberOfPages is zero. |
EFI_STATUS EFIAPI MmInternalFreePool | ( | IN VOID * | Buffer | ) |
Frees pool.
Buffer | The allocated pool entry to free |
EFI_INVALID_PARAMETER | Buffer is not a valid value. |
EFI_SUCCESS | Pool successfully freed. |
Frees pool.
Buffer | The allocated pool entry to free. |
EFI_INVALID_PARAMETER | Buffer is not a valid value. |
EFI_SUCCESS | Pool successfully freed. |
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.
DriverEntry | DriverEntry element to update. |
TRUE | If driver is ready to run. |
FALSE | If driver is not ready to run or some fatal error was found. |
Definition at line 159 of file Dependency.c.
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.
SearchType | The type of search to perform to locate the handles |
Protocol | The protocol to search for |
SearchKey | Dependant on SearchType |
BufferSize | On input the size of Buffer. On output the size of data returned. |
Buffer | The buffer to return the results in |
EFI_BUFFER_TOO_SMALL | Buffer too small, required buffer size is returned in BufferSize. |
EFI_INVALID_PARAMETER | Invalid parameter |
EFI_SUCCESS | Successfully found the requested handle(s) and returns them in 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 | ||
) |
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.
SearchType | Specifies which handle(s) are to be returned. |
Protocol | Provides the protocol to search by. This parameter is only valid for SearchType ByProtocol. |
SearchKey | Supplies the search key depending on the SearchType. |
NumberHandles | The number of handles returned in Buffer. |
Buffer | A pointer to the buffer to return the requested array of handles that support Protocol. |
EFI_SUCCESS | The result array of handles was returned. |
EFI_NOT_FOUND | No handles match the search. |
EFI_OUT_OF_RESOURCES | There is not enough pool memory to store the matching results. |
EFI_INVALID_PARAMETER | One or more parameters are not valid. |
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.
Protocol | The protocol to search for |
Registration | Optional Registration Key returned from RegisterProtocolNotify() |
Interface | Return the Protocol interface (instance). |
EFI_SUCCESS | If a valid Interface is returned |
EFI_INVALID_PARAMETER | Invalid parameter |
EFI_NOT_FOUND | Protocol interface not found |
VOID MmNotifyProtocol | ( | IN PROTOCOL_INTERFACE * | Prot | ) |
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.
DispatchHandle | The unique handle assigned to this handler by MmiHandlerRegister(). |
Context | Points to an optional handler context which was specified when the handler was registered. |
CommBuffer | A pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment. |
CommBufferSize | The size of the CommBuffer. |
Software MMI handler that is called when a ExitBoot Service event is signaled.
DispatchHandle | The unique handle assigned to this handler by MmiHandlerRegister(). |
Context | Points to an optional handler context which was specified when the handler was registered. |
CommBuffer | A pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment. |
CommBufferSize | The size of the CommBuffer. |
Definition at line 176 of file StandaloneMmCore.c.
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.
DispatchHandle | The unique handle assigned to this handler by MmiHandlerRegister(). |
Context | Points to an optional handler context which was specified when the handler was registered. |
CommBuffer | A pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment. |
CommBufferSize | The size of the CommBuffer. |
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.
DispatchHandle | The unique handle assigned to this handler by MmiHandlerRegister(). |
Context | Points to an optional handler context which was specified when the handler was registered. |
CommBuffer | A pointer to a collection of data in memory that will be conveyed from a non-MM environment into an MM environment. |
CommBufferSize | The size of the CommBuffer. |
Definition at line 220 of file StandaloneMmCore.c.
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.
Protocol | The requested protocol to add the notify registration |
Function | Points to the notification function |
Registration | Returns the registration record |
EFI_INVALID_PARAMETER | Invalid parameter |
EFI_SUCCESS | Successfully returned the registration record that has been added |
Add a new protocol notification record for the request protocol.
Protocol | The requested protocol to add the notify registration |
Function | Points to the notification function |
Registration | Returns the registration record |
EFI_SUCCESS | Successfully returned the registration record that has been added or unhooked |
EFI_INVALID_PARAMETER | Protocol is NULL or Registration is NULL |
EFI_OUT_OF_RESOURCES | Not enough memory resource to finish the request |
EFI_NOT_FOUND | If the registration is not found when Function == NULL |
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.
UserHandle | The handle to remove the protocol handler from |
Protocol | The protocol, of protocol:interface, to remove |
Interface | The interface, of protocol:interface, to remove |
EFI_INVALID_PARAMETER | Protocol is NULL. |
EFI_SUCCESS | Protocol interface successfully uninstalled. |
|
extern |
|
extern |
Definition at line 25 of file StandaloneMmCore.c.
|
extern |
Definition at line 89 of file StandaloneMmCore.c.
|
extern |
Definition at line 86 of file StandaloneMmCore.c.