TianoCore EDK2 master
|
#include <PiSmm.h>
#include <Protocol/DxeSmmReadyToLock.h>
#include <Protocol/SmmReadyToLock.h>
#include <Protocol/SmmEndOfDxe.h>
#include <Protocol/CpuIo2.h>
#include <Protocol/SmmCommunication.h>
#include <Protocol/SmmAccess2.h>
#include <Protocol/FirmwareVolume2.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/DevicePath.h>
#include <Protocol/Security.h>
#include <Protocol/Security2.h>
#include <Protocol/SmmExitBootServices.h>
#include <Protocol/SmmLegacyBoot.h>
#include <Protocol/SmmReadyToBoot.h>
#include <Protocol/SmmMemoryAttribute.h>
#include <Protocol/SmmSxDispatch2.h>
#include <Guid/Apriori.h>
#include <Guid/EventGroup.h>
#include <Guid/EventLegacyBios.h>
#include <Guid/MemoryProfile.h>
#include <Guid/LoadModuleAtFixedAddress.h>
#include <Guid/SmiHandlerProfile.h>
#include <Guid/EndOfS3Resume.h>
#include <Guid/S3SmmInitDone.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/PeCoffLib.h>
#include <Library/PeCoffGetEntryPointLib.h>
#include <Library/CacheMaintenanceLib.h>
#include <Library/DebugLib.h>
#include <Library/ReportStatusCodeLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/DevicePathLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/PcdLib.h>
#include <Library/SmmCorePlatformHookLib.h>
#include <Library/PerformanceLib.h>
#include <Library/HobLib.h>
#include <Library/SmmMemLib.h>
#include <Library/SafeIntLib.h>
#include "PiSmmCorePrivateData.h"
#include "HeapGuard.h"
Go to the source code of this file.
Data Structures | |
struct | SMM_CORE_SMI_HANDLERS |
struct | SMI_ENTRY |
struct | SMI_HANDLER |
struct | EFI_SMM_DRIVER_ENTRY |
struct | IHANDLE |
struct | PROTOCOL_ENTRY |
struct | PROTOCOL_INTERFACE |
struct | PROTOCOL_NOTIFY |
struct | FREE_PAGE_LIST |
struct | POOL_HEADER |
struct | POOL_TAIL |
struct | FREE_POOL_HEADER |
Macros | |
#define | SMI_ENTRY_SIGNATURE SIGNATURE_32('s','m','i','e') |
#define | SMI_HANDLER_SIGNATURE SIGNATURE_32('s','m','i','h') |
#define | EFI_SMM_DRIVER_ENTRY_SIGNATURE SIGNATURE_32('s', 'd','r','v') |
#define | EFI_HANDLE_SIGNATURE SIGNATURE_32('s','h','d','l') |
#define | ASSERT_IS_HANDLE(a) ASSERT((a)->Signature == EFI_HANDLE_SIGNATURE) |
#define | PROTOCOL_ENTRY_SIGNATURE SIGNATURE_32('s','p','t','e') |
#define | PROTOCOL_INTERFACE_SIGNATURE SIGNATURE_32('s','p','i','f') |
#define | PROTOCOL_NOTIFY_SIGNATURE SIGNATURE_32('s','p','t','n') |
#define | MIN_POOL_SHIFT 6 |
#define | MIN_POOL_SIZE (1 << MIN_POOL_SHIFT) |
#define | MAX_POOL_SHIFT (EFI_PAGE_SHIFT - 1) |
#define | MAX_POOL_SIZE (1 << MAX_POOL_SHIFT) |
#define | MAX_POOL_INDEX (MAX_POOL_SHIFT - MIN_POOL_SHIFT + 1) |
#define | POOL_HEAD_SIGNATURE SIGNATURE_32('s','p','h','d') |
#define | POOL_TAIL_SIGNATURE SIGNATURE_32('s','p','t','l') |
#define | POOL_OVERHEAD (sizeof(POOL_HEADER) + sizeof(POOL_TAIL)) |
#define | HEAD_TO_TAIL(a) ((POOL_TAIL *) (((CHAR8 *) (a)) + (a)->Size - sizeof(POOL_TAIL))); |
Enumerations | |
enum | SMM_POOL_TYPE { SmmPoolTypeCode , SmmPoolTypeData , SmmPoolTypeMax } |
The internal header file includes the common header files, defines internal structure and functions used by SmmCore module.
Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PiSmmCore.h.
#define ASSERT_IS_HANDLE | ( | a | ) | ASSERT((a)->Signature == EFI_HANDLE_SIGNATURE) |
Definition at line 159 of file PiSmmCore.h.
#define EFI_HANDLE_SIGNATURE SIGNATURE_32('s','h','d','l') |
Definition at line 145 of file PiSmmCore.h.
#define EFI_SMM_DRIVER_ENTRY_SIGNATURE SIGNATURE_32('s', 'd','r','v') |
Definition at line 102 of file PiSmmCore.h.
Definition at line 1269 of file PiSmmCore.h.
#define MAX_POOL_INDEX (MAX_POOL_SHIFT - MIN_POOL_SHIFT + 1) |
Definition at line 1248 of file PiSmmCore.h.
#define MAX_POOL_SHIFT (EFI_PAGE_SHIFT - 1) |
Definition at line 1242 of file PiSmmCore.h.
#define MAX_POOL_SIZE (1 << MAX_POOL_SHIFT) |
Definition at line 1243 of file PiSmmCore.h.
#define MIN_POOL_SHIFT 6 |
Definition at line 1236 of file PiSmmCore.h.
#define MIN_POOL_SIZE (1 << MIN_POOL_SHIFT) |
Definition at line 1237 of file PiSmmCore.h.
#define POOL_HEAD_SIGNATURE SIGNATURE_32('s','p','h','d') |
Definition at line 1250 of file PiSmmCore.h.
#define POOL_OVERHEAD (sizeof(POOL_HEADER) + sizeof(POOL_TAIL)) |
Definition at line 1267 of file PiSmmCore.h.
#define POOL_TAIL_SIGNATURE SIGNATURE_32('s','p','t','l') |
Definition at line 1259 of file PiSmmCore.h.
#define PROTOCOL_ENTRY_SIGNATURE SIGNATURE_32('s','p','t','e') |
Definition at line 161 of file PiSmmCore.h.
#define PROTOCOL_INTERFACE_SIGNATURE SIGNATURE_32('s','p','i','f') |
Definition at line 180 of file PiSmmCore.h.
#define PROTOCOL_NOTIFY_SIGNATURE SIGNATURE_32('s','p','t','n') |
Definition at line 200 of file PiSmmCore.h.
#define SMI_ENTRY_SIGNATURE SIGNATURE_32('s','m','i','e') |
Definition at line 76 of file PiSmmCore.h.
#define SMI_HANDLER_SIGNATURE SIGNATURE_32('s','m','i','h') |
Definition at line 86 of file PiSmmCore.h.
enum SMM_POOL_TYPE |
Definition at line 1277 of file PiSmmCore.h.
VOID ConvertSmmMemoryMapEntry | ( | IN EFI_MEMORY_TYPE | Type, |
IN EFI_PHYSICAL_ADDRESS | Memory, | ||
IN UINTN | NumberOfPages, | ||
IN BOOLEAN | AddRegion | ||
) |
VOID CoreFreeMemoryMapStack | ( | VOID | ) |
VOID RegisterSmramProfileHandler | ( | VOID | ) |
Register SMRAM profile handler.
Definition at line 2416 of file SmramProfileRecord.c.
EFI_STATUS RegisterSmramProfileImage | ( | IN EFI_SMM_DRIVER_ENTRY * | DriverEntry, |
IN BOOLEAN | RegisterToDxe | ||
) |
Register SMM image to SMRAM profile.
DriverEntry | SMM image info. |
RegisterToDxe | Register image to DXE. |
Register SMM image to SMRAM profile.
DriverEntry | SMM image info. |
RegisterToDxe | Register image to DXE. |
Definition at line 756 of file SmramProfileRecord.c.
EFI_STATUS EFIAPI SmiHandlerProfileRegisterHandler | ( | IN SMI_HANDLER_PROFILE_PROTOCOL * | This, |
IN EFI_GUID * | HandlerGuid, | ||
IN EFI_SMM_HANDLER_ENTRY_POINT2 | Handler, | ||
IN PHYSICAL_ADDRESS | CallerAddress, | ||
IN VOID *Context | OPTIONAL, | ||
IN UINTN ContextSize | OPTIONAL | ||
) |
This function is called by SmmChildDispatcher module to report a new SMI handler is registered, to SmmCore.
This | The protocol instance |
HandlerGuid | The GUID to identify the type of the handler. For the SmmChildDispatch protocol, the HandlerGuid must be the GUID of SmmChildDispatch protocol. |
Handler | The SMI handler. |
CallerAddress | The address of the module who registers the SMI handler. |
Context | The context of the SMI handler. For the SmmChildDispatch protocol, the Context must match the one defined for SmmChildDispatch protocol. |
ContextSize | The size of the context in bytes. For the SmmChildDispatch protocol, the Context must match the one defined for SmmChildDispatch protocol. |
EFI_SUCCESS | The information is recorded. |
EFI_OUT_OF_RESOURCES | There is no enough resource to record the information. |
Definition at line 1238 of file SmiHandlerProfile.c.
EFI_STATUS EFIAPI SmiHandlerProfileUnregisterHandler | ( | IN SMI_HANDLER_PROFILE_PROTOCOL * | This, |
IN EFI_GUID * | HandlerGuid, | ||
IN EFI_SMM_HANDLER_ENTRY_POINT2 | Handler, | ||
IN VOID *Context | OPTIONAL, | ||
IN UINTN ContextSize | OPTIONAL | ||
) |
This function is called by SmmChildDispatcher module to report an existing SMI handler is unregistered, to SmmCore.
This | The protocol instance |
HandlerGuid | The GUID to identify the type of the handler. For the SmmChildDispatch protocol, the HandlerGuid must be the GUID of SmmChildDispatch protocol. |
Handler | The SMI handler. |
Context | The context of the SMI handler. If it is NOT NULL, it will be used to check what is registered. |
ContextSize | The size of the context in bytes. If Context is NOT NULL, it will be used to check what is registered. |
EFI_SUCCESS | The original record is removed. |
EFI_NOT_FOUND | There is no record for the HandlerGuid and handler. |
Definition at line 1319 of file SmiHandlerProfile.c.
EFI_STATUS EFIAPI SmiHandlerRegister | ( | IN EFI_SMM_HANDLER_ENTRY_POINT2 | Handler, |
IN CONST EFI_GUID *HandlerType | OPTIONAL, | ||
OUT EFI_HANDLE * | DispatchHandle | ||
) |
Registers a handler to execute within SMM.
Handler | Handler service function pointer. |
HandlerType | Points to the handler type or NULL for root SMI 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 SmiHandlerUnRegister | ( | IN EFI_HANDLE | DispatchHandle | ) |
EFI_STATUS EFIAPI SmiManage | ( | IN CONST EFI_GUID * | HandlerType, |
IN CONST VOID *Context | OPTIONAL, | ||
IN OUT VOID *CommBuffer | OPTIONAL, | ||
IN OUT UINTN *CommBufferSize | OPTIONAL | ||
) |
Manage SMI of a particular type.
HandlerType | Points to the handler type or NULL for root SMI 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 SMI 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 SMI of a particular type.
HandlerType | Points to the handler type or NULL for root SMI 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 SMI sources could not be quiesced. |
EFI_NOT_FOUND | Interrupt source was not handled or quiesced. |
EFI_SUCCESS | Interrupt source was handled and quiesced. |
VOID SmmAddMemoryRegion | ( | IN EFI_PHYSICAL_ADDRESS | MemBase, |
IN UINT64 | MemLength, | ||
IN EFI_MEMORY_TYPE | Type, | ||
IN UINT64 | Attributes | ||
) |
EFI_STATUS EFIAPI SmmAllocatePages | ( | 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 SmmAllocatePool | ( | 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 SmmCoreGetMemoryMap | ( | 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 SmmCoreInitializeMemoryAttributesTable | ( | VOID | ) |
Initialize MemoryAttributes support.
Initialize MemoryAttributesTable support.
Definition at line 518 of file MemoryAttributesTable.c.
VOID SmmCoreInitializeSmiHandlerProfile | ( | VOID | ) |
Initialize SmiHandler profile feature.
Definition at line 1401 of file SmiHandlerProfile.c.
EFI_STATUS EFIAPI SmmCoreUpdateProfile | ( | IN PHYSICAL_ADDRESS | CallerAddress, |
IN MEMORY_PROFILE_ACTION | Action, | ||
IN EFI_MEMORY_TYPE | MemoryType, | ||
IN UINTN | Size, | ||
IN VOID * | Buffer, | ||
IN CHAR8 *ActionString | OPTIONAL | ||
) |
Update SMRAM profile information.
CallerAddress | Address of caller who call Allocate or Free. |
Action | This Allocate or Free action. |
MemoryType | Memory type. EfiMaxMemoryType means the MemoryType is unknown. |
Size | Buffer size. |
Buffer | Buffer address. |
ActionString | String for memory profile action. Only needed for user defined allocate action. |
Definition at line 1476 of file SmramProfileRecord.c.
VOID SmmDisplayDiscoveredNotDispatched | ( | VOID | ) |
Traverse the discovered list for any drivers that were discovered but not loaded because the dependency expressions evaluated to false.
Definition at line 1526 of file Dispatcher.c.
EFI_STATUS EFIAPI SmmDriverDispatchHandler | ( | 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 SMM handler dispatch or communicate-based callback.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
This function is the main entry point for an SMM handler dispatch or communicate-based callback.
Event notification that is fired every time a FV dispatch protocol is added. More than one protocol may have been added when this event is fired, so you must loop on SmmLocateHandle () to see how many protocols were added and do the following to each FV: If the Fv has already been processed, skip it. If the Fv has not been processed then mark it as being processed, as we are about to process it. Read the Fv and add any driver in the Fv to the mDiscoveredList.The mDiscoveredList is never free'ed and contains variables that define the other states the SMM driver transitions to.. While you are at it read the A Priori file into memory. Place drivers in the A Priori list onto the mScheduledQueue.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
Definition at line 1284 of file Dispatcher.c.
EFI_STATUS EFIAPI SmmEfiNotAvailableYetArg5 | ( | UINTN | Arg1, |
UINTN | Arg2, | ||
UINTN | Arg3, | ||
UINTN | Arg4, | ||
UINTN | Arg5 | ||
) |
Place holder function until all the SMM System Table Service are available.
Arg1 | Undefined |
Arg2 | Undefined |
Arg3 | Undefined |
Arg4 | Undefined |
Arg5 | Undefined |
Place holder function until all the SMM System Table Service are available.
Note: This function is only used by SMRAM invocation. It is never used by DXE invocation.
Arg1 | Undefined |
Arg2 | Undefined |
Arg3 | Undefined |
Arg4 | Undefined |
Arg5 | Undefined |
Definition at line 125 of file PiSmmCore.c.
EFI_STATUS EFIAPI SmmEndOfDxeHandler | ( | 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 SMM handler dispatch or communicate-based callback.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
Software SMI handler that is called when the EndOfDxe event is signalled. This function installs the SMM EndOfDxe Protocol so SMM Drivers are informed that platform code will invoke 3rd part code.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
Definition at line 436 of file PiSmmCore.c.
EFI_STATUS EFIAPI SmmEndOfS3ResumeHandler | ( | IN EFI_HANDLE | DispatchHandle, |
IN CONST VOID *Context | OPTIONAL, | ||
IN OUT VOID *CommBuffer | OPTIONAL, | ||
IN OUT UINTN *CommBufferSize | OPTIONAL | ||
) |
Software SMI handler that is called when the EndOfS3Resume event is trigged. This function installs the SMM EndOfS3Resume Protocol so SMM Drivers are informed that S3 resume has finished.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
Software SMI handler that is called when the EndOfS3Resume signal is triggered. This function installs the SMM EndOfS3Resume Protocol so SMM Drivers are informed that S3 resume has finished.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
Definition at line 569 of file PiSmmCore.c.
VOID SmmEntryPointMemoryManagementHook | ( | VOID | ) |
Hook function used to set all Guard pages after entering SMM mode.
Definition at line 1218 of file HeapGuard.c.
EFI_STATUS EFIAPI SmmExitBootServicesHandler | ( | 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 SMM handler dispatch or communicate-based callback.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
Software SMI handler that is called when an Exit Boot Services event is signalled. Then the SMM Core also install SMM Exit Boot Services protocol to notify SMM driver that system enter exit boot services.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
Definition at line 214 of file PiSmmCore.c.
PROTOCOL_ENTRY * SmmFindProtocolEntry | ( | IN EFI_GUID * | Protocol, |
IN BOOLEAN | Create | ||
) |
PROTOCOL_INTERFACE * SmmFindProtocolInterface | ( | 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 SmmFreePages | ( | 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 SmmFreePool | ( | 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 SmmHandleProtocol | ( | 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. |
VOID SmmInitializeMemoryServices | ( | IN UINTN | SmramRangeCount, |
IN EFI_SMRAM_DESCRIPTOR * | SmramRanges | ||
) |
EFI_STATUS EFIAPI SmmInstallConfigurationTable | ( | IN CONST EFI_SMM_SYSTEM_TABLE2 * | SystemTable, |
IN CONST EFI_GUID * | Guid, | ||
IN VOID * | Table, | ||
IN UINTN | TableSize | ||
) |
The SmmInstallConfigurationTable() 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 34 of file InstallConfigurationTable.c.
EFI_STATUS EFIAPI SmmInstallProtocolInterface | ( | IN OUT EFI_HANDLE * | UserHandle, |
IN EFI_GUID * | Protocol, | ||
IN EFI_INTERFACE_TYPE | InterfaceType, | ||
IN VOID * | Interface | ||
) |
Wrapper function to SmmInstallProtocolInterfaceNotify. 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 SmmInstallProtocolInterfaceNotify | ( | 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 SmmInternalAllocatePages | ( | IN EFI_ALLOCATE_TYPE | Type, |
IN EFI_MEMORY_TYPE | MemoryType, | ||
IN UINTN | NumberOfPages, | ||
OUT EFI_PHYSICAL_ADDRESS * | Memory, | ||
IN BOOLEAN | NeedGuard | ||
) |
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 |
NeedGuard | Flag to indicate Guard page is needed or not |
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. |
[in] | NeedGuard | Flag to indicate Guard page is needed or not |
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 SmmInternalAllocatePool | ( | 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 SmmInternalFreePages | ( | IN EFI_PHYSICAL_ADDRESS | Memory, |
IN UINTN | NumberOfPages, | ||
IN BOOLEAN | IsGuarded | ||
) |
Frees previous allocated pages.
Memory | Base address of memory being freed |
NumberOfPages | The number of pages to free |
IsGuarded | Flag to indicate if the memory is guarded or not |
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. |
[in] | IsGuarded | Is the memory to free guarded or not. |
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 SmmInternalFreePagesEx | ( | IN EFI_PHYSICAL_ADDRESS | Memory, |
IN UINTN | NumberOfPages, | ||
IN BOOLEAN | AddRegion | ||
) |
Frees previous allocated pages.
[in] | Memory | Base address of memory being freed. |
[in] | NumberOfPages | The number of pages to free. |
[in] | AddRegion | If this memory is new added region. |
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 SmmInternalFreePool | ( | 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 SmmIsSchedulable | ( | IN EFI_SMM_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 168 of file Dependency.c.
EFI_STATUS EFIAPI SmmLegacyBootHandler | ( | 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 SMM handler dispatch or communicate-based callback.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
Software SMI handler that is called when a Legacy Boot event is signalled. The SMM Core uses this signal to know that a Legacy Boot has been performed and that gSmmCorePrivate that is shared between the UEFI and SMM execution environments can not be accessed from SMM anymore since that structure is considered free memory by a legacy OS. Then the SMM Core also install SMM Legacy Boot protocol to notify SMM driver that system enter legacy boot.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
Definition at line 159 of file PiSmmCore.c.
EFI_STATUS EFIAPI SmmLocateHandle | ( | 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 SmmLocateHandleBuffer | ( | 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 SmmLocateHandle() 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 SmmLocateProtocol | ( | IN EFI_GUID * | Protocol, |
IN VOID *Registration | OPTIONAL, | ||
OUT VOID ** | Interface | ||
) |
Return the first Protocol Interface that matches the Protocol GUID. If Registration is pasased 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 SmmNotifyProtocol | ( | IN PROTOCOL_INTERFACE * | Prot | ) |
EFI_STATUS EFIAPI SmmReadyToBootHandler | ( | 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 SMM handler dispatch or communicate-based callback.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
Software SMI handler that is called when an Ready To Boot event is signalled. Then the SMM Core also install SMM Ready To Boot protocol to notify SMM driver that system enter ready to boot.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
Definition at line 298 of file PiSmmCore.c.
EFI_STATUS EFIAPI SmmReadyToLockHandler | ( | 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 SMM handler dispatch or communicate-based callback.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
Software SMI handler that is called when the DxeSmmReadyToLock protocol is added or if gEfiEventReadyToBootGuid is signalled. This function unregisters the Software SMIs that are nor required after SMRAM is locked and installs the SMM Ready To Lock Protocol so SMM Drivers are informed that SMRAM is about to be locked. It also verifies the SMM CPU I/O 2 Protocol has been installed and NULLs gBS and gST because they can not longer be used after SMRAM is locked.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
Definition at line 346 of file PiSmmCore.c.
EFI_STATUS EFIAPI SmmRegisterProtocolNotify | ( | IN CONST EFI_GUID * | Protocol, |
IN EFI_SMM_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 SmmS3SmmInitDoneHandler | ( | IN EFI_HANDLE | DispatchHandle, |
IN CONST VOID *Context | OPTIONAL, | ||
IN OUT VOID *CommBuffer | OPTIONAL, | ||
IN OUT UINTN *CommBufferSize | OPTIONAL | ||
) |
Software SMI handler that is called when the S3SmmInitDone signal is triggered. This function installs the SMM S3SmmInitDone Protocol so SMM Drivers are informed that S3 SMM initialization has been done.
DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
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-SMM environment into an SMM environment. |
CommBufferSize | The size of the CommBuffer. |
Definition at line 510 of file PiSmmCore.c.
EFI_STATUS EFIAPI SmmUninstallProtocolInterface | ( | 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. |
VOID SmramProfileInit | ( | VOID | ) |
Initialize SMRAM profile.
Definition at line 647 of file SmramProfileRecord.c.
VOID SmramProfileInstallProtocol | ( | VOID | ) |
Install SMRAM profile protocol.
Definition at line 690 of file SmramProfileRecord.c.
VOID SmramProfileReadyToLock | ( | VOID | ) |
SMRAM profile ready to lock callback function.
Definition at line 1550 of file SmramProfileRecord.c.
EFI_STATUS UnregisterSmramProfileImage | ( | IN EFI_SMM_DRIVER_ENTRY * | DriverEntry, |
IN BOOLEAN | UnregisterFromDxe | ||
) |
Unregister image from SMRAM profile.
DriverEntry | SMM image info. |
UnregisterToDxe | Unregister image from DXE. |
Unregister image from SMRAM profile.
DriverEntry | SMM image info. |
UnregisterFromDxe | Unregister image from DXE. |
Definition at line 911 of file SmramProfileRecord.c.
|
extern |
|
extern |
|
extern |
Definition at line 14 of file PiSmmCore.c.
|
extern |
Definition at line 19 of file PiSmmCore.c.
|
extern |
Definition at line 102 of file PiSmmCore.c.
|
extern |
Definition at line 103 of file PiSmmCore.c.
|
extern |
Definition at line 105 of file PiSmmCore.c.
|
extern |
Definition at line 107 of file PiSmmCore.c.
|
extern |
|
extern |