TianoCore EDK2 master
|
#include "PiSmmCore.h"
Go to the source code of this file.
SMM Core Main Entry Point
Copyright (c) 2009 - 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PiSmmCore.c.
BOOLEAN InternalIsBufferOverlapped | ( | IN UINT8 * | Buff1, |
IN UINTN | Size1, | ||
IN UINT8 * | Buff2, | ||
IN UINTN | Size2 | ||
) |
Determine if two buffers overlap in memory.
[in] | Buff1 | Pointer to first buffer |
[in] | Size1 | Size of Buff1 |
[in] | Buff2 | Pointer to second buffer |
[in] | Size2 | Size of Buff2 |
TRUE | Buffers overlap in memory. |
TRUE | Math error. Prevents potential math over and underflows. |
FALSE | Buffer doesn't overlap. |
Definition at line 627 of file PiSmmCore.c.
VOID SmmCoreInstallLoadedImage | ( | VOID | ) |
Install LoadedImage protocol for SMM Core.
Definition at line 795 of file PiSmmCore.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.
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 | ||
) |
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 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 EFIAPI SmmEntryPoint | ( | IN CONST EFI_SMM_ENTRY_CONTEXT * | SmmEntryContext | ) |
The main entry point to SMM Foundation.
Note: This function is only used by SMRAM invocation. It is never used by DXE invocation.
SmmEntryContext | Processor information and functionality needed by SMM Foundation. |
Definition at line 669 of file PiSmmCore.c.
EFI_STATUS EFIAPI SmmExitBootServicesHandler | ( | 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 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.
EFI_STATUS EFIAPI SmmLegacyBootHandler | ( | 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 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 SmmMain | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The Entry Point for SMM Core
Install DXE Protocols and reload SMM Core into SMRAM and register SMM Core EntryPoint on the SMI vector.
Note: This function is called for both DXE invocation and SMRAM invocation.
ImageHandle | The firmware allocated handle for the EFI image. |
SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point is executed successfully. |
Other | Some error occurred when executing this entry point. |
Definition at line 890 of file PiSmmCore.c.
EFI_STATUS EFIAPI SmmReadyToBootHandler | ( | 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 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 | ||
) |
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 SmmS3EntryCallBack | ( | IN EFI_HANDLE | DispatchHandle, |
IN CONST VOID *Context | OPTIONAL, | ||
IN OUT VOID *CommBuffer | OPTIONAL, | ||
IN OUT UINTN *CommBufferSize | OPTIONAL | ||
) |
Main entry point for an SMM handler dispatch or communicate-based callback.
[in] | DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
[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-SMM environment into an SMM environment. |
[in,out] | CommBufferSize | The size of the CommBuffer. |
EFI_SUCCESS | The interrupt was handled and quiesced. No other handlers should still be called. |
EFI_WARN_INTERRUPT_SOURCE_QUIESCED | The interrupt has been quiesced but other handlers should still be called. |
EFI_WARN_INTERRUPT_SOURCE_PENDING | The interrupt is still pending and other handlers should still be called. |
EFI_INTERRUPT_PENDING | The interrupt could not be quiesced. |
Definition at line 271 of file PiSmmCore.c.
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.
SMM_CORE_PRIVATE_DATA* gSmmCorePrivate |
Definition at line 14 of file PiSmmCore.c.
EFI_SMM_SYSTEM_TABLE2 gSmmCoreSmst |
Definition at line 19 of file PiSmmCore.c.
BOOLEAN mAcpiS3Enable = FALSE |
Definition at line 78 of file PiSmmCore.c.
BOOLEAN mDuringS3Resume = FALSE |
Definition at line 72 of file PiSmmCore.c.
UINTN mFullSmramRangeCount |
Definition at line 102 of file PiSmmCore.c.
EFI_SMRAM_DESCRIPTOR* mFullSmramRanges |
Definition at line 103 of file PiSmmCore.c.
BOOLEAN mInLegacyBoot = FALSE |
Definition at line 66 of file PiSmmCore.c.
EFI_SMM_DRIVER_ENTRY* mSmmCoreDriverEntry |
Definition at line 105 of file PiSmmCore.c.
EFI_LOADED_IMAGE_PROTOCOL* mSmmCoreLoadedImage |
Definition at line 107 of file PiSmmCore.c.
SMM_CORE_SMI_HANDLERS mSmmCoreS3SmiHandlers[] |
Definition at line 96 of file PiSmmCore.c.
SMM_CORE_SMI_HANDLERS mSmmCoreSmiHandlers[] |
Definition at line 83 of file PiSmmCore.c.