TianoCore EDK2 master
Loading...
Searching...
No Matches
Smi.c File Reference
#include "PiSmmCore.h"

Go to the source code of this file.

Functions

SMI_ENTRY *EFIAPI SmmCoreFindSmiEntry (IN EFI_GUID *HandlerType, IN BOOLEAN Create)
 
BOOLEAN RemoveSmiHandler (IN SMI_HANDLER *SmiHandler, IN SMI_ENTRY *SmiEntry)
 
EFI_STATUS EFIAPI SmiManage (IN CONST EFI_GUID *HandlerType, IN CONST VOID *Context OPTIONAL, IN OUT VOID *CommBuffer OPTIONAL, IN OUT UINTN *CommBufferSize OPTIONAL)
 
EFI_STATUS EFIAPI SmiHandlerRegister (IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler, IN CONST EFI_GUID *HandlerType OPTIONAL, OUT EFI_HANDLE *DispatchHandle)
 
EFI_STATUS EFIAPI SmiHandlerUnRegister (IN EFI_HANDLE DispatchHandle)
 

Variables

UINTN mSmiManageCallingDepth = 0
 
LIST_ENTRY mSmiEntryList = INITIALIZE_LIST_HEAD_VARIABLE (mSmiEntryList)
 
SMI_ENTRY mRootSmiEntry
 

Detailed Description

SMI management.

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

Definition in file Smi.c.

Function Documentation

◆ RemoveSmiHandler()

BOOLEAN RemoveSmiHandler ( IN SMI_HANDLER SmiHandler,
IN SMI_ENTRY SmiEntry 
)

Remove SmiHandler and free the memory it used. If SmiEntry is empty, remove SmiEntry and free the memory it used.

Parameters
SmiHandlerPoints to SMI handler.
SmiEntryPoints to SMI Entry or NULL for root SMI handlers.
Return values
TRUESmiEntry is removed.
FALSESmiEntry is not removed.

Definition at line 98 of file Smi.c.

◆ SmiHandlerRegister()

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.

Parameters
HandlerHandler service function pointer.
HandlerTypePoints to the handler type or NULL for root SMI 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 334 of file Smi.c.

◆ SmiHandlerUnRegister()

EFI_STATUS EFIAPI SmiHandlerUnRegister ( IN EFI_HANDLE  DispatchHandle)

Unregister a handler in SMM.

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 394 of file Smi.c.

◆ SmiManage()

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.

Parameters
HandlerTypePoints to the handler type or NULL for root SMI 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 SMI sources could not be quiesced.
EFI_NOT_FOUNDInterrupt source was not handled or quiesced.
EFI_SUCCESSInterrupt source was handled and quiesced.

Definition at line 137 of file Smi.c.

◆ SmmCoreFindSmiEntry()

SMI_ENTRY *EFIAPI SmmCoreFindSmiEntry ( IN EFI_GUID HandlerType,
IN BOOLEAN  Create 
)

Finds the SMI entry for the requested handler type.

Parameters
HandlerTypeThe type of the interrupt
CreateCreate a new entry if not found
Returns
SMI entry

Definition at line 36 of file Smi.c.

Variable Documentation

◆ mRootSmiEntry

SMI_ENTRY mRootSmiEntry
Initial value:
= {
SMI_ENTRY_SIGNATURE,
INITIALIZE_LIST_HEAD_VARIABLE (mRootSmiEntry.AllEntries),
{ 0 },
INITIALIZE_LIST_HEAD_VARIABLE (mRootSmiEntry.SmiHandlers),
}
#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead)
Definition: BaseLib.h:2904

Definition at line 18 of file Smi.c.

◆ mSmiEntryList

LIST_ENTRY mSmiEntryList = INITIALIZE_LIST_HEAD_VARIABLE (mSmiEntryList)

Definition at line 16 of file Smi.c.

◆ mSmiManageCallingDepth

UINTN mSmiManageCallingDepth = 0

Definition at line 14 of file Smi.c.