American Megatrends, Inc.

Smm

Copyright

Release Notes

© American Megatrends, Inc.


Release Notes - NDA Required

Note: Always download the latest CHM.

Component Information:

Component Name: | SMM
Component Type: | e-Module
Release Date: | 4/4/2012
Source Control Label: | 4.6.3_SMM_46
Source Control Location: | SS: Alaska;$/Alaska/SOURCE/Modules/SMM

Component Description:

Filename | Description
Smm.cif | Cif file for SMM Component.
Smm.chm | CHM file for SMM Component.
SMM.sdl | SDL token file for SMM.
SmmPrivateShared.h | Header for declarations that are common between SMM Base and SMM dispatcher.
SmmHdr.equ | Header for declarations that are common between SMM Base and SMM dispatcher.
SmmReleaseNotes.txt | Release notes for SMM Module.
SmmDispatcher.cif | Cif file for SMM Dispatcher.
SmmDispatcher.sdl | SDL file for SMM Dispatcher.
SmmDispatcher.mak | Make file for SMM Dispatcher.
SmmEntry.asm | Assembly for SMM Entry point.
SmmDispatcher.c | Main Dispatcher core.
Smst.c | SMST functions.
SmmPiSmst.c | PI SMST functions
SmmMemoryManager.c | SMM Memory manager functions.
SmmDispatcherAsm.asm | Assembly library functions for Smm Dispatcher.
SmmDispatcher.dxs | Dxe file for Smm Dispatcher.
SmmBase.cif | Cif file for SmmBase.
SmmBase.sdl | Sdl file SmmBase.
SmmBase.mak | Makefile for SmmBase.
SmmInit.c | Initialize SMM.
SmmBase.c | SmmBase functions.
SmmBase2.c | SmmBase2 Functions.
SmmBase.dxs | Dxs file SmmBase.
SmmBaseAsm.asm | Assembly functions for SmmBase.
SmmProtocols.cif | Cif file for SMM Protocols.
SmmBase.h | SmmBase protocol header file.
SmmAccess.h | SmmAccess protocol header file.
SmmControl.h | SmmControl protocol header file.
SmmCpuState.h | SmmCpuState protocol header file.
SmmThunk.h | SmmThunk protocol header file.
SmmStatusCode.h | SmmStatusCode protocol header file.
SmmSwDispatch.h | SmmStatusCode protocol header file.
SmmSxDispatch.h | SmmStatusCode protocol header file.
SmmPowerButtonDispatch.h | SmmStatusCode protocol header file.
SmmStandbyButtonDispatch.h | SmmStatusCode protocol header file.
SmmUsbDispatch.h | SmmStatusCode protocol header file.
SmmGpiDispatch.h | SmmStatusCode protocol header file.
SmmPeriodicTimerDispatch.h | SmmStatusCode protocol header file.
SmmTcoDispatch.h | SmmStatusCode protocol header file.
SmmPiIncludes.cif | Cif file for PI Includes.
SmmPiIncludes.sdl | SDL file for PI Includes.
SmmPi.h | Include file for Smm PI.
SmmPiProtocol.cif | Cif file for SMM PI protocols.
SmmPiProtocols.sdl | SDL file for SMM PI protocols.
SmmBase2.h | SmmBase2 protocol header.
SmmAccess2.h | SmmAccess2 protocol header.
SmmControl2.h | SmmControl2 protocol header.
SmmCommunication.h | SmmCommunication protocol Header.
SmmCpu.h | SmmCPU protocol header for state save/restore.
SmmCpuIo2.h | SmmCpuIo2 protocol header.
SmmPciRootBridgeIo.h | SmmPciRootBridgeIo protocol header.
SmmReadyToLock.h | SmmReadToLock protocol header.
SmmStatusCode.h | SmmStatusCode protocol header.
SmmSwDispatch2.h | SmmSwDispatch2 protocol header.
SmmSxDispatch2.h | SmmSxDispatch2 protocol header.
SmmPowerButtonDispatch2.h | SmmPowerButtonDispatch2 protocol header.
SmmStandbyButtonDispatch2.h | SmmStandbyButtonDispatch2 protocol header.
SmmUsbDispatch2.h | SmmUsbDispatch2 protocol header.
SmmGpiDispatch2.h | SmmGpiDispatch2 protocol header.
SmmPeriodicTimerDispatch2.h | SmmPeriodicTimerDispatch2 protocol header.
SmmIoTrapDispatch2.h | SmmIoTrapDispatch2 protocol header.
AmiInternalSmmComm.h | AmiInternalSmmComm protocol header.
SmmCommunicate.cif | Cif file for Smm Communicate.
SmmCommunicate.sdl | Sdl file for Smm Communicate.
SmmCommunicate.c | Smm Communicate C file.
SmmCommunicate.dxs | Smm Communicate SMM dxs file.
SmmDxeCommunicate.dxs | Smm Communicate DXE dxs file.
SmmCommunicate.mak | Makefile for Smm Communicate.
PowerButton.cif | Cif file for Power Button.
PowerButton.sdl | SDL file for Power Button.
PowerButton.mak | Make file for Power Button.
PowerButton.c | Power Button functions.
PowerButton.dxs | Dxs file for PowerButton.

AMI Build Tools:

Tools Label: | 4.5.5_TOOLS_36 | Dated: | 2011-06-30
Visual eBios: | RSS.5.70.0171 | Dated: | 2010-10-04
Compiler Tool(s): | Microsoft Windows Driver Development Kit (DDK) Ver. 3790.1830

Notes:

Major updates:
  • 4.6.3_SMM_43 04-18-11
  • 4.6.3_SMM_36 11-25-08
  • 4.6.3_SMM_31 09-03-08
  • Do not use labels 4.6.3_SMM_30 - 4.6.3_SMM_35.
If you get these errors,
  • CpuLib_SmmRestoreCpuState or CpuLib_SmmSaveCpuState error see 4.5.3_SMM_41.
  • ICH_IOREG_PM1_TMR is undefined, see 4.6.3_SMM_36a.
  • S3 resume hangs in SMM, see 4.6.3_SMM_36.
  • Build Error for CPU_SmmMemoryInit, see 4.6.3_SMM_35.

Releases

4.6.3_SMM_46 - 4/4/2012

Bug fixes

  1. EIP 84198 - Fix PI 1.1 SMM Communication protocol, if used during UEFI OS, caused the system to hang. Very few projects if any currently use this. Most projects use SMM framework, and most if not all of the PI 1.1 projects do not use SMM Communicate protocol. The issue was caused by ConvertPointer() not converting ACPI Memory NVS address to virtual address, so type was changed to Runtime Services Data allocation.
    Files: SmmCommunicate.c

4.6.3_SMM_45 - 02/14/2012

Bug fixes

  1. EIP 78978 - Remove redundant authentication code, in which the redundant authentication code had an incorrect input parameter causing it to return error. This only affects secure boot.
    Files: SmmDriverDispatcher.c
  2. EIP 78457 - Fix issue that if BSP is switched in DXE, SMM may not bring all CPUs into SMM on the rare occasion that a SMI only generated on one socket of a two socket system.
    Files: SmmInit.c
  3. EIP 83005 - EDK libraries expect a DXE image handle on SMM driver entry point in SMM. Update the code to provide this for a framework SMM driver. The spec doesn't specify the Handle should be a DXE image handle. PI 1.1 SMM drivers provide a SMM image handle as before this update.
    Files: SmmBase.c, SmmDriverDispatcher.c

Improvements

  1. EIP 78978 - Cleanup of SmmLoadImage function Intel Reference code function - remove unused and removing unneeded variable initialization after AMI update.
    Files: SmmDriverDispatcher.c
  2. SDL token SMM_LEGACY_SUPPORT is removed because it is no longer referenced.
    Files: Smm.sdl
  3. Remove function legacy_handler that is code that is no longer referenced.
    Files: SmmEntry.asm

4.6.3_SMM_44 - 10/03/2011

Bug fixes

  1. EIP 71122 - Initialize gSmmBase before using in InitializeSmmPiSystemTable(). In Pi 1.1, system may hang randomly without this fix.
    Files: SmmDispatcher.c
  2. EIP 64115 - Create SMM image handle that a protocol can be installed on, so a new handle doesn't have to be created by SMM driver to install handles.
    Files: SmmBase.c
  3. EIP 64115 - SMM Communicate hangs in OS - make a runtime/SMM driver.
    Files: SmmCommunicate.c, SmmCommunicate.mak

New Feature

  1. EIP 67890 - Support power button handler as PI 1.1 driver
    Files: PowerButton.c, PowerButton.mak, PowerButton.dxs
  2. Add SMM Machine Check handler instead of jmp $. Now if a machine check occurs during SMM (extremely rare) the system will continue.
    No issues have been seen with the jmp $.
    Files: SmmDispatcher.c, SmmDispatcherAsm.asm

Improvements

  1. Separate DxeSmmReadyToLock from SmmReadyToLock
    Files: SmmInit.c, SmmReadyToLock.h, DxeSmmReadyToLock.h
  2. Add exclusions around typedef EFI_AP_PROCEDURE.
    Files: SmmPi.h
  3. Use tokens for SW SMI. Comment out publishing ACPI table for SMM Communication until ready for support.
    Files: SmmCommunicate.sdl, SmmCommunicate.c

4.6.3_SMM_43a - 6/09/2011

  1. EIP 61586 - Fixed minor SMM security issue. A Pointer outside of SMM is used to write outside of SMM, and this value is used by the SMM Base Protocol InSMM to return if inside of SMM or out. To exploit, one would need the exact BIOS, memory, and a hardware debugger to modify the pointer to update code inside of SMM to access the function call outside of SMM. Then, the exploit would have update a callback structure with an address outside of SMM. Fixed by not accessing a pointer outside of SMM.
    File: SmmDispatcher.c

4.6.3_SMM_43 - 4/18/2011

  1. Add PI 1.1 SMM Support. Framework SMM co-exists with PI 1.1. PI 1.1 requires core label 4.6.5.0 and Nehalem 40. If not using PI 1.1, core label or Nehalem label update is not required.
    Files: All SMM Files. Add PI 1.1 include files. Add PI 1.1 SMM Communicate files.
  2. SMM CPU IO protocol memory read/write is no longer limited to 4 GB.
    File: Smst.c

4.6.3_SMM_42 - 10/13/2010

  1. Fix compare to determine CPU that generated SW SMI. Issue is only in label 41.
    File: SmmDispatcher.c
  2. Reduce timeout to 1ms for syncing processors entering SMM. Timeout was too long.
    File: Smm.sdl
  3. Fix Compiler warning for Timeout->EndValue.
    File: SmmDispatcher.c

4.6.3_SMM_41 - 6/18/2010

  1. Fix timeout boundary condition bug.
    File: SmmDispatcher.c
  2. Add functions/structures for Save/Restore CPU state in SMM. This was added specifically to save/disable/restore CPU throttling. If throttling is enabled, CPU synchronization issues in SMM may occur:
    New CPU functions required:
    • VOID CpuLib_SmmRestoreCpuState(IN CPU_LIB_SMM_SAVE_RESTORE_DATA* State);
    • VOID CpuLib_SmmSaveCpuState(IN OUT CPU_LIB_SMM_SAVE_RESTORE_DATA* State);
    CPU_LIB_SMM_SAVE_RESTORE_DATA is CPU specific.
    See Intel Nehalem module 4.6.3_INTEL_Nehalem_29 file CpuCspLib.c.
    File: SmmDispatcher.c
  3. Bug fix: SmmSmstAllocatePages now returns correct status for input AllocateAddress.
    File: Smst.c
  4. Added AmiSmmInfo protocol. This was added for SMM RAS feature support.
    Files: SmmDispatcher.c, AmiSmmInfo.c
  5. Update CPU that generated SW SMI detection in case of multiple CPU generate SW SMI simultaneously. The CPU reported will the first CPU that matches SW_SMI_IO_ADDRESS not just the first CPU found that generated a SW SMI.
    File: SmmDispatcher.c
  6. Add support for APs to execute code non-blocking for RAS.
    File Smst.c.
  7. Added some additional asserts on allocating SMM memory during SMM initialization.
    File SmmDispatcher.c
  8. Typecast updates to support /w4 compiler option.
    Files: Smst.c, SmmMemoryManager.c

4.6.3_SMM_40 - 2/3/2010

  1. upport paging memory above 4GB based on SDL token.
    Files: Smm.sdl, SmmBase.c
  2. Update so if allocation fails, memory is not allocated outside of SMM driver.
    File: SmmBase.c
  3. Use 64-bit prefex for fxsave and fxrstor. This saves some additional Floating point information.
    File: SmmEntry.asm
  4. Rename TIMEOUT to SMM_TIMEOUT
    File: SmmDispatcher.c
  5. Remove ASSERT for if BSP not started. It is not an error, if BSP is not started.
    File: SmmDispatcher.c

4.6.3_SMM_39a - 9/9/2009

Note: If using Nehalem module with x2APIC enabled processor, use Nehalem label 25.
  1. Use local x2APIC support token to wrap x2apic code. This so, function CPULib_IsLocalX2ApicEnabled is not needed if x2apic is not supported by processor family.
    File: SmmDispatcher.c

4.6.3_SMM_39

Note: The requires CPU module to support CSP function BOOLEAN CPULib_IsLocalX2ApicEnabled();
Note: See Nehalem label 24.
  1. SMM cleanup: Removed Legacy 16-bit registration-no longer used. Removed extra free pool.
    Files: SmmPrivateShared.h, SmmHdr.equ, SmmBase.c
  2. EIP #24914 - Add early local x2APIC support.
    Files: SmmDispatcher.c
  3. EIP #24824 - Correct order SmmCpuInfo structure. It's was ordered incorrectly the same as CpuInfo. Thus, the wrong APIC ID would be used when starting unstarted APs when the BSP was changed.
    File: SmmBase.c
  4. For all SMM Base functions that aren't avilable in BDS, return error not just skip processing. Currently, register function already returns error.
    File: SmmBase.c

4.6.3_SMM_38 - 06-01-09

  1. EIP #18671: Clear SW SMI status and set EOS inside SMM.
    Files: SmmPrivateShared.h, SmmDispatcher.c, SmmBase.c
  2. EIP #14800: Aptio 4.x SMI Code vulnerability: Disable call back inside SMM before BDS can launch option roms.
    File: SmmBase.c
  3. Remove unused token SMM_FORCE_BSP_CPU_0.
    File: Smm.sdl
  4. EIP #22087 - Always reinialize IDT in SMM even with AMI Debugger. Some processors place junk value in IDT.
    Files: SmmEntry.asm, SmmDispatcher.c

4.6.3_SMM_37 - 01-08-09

  1. EIP# 17900: Load a 32-bit TSS before switching long mode. If a 16-bit TSS exists before entering SMM, a 64-bit BIOS will hang.
    Files: SmmPrivateShared.h, SmmHdr.equ, SmmEntry.asm, SmmBase.c
  2. EIP #18423: Determine EBDA allocated memory before using. New EBDA allocations will cause existing offsets to change.
    Files: SmmPrivateShared.h, SmmDispatcher.c, SmmBase.c
  3. EIP #17767: Change for pointer returns 0 to NULL. Coding style change.
    File: SmmMemoryManager.c

4.6.3_SMM_36a - 12-01-08

  1. Replace using PM_BASE_ADDRESS + ICH_IOREG_PM1_TMR with PM_TMR_BLK_ADDRESS. Only ICH projects have ICH_IOREG_PM1_TMR defined.
    File: SmmDispatcher.c

4.6.3_SMM_36 - 11-25-08

Note: Must update CPU module for data to reinitialize in S3 resume. This affects if the system went into S3 during SMM. See 4.6.3_INTEL_Nehalem_17 file CpuCspLib.c array SmmBaseChangeCopy[]. This sets SMM initialization variable.
  1. SBSP always dispatches unless SBSP is not started. The any AP may dispatch. This required significant update of syncronization between CPUs.
    File: SmmDispatcher.c
  2. Reinitialize variables in S3Resume in case of S3 inside of SMM.
    Files: SmmDispatcher.c, SmmEntry.asm, SmmPrivateShared.h, SmmHdr.equ
  3. Use ACPI counter for timeouts.
    Files: SmmDispatcher.c, SMM.sdl
  4. Update variable gSmmBase numbering to match SmmBase.
    Files: SmmDispatcher.c
  5. Removed hlt from SMM Exception handler. Makes debugging easier.
    Files: SmmDispatcher.c
  6. Use 32-bit CPU count.
    Files: SmmBase.c, SmmPrivatedShared.h, SmmDispatcher.c

4.6.3_SMM_35 - 11-13-08

Note: Build Error for CPU_SmmMemoryInit if this function is not in the CPU CSP library.
Note: Further, this fixes SMM driver issues that depend on CurrentlyExecutingCpu.
  1. Dynamically update CurrentlyExecutingCpu in EFI_SMM_SYSTEM_TABLE to SMM BSP.
    File: SmmDispatcher.c
  2. Fix using SMM Allocate Pool of type AllocateMaxAddress.
    File: Smst.c
  3. Use library hook to program to fill CPU specific SMM memory.
    File: SmmBase.c

4.6.3_SMM_34 - 10-03-08

Note: This release fixes a race condition that the system may hang on SMST function SmmStartupThisAp.
  1. Made InSmm a runtime function.
    Files: SmmPrivateShared.h, SmmDispatcher.c, SmmBase.c, SmmBaseAsm.asm.
  2. Fixed race condition between SmmBspEntry and SmmApEntry.
    File: SmmDispatcher.c

4.6.3_SMM_33 - 09-15-08

  1. Initialize SMM_DISPATCHER_PRIVATE_STRUCT members HandlerListHead and FloatingPointSave.
    File: SmmBase.c

4.6.3_SMM_32 - 09-09-08

  1. Always disallow shell SMM drivers from loading new SMM drivers.
    File: SmmBase.sdl
  2. Separate SMM_BASE_PRIVATE_STRUCT into SMM_BASE_PRIVATE_STRUCT and SMM_DISPATCHER_PRIVATE_STRUCT. Once READY_TO_BOOT is signaled, SMM_BASE_PRIVATE_STRUCT outside of SMM won't be executed.
    Files: SmmPrivateShared.h, SmmHdr.equ, SmmBase.c, SmmDispatcher.c, SmmEntry.asm, Smst.c
  3. Add function EarlyAllocSmmMemory which allocate memory before the SMM memory manager.
    File: SmmBase.c
  4. Remove members from structures in SmmPrivateShared.h that is for SmmBase.c use only.
    Files: SmmPrivateShared.h, SmmHdr.equ, SmmBase.c
  5. Open/Close/Lock Smm at beginning/end of SmmBase.c entry point.
    File: SmmBase.c
  6. Use local function instead of using Boot Service CRC.
    File: Smst.c

4.6.3_SMM_31 - 09-03-08

  1. Make all CPUs have the same stack size. In label 30, only CPU 0 had 16k of stack. This could cause stack overflows.
    File: Smm.sdl
  2. VIA does not support CPUID eax = 0x8000_0008. Fix, so that VIA works.
    File: SmmBase.c
  3. SmmBase.dxs needs to to include Token.h.
    File: SmmBase.dxs
  4. Provide a Save and Restore SMM context chipset hooks such as cf8/cfc.
    Files: SmmDispatcher.c, SmmDispatcher.mak, SmmDispatcher.sdl, SmmPrivateShared.h
  5. For Bsp, use correct CPU not just 0.
    File: SmmDispatcher.c
  6. For special SmmBase software SMI, process SMM drivers.
    File: SmmDispatcher.c
  7. Remove Smm Cache code for Nehalem using #ifdef/#endif. (Always on).
    File: SmmEntry.asm, SmmBase.c
  8. Remove Oem porting files. Use SDL tokens instead.
    Deleted Files: SmmDispatcher.h, SmmDispatcherBoard.c

4.6.3_SMM_30 - 06-11-08 <<<< Do not use this label.

  1. If an error occurs in SmmBase.c because of AllocateEbda, this is because the SMM module is using an updated CSM which has added or change the protocol definition of AllocateEda. This can be resolved by updated CSM or by setting the SMM token SMM_THUNK_IN_CSM = 0. If you want to Support SMM thunk with SMM_THUNK_IN_CSM = 0, then SMM_THUNK_NO_AB_SEG must equal 0, and the A or B SMM segment must be supported.
  2. Changed SMM Entry so that any CPU can be BSP. Physical packages that are started will be sent a SMM IPI to start them. This required for Nehalem DP.
  3. A new token SMM_FORCE_BSP_CPU_0 was created, to force CPU 0 to be the BSP:
    • This can make SMM testing easier.
    • This can enable drivers to work without change that require CPU 0 to be BSP. For example, drivers that read/write MSRs on APs that expect CPU 1 to be the AP always.
  4. SmmDispatcherBoard was created for any OEM hooks. OEM hook SmmSaveRestoreStates(BOOLEAN Save) was created to save restore any SMM state needed.
  5. In private structure, SMM_BASE_PRIVATE_STRUCT, a pointer to an array of SMM_CPU_INFO for information about each CPU was added. Currently, this only contains if in SMM and its APIC ID.
Files Changed: Smm.sdl, SmmPrivateShared.h, SmmDispatcher.mak, SmmDispatcher.c, Smst.c, SmmBase.c, SmmDispatcher.h, SmmDispatcherBoard.c, SmmDispatcherAsm.asm


Function by File Name

AMIBIOS Function Reference

By File Name

The following is a list of the source files.
For a list in alphabetical order, see In Alphabetical Order.
For a list by segment, see By Segment.

  • AmiInternalSmmComm.h
  • AmiSmmInfo.h
  • DxeSmmReadyToLock.h
  • PowerButton.c
  • PowerButton.dxs
  • PowerButton.mak
  • SmmAccess.h
  • SmmAccess2.h
  • SmmBase.c
  • SmmBase.dxs
  • SmmBase.h
  • SmmBase.mak
  • SmmBase2.c
  • SmmBase2.h
  • SmmBaseAsm.asm
  • SmmCommunicate.c
  • SmmCommunicate.dxs
  • SmmCommunicate.mak
  • SmmCommunication.h
  • SmmControl.h
  • SmmControl2.h
  • SmmCpu.h
  • SmmCpuIo2.h
  • SmmCpuState.h
  • SmmDispatcher.c
  • SmmDispatcher.dxs
  • SmmDispatcher.h
  • SmmDispatcher.mak
  • SmmDispatcherAsm.asm
  • SmmDriverDispatcher.c
  • SmmDxeCommunicate.dxs
  • SmmEntry.asm
  • SmmGpiDispatch.h
  • SmmGpiDispatch2.h
  • SmmHdr.equ
  • SmmInit.c
  • SmmIoTrapDispatch2.h
  • SmmMemoryManager.c
  • SmmPciRootBridgeIo.h
  • SmmPeriodicTimerDispatch.h
  • SmmPeriodicTimerDispatch2.h
  • SmmPi.h
  • SmmPiSmst.c
  • SmmPowerButtonDispatch.h
  • SmmPowerButtonDispatch2.h
  • SmmPrivateShared.h
  • SmmReadyToLock.h
  • SmmStandbyButtonDispatch.h
  • SmmStandbyButtonDispatch2.h
  • SmmStatusCode.h
  • SmmSwDispatch.h
  • SmmSwDispatch2.h
  • SmmSxDispatch.h
  • SmmSxDispatch2.h
  • SmmTcoDispatch.h
  • SmmThunk.h
  • SmmUsbDispatch.h
  • SmmUsbDispatch2.h
  • Smst.c
Built on 12:15:26 04/04/12


AmiInternalSmmComm.h

Description:
Protocol used by SmmCommunication to Communication DXE driver know SMM has been installed.


AmiSmmInfo.h

Description:
Provide AMI Smm Info


DxeSmmReadyToLock.h

Description:
DxeSmmReadyToLock protocol definition


PowerButton.c

Description:
Provide functions to register and handle Powerbutton
functionality.  This code is generic and as long as PM
base address SDL token is defined properly this should
work fine.

The following functions are used in the file: PowerButton.c.

Function | Description
InitPowerButton | This is the entrypoint of the Power button driver.
InSmmFunction | This function is called from SMM during SMM registration.
NotInSmmFunction | This function is called from outside of SMM during SMM registration.
PowerButtonActivated | If the power button is pressed, then this function is called.


InitPowerButton in the PowerButton.c

Function : InitPowerButton

File: PowerButton.c
Description:
This is the entrypoint of the Power button driver.
Input:
IN EFI_HANDLE       ImageHandle
IN EFI_SYSTEM_TABLE *SystemTable
Output:
EFI_STATUS


InSmmFunction in the PowerButton.c

Function : InSmmFunction

File: PowerButton.c
Description:
This function is called from SMM during SMM registration.
Input:
IN EFI_HANDLE       ImageHandle
IN EFI_SYSTEM_TABLE *SystemTable
Output:
EFI_STATUS


NotInSmmFunction in the PowerButton.c

Function : NotInSmmFunction

File: PowerButton.c
Description:
This function is called from outside of SMM during SMM registration.
Input:
IN EFI_HANDLE       ImageHandle
IN EFI_SYSTEM_TABLE *SystemTable
Output:
EFI_STATUS


PowerButtonActivated in the PowerButton.c

Function : PowerButtonActivated

File: PowerButton.c
Description:
If the power button is pressed, then this function is called.
Input:
IN EFI_HANDLE                               DispatchHandle
IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT    *DispatchContext
Output:
VOID


PowerButton.dxs

Description:
Dependency file for the power button handler driver


PowerButton.mak

Description:
Make file for the SMM power button handler code


SmmAccess.h

Description:
This provides north bridge functions to open, close, lock,
and describe SMM space.

The following tables are used in the file: SmmAccess.h.

Table | Description
EFI_SMM_ACCESS_PROTOCOL | This provides north bridge functions to open, close, lock, and describe SMM space.


EFI_SMM_ACCESS_PROTOCOL in the SmmAccess.h

Table : EFI_SMM_ACCESS_PROTOCOL

File: SmmAccess.h
Fields:

Name | Type | Description
Open | EFI_SMM_OPEN | Access SMM space when in non-SMM mode.
Close | EFI_SMM_CLOSE | Close SMM space when in non-SMM mode.
Lock | EFI_SMM_LOCK | Do not allow access to SMM when in non-SMM Mode.
GetCapabilities | EFI_SMM_CAPABILITIES | Provide information for SMM memory areas.
LockState | BOOLEAN | TRUE if SMM memory is locked.
OpenState | BOOLEAN | TRUE if any SMM memory is opened.

Description:
This provides north bridge functions to open, close, lock,
and describe SMM space.


SmmAccess2.h

Description:
This provides north bridge functions to open, close, lock, and describe SMM space.


SmmBase.c

Description:
Provide functions to register drivers with SMM,
        determine if driver is in SMM Mode, register call backs,
provide callback buffer, return SMST table pointer,
        and Allocate memory.

The following functions are used in the file: SmmBase.c.

Function | Description
EfiSmmAllocatePool | Allocate buffer from SMM Memory.
EfiSmmCallBackService | Function for the SMM to call back.
EfiSmmCommunicate | Buffer location for EFI Call Back function.
EfiSmmFreePool | Free pool of memory.
EfiSmmGetSmstLocation | Returns a pointer to the Smst.
EfiSmmRegister | Register a driver with the SMM Handler. * Loads SMM PE32 Driver into SMM memory and give control to the entry point. * Or, loads SMM 16-bit driver into SMM memory. It is given control during SMM mode.
EfiSmmRegisterUnsupported | The SMM Base Protocol function Register return unsupported after BIOS is done executing.
EfiSmmUnregister | Removes handler from being called in SMM.
EfiSmmUnregisterUnsupported | The SMM Base Protocol function UnRegister return unsupported after BIOS is done executing.
SetDisallowRegistering | Don't allow registering handlers from SMM.
SmmAllocatePool | Does the actual work for EfiSmmAllocatePool.
SmmCommunicate | Does the actual work for EfiSmmCommunicate.
SmmFreePool | Does the actual work for EfiSmmFreePool.
SmmRegisterHandler | Does the actual work for EfiSmmRegisterHandler.
SmmUnregisterHandler | Does the actual work for EfiSmmUnregisterHandler.


EfiSmmAllocatePool in the SmmBase.c

Function : EfiSmmAllocatePool

File: SmmBase.c
Description:
Allocate buffer from SMM Memory.
Input:
IN EFI_SMM_BASE_PROTOCOL	*This
IN EFI_MEMORY_TYPE			PoolType
IN UINTN					Size
OUT VOID					**Buffer
Output:
EFI_STATUS
* EFI_SUCCESS - Allocation successful.
* EFI_OUT_OF_RESOURCES - Not enough space.


EfiSmmCallBackService in the SmmBase.c

Function : EfiSmmCallBackService

File: SmmBase.c
Description:
Function for the SMM to call back.
Input:
IN EFI_SMM_BASE_PROTOCOL		*This
IN EFI_HANDLE					SmmImageHandle
IN EFI_SMM_CALLBACK_ENTRY_POINT	CallbackAddress
IN BOOLEAN						MakeLast OPTIONAL
IN BOOLEAN						FloatingPointSave OPTIONAL
Output:
EFI_STATUS
* EFI_SUCCESS - Call back function set for Handle.
* EFI_OUT_OF_RESOURCES - Not enough memory to add callback.
* EFI_UNSUPPORTED - Caller not in SMM.


EfiSmmCommunicate in the SmmBase.c

Function : EfiSmmCommunicate

File: SmmBase.c
Description:
Buffer location for EFI Call Back function.
Input:
IN EFI_SMM_BASE_PROTOCOL	*This
IN EFI_HANDLE				ImageHandle
IN OUT VOID					*CommunicationBuffer
IN OUT UINTN				*SourceSize
Output:
EFI_STATUS
* EFI_SUCCESS - Buffer is set.
* EFI_INVALID_PARAMETER - Buffer is NULL


EfiSmmFreePool in the SmmBase.c

Function : EfiSmmFreePool

File: SmmBase.c
Description:
Free pool of memory.
Input:
IN EFI_SMM_BASE_PROTOCOL	*This
IN VOID						*Buffer
Output:
EFI_STATUS
* EFI_SUCCESS - Buffer freed
* EFI_INVALID_PARAMETER - Buffer invalid.


EfiSmmGetSmstLocation in the SmmBase.c

Function : EfiSmmGetSmstLocation

File: SmmBase.c
Description:
Returns a pointer to the Smst.
Input:
IN EFI_SMM_BASE_PROTOCOL	*This
IN OUT EFI_SMM_SYSTEM_TABLE	**Smst
Output:
EFI_STATUS
* EFI_SUCCESS - SMST address saved in *Smst.
* EFI_INVALID_PARAMETER - Smst = NULL.
* EFI_UNSUPPORTED - Not in SMM.


EfiSmmRegister in the SmmBase.c

Function : EfiSmmRegister

File: SmmBase.c
Description:
Register a driver with the SMM Handler.
* Loads SMM PE32 Driver into SMM memory and give control to the entry point.
* Or, loads SMM 16-bit driver into SMM memory. It is given control during SMM mode.
Input:
IN EFI_SMM_BASE_PROTOCOL	*This
IN EFI_DEVICE_PATH_PROTOCOL	*FilePath
IN VOID						*SourceBuffer OPTIONAL
IN UINTN					SourceSize
OUT EFI_HANDLE				*ImageHandle
IN BOOLEAN					LegacyIA32Binary OPTIONAL
Output:
EFI_STATUS
* EFI_SUCCESS - Driver was registered.
* EFI_OUT_OF_RESOURCES - No additional resources to load handler.
* EFI_INVALID_PARAMETER - Invalid inputs.


EfiSmmRegisterUnsupported in the SmmBase.c

Function : EfiSmmRegisterUnsupported

File: SmmBase.c
Description:
The SMM Base Protocol function Register return unsupported after
BIOS is done executing.
Input:
IN EFI_SMM_BASE_PROTOCOL	*This
IN EFI_DEVICE_PATH_PROTOCOL	*FilePath
IN VOID						*SourceBuffer OPTIONAL,
IN UINTN					SourceSize
OUT EFI_HANDLE				*ImageHandle
IN BOOLEAN					LegacyIA32Binary OPTIONAL
Output:
EFI_STATUS


EfiSmmUnregister in the SmmBase.c

Function : EfiSmmUnregister

File: SmmBase.c
Description:
Removes handler from being called in SMM.
Input:
IN EFI_SMM_BASE_PROTOCOL	*This
IN EFI_HANDLE				ImageHandle
Output:
EFI_STATUS
* EFI_SUCCESS - Driver was unregistered.
* EFI_INVALID_PARAMETER - Image Handle doesn't exist.


EfiSmmUnregisterUnsupported in the SmmBase.c

Function : EfiSmmUnregisterUnsupported

File: SmmBase.c
Description:
The SMM Base Protocol function UnRegister return unsupported after
BIOS is done executing.
Input:
IN EFI_SMM_BASE_PROTOCOL	*This
IN EFI_HANDLE				ImageHandle
Output:
EFI_STATUS


SetDisallowRegistering in the SmmBase.c

Function : SetDisallowRegistering

File: SmmBase.c
Description:
Don't allow registering handlers from SMM.
Input:
VOID
Output:
None


SmmAllocatePool in the SmmBase.c

Function : SmmAllocatePool

File: SmmBase.c
Description:
Does the actual work for EfiSmmAllocatePool.
Input:
VOID
Output:
None


SmmCommunicate in the SmmBase.c

Function : SmmCommunicate

File: SmmBase.c
Description:
Does the actual work for EfiSmmCommunicate.
Input:
VOID
Output:
VOID
Notes:
A runtime driver will have to call this function again for a virtual address.
Currently, virtual address are not automatically fixed up.


SmmFreePool in the SmmBase.c

Function : SmmFreePool

File: SmmBase.c
Description:
Does the actual work for EfiSmmFreePool.
Input:
VOID
Output:
None


SmmRegisterHandler in the SmmBase.c

Function : SmmRegisterHandler

File: SmmBase.c
Description:
Does the actual work for EfiSmmRegisterHandler.
Input:
VOID
Output:
None


SmmUnregisterHandler in the SmmBase.c

Function : SmmUnregisterHandler

File: SmmBase.c
Description:
Does the actual work for EfiSmmUnregisterHandler.
Input:
VOID
Output:
VOID


SmmBase.dxs

Description:
Dependency file for the SMM base driver


SmmBase.h

Description:
Smm Base Protocol header file.


SmmBase.mak

Description:
Make file for the SMM base code


SmmBase2.c

Description:
SmmBase2 Protocol

The following functions are used in the file: SmmBase2.c.

Function | Description
EfiSmmGetSmstLocation2 | Retruns a pointer to the Smst.


EfiSmmGetSmstLocation2 in the SmmBase2.c

Function : EfiSmmGetSmstLocation2

File: SmmBase2.c
Description:
Retruns a pointer to the Smst.
Input:
IN EFI_SMM_BASE_PROTOCOL	*This
IN OUT EFI_SMM_SYSTEM_TABLE	**Smst
Output:
EFI_STATUS
* EFI_SUCCESS - SMST address saved in *Smst.
* EFI_INVALID_PARAMETER - Smst = NULL.
* EFI_UNSUPPORTED - Not in SMM.


SmmBase2.h

Description:
PI Smm Base Protocol header file.


SmmBaseAsm.asm

Description:
File that contains assembly for Smm Dispatcher.

The following functions are used in the file: SmmBaseAsm.asm.

Function | Description
InSmm | Updates if *InSmm if in SMM.


InSmm in the SmmBaseAsm.asm

Function : InSmm

File: SmmBaseAsm.asm
Description:
Updates if *InSmm if in SMM.
Input:
IN EFI_SMM_BASE_PROTOCOL	*This,
OUT BOOLEAN					*InSmm
Output:
EFI_STATUS
Modified:
Nothing


SmmCommunicate.c

Description:
Provide SMM Communicate Protocol

The following functions are used in the file: SmmCommunicate.c.

Function | Description
CommunicateCallBack | Sw SMI callback to call communicate functions.
InitAcpi | Initialize Acpi SMM Communicate part.
InitDxe | Initialize DXE SMM Communicate part.
InitSmm | Initialize SMM part of SMM Communicate.
SmmCommunicate | SmmCommunicate Protocol function. This will generate SW SMI.
SmmCommunicateEntry | Smm Communciation entry point to initialize provide SMM Communicate Protocol.
VirtAddrChg | Change pointer of gCommunicateData to virtual address.


CommunicateCallBack in the SmmCommunicate.c

Function : CommunicateCallBack

File: SmmCommunicate.c
Description:
Sw SMI callback to call communicate functions.
Input:
IN EFI_HANDLE DispatchHandle  - Unused
IN CONST VOID *Context OPTIONAL - Unused
IN OUT VOID *CommBuffer OPTIONAL  - Unused
IN OUT UINTN *CommBufferSize OPTIONAL  - Unused
Output:
EFI_STATUS


InitAcpi in the SmmCommunicate.c

Function : InitAcpi

File: SmmCommunicate.c
Description:
Initialize Acpi SMM Communicate part.
Input:
VOID
Output:
EFI_STATUS


InitDxe in the SmmCommunicate.c

Function : InitDxe

File: SmmCommunicate.c
Description:
Initialize DXE SMM Communicate part.
Input:
VOID
Output:
EFI_STATUS


InitSmm in the SmmCommunicate.c

Function : InitSmm

File: SmmCommunicate.c
Description:
Initialize SMM part of SMM Communicate.
Input:
VOID
Output:
EFI_STATUS


SmmCommunicate in the SmmCommunicate.c

Function : SmmCommunicate

File: SmmCommunicate.c
Description:

 SmmCommunicate
 Protocol function. This will generate SW SMI.
Input:
IN CONST EFI_SMM_COMMUNICATION_PROTOCOL *This,
IN OUT VOID     *CommBuffer,
IN OUT UINTN    *CommSize
Output:
EFI_STATUS


SmmCommunicateEntry in the SmmCommunicate.c

Function : SmmCommunicateEntry

File: SmmCommunicate.c
Description:
Smm Communciation entry point to initialize provide SMM Communicate Protocol.
Input:
IN EFI_HANDLE       ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
Output:
EFI_STATUS


VirtAddrChg in the SmmCommunicate.c

Function : VirtAddrChg

File: SmmCommunicate.c
Description:
Change pointer of gCommunicateData to virtual address.
Input:
IN EFI_EVENT Event
IN VOID *Context
Output:
VOID


SmmCommunicate.dxs

Description:
Dependency file for the SMM Communicate driver


SmmCommunicate.mak

Description:
Make file for the SMM Communicate code


SmmCommunication.h

Description:
PI Smm Base Protocol header file.


SmmControl.h

Description:
Provides south bridge functions for triggering and clearing SMIs.

The following tables are used in the file: SmmControl.h.

Table | Description
EFI_SMM_CONTROL_PROTOCOL | Provides south bridge functions for triggering and clearing SMIs.


EFI_SMM_CONTROL_PROTOCOL in the SmmControl.h

Table : EFI_SMM_CONTROL_PROTOCOL

File: SmmControl.h
Fields:

Name | Type | Description
Trigger | EFI_SMM_ACTIVATE | Trigger SMI and provide it with a byte code.
Clear | EFI_SMM_DEACTIVATE | Clear all SMI sources.
GetRegisterInfo | EFI_SMM_GET_REGISTER_INFO | Get SMI Trigger information.
MinimumTriggerPeriod | UINTN | 0 in IA32. SMI period is not supported.

Description:
Provides south bridge functions for triggering and clearing SMIs.


SmmControl2.h

Description:
Provides south bridge functions for triggering and clearing SMIs.


SmmCpu.h

Description:
Smm CPU Protocol


SmmCpuIo2.h

Description:
Smm CPU IO Protocol


SmmCpuState.h

Description:
This provides the SMM Cpu Save State protocol.


SmmDispatcher.c

Description:
Contains the SMM dispatcher code for BSP & APs

The following functions are used in the file: SmmDispatcher.c.

Function | Description
CommonEntry | BSP and APs start here from SmmEntry.asm.
EfiSmmFarCall86 | Smm Thunk call. If no stack, this will push flags to simulate int call.
EfiSmmFarCall86Ex | Smm Thunk call. If no stack, this will push flags to simulate int call.
HasItTimedOut | Return EFI_TIMEOUT if timer has expired.
HoldStartedCpus | Hold loop for CPU to sync. All but one CPU will enter here.
InitializeDispatcher | Initialize Dispatcher.
InitInterrupts | Install Interrupt Handlers. Initialize the interrupt descriptors.
SmmApEntry | APs after switching to protected mode will jump here.
SmmBspEntry | Call Smm call back or dispatch handlers.
StartAllCpus | One random CPU enters here. Waits for CPUs to sync. If no sync, tries to start CPUs that didn't enter SMM.
StartTimeout | Initialize timeout for a specified about of time in uS.


CommonEntry in the SmmDispatcher.c

Function : CommonEntry

File: SmmDispatcher.c
Description:
BSP and APs start here from SmmEntry.asm.
Input:
IN SMM_ENTRY_INIT_STRUCT *SmmEntryInit
Output:
VOID


EfiSmmFarCall86 in the SmmDispatcher.c

Function : EfiSmmFarCall86

File: SmmDispatcher.c
Description:
Smm Thunk call. If no stack, this will push flags to simulate int call.
Input:
IN EFI_SMM_THUNK_PROTOCOL       *This,
IN  UINT16                      Segment -16-bit segment to call
IN  UINT16                      Offset  -16-bit offset to call
IN  SMM_THUNK_IA32_REGISTER_SET *Regs   -Preload registers before call
IN  VOID                        *Stack  -Stack before call optional
IN  UINTN                       StackSize - if no stack, this should be zero.
Output:
BOOLEAN


EfiSmmFarCall86Ex in the SmmDispatcher.c

Function : EfiSmmFarCall86Ex

File: SmmDispatcher.c
Description:
Smm Thunk call. If no stack, this will push flags to simulate int call.
Input:
IN EFI_SMM_THUNK_PROTOCOL           *This,
IN  UINT16                          Segment -16-bit segment to call
IN  UINT16                          Offset  -16-bit offset to call
IN  SMM_THUNK_IA32_REGISTER_SET_EX  *Regs   -Preload registers before call
IN  VOID                            *Stack  -Stack before call optional
IN  UINTN                           StackSize - if no stack, this should be zero.
Output:
BOOLEAN


HasItTimedOut in the SmmDispatcher.c

Function : HasItTimedOut

File: SmmDispatcher.c
Description:
Return EFI_TIMEOUT if timer has expired.
Input:
IN OUT SMM_TIMEOUT *Timeout
Output:
EFI_STATUS


HoldStartedCpus in the SmmDispatcher.c

Function : HoldStartedCpus

File: SmmDispatcher.c
Description:
Hold loop for CPU to sync. All but one CPU will enter here.
Input:
IN SMM_ENTRY_INIT_STRUCT *SmmEntryInit
Output:
VOID


InitializeDispatcher in the SmmDispatcher.c

Function : InitializeDispatcher

File: SmmDispatcher.c
Description:
Initialize Dispatcher.
Input:
IN EFI_HANDLE		ImageHandle
IN EFI_SYSTEM_TABLE	*SystemTable
Output:
EFI_STATUS


InitInterrupts in the SmmDispatcher.c

Function : InitInterrupts

File: SmmDispatcher.c
Description:
Install Interrupt Handlers. Initialize the interrupt descriptors.
Input:
VOID
Output:
VOID


SmmApEntry in the SmmDispatcher.c

Function : SmmApEntry

File: SmmDispatcher.c
Description:
APs after switching to protected mode will jump here.
Input:
IN SMM_ENTRY_INIT_STRUCT *SmmEntryInit
Output:
VOID


SmmBspEntry in the SmmDispatcher.c

Function : SmmBspEntry

File: SmmDispatcher.c
Description:
Call Smm call back or dispatch handlers.
Input:
IN SMM_ENTRY_INIT_STRUCT *SmmEntryInit
Output:
VOID


StartAllCpus in the SmmDispatcher.c

Function : StartAllCpus

File: SmmDispatcher.c
Description:
One random CPU enters here. Waits for CPUs to sync. If no sync, tries to
start CPUs that didn't enter SMM.
Input:
IN SMM_ENTRY_INIT_STRUCT *SmmEntryInit
Output:
VOID


StartTimeout in the SmmDispatcher.c

Function : StartTimeout

File: SmmDispatcher.c
Description:
Initialize timeout for a specified about of time in uS.
Input:
OUT SMM_TIMEOUT *Timeout
IN UINT32 Time
Output:
EFI_STATUS


SmmDispatcher.dxs

Description:
Dependency file for the SMM dispatcher


SmmDispatcher.h

Description:
SmmDispatcher header file


SmmDispatcher.mak

Description:
Make file for the SMM Dispatcher


SmmDispatcherAsm.asm

Description:
File that contains assembly for Smm Dispatcher.

The following functions are used in the file: SmmDispatcherAsm.asm.

Function | Description
LockDec32 | Decrement value at pointer locking address.
LockInc32 | Increment value at pointer locking address.
MachineCheckHandler | SMM Machine Check Handler
Xchg8 | Exchange a value with a pointer and return the exchanged value.


LockDec32 in the SmmDispatcherAsm.asm

Function : LockDec32

File: SmmDispatcherAsm.asm
Description:
Decrement value at pointer locking address.
Input:
IN OUT UINT32 *ptr
Output:
None


LockInc32 in the SmmDispatcherAsm.asm

Function : LockInc32

File: SmmDispatcherAsm.asm
Description:
Increment value at pointer locking address.
Input:
IN OUT UINT32 *ptr
Output:
None


MachineCheckHandler in the SmmDispatcherAsm.asm

Function : MachineCheckHandler

File: SmmDispatcherAsm.asm
Description:
SMM Machine Check Handler
Input:
VOID
Output:
VOID


Xchg8 in the SmmDispatcherAsm.asm

Function : Xchg8

File: SmmDispatcherAsm.asm
Description:
Exchange a value with a pointer and return the exchanged value.
Input:
IN OUT volatile UINT8 *     Pointer to value to exchange.
IN UINT8                    Value to exchange.
Output:
UINT8   Exchanged Value
Modified:
Nothing


SmmDriverDispatcher.c

Description:
Dispatch SMM Drivers

The following functions are used in the file: SmmDriverDispatcher.c.

Function | Description
AllocatePool | Allocate memory.
EfiInitializeFwVolDevicepathNode | Create Firmware volume device path.
FvHasBeenProcessed |
FvIsBeingProcesssed | This firmware volume is marked as being processed.
GrowDepexStack | Increase Depex Stack..
PopBool | Pop boolean value to stack.
PushBool | Push boolean value to stack.
SmmAddToDriverList | Add Driver to database for processing.
SmmDispatcher | Dispatch drivers that dependencies are met.
SmmDisplayDiscoveredNotDispatched | Display to debug output drivers discovered, but not loaded.
SmmDriverDispatchHandler | Dispatch SMM drivers
SmmFvToDevicePath | Create device path for Driver.
SmmGetDepexSectionAndPreProccess | Get driver depex section.
SmmInsertOnScheduledQueueWhileProcessingBeforeAndAfter | Add drivers on queue with before or after dependencies.
SmmIsSchedulable | Check if driver meets dependencies.
SmmLoadImage | Load driver into memory and give control.
SmmPreProcessDepex | Check driver dependencies for SOR, BEFORE, or AFTER, and update DriverEntry.


AllocatePool in the SmmDriverDispatcher.c

Function : AllocatePool

File: SmmDriverDispatcher.c
Description:
Allocate memory.
Input:
IN UINTN Size
Output:
VOID * - Address


EfiInitializeFwVolDevicepathNode in the SmmDriverDispatcher.c

Function : EfiInitializeFwVolDevicepathNode

File: SmmDriverDispatcher.c
Description:
Create Firmware volume device path.
Input:
IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH     *FvDevicePathNode,
IN     EFI_GUID                              *NameGuid
Output:
VOID


FvHasBeenProcessed in the SmmDriverDispatcher.c

Function : FvHasBeenProcessed

File: SmmDriverDispatcher.c
Description:
Input:
Output:


FvIsBeingProcesssed in the SmmDriverDispatcher.c

Function : FvIsBeingProcesssed

File: SmmDriverDispatcher.c
Description:
This firmware volume is marked as being processed.
Input:
IN EFI_HANDLE  FvHandle
Output:
VOID


GrowDepexStack in the SmmDriverDispatcher.c

Function : GrowDepexStack

File: SmmDriverDispatcher.c
Description:
Increase Depex Stack..
Input:
VOID
Output:
EFI_STATUS


PopBool in the SmmDriverDispatcher.c

Function : PopBool

File: SmmDriverDispatcher.c
Description:
Pop boolean value to stack.
Input:
OUT BOOLEAN *Value
Output:
EFI_STATUS


PushBool in the SmmDriverDispatcher.c

Function : PushBool

File: SmmDriverDispatcher.c
Description:
Push boolean value to stack.
Input:
IN BOOLEAN Value
Output:
EFI_STATUS


SmmAddToDriverList in the SmmDriverDispatcher.c

Function : SmmAddToDriverList

File: SmmDriverDispatcher.c
Description:
Add Driver to database for processing.
Input:
IN EFI_FIRMWARE_VOLUME2_PROTOCOL  *Fv
IN EFI_HANDLE                     FvHandle
IN EFI_GUID                       *DriverName
Output:
EFI_STATUS


SmmDispatcher in the SmmDriverDispatcher.c

Function : SmmDispatcher

File: SmmDriverDispatcher.c
Description:
Dispatch drivers that dependencies are met.
Input:
VOID
Output:
VOID


SmmDisplayDiscoveredNotDispatched in the SmmDriverDispatcher.c

Function : SmmDisplayDiscoveredNotDispatched

File: SmmDriverDispatcher.c
Description:
Display to debug output drivers discovered, but not loaded.
Input:
VOID
Output:
VOID


SmmDriverDispatchHandler in the SmmDriverDispatcher.c

Function : SmmDriverDispatchHandler

File: SmmDriverDispatcher.c
Description:
Dispatch SMM drivers
Input:
VOID
Output:
VOID


SmmFvToDevicePath in the SmmDriverDispatcher.c

Function : SmmFvToDevicePath

File: SmmDriverDispatcher.c
Description:
Create device path for Driver.
Input:
IN EFI_FIRMWARE_VOLUME2_PROTOCOL   *Fv
IN EFI_HANDLE                      FvHandle
IN EFI_GUID                        *DriverName
Output:
EFI_DEVICE_PATH_PROTOCOL *


SmmGetDepexSectionAndPreProccess in the SmmDriverDispatcher.c

Function : SmmGetDepexSectionAndPreProccess

File: SmmDriverDispatcher.c
Description:
Get driver depex section.
Input:
IN OUT EFI_SMM_DRIVER_ENTRY  *DriverEntry
Output:
EFI_STATUS


SmmInsertOnScheduledQueueWhileProcessingBeforeAndAfter in the SmmDriverDispatcher.c

Function : SmmInsertOnScheduledQueueWhileProcessingBeforeAndAfter

File: SmmDriverDispatcher.c
Description:
Add drivers on queue with before or after dependencies.
Input:
IN EFI_SMM_DRIVER_ENTRY   *InsertedDriverEntry
Output:
VOID


SmmIsSchedulable in the SmmDriverDispatcher.c

Function : SmmIsSchedulable

File: SmmDriverDispatcher.c
Description:
Check if driver meets dependencies.
Input:
IN EFI_SMM_DRIVER_ENTRY *DriverEntry
Output:
BOOLEAN


SmmLoadImage in the SmmDriverDispatcher.c

Function : SmmLoadImage

File: SmmDriverDispatcher.c
Description:
Load driver into memory and give control.
Input:
IN OUT EFI_SMM_DRIVER_ENTRY  *DriverEntry
Output:
EFI_STATUS


SmmPreProcessDepex in the SmmDriverDispatcher.c

Function : SmmPreProcessDepex

File: SmmDriverDispatcher.c
Description:
Check driver dependencies for SOR, BEFORE, or AFTER, and update DriverEntry.
Input:
IN OUT EFI_SMM_DRIVER_ENTRY  *DriverEntry
Output:
EFI_STATUS


SmmDxeCommunicate.dxs

Description:
Dependency file for the SMM Communicate driver


SmmEntry.asm

Description:
File that contains the code for BSP SMM entry point

The following functions are used in the file: SmmEntry.asm.

Function | Description
SmmEntry | Call any Legacy Handlers and call 32 bit protected Mode Dispatcher.
Thunk | The Thunk code is copied to below 1MB and used in SMM to Thunk to 16-bit mode.


SmmEntry in the SmmEntry.asm

Function : SmmEntry

File: SmmEntry.asm
Segment: SMM
Description:
Call any Legacy Handlers and call 32 bit protected Mode Dispatcher.
Input:
None
Output:
None


Thunk in the SmmEntry.asm

Function : Thunk

File: SmmEntry.asm
Segment: SMM
Description:
The Thunk code is copied to below 1MB and used in SMM to Thunk to
16-bit mode.
Input:
None
Output:
None


SmmGpiDispatch.h

Description:
SMM GPI Dispatch Protocol header.


SmmGpiDispatch2.h

Description:
SMM GPI Dispatch Protocol header.


SmmHdr.equ

Description:
Header file for the SMM x86 assembly source


SmmInit.c

Description:
Dispatch SMM Drivers

The following functions are used in the file: SmmInit.c.

Function | Description
CallFuncInSmm | Call function in SMM. If not in SMM, generate SW SMI, otherwise call the function.
CopySmmThunkAfterBspEntry | Copy SMM Thunk to immediately after SMM BSP entry.
CopySmmThunkAtStartABSegment | Copy SMM Thunk to start of AB Segment
CopySmmThunkInCsmEBDA | Copy SMM Thunk to CSM. Data will be in EBDA.
CreateRuntimeInSmmFunction | Create InSmm function in runtime.
DisableSmmCallbacks | This is signaled before booting or shell. This makes the SMM Base protocol register/unregister unsupported.
EarlyAllocSmmMemory | Allocate SMM memory before SMM memory manager available.
EarlyAllocSmmMemoryAlign | Allocate SMM memory before SMM memory manager available with specified alignment. Memory address returned will be the next aligned address available and the Free memory before the aligned address can not be allocated.
FindHobs | Locate the HOBs needed.
FindMatchingMtrr | Search MTRRs for a matching MTRR.
LoadAndInitDispatcherImages | Load and initialize dispatcher images.
LoadRealModeFile | Load a real mode file into a buffer.
LocateProtocols | Locate protocols needed for SMM Base.
SmmInitEntry | SMM Installer Entry Point.


CallFuncInSmm in the SmmInit.c

Function : CallFuncInSmm

File: SmmInit.c
Description:
Call function in SMM. If not in SMM, generate SW SMI, otherwise
call the function.
Input:
IN func -- Pointer to function
Output:
VOID


CopySmmThunkAfterBspEntry in the SmmInit.c

Function : CopySmmThunkAfterBspEntry

File: SmmInit.c
Description:
Copy SMM Thunk to immediately after SMM BSP entry.
Input:
IN VOID       *SmmEntryBuffer -- pointer to SMM Entry file
IN UINTN      SmmEntryBufferSize -- Size of SMM Entry file
Output:
EFI_STATUS


CopySmmThunkAtStartABSegment in the SmmInit.c

Function : CopySmmThunkAtStartABSegment

File: SmmInit.c
Description:
Copy SMM Thunk to start of AB Segment
Input:
IN VOID       *SmmEntryBuffer -- pointer to SMM Entry file
IN UINTN      SmmEntryBufferSize -- Size of SMM Entry file
Output:
EFI_STATUS


CopySmmThunkInCsmEBDA in the SmmInit.c

Function : CopySmmThunkInCsmEBDA

File: SmmInit.c
Description:
Copy SMM Thunk to CSM. Data will be in EBDA.
Input:
IN VOID       *SmmEntryBuffer -- pointer to SMM Entry file
IN UINTN      SmmEntryBufferSize -- Size of SMM Entry file
Output:
EFI_STATUS


CreateRuntimeInSmmFunction in the SmmInit.c

Function : CreateRuntimeInSmmFunction

File: SmmInit.c
Description:
Create InSmm function in runtime.
Input:
VOID
Output:
VOID


DisableSmmCallbacks in the SmmInit.c

Function : DisableSmmCallbacks

File: SmmInit.c
Description:
This is signaled before booting or shell.
This makes the SMM Base protocol register/unregister unsupported.
Input:
IN EFI_EVENT Event
IN VOID *Context
Output:
VOID
NOTE: This routine could be called multiple times right before booting.


EarlyAllocSmmMemory in the SmmInit.c

Function : EarlyAllocSmmMemory

File: SmmInit.c
Description:
Allocate SMM memory before SMM memory manager available.
Input:
IN UINT32   Size -- Memory size
Output:
VOID * -- ptr to allocated memory.


EarlyAllocSmmMemoryAlign in the SmmInit.c

Function : EarlyAllocSmmMemoryAlign

File: SmmInit.c
Description:
Allocate SMM memory before SMM memory manager available with specified alignment.
Memory address returned will be the next aligned address available and the Free memory
before the aligned address can not be allocated.
Input:
IN UINT32	Size -- Memory size.
IN UINT32   Align -- Alignment. Must be 2^n.
Output:
VOID * -- ptr to allocated memory.


FindHobs in the SmmInit.c

Function : FindHobs

File: SmmInit.c
Description:
Locate the HOBs needed.
Input:
VOID
Output:
VOID


FindMatchingMtrr in the SmmInit.c

Function : FindMatchingMtrr

File: SmmInit.c
Description:
Search MTRRs for a matching MTRR.
Input:
IN UINT64 BASE
IN UINT64 Mask
Output:
UINT32  -- MSR for matching MTTR.


LoadAndInitDispatcherImages in the SmmInit.c

Function : LoadAndInitDispatcherImages

File: SmmInit.c
Description:
Load and initialize dispatcher images.
Input:
IN EFI_SYSTEM_TABLE SystemTable
IN UINT32           NumCpus
Output:
VOID


LoadRealModeFile in the SmmInit.c

Function : LoadRealModeFile

File: SmmInit.c
Description:
Load a real mode file into a buffer.
Input:
IN EFI_GUID *Guid
OUT VOID    **Buffer
OUT UINTN   *BufferSize
Output:
EFI_STATUS


LocateProtocols in the SmmInit.c

Function : LocateProtocols

File: SmmInit.c
Description:
Locate protocols needed for SMM Base.
Input:
VOID
Output:
VOID


SmmInitEntry in the SmmInit.c

Function : SmmInitEntry

File: SmmInit.c
Description:
SMM Installer Entry Point.
Input:
IN EFI_HANDLE       ImageHandle
IN EFI_SYSTEM_TABLE *SystemTable
Output:
EFI_STATUS


SmmIoTrapDispatch2.h

Description:
SMM BIOS write Dispatch Protocol header.


SmmMemoryManager.c

Description:
Provides functions to manage SMM memory. Allocate and Free memory.

The following functions are used in the file: SmmMemoryManager.c.

Function | Description
Align2n | Align the address to nearest specified 2n alignment. If the alignment isn't 2^n-1, then result will be invalid.
Align8 | Align the address to nearest 8 byte alignment.
Allocate | Allocate a memory. Caller may specify either a specific address or alignment, or neither. Alignment is a minimum of 8 bytes.
AllocateABSegPages | Allocate SMM 4k pages of memory in A or B segment.
ConstructMemoryReservedTable | Intitialize the MEMORY_RESERVED_TABLE.
FindAddress | Find a gap of Free memory of an specific Address and a size. If part of the space is taken, return 0. If the space is found, return the preceding memory descriptor, or the last memory descriptor.
FindFreeSpace | Find a gap of Free memory of a size and possibly of an alignment. This returns the preceding memory descriptor. If no gaps are found, the last memory descriptor is returned.
Free | Free an allocated buffer.
Free4kPages | Free pages from buffer.
GetEmptyDescriptor | Find an unused memory descriptor in the tables.
InitializeMemoryManager | Initialize the memory manager, so the functions can be used.
RemoveDescriptor | Find an unused memory descriptor in the tables.

The following data structures are used in the file: SmmMemoryManager.c.

Variable | Description
MEMORY_DESCRIPTOR | Each descriptor contains the Base and end + 1 of each memory allocation. The list is sorted from lowest to highest. Last linked descriptor has a Link = 0. Unused descriptors have links = 0xffffffff.
MEMORY_RESERVED_TABLE | Table stores memory descriptors. If runs out of descriptors, additional tables will be linked. New tables can not be removed. Unused descriptors Link will be 0xffffffff. Last table Link = 0.


Align2n in the SmmMemoryManager.c

Function : Align2n

File: SmmMemoryManager.c
Description:
Align the address to nearest specified 2n alignment.
        If the alignment isn't 2^n-1, then result will be invalid.
Input:
UINT8	*Value - Pointer to value to Align.
UINTN	Alignment (This the 2n Alignment - 1. Example Alignment = 31, for 32 byte alignment.
Output:
UINT8* - Aligned Value.


Align8 in the SmmMemoryManager.c

Function : Align8

File: SmmMemoryManager.c
Description:
Align the address to nearest 8 byte alignment.
Input:
UINTN	Value - Value to Align.
Output:
UINTN - Aligned Value.


Allocate in the SmmMemoryManager.c

Function : Allocate

File: SmmMemoryManager.c
Description:
Allocate a memory. Caller may specify either a specific address
or alignment, or neither. Alignment is a minimum of 8 bytes.
Input:
IN VOID *Address OPTIONAL	- If caller wants to specify a specific address (Alignment is ignored).
IN UINTN Size				- Size of allocation.
UINTN Alignment OPTIONAL    - Specific alignment, if required. An address must not be given.
                 If alignment is set to 0, then alignment is 8 bytes. (Required by SMM spec.)
Output:
VOID *						- Memory allocated start address.
Notes:
Here is the control flow of this function:
1. If no size requested return 0.
2. Align Size up to the nearest 8 bytes.
3. Get an empty descriptor. If none, return 0.
4. If Address is given, set BaseStart to address.
If not aligned on 8 byte boundary, remove descriptor and return 0.
5. Otherwise, set BaseStart to gSmmMemBase and
align if and to the given alignment. (Bottom of SMM.)
6. If Size requested is greater than the Smm memory region,
remove descriptor and return 0.
7. If no memory is previously allocated, setup descriptor, and point to it from gDescHead.
(Baseaddress is either the Address requested or beggining of Smm RAM.) Return address.
8. Otherwise if requested memory base is lower than the base pointed by gDescHead or
gap between start of smm ram and memory base pointed to by gDescHead is larger than
    the size requested is available,
fill in memory descriptor, and add it in front of gDescHead, replacing gDescHead. Return Address.
9. Otherwise, if address address, find descriptor preceding the Address requested.
10. If size requested, find the descriptor preceding the gap >= Size requested.
11. If last descriptor, if not enough space left, remove descriptor, and return 0.
12. Fill in descriptor. Return Address.


AllocateABSegPages in the SmmMemoryManager.c

Function : AllocateABSegPages

File: SmmMemoryManager.c
Description:
Allocate SMM 4k pages of memory in A or B segment.
Input:
IN EFI_ALLOCATE_TYPE		Type
IN UINTN					NumberOfPages
IN OUT EFI_PHYSICAL_ADDRESS	*Memory
Output:
EFI_STATUS


ConstructMemoryReservedTable in the SmmMemoryManager.c

Function : ConstructMemoryReservedTable

File: SmmMemoryManager.c
Description:
Intitialize the MEMORY_RESERVED_TABLE.
Input:
MEMORY_RESERVED_TABLE	*Table
Output:
VOID


FindAddress in the SmmMemoryManager.c

Function : FindAddress

File: SmmMemoryManager.c
Description:
Find a gap of Free memory of an specific Address and a size.
        If part of the space is taken, return 0.
        If the space is found, return the preceding memory descriptor,
         or the last memory descriptor.
Input:
UINTN	Size - Size of memory.
UINTN	Alignment  - This the 2n Alignment - 1. Example Alignment = 31, for 32 byte alignment.
Output:
MEMORY_DESCRIPTOR * - 0 if the address range is taken.
       - not zero, if gap is found, or last link.
Notes:
Here is the control flow of this function:
1. Start with the first descriptor.
2. If the specifed address is in the descriptor, it is taken return 0.
3. If the specified address is in the gap after the descriptor,
if the gap is big enough, return the preceding link, otherwise return 0.
4. Repeat steps 2-4 until iterated all the descriptors.
5. Return the last descriptor.


FindFreeSpace in the SmmMemoryManager.c

Function : FindFreeSpace

File: SmmMemoryManager.c
Description:
Find a gap of Free memory of a size and possibly of an alignment. This returns
        the preceding memory descriptor. If no gaps are found, the last memory descriptor
        is returned.
Input:
UINTN	Size - Size of Free space.
UINTN	Alignment OPTIONAL - This the 2n Alignment - 1. Example Alignment = 31, for 32 byte alignment.
Output:
MEMORY_DESCRIPTOR *
Notes:
Here is the control flow of this function:
1. Start with the first descriptor.
2. Evaluate the difference (empty space) between the
(a) the base of address of the next descriptor and (b) the
aligned End address of the current descriptor.
3. If the difference is greater or equal to the requested size,
return the link.
4. Repeat 2-4, until out of descriptors.
5. Return the last descriptor.


Free in the SmmMemoryManager.c

Function : Free

File: SmmMemoryManager.c
Description:
Free an allocated buffer.
Input:
IN VOID *Buffer - Allocation to Free.
Output:
BOOLEAN	- TRUE if buffer freed.
Notes:
Here is the control flow of this function:
1. If no allocations, return FALSE.
2. If Buffer to Free is gDescHead, set gDescHead to next Link, remove decriptor, and return TRUE.
3. Search link list for buffer.
4. If not found, return FALSE.
5. Set previous link of buffer to link after buffer.
6. Remove Descriptor.
7. Return TRUE.


Free4kPages in the SmmMemoryManager.c

Function : Free4kPages

File: SmmMemoryManager.c
Description:
Free pages from buffer.
Input:
IN VOID		*StartAddress - Pages to Free.
IN UINTN	Pages		  - # of 4k pages.
Output:
BOOLEAN	- TRUE if buffer freed.
Notes:
Here is the control flow of this function:
1. If End Address is not greater than 4G, return FALSE.
2. If StartAddress is not aligned 4k, return FALSE.
3. If no allocations, return FALSE.
4. Search for a descriptor with the StartAddress is allocated.
5. If descriptor not found, return FALSE.
6. Search for a descriptor with the EndAddress is allocated. These criteria must be met which searching.
* Allocation size of each descriptor must be 4k pages, otherwise return FALSE.
* End address of descriptor must match base address of next descriptor (no Free space), otherwise return FALSE.
7. If descriptor not found, return FALSE.
8. If Start and End descriptors are not the same go to step 13.
-----Start and End Descriptor match exactly.----
9. If Base and End descriptor match exactly, remove the descriptor from the list.
10. If only Start Address matches exactly, Free that space by setting the start address to the End Address.
11. If only the End Address matches exactly, move the end address to Start Address.
Note: the end address of the descriptor is not allocated.
12. return TRUE.
----Start and End Descriptors are different descriptors.----
13. If Base address of the Start Descriptor, adjust its end address to the space, and
move the Start Descriptor to the next descriptor.
14. Free the descriptors up till the end descriptor.
15. If the End Descriptor's End address doesn match the end address to Free,
set the base address to the end address, to Free the space.
16. Otherwise, remove the end descriptor.
17. Return True.


GetEmptyDescriptor in the SmmMemoryManager.c

Function : GetEmptyDescriptor

File: SmmMemoryManager.c
Description:
Find an unused memory descriptor in the tables.
Input:
VOID
Output:
MEMORY_DESCRIPTOR * - 0 if can not Allocate a new descriptor.
       - Empty descriptor.
Notes:
Here is the control flow of this function:
1. Find a table with empty descriptors.
2. If a table is not found with an empty descriptor, go to step 5.
---Found table with an empty descriptor---
3. Search descriptor array for an unused descriptors (Link = 0xffffffff)
4. Return the descriptor.
---Did not find table with an empty descriptor---
5. Search memory descriptors for Free space for a new table.
6. Check if last descriptor and enough Free space at end, if not return 0.
7. Add a new memory table descriptor at the end of the returned descriptor.
8. Add new table link.
9. Construct a new table.
10. Return the first descriptor.


InitializeMemoryManager in the SmmMemoryManager.c

Function : InitializeMemoryManager

File: SmmMemoryManager.c
Description:
Initialize the memory manager, so the functions can be used.
Input:
VOID
Output:
VOID


MEMORY_DESCRIPTOR in the SmmMemoryManager.c

Variable : MEMORY_DESCRIPTOR

File: SmmMemoryManager.c
Fields:

Name | Type | Description
MemBase | UINT8* | Base address of allocated memory.
MemEnd | UINT8* | End address + 1 of allocated memory.
Link | MEMORY_DESCRIPTOR* | Link to next Descriptor.

Description:
Each descriptor contains the Base and end + 1 of each
memory allocation. The list is sorted from lowest to highest.
Last linked descriptor has a Link = 0.
Unused descriptors have links = 0xffffffff.


MEMORY_RESERVED_TABLE in the SmmMemoryManager.c

Variable : MEMORY_RESERVED_TABLE

File: SmmMemoryManager.c
Fields:

Name | Type | Description
MemDesc | MEMORY_DESCRIPTOR | [] Array of memory descriptors.
MemNextTable | MEMORY_DESCRIPTOR | A descriptor used if a new table is created.
NumMemDescUsed | UINTN | Number of descriptors used.
Link | MEMORY_RESERVED_TABLE* | Link to next table.

Description:
Table stores memory descriptors. If runs out of descriptors,
additional tables will be linked. New tables can not be removed.
Unused descriptors Link will be 0xffffffff.
Last table Link = 0.


RemoveDescriptor in the SmmMemoryManager.c

Function : RemoveDescriptor

File: SmmMemoryManager.c
Description:
Find an unused memory descriptor in the tables.
Input:
MEMORY_DESCRIPTOR * Descriptor  -  Descriptor to Free.
Output:
VOID
Notes:
Here is the control flow of this function:
1. Start with first table.
2. Check each table's descriptor array for the descriptor to be removed.
3. If descriptor not found go to step 7.
---Descriptor found---
4. Replace the Link with 0xffffffff.
5. Reduce number of descripors being used.
6. return.
---Descriptor not found---
7. Repeat for next table steps 2-7 until last table.
8. Return


SmmPciRootBridgeIo.h

Description:
Smm Pci Root Bridge Io Protocol


SmmPeriodicTimerDispatch.h

Description:
Smm Periodic Timer Dispatch Protocol header.


SmmPeriodicTimerDispatch2.h

Description:
Smm Periodic Timer Dispatch Protocol header.


SmmPi.h

Description:
Smst table definitions.


SmmPiSmst.c

Description:
PI Smst functions.

The following functions are used in the file: SmmPiSmst.c.

Function | Description
InitializeListHead | Initialize the head of the List. The caller must Allocate the memory for the EFI_LIST. This function must be called before the other linked list macros can be used.
InitializeSmmPiSystemTable | Initialize SMM PI System Table.
InsertHeadList | Insert a Node into the start of a doubly linked list. The list must have been initialized with InitializeListHead () before using this function.
InsertTailList | Insert a Node into the end of a doubly linked list. The list must have been initialized with InitializeListHead () before using this function.
IsListEmpty | Return TRUE is the list contains zero nodes. Otherwise return FALSE. The list must have been initialized with InitializeListHead () before using this function.
RemoveEntryList | Remove Node from the doubly linked list. It is the caller's responsibility to Free any memory used by the entry if needed. The list must have been initialized with InitializeListHead () before using this function.
SmiHandlerRegister | Register SMI Handle
SmmCoreFindSmiEntry | Find Smi Entry
SmmFindProtocolEntry | Finds the protocol entry for the requested protocol.
SmmFindProtocolInterface | 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.
SmmGetNextLocateAllHandles | Find next handle.
SmmGetNextLocateByProtocol | Routine to get the next Handle, when you are searching for a given protocol.
SmmGetNextLocateByRegisterNotify | Routine to get the next Handle, when you are searching for register protocol notifies.
SmmGetProtocolInterface | Locate a certain GUID protocol interface in a Handle's protocols.
SmmNotifyProtocol | Signal event for every protocol in protocol entry.
SmmRemoveInterfaceFromProtocol | Removes Protocol from the protocol list (but not the handle list).
SmmSmstHandleProtocol | Queries a handle to determine if it supports a specified protocol.
SmmSmstInstallProtocolInterface | Wrapper function to SmmInstallProtocolInterfaceNotify. This is the public API which Calls the private one which contains a BOOLEAN parameter for notifications
SmmSmstInstallProtocolInterfaceNotify | Installs a protocol interface into the boot services environment.
SmmSmstLocateHandle | Locates the requested handle(s) and returns them in Buffer.
SmmSmstLocateProtocol | 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.
SmmSmstRegisterProtocolNotify | Add a new protocol notification record for the request protocol.
SmmSmstUninstallProtocolInterface | Uninstalls all instances of a protocol:interfacer from a handle. If the last protocol interface is remove from the handle, the handle is freed.
SmmValidateHandle | Check whether a handle is a valid EFI_HANDLE.


InitializeListHead in the SmmPiSmst.c

Function : InitializeListHead

File: SmmPiSmst.c
Description:
Initialize the head of the List.  The caller must Allocate the memory
for the EFI_LIST. This function must be called before the other linked
list macros can be used.
Input:
IN EFI_LIST_ENTRY  *List
Output:
VOID


InitializeSmmPiSystemTable in the SmmPiSmst.c

Function : InitializeSmmPiSystemTable

File: SmmPiSmst.c
Description:
Initialize SMM PI System Table.
Input:
VOID
Output:
VOID


InsertHeadList in the SmmPiSmst.c

Function : InsertHeadList

File: SmmPiSmst.c
Description:
Insert a Node into the start of a doubly linked list. The list must have
been initialized with InitializeListHead () before using this function.
Input:
IN EFI_LIST_ENTRY  *ListHead
IN EFI_LIST_ENTRY  *Entry
Output:
VOID


InsertTailList in the SmmPiSmst.c

Function : InsertTailList

File: SmmPiSmst.c
Description:
Insert a Node into the end of a doubly linked list. The list must have
been initialized with InitializeListHead () before using this function.
Input:
IN EFI_LIST_ENTRY  *ListHead
IN EFI_LIST_ENTRY  *Entry
Output:
VOID


IsListEmpty in the SmmPiSmst.c

Function : IsListEmpty

File: SmmPiSmst.c
Description:
Return TRUE is the list contains zero nodes. Otherwise return FALSE.
The list must have been initialized with InitializeListHead () before using
this function.
Input:
IN EFI_LIST_ENTRY  *List
Output:
VOID


RemoveEntryList in the SmmPiSmst.c

Function : RemoveEntryList

File: SmmPiSmst.c
Description:
Remove Node from the doubly linked list. It is the caller's responsibility
to Free any memory used by the entry if needed. The list must have been
initialized with InitializeListHead () before using this function.
Input:
IN EFI_LIST_ENTRY  *Entry
Output:
VOID


SmiHandlerRegister in the SmmPiSmst.c

Function : SmiHandlerRegister

File: SmmPiSmst.c
Description:
Register SMI Handle
Input:
IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler,
IN CONST EFI_GUID               *HandlerType OPTIONAL,
OUT EFI_HANDLE                  *DispatchHandle
Output:
EFI_STATUS


SmmCoreFindSmiEntry in the SmmPiSmst.c

Function : SmmCoreFindSmiEntry

File: SmmPiSmst.c
Description:
Find Smi Entry
Input:
IN EFI_GUID  *HandlerType
IN BOOLEAN   Create
Output:
SMM_SMI_ENTRY


SmmFindProtocolEntry in the SmmPiSmst.c

Function : SmmFindProtocolEntry

File: SmmPiSmst.c
Description:
Finds the protocol entry for the requested protocol.
Input:
IN EFI_GUID   *Protocol
IN BOOLEAN    Create
Output:
Protocol entry


SmmFindProtocolInterface in the SmmPiSmst.c

Function : SmmFindProtocolInterface

File: SmmPiSmst.c
Description:
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.
Input:
IN SMM_IHANDLE  *Handle,
IN EFI_GUID     *Protocol
IN VOID         *Interface
Output:
Protocol instance (NULL: Not found)


SmmGetNextLocateAllHandles in the SmmPiSmst.c

Function : SmmGetNextLocateAllHandles

File: SmmPiSmst.c
Description:
Find next handle.
Input:
IN OUT SMM_LOCATE_POSITION  *Position,
OUT    VOID                 **Interface
Output:
SMM_IHANDLE


SmmGetNextLocateByProtocol in the SmmPiSmst.c

Function : SmmGetNextLocateByProtocol

File: SmmPiSmst.c
Description:
Routine to get the next Handle, when you are searching for a given protocol.
Input:
IN OUT SMM_LOCATE_POSITION  *Position
OUT    VOID                 **Interface
Output:
An pointer to SMM_IHANDLE if the next Position is not the end of the list.
Otherwise,NULL is returned.


SmmGetNextLocateByRegisterNotify in the SmmPiSmst.c

Function : SmmGetNextLocateByRegisterNotify

File: SmmPiSmst.c
Description:
Routine to get the next Handle, when you are searching for register protocol
notifies.
Input:
IN OUT SMM_LOCATE_POSITION  *Position
OUT    VOID                 **Interface
Output:
An pointer to SMM_IHANDLE if the next Position is not the end of the list.
Otherwise,NULL is returned.


SmmGetProtocolInterface in the SmmPiSmst.c

Function : SmmGetProtocolInterface

File: SmmPiSmst.c
Description:
Locate a certain GUID protocol interface in a Handle's protocols.
Input:
IN EFI_HANDLE  UserHandle,
IN EFI_GUID    *Protocol
Output:
The requested protocol interface for the handle.


SmmNotifyProtocol in the SmmPiSmst.c

Function : SmmNotifyProtocol

File: SmmPiSmst.c
Description:
Signal event for every protocol in protocol entry.
Input:
IN SMM_PROTOCOL_INTERFACE  *Prot
Output:
VOID


SmmRemoveInterfaceFromProtocol in the SmmPiSmst.c

Function : SmmRemoveInterfaceFromProtocol

File: SmmPiSmst.c
Description:
Removes Protocol from the protocol list (but not the handle list).
Input:
IN SMM_IHANDLE  *Handle,
IN EFI_GUID     *Protocol
IN VOID         *Interface
Output:
Protocol Entry


SmmSmstHandleProtocol in the SmmPiSmst.c

Function : SmmSmstHandleProtocol

File: SmmPiSmst.c
Description:
Queries a handle to determine if it supports a specified protocol.
Input:
IN OUT EFI_HANDLE  UserHandle
IN     EFI_GUID    *Protocol
OUT    VOID        **Interface
Output:
EFI_STATUS


SmmSmstInstallProtocolInterface in the SmmPiSmst.c

Function : SmmSmstInstallProtocolInterface

File: SmmPiSmst.c
Description:
Wrapper function to SmmInstallProtocolInterfaceNotify.  This is the public API which
Calls the private one which contains a BOOLEAN parameter for notifications
Input:
IN OUT EFI_HANDLE       *Handle
IN EFI_GUID             *Protocol
IN EFI_INTERFACE_TYPE   InterfaceType
IN VOID                 Interface
Output:
EFI_STATUS


SmmSmstInstallProtocolInterfaceNotify in the SmmPiSmst.c

Function : SmmSmstInstallProtocolInterfaceNotify

File: SmmPiSmst.c
Description:
Installs a protocol interface into the boot services environment.
Input:
IN OUT EFI_HANDLE          *UserHandle,
IN     EFI_GUID            *Protocol,
IN     EFI_INTERFACE_TYPE  InterfaceType,
IN     VOID                *Interface,
IN     BOOLEAN             Notify
Output:
EFI_STATUS


SmmSmstLocateHandle in the SmmPiSmst.c

Function : SmmSmstLocateHandle

File: SmmPiSmst.c
Description:
Locates the requested handle(s) and returns them in Buffer.
Input:
IN EFI_LOCATE_SEARCH_TYPE   SearchType
IN EFI_GUID                 *Protocol OPTIONAL
IN VOID                     *SearchKey OPTIONAL
IN OUT UINTN                *BufferSize
OUT EFI_HANDLE              *Buffer
Output:
EFI_STATUS


SmmSmstLocateProtocol in the SmmPiSmst.c

Function : SmmSmstLocateProtocol

File: SmmPiSmst.c
Description:
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.
Input:
IN  EFI_GUID    *Protocol,
IN  VOID        *Registration OPTIONAL
OUT VOID        **Interface
Output:
EFI_STATUS


SmmSmstRegisterProtocolNotify in the SmmPiSmst.c

Function : SmmSmstRegisterProtocolNotify

File: SmmPiSmst.c
Description:
Add a new protocol notification record for the request protocol.
Input:
IN EFI_GUID                  *Protocol
IN EFI_SMM_NOTIFY_FN         Function
OUT VOID                     **Registration
Output:
EFI_STATUS


SmmSmstUninstallProtocolInterface in the SmmPiSmst.c

Function : SmmSmstUninstallProtocolInterface

File: SmmPiSmst.c
Description:
Uninstalls all instances of a protocol:interfacer from a handle.
If the last protocol interface is remove from the handle, the
handle is freed.
Input:
IN OUT EFI_HANDLE   UserHandle
IN EFI_GUID         *Protocol
IN VOID             *Interface
Output:
EFI_STATUS


SmmValidateHandle in the SmmPiSmst.c

Function : SmmValidateHandle

File: SmmPiSmst.c
Description:
Check whether a handle is a valid EFI_HANDLE.
Input:
IN  EFI_HANDLE  UserHandle
Output:
EFI_STATUS


SmmPowerButtonDispatch.h

Description:
Power Button Dispatch Protocol Header.


SmmPowerButtonDispatch2.h

Description:
Power Button Dispatch Protocol Header.


SmmPrivateShared.h

Description:
Header file for the SMM shared equates and structures


SmmReadyToLock.h

Description:
SmmReadyToLock protocol definition


SmmStandbyButtonDispatch.h

Description:
Standby Button Dispatch Protocol Header.


SmmStandbyButtonDispatch2.h

Description:
Standby Button Dispatch Protocol Header.


SmmStatusCode.h

Description:
This file is an include file used to define the Protocol for the
        Firmware Volume Block Protocol.


SmmSwDispatch.h

Description:
SMM SW Dispatch Protocol header.


SmmSwDispatch2.h

Description:
SMM SW Dispatch Protocol header.


SmmSxDispatch.h

Description:
SMM SX Dispatch Protocol Header.


SmmSxDispatch2.h

Description:
SMM SX Dispatch Protocol Header.


SmmTcoDispatch.h

Description:


SmmThunk.h

Description:
This file is an include file used to define the Protocol for the
SMM Thunk Protocol.


SmmUsbDispatch.h

Description:
Smm Usb Dispatch Protocol header.


SmmUsbDispatch2.h

Description:
Smm Usb Dispatch Protocol header.


Smst.c

Description:
Smst functions.

The following functions are used in the file: Smst.c.

Function | Description
CalculateCrc32 | Calculate Crc 32
InitCrc | InitCrc
InitializeSmmSystemTable | Initialize the System Table.
MoveToNewConfigurationTable | Create a new bigger or smaller table and copy the old table to the new table.
SmmInstallConfigurationTable | This procedure add/updates/deletes configuration table entries. Configuration Table Entry definition: EFI_GUID VendorGuid VOID *VenderTable 1. If Vendor Guid is not in table and Input table isn't NULL, add Guid/Table pair. 2. If Vendor Guid is in table and Input table isn't NULL, update Guid/Table pair. 3. If Vendor Guid is in table and Input table is NULL, remove Guid/Tablble pair. 4. If Vendor Guid is not in table, Input table is NULL, return EFI_NOT_FOUND. Nothing to delete.
SmmIoRead | Read io buffer.
SmmIoWrite | Write to Io from buffer.
SmmMemRead | Read memory buffer.
SmmMemWrite | Write to memory from buffer.
SmmSmstAllocatePages | Allocate # pages at any address, a max address, or a specified address.
SmmSmstAllocatePool | Allocate a pool of memory.
SmmSmstFreePages | Free pages. The address must be on a page boundary, but it doesn't have to start on address from AllocatePages. It only frees the requested pages.
SmmSmstFreePool | Free Allocated memory.
SmmStartupThisAp | Execute a procedure on an AP.


CalculateCrc32 in the Smst.c

Function : CalculateCrc32

File: Smst.c
Description:
Calculate Crc 32
Input:
IN VOID *Data
IN UINTN DataSize
OUT UINT32 *Crc32
Output:
EFI_STATUS


InitCrc in the Smst.c

Function : InitCrc

File: Smst.c
Description:
InitCrc
Input:
VOID
Output:
VOID


InitializeSmmSystemTable in the Smst.c

Function : InitializeSmmSystemTable

File: Smst.c
Description:
Initialize the System Table.
Input:
SMM_BASE_PRIVATE_STRUCT *Private
Output:
VOID


MoveToNewConfigurationTable in the Smst.c

Function : MoveToNewConfigurationTable

File: Smst.c
Description:
Create a new bigger or smaller table and copy the old table to the new table.
Input:
IN EFI_CONFIGURATION_TABLE  *OldTable
IN UINTN                    NumOldDescriptors
IN UINTN                    NumDescriptors
Output:
EFI_CONFIGURATION_TABLE * - New table address.


SmmInstallConfigurationTable in the Smst.c

Function : SmmInstallConfigurationTable

File: Smst.c
Description:
This procedure add/updates/deletes configuration table entries.

Configuration Table Entry definition:
EFI_GUID    VendorGuid
VOID        *VenderTable

1. If Vendor Guid is not in table and Input table isn't NULL, add Guid/Table pair.
2. If Vendor Guid is in table and Input table isn't NULL, update Guid/Table pair.
3. If Vendor Guid is in table and Input table is NULL, remove Guid/Tablble pair.
4. If Vendor Guid is not in table, Input table is NULL, return EFI_NOT_FOUND. Nothing to delete.
Input:
IN EFI_SMM_SYSTEM_TABLE *SystemTable
IN EFI_GUID             *Guid
IN VOID                 *Table
IN UINTN                TableSize
Output:
EFI_STATUS
* EFI_SUCCESS - Add/update/remove operation successful.
* EFI_INVALID_PARAMETER - Guid = 0.
* EFI_NOT_FOUND - Can not delete a nonexistent entry.
* EFI_OUT_OF_RESOURCES - Not enough memory to complete operation.


SmmIoRead in the Smst.c

Function : SmmIoRead

File: Smst.c
Description:
Read io buffer.
Input:
IN EFI_SMM_CPU_IO_INTERFACE	*This
IN EFI_SMM_IO_WIDTH         Width
IN UINT64                   Address
IN UINTN                    Count
IN OUT VOID                 *Buffer
Output:
EFI_STATUS
* EFI_SUCCESS - Buffer written Successfully.
* EFI_INVALID_PARAMETER - 0 Count, Unsupported Width, or memory region out of range.


SmmIoWrite in the Smst.c

Function : SmmIoWrite

File: Smst.c
Description:
Write to Io from buffer.
Input:
IN EFI_SMM_CPU_IO_INTERFACE	*This
IN EFI_SMM_IO_WIDTH         Width
IN UINT64                   Address
IN UINTN                    Count
IN OUT VOID                 *Buffer
Output:
EFI_STATUS
* EFI_SUCCESS - Buffer written Successfully.
* EFI_INVALID_PARAMETER - 0 Count, Unsupported Width, or memory region out of range.


SmmMemRead in the Smst.c

Function : SmmMemRead

File: Smst.c
Description:
Read memory buffer.
Input:
IN EFI_SMM_CPU_IO_INTERFACE *This
IN EFI_SMM_IO_WIDTH         Width
IN UINT64                   Address
IN UINTN                    Count
IN OUT VOID                 *Buffer
Output:
EFI_STATUS
* EFI_SUCCESS - Buffer written Successfully.
* EFI_INVALID_PARAMETER - 0 Count, Unsupported Width, or memory region out of range.


SmmMemWrite in the Smst.c

Function : SmmMemWrite

File: Smst.c
Description:
Write to memory from buffer.
Input:
IN EFI_SMM_CPU_IO_INTERFACE *This
IN EFI_SMM_IO_WIDTH         Width
IN UINT64                   Address
IN UINTN                    Count
IN OUT VOID                 *Buffer
Output:
EFI_STATUS
* EFI_SUCCESS - Buffer written Successfully.
* EFI_INVALID_PARAMETER - 0 Count, Unsupported Width, or memory region out of range.


SmmSmstAllocatePages in the Smst.c

Function : SmmSmstAllocatePages

File: Smst.c
Description:
Allocate # pages at any address, a max address, or a specified address.
Input:
IN EFI_ALLOCATE_TYPE        Type
IN EFI_MEMORY_TYPE          MemoryType
IN UINTN                    NumberOfPages
OUT EFI_PHYSICAL_ADDRESS    *Memory
Output:
EFI_STATUS
* EFI_SUCCESS - Memory allocated.
* EFI_OUT_OF_RESOURCES - Memory already allocated or unavailable.
* EFI_INVALID_PARAMETER - Incorrect Type or specified address not 4k aligned.


SmmSmstAllocatePool in the Smst.c

Function : SmmSmstAllocatePool

File: Smst.c
Description:
Allocate a pool of memory.
Input:
IN EFI_MEMORY_TYPE  PoolType
IN UINTN            Size
OUT VOID            **Buffer
Output:
EFI_STATUS
* EFI_SUCCESS - Pool of memory allocated.
* EFI_INVALID_PARAMETER - Allocate 0 size.
* EFI_OUT_OF_RESOURCES - Memory unavailable.


SmmSmstFreePages in the Smst.c

Function : SmmSmstFreePages

File: Smst.c
Description:
Free pages. The address must be on a page boundary, but it doesn't have to
start on address from AllocatePages. It only frees the requested pages.
Input:
IN EFI_PHYSICAL_ADDRESS Memory
IN UINTN                NumberOfPages


SmmSmstFreePool in the Smst.c

Function : SmmSmstFreePool

File: Smst.c
Description:
Free Allocated memory.
Input:
IN VOID *Buffer
Output:
EFI_STATUS
* EFI_SUCCESS - Memory is freed.
* EFI_INVALID_PARAMETER - Memory starting at Buffer was not allocated.


SmmStartupThisAp in the Smst.c

Function : SmmStartupThisAp

File: Smst.c
Description:
Execute a procedure on an AP.
Input:
IN EFI_AP_PROCEDURE         Procedure
IN UINTN                    CpuNumber
IN OUT VOID                 *ProcArguments 	OPTIONAL
Output:
EFI_STATUS


Function by Segment

By Segment

The following is a list of the segments.
For a list in alphabetical order, see In Alphabetical Order.
For a list by file name, see By File Name.

  • SMM


SMM

The following functions are used in the segment: SMM.

Function | Description
SmmEntry | Call any Legacy Handlers and call 32 bit protected Mode Dispatcher.
Thunk | The Thunk code is copied to below 1MB and used in SMM to Thunk to 16-bit mode.


Functions in Alphabetical Order

In Alphabetical Order

The following topics provide a list in alphabetical order.
For a list by file name, see By File Name.
For a list by segment, see By Segment.

  • A
  • C
  • D
  • E
  • F
  • G
  • H
  • I
  • L
  • M
  • N
  • P
  • R
  • S
  • T
  • V
  • X


Functions in Alphabetical Order

A

Function | Description
Align2n | Align the address to nearest specified 2n alignment. If the alignment isn't 2^n-1, then result will be invalid.
Align8 | Align the address to nearest 8 byte alignment.
Allocate | Allocate a memory. Caller may specify either a specific address or alignment, or neither. Alignment is a minimum of 8 bytes.
AllocateABSegPages | Allocate SMM 4k pages of memory in A or B segment.
AllocatePool | Allocate memory.


Functions in Alphabetical Order

C

Function | Description
CalculateCrc32 | Calculate Crc 32
CallFuncInSmm | Call function in SMM. If not in SMM, generate SW SMI, otherwise call the function.
CommonEntry | BSP and APs start here from SmmEntry.asm.
CommunicateCallBack | Sw SMI callback to call communicate functions.
ConstructMemoryReservedTable | Intitialize the MEMORY_RESERVED_TABLE.
CopySmmThunkAfterBspEntry | Copy SMM Thunk to immediately after SMM BSP entry.
CopySmmThunkAtStartABSegment | Copy SMM Thunk to start of AB Segment
CopySmmThunkInCsmEBDA | Copy SMM Thunk to CSM. Data will be in EBDA.
CreateRuntimeInSmmFunction | Create InSmm function in runtime.


Functions in Alphabetical Order

D

Function | Description
DisableSmmCallbacks | This is signaled before booting or shell. This makes the SMM Base protocol register/unregister unsupported.


Functions in Alphabetical Order

E

Function | Description
EarlyAllocSmmMemory | Allocate SMM memory before SMM memory manager available.
EarlyAllocSmmMemoryAlign | Allocate SMM memory before SMM memory manager available with specified alignment. Memory address returned will be the next aligned address available and the Free memory before the aligned address can not be allocated.
EfiInitializeFwVolDevicepathNode | Create Firmware volume device path.
EfiSmmAllocatePool | Allocate buffer from SMM Memory.
EfiSmmCallBackService | Function for the SMM to call back.
EfiSmmCommunicate | Buffer location for EFI Call Back function.
EfiSmmFarCall86 | Smm Thunk call. If no stack, this will push flags to simulate int call.
EfiSmmFarCall86Ex | Smm Thunk call. If no stack, this will push flags to simulate int call.
EfiSmmFreePool | Free pool of memory.
EfiSmmGetSmstLocation | Returns a pointer to the Smst.
EfiSmmGetSmstLocation2 | Retruns a pointer to the Smst.
EfiSmmRegister | Register a driver with the SMM Handler. * Loads SMM PE32 Driver into SMM memory and give control to the entry point. * Or, loads SMM 16-bit driver into SMM memory. It is given control during SMM mode.
EfiSmmRegisterUnsupported | The SMM Base Protocol function Register return unsupported after BIOS is done executing.
EfiSmmUnregister | Removes handler from being called in SMM.
EfiSmmUnregisterUnsupported | The SMM Base Protocol function UnRegister return unsupported after BIOS is done executing.

Table | Description
EFI_SMM_ACCESS_PROTOCOL | This provides north bridge functions to open, close, lock, and describe SMM space.
EFI_SMM_CONTROL_PROTOCOL | Provides south bridge functions for triggering and clearing SMIs.


Functions in Alphabetical Order

F

Function | Description
FindAddress | Find a gap of Free memory of an specific Address and a size. If part of the space is taken, return 0. If the space is found, return the preceding memory descriptor, or the last memory descriptor.
FindFreeSpace | Find a gap of Free memory of a size and possibly of an alignment. This returns the preceding memory descriptor. If no gaps are found, the last memory descriptor is returned.
FindHobs | Locate the HOBs needed.
FindMatchingMtrr | Search MTRRs for a matching MTRR.
Free | Free an allocated buffer.
Free4kPages | Free pages from buffer.
FvHasBeenProcessed |
FvIsBeingProcesssed | This firmware volume is marked as being processed.


Functions in Alphabetical Order

G

Function | Description
GetEmptyDescriptor | Find an unused memory descriptor in the tables.
GrowDepexStack | Increase Depex Stack..


Functions in Alphabetical Order

H

Function | Description
HasItTimedOut | Return EFI_TIMEOUT if timer has expired.
HoldStartedCpus | Hold loop for CPU to sync. All but one CPU will enter here.


Functions in Alphabetical Order

I

Function | Description
InitAcpi | Initialize Acpi SMM Communicate part.
InitCrc | InitCrc
InitDxe | Initialize DXE SMM Communicate part.
InitializeDispatcher | Initialize Dispatcher.
InitializeListHead | Initialize the head of the List. The caller must Allocate the memory for the EFI_LIST. This function must be called before the other linked list macros can be used.
InitializeMemoryManager | Initialize the memory manager, so the functions can be used.
InitializeSmmPiSystemTable | Initialize SMM PI System Table.
InitializeSmmSystemTable | Initialize the System Table.
InitInterrupts | Install Interrupt Handlers. Initialize the interrupt descriptors.
InitPowerButton | This is the entrypoint of the Power button driver.
InitSmm | Initialize SMM part of SMM Communicate.
InsertHeadList | Insert a Node into the start of a doubly linked list. The list must have been initialized with InitializeListHead () before using this function.
InsertTailList | Insert a Node into the end of a doubly linked list. The list must have been initialized with InitializeListHead () before using this function.
InSmm | Updates if *InSmm if in SMM.
InSmmFunction | This function is called from SMM during SMM registration.
IsListEmpty | Return TRUE is the list contains zero nodes. Otherwise return FALSE. The list must have been initialized with InitializeListHead () before using this function.


Functions in Alphabetical Order

L

Function | Description
LoadAndInitDispatcherImages | Load and initialize dispatcher images.
LoadRealModeFile | Load a real mode file into a buffer.
LocateProtocols | Locate protocols needed for SMM Base.
LockDec32 | Decrement value at pointer locking address.
LockInc32 | Increment value at pointer locking address.


Functions in Alphabetical Order

M

Function | Description
MachineCheckHandler | SMM Machine Check Handler
MoveToNewConfigurationTable | Create a new bigger or smaller table and copy the old table to the new table.

Data Structure | Description
MEMORY_DESCRIPTOR | Each descriptor contains the Base and end + 1 of each memory allocation. The list is sorted from lowest to highest. Last linked descriptor has a Link = 0. Unused descriptors have links = 0xffffffff.
MEMORY_RESERVED_TABLE | Table stores memory descriptors. If runs out of descriptors, additional tables will be linked. New tables can not be removed. Unused descriptors Link will be 0xffffffff. Last table Link = 0.


Functions in Alphabetical Order

N

Function | Description
NotInSmmFunction | This function is called from outside of SMM during SMM registration.


Functions in Alphabetical Order

P

Function | Description
PopBool | Pop boolean value to stack.
PowerButtonActivated | If the power button is pressed, then this function is called.
PushBool | Push boolean value to stack.


Functions in Alphabetical Order

R

Function | Description
RemoveDescriptor | Find an unused memory descriptor in the tables.
RemoveEntryList | Remove Node from the doubly linked list. It is the caller's responsibility to Free any memory used by the entry if needed. The list must have been initialized with InitializeListHead () before using this function.


Functions in Alphabetical Order

S

Function | Description
SetDisallowRegistering | Don't allow registering handlers from SMM.
SmiHandlerRegister | Register SMI Handle
SmmAddToDriverList | Add Driver to database for processing.
SmmAllocatePool | Does the actual work for EfiSmmAllocatePool.
SmmApEntry | APs after switching to protected mode will jump here.
SmmBspEntry | Call Smm call back or dispatch handlers.
SmmCommunicate | Does the actual work for EfiSmmCommunicate.
SmmCommunicate | SmmCommunicate Protocol function. This will generate SW SMI.
SmmCommunicateEntry | Smm Communciation entry point to initialize provide SMM Communicate Protocol.
SmmCoreFindSmiEntry | Find Smi Entry
SmmDispatcher | Dispatch drivers that dependencies are met.
SmmDisplayDiscoveredNotDispatched | Display to debug output drivers discovered, but not loaded.
SmmDriverDispatchHandler | Dispatch SMM drivers
SmmEntry | Call any Legacy Handlers and call 32 bit protected Mode Dispatcher.
SmmFindProtocolEntry | Finds the protocol entry for the requested protocol.
SmmFindProtocolInterface | 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.
SmmFreePool | Does the actual work for EfiSmmFreePool.
SmmFvToDevicePath | Create device path for Driver.
SmmGetDepexSectionAndPreProccess | Get driver depex section.
SmmGetNextLocateAllHandles | Find next handle.
SmmGetNextLocateByProtocol | Routine to get the next Handle, when you are searching for a given protocol.
SmmGetNextLocateByRegisterNotify | Routine to get the next Handle, when you are searching for register protocol notifies.
SmmGetProtocolInterface | Locate a certain GUID protocol interface in a Handle's protocols.
SmmInitEntry | SMM Installer Entry Point.
SmmInsertOnScheduledQueueWhileProcessingBeforeAndAfter | Add drivers on queue with before or after dependencies.
SmmInstallConfigurationTable | This procedure add/updates/deletes configuration table entries. Configuration Table Entry definition: EFI_GUID VendorGuid VOID *VenderTable 1. If Vendor Guid is not in table and Input table isn't NULL, add Guid/Table pair. 2. If Vendor Guid is in table and Input table isn't NULL, update Guid/Table pair. 3. If Vendor Guid is in table and Input table is NULL, remove Guid/Tablble pair. 4. If Vendor Guid is not in table, Input table is NULL, return EFI_NOT_FOUND. Nothing to delete.
SmmIoRead | Read io buffer.
SmmIoWrite | Write to Io from buffer.
SmmIsSchedulable | Check if driver meets dependencies.
SmmLoadImage | Load driver into memory and give control.
SmmMemRead | Read memory buffer.
SmmMemWrite | Write to memory from buffer.
SmmNotifyProtocol | Signal event for every protocol in protocol entry.
SmmPreProcessDepex | Check driver dependencies for SOR, BEFORE, or AFTER, and update DriverEntry.
SmmRegisterHandler | Does the actual work for EfiSmmRegisterHandler.
SmmRemoveInterfaceFromProtocol | Removes Protocol from the protocol list (but not the handle list).
SmmSmstAllocatePages | Allocate # pages at any address, a max address, or a specified address.
SmmSmstAllocatePool | Allocate a pool of memory.
SmmSmstFreePages | Free pages. The address must be on a page boundary, but it doesn't have to start on address from AllocatePages. It only frees the requested pages.
SmmSmstFreePool | Free Allocated memory.
SmmSmstHandleProtocol | Queries a handle to determine if it supports a specified protocol.
SmmSmstInstallProtocolInterface | Wrapper function to SmmInstallProtocolInterfaceNotify. This is the public API which Calls the private one which contains a BOOLEAN parameter for notifications
SmmSmstInstallProtocolInterfaceNotify | Installs a protocol interface into the boot services environment.
SmmSmstLocateHandle | Locates the requested handle(s) and returns them in Buffer.
SmmSmstLocateProtocol | 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.
SmmSmstRegisterProtocolNotify | Add a new protocol notification record for the request protocol.
SmmSmstUninstallProtocolInterface | Uninstalls all instances of a protocol:interfacer from a handle. If the last protocol interface is remove from the handle, the handle is freed.
SmmStartupThisAp | Execute a procedure on an AP.
SmmUnregisterHandler | Does the actual work for EfiSmmUnregisterHandler.
SmmValidateHandle | Check whether a handle is a valid EFI_HANDLE.
StartAllCpus | One random CPU enters here. Waits for CPUs to sync. If no sync, tries to start CPUs that didn't enter SMM.
StartTimeout | Initialize timeout for a specified about of time in uS.


Functions in Alphabetical Order

T

Function | Description
Thunk | The Thunk code is copied to below 1MB and used in SMM to Thunk to 16-bit mode.


Functions in Alphabetical Order

V

Function | Description
VirtAddrChg | Change pointer of gCommunicateData to virtual address.


Functions in Alphabetical Order

X

Function | Description
Xchg8 | Exchange a value with a pointer and return the exchanged value.


General Information


Copyright

American Megatrends, Inc.
5555 Oakbrook Parkway
Suite 200
Norcross, GA 30093 (USA)

Copyright (c) 1999-2012 American Megatrends, Inc. All Rights Reserved.

This publication contains proprietary information, which is protected by copyright. No part of this publication may be reproduced, transcribed, stored in a retrieval system, translated into any language or computer language, or transmitted in any form whatsoever without the prior written consent of the publisher, American Megatrends, Inc.

American Megatrends, Inc. retains the right to update, change, modify this publication at any time, without notice.

For Additional Information

Call American Megatrends BIOS Sales Department at 1-800-828-9264 for additional information.

Limitations of Liability

In no event shall American Megatrends be held liable for any loss, expenses, or damages of any kind whatsoever, whether direct, indirect, incidental, or consequential, arising from the design or use of this product or the support materials provided with the product.

Limited Warranty

No warranties are made, either expressed or implied, with regard to the contents of this work, its merchantability, or fitness for a particular use. American Megatrends assumes no responsibility for errors and omissions or for the uses made of the material contained herein or reader decisions based on such use.

Trademark and Copyright Acknowledgments

All product names used in this publication are for identification purposes only and are trademarks of their respective Companies.