This module type is used by SMM Drivers that are loaded into SMRAM. As a result, this module type is only available for IA-32 and x64 CPUs. These modules are dispatched by SMM Foundation and are never destroyed. This means the services that these modules produce are available after
The lifecycle of SMM drivers can be divided into two phases, which have different constraints.
This is the phase of SMM Driver initialization that starts with the call to the driver's entry point and ends with the return from the driver's entry point.
This is the phase of SMM Driver initialization that starts after the return from the driver's entry point.
Following is the example of
[Defines] section for a driver named
SampleDriverDxeSmm. For a SMM driver, the
[Defines]INF_VERSION = 0x00010005BASE_NAME = SampleDriverDxeSmmFILE_GUID = XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXMODULE_TYPE = DXE_SMM_DRIVERPI_SPECIFICATION_VERSION = 0x0001000AENTRY_POINT = SampleDxeSmmDriverEntryPoint[Depex]gSampleProtocolGuid
Note: PISPECIFICATIONVERSION should be definitely set to 0x0001000A for PI
1.1 compliant SMM drivers.
The SMM driver model has constraints similar to those of DXE Runtime Drivers.
Inside of SMM Runtime, the drivers may not be able to use core protocol services.
There are SMST-based services, which the drivers can access, but the UEFI System Table and other protocols installed during boot services may not necessarily be available.
Inside of SMM Initialization, the full collection of UEFI Boot Services, UEFI Runtime Services and SMST-based services are available.
An SMM Driver's initialization phase begins when the driver is loaded into SMRAM, and its entry point is called. An SMM Driver's initialization phase ends when the entry point returns.
During SMM Driver initialization, SMM Drivers have access to two sets of protocols:
UEFI protocols and SMM protocols.
UEFI protocols are those installed and discovered using UEFI Boot Services. UEFI protocols can be located and used by SMM drivers only during SMM Initialization.
SMM protocols are those installed and discovered using the System Management Services Table (SMST). SMM protocols can be discovered by SMM drivers during initialization phase and SMM runtime phase.
SMM Drivers must not use the UEFI Boot Services
ExitBootServices() during SMM Driver Initialization.
During SMM Driver runtime, SMM drivers only have access to SMST-based services. In addition, depending on the platform architecture, memory areas outside of SMRAM may not be accessible to SMM Drivers. Likewise, memory areas inside of SMRAM may not be accessible to UEFI drivers.
These SMM Driver Runtime characteristics lead to several restrictions regarding the usage of UEFI services:
UEFI interfaces and services located during SMM Driver Initialization must not be called or referenced during SMM Driver Runtime. This includes the EFI System Table, the UEFI Boot Services, and the UEFI Runtime Services.
Events created during SMM Driver Initialization must be closed before exiting the driver entry point.