# NvmeSmm

**Index:** 0210
**Size:** 18,052 bytes (4684h)
**Phase:** SMM (DXE_SMM_DRIVER)
**Source Package:** AmiModulePkg\Nvme\NvmeSmm\NvmeSmm

## Overview
SMM-based NVMe controller management driver. Provides SMI-handled services for NVMe storage devices, including NVMe device power management, surprise hot-plug handling, and NVMe command queue management during SMM execution context. Handles NVMe controller reset and shutdown sequences under SMM protection. Includes a .reloc section for runtime relocation. Part of the AmiModulePkg NVMe stack that provides both boot-time (NvmePassThroughDxe) and SMM-time NVMe support.

## Key Functions
- **ModuleEntryPoint** -- Main entry: calls sub_5A0 init, then sub_166C for NVMe SMM setup
- **sub_5A0** -- UEFI driver init: caches ImageHandle, SystemTable, BootServices, RuntimeServices
- **sub_166C** -- Core NVMe SMM initialization: registers SMI handlers for NVMe events
- **sub_19E4 / sub_3D0** -- NVMe notification cleanup/teardown callbacks
- **sub_1B34** -- Debug ASSERT handler referencing AutoGen.c
- **sub_1BE8** -- Error path cleanup handler

## Protocols
- EFI_SMM_SYSTEM_TABLE2 for SMM services
- NVMe Controller Pass-Through protocol
- Storage Security Command protocol
- EFI_SMM_CPU_IO2 for MMIO access to NVMe BARs

## Platform
HR650X (Purley), built from AmiModulePkg\Nvme, DEBUG VS2015 X64
