# SmmPciRbIo

- **Index:** 0199
- **Size:** 13,188 bytes (12.9 KB)
- **Phase:** SMM (System Management Mode)
- **PE Format:** PE32+ x86-64, 5 sections (.text, .rdata, .data, section_3, .xdata)

## Overview

SMM driver for PCI Root Bridge I/O access. Part of the AmiModulePkg/PCI/SmmPciRbIo package. This driver provides a root bridge I/O abstraction that operates from SMM context, allowing SMM code to perform PCI configuration cycles (both legacy CF8/CFC and PCIe enhanced configuration) independent of the DXE PCI infrastructure. It handles bus number translation, device enumeration, and memory-mapped PCIe configuration space access. This is essential for SMM drivers that need to query or configure PCI devices during runtime or S3 resume.

## Key Functions

- **ModuleEntryPoint** -- Standard SMM entry; library init and PCI RbIo setup
- **sub_544** -- AutoGen library constructor
- **sub_1148** -- Core PCI Root Bridge I/O initialization (segment groups, bus range detection)
- **sub_1530** -- Library destructor
- **sub_340** -- Manual unload handler
- **sub_1664** -- Error handler for PCI RbIo failures
- **sub_2A0** -- Early PCI configuration space enumeration

## Protocols

- **SmmBase2 Protocol** -- SMM entry point
- **SmmPciRbIo Protocol** -- Root bridge PCI I/O abstraction (PciRead/PciWrite via SMM)
- **SmmCpuIo2 Protocol** -- CPU I/O access in SMM

## Platform

- **Build:** HR6N0XMLK DEBUG_VS2015 X64
- **Source:** AmiModulePkg/PCI/SmmPciRbIo
- **Part of:** HR650X BIOS SMM infrastructure (indices 0195-0199, 0201-0203)