# AcpiPlatform

**Index:** 0318 | **Size:** 117.6 KB | **Phase:** DXE | **Arch:** X64

## Overview

ACPI platform driver that constructs and installs the ACPI tables for the Purley platform. Builds platform policy from setup variables, CPUID, and MSR values, then dispatches table-specific patching based on 4-byte ACPI table signatures. Handles VT-d (DMA remapping with 24 DRHD entries), SRAT (NUMA proximity domains for 2S/4S/8S topologies), SLIT (system locality distances), APIC (LAPIC/I/O APIC/ISO/NMI entries), NFIT (NVDIMM firmware interface table), and SSDT generation.

## Key Functions

- **PlatformHooksInit**, **SetAcpiMode**, **InstallAcpiTables**, **InstallNfitAcpiTable**: Main ACPI installation pipeline
- **PlatformUpdateTables**: Notification event that patches installed tables based on platform configuration
- **AcpiPlatformTableFilter**: Filters tables by signature, dispatches to signature-specific patchers (DSDT, SSDT, SRAT, SLIT, APIC, NFIT, DMAR, etc.)
- **SetupPlatformPolicy**, **CheckCsmEnabled**: Reads setup variables and platform configuration to determine ACPI table content
- **GetApicCoreMap**, **InitializeApicProcessorMap**: Builds processor topology tables for LAPIC entries

## Protocols/Dependencies

- AcpiPlatformProtocol, SystemConfigProtocol, CpuConfigProtocol
- AMI ACPI Library Protocol (for NFIT patching)
- PCI Root Bridge (LocatePciRootBridge), USRA protocol
- VT-d (DMAR with 24 DRHD entries, 4 sockets x 6 cores), NUMA/SRAT/SLIT, NVDIMM/NFIT

## Platform

Intel Purley platform (PurleyPlatPkg/Acpi/AcpiPlatform), Lenovo HR650X. Supports CSM/compatibility mode detection and multi-socket topologies.