# EmcaErrorLog

**Index:** 0214
**Size:** 160,004 bytes (27104h)
**Phase:** SMM (DXE_SMM_DRIVER)
**Source Package:** CpPlatPkg (Enhanced Machine Check Architecture Error Log)

## Overview
SMM-based Enhanced Machine Check Architecture (EMCA) error logging driver. Handles processor machine check error events within SMM context, providing firmware-first error handling for corrected and uncorrected machine check errors. The largest driver in this batch at 160KB, with a massive .data section (137KB) containing error translation tables, platform error descriptors, and CPER (Common Platform Error Record) templates. Coordinates with the WHEA infrastructure (WheaElog/WheaPlatformBoot) for OS-level error reporting.

## Key Functions
- **ModuleEntryPoint** -- Main entry: calls `sub_37E0` init, then `sub_3C58` for EMCA error log setup
- **EmcaErrorLogInitialize** (`sub_37E0`) -- EMCA error log initialization: prepares error logging infrastructure and data tables
- **EmcaErrorLogEnable** (`sub_3C58`) -- Core EMCA error handling: registers SMI handler for machine check events
- **EmcaErrorLogRollback** (`sub_3BE8`) -- Error path cleanup handler called when initialization fails

## Module Recovery Notes
- This module boundary was recovered from decompilation stubs by keeping the original binary symbol names (`sub_37E0`, `sub_3C58`, `sub_3BE8`) as internal references and introducing descriptive entry-level wrappers.

## Protocols
- EFI_SMM_SYSTEM_TABLE2 for SMM services
- EFI_SMM_BASE2_PROTOCOL
- Machine Check Architecture (MCA) MSR access protocol
- CPER (Common Platform Error Record) reporting protocol
- WHEA error notification protocol

## Platform
HR650X (Purley), built from CpPlatPkg, DEBUG VS2015 X64
