# MainErrorHandler
**Index:** 0216 | **Size:** 25,584 bytes (152,960 body) | **Phase:** DXE/SMM

## Overview
Top-level UEFI error handler dispatcher for the Intel Purley platform. This module initializes the error handling subsystem by calling library constructors, then registers error sources and notification callbacks. It serves as the main entry point that chains into PlatformErrorHandler, ProcessorErrorHandler, and other per-domain error handlers.

## Key Functions
- **ModuleEntryPoint** -- UEFI entry point; calls sub_2398 (AutoGen init), sub_2774 (main init), and sub_2704 (fallback/unload on error)
- **InitMainErrorHandlerLibraries** (recovered from `sub_2398`) -- library constructor chain initialization (gST/gBS/gRT/gSmst setup)
- **RegisterMainErrorHandlerCallbacks** (recovered from `sub_2774`) -- main error handler registration logic
- **UnregisterMainErrorHandlerCallbacks** (recovered from `sub_2704`) -- error cleanup/unload handler on initialization failure

## Recovered Symbol Mapping
- `sub_2398` -> `InitMainErrorHandlerLibraries`
- `sub_2774` -> `RegisterMainErrorHandlerCallbacks`
- `sub_2704` -> `UnregisterMainErrorHandlerCallbacks`

## Protocols/Dependencies
- UEFI Boot Services (gBS), Runtime Services (gRT), SMM System Table (gSmst)
- EFI_SMM_BASE2_PROTOCOL, EFI_SMM_SW_DISPATCH2_PROTOCOL
- EMCA Platform Protocol and MP Sync Data protocols

## Platform
Intel Purley (Skylake-SP Xeon), HR650X
Source: PurleyPlatPkg/Ras/Smm/ErrHandling/MainErrorHandler/
