AMI-Aptio-BIOS-Reversed / AmiModulePkg / RuntimeSmm / RuntimeSmm /
@Ajax Dong Ajax Dong authored 7 days ago
..
README.md Recovering names (docs) 7 days ago
RuntimeSmm.c Recovering names 7 days ago
RuntimeSmm.h Recovering names 7 days ago
RuntimeSmm.md Recovering names (docs) 7 days ago
README.md

RuntimeSmm

Index: 0204
Size: 5,476 bytes (1564h)
Phase: SMM (DXE_SMM_DRIVER)
Source Package: AmiModulePkg\RuntimeSmm\RuntimeSmm.c

Overview

Minimal UEFI SMM runtime driver that bridges boot-time and SMM runtime services. Initializes global pointers to Boot Services, Runtime Services, and System Table; locates the SmmBase2 protocol to obtain the SMM Services Table (gSmst); registers a protocol notification handler for the SMM Runtime Services Table protocol. Uses SetJump/LongJump for error recovery. Has no import table -- all protocol interfaces resolved via LocateProtocol.

Module Layout

  • Recovered into a single implementation unit: RuntimeSmm.c with companion declarations in RuntimeSmm.h.
  • Symbol recovery applied for function/variable names where map evidence was explicit; no local file split was identified in evidence.

Key Functions

  • _ModuleEntryPoint -- recovered module entry symbol (maps to SMM entry)
  • ModuleEntryPoint -- local compatibility wrapper preserved in source for symbol continuity
  • RuntimeSmmCacheSystemServices (0x44C) -- Initializes gImageHandle, gST, gBS, gRT, locates SmmBase2, retrieves gSmst
  • RuntimeSmmInitJumpState (0x58C) -- Main dispatch: SetJump error recovery, calls RuntimeSmmInitialize (0x768) init, cleans up with LongJump
  • RuntimeSmmInitialize (0x768) -- Driver init: caches system tables, locates SMM Runtime Services Table protocol, calls its callback, installs protocol handlers
  • RuntimeSmmSetJump / RuntimeSmmLongJump (0x300/0x3A0) -- SetJump/LongJump: saves/restores GP registers, XMM registers, MXCSR into 248-byte buffer
  • RuntimeSmmRegisterProtocolNotifyTable (0x64C) -- Allocates buffer with protocol GUID data, registers via SmmRegisterProtocolNotify
  • RuntimeSmmRegisterRuntimeServices / RuntimeSmmRegisterStatusCodeProtocol (0x9F8/0xA80) -- Protocol registration for Runtime Services and Status Code in both SMM and boot modes

Protocols

  • SmmBase2 protocol (SMM_SERVICES_TABLE_GUID)
  • SMM Runtime Services Table protocol
  • gEfiStatusCodeRuntimeProtocolGuid (DebugLib)

Platform

HR650X (Purley), built from PurleyPlatformPkg/AmiModulePkg, DEBUG VS2015 X64