Newer
Older
AMI-Aptio-BIOS-Reversed / AmiIpmiPkg / Ipmi / DxeSelStatusCode / DxeSelStatusCode.md
@Ajax Dong Ajax Dong 2 days ago 8 KB Full restructure

DxeSelStatusCode

Function Table

Address Name Description
UefiBootServicesTableLibConstructor
ReportStatusCodeLibDestructor
BootServicesCleanup
RuntimeProtocolCleanup
ModuleEntryPoint
SetVirtualAddressMapHandler
SelMapStatusCodeToEventData
SelWriteEventToRecord
SelClearEventRecord
SelStatusCodeEntryInit
DebugPrintWithLevel
DebugAssert
nullsub_1
RuntimeProtocolNotifyCleanup
SmbiosProtocolInit
SmbiosProtocolCleanup
ReportStatusCodeNotifyShutdown
SelAddEventRecord
SelCheckRedundancyStatus
SelManageEventLog
HobGuidCompare
ReadUnaligned64
Global Variables
EFI_HANDLE gImageHandle = NULL;
RuntimeServices_0 EFI_RUNTIME_SERVICES *gRuntimeServices2 = NULL; // RuntimeServices_1
qword_4418 // SEL configuration state
byte_4370 UINT8 gEnableRedundancy = 0; // byte_4410
byte_4421 UINT8 gSelOperationMode = 0; // n2 (0x4420)
qword_43C0 VOID *gHobList = NULL; // qword_43C8
qword_43D8 UINT8 gSmbiosInitialized = 0; // byte_43D0
qword_4408 EFI_EVENT gBootServicesCleanupEvent = NULL; // qword_43B0
qword_43F0 EFI_EVENT gSmbiosCleanupEvent = NULL; // qword_43E8
qword_43F8 EFI_EVENT gRuntimeProtocolCleanupEvent = NULL; // qword_43A8
BootServices_0 at qword_43B8
SEL Event Record Mapping Table
61 entries x 12 bytes mapping UEFI status code classes to IPMI
sensor number, sensor type, event direction, and event data.
SEL_EVENT_MAP_ENTRY gSelEventMapTable[] = {
Function Prototypes
EFI_STATUS EFIAPI
Module Entry Point
UefiBootServicesTableLibConstructor (formerly sub_10F8)
Initializes UEFI boot services table library state. Registers
exit boot services and set virtual address map events. Locates
runtime protocol and debug print protocol instances.
Cache global pointers
Register BootServices cleanup event
Register runtime protocol cleanup event
Register SetVirtualAddressMap notify for runtime library
Register runtime protocol notify
Register SMBIOS cleanup
Register ReportStatusCode shutdown
ReportStatusCodeLibDestructor (formerly sub_1424)
Closes all registered events and frees protocol resources.
Called on error unwind or module unload.
SetVirtualAddressMapHandler (formerly sub_15CC)
Converts gRuntimeServicesCopy and gIpmiTransport for virtual
addressing after SetVirtualAddressMap.
SelMapStatusCodeToEventData (formerly sub_15FC)
Searches the SEL event mapping table for an entry matching the
given status code value and instance. If found, builds a 16-byte
IPMI SEL event record data buffer.
Check redundancy status
Clear the record first
Add with redundancy
Build record data structure
Record ID = 0
Record Type = 2 (SEL)
Timestamp = 0
Generator ID
Event Message Format Version
Event Type + Event Direction
SelWriteEventToRecord (formerly sub_16D4)
Writes an IPMI SEL event record using the transport protocol.
Handles reserve and append operations.
Skip if redundancy not needed
Map status code to SEL event data
IPMI transport write command
NetFn 0x0A
Command 0x44
SelClearEventRecord (formerly sub_175C)
Clears an IPMI SEL event record. Validates sensor type.
Validate type
Call IPMI transport to clear SEL
SelStatusCodeEntryInit (formerly sub_17E0)
Main initialization for the SEL Status Code driver. Reads platform
configuration from the "ServerSetup" UEFI variable, locates the IPMI
transport protocol, registers SetVirtualAddressMap notification, and
installs the SEL event clearing/smm notification protocol.
Get IPMI transport protocol
Read ServerSetup variable
Handle SEL clear operation
Check redundancy
Configure SEL event handling
Register SMM communication protocol
Register SetVirtualAddressMap event
Locate SMM communication/SMBIOS dispatch protocol
Register clear handler
DebugPrintProtocolInit (formerly sub_1A48)
Allocates memory and locates the debug print protocol. Used for
ASSERT and debug output.
DebugPrintWithLevel (formerly sub_1AD0)
Checks current debug verbosity level (via CMOS) and prints message
if level matches. Used by ASSERT_EFI_ERROR macro output.
Read debug level from CMOS (offset 0x4B)
DebugAssert (formerly sub_1B50)
Standard EDK2 ASSERT handler. Prints file/line/expression and
enters dead loop.
BootServicesCleanup (formerly sub_1B90)
ExitBootServices callback. Nullifies the BootServices_0 pointer
to prevent use after boot services exit.
RuntimeProtocolCleanup (formerly sub_1B9C)
SetVirtualAddressMap callback. Converts the debug print protocol
pointer for runtime virtual addressing.
HobGetGuidEntry (formerly sub_1BC4)
Locates the GUIDed HOB entry in the system HOB list. Used to find
the SMBIOS table or other platform configuration tables.
Get HOB list from SystemTable
nullsub_1 (formerly nullsub_1)
action but need a registered callback.
RuntimeProtocolNotifyCleanup (formerly sub_1CA0)
SetVirtualAddressMap notification to convert the gRuntimeServices2
pointer to virtual addressing.
SmbiosProtocolInit (formerly sub_1CB4)
Locates the SMBIOS protocol instance. Used for SMBIOS table access
during SEL event logging.
SmbiosProtocolCleanup (formerly sub_1D14)
SetVirtualAddressMap callback to convert the SMBIOS protocol
ReportStatusCodeNotifyShutdown (formerly sub_1D3C)
ExitBootServices notification. Initializes SMBIOS protocol for
runtime and marks initialization complete.
SelAddEventRecord (formerly sub_1D54)
Adds a SEL event record via the IPMI transport. Retries up to
512 times to handle the reserve-then-add race condition with
the BMC.
Send reserve SEL command
IPMI SEL reserve
IPMI SEL add
Data length
Set reserve flag
Reservation lost/gained - need to retry
SelCheckRedundancyStatus (formerly sub_1E30)
Checks the IPMI SEL status via the transport protocol to determine
if the SEL is operational, has available space, and redundancy is
NetFn 0x0A, Cmd 0x40 (Get SEL Info)
IPMI NetFn Storage
Get SEL Info
Byte 7: SEL State (bit 3 = Redundancy, bit 7 = Operational)
SelManageEventLog (formerly sub_1E98)
Manages the IPMI SEL event log. Supports two operations:
Mode 1: Clear SEL entries matching the status code
Mode 2: Add SEL entries for status codes
For mode 2, performs a reserve + add sequence using the IPMI
transport protocol.
Get SEL info to check state
SEL has entries - clear or process
Reserve SEL
Clear SEL entries
Deleting single record not supported
Add entry
Reserve + Add
Check response byte 8 for status
HobGuidCompare (formerly sub_2048)
Compares two GUIDs by reading their QWORD pairs via unaligned
ReadUnaligned64 (formerly sub_20B8)
Reads a 64-bit value from potentially unaligned memory.

Generated by HR650X BIOS Decompilation Project