# IioCfgUpdateDxeLightningRidgeEXECB3

## Function Table

| Address | Name | Description |
|---------|------|-------------|
|  | **ModuleEntryPoint** |  |
|  | **IioCfgUpdateEntryPoint** |  |
|  | **UbaDebugPrint** |  |
|  | **UbaDebugAssert** |  |
|  | **IsHobListGuid** |  |
|  | **ReadUnaligned64** |  |
| UBA | **IIO Configuration Protocol GUID** |  |
| Image | **offset: 0xBC0 (16 bytes)** |  |
| STATIC | **CONST EFI_GUID  mUbaIioCfgProtocolGuid = UBA_IIO_CFG_PROTOCOL_GUID;** |  |
| IIO | **Table 1 GUID** |  |
| Image | **offset: 0xBD0 (16 bytes)** |  |
| STATIC | **CONST EFI_GUID  mIioCfgTable1Guid = IIO_CFG_TABLE_1_GUID;** |  |
| IIO | **Table 2 GUID** |  |
| Image | **offset: 0xBE0 (16 bytes)** |  |
| STATIC | **CONST EFI_GUID  mIioCfgTable2Guid = IIO_CFG_TABLE_2_GUID;** |  |
| IIO | **Table 3 GUID** |  |
| Image | **offset: 0xBF0 (16 bytes)** |  |
| STATIC | **CONST EFI_GUID  mIioCfgTable3Guid = IIO_CFG_TABLE_3_GUID;** |  |
| IIO | **Table 4 GUID** |  |
| Image | **offset: 0xC00 (16 bytes)** |  |
| STATIC | **CONST EFI_GUID  mIioCfgTable4Guid = IIO_CFG_TABLE_4_GUID;** |  |
| EFI | **HOB List GUID** |  |
| Image | **offset: 0xC10 (16 bytes)** |  |
| Used | **by IsHobListGuid() to identify the HOB list in ConfigurationTable[].** |  |
| STATIC | **CONST EFI_GUID  mEfiHobListGuid = EFI_HOB_LIST_GUID;** |  |
| UBA | **Debug Library Protocol GUID** |  |
| Image | **offset: 0xBD0 (duplicate of IIO Table 1 GUID** | the decompiler |
| references | **0xBD0 as the debug lib protocol GUID in sub_510).** |  |
| STATIC | **CONST EFI_GUID  mUbaDebugLibProtocolGuid = UBA_DEBUG_LIB_PROTOCOL_GUID;** |  |
| gImageHandle | **-- UEFI image handle for this driver.** |  |
| Image | **offset: 0xDB0** |  |
| EFI_HANDLE | **gImageHandle = NULL;** |  |
| gST | **-- UEFI System Table pointer.** |  |
| Image | **offset: 0xDA0** |  |
| EFI_SYSTEM_TABLE | ***gST = NULL;** |  |
| gBS | **-- UEFI Boot Services pointer.** |  |
| Image | **offset: 0xDA8** |  |
| EFI_BOOT_SERVICES | ***gBS = NULL;** |  |
| gRT | **-- UEFI Runtime Services pointer.** |  |
| Image | **offset: 0xDB8** |  |
| EFI_RUNTIME_SERVICES | ***gRT = NULL;** |  |
| mUbaDebugProtocol | **-- Cached UBA debug protocol pointer.** |  |
| Image | **offset: 0xDC0** |  |
| Resolved | **lazily by LocateUbaDebugProtocol().** |  |
| VOID | ***mUbaDebugProtocol = NULL;** |  |
| mHobList | **-- Cached HOB list pointer.** |  |
| Image | **offset: 0xDC8** |  |
| Resolved | **lazily by GetHobList().** |  |
| VOID | ***mHobList = NULL;** |  |
| Step | **1: Cache UEFI standard pointers globally.** |  |
| gImageHandle | **= ImageHandle;** |  |
| Step | **2: Validate non-NULL and cache boot/runtime services.** |  |
| if | **(ImageHandle == NULL) {** |  |
| Step | **3: Resolve the HOB list (cached in mHobList).** |  |
| GetHobList | **();** |  |
| Step | **4: Dispatch the IIO configuration update.** |  |
| Status | **= IioCfgUpdateEntryPoint ();** |  |
| Step | **1: Initialize output variable and emit platform banner.** |  |
| UbaProtocol | **= NULL;** |  |
| Step | **2: Locate the UBA IIO configuration protocol.** |  |
| Status | **= gBS->LocateProtocol (** |  |
| Step | **3: Register the four IIO PCIe topology configuration tables.** |  |
| Each | **call passes the same PIIO header structure (48 bytes) but keyed** |  |
| by | **a different table GUID.** |  |
| The | **AddConfig function is at vtable index 2 (offset 0x10):** |  |
| EFI_STATUS | **(*AddConfig)(** |  |
| VOID | ***This** |  |
| CONST | **EFI_GUID *ConfigGuid** |  |
| CONST | **VOID *ConfigData** |  |
| UINTN | **ConfigDataSize** |  |
| Table | **1: Primary IIO topology** |  |
| Status | **= ((EFI_STATUS (*)(VOID *, CONST EFI_GUID *, CONST VOID *, UINTN))** |  |
| Table | **2: Secondary IIO topology** |  |
| Table | **3: Tertiary IIO topology** |  |
| Table | **4: Quaternary IIO topology** |  |
| Return | **cached pointer if already resolved.** |  |
| if | **(mUbaDebugProtocol != NULL) {** |  |
| Perform | **pool size sanity check.** |  |
| Allocate | **and immediately free a 31-byte buffer. If the returned pool** |  |
| size | **is <= 0x10, the system is in a state where protocol resolution** |  |
| would | **also fail, so bail out early.** |  |
| Locate | **the UBA debug protocol.** |  |
| Resolve | **the UBA debug protocol (lazy init).** |  |
| Protocol | **= LocateUbaDebugProtocol ();** |  |
| Read | **CMOS register 0x4B to determine the board platform type.** |  |
| Access | **sequence:** |  |
| CmosValue | **= IoRead8 (0x70);** |  |
| Determine | **platform type from CMOS value.** |  |
| If | **value is > 3 and equals 0, fall back to MMIO strapping register.** |  |
| if | **(PlatformType > 3) {** |  |
| Select | **debug mask based on platform type.** |  |
| Type | **1 = LightningRidge, others use a broader mask.** |  |
| if | **(PlatformType == 1) {** |  |
| Check | **if the error level matches the platform debug mask.** |  |
| if | **((DebugMask & ErrorLevel) == 0) {** |  |
| Call | **the protocol's DebugPrint function (vtable offset 0x00).** |  |
| VA_START | **(VaList, Format);** |  |
| Call | **the protocol's assertion handler (vtable offset 0x08).** |  |
| if | **(mHobList != NULL) {** |  |
| Initialize | **cache to NULL before scanning.** |  |
| Scan | **the configuration table array for the HOB list GUID.** |  |
| if | **(ConfigTable != NULL) {** |  |
| If | **the GUID was not found, trigger a debug assert.** |  |
| if | **(mHobList == NULL) {** |  |
| EFI_NOT_FOUND | **);** |  |
| If | **the resolved pointer itself is NULL, trigger another assert.** |  |
| Compare | **GUID as two 64-bit halves.** |  |
| return | **(ReadUnaligned64 (&mEfiHobListGuid) == ReadUnaligned64 (Guid))** |  |
| Validate | **buffer pointer is not NULL.** |  |
| if | **(Buffer == NULL) {** |  |
| Dereference | **directly.** |  |
| return | ***(CONST UINT64 *)Buffer;** |  |

---
*Generated by HR650X BIOS Decompilation Project*