/** @file
  IioCfgUpdateDxeLightningRidgeEXECB3.h -- Header for IioCfgUpdateDxeLightningRidgeEXECB3

Copyright (c) HR650X BIOS Decompilation Project
**/

#ifndef __IIOCFGUPDATEDXELIGHTNINGRIDGEEXECB3_H__
#define __IIOCFGUPDATEDXELIGHTNINGRIDGEEXECB3_H__

#include "../uefi_headers/Uefi.h"

//
// Function Prototypes
//

EFI_STATUS
EFIAPI
ModuleEntryPoint(
  VOID
);

EFI_STATUS
EFIAPI
IioCfgUpdateEntryPoint(
  VOID
);

EFI_STATUS
EFIAPI
UbaDebugPrint(
  VOID
);

EFI_STATUS
EFIAPI
UbaDebugAssert(
  VOID
);

EFI_STATUS
EFIAPI
IsHobListGuid(
  VOID
);

EFI_STATUS
EFIAPI
ReadUnaligned64(
  VOID
);

EFI_STATUS
EFIAPI
IIO Configuration Protocol GUID(
  VOID
);

EFI_STATUS
EFIAPI
offset: 0xBC0 (16 bytes)(
  VOID
);

EFI_STATUS
EFIAPI
CONST EFI_GUID  mUbaIioCfgProtocolGuid = UBA_IIO_CFG_PROTOCOL_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
Table 1 GUID(
  VOID
);

EFI_STATUS
EFIAPI
offset: 0xBD0 (16 bytes)(
  VOID
);

EFI_STATUS
EFIAPI
CONST EFI_GUID  mIioCfgTable1Guid = IIO_CFG_TABLE_1_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
Table 2 GUID(
  VOID
);

EFI_STATUS
EFIAPI
offset: 0xBE0 (16 bytes)(
  VOID
);

EFI_STATUS
EFIAPI
CONST EFI_GUID  mIioCfgTable2Guid = IIO_CFG_TABLE_2_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
Table 3 GUID(
  VOID
);

EFI_STATUS
EFIAPI
offset: 0xBF0 (16 bytes)(
  VOID
);

EFI_STATUS
EFIAPI
CONST EFI_GUID  mIioCfgTable3Guid = IIO_CFG_TABLE_3_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
Table 4 GUID(
  VOID
);

EFI_STATUS
EFIAPI
offset: 0xC00 (16 bytes)(
  VOID
);

EFI_STATUS
EFIAPI
CONST EFI_GUID  mIioCfgTable4Guid = IIO_CFG_TABLE_4_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
HOB List GUID(
  VOID
);

EFI_STATUS
EFIAPI
offset: 0xC10 (16 bytes)(
  VOID
);

EFI_STATUS
EFIAPI
by IsHobListGuid() to identify the HOB list in ConfigurationTable[].(
  VOID
);

EFI_STATUS
EFIAPI
CONST EFI_GUID  mEfiHobListGuid = EFI_HOB_LIST_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
Debug Library Protocol GUID(
  VOID
);

/// the decompiler
EFI_STATUS
EFIAPI
offset: 0xBD0 (duplicate of IIO Table 1 GUID(
  VOID
);

EFI_STATUS
EFIAPI
0xBD0 as the debug lib protocol GUID in sub_510).(
  VOID
);

EFI_STATUS
EFIAPI
CONST EFI_GUID  mUbaDebugLibProtocolGuid = UBA_DEBUG_LIB_PROTOCOL_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
-- UEFI image handle for this driver.(
  VOID
);

EFI_STATUS
EFIAPI
offset: 0xDB0(
  VOID
);

EFI_STATUS
EFIAPI
gImageHandle = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
-- UEFI System Table pointer.(
  VOID
);

EFI_STATUS
EFIAPI
offset: 0xDA0(
  VOID
);

EFI_STATUS
EFIAPI
*gST = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
-- UEFI Boot Services pointer.(
  VOID
);

EFI_STATUS
EFIAPI
offset: 0xDA8(
  VOID
);

EFI_STATUS
EFIAPI
*gBS = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
-- UEFI Runtime Services pointer.(
  VOID
);

EFI_STATUS
EFIAPI
offset: 0xDB8(
  VOID
);

EFI_STATUS
EFIAPI
*gRT = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
-- Cached UBA debug protocol pointer.(
  VOID
);

EFI_STATUS
EFIAPI
offset: 0xDC0(
  VOID
);

EFI_STATUS
EFIAPI
lazily by LocateUbaDebugProtocol().(
  VOID
);

EFI_STATUS
EFIAPI
*mUbaDebugProtocol = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
-- Cached HOB list pointer.(
  VOID
);

EFI_STATUS
EFIAPI
offset: 0xDC8(
  VOID
);

EFI_STATUS
EFIAPI
lazily by GetHobList().(
  VOID
);

EFI_STATUS
EFIAPI
*mHobList = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
1: Cache UEFI standard pointers globally.(
  VOID
);

EFI_STATUS
EFIAPI
= ImageHandle;(
  VOID
);

EFI_STATUS
EFIAPI
2: Validate non-NULL and cache boot/runtime services.(
  VOID
);

EFI_STATUS
EFIAPI
(ImageHandle == NULL) {(
  VOID
);

EFI_STATUS
EFIAPI
3: Resolve the HOB list (cached in mHobList).(
  VOID
);

EFI_STATUS
EFIAPI
();(
  VOID
);

EFI_STATUS
EFIAPI
4: Dispatch the IIO configuration update.(
  VOID
);

EFI_STATUS
EFIAPI
= IioCfgUpdateEntryPoint ();(
  VOID
);

EFI_STATUS
EFIAPI
1: Initialize output variable and emit platform banner.(
  VOID
);

EFI_STATUS
EFIAPI
= NULL;(
  VOID
);

EFI_STATUS
EFIAPI
2: Locate the UBA IIO configuration protocol.(
  VOID
);

EFI_STATUS
EFIAPI
= gBS->LocateProtocol ((
  VOID
);

EFI_STATUS
EFIAPI
3: Register the four IIO PCIe topology configuration tables.(
  VOID
);

EFI_STATUS
EFIAPI
call passes the same PIIO header structure (48 bytes) but keyed(
  VOID
);

EFI_STATUS
EFIAPI
a different table GUID.(
  VOID
);

EFI_STATUS
EFIAPI
AddConfig function is at vtable index 2 (offset 0x10):(
  VOID
);

EFI_STATUS
EFIAPI
(*AddConfig)((
  VOID
);

EFI_STATUS
EFIAPI
*This(
  VOID
);

EFI_STATUS
EFIAPI
EFI_GUID *ConfigGuid(
  VOID
);

EFI_STATUS
EFIAPI
VOID *ConfigData(
  VOID
);

EFI_STATUS
EFIAPI
ConfigDataSize(
  VOID
);

EFI_STATUS
EFIAPI
1: Primary IIO topology(
  VOID
);

EFI_STATUS
EFIAPI
= ((EFI_STATUS (*)(VOID *, CONST EFI_GUID *, CONST VOID *, UINTN))(
  VOID
);

EFI_STATUS
EFIAPI
2: Secondary IIO topology(
  VOID
);

EFI_STATUS
EFIAPI
3: Tertiary IIO topology(
  VOID
);

EFI_STATUS
EFIAPI
4: Quaternary IIO topology(
  VOID
);

EFI_STATUS
EFIAPI
cached pointer if already resolved.(
  VOID
);

EFI_STATUS
EFIAPI
(mUbaDebugProtocol != NULL) {(
  VOID
);

EFI_STATUS
EFIAPI
pool size sanity check.(
  VOID
);

EFI_STATUS
EFIAPI
and immediately free a 31-byte buffer. If the returned pool(
  VOID
);

EFI_STATUS
EFIAPI
is <= 0x10, the system is in a state where protocol resolution(
  VOID
);

EFI_STATUS
EFIAPI
also fail, so bail out early.(
  VOID
);

EFI_STATUS
EFIAPI
the UBA debug protocol.(
  VOID
);

EFI_STATUS
EFIAPI
the UBA debug protocol (lazy init).(
  VOID
);

EFI_STATUS
EFIAPI
= LocateUbaDebugProtocol ();(
  VOID
);

EFI_STATUS
EFIAPI
CMOS register 0x4B to determine the board platform type.(
  VOID
);

EFI_STATUS
EFIAPI
sequence:(
  VOID
);

EFI_STATUS
EFIAPI
= IoRead8 (0x70);(
  VOID
);

EFI_STATUS
EFIAPI
platform type from CMOS value.(
  VOID
);

EFI_STATUS
EFIAPI
value is > 3 and equals 0, fall back to MMIO strapping register.(
  VOID
);

EFI_STATUS
EFIAPI
(PlatformType > 3) {(
  VOID
);

EFI_STATUS
EFIAPI
debug mask based on platform type.(
  VOID
);

EFI_STATUS
EFIAPI
1 = LightningRidge, others use a broader mask.(
  VOID
);

EFI_STATUS
EFIAPI
(PlatformType == 1) {(
  VOID
);

EFI_STATUS
EFIAPI
if the error level matches the platform debug mask.(
  VOID
);

EFI_STATUS
EFIAPI
((DebugMask & ErrorLevel) == 0) {(
  VOID
);

EFI_STATUS
EFIAPI
the protocol's DebugPrint function (vtable offset 0x00).(
  VOID
);

EFI_STATUS
EFIAPI
(VaList, Format);(
  VOID
);

EFI_STATUS
EFIAPI
the protocol's assertion handler (vtable offset 0x08).(
  VOID
);

EFI_STATUS
EFIAPI
(mHobList != NULL) {(
  VOID
);

EFI_STATUS
EFIAPI
cache to NULL before scanning.(
  VOID
);

EFI_STATUS
EFIAPI
the configuration table array for the HOB list GUID.(
  VOID
);

EFI_STATUS
EFIAPI
(ConfigTable != NULL) {(
  VOID
);

EFI_STATUS
EFIAPI
the GUID was not found, trigger a debug assert.(
  VOID
);

EFI_STATUS
EFIAPI
(mHobList == NULL) {(
  VOID
);

EFI_STATUS
EFIAPI
);(
  VOID
);

EFI_STATUS
EFIAPI
the resolved pointer itself is NULL, trigger another assert.(
  VOID
);

EFI_STATUS
EFIAPI
GUID as two 64-bit halves.(
  VOID
);

EFI_STATUS
EFIAPI
(ReadUnaligned64 (&mEfiHobListGuid) == ReadUnaligned64 (Guid))(
  VOID
);

EFI_STATUS
EFIAPI
buffer pointer is not NULL.(
  VOID
);

EFI_STATUS
EFIAPI
(Buffer == NULL) {(
  VOID
);

EFI_STATUS
EFIAPI
directly.(
  VOID
);

EFI_STATUS
EFIAPI
*(CONST UINT64 *)Buffer;(
  VOID
);

#endif /* __IIOCFGUPDATEDXELIGHTNINGRIDGEEXECB3_H__ */