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

Copyright (c) HR650X BIOS Decompilation Project
**/

#ifndef __IIOCFGUPDATEDXENEONCITYEPECB_H__
#define __IIOCFGUPDATEDXENEONCITYEPECB_H__

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

//
// Function Prototypes
//

EFI_STATUS
EFIAPI
ReadUnaligned64(
  VOID
);

EFI_STATUS
EFIAPI
IsMatchingHobGuidPair(
  VOID
);

EFI_STATUS
EFIAPI
DebugAssert(
  VOID
);

EFI_STATUS
EFIAPI
DebugPrint(
  VOID
);

EFI_STATUS
EFIAPI
SetIioConfiguration(
  VOID
);

EFI_STATUS
EFIAPI
NoOpStub(
  VOID
);

EFI_STATUS
EFIAPI
ModuleEntryPoint(
  VOID
);

EFI_STATUS
EFIAPI
Protocol GUID definitions(
  VOID
);

EFI_STATUS
EFIAPI
GUIDs identify the IIO configuration tables and protocols(
  VOID
);

EFI_STATUS
EFIAPI
by this driver for the NeonCity EP EC B platform.(
  VOID
);

EFI_STATUS
EFIAPI
gIioConfigTable0Guid      = IIO_CONFIG_TABLE_0_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
discovery GUID pair.(
  VOID
);

EFI_STATUS
EFIAPI
system table contains a firmware resource array. Each entry is a 24-byte(
  VOID
);

EFI_STATUS
EFIAPI
a pair where the first QWORD of descriptor[N] matches gHobListGuid1 and(
  VOID
);

EFI_STATUS
EFIAPI
first QWORD of descriptor[N] matches gHobListGuid2. The third QWORD of(
  VOID
);

EFI_STATUS
EFIAPI
matching descriptor contains the HOB list pointer.(
  VOID
);

EFI_STATUS
EFIAPI
= gEfiDxeServicesTableGuid(
  VOID
);

EFI_STATUS
EFIAPI
gHobListGuid1             = { 0x7739F24C, 0x93D7, 0x11D4, { 0x9A, 0x3A, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } };(
  VOID
);

EFI_STATUS
EFIAPI
globals(
  VOID
);

EFI_STATUS
EFIAPI
*mHobList            = NULL;  ///< Cached HOB list pointer(
  VOID
);

EFI_STATUS
EFIAPI
Configuration Table (platform data for NeonCity EP EC B)(
  VOID
);

EFI_STATUS
EFIAPI
configuration data is stored in PIIO format (signature "PIIO", version 1(
  VOID
);

EFI_STATUS
EFIAPI
0xD48). It contains IIO port configuration entries including PCIe port(
  VOID
);

EFI_STATUS
EFIAPI
stack on the NeonCity EP EC B platform.(
  VOID
);

EFI_STATUS
EFIAPI
port configuration entries follow(
  VOID
);

EFI_STATUS
EFIAPI
function prototypes(
  VOID
);

EFI_STATUS
EFIAPI
ReadUnaligned64 ((
  VOID
);

EFI_STATUS
EFIAPI
system table at offset 0x68 (104) contains the number of firmware(
  VOID
);

EFI_STATUS
EFIAPI
descriptors, and at offset 0x70 (112) contains the array pointer.(
  VOID
);

EFI_STATUS
EFIAPI
= *(UINTN *)((UINTN)gST + 104);(
  VOID
);

EFI_STATUS
EFIAPI
third QWORD of the matching descriptor is the HOB list pointer.(
  VOID
);

EFI_STATUS
EFIAPI
= *(VOID **)((UINTN)FwResourceArray + (Index * 24) + 16);(
  VOID
);

EFI_STATUS
EFIAPI
list not found: report error via debug and assert.(
  VOID
);

EFI_STATUS
EFIAPI
((EFI_D_ERROR, "\nASSERT_EFI_ERROR (Status = %r)\n", EFI_NOT_FOUND));(
  VOID
);

EFI_STATUS
EFIAPI
page allocator: try to allocate 0x10 pages (64 KB).(
  VOID
);

EFI_STATUS
EFIAPI
pointer value is checked against 0x10 to determine if the(
  VOID
);

EFI_STATUS
EFIAPI
function is available (low addresses are typical for(
  VOID
);

EFI_STATUS
EFIAPI
DXE phase allocations, and a return value <= 0x10 suggests(
  VOID
);

EFI_STATUS
EFIAPI
allocation backend is functional).(
  VOID
);

EFI_STATUS
EFIAPI
= (UINT64)(UINTN)gBS->AllocatePages (AllocateAnyPages, EfiBootServicesData, 0x10);(
  VOID
);

EFI_STATUS
EFIAPI
assertion handler is at offset 8 in the protocol vtable.(
  VOID
);

EFI_STATUS
EFIAPI
= *(UINT64 (*)(CONST CHAR8 *, UINTN, CONST CHAR8 *))((UINTN)DebugProtocol + 8);(
  VOID
);

EFI_STATUS
EFIAPI
the current CMOS index register (I/O port 0x70)(
  VOID
);

EFI_STATUS
EFIAPI
select CMOS offset 0x4B (BIOS debug level).(
  VOID
);

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

EFI_STATUS
EFIAPI
effective debug level.(
  VOID
);

EFI_STATUS
EFIAPI
DebugLevel > 3 (e.g., uninitialized CMOS), fall back to(
  VOID
);

EFI_STATUS
EFIAPI
strap: read from I/O port 0xFDAF0490 bit 1, then OR with 1.(
  VOID
);

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

EFI_STATUS
EFIAPI
the filter mask based on debug level.(
  VOID
);

EFI_STATUS
EFIAPI
1 (errors only):  0x80000004(
  VOID
);

EFI_STATUS
EFIAPI
2+ (errors+warn): 0x80000006(
  VOID
);

EFI_STATUS
EFIAPI
= FALSE;(
  VOID
);

EFI_STATUS
EFIAPI
print function is at offset 0 in the protocol vtable.(
  VOID
);

EFI_STATUS
EFIAPI
= *(UINT64 (*)(UINTN, CONST CHAR8 *, ...))((UINTN)DebugProtocol);(
  VOID
);

EFI_STATUS
EFIAPI
the platform type for debug purposes.(
  VOID
);

EFI_STATUS
EFIAPI
((EFI_D_INFO, "UBA:IioCfgUpdate-TypeNeonCityEPECB\n"));(
  VOID
);

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

EFI_STATUS
EFIAPI
protocol GUID is IIO_CONFIG_PROTOCOL_GUID.(
  VOID
);

EFI_STATUS
EFIAPI
= gBS->LocateProtocol (&gIioConfigProtocolGuid, NULL, &UbaProtocol);(
  VOID
);

EFI_STATUS
EFIAPI
the protocol's SetIioConfig function at offset 16 in the vtable(
  VOID
);

EFI_STATUS
EFIAPI
configuration table 0.(
  VOID
);

EFI_STATUS
EFIAPI
= ((EFI_STATUS (*)(VOID *, EFI_GUID *, VOID *, UINTN))((UINTN)UbaProtocol + 16))((
  VOID
);

EFI_STATUS
EFIAPI
configuration table 1.(
  VOID
);

EFI_STATUS
EFIAPI
configuration table 2.(
  VOID
);

EFI_STATUS
EFIAPI
configuration table 3.(
  VOID
);

EFI_STATUS
EFIAPI
the global image handle.(
  VOID
);

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

EFI_STATUS
EFIAPI
the UEFI system table pointer.(
  VOID
);

EFI_STATUS
EFIAPI
(SystemTable != NULL);(
  VOID
);

EFI_STATUS
EFIAPI
the boot services table pointer.(
  VOID
);

EFI_STATUS
EFIAPI
(SystemTable->BootServices != NULL);(
  VOID
);

EFI_STATUS
EFIAPI
the runtime services table pointer.(
  VOID
);

EFI_STATUS
EFIAPI
(SystemTable->RuntimeServices != NULL);(
  VOID
);

EFI_STATUS
EFIAPI
the HOB list (needed by platform configuration code).(
  VOID
);

EFI_STATUS
EFIAPI
();(
  VOID
);

EFI_STATUS
EFIAPI
the IIO configuration data via the UBA protocol.(
  VOID
);

EFI_STATUS
EFIAPI
= SetIioConfiguration ();(
  VOID
);

#endif /* __IIOCFGUPDATEDXENEONCITYEPECB_H__ */