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

Copyright (c) HR650X BIOS Decompilation Project
**/

#ifndef __STATICSKUDATADXENEONCITYEPECB_H__
#define __STATICSKUDATADXENEONCITYEPECB_H__

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

//
// Function Prototypes
//

EFI_STATUS
EFIAPI
InitializeUmpProtocol(
  VOID
);

EFI_STATUS
EFIAPI
ReadUnaligned64(
  VOID
);

EFI_STATUS
EFIAPI
IsHobMatchingGuid(
  VOID
);

EFI_STATUS
EFIAPI
AssertPrint(
  VOID
);

EFI_STATUS
EFIAPI
CheckEfiStatus(
  VOID
);

EFI_STATUS
EFIAPI
GetBoardTypeFromCmos(
  VOID
);

EFI_STATUS
EFIAPI
ModuleEntryPoint(
  VOID
);

EFI_STATUS
EFIAPI
UEFI Table Pointers(
  VOID
);

EFI_STATUS
EFIAPI
image handle of this driver (set by ModuleEntryPoint).(
  VOID
);

EFI_STATUS
EFIAPI
gImageHandle = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
to the UEFI System Table (set by ModuleEntryPoint).(
  VOID
);

EFI_STATUS
EFIAPI
*gSystemTable = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
to the UEFI Boot Services Table (set by ModuleEntryPoint).(
  VOID
);

EFI_STATUS
EFIAPI
*gBootServices = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
to the UEFI Runtime Services Table (set by ModuleEntryPoint).(
  VOID
);

EFI_STATUS
EFIAPI
*gRuntimeServices = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
to the HOB (Hand-Off Block) list, initialized via DxeHobLib.GetBootModeHobList().(
  VOID
);

EFI_STATUS
EFIAPI
*mHobList = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
GUID definitions (stored in .data section at 0x4060-0x40E0)(
  VOID
);

EFI_STATUS
EFIAPI
at 0x4060-0x407F (32 bytes, first 16 = GUID, next 8 = name, next 8 = reserved/ptr)(
  VOID
);

EFI_STATUS
EFIAPI
is a UEFI configuration table GUID used to locate platform-specific data.(
  VOID
);

EFI_STATUS
EFIAPI
mUbaOemGuid1 = { 0x36292936, 0x0E76, 0x31C8, { 0xA1, 0x3A, 0x3A, 0xF2, 0xFC, 0x1C, 0x39, 0x32 } };(
  VOID
);

EFI_STATUS
EFIAPI
the UMPT protocol handler GUID.(
  VOID
);

EFI_STATUS
EFIAPI
mUbaOemGuid2 = { 0x460D3EE0, 0x6352, 0x4548, { 0xB0, 0xA4, 0x58, 0xD5, 0x7B, 0x31, 0x77, 0xE2 } };(
  VOID
);

EFI_STATUS
EFIAPI
(UEFI Memory Protocol Table) GUID.(
  VOID
);

EFI_STATUS
EFIAPI
GUID identifies the UMPT protocol. The protocol provides memory topology(
  VOID
);

EFI_STATUS
EFIAPI
configuration data used by the board-specific SKU dispatch code.(
  VOID
);

EFI_STATUS
EFIAPI
gUmpProtocolGuid = UMPT_PROTOCOL_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
string "UMPT" stored alongside the GUID in the protocol registration entry.(
  VOID
);

EFI_STATUS
EFIAPI
mUmpProtocolName[4] = "UMPT";(
  VOID
);

EFI_STATUS
EFIAPI
(PCI Interrupt Routing) protocol GUID.(
  VOID
);

EFI_STATUS
EFIAPI
GUID identifies the PIRQ protocol, which provides PCI interrupt routing(
  VOID
);

EFI_STATUS
EFIAPI
for the board.(
  VOID
);

EFI_STATUS
EFIAPI
gPirqProtocolGuid = PIRQ_PROTOCOL_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
string "PIRQ" stored alongside the GUID in the protocol registration entry.(
  VOID
);

EFI_STATUS
EFIAPI
mPirqProtocolName[4] = "PIRQ";(
  VOID
);

EFI_STATUS
EFIAPI
protocol GUID.(
  VOID
);

EFI_STATUS
EFIAPI
GUID identifies the FIX protocol, which provides board-specific fixup(
  VOID
);

EFI_STATUS
EFIAPI
methods (FIX0-X, FIXV, FIXY, FIXW).(
  VOID
);

EFI_STATUS
EFIAPI
gFixProtocolGuid = FIX_PROTOCOL_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
(ACPI Path Format) protocol GUID.(
  VOID
);

EFI_STATUS
EFIAPI
GUID identifies the ACPF protocol, which exposes the ACPI path format(
  VOID
);

EFI_STATUS
EFIAPI
to UBA dispatch code.(
  VOID
);

EFI_STATUS
EFIAPI
gAcpfProtocolGuid = ACPF_PROTOCOL_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
ACPI Path Name Strings (stored in .rdata section)(
  VOID
);

EFI_STATUS
EFIAPI
.rdata section contains ACPI path strings organized as:(
  VOID
);

EFI_STATUS
EFIAPI
(Core Count Table) path strings: _SB_.CCT0 through _SB_.CCT8(
  VOID
);

EFI_STATUS
EFIAPI
map CPU core count configurations per socket.(
  VOID
);

EFI_STATUS
EFIAPI
(Core Frequency Header) path strings: _SB_.CFH0 through _SB_.CFH8(
  VOID
);

EFI_STATUS
EFIAPI
map CPU frequency configuration headers per socket.(
  VOID
);

EFI_STATUS
EFIAPI
namespace: _SB_.NVDR(
  VOID
);

EFI_STATUS
EFIAPI
sub-namespace devices (N000 through N151, organized by socket/channel)(
  VOID
);

EFI_STATUS
EFIAPI
NVDIMM entry has ACPI methods:(
  VOID
);

EFI_STATUS
EFIAPI
- Function Code(
  VOID
);

EFI_STATUS
EFIAPI
- Function Status(
  VOID
);

EFI_STATUS
EFIAPI
- Function Input(
  VOID
);

EFI_STATUS
EFIAPI
- Function Output(
  VOID
);

EFI_STATUS
EFIAPI
- Function Buffer Size(
  VOID
);

EFI_STATUS
EFIAPI
- Function File Handle(
  VOID
);

EFI_STATUS
EFIAPI
- Command Enable(
  VOID
);

EFI_STATUS
EFIAPI
- Command Finish Status(
  VOID
);

EFI_STATUS
EFIAPI
Root Port FIX methods (per port):(
  VOID
);

EFI_STATUS
EFIAPI
- Management Control(
  VOID
);

EFI_STATUS
EFIAPI
types:(
  VOID
);

EFI_STATUS
EFIAPI
- Base FIX method (single entry)(
  VOID
);

EFI_STATUS
EFIAPI
- FIX Extension (0..8 per device) with type=0x5B80(
  VOID
);

EFI_STATUS
EFIAPI
- FIX Value (0..8 per device) with type=0x5B80(
  VOID
);

EFI_STATUS
EFIAPI
- NVDIMM FIX Y (per sub-instance) with type=0x0008(
  VOID
);

EFI_STATUS
EFIAPI
- NVDIMM FIX W (per sub-instance) with type=0x0008(
  VOID
);

EFI_STATUS
EFIAPI
Path Entry Table (stored in .data section at 0x40E0+)(
  VOID
);

EFI_STATUS
EFIAPI
table is organized as arrays of 32-byte ACPI_PATH_ENTRY structures.(
  VOID
);

EFI_STATUS
EFIAPI
table is anchored by the ACPI_PATH_FORMAT_TABLE header at 0x9000.(
  VOID
);

EFI_STATUS
EFIAPI
sections:(
  VOID
);

EFI_STATUS
EFIAPI
entries: ~200+ entries covering all board-configurable ACPI paths(
  VOID
);

EFI_STATUS
EFIAPI
Path Format Table header at 0x9000(
  VOID
);

EFI_STATUS
EFIAPI
pointer: 0x40E0 (gAcpiPathEntries)(
  VOID
);

EFI_STATUS
EFIAPI
mAcpiPathFormatTable = {(
  VOID
);

EFI_STATUS
EFIAPI
registration handles (initialized by entry point)(
  VOID
);

EFI_STATUS
EFIAPI
gUmpProtocolHandle  = 0;(
  VOID
);

EFI_STATUS
EFIAPI
Function Declarations(
  VOID
);

EFI_STATUS
EFIAPI
Implementations(
  VOID
);

EFI_STATUS
EFIAPI
a pool buffer using BootServices->AllocatePool (index 24 = 3 entries).(
  VOID
);

EFI_STATUS
EFIAPI
= gBootServices->AllocatePool (31);(
  VOID
);

EFI_STATUS
EFIAPI
the UMPT protocol configuration table entry.(
  VOID
);

EFI_STATUS
EFIAPI
= gBootServices->LocateProtocol (&gUmpOemGuid2, NULL, &CachedHandle);(
  VOID
);

EFI_STATUS
EFIAPI
search state.(
  VOID
);

EFI_STATUS
EFIAPI
= 0;(
  VOID
);

EFI_STATUS
EFIAPI
if the SystemTable has a HOB list pointer at offset 104.(
  VOID
);

EFI_STATUS
EFIAPI
(*(UINT64 *)((UINT8 *)gSystemTable + 104) != 0) {(
  VOID
);

EFI_STATUS
EFIAPI
search through the HOB list.(
  VOID
);

EFI_STATUS
EFIAPI
(CurrentEntry = EntryBase; ; CurrentEntry += 24) {(
  VOID
);

EFI_STATUS
EFIAPI
matching entry: extract the HOB pointer at offset +16.(
  VOID
);

EFI_STATUS
EFIAPI
= *(VOID **)(CurrentEntry + 16);(
  VOID
);

EFI_STATUS
EFIAPI
matching HOB entry found; trigger ASSERT.(
  VOID
);

EFI_STATUS
EFIAPI
((EFI_STATUS)(UINTN)0x800000000000000EULL);(
  VOID
);

EFI_STATUS
EFIAPI
has no HOB list; trigger ASSERT.(
  VOID
);

EFI_STATUS
EFIAPI
both GUIDs via unaligned 64-bit reads.(
  VOID
);

EFI_STATUS
EFIAPI
= ReadUnaligned64 (Entry);(
  VOID
);

EFI_STATUS
EFIAPI
assertion via the protocol's report function (at offset +8 in vtable).(
  VOID
);

EFI_STATUS
EFIAPI
if this is a HOB list pointer validation by examining(
  VOID
);

EFI_STATUS
EFIAPI
SystemTable HOB count entry.(
  VOID
);

EFI_STATUS
EFIAPI
((UINT64)Status);(
  VOID
);

EFI_STATUS
EFIAPI
the UMP protocol handle for dispatch.(
  VOID
);

EFI_STATUS
EFIAPI
= InitializeUmpProtocol ();(
  VOID
);

EFI_STATUS
EFIAPI
CMOS index register 0x70, set index to 0x4B (preserving NMI enable bit).(
  VOID
);

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

EFI_STATUS
EFIAPI
the CMOS data register 0x71.(
  VOID
);

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

EFI_STATUS
EFIAPI
the value is > 3, it may indicate a special configuration.(
  VOID
);

EFI_STATUS
EFIAPI
preserved from the original binary.(
  VOID
);

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

EFI_STATUS
EFIAPI
the CMOS result to a dispatch type.(
  VOID
);

EFI_STATUS
EFIAPI
CMOS value >= 1 and <= 254: valid range (n3_1 - 1 <= 0xFD).(
  VOID
);

EFI_STATUS
EFIAPI
1 -> DispatchType = 0x8000000C (NVDIMM path data dispatch)(
  VOID
);

EFI_STATUS
EFIAPI
2..254 -> DispatchType = 0x80000006 (FIX/PCIe path data dispatch)(
  VOID
);

EFI_STATUS
EFIAPI
CMOS value 0 or 255: out of range, no dispatch performed(
  VOID
);

EFI_STATUS
EFIAPI
default value of (RawCmosResult - 1).(
  VOID
);

EFI_STATUS
EFIAPI
((UINT8)(RawCmosResult - 1) <= 0xFD) {(
  VOID
);

EFI_STATUS
EFIAPI
the dispatch type matches the input mask, call the protocol function.(
  VOID
);

EFI_STATUS
EFIAPI
((DispatchType & (UINT64)InputValue) != 0) {(
  VOID
);

EFI_STATUS
EFIAPI
the global UEFI table pointers.(
  VOID
);

EFI_STATUS
EFIAPI
= ImageHandle;(
  VOID
);

EFI_STATUS
EFIAPI
the HOB list for later use (DxeHobLib compatibility).(
  VOID
);

EFI_STATUS
EFIAPI
();(
  VOID
);

EFI_STATUS
EFIAPI
the OEM configuration table entry (UMPT protocol GUID)(
  VOID
);

EFI_STATUS
EFIAPI
obtain the protocol handle for subsequent registrations.(
  VOID
);

EFI_STATUS
EFIAPI
the ACPI path format table.(
  VOID
);

EFI_STATUS
EFIAPI
installs the mAcpiPathFormatTable (containing "ACPF" signature(
  VOID
);

EFI_STATUS
EFIAPI
pointer to the ACPI path entries) as the protocol interface.(
  VOID
);

EFI_STATUS
EFIAPI
= ((EFI_STATUS (*)(UINT64, VOID *, VOID *, UINTN)) \(
  VOID
);

EFI_STATUS
EFIAPI
the PIRQ protocol interface.(
  VOID
);

EFI_STATUS
EFIAPI
the FIX protocol interface.(
  VOID
);

EFI_STATUS
EFIAPI
((EFI_STATUS (*)(UINT64, VOID *, VOID *, UINTN)) \(
  VOID
);

#endif /* __STATICSKUDATADXENEONCITYEPECB_H__ */