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

Copyright (c) HR650X BIOS Decompilation Project
**/

#ifndef __SLOTDATAUPDATEDXECLX64L_H__
#define __SLOTDATAUPDATEDXECLX64L_H__

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

//
// Function Prototypes
//

EFI_STATUS
EFIAPI
ReadUnaligned64(
  VOID
);

EFI_STATUS
EFIAPI
LogUbaMessage(
  VOID
);

EFI_STATUS
EFIAPI
UbaAssert(
  VOID
);

EFI_STATUS
EFIAPI
MatchHobGuid(
  VOID
);

EFI_STATUS
EFIAPI
GetHobList(
  VOID
);

EFI_STATUS
EFIAPI
_ModuleEntryPoint(
  VOID
);

EFI_STATUS
EFIAPI
UEFI table pointers (set by _ModuleEntryPoint)(
  VOID
);

EFI_STATUS
EFIAPI
gImageHandle   = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
UBA debug protocol pointer(
  VOID
);

EFI_STATUS
EFIAPI
*gUbaDebugProtocol = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
HOB list pointer(
  VOID
);

EFI_STATUS
EFIAPI
*gHobList = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
Slot Data Update Protocol GUID(
  VOID
);

EFI_STATUS
EFIAPI
CONST EFI_GUID mSlotDataUpdateProtocolGuid = SLOT_DATA_UPDATE_PROTOCOL_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
Data Entry Protocol GUID(
  VOID
);

EFI_STATUS
EFIAPI
CONST EFI_GUID mSlotDataEntryGuid = SLOT_DATA_ENTRY_PROTOCOL_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
List GUID(
  VOID
);

EFI_STATUS
EFIAPI
CONST EFI_GUID mGetHobListGuid = GET_HOB_LIST_PROTOCOL_GUID;(
  VOID
);

EFI_STATUS
EFIAPI
PSLT entry: physical slot configuration for CLX64L platform(
  VOID
);

EFI_STATUS
EFIAPI
CONST PSLT_HEADER mSlotTableEntry1 = {(
  VOID
);

EFI_STATUS
EFIAPI
= "PSLT"(
  VOID
);

EFI_STATUS
EFIAPI
0xBA0,              // TableOffset(
  VOID
);

EFI_STATUS
EFIAPI
{                   // SlotData[24]:(
  VOID
);

EFI_STATUS
EFIAPI
0: B0:D2:F0 -> Port 1(
  VOID
);

EFI_STATUS
EFIAPI
1: B1:D2:F1 -> Port 0(
  VOID
);

EFI_STATUS
EFIAPI
mapping attribute(
  VOID
);

EFI_STATUS
EFIAPI
0x00, 0x00, 0x00, 0x00,   // Reserved(
  VOID
);

EFI_STATUS
EFIAPI
}(
  VOID
);

EFI_STATUS
EFIAPI
PSLT entry: extended slot configuration(
  VOID
);

EFI_STATUS
EFIAPI
null table offset (placeholder/reserved entry)(
  VOID
);

EFI_STATUS
EFIAPI
CONST PSLT_HEADER mSlotTableEntry2 = {(
  VOID
);

EFI_STATUS
EFIAPI
slot mapping(
  VOID
);

EFI_STATUS
EFIAPI
0xB4, 0x04, 0x00, 0x00,   // Secondary table reference(
  VOID
);

EFI_STATUS
EFIAPI
debug protocol GUID (internal UBA protocol for debug services)(
  VOID
);

EFI_STATUS
EFIAPI
GUID varies by platform; located via gBS->LocateProtocol(
  VOID
);

EFI_STATUS
EFIAPI
CONST EFI_GUID mUbaDebugProtocolGuid = {(
  VOID
);

EFI_STATUS
EFIAPI
cached protocol if already located(
  VOID
);

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

EFI_STATUS
EFIAPI
pool for the protocol instance(
  VOID
);

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

EFI_STATUS
EFIAPI
the allocated pool(
  VOID
);

EFI_STATUS
EFIAPI
the UBA debug protocol(
  VOID
);

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

EFI_STATUS
EFIAPI
CMOS debug level(
  VOID
);

EFI_STATUS
EFIAPI
= __inbyte (RTC_INDEX_PORT);(
  VOID
);

EFI_STATUS
EFIAPI
if debug is enabled for this severity(
  VOID
);

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

EFI_STATUS
EFIAPI
(DebugLevel == 0) {(
  VOID
);

EFI_STATUS
EFIAPI
debug level to UBA severity mask(
  VOID
);

EFI_STATUS
EFIAPI
= (DebugLevel == 1) ?(
  VOID
);

EFI_STATUS
EFIAPI
severity matches, forward to UBA debug print(
  VOID
);

EFI_STATUS
EFIAPI
((SeverityLevel & Severity) != 0) {(
  VOID
);

EFI_STATUS
EFIAPI
the first 8 bytes of the HOB header(
  VOID
);

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

EFI_STATUS
EFIAPI
cached HOB list if already located(
  VOID
);

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

EFI_STATUS
EFIAPI
//(
  VOID
);

EFI_STATUS
EFIAPI
through HOB entries from the system table(
  VOID
);

EFI_STATUS
EFIAPI
(gSystemTable->NumberOfTableEntries != 0) {(
  VOID
);

EFI_STATUS
EFIAPI
matching HOB; return the data field at offset 16(
  VOID
);

EFI_STATUS
EFIAPI
= *(UINT64 *)((UINTN)gSystemTable->ConfigurationTable +(
  VOID
);

EFI_STATUS
EFIAPI
matching HOB found - assert(
  VOID
);

EFI_STATUS
EFIAPI
((
  VOID
);

EFI_STATUS
EFIAPI
HOB list was found(
  VOID
);

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

EFI_STATUS
EFIAPI
global UEFI table pointers(
  VOID
);

EFI_STATUS
EFIAPI
= ImageHandle;(
  VOID
);

EFI_STATUS
EFIAPI
boot services pointer from system table (offset 0x60)(
  VOID
);

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

EFI_STATUS
EFIAPI
runtime services pointer from system table (offset 0x58)(
  VOID
);

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

EFI_STATUS
EFIAPI
HOB list cache(
  VOID
);

EFI_STATUS
EFIAPI
(0);(
  VOID
);

EFI_STATUS
EFIAPI
initialization message(
  VOID
);

EFI_STATUS
EFIAPI
(UBA_DEBUG_ERROR, "UBA:SlotDataUpdate-TypeClx64L\n");(
  VOID
);

EFI_STATUS
EFIAPI
the UBA Slot Data Update protocol (BootServices->LocateProtocol)(
  VOID
);

EFI_STATUS
EFIAPI
first PSLT entry: physical slot table (40 bytes)(
  VOID
);

EFI_STATUS
EFIAPI
= SlotProtocol->GetSlotData ((
  VOID
);

EFI_STATUS
EFIAPI
second PSLT entry: extended slot config (40 bytes)(
  VOID
);

EFI_STATUS
EFIAPI
SlotProtocol->GetSlotData ((
  VOID
);

#endif /* __SLOTDATAUPDATEDXECLX64L_H__ */