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

Copyright (c) HR650X BIOS Decompilation Project
**/

#ifndef __PLATFORM_H__
#define __PLATFORM_H__

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

//
// Function Prototypes
//

RETURN_STATUS
EFIAPI
AsciiStrCpyS(
  CHAR8 *Destination,
  UINTN DestMax,
  const CHAR8 *Source
);

char *
EFIAPI
CopyMemOverlap(
  char *dst,
  char *src,
  unsigned __int64 count
);

char *
EFIAPI
ZeroMemFast(
  char *buf,
  unsigned __int64 Length
);

void
EFIAPI
IoRead32Stall(
  VOID
);

void
EFIAPI
DisableInterrupts(
  VOID
);

void
EFIAPI
EnableInterrupts(
  VOID
);

void
EFIAPI
DisableCache(
  VOID
);

unsigned __int64
EFIAPI
CpuIdFeatureCheck(
  VOID
);

void *
EFIAPI
ReadMsr(
  void *buf,
  unsigned __int64 count,
  char value
);

EFI_STATUS
EFIAPI
ModuleEntryPoint(
  EFI_HANDLE ImageHandle,
  EFI_SYSTEM_TABLE *SystemTable
);

{"addr":"0x490","code":"__int64
EFIAPI
DriverInit(
  __int64 ImageHandle,
  EFI_SYSTEM_TABLE *SystemTable,
  UINTN Length
);

void
EFIAPI
CpuDeadLoop(
  VOID
);

__int64
EFIAPI
GetAndSetSocketIioConfig(
  VOID
);

{"addr":"0x9ec","code":"__int64
EFIAPI
DriverEntryMain(
  __int64 ImageHandle,
  __int64 SystemTable_1
);

void
EFIAPI
LocateHiiSetup(
  VOID
);

__int64
EFIAPI
DxePlatformDriverEntry(
  __int64 *Length_
);

__int64
EFIAPI
HiiSubCallback(
  CHAR16 *ZeroPool,
  _QWORD *a2,
  __int64 a3
);

void
EFIAPI
HiiRouteConfig(
  VOID
);

__int64
EFIAPI
HiiExtractConfig(
  __int64 *p_psub_1B18,
  CHAR16 *ZeroPool,
  CHAR16 **a3,
  __int64 a4
);

void *
EFIAPI
HiiCallbackHelper(
  VOID
);

__int64
EFIAPI
HiiFormActions(
  char *ZeroPool,
  _QWORD *a2
);

__int64
EFIAPI
HiiConfigRouting(
  __int64 a1,
  char *ZeroPool,
  char **a3
);

{"addr":"0x20c0","code":"unsigned __int64
EFIAPI
SetupFormCallback(
  __int64 a1,
  __int64 a2,
  unsigned __int16 n4279,
  __int64 a4,
  char *a5
);

unsigned __int64
EFIAPI
SetupActionHandler(
  VOID
);

void
EFIAPI
SetupValueChangeHandler(
  VOID
);

{"addr":"0x2ba8","code":"char
EFIAPI
SetupRouteHandler(
  _BYTE *a1
);

__int64
EFIAPI
SetupIfrNavigator(
  VOID
);

void
EFIAPI
SetupActionDispatcher(
  VOID
);

__int64
EFIAPI
SetupValueSetter(
  VOID
);

__int64
EFIAPI
SetupValueFormatter(
  char n2,
  __int64 DiskDataBuffer
);

{"addr":"0x36a0","code":"__int64
EFIAPI
PopulateDiskInfoRecords(
  VOID
);

unsigned __int64
EFIAPI
SetupBootOptionMaint(
  VOID
);

{"addr":"0x3e14","code":"void
EFIAPI
MeInitSpsInfo(
  \n        __int64 (__fastcall **a1)(_QWORD, __int64 *, __int64, __int64 *, int, int, int, int),
  \n        __int64 n0x14
);

unsigned __int64
EFIAPI
MeExtractSpsConfigOnSetupEnter(
  _BYTE *SourceBuffer
);

__int64
EFIAPI
MeSetupConfiguration(
  unsigned __int8 *SourceBuffer,
  __int64 MeFeatureBuffer1
);

void
EFIAPI
ExtractMeSpsConfig(
  _BYTE *SourceBuffer
);

void
EFIAPI
MeFirmwareUpdateHandler(
  unsigned __int8 *SourceBuffer
);

__int64
EFIAPI
StrAppendInfo(
  char *Gen1,
  CHAR16 *ZeroPool
);

UINTN
EFIAPI
StrLen(
  const CHAR16 *String
);

unsigned __int64
EFIAPI
HiiStringPacker(
  CHAR16 *ZeroPool,
  UINTN n0xF4240,
  const CHAR16 *GUID_
);

unsigned __int64
EFIAPI
SetupDisplayStrings(
  CHAR16 *Buffer,
  __int64 a2,
  const CHAR16 *Buffer_2
);

RETURN_STATUS
EFIAPI
StrCatS(
  CHAR16 *Destination,
  UINTN DestMax,
  const CHAR16 *Source
);

unsigned __int64
EFIAPI
SetupOptionProcessor(
  VOID
);

UINTN
EFIAPI
AsciiStrnLenS(
  const CHAR8 *%02d_%02d_%04d__%02d:%02d,
  UINTN MaxSize
);

unsigned __int64
EFIAPI
SetupOptionQuery(
  _WORD *a1
);

__int64
EFIAPI
SetupValueCheck(
  _WORD *ZeroPool,
  _WORD *GUID_,
  unsigned __int64 n0xF4240
);

_WORD *
EFIAPI
PlatformSetupPolicy(
  _WORD *a1,
  _WORD *a2
);

__int64
EFIAPI
GetSetupVarSize(
  unsigned __int16 a1
);

unsigned __int64
EFIAPI
ProcessSetupConfig(
  unsigned __int16 *Buffer
);

unsigned __int64
EFIAPI
BoolToString(
  _BYTE *x_UEFI
);

__int64
EFIAPI
LocateHiiSetupConfig(
  _BYTE *x_UEFI,
  _BYTE *x_UEFI_2,
  unsigned __int64 n0xF4240
);

__int64
EFIAPI
GetUint16AtIndex(
  __int64 a1,
  unsigned __int64 n16
);

__int64
EFIAPI
UnicodeStrToUpper(
  __int64 n12
);

__int64
EFIAPI
LocateProtocol(
  VOID
);

__int64
EFIAPI
GetUint32(
  __int64 a1,
  __int64 a2
);

__int64
EFIAPI
SetUint8(
  __int64 a1,
  char a2
);

void *
EFIAPI
CopyMem(
  void *DestinationBuffer,
  const void *SourceBuffer,
  UINTN Length
);

void *
EFIAPI
ZeroMem(
  void *Buffer,
  UINTN Length
);

void *
EFIAPI
StrCmpS(
  void *Buffer,
  UINTN Length,
  __int64 n2
);

INTN
EFIAPI
CompareMem(
  const void *DestinationBuffer,
  const void *SourceBuffer,
  UINTN Length
);

void *
EFIAPI
AllocatePool(
  UINTN AllocationSize
);

__int64
EFIAPI
GetVariableSize(
  unsigned __int16 *CpuPciCfg
);

__int64
EFIAPI
SetMemRange(
  _WORD *CpRcCfg
);

__int64
EFIAPI
CalculateCrc(
  VOID
);

void
EFIAPI
DebugPrint(
  UINTN ErrorLevel,
  const CHAR8 *Format,
  ...
);

__int64
EFIAPI
Assert(
  __int64 a1,
  __int64 a2,
  __int64 a3
);

void *
EFIAPI
AllocateCopyPool(
  UINTN AllocationSize,
  const void *Buffer
);

void *
EFIAPI
AllocateZeroPool(
  UINTN AllocationSize
);

void *
EFIAPI
CreateDevicePath(
  UINTN AllocationSize,
  UINTN n26,
  __int64 SourceBuffer
);

__int64
EFIAPI
ExtractConfig(
  VOID
);

unsigned __int64
EFIAPI
UnicodeToString(
  VOID
);

UINTN
EFIAPI
AsciiStrLen(
  const CHAR8 *_r_n
);

unsigned __int64
EFIAPI
Uint64ToStr(
  VOID
);

_BYTE *
EFIAPI
WritePciCfg(
  _BYTE *_r_n,
  _BYTE *_r_n_1,
  __int64 i_1,
  __int16 n48,
  __int64 n2
);

_BYTE *
EFIAPI
ReadPciCfg(
  _BYTE *_r_n,
  unsigned __int64 a2,
  __int64 n16
);

unsigned __int64
EFIAPI
PrintLibInternalSPrint(
  VOID
);

{"addr":"0x665c","code":"unsigned __int64
EFIAPI
PrintLibUnicodeVSPrint(
  \n        unsigned __int64 _r_n,
  \n        UINTN n0xF4240,
  \n        __int16 n320,
  \n        CHAR8 *%02d_%02d_%04d__%02d:%02d,
  \n        unsigned __int16 **va
);

unsigned __int64
EFIAPI
DevicePathIsEnd(
  _BYTE *_r_n,
  UINTN n38,
  __int16 n320,
  char *%02d_%02d_%04d__%02d:%02d,
  ...
);

bool
EFIAPI
DevicePathNodeOps(
  const void *i
);

UINT8
EFIAPI
DevicePathType(
  const void *Node
);

UINT8
EFIAPI
DevicePathSubType(
  const void *Node
);

UINTN
EFIAPI
DevicePathNodeLength(
  const void *Node
);

__int64
EFIAPI
DevicePathNextNode(
  const void *i
);

bool
EFIAPI
DevicePathIsMultiInstance(
  const void *Node
);

char
EFIAPI
DevicePathIsEndInstance(
  const void *i
);

UINTN
EFIAPI
DevicePathAppend(
  const void *Node
);

unsigned __int64
EFIAPI
GetDxeServicesTable(
  const void *DestinationBuffer,
  _QWORD *a2,
  UINTN Length
);

__int64
EFIAPI
DevicePathUtilities(
  __int64 a1,
  __int64 a2,
  __int64 a3,
  __int64 a4,
  __int64 a5
);

__int64
EFIAPI
LocateHandleBuffer(
  __int64 a1,
  __int64 *a2,
  const void *n512
);

void *
EFIAPI
GetAllHandlesByProtocol(
  char *x_UEFI,
  char a2,
  ...
);

__int64
EFIAPI
ReadCpuPciCfg(
  __int64 a1,
  char a2,
  char a3
);

__int64
EFIAPI
WriteS3BootScript(
  const void *DestinationBuffer,
  __int64 StringSize,
  UINTN Length
);

_WORD *
EFIAPI
HiiStringToToken(
  __int64 a1,
  _WORD *i
);

_WORD *
EFIAPI
HiiStringToToken2(
  const void *DestinationBuffer,
  __int64 StringSize,
  UINTN Length
);

__int64
EFIAPI
ReadCpRcCfg(
  __int64 n1024064
);

__int64
EFIAPI
ReadCpRcCfg2(
  unsigned int a1,
  __int64 PciCfgData,
  UINTN Length
);

__int64
EFIAPI
GetManufacturingMode(
  VOID
);

UINTN
EFIAPI
SetupPolicyInit(
  __int64 a1,
  va_list va,
  const void *SourceBuffer,
  ...
);

unsigned __int64
EFIAPI
GetSetupString(
  VOID
);

__int64
EFIAPI
SetupBufferOps(
  const void *SourceBuffer,
  unsigned __int64 n209,
  UINTN Length
);

__int64
EFIAPI
SetupVariableReadback(
  const void *SourceBuffer,
  unsigned __int64 n209,
  const void *Length,
  ...
);

__int64
EFIAPI
SetSetupVariable(
  const void *SourceBuffer
);

__int64
EFIAPI
WriteProtocolVar(
  const void *SourceBuffer,
  unsigned __int64 n209,
  UINTN Length
);

unsigned __int64
EFIAPI
RegisterHiiPackage(
  const void *SourceBuffer,
  unsigned __int64 n209,
  UINTN Length
);

__int64
EFIAPI
PublishInterface(
  VOID
);

{"addr":"0x8760","code":"__int64
EFIAPI
VariableServicesInit(
  VOID
);

__int64
EFIAPI
SetupVarSizeCheck(
  VOID
);

__int64
EFIAPI
SetupDataMigrate(
  VOID
);

__int64
EFIAPI
MigrateOldSetupVar(
  VOID
);

__int64
EFIAPI
SetupVarMigrate(
  __int64 a1,
  __int64 a2,
  __int64 n72
);

__int64
EFIAPI
InstallSetupVariables(
  void *Buffer,
  __int64 S3BootScriptArg
);

__int64
EFIAPI
SetupIfrExtractor(
  __int64 a1,
  __int64 a2,
  double a3,
  double a4
);

void
EFIAPI
SetupIfrStringLoader(
  _DWORD *a1,
  unsigned __int8 *n209
);

__int64
EFIAPI
SetupIfrPackLoader(
  VOID
);

char
EFIAPI
SetupConfigRouting(
  VOID
);

void *
EFIAPI
SetupConfigAccessExtract(
  VOID
);

void *
EFIAPI
SetupKeywordHandler(
  __int64 a1,
  __int64 a2,
  void *ZeroPool_1,
  __int64 a4
);

CHAR16 *
EFIAPI
ConstructConfigHdr(
  unsigned __int8 *SourceBuffer,
  __int16 *IntelSetup,
  __int64 DriverImageHandle
);

unsigned __int64
EFIAPI
SetupIfrBuilder(
  const CHAR16 *ZeroPool,
  char n2,
  __int64 *a3
);

{"addr":"0x9c04","code":"bool
EFIAPI
CheckActionFlag(
  __int64 a1
);

bool
EFIAPI
SetupRecordsGetSet(
  _WORD *ZeroPool,
  _WORD *a2,
  _WORD *&NAME_,
  _WORD *&PATH_
);

char
EFIAPI
SetupRecordsList(
  _WORD *ZeroPool,
  unsigned __int8 *SourceBuffer,
  __int16 *PchRcConfiguration
);

bool
EFIAPI
SetupInfoRecordsDisplay(
  __int64 a1,
  __int64 a2,
  __int64 a3,
  __int64 a4
);

bool
EFIAPI
SetupRecordsNavigate(
  __int64 a1,
  __int64 a2,
  __int64 a3,
  __int64 a4,
  __int64 a5
);

__int64
EFIAPI
SetupInfoRecordsWriter(
  __int64 a1,
  unsigned __int16 a2,
  __int64 a3
);

void *
EFIAPI
SetupIfrConfigAccess(
  __int64 MeProtocol,
  unsigned __int16 n1310,
  __int64 TempResult
);

void *
EFIAPI
SetupIfrOptionLookup(
  __int64 MeProtocol
);

__int64
EFIAPI
SetupIfrOptionValue(
  VOID
);

__int64
EFIAPI
SetupIfrKeywordHandle(
  unsigned __int8 *a1
);

__int64
EFIAPI
SetupIfrSupplement(
  char a1
);

UINT8
EFIAPI
IoRead8(
  UINTN Port
);

UINT8
EFIAPI
IoWrite8(
  UINTN Port,
  UINT8 Value
);

__int64
EFIAPI
MmIoRead32(
  const void *DestinationBuffer
);

unsigned __int64
EFIAPI
GetTimerValue(
  unsigned int Pool,
  unsigned __int64 n23,
  unsigned __int64 n0x20
);

UINT16
EFIAPI
IoRead16(
  UINTN Port
);

UINT16
EFIAPI
IoWrite16(
  UINTN Port,
  UINT16 Value
);

UINT32
EFIAPI
IoRead32(
  UINTN Port
);

__int64
EFIAPI
SetupVariableGet(
  const void *Port,
  __int64 n64
);

__int64
EFIAPI
SetupVariableSet(
  __int64 Buffer,
  __int64 a2,
  __int64 n72
);

__int64
EFIAPI
SetupConfigExtract(
  int n4,
  unsigned int n2
);

unsigned __int64
EFIAPI
SetupConfigRoute(
  _DWORD *a1
);

unsigned __int64
EFIAPI
SetupCallbackFinal(
  unsigned int *a1
);

#endif /* __PLATFORM_H__ */