Newer
Older
AMI-Aptio-BIOS-Reversed / AmiCRBPkg / CRB / CRBDxe / CRBDxe.h
@Ajax Dong Ajax Dong 2 days ago 4 KB Restructure the repo
/** @file
  CRBDxe reverse-engineering header.

  This header intentionally preserves decompiler-era names and recovered
  calling conventions. It is a navigation aid for CRBDxe.c, not a fully
  restored EDK2 production header.
**/

#ifndef CRBDXE_H_
#define CRBDXE_H_

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

//
// Module entry and constructor path
//
EFI_STATUS
ModuleEntryPoint (
  EFI_HANDLE        ImageHandle,
  EFI_SYSTEM_TABLE  *SystemTable
  );

char *
__fastcall
UefiBootServicesTableLibConstructor (
  __int64           ImageHandle,
  EFI_SYSTEM_TABLE  *SystemTable
  );

EFI_STATUS
__fastcall
PchRcConfigDriverEntry (
  __int64           a1,
  EFI_SYSTEM_TABLE  *SystemTable,
  __int64           a3,
  __int64           a4
  );

//
// PCH/PCIe configuration and SMBIOS slot update helpers
//
__int64
__fastcall
PchRcConfigUpdate (
  __int64  a1
  );

__int64
PciClassCodeQuery (
  VOID
  );

__int64
OptimizedBootConfig (
  VOID
  );

__int64
__fastcall
SmbiosType9FillSlotTable (
  char            SlotDesignationIndex,
  __int64         a2,
  char            CurrentUsage,
  char            SlotLength,
  unsigned char   SlotType,
  char            SlotDataBusWidth,
  char            SegmentGroup
  );

__int64
__fastcall
PciConfigBitParse (
  unsigned char  Bus,
  char           Device,
  __int64        Function,
  _BYTE          *LinkSpeed,
  _BYTE          *LinkWidth
  );

__int64
__fastcall
SmbiosType9SlotUpdateHelper (
  char           a1,
  char           a2,
  unsigned char  a3,
  char           a4,
  char           n16,
  __int16        a6,
  unsigned char  a7,
  char           *Slot9
  );

__int64
__fastcall
CrbDriverEntryPoint (
  __int64  a1
  );

__int64
__fastcall
SmbiosType9TableUpdate (
  __int64  a1,
  __int64  a2
  );

__int64
__fastcall
NotifyFunctionCallback (
  __int64  a1
  );

//
// Memory and pool wrappers recovered from linked libraries
//
char *
__fastcall
InternalMemCopyMem (
  char               *Destination,
  char               *Source,
  unsigned __int64   Count
  );

void *
__fastcall
MemCopyForward (
  void               *Buffer,
  unsigned __int64   Count,
  char               Value
  );

char *
__fastcall
MemCopyBackward (
  char               *Buffer,
  unsigned __int64   Count
  );

UINTN
__cdecl
AsciiStrLen (
  const CHAR8  *String
  );

char *
__fastcall
CopyMemWrapper (
  char               *Destination,
  char               *Source,
  unsigned __int64   Count
  );

void *
__fastcall
SetMemWrapper (
  void               *Buffer,
  unsigned __int64   Count
  );

char *
__fastcall
SetMem16Wrapper (
  char               *Buffer,
  unsigned __int64   Count
  );

__int64
CompareMemWrapper (
  VOID
  );

__int64
__fastcall
AllocatePoolWrapper (
  __int64  PoolType,
  __int64  Size
  );

__int64
__fastcall
AllocateZeroPoolWrapper (
  __int64  Size
  );

//
// UEFI library and platform access helpers
//
__int64
DebugLogPrint (
  __int64     ErrorLevel,
  const char  *Format,
  ...
  );

__int64
__fastcall
AssertCpuDeadLoop (
  __int64  FileName,
  __int64  LineNumber,
  __int64  Description
  );

unsigned __int64
__fastcall
DxeServicesTableRegister (
  __int64  DxeServicesTableGuid,
  _QWORD   *DxeServicesTable
  );

__int64
__fastcall
UefiLibCreateProtocolNotifyEvent (
  __int64           ProtocolGuid,
  EFI_SYSTEM_TABLE  *SystemTable,
  __int64           NotifyFunction,
  __int64           Event,
  __int64           Registration
  );

__int64
SmbiosType9SetSlotId (
  VOID
  );

__int64
SmbiosType9GetSlotConfig (
  VOID
  );

__int64
__fastcall
MmioReadHelper (
  __int64  Address
  );

unsigned __int64
__fastcall
SmbiosType9SlotDataValidate (
  unsigned char  *SlotData,
  _BYTE          *LinkSpeed,
  _BYTE          *LinkWidth
  );

char
__fastcall
GpioGetPadConfig (
  UINTN  Address
  );

__int64
__fastcall
GpioSetPadConfig (
  UINTN  Address
  );

__int64
GpioCheckPadOverride (
  VOID
  );

unsigned __int64
__fastcall
GpioPadCfgValidate (
  __int64  a1,
  __int64  a2,
  __int64  a3,
  char     a4,
  int      *a5
  );

unsigned __int64
__fastcall
GpioGroupCheck (
  __int64  a1,
  int      *a2
  );

void *
__fastcall
GpioGetPadCfgBase (
  unsigned __int64  *Group
  );

__int64
GpioGetChipsetId (
  VOID
  );

UINT16
__cdecl
MmioRead16 (
  UINTN  Address
  );

__int64
__fastcall
MmioGetBaseAddr (
  __int64  Address
  );

UINT16
__cdecl
MmioWrite16 (
  UINTN   Address,
  UINT16  Value
  );

#endif // CRBDXE_H_