Newer
Older
AMI-Aptio-BIOS-Reversed / ExportHiiDb / ExportHiiDb.h
@Ajax Dong Ajax Dong 2 days ago 5 KB Init
/** @file
  ExportHiiDb.h -- Header for ExportHiiDb

Copyright (c) HR650X BIOS Decompilation Project
**/

#ifndef __EXPORTHIIDB_H__
#define __EXPORTHIIDB_H__

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

//
// Function Prototypes
//

EFI_STATUS
EFIAPI
ReadUnaligned64(
  VOID
);

EFI_STATUS
EFIAPI
CompareGuid(
  VOID
);

EFI_STATUS
EFIAPI
IsCpuInfoHob(
  VOID
);

EFI_STATUS
EFIAPI
GetPlatformCmosType(
  VOID
);

EFI_STATUS
EFIAPI
FormatUnsignedDecimal(
  VOID
);

EFI_STATUS
EFIAPI
StringAppend(
  VOID
);

EFI_STATUS
EFIAPI
FormatCpuInfoLine(
  VOID
);

EFI_STATUS
EFIAPI
GetTotalCpuNumber(
  VOID
);

EFI_STATUS
EFIAPI
ExportHiiDbNotify(
  VOID
);

EFI_STATUS
EFIAPI
ExportHiiDbEntryPoint(
  VOID
);

EFI_STATUS
EFIAPI
protocol pointer caches (used by standard UEFI library constructors)(
  VOID
);

EFI_STATUS
EFIAPI
gImageHandle        = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
copies for direct access within callbacks(
  VOID
);

EFI_STATUS
EFIAPI
EFI_SYSTEM_TABLE     *mSystemTable      = NULL;   // 0xe50 SystemTable_0(
  VOID
);

EFI_STATUS
EFIAPI
BootServices_0(
  VOID
);

EFI_STATUS
EFIAPI
RuntimeServices_0(
  VOID
);

EFI_STATUS
EFIAPI
GUID for the "HiiDB" UEFI variable(
  VOID
);

EFI_STATUS
EFIAPI
CONST EFI_GUID mHiiDbVariableGuid =(
  VOID
);

EFI_STATUS
EFIAPI
for the HII database protocol that the notification event listens for(
  VOID
);

EFI_STATUS
EFIAPI
CONST EFI_GUID mHiiDbProtocolGuid =(
  VOID
);

EFI_STATUS
EFIAPI
protocol interface pointer (lazy-init via GetHiiDbProtocol)(
  VOID
);

EFI_STATUS
EFIAPI
VOID   *mHiiDbProtocol     = NULL;     // 0xe30 qword_E30(
  VOID
);

EFI_STATUS
EFIAPI
HOB list pointer (lazy-init via GetHobList)(
  VOID
);

EFI_STATUS
EFIAPI
VOID   *mHobList           = NULL;     // 0xe38 qword_E38(
  VOID
);

EFI_STATUS
EFIAPI
event handle(
  VOID
);

EFI_STATUS
EFIAPI
EFI_EVENT mNotificationEvent;          // returned by CreateEventEx(
  VOID
);

EFI_STATUS
EFIAPI
cached pointer if already resolved(
  VOID
);

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

EFI_STATUS
EFIAPI
= gBS->RaiseTPL (TPL_HIGH_LEVEL);            // BS+24 (0x18): RaiseTPL(
  VOID
);

EFI_STATUS
EFIAPI
proceed if we were at TPL_NOTIFY or below(
  VOID
);

EFI_STATUS
EFIAPI
(OldTpl <= TPL_NOTIFY) {(
  VOID
);

EFI_STATUS
EFIAPI
load on x64(
  VOID
);

/// same bytes as mHiiDbProtocolGuid in this module
EFI_STATUS
EFIAPI
mCpuInfoHobGuid(
  VOID
);

EFI_STATUS
EFIAPI
use the same GUID value for match purposes.(
  VOID
);

EFI_STATUS
EFIAPI
cached HOB list pointer(
  VOID
);

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

EFI_STATUS
EFIAPI
if SystemTable has HOB list (set up by DXE core)(
  VOID
);

EFI_STATUS
EFIAPI
(mSystemTable->HobList != NULL) {(
  VOID
);

EFI_STATUS
EFIAPI
+ 0x68: number of entries or HOB end marker(
  VOID
);

EFI_STATUS
EFIAPI
through HOB entries to find the CPU info GUID(
  VOID
);

EFI_STATUS
EFIAPI
( ; ; ) {(
  VOID
);

EFI_STATUS
EFIAPI
to data portion(
  VOID
);

EFI_STATUS
EFIAPI
actual data pointer is at offset 16 from start(
  VOID
);

EFI_STATUS
EFIAPI
to next HOB(
  VOID
);

EFI_STATUS
EFIAPI
= (EFI_HOB *)((UINTN)HobEntry + *(UINT16 *)((UINTN)HobEntry + 4));(
  VOID
);

EFI_STATUS
EFIAPI
of HOB list(
  VOID
);

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

EFI_STATUS
EFIAPI
loop: mHobList should never be NULL if PEI published the CPU info(
  VOID
);

EFI_STATUS
EFIAPI
();(
  VOID
);

EFI_STATUS
EFIAPI
CMOS status register (index 0x4B)(
  VOID
);

EFI_STATUS
EFIAPI
NMI mask bit (bit 7)(
  VOID
);

EFI_STATUS
EFIAPI
(0x70, (__inbyte (0x70) & 0x80) | 0x4B);(
  VOID
);

EFI_STATUS
EFIAPI
the NV storage type(
  VOID
);

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

EFI_STATUS
EFIAPI
type to platform type(
  VOID
);

EFI_STATUS
EFIAPI
(NvStorageType == 1) {(
  VOID
);

EFI_STATUS
EFIAPI
}(
  VOID
);

EFI_STATUS
EFIAPI
to end of Destination(
  VOID
);

EFI_STATUS
EFIAPI
(*Destination != L'\0') {(
  VOID
);

EFI_STATUS
EFIAPI
Source characters including terminator(
  VOID
);

EFI_STATUS
EFIAPI
{(
  VOID
);

EFI_STATUS
EFIAPI
reads from the CPU info HOB.(
  VOID
);

EFI_STATUS
EFIAPI
unpopulated, reads from chipset MSR range.(
  VOID
);

EFI_STATUS
EFIAPI
this platform, total CPU number is derived from(
  VOID
);

EFI_STATUS
EFIAPI
detected package count.(
  VOID
);

EFI_STATUS
EFIAPI
1;(
  VOID
);

EFI_STATUS
EFIAPI
interface call at offset 0x20 (32):(
  VOID
);

EFI_STATUS
EFIAPI
(*GetHiiDbPhysicalAddr)((
  VOID
);

EFI_STATUS
EFIAPI
VOID                *This(
  VOID
);

EFI_STATUS
EFIAPI
UINTN               Flags(
  VOID
);

EFI_STATUS
EFIAPI
EFI_PHYSICAL_ADDRESS *PhysicalAddress(
  VOID
);

EFI_STATUS
EFIAPI
UINTN               Reserved(
  VOID
);

EFI_STATUS
EFIAPI
EFI_NOT_FOUND (0x8000000000000005) if not yet populated(
  VOID
);

EFI_STATUS
EFIAPI
HiiDbPhysAddr containing the required buffer size from(
  VOID
);

EFI_STATUS
EFIAPI
EFI_NOT_FOUND:(
  VOID
);

EFI_STATUS
EFIAPI
PagesNeeded = EFI_SIZE_TO_PAGES (HiiDbPhysAddr);(
  VOID
);

EFI_STATUS
EFIAPI
= gBS->AllocatePages ((
  VOID
);

EFI_STATUS
EFIAPI
= AllocateAnyPages(
  VOID
);

EFI_STATUS
EFIAPI
= EfiRuntimeServicesData(
  VOID
);

EFI_STATUS
EFIAPI
the read with the allocated physical address(
  VOID
);

EFI_STATUS
EFIAPI
publish the variable:(
  VOID
);

EFI_STATUS
EFIAPI
= gRT->SetVariable ((
  VOID
);

EFI_STATUS
EFIAPI
| EFI_VARIABLE_RUNTIME_ACCESS(
  VOID
);

/// one-shot notification
EFI_STATUS
EFIAPI
this event(
  VOID
);

EFI_STATUS
EFIAPI
up UEFI Library globals(
  VOID
);

EFI_STATUS
EFIAPI
= ImageHandle;(
  VOID
);

EFI_STATUS
EFIAPI
local copies(
  VOID
);

EFI_STATUS
EFIAPI
= SystemTable;(
  VOID
);

EFI_STATUS
EFIAPI
HOB list(
  VOID
);

EFI_STATUS
EFIAPI
a notification event that catches the HII DB protocol install.(
  VOID
);

EFI_STATUS
EFIAPI
= gBS->CreateEventEx ((
  VOID
);

EFI_STATUS
EFIAPI
that triggers the event(
  VOID
);

EFI_STATUS
EFIAPI
if the event could not be created(
  VOID
);

EFI_STATUS
EFIAPI
(EFI_ERROR (Status)) {(
  VOID
);

EFI_STATUS
EFIAPI
132 in ExportHiiDb.c: "!EFI_ERROR (Status)"(
  VOID
);

EFI_STATUS
EFIAPI
((EFI_D_ERROR(
  VOID
);

#endif /* __EXPORTHIIDB_H__ */