/** @file
NvdimmSmbusCommon.h -- Header for NvdimmSmbusCommon
Copyright (c) HR650X BIOS Decompilation Project
**/
#ifndef __NVDIMMSMBUSCOMMON_H__
#define __NVDIMMSMBUSCOMMON_H__
#include "../uefi_headers/Uefi.h"
//
// Function Prototypes
//
EFI_STATUS
EFIAPI
ModuleEntryPoint(
VOID
);
EFI_STATUS
EFIAPI
Data(
VOID
);
EFI_STATUS
EFIAPI
ImageHandle; // 0x3058(
VOID
);
EFI_STATUS
EFIAPI
EFI_BOOT_SERVICES *BootServices; // 0x3050(
VOID
);
EFI_STATUS
EFIAPI
UINT64 RuntimeServices_0; // 0x3068 - copy of RT(
VOID
);
EFI_STATUS
EFIAPI
- copy of BS(
VOID
);
EFI_STATUS
EFIAPI
UINT64 qword_3078; // 0x3078 - TPL notify event(
VOID
);
EFI_STATUS
EFIAPI
- debug port protocol ptr(
VOID
);
EFI_STATUS
EFIAPI
- HOB list ptr(
VOID
);
EFI_STATUS
EFIAPI
- gDS ptr(
VOID
);
EFI_STATUS
EFIAPI
- debug level state(
VOID
);
EFI_STATUS
EFIAPI
- SMM buffer struct(
VOID
);
EFI_STATUS
EFIAPI
- SMM buffer address(
VOID
);
EFI_STATUS
EFIAPI
definitions (in .rdata section)(
VOID
);
EFI_STATUS
EFIAPI
gEfiDebugPortProtocolGuid = { 0xEBA4E8D2L, 0x3858, 0x41EC, { 0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } };(
VOID
);
EFI_STATUS
EFIAPI
parameters and calls sub_1000 to zero memory.(
VOID
);
EFI_STATUS
EFIAPI
a QWORD from an unaligned pointer with NULL validation.(
VOID
);
EFI_STATUS
EFIAPI
two GUIDs by reading them as two 64-bit values.(
VOID
);
EFI_STATUS
EFIAPI
SystemTable->ConfigurationTable for a matching GUID.(
VOID
);
EFI_STATUS
EFIAPI
NumberOfTableEntries (SystemTable + 104 = 0x68, offset of(
VOID
);
EFI_STATUS
EFIAPI
in EFI_SYSTEM_TABLE)(
VOID
);
EFI_STATUS
EFIAPI
(*(UINT64 *)(SystemTablePtr + 104) == 0) {(
VOID
);
EFI_STATUS
EFIAPI
ConfigurationTable array at SystemTable + 112 (= 0x70)(
VOID
);
EFI_STATUS
EFIAPI
are 24 bytes each (GUID + pointer)(
VOID
);
EFI_STATUS
EFIAPI
(i = 0;(
VOID
);
EFI_STATUS
EFIAPI
pointer is at offset 16 within each 24-byte entry(
VOID
);
EFI_STATUS
EFIAPI
and caches the HOB list pointer via the UEFI configuration table.(
VOID
);
EFI_STATUS
EFIAPI
BootServices_0 to 0. Registered via CreateEvent to track(
VOID
);
EFI_STATUS
EFIAPI
services availability.(
VOID
);
EFI_STATUS
EFIAPI
services cleanup for debug port protocol pointer.(
VOID
);
EFI_STATUS
EFIAPI
via CreateEventEx with EVT_NOTIFY_SIGNAL.(
VOID
);
EFI_STATUS
EFIAPI
and caches the EFI_DEBUGPORT_PROTOCOL for debug print output.(
VOID
);
EFI_STATUS
EFIAPI
BootServices->LocateProtocol if available; checks TPL first.(
VOID
);
EFI_STATUS
EFIAPI
to TPL_HIGH_LEVEL (31) via BootServices_0 + 24(
VOID
);
EFI_STATUS
EFIAPI
= (*(UINT64 (__fastcall **)(UINT64))(BootServices_0 + 24))(31);(
VOID
);
EFI_STATUS
EFIAPI
+ 320 = LocateProtocol(
VOID
);
EFI_STATUS
EFIAPI
= (*(INT64 (__fastcall **)(void *, UINT64, UINT64 *))((
VOID
);
EFI_STATUS
EFIAPI
outputs debug messages based on the current debug level(
VOID
);
EFI_STATUS
EFIAPI
in CMOS ports 0x70/0x71 (index 0x4B). If a debug port protocol(
VOID
);
EFI_STATUS
EFIAPI
available and the message's error level passes the platform filter(
VOID
);
EFI_STATUS
EFIAPI
message is forwarded to the protocol's output function.(
VOID
);
EFI_STATUS
EFIAPI
current debug level from CMOS index 0x4B(
VOID
);
EFI_STATUS
EFIAPI
(0x70, (__inbyte (0x70) & 0x80) | 0x4B);(
VOID
);
EFI_STATUS
EFIAPI
to max level 3(
VOID
);
EFI_STATUS
EFIAPI
= CmosDebugLevel;(
VOID
);
EFI_STATUS
EFIAPI
to filter mask (level 1 = EFI_D_ERROR, level 2+ = EFI_D_WARN)(
VOID
);
EFI_STATUS
EFIAPI
= (UINT8)(N113 - 1);(
VOID
);
EFI_STATUS
EFIAPI
equivalent(
VOID
);
EFI_STATUS
EFIAPI
| EFI_D_ERROR(
VOID
);
EFI_STATUS
EFIAPI
only(
VOID
);
EFI_STATUS
EFIAPI
the message level passes the filter, call debug output(
VOID
);
EFI_STATUS
EFIAPI
((FilterLevel & ErrorLevel) != 0) {(
VOID
);
EFI_STATUS
EFIAPI
debug output with file, line, and assertion condition.(
VOID
);
EFI_STATUS
EFIAPI
driver initialization that:(
VOID
);
EFI_STATUS
EFIAPI
references:(
VOID
);
EFI_STATUS
EFIAPI
= sub_1584(
VOID
);
EFI_STATUS
EFIAPI
| EVT_TIMER(
VOID
);
EFI_STATUS
EFIAPI
HOB list(
VOID
);
EFI_STATUS
EFIAPI
();(
VOID
);
EFI_STATUS
EFIAPI
DXE Services Table by GUID(
VOID
);
EFI_STATUS
EFIAPI
= sub_15B8 ((UINT64)&gEfiDxeServicesTableGuid, &qword_3098);(
VOID
);
EFI_STATUS
EFIAPI
SMM communication buffer, zeros it, and installs the(
VOID
);
EFI_STATUS
EFIAPI
protocol for NONSMM<->SMM interface.(
VOID
);
EFI_STATUS
EFIAPI
(type 1 = EfiRuntimeServicesData, 10 pages)(
VOID
);
EFI_STATUS
EFIAPI
= (*(INT64 (__fastcall **)(UINT64, UINT64, UINT64, UINT64 *))((
VOID
);
EFI_STATUS
EFIAPI
10, // Pages(
VOID
);
EFI_STATUS
EFIAPI
&Buffer(
VOID
);
EFI_STATUS
EFIAPI
the SMM communication buffer address(
VOID
);
EFI_STATUS
EFIAPI
((
VOID
);
EFI_STATUS
EFIAPI
the communication buffer (15 bytes for the SMBUS interface)(
VOID
);
EFI_STATUS
EFIAPI
((char *)Buffer, 0x0F);(
VOID
);
EFI_STATUS
EFIAPI
the local buffer structure(
VOID
);
EFI_STATUS
EFIAPI
((char *)&buf_, 0x10);(
VOID
);
EFI_STATUS
EFIAPI
the SMM communication structure(
VOID
);
EFI_STATUS
EFIAPI
= Buffer; // SMM buffer pointer(
VOID
);
EFI_STATUS
EFIAPI
revision or initialized flag(
VOID
);
EFI_STATUS
EFIAPI
= (*(INT64 (__fastcall **)(EFI_HANDLE *, void *, UINT64, char *))((
VOID
);
EFI_STATUS
EFIAPI
driver entry point.(
VOID
);
EFI_STATUS
EFIAPI
services, allocates SMM communication buffer, installs(
VOID
);
EFI_STATUS
EFIAPI
SMBUS NONSMM<->SMM interface protocol.(
VOID
);
EFI_STATUS
EFIAPI
up: close protocol notify events(
VOID
);
#endif /* __NVDIMMSMBUSCOMMON_H__ */