/** @file
TpmNvmeSupport.h -- Header for TpmNvmeSupport
Copyright (c) HR650X BIOS Decompilation Project
**/
#ifndef __TPMNVMESUPPORT_H__
#define __TPMNVMESUPPORT_H__
#include "../uefi_headers/Uefi.h"
//
// Function Prototypes
//
EFI_STATUS
EFIAPI
CpuPause(
VOID
);
EFI_STATUS
EFIAPI
ReadTsc(
VOID
);
EFI_STATUS
EFIAPI
EnableInterrupts(
VOID
);
EFI_STATUS
EFIAPI
DisableInterrupts(
VOID
);
EFI_STATUS
EFIAPI
ReadEflags(
VOID
);
EFI_STATUS
EFIAPI
DebugPrint(
VOID
);
EFI_STATUS
EFIAPI
AssertBreak(
VOID
);
EFI_STATUS
EFIAPI
GetPciExpressBaseAddress(
VOID
);
EFI_STATUS
EFIAPI
PciExpressLibAddress(
VOID
);
EFI_STATUS
EFIAPI
IoWrite16(
VOID
);
EFI_STATUS
EFIAPI
IoRead32(
VOID
);
EFI_STATUS
EFIAPI
ReadUnaligned64(
VOID
);
EFI_STATUS
EFIAPI
CompareGuid(
VOID
);
EFI_STATUS
EFIAPI
TpmNvmeSupportEntry(
VOID
);
EFI_STATUS
EFIAPI
TpmNvmeSupportDxeEntry(
VOID
);
EFI_STATUS
EFIAPI
CheckNvmeDevicePresence(
VOID
);
EFI_STATUS
EFIAPI
NvmeCheckTimerNotify(
VOID
);
EFI_STATUS
EFIAPI
Definitions(
VOID
);
EFI_STATUS
EFIAPI
gAmiTcgPpiVariableGuid = AMI_TCG_PPI_VARIABLE_GUID;(
VOID
);
EFI_STATUS
EFIAPI
Data(
VOID
);
EFI_STATUS
EFIAPI
BIOS globals.(
VOID
);
EFI_STATUS
EFIAPI
gImageHandle = NULL;(
VOID
);
EFI_STATUS
EFIAPI
mode protocol interface (obtained via LocateProtocol).(
VOID
);
EFI_STATUS
EFIAPI
*gDebugModeProtocol = NULL;(
VOID
);
EFI_STATUS
EFIAPI
list pointer cached from the system configuration table.(
VOID
);
EFI_STATUS
EFIAPI
*gHobList = NULL;(
VOID
);
EFI_STATUS
EFIAPI
Express base address from PCD token 5.(
VOID
);
EFI_STATUS
EFIAPI
gPciExpressBaseAddress = 0;(
VOID
);
EFI_STATUS
EFIAPI
protocol interface (obtained via LocateProtocol).(
VOID
);
EFI_STATUS
EFIAPI
*gPcdProtocol = NULL;(
VOID
);
EFI_STATUS
EFIAPI
/ CPU Intrinsic Functions(
VOID
);
EFI_STATUS
EFIAPI
Access Helpers(
VOID
);
/// in very early phases this will be small.
EFI_STATUS
EFIAPI
available memory(
VOID
);
EFI_STATUS
EFIAPI
= gBootServices->AllocatePages (AllocateAnyPages, EfiBootServicesData, 31);(
VOID
);
/// attempt to locate the debug protocol.
EFI_STATUS
EFIAPI
phase(
VOID
);
EFI_STATUS
EFIAPI
(gBootServices->LocateProtocol ((
VOID
);
EFI_STATUS
EFIAPI
Print and Assert Support(
VOID
);
EFI_STATUS
EFIAPI
the CMOS debug level register.(
VOID
);
EFI_STATUS
EFIAPI
= IoRead8 (0x70) & 0x80;(
VOID
);
EFI_STATUS
EFIAPI
the CMOS value to get the debug filter mask.(
VOID
);
EFI_STATUS
EFIAPI
(CmosValue > 3) {(
VOID
);
EFI_STATUS
EFIAPI
hardware debug pin status.(
VOID
);
EFI_STATUS
EFIAPI
= (MmioRead8 (0xFEDAF0490) & 2) | 1;(
VOID
);
EFI_STATUS
EFIAPI
the message passes the filter, call the debug protocol print function.(
VOID
);
EFI_STATUS
EFIAPI
((FilterMask & ErrorLevel) != 0) {(
VOID
);
EFI_STATUS
EFIAPI
and PCD Access(
VOID
);
EFI_STATUS
EFIAPI
5 in the PCD database corresponds to PcdPciExpressBaseAddress.(
VOID
);
EFI_STATUS
EFIAPI
= PcdProtocol->Get5 (PcdToken (PcdPciExpressBaseAddress));(
VOID
);
EFI_STATUS
EFIAPI
Driver Logic(
VOID
);
EFI_STATUS
EFIAPI
the driver image handle.(
VOID
);
EFI_STATUS
EFIAPI
= ImageHandle;(
VOID
);
EFI_STATUS
EFIAPI
the system table.(
VOID
);
EFI_STATUS
EFIAPI
= SystemTable;(
VOID
);
EFI_STATUS
EFIAPI
the boot services table.(
VOID
);
EFI_STATUS
EFIAPI
= SystemTable->BootServices;(
VOID
);
EFI_STATUS
EFIAPI
the runtime services table.(
VOID
);
EFI_STATUS
EFIAPI
= SystemTable->RuntimeServices;(
VOID
);
EFI_STATUS
EFIAPI
the HOB list.(
VOID
);
EFI_STATUS
EFIAPI
();(
VOID
);
EFI_STATUS
EFIAPI
the PCI Express base address from PCD.(
VOID
);
EFI_STATUS
EFIAPI
the PcdPciExpressBaseAddress token is non-negative, enable(
VOID
);
EFI_STATUS
EFIAPI
Express MMIO access by writing the port 0xCF8 command.(
VOID
);
EFI_STATUS
EFIAPI
((INT8)PciExpressLibAddress (0xF0004) >= 0) {(
VOID
);
EFI_STATUS
EFIAPI
the current interrupt state and disable interrupts.(
VOID
);
EFI_STATUS
EFIAPI
= (ReadEflags () & EFI_FLAGS_IF) != 0;(
VOID
);
EFI_STATUS
EFIAPI
for I/O posting to complete).(
VOID
);
EFI_STATUS
EFIAPI
= (UINTN)IoRead32 (1288);(
VOID
);
EFI_STATUS
EFIAPI
the interrupt state.(
VOID
);
EFI_STATUS
EFIAPI
(InterruptsOn) {(
VOID
);
EFI_STATUS
EFIAPI
the module banner.(
VOID
);
EFI_STATUS
EFIAPI
((DEBUG_INFO, " \n TpmNvmeSupportDxeEntry \n "));(
VOID
);
EFI_STATUS
EFIAPI
the AMI Setup variable to check if TPM NVMe support is enabled.(
VOID
);
EFI_STATUS
EFIAPI
= sizeof (SetupData);(
VOID
);
EFI_STATUS
EFIAPI
at offset 0x12C (300) in the Setup structure holds the(
VOID
);
/// a single byte: 0x01 = enabled.
EFI_STATUS
EFIAPI
option(
VOID
);
EFI_STATUS
EFIAPI
= SetupData[300];(
VOID
);
EFI_STATUS
EFIAPI
the AMI TCG PPI variable.(
VOID
);
EFI_STATUS
EFIAPI
the AMITCGPPIVAR variable.(
VOID
);
EFI_STATUS
EFIAPI
= 0;(
VOID
);
EFI_STATUS
EFIAPI
the initial NVMe device presence check.(
VOID
);
EFI_STATUS
EFIAPI
= CheckNvmeDevicePresence ();(
VOID
);
/// register a periodic timer to retry.
EFI_STATUS
EFIAPI
not found yet(
VOID
);
EFI_STATUS
EFIAPI
= gBootServices->SetTimer ((
VOID
);
EFI_STATUS
EFIAPI
all handles that support the NVMe storage protocol.(
VOID
);
EFI_STATUS
EFIAPI
= gBootServices->LocateHandleBuffer ((
VOID
);
EFI_STATUS
EFIAPI
all NVMe protocol handles for a live device.(
VOID
);
EFI_STATUS
EFIAPI
a responsive NVMe device.(
VOID
);
EFI_STATUS
EFIAPI
= 1;(
VOID
);
EFI_STATUS
EFIAPI
the presence flag into the AMI Setup variable.(
VOID
);
EFI_STATUS
EFIAPI
byte offset 300 in the Setup data (TpmNvmeSupport presence flag).(
VOID
);
EFI_STATUS
EFIAPI
the NVMe device presence check.(
VOID
);
EFI_STATUS
EFIAPI
the event to indicate completion.(
VOID
);
#endif /* __TPMNVMESUPPORT_H__ */