Newer
Older
AMI-Aptio-BIOS-Reversed / PurleyPlatPkg / Ras / AddressTran / AddressTranslationDsmMemRas / AddressTranslationDsmMemRas.h
@Ajax Dong Ajax Dong 2 days ago 5 KB Restructure the repo
/** @file
  AddressTranslationDsmMemRas.h -- Header for AddressTranslationDsmMemRas

Copyright (c) HR650X BIOS Decompilation Project
**/

#ifndef __ADDRESSTRANSLATIONDSMMEMRAS_H__
#define __ADDRESSTRANSLATIONDSMMEMRAS_H__

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

//
// Function Prototypes
//

EFI_STATUS
EFIAPI
UefiBootServicesTableLibConstructor(
  VOID
);

EFI_STATUS
EFIAPI
DebugPrint(
  VOID
);

EFI_STATUS
EFIAPI
DebugAssert(
  VOID
);

EFI_STATUS
EFIAPI
IsAddressInSmram(
  VOID
);

EFI_STATUS
EFIAPI
FreeMemory(
  VOID
);

EFI_STATUS
EFIAPI
SetJump(
  VOID
);

EFI_STATUS
EFIAPI
LongJump(
  VOID
);

EFI_STATUS
EFIAPI
AddressTranslationDsmEntry(
  VOID
);

EFI_STATUS
EFIAPI
RegisterSwSmi(
  VOID
);

EFI_STATUS
EFIAPI
SwSmiHandler(
  VOID
);

EFI_STATUS
EFIAPI
InstallSsdt(
  VOID
);

EFI_STATUS
EFIAPI
GetSectionFromFv(
  VOID
);

EFI_STATUS
EFIAPI
ModuleEntryPoint(
  VOID
);

EFI_STATUS
EFIAPI
variables(
  VOID
);

EFI_STATUS
EFIAPI
*gImageHandle       = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
communication buffer (0x100 bytes allocated via AllocatePool)(
  VOID
);

EFI_STATUS
EFIAPI
*mCommunicationBuffer = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
ranges for memory allocation tracking(
  VOID
);

EFI_STATUS
EFIAPI
*mSmramRanges       = NULL;(
  VOID
);

EFI_STATUS
EFIAPI
status tracking(
  VOID
);

EFI_STATUS
EFIAPI
mModuleStatus       = EFI_SUCCESS;(
  VOID
);

EFI_STATUS
EFIAPI
GUIDs (platform-specific)(
  VOID
);

EFI_STATUS
EFIAPI
gMemRasProtocolGuid  = { 0x6D7E4A32, 0x9A73, 0x46BA, { 0x94, 0xA1, 0x5F, 0x2F, 0x25, 0xEF, 0x3E, 0x29 } };(
  VOID
);

EFI_STATUS
EFIAPI
SMM Base2 protocol to get SMM System Table(
  VOID
);

EFI_STATUS
EFIAPI
= gBS->LocateProtocol (&gEfiSmmBase2ProtocolGuid, NULL, (VOID **)&gSmst);(
  VOID
);

EFI_STATUS
EFIAPI
SMM Access2 protocol for SMRAM discovery(
  VOID
);

EFI_STATUS
EFIAPI
= gBS->LocateProtocol (&gEfiSmmAccess2ProtocolGuid, NULL, (VOID **)&SmmAccess);(
  VOID
);

EFI_STATUS
EFIAPI
SMRAM capabilities (expected to return EFI_BUFFER_TOO_SMALL initially)(
  VOID
);

EFI_STATUS
EFIAPI
= SmmAccess->GetCapabilities (SmmAccess, &SmramSize, NULL);(
  VOID
);

EFI_STATUS
EFIAPI
SMRAM ranges descriptor(
  VOID
);

EFI_STATUS
EFIAPI
= (EFI_SMRAM_DESCRIPTOR *)SmramAllocatePool (SmramSize);(
  VOID
);

EFI_STATUS
EFIAPI
descriptor is 0x20 (32) bytes(
  VOID
);

EFI_STATUS
EFIAPI
= SmramSize >> 5;(
  VOID
);

EFI_STATUS
EFIAPI
CMOS debug level at offset 0x4C(
  VOID
);

EFI_STATUS
EFIAPI
= IoRead8 (0x70);(
  VOID
);

EFI_STATUS
EFIAPI
non-volatile GPRs(
  VOID
);

EFI_STATUS
EFIAPI
MemRas protocol(
  VOID
);

EFI_STATUS
EFIAPI
= gSmst->SmmLocateProtocol (&gMemRasProtocolGuid, NULL, (VOID **)&mMemRas);(
  VOID
);

EFI_STATUS
EFIAPI
communication buffer (sizeof = 0x100 bytes)(
  VOID
);

EFI_STATUS
EFIAPI
= gBootServices->AllocatePool ((
  VOID
);

EFI_STATUS
EFIAPI
SW SMI handler(
  VOID
);

EFI_STATUS
EFIAPI
= RegisterSwSmi ();(
  VOID
);

EFI_STATUS
EFIAPI
patched SSDT(
  VOID
);

EFI_STATUS
EFIAPI
= InstallSsdt ();(
  VOID
);

EFI_STATUS
EFIAPI
SMM SW Dispatch2 protocol(
  VOID
);

EFI_STATUS
EFIAPI
= gSmst->SmmLocateProtocol ((
  VOID
);

EFI_STATUS
EFIAPI
SMI handler with input value 0x97 (151)(
  VOID
);

EFI_STATUS
EFIAPI
the SW SMI input value in the communication header(
  VOID
);

EFI_STATUS
EFIAPI
already registered, treat as unsupported(
  VOID
);

EFI_STATUS
EFIAPI
(Status == EFI_ALREADY_STARTED) {(
  VOID
);

EFI_STATUS
EFIAPI
MemRas protocol availability(
  VOID
);

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

EFI_STATUS
EFIAPI
stack buffer(
  VOID
);

EFI_STATUS
EFIAPI
(&Buffer, sizeof (Buffer));(
  VOID
);

EFI_STATUS
EFIAPI
status to "in progress" (2)(
  VOID
);

EFI_STATUS
EFIAPI
(CommBuffer->Command == COMMAND_GET_ERROR_LOG) {(
  VOID
);

EFI_STATUS
EFIAPI
(CommBuffer->Command == COMMAND_CLEAR_ERROR_LOG) {(
  VOID
);

EFI_STATUS
EFIAPI
input data from communication buffer(
  VOID
);

EFI_STATUS
EFIAPI
(&Buffer, (VOID *)(UINTN)CommBuffer->Address0, sizeof (Buffer));(
  VOID
);

EFI_STATUS
EFIAPI
command succeeded, copy results back with sentinel handling.(
  VOID
);

EFI_STATUS
EFIAPI
are conditionally written: if the output field value equals the(
  VOID
);

EFI_STATUS
EFIAPI
(-1 for QWORD/DWORD, 0xFF for BYTE), the original value is preserved.(
  VOID
);

EFI_STATUS
EFIAPI
(CommBuffer->Status == COMMAND_STATUS_SUCCESS) {(
  VOID
);

EFI_STATUS
EFIAPI
ACPI Table protocol(
  VOID
);

EFI_STATUS
EFIAPI
= gBootServices->LocateProtocol ((
  VOID
);

EFI_STATUS
EFIAPI
SSDT firmware file by GUID from Firmware Volume(
  VOID
);

EFI_STATUS
EFIAPI
= GetSectionFromFv ((
  VOID
);

EFI_STATUS
EFIAPI
for the SSDT signature pattern to patch.(
  VOID
);

EFI_STATUS
EFIAPI
= (UINTN)SsdtData + 36;(
  VOID
);

EFI_STATUS
EFIAPI
Data[1] == 0x80 &&          // CreateField/OpRegion(
  VOID
);

EFI_STATUS
EFIAPI
Data[12] == 0x0C) {         // DWordConst(
  VOID
);

EFI_STATUS
EFIAPI
the buffer address to point to the communication buffer(
  VOID
);

EFI_STATUS
EFIAPI
the SSDT ACPI table(
  VOID
);

EFI_STATUS
EFIAPI
firmware volume protocol by image handle(
  VOID
);

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

EFI_STATUS
EFIAPI
the raw file section(
  VOID
);

EFI_STATUS
EFIAPI
= FvProtocol->ReadSection ((
  VOID
);

EFI_STATUS
EFIAPI
boot services and SMM globals(
  VOID
);

EFI_STATUS
EFIAPI
(ImageHandle, SystemTable);(
  VOID
);

EFI_STATUS
EFIAPI
module status to EFI_SUCCESS initially(
  VOID
);

EFI_STATUS
EFIAPI
= 0x8000000000000001uLL;(
  VOID
);

EFI_STATUS
EFIAPI
to initialize with SetJump for error recovery(
  VOID
);

EFI_STATUS
EFIAPI
(SetJump (&JumpBuffer) == 0) {(
  VOID
);

EFI_STATUS
EFIAPI
module status if needed(
  VOID
);

EFI_STATUS
EFIAPI
(Status >= 0 || mModuleStatus < 0) {(
  VOID
);

EFI_STATUS
EFIAPI
final status and free memory if failed(
  VOID
);

EFI_STATUS
EFIAPI
= mModuleStatus;(
  VOID
);

#endif /* __ADDRESSTRANSLATIONDSMMEMRAS_H__ */