AcpiTable.c
/*
* AcpiTable.c
*
* Created on: 2017年9月20日
* Author:
*/
#include <Uefi.h>
#include <Library/UefiLib.h>
#include <IndustryStandard/Acpi10.h>
#include <Protocol/AcpiTable.h>
#include "UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h"
#include <stdio.h>
EFI_STATUS
EFIAPI
UefiMain (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader;
VOID *AcpiTable;
EFI_ACPI_6_0_ROOT_SYSTEM_DESCRIPTION_POINTER *RSDP;
UINTN EntryIndex;
Print (L"-----------------------------------------------------\r\n");
AcpiTable = NULL;
Status = EfiGetSystemConfigurationTable (
&gEfiAcpi20TableGuid,
&AcpiTable
);
if (EFI_ERROR (Status)) {
Status = EfiGetSystemConfigurationTable (
&gEfiAcpi10TableGuid,
&AcpiTable
);
}
//
// We do not ASSERT if AcpiTable not found. It is possbile that a platform does not produce AcpiTable.
//
if (AcpiTable == NULL) {
Print(L"acpi table is not found.\r\n");
}
RSDP = (EFI_ACPI_6_0_ROOT_SYSTEM_DESCRIPTION_POINTER*)AcpiTable;
Print(L"RSDP Address :%08x\r\n", AcpiTable);
Print(L"Signature :");
putchar(RSDP->Signature & 0x000000FF);
putchar((RSDP->Signature & 0x0000FF00) / 16 /16);
putchar((RSDP->Signature & 0x00FF0000) / 16 /16 / 16 /16);
putchar((RSDP->Signature & 0xFF000000) / 16 /16 / 16 /16 / 16 /16);
putchar((RSDP->Signature & 0x000000FF00000000) / 16 /16 / 16 /16 / 16 /16 / 16 /16);
putchar