43 UINTN AddressCells, SizeCells;
47 RsdpStructurePtr =
NULL;
52 Status =
gBS->LocateProtocol (
53 &gFdtClientProtocolGuid,
59 Status = FdtClient->FindCompatibleNodeReg (
67 if (EFI_ERROR (Status)) {
70 "%a: No 'xen,guest-acpi' compatible DT node found\n",
76 ASSERT (AddressCells == 2);
77 ASSERT (SizeCells == 2);
78 ASSERT (RegSize == 2 *
sizeof (UINT64));
84 if (RsdpStructurePtr && (RsdpStructurePtr->Revision >= 2)) {
86 (
CONST UINT8 *)RsdpStructurePtr,
94 *RsdpPtr = RsdpStructurePtr;
122 VOID *CurrentTableEntry;
123 UINTN CurrentTablePointer;
126 UINTN NumberOfTableEntries;
133 XenAcpiRsdpStructurePtr =
NULL;
138 NumberOfTableEntries = 0;
144 if (EFI_ERROR (Status)) {
145 DEBUG ((DEBUG_INFO,
"%a: No RSDP table found\n", __func__));
152 if (XenAcpiRsdpStructurePtr->XsdtAddress) {
158 XenAcpiRsdpStructurePtr->XsdtAddress;
159 NumberOfTableEntries = (Xsdt->Length -
165 for (Index = 0; Index < NumberOfTableEntries; Index++) {
169 CurrentTableEntry = (VOID *)((UINT8 *)Xsdt +
171 Index *
sizeof (UINT64));
172 CurrentTablePointer = (
UINTN)*(UINT64 *)CurrentTableEntry;
178 Status = AcpiProtocol->InstallAcpiTable (
181 CurrentTable->Length,
185 if (EFI_ERROR (Status)) {
192 if (!
AsciiStrnCmp ((CHAR8 *)&CurrentTable->Signature,
"FACP", 4)) {
194 (
UINTN)CurrentTablePointer;
197 (
UINTN)FadtTable->FirmwareCtrl;
205 if (DsdtTable !=
NULL) {
206 Status = AcpiProtocol->InstallAcpiTable (
212 if (EFI_ERROR (Status)) {
220 if (FacsTable !=
NULL) {
221 Status = AcpiProtocol->InstallAcpiTable (
227 if (EFI_ERROR (Status)) {
245 Status =
gBS->LocateProtocol (
246 &gEfiAcpiTableProtocolGuid,
UINT8 EFIAPI CalculateSum8(IN CONST UINT8 *Buffer, IN UINTN Length)
INTN EFIAPI AsciiStrnCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString, IN UINTN Length)
UINT64 EFIAPI SwapBytes64(IN UINT64 Value)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)