summaryrefslogtreecommitdiff
path: root/ArmVirtPkg/XenAcpiPlatformDxe
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-09-15 14:15:14 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-09-15 15:31:24 +0100
commitcfc8d51c0cbf97b5e71cfd92dcc6c5760940214f (patch)
tree8330973059c6b0d3de0daf3d7da1a962ff40f0f6 /ArmVirtPkg/XenAcpiPlatformDxe
parent38ed4a9e3a65185e7e7b3c891feab1ddc865fdb5 (diff)
downloadedk2-cfc8d51c0cbf97b5e71cfd92dcc6c5760940214f.zip
edk2-cfc8d51c0cbf97b5e71cfd92dcc6c5760940214f.tar.gz
edk2-cfc8d51c0cbf97b5e71cfd92dcc6c5760940214f.tar.bz2
ArmVirtPkg/FdtClientDxe: report address and size cell count directly
The FDT client protocol methods dealing with "reg" properties return the size of a "reg" element. Currently, we have hardcoded this as '8', since #address-cells == #size-cells == 2 in most cases. However, for different values, have a single 'reg' element size is not unambiguous, since - however unlikely - if #address-cells != #size-cells, we do not know which is which. So before adding more methods to the protocol, fix up this oversight. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'ArmVirtPkg/XenAcpiPlatformDxe')
-rw-r--r--ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c b/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c
index 37aea80..203946f 100644
--- a/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c
+++ b/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c
@@ -45,7 +45,8 @@ GetXenArmAcpiRsdp (
EFI_STATUS Status;
FDT_CLIENT_PROTOCOL *FdtClient;
CONST UINT64 *Reg;
- UINT32 RegElemSize, RegSize;
+ UINT32 RegSize;
+ UINTN AddressCells, SizeCells;
UINT64 RegBase;
UINT8 Sum;
@@ -59,13 +60,16 @@ GetXenArmAcpiRsdp (
ASSERT_EFI_ERROR (Status);
Status = FdtClient->FindCompatibleNodeReg (FdtClient, "xen,guest-acpi",
- (CONST VOID **)&Reg, &RegElemSize, &RegSize);
+ (CONST VOID **)&Reg, &AddressCells, &SizeCells,
+ &RegSize);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_WARN, "%a: No 'xen,guest-acpi' compatible DT node found\n",
__FUNCTION__));
return EFI_NOT_FOUND;
}
+ ASSERT (AddressCells == 2);
+ ASSERT (SizeCells == 2);
ASSERT (RegSize == 2 * sizeof (UINT64));
RegBase = SwapBytes64(Reg[0]);