diff options
Diffstat (limited to 'ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c')
-rw-r--r-- | ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c index 992932ee97..38fd5d3ed0 100644 --- a/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c +++ b/ArmVirtPkg/Library/ArmXenRelocatablePlatformLib/FdtParser.c @@ -65,17 +65,15 @@ FindMemnode ( return FALSE;
}
- if (AddressCells == 1) {
- *SystemMemoryBase = fdt32_to_cpu (*Prop);
- } else {
- *SystemMemoryBase = fdt64_to_cpu (*(UINT64 *)Prop);
+ *SystemMemoryBase = fdt32_to_cpu (Prop[0]);
+ if (AddressCells > 1) {
+ *SystemMemoryBase = (*SystemMemoryBase << 32) | fdt32_to_cpu (Prop[1]);
}
Prop += AddressCells;
- if (SizeCells == 1) {
- *SystemMemorySize = fdt32_to_cpu (*Prop);
- } else {
- *SystemMemorySize = fdt64_to_cpu (*(UINT64 *)Prop);
+ *SystemMemorySize = fdt32_to_cpu (Prop[0]);
+ if (SizeCells > 1) {
+ *SystemMemorySize = (*SystemMemorySize << 32) | fdt32_to_cpu (Prop[1]);
}
return TRUE;
|