18QemuVirtMemInfoPeiLibConstructor (
24 UINT64 NewBase, CurBase;
25 UINT64 NewSize, CurSize;
28 CONST UINT64 *RegProp;
34 DeviceTreeBase = (VOID *)(
UINTN)
PcdGet64 (PcdDeviceTreeInitialBaseAddress);
35 ASSERT (DeviceTreeBase !=
NULL);
40 ASSERT (fdt_check_header (DeviceTreeBase) == 0);
45 for (Prev = 0; ; Prev = Node) {
46 Node = fdt_next_node (DeviceTreeBase, Prev,
NULL);
54 Type = fdt_getprop (DeviceTreeBase, Node,
"device_type", &Len);
60 RegProp = fdt_getprop (DeviceTreeBase, Node,
"reg", &Len);
61 if ((RegProp != 0) && (Len == (2 *
sizeof (UINT64)))) {
67 "%a: System RAM @ 0x%lx - 0x%lx\n",
73 if ((NewBase > CurBase) || (NewBase == 0)) {
80 "%a: Failed to parse FDT memory node\n",
93 &gArmVirtSystemMemorySizeGuid,
107 ASSERT (NewSize >= SIZE_128MB);
109 (((UINT64)
PcdGet64 (PcdFdBaseAddress) +
110 (UINT64)
PcdGet32 (PcdFdSize)) <= NewBase) ||
111 ((UINT64)
PcdGet64 (PcdFdBaseAddress) >= (NewBase + NewSize))
VOID *EFIAPI BuildGuidDataHob(IN CONST EFI_GUID *Guid, IN VOID *Data, IN UINTN DataLength)
UINT64 EFIAPI ReadUnaligned64(IN CONST UINT64 *Buffer)
INTN EFIAPI AsciiStrnCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString, IN UINTN Length)
#define DEBUG(Expression)
#define PcdGet64(TokenName)
#define FixedPcdGet64(TokenName)
#define PcdGet32(TokenName)