/* Walk all memory nodes and regions */ for (offset = fdt_next_node(fdt, -1, NULL); offset >= 0;
offset = fdt_next_node(fdt, offset, NULL)) {
type = fdt_getprop(fdt, offset, "device_type", NULL); if (!type || strcmp(type, "memory")) continue;
reg = fdt_getprop(fdt, offset, "linux,usable-memory", &len); if (!reg)
reg = fdt_getprop(fdt, offset, "reg", &len); if (!reg) continue;
base = fdt32_ld(reg + addr_cells - 1);
end = base + size; if (usable) { /* *Cliptousablerange,whichtakesprecedence *overmem_start
*/ if (base < usable_base)
base = usable_base;
if (end > usable_end)
end = usable_end;
if (end <= base) continue;
} elseif (mem_start >= base && mem_start < end) { /* Calculated address is valid, use it */ return mem_start;
}
if (base < fdt_mem_start)
fdt_mem_start = base;
}
}
if (fdt_mem_start == 0xffffffff) { /* No usable memory found, falling back to default */ return mem_start;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.