diff --git a/src/fdt.rs b/src/fdt.rs index b823c555..00d485d0 100644 --- a/src/fdt.rs +++ b/src/fdt.rs @@ -78,11 +78,15 @@ impl Info for StartInfo<'_> { } fn num_entries(&self) -> usize { - self.fdt.memory().regions().count() + let nodes = self.fdt.find_all_nodes("/memory"); + let regions = nodes.flat_map(|n| n.reg().unwrap()); + regions.count() } fn entry(&self, idx: usize) -> MemoryEntry { - for (i, region) in self.fdt.memory().regions().enumerate() { + let nodes = self.fdt.find_all_nodes("/memory"); + let regions = nodes.flat_map(|n| n.reg().unwrap()); + for (i, region) in regions.enumerate() { if i == idx { return MemoryEntry { addr: region.starting_address as u64,