base-hw mbi: do not copy Mmap MMIO objects
This commit is contained in:
parent
5366c8cf7e
commit
c5cb6cb410
|
@ -36,7 +36,7 @@ Platform::Board::Board()
|
||||||
static constexpr size_t initial_map_max = 1024 * 1024 * 1024;
|
static constexpr size_t initial_map_max = 1024 * 1024 * 1024;
|
||||||
|
|
||||||
for (unsigned i = 0; true; i++) {
|
for (unsigned i = 0; true; i++) {
|
||||||
Mmap v = Multiboot_info(__initial_bx).phys_ram(i);
|
Mmap v(Multiboot_info(__initial_bx).phys_ram_mmap_base(i));
|
||||||
if (!v.base) break;
|
if (!v.base) break;
|
||||||
|
|
||||||
Mmap::Addr::access_t base = v.read<Mmap::Addr>();
|
Mmap::Addr::access_t base = v.read<Mmap::Addr>();
|
||||||
|
|
|
@ -48,10 +48,10 @@ class Genode::Multiboot_info : Mmio
|
||||||
/**
|
/**
|
||||||
* Physical ram regions
|
* Physical ram regions
|
||||||
*/
|
*/
|
||||||
Mmap phys_ram(unsigned i, bool solely_within_4k_base = true) {
|
addr_t phys_ram_mmap_base(unsigned i, bool solely_within_4k_base = true) {
|
||||||
|
|
||||||
if (!read<Flags::Mem_map>())
|
if (!read<Flags::Mem_map>())
|
||||||
return Mmap(0);
|
return 0;
|
||||||
|
|
||||||
Mmap_length::access_t const mmap_length = read<Mmap_length>();
|
Mmap_length::access_t const mmap_length = read<Mmap_length>();
|
||||||
Mmap_addr::access_t const mmap_start = read<Mmap_addr>();
|
Mmap_addr::access_t const mmap_start = read<Mmap_addr>();
|
||||||
|
@ -63,21 +63,22 @@ class Genode::Multiboot_info : Mmio
|
||||||
|
|
||||||
if (solely_within_4k_base &&
|
if (solely_within_4k_base &&
|
||||||
(mmap + MMAP_SIZE_OF >= Genode::align_addr(base + 1, 12)))
|
(mmap + MMAP_SIZE_OF >= Genode::align_addr(base + 1, 12)))
|
||||||
return Mmap(0);
|
return 0;
|
||||||
|
|
||||||
Mmap r(mmap);
|
Mmap r(mmap);
|
||||||
|
addr_t last_mmap = mmap;
|
||||||
mmap += r.read<Mmap::Size>() + MMAP_SIZE_SIZE_OF;
|
mmap += r.read<Mmap::Size>() + MMAP_SIZE_SIZE_OF;
|
||||||
|
|
||||||
if (r.read<Mmap::Type>() != Mmap::Type::MEMORY)
|
if (r.read<Mmap::Type>() != Mmap::Type::MEMORY)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (i == j)
|
if (i == j)
|
||||||
return r;
|
return last_mmap;
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Mmap(0);
|
return 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user