mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-06 22:08:46 +00:00
parent
675aa2cd2f
commit
77bbe87dc8
@ -45,8 +45,10 @@ void Pd_session_component::map(addr_t virt, addr_t size)
|
|||||||
addr_t region_offset) -> addr_t
|
addr_t region_offset) -> addr_t
|
||||||
{
|
{
|
||||||
Dataspace_component * dsc = region ? region->dataspace() : nullptr;
|
Dataspace_component * dsc = region ? region->dataspace() : nullptr;
|
||||||
if (!dsc)
|
if (!dsc) {
|
||||||
return ~0UL;
|
struct No_dataspace{};
|
||||||
|
throw No_dataspace();
|
||||||
|
}
|
||||||
|
|
||||||
Mapping mapping = Region_map_component::create_map_item(region_map,
|
Mapping mapping = Region_map_component::create_map_item(region_map,
|
||||||
region,
|
region,
|
||||||
@ -87,9 +89,13 @@ void Pd_session_component::map(addr_t virt, addr_t size)
|
|||||||
return mapped;
|
return mapped;
|
||||||
};
|
};
|
||||||
|
|
||||||
while (size) {
|
try {
|
||||||
addr_t mapped = _address_space.apply_to_dataspace(virt, lambda);
|
while (size) {
|
||||||
virt += mapped;
|
addr_t mapped = _address_space.apply_to_dataspace(virt, lambda);
|
||||||
size = size < mapped ? size : size - mapped;
|
virt += mapped;
|
||||||
|
size = size < mapped ? size : size - mapped;
|
||||||
|
}
|
||||||
|
} catch (...) {
|
||||||
|
error(__func__, " failed ", Hex(virt), "+", Hex(size));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user