mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 06:57:51 +00:00
parent
79ab0cf98e
commit
9a7fe5e775
repos/base-hw/src/core
@ -82,4 +82,11 @@ Core_region_map::attach(Dataspace_capability ds_cap, Attr const &attr)
|
||||
}
|
||||
|
||||
|
||||
void Core_region_map::detach(addr_t) { }
|
||||
void Core_region_map::detach(addr_t core_local_addr)
|
||||
{
|
||||
size_t size = platform_specific().region_alloc_size_at((void *)core_local_addr);
|
||||
|
||||
unmap_local(core_local_addr, size >> get_page_size_log2());
|
||||
|
||||
platform().region_alloc().free((void *)core_local_addr);
|
||||
}
|
||||
|
@ -119,6 +119,18 @@ class Core::Platform : public Platform_generic
|
||||
static addr_t core_page_table();
|
||||
static Hw::Page_table::Allocator & core_page_table_allocator();
|
||||
|
||||
/**
|
||||
* Determine size of a core local mapping required for a
|
||||
* Core_region_map::detach().
|
||||
*/
|
||||
size_t region_alloc_size_at(void * addr)
|
||||
{
|
||||
using Size_at_error = Allocator_avl::Size_at_error;
|
||||
|
||||
return (_core_mem_alloc.virt_alloc())()->size_at(addr).convert<size_t>(
|
||||
[ ] (size_t s) { return s; },
|
||||
[ ] (Size_at_error) { return 0U; });
|
||||
}
|
||||
|
||||
/********************************
|
||||
** Platform_generic interface **
|
||||
|
Loading…
Reference in New Issue
Block a user