diff --git a/repos/base/src/core/include/region_map_component.h b/repos/base/src/core/include/region_map_component.h index 922c31ea2a..49481293f1 100644 --- a/repos/base/src/core/include/region_map_component.h +++ b/repos/base/src/core/include/region_map_component.h @@ -43,12 +43,21 @@ namespace Genode { class Cpu_thread_component; class Dataspace_component; class Region_map_component; + class Region_map_detach; class Rm_client; class Rm_region; class Rm_faulter; class Rm_session_component; } +class Genode::Region_map_detach : Genode::Interface +{ + public: + + virtual void detach(Region_map::Local_addr) = 0; + virtual void unmap_region(addr_t base, size_t size) = 0; + +}; /** * Representation of a single entry of a region map @@ -70,13 +79,13 @@ class Genode::Rm_region : public List::Element off_t const _off; Dataspace_component &_dsc; - Region_map_component &_rm; + Region_map_detach &_rm; public: Rm_region(addr_t base, size_t size, bool write, Dataspace_component &dsc, off_t offset, - Region_map_component &rm, bool exec) + Region_map_detach &rm, bool exec) : _base(base), _size(size), _write(write), _exec(exec), _off(offset), _dsc(dsc), _rm(rm) @@ -93,7 +102,7 @@ class Genode::Rm_region : public List::Element bool executable() const { return _exec; } Dataspace_component &dataspace() const { return _dsc; } off_t offset() const { return _off; } - Region_map_component &rm() const { return _rm; } + Region_map_detach &rm() const { return _rm; } }; @@ -210,7 +219,8 @@ class Genode::Rm_client : public Pager_object, public Rm_faulter, class Genode::Region_map_component : private Weak_object, public Rpc_object, - private List::Element + private List::Element, + public Region_map_detach { private: @@ -348,15 +358,15 @@ class Genode::Region_map_component : private Weak_object, */ addr_t _core_local_addr(Rm_region & r); + public: + /* * Unmaps a memory area from all address spaces referencing it. * * \param base base address of region to unmap * \param size size of region to unmap */ - void _unmap_region(addr_t base, size_t size); - - public: + void unmap_region(addr_t base, size_t size) override; /** * Constructor diff --git a/repos/base/src/core/region_map_component.cc b/repos/base/src/core/region_map_component.cc index d6dac9716b..81190f3e31 100644 --- a/repos/base/src/core/region_map_component.cc +++ b/repos/base/src/core/region_map_component.cc @@ -490,7 +490,7 @@ addr_t Region_map_component::_core_local_addr(Rm_region & region) } -void Region_map_component::_unmap_region(addr_t base, size_t size) +void Region_map_component::unmap_region(addr_t base, size_t size) { if (address_space()) address_space()->flush(base, size, { 0 }); @@ -511,7 +511,7 @@ void Region_map_component::_unmap_region(addr_t base, size_t size) /* if size is not zero, there is an overlap */ if (ds_size) - r->rm()._unmap_region(r->base() + ds_base - r->offset(), ds_size); + r->rm().unmap_region(r->base() + ds_base - r->offset(), ds_size); } } @@ -571,7 +571,7 @@ void Region_map_component::detach(Local_addr local_addr) /* * Unmap this memory region from all region maps referencing it. */ - _unmap_region(region.base(), region.size()); + unmap_region(region.base(), region.size()); } }