mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 21:27:56 +00:00
parent
bc8a5cbb2a
commit
c42e770384
@ -98,6 +98,11 @@ namespace Genode {
|
||||
*/
|
||||
bool owner(Dataspace_owner * const o) const { return _owner == o; }
|
||||
|
||||
/**
|
||||
* Detach dataspace from all rm sessions.
|
||||
*/
|
||||
void detach_from_rm_sessions() { }
|
||||
|
||||
/*************************
|
||||
** Dataspace interface **
|
||||
*************************/
|
||||
|
@ -43,8 +43,6 @@ void Ram_session_component::_revoke_ram_ds(Dataspace_component *ds)
|
||||
|
||||
platform()->region_alloc()->free((void*)ds->core_local_addr(),
|
||||
page_rounded_size);
|
||||
|
||||
ds->assign_core_local_addr(0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -31,8 +31,7 @@ void Dataspace_component::detached_from(Rm_region *region)
|
||||
_regions.remove(region);
|
||||
}
|
||||
|
||||
|
||||
Dataspace_component::~Dataspace_component()
|
||||
void Dataspace_component::detach_from_rm_sessions()
|
||||
{
|
||||
_lock.lock();
|
||||
|
||||
@ -50,3 +49,8 @@ Dataspace_component::~Dataspace_component()
|
||||
|
||||
_lock.unlock();
|
||||
}
|
||||
|
||||
Dataspace_component::~Dataspace_component()
|
||||
{
|
||||
detach_from_rm_sessions();
|
||||
}
|
||||
|
@ -140,6 +140,11 @@ namespace Genode {
|
||||
void attached_to(Rm_region *region);
|
||||
void detached_from(Rm_region *region);
|
||||
|
||||
/**
|
||||
* Detach dataspace from all rm sessions.
|
||||
*/
|
||||
void detach_from_rm_sessions();
|
||||
|
||||
/**
|
||||
* Check if dataspace is owned by a specific owner
|
||||
*/
|
||||
|
@ -42,11 +42,12 @@ void Ram_session_component::_free_ds(Dataspace_component *ds)
|
||||
/* tell entry point to forget the dataspace */
|
||||
_ds_ep->dissolve(ds);
|
||||
|
||||
/* remove dataspace from all RM sessions */
|
||||
ds->detach_from_rm_sessions();
|
||||
|
||||
/* destroy native shared memory representation */
|
||||
_revoke_ram_ds(ds);
|
||||
|
||||
/* XXX: remove dataspace from all RM sessions */
|
||||
|
||||
/* free physical memory that was backing the dataspace */
|
||||
_ram_alloc->free((void *)ds->phys_addr(), ds_size);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user