mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-18 23:28:29 +00:00
committed by
Christian Helmuth
parent
c4ed38cfbc
commit
9c8676b2ae
@ -164,7 +164,7 @@ class Genode::Cnode : public Cnode_base, Noncopyable
|
|||||||
create<Cnode_kobj>(untyped_pool, parent_sel, dst_idx, size_log2);
|
create<Cnode_kobj>(untyped_pool, parent_sel, dst_idx, size_log2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void destruct(Range_allocator &phys_alloc)
|
void destruct(Range_allocator &phys_alloc, bool revoke = false)
|
||||||
{
|
{
|
||||||
/* revert phys allocation */
|
/* revert phys allocation */
|
||||||
|
|
||||||
@ -173,6 +173,14 @@ class Genode::Cnode : public Cnode_base, Noncopyable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (revoke) {
|
||||||
|
int ret = seL4_CNode_Revoke(seL4_CapInitThreadCNode,
|
||||||
|
sel().value(), 32);
|
||||||
|
if (ret)
|
||||||
|
error(__PRETTY_FUNCTION__, ": seL4_CNode_Revoke (",
|
||||||
|
Hex(sel().value()), ") returned ", ret);
|
||||||
|
}
|
||||||
|
|
||||||
int ret = seL4_CNode_Delete(seL4_CapInitThreadCNode,
|
int ret = seL4_CNode_Delete(seL4_CapInitThreadCNode,
|
||||||
sel().value(), 32);
|
sel().value(), 32);
|
||||||
if (ret != seL4_NoError)
|
if (ret != seL4_NoError)
|
||||||
|
@ -196,11 +196,12 @@ Platform_pd::~Platform_pd()
|
|||||||
{
|
{
|
||||||
for (unsigned i = 0; i < sizeof(_cspace_cnode_2nd) /
|
for (unsigned i = 0; i < sizeof(_cspace_cnode_2nd) /
|
||||||
sizeof(_cspace_cnode_2nd[0]); i++) {
|
sizeof(_cspace_cnode_2nd[0]); i++) {
|
||||||
_cspace_cnode_2nd[i]->destruct(*platform()->ram_alloc());
|
_cspace_cnode_1st.remove(Cnode_index(i));
|
||||||
|
_cspace_cnode_2nd[i]->destruct(*platform()->ram_alloc(), true);
|
||||||
platform_specific()->core_sel_alloc().free(_cspace_cnode_2nd[i]->sel());
|
platform_specific()->core_sel_alloc().free(_cspace_cnode_2nd[i]->sel());
|
||||||
}
|
}
|
||||||
|
|
||||||
_cspace_cnode_1st.destruct(*platform()->ram_alloc());
|
_cspace_cnode_1st.destruct(*platform()->ram_alloc(), true);
|
||||||
platform_specific()->core_sel_alloc().free(_cspace_cnode_1st.sel());
|
platform_specific()->core_sel_alloc().free(_cspace_cnode_1st.sel());
|
||||||
|
|
||||||
/* invalidate weak pointers to this object */
|
/* invalidate weak pointers to this object */
|
||||||
|
Reference in New Issue
Block a user