sel4: handle threads in destruction

- revoke utcb
- suspend thread before destruction, less noise during destruction

Issue #2044
This commit is contained in:
Alexander Boettcher 2016-06-30 17:33:22 +02:00 committed by Christian Helmuth
parent 2aaeb8db1b
commit 73e35cdf6a
2 changed files with 11 additions and 2 deletions

View File

@ -79,7 +79,13 @@ bool Platform_pd::bind_thread(Platform_thread *thread)
void Platform_pd::unbind_thread(Platform_thread *thread)
{
PDBG("not implemented");
if (!thread)
return;
if (thread->_utcb)
_vm_space.unmap(thread->_utcb, 1);
else
_vm_space.unmap(thread->INITIAL_IPC_BUFFER_VIRT, 1);
}

View File

@ -217,7 +217,10 @@ Platform_thread::Platform_thread(size_t, const char *name, unsigned priority,
Platform_thread::~Platform_thread()
{
PDBG("not completely implemented");
if (_pd) {
seL4_TCB_Suspend(_info.tcb_sel.value());
_pd->unbind_thread(this);
}
platform_thread_registry().remove(*this);
platform_specific()->core_sel_alloc().free(_pager_obj_sel);