base: fix sporadic context thread area faults

reverts 68156918ee
"base: apply thread.cc fix of foc to base"

Depending on the context area a fixed location is calculated where the
memory for the stack is attached to. If the context area is released before the
detach call, the very same context area can be reused and memory for the new
stack is attached for a new thread. The detach of the old thread would then
revoke the mapping for the new thread which will cause a un-handled page fault.

Issue #549
This commit is contained in:
Alexander Boettcher 2013-02-04 15:33:57 +01:00 committed by Norman Feske
parent 9acad80f37
commit 6c7661ed62
2 changed files with 2 additions and 2 deletions

View File

@ -164,9 +164,9 @@ void Thread_base::_free_context()
{
addr_t ds_addr = _context->stack_base - Native_config::context_area_virtual_base();
Ram_dataspace_capability ds_cap = _context->ds_cap;
_context_allocator()->free(this);
Genode::env_context_area_rm_session()->detach((void *)ds_addr);
Genode::env_context_area_ram_session()->free(ds_cap);
_context_allocator()->free(this);
}

View File

@ -163,9 +163,9 @@ void Thread_base::_free_context()
{
addr_t ds_addr = _context->stack_base - Native_config::context_area_virtual_base();
Ram_dataspace_capability ds_cap = _context->ds_cap;
_context_allocator()->free(this);
Genode::env_context_area_rm_session()->detach((void *)ds_addr);
Genode::env_context_area_ram_session()->free(ds_cap);
_context_allocator()->free(this);
}