mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-16 14:18:27 +00:00
Separation of thread operations from CPU session
This patch moves the thread operations from the 'Cpu_session' to the 'Cpu_thread' interface. A noteworthy semantic change is the meaning of the former 'exception_handler' function, which used to define both, the default exception handler or a thread-specific signal handler. Now, the 'Cpu_session::exception_sigh' function defines the CPU-session-wide default handler whereas the 'Cpu_thread::exception_sigh' function defines the thread-specific one. To retain the ability to create 'Child' objects without invoking a capability, the child's initial thread must be created outside the 'Child::Process'. It is now represented by the 'Child::Initial_thread', which is passed as argument to the 'Child' constructor. Fixes #1939
This commit is contained in:
committed by
Christian Helmuth
parent
59aec6114b
commit
a99989af40
@ -21,6 +21,7 @@
|
||||
#include <base/rpc_client.h>
|
||||
#include <session/session.h>
|
||||
#include <nova_native_cpu/client.h>
|
||||
#include <cpu_thread/client.h>
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/stack.h>
|
||||
@ -164,11 +165,11 @@ void Thread::start()
|
||||
/* local thread have no start instruction pointer - set via portal entry */
|
||||
addr_t thread_ip = global ? reinterpret_cast<addr_t>(_thread_start) : 0;
|
||||
|
||||
try { _cpu_session->state(_thread_cap, state); }
|
||||
Cpu_thread_client cpu_thread(_thread_cap);
|
||||
try { cpu_thread.state(state); }
|
||||
catch (...) { throw Cpu_session::Thread_creation_failed(); }
|
||||
|
||||
if (_cpu_session->start(_thread_cap, thread_ip, _stack->top()))
|
||||
throw Cpu_session::Thread_creation_failed();
|
||||
cpu_thread.start(thread_ip, _stack->top());
|
||||
|
||||
/* request native EC thread cap */
|
||||
native_thread().ec_sel = cap_map()->insert(1);
|
||||
@ -193,7 +194,7 @@ void Thread::start()
|
||||
|
||||
if (global)
|
||||
/* request creation of SC to let thread run*/
|
||||
_cpu_session->resume(_thread_cap);
|
||||
cpu_thread.resume();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user