mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
parent
d7b88afb68
commit
75ab803ea2
@ -53,13 +53,18 @@ void Thread_base::_init_platform_thread(size_t, Type type)
|
||||
_thread_cap = _cpu_session->create_thread(0, buf);
|
||||
|
||||
/* assign thread to protection domain */
|
||||
env()->pd_session()->bind_thread(_thread_cap);
|
||||
if (!_thread_cap.valid() ||
|
||||
env()->pd_session()->bind_thread(_thread_cap))
|
||||
throw Cpu_session::Thread_creation_failed();
|
||||
return;
|
||||
}
|
||||
/* adjust values whose computation differs for a main thread */
|
||||
_tid = Fiasco::MAIN_THREAD_CAP;
|
||||
_thread_cap = env()->parent()->main_thread_cap();
|
||||
|
||||
if (!_thread_cap.valid())
|
||||
throw Cpu_session::Thread_creation_failed();
|
||||
|
||||
/* make thread object known to the Fiasco environment */
|
||||
addr_t const t = (addr_t)this;
|
||||
Fiasco::l4_utcb_tcr()->user[Fiasco::UTCB_TCR_THREAD_OBJ] = t;
|
||||
|
@ -140,7 +140,8 @@ Platform::Core_pager::Core_pager(Platform_pd *core_pd, Sigma0 *sigma0)
|
||||
{
|
||||
Platform_thread::pager(sigma0);
|
||||
|
||||
core_pd->bind_thread(this);
|
||||
if (core_pd->bind_thread(this))
|
||||
panic("Binding thread failed");
|
||||
cap(thread().local);
|
||||
|
||||
/* stack begins at the top end of the '_core_pager_stack' array */
|
||||
@ -499,7 +500,8 @@ Platform::Platform() :
|
||||
Platform_thread(thi, irqi, "core.main");
|
||||
|
||||
core_thread->pager(&_sigma0);
|
||||
_core_pd->bind_thread(core_thread);
|
||||
if (_core_pd->bind_thread(core_thread))
|
||||
panic("Binding thread failed");
|
||||
}
|
||||
|
||||
|
||||
|
@ -46,7 +46,9 @@ void Thread_base::start()
|
||||
Platform_thread *pt =
|
||||
new(platform()->core_mem_alloc()) Platform_thread(_context->name);
|
||||
|
||||
platform_specific()->core_pd()->bind_thread(pt);
|
||||
if (platform_specific()->core_pd()->bind_thread(pt))
|
||||
throw Cpu_session::Thread_creation_failed();
|
||||
|
||||
_tid = pt->gate().remote;
|
||||
_thread_cap =
|
||||
reinterpret_cap_cast<Cpu_thread>(Native_capability(pt->thread().local));
|
||||
|
Loading…
x
Reference in New Issue
Block a user