mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-05 00:50:54 +00:00
parent
5f0843082a
commit
ed9c4f4427
@ -352,32 +352,31 @@ void Thread::_call_start_thread()
|
|||||||
{
|
{
|
||||||
/* check permissions */
|
/* check permissions */
|
||||||
if (!_core()) {
|
if (!_core()) {
|
||||||
PERR("not entitled to start thread");
|
PERR("permission denied");
|
||||||
user_arg_0(0);
|
user_arg_0(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* dispatch arguments */
|
|
||||||
unsigned const thread_id = user_arg_1();
|
|
||||||
unsigned const cpu_id = user_arg_2();
|
|
||||||
unsigned const pd_id = user_arg_3();
|
|
||||||
Native_utcb * const utcb = (Native_utcb *)user_arg_4();
|
|
||||||
|
|
||||||
/* lookup targeted thread */
|
/* lookup targeted thread */
|
||||||
Thread * const t = Thread::pool()->object(thread_id);
|
unsigned const thread_id = user_arg_1();
|
||||||
if (!t) {
|
Thread * const thread = Thread::pool()->object(thread_id);
|
||||||
|
if (!thread) {
|
||||||
PERR("unknown thread");
|
PERR("unknown thread");
|
||||||
user_arg_0(0);
|
user_arg_0(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*
|
/* lookup targeted processor */
|
||||||
* Start thread
|
unsigned const processor_id = user_arg_2();
|
||||||
*
|
Processor * const processor = processor_pool()->select(processor_id);
|
||||||
* FIXME: The affinity of a thread is ignored by now.
|
if (!processor) {
|
||||||
* Instead we always assign the primary processor.
|
PERR("unknown processor");
|
||||||
*/
|
user_arg_0(0);
|
||||||
if (cpu_id) { PERR("multiprocessing not supported"); }
|
return;
|
||||||
t->init(processor_pool()->primary(), pd_id, utcb, 1);
|
}
|
||||||
user_arg_0((Call_ret)t->_pd->tlb());
|
/* start thread */
|
||||||
|
unsigned const pd_id = user_arg_3();
|
||||||
|
Native_utcb * const utcb = (Native_utcb *)user_arg_4();
|
||||||
|
thread->init(processor, pd_id, utcb, 1);
|
||||||
|
user_arg_0((Call_ret)thread->_pd->tlb());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user