base-foc: comply with thread limit in core

Fiasco.OC limits the UTCB area for roottask to 16K. Therefore, the
number of threads is limited to 16K / L4_UTCB_OFFSET. (see
kernel/fiasco/src/kern/kernel_thread-std.cpp:94)
This commit is contained in:
Christian Helmuth 2015-05-05 17:38:29 +02:00
parent 6b0723b3bb
commit ec954a2278

View File

@ -43,7 +43,14 @@ static addr_t core_utcb_base() {
int Platform_pd::bind_thread(Platform_thread *thread)
{
for (unsigned i = 0; i < THREAD_MAX; i++) {
/*
* Fiasco.OC limits the UTCB area for roottask to 16K. Therefore, the
* number of threads is limited to 16K / L4_UTCB_OFFSET.
* (see kernel/fiasco/src/kern/kernel_thread-std.cpp:94)
*/
unsigned const thread_max = thread->core_thread() ? 16*1024/L4_UTCB_OFFSET : THREAD_MAX;
for (unsigned i = 0; i < thread_max; i++) {
if (_threads[i])
continue;