From ec954a227845734da672a663e5c5802f80838a02 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Tue, 5 May 2015 17:38:29 +0200 Subject: [PATCH] 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) --- repos/base-foc/src/core/platform_pd.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/repos/base-foc/src/core/platform_pd.cc b/repos/base-foc/src/core/platform_pd.cc index 32564b88e7..52fdba1025 100644 --- a/repos/base-foc/src/core/platform_pd.cc +++ b/repos/base-foc/src/core/platform_pd.cc @@ -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;