From 356526d61058d52bc1f66a8e0aac426dc9c3c411 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Tue, 2 Apr 2019 11:39:26 +0200 Subject: [PATCH] foc: increase USER_BASE_CAP due to THREAD_AREA_SLOT increase by foc/x86: implement vm_session interface Add additional static assertion check to detect misconfiguration earlier. --- repos/base-foc/include/foc/native_capability.h | 8 ++++++-- repos/base-foc/src/core/include/platform_pd.h | 7 +++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/repos/base-foc/include/foc/native_capability.h b/repos/base-foc/include/foc/native_capability.h index 09e8a3616..1da899233 100644 --- a/repos/base-foc/include/foc/native_capability.h +++ b/repos/base-foc/include/foc/native_capability.h @@ -71,10 +71,14 @@ namespace Fiasco { /********************************************************* - ** Capability seclectors controlled by the task itself ** + ** Capability selectors controlled by the task itself ** *********************************************************/ - static constexpr l4_cap_idx_t USER_BASE_CAP = 0x200UL << L4_CAP_SHIFT; + static constexpr unsigned THREAD_MAX = (1 << 7); + static constexpr l4_cap_idx_t USER_BASE_CAP = 0x300 << L4_CAP_SHIFT; + + static_assert(USER_BASE_CAP > THREAD_MAX * THREAD_AREA_SLOT, + "USER_BASE_CAP too small for supported maximal threads"); struct Capability { diff --git a/repos/base-foc/src/core/include/platform_pd.h b/repos/base-foc/src/core/include/platform_pd.h index 8fd42514d..fa0021fde 100644 --- a/repos/base-foc/src/core/include/platform_pd.h +++ b/repos/base-foc/src/core/include/platform_pd.h @@ -52,20 +52,19 @@ namespace Genode { Platform_pd &operator = (Platform_pd const &); enum { - THREAD_MAX = (1 << 7), - UTCB_AREA_SIZE = (THREAD_MAX * Fiasco::L4_UTCB_OFFSET), + UTCB_AREA_SIZE = (Fiasco::THREAD_MAX * Fiasco::L4_UTCB_OFFSET), }; addr_t utcb_area_start() { return NON_CORE_STACK_AREA_ADDR + - THREAD_MAX*stack_virtual_size(); + Fiasco::THREAD_MAX*stack_virtual_size(); } Cap_mapping _task; Cap_mapping _parent { }; Cap_mapping _debug { }; - Platform_thread *_threads[THREAD_MAX] { }; + Platform_thread *_threads[Fiasco::THREAD_MAX] { }; public: