From 2316937e582114b36299acb15070a6bedf0a0fff Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Wed, 2 Dec 2015 14:13:01 +0100 Subject: [PATCH] hw: remove main thread's initial UTCB from vm area The main thread's UTCB, used during bootstrap of the main thread before it allocates its context area, needs to be outside the virtual memory area controlled by the RM session, because it is needed before the main thread can access its RM session. Fix #1804 --- repos/base-hw/include/base/native_types.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/repos/base-hw/include/base/native_types.h b/repos/base-hw/include/base/native_types.h index 30fff4e9c..c6fe26031 100644 --- a/repos/base-hw/include/base/native_types.h +++ b/repos/base-hw/include/base/native_types.h @@ -186,14 +186,16 @@ class Genode::Native_utcb namespace Genode { static constexpr addr_t VIRT_ADDR_SPACE_START = 0x1000; - static constexpr size_t VIRT_ADDR_SPACE_SIZE = 0xfffef000; + static constexpr size_t VIRT_ADDR_SPACE_SIZE = 0xfffee000; - static constexpr Native_utcb * utcb_main_thread() - { - return (Native_utcb *) - ((VIRT_ADDR_SPACE_START + VIRT_ADDR_SPACE_SIZE - sizeof(Native_utcb)) - & ~(get_page_size() - 1)); - } + /** + * The main thread's UTCB, used during bootstrap of the main thread before it + * allocates its context area, needs to be outside the virtual memory area + * controlled by the RM session, because it is needed before the main + * thread can access its RM session. + */ + static constexpr Native_utcb * utcb_main_thread() { + return (Native_utcb *) (VIRT_ADDR_SPACE_START + VIRT_ADDR_SPACE_SIZE); } } #endif /* _BASE__NATIVE_TYPES_H_ */