From f9ba60e501b9f7d8cd2fb89f01df28b0f4cf5d1d Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Tue, 12 Feb 2013 17:33:08 +0100 Subject: [PATCH] foc: Make context area configurable in core Make 'context_area_virtual_base' platform configurable. On Arndale, we need to move the context area to a location that does not interfere with the address range of physical memory. --- base-foc/include/base/native_types.h | 4 ++-- base-foc/lib/mk/base.mk | 2 +- base-foc/src/base/thread/thread_context_area.cc | 11 +++++++++++ base-foc/src/core/arndale/target.mk | 6 +++++- base-foc/src/core/arndale/thread_context_area.cc | 15 +++++++++++++++ base-foc/src/core/target.inc | 2 ++ 6 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 base-foc/src/base/thread/thread_context_area.cc create mode 100644 base-foc/src/core/arndale/thread_context_area.cc diff --git a/base-foc/include/base/native_types.h b/base-foc/include/base/native_types.h index 6b55694e8..2b0f522f0 100644 --- a/base-foc/include/base/native_types.h +++ b/base-foc/include/base/native_types.h @@ -150,9 +150,9 @@ namespace Genode { struct Native_config { /** - * Thread-context area configuration. + * Thread-context area configuration */ - static addr_t context_area_virtual_base() { return 0x40000000UL; } + static addr_t context_area_virtual_base(); static addr_t context_area_virtual_size() { return 0x10000000UL; } /** diff --git a/base-foc/lib/mk/base.mk b/base-foc/lib/mk/base.mk index 8f0a09bb4..915c86331 100644 --- a/base-foc/lib/mk/base.mk +++ b/base-foc/lib/mk/base.mk @@ -9,7 +9,7 @@ LIBS += base-common SRC_CC += console/log_console.cc SRC_CC += env/env.cc env/context_area.cc env/reload_parent_cap.cc \ env/cap_map_remove.cc env/cap_alloc.cc -SRC_CC += thread/thread_start.cc +SRC_CC += thread/thread_start.cc thread/thread_context_area.cc INC_DIR += $(BASE_DIR)/src/base/env diff --git a/base-foc/src/base/thread/thread_context_area.cc b/base-foc/src/base/thread/thread_context_area.cc new file mode 100644 index 000000000..2597172ab --- /dev/null +++ b/base-foc/src/base/thread/thread_context_area.cc @@ -0,0 +1,11 @@ +/* + * \brief Generic definitions for the location of the thread-context area + * \author Sebastian Sumpf + * \date 2013-02-12 + */ + +#include + +using namespace Genode; + +addr_t Native_config::context_area_virtual_base() { return 0x40000000UL; } diff --git a/base-foc/src/core/arndale/target.mk b/base-foc/src/core/arndale/target.mk index 6a182a0b0..311153b2c 100644 --- a/base-foc/src/core/arndale/target.mk +++ b/base-foc/src/core/arndale/target.mk @@ -1,3 +1,8 @@ +vpath platform_services.cc $(GEN_CORE_DIR) + +# override default location of thread context area within core +vpath thread_context_area.cc $(PRG_DIR) + include $(PRG_DIR)/../target.inc LD_TEXT_ADDR = 0x80100000 @@ -6,4 +11,3 @@ REQUIRES += arm foc_arndale SRC_CC += arm/platform_arm.cc INC_DIR += $(REP_DIR)/src/core/include/arm -vpath platform_services.cc $(GEN_CORE_DIR) diff --git a/base-foc/src/core/arndale/thread_context_area.cc b/base-foc/src/core/arndale/thread_context_area.cc new file mode 100644 index 000000000..b9c7c2772 --- /dev/null +++ b/base-foc/src/core/arndale/thread_context_area.cc @@ -0,0 +1,15 @@ +/* + * \brief Arndale specific definition of the context area location + * \author Sebastian Sumpf + * \date 2013-02-12 + * + * We need to place the context area within core outside the physical memory. + * Sigma0 maps physical to core-local memory always 1:1 when using + * SIGMA0_REQ_FPAGE_ANY. Those mappings would interfere with the context area. + */ + +#include + +using namespace Genode; + +addr_t Native_config::context_area_virtual_base() { return 0x20000000UL; } diff --git a/base-foc/src/core/target.inc b/base-foc/src/core/target.inc index e3a73f24e..8767aadc2 100644 --- a/base-foc/src/core/target.inc +++ b/base-foc/src/core/target.inc @@ -32,6 +32,7 @@ SRC_CC = cap_session_component.cc \ signal_session_component.cc \ signal_source_component.cc \ thread_start.cc \ + thread_context_area.cc \ core_printf.cc INC_DIR += $(REP_DIR)/src/core/include \ @@ -55,3 +56,4 @@ vpath rom_session_component.cc $(GEN_CORE_DIR) vpath signal_session_component.cc $(GEN_CORE_DIR) vpath core_printf.cc $(BASE_DIR)/src/base/console vpath %.cc $(REP_DIR)/src/core +vpath %.cc $(REP_DIR)/src/base/thread