From 56ec0ad1726b66a80703009d5fef5e7e2b02099c Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Mon, 11 May 2015 17:54:11 +0200 Subject: [PATCH] sel4: add base.mk lib to build and link init --- repos/base-sel4/lib/mk/base.mk | 18 +++++++++++ .../src/base/env/capability_space.cc | 18 +++++------ .../base-sel4/src/base/thread/thread_init.cc | 30 +++++++++++++++++++ 3 files changed, 57 insertions(+), 9 deletions(-) create mode 100644 repos/base-sel4/lib/mk/base.mk create mode 100644 repos/base-sel4/src/base/thread/thread_init.cc diff --git a/repos/base-sel4/lib/mk/base.mk b/repos/base-sel4/lib/mk/base.mk new file mode 100644 index 000000000..7bfa6813f --- /dev/null +++ b/repos/base-sel4/lib/mk/base.mk @@ -0,0 +1,18 @@ +# +# \brief Portions of base library that are exclusive to non-core processes +# \author Norman Feske +# \date 2013-02-14 +# + +LIBS += base-common syscall + +SRC_CC += console/log_console.cc +SRC_CC += env/env.cc env/context_area.cc env/reinitialize.cc +SRC_CC += env/capability_space.cc +SRC_CC += thread/thread_start.cc thread/thread_init.cc + +INC_DIR += $(REP_DIR)/src/base +INC_DIR += $(BASE_DIR)/src/base/env + +vpath %.cc $(REP_DIR)/src/base +vpath %.cc $(BASE_DIR)/src/base diff --git a/repos/base-sel4/src/base/env/capability_space.cc b/repos/base-sel4/src/base/env/capability_space.cc index d1019937d..3c5a59a99 100644 --- a/repos/base-sel4/src/base/env/capability_space.cc +++ b/repos/base-sel4/src/base/env/capability_space.cc @@ -1,7 +1,7 @@ /* - * \brief Instance of the component's local capability space + * \brief Instance of the (Genode) capability space for non-core components * \author Norman Feske - * \date 2015-05-08 + * \date 2015-05-11 */ /* @@ -19,14 +19,12 @@ #include #include - /** * Definition of capability meta data */ struct Genode::Native_capability::Data : Capability_data { Data(Rpc_obj_key key) : Capability_data(key) { } - Data() { } }; @@ -35,13 +33,13 @@ using namespace Genode; /** - * Singleton instance of core-specific capability space + * Singleton instance of component-local capability space */ namespace { struct Local_capability_space : - Capability_space_sel4<8*1024, Native_capability::Data> + Capability_space_sel4<4*1024, 1024UL, Native_capability::Data> { }; static Local_capability_space &local_capability_space() @@ -56,12 +54,14 @@ namespace { ** Implementation of the Capability_space interface ** ******************************************************/ -Native_capability::Data &Capability_space::create_ep_cap(Thread_base &ep_thread) +Native_capability Capability_space::create_ep_cap(Thread_base &ep_thread) { unsigned const ep_sel = ep_thread.tid().ep_sel; - return local_capability_space().create_capability(ep_sel, - Rpc_obj_key()); + Native_capability::Data &data = + local_capability_space().create_capability(ep_sel, Rpc_obj_key()); + + return Native_capability(data); } diff --git a/repos/base-sel4/src/base/thread/thread_init.cc b/repos/base-sel4/src/base/thread/thread_init.cc new file mode 100644 index 000000000..51c53f5b0 --- /dev/null +++ b/repos/base-sel4/src/base/thread/thread_init.cc @@ -0,0 +1,30 @@ +/* + * \brief Implementation of Thread API interface + * \author Norman Feske + * \date 2015-05-01 + */ + +/* + * Copyright (C) 2015 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +/* Genode includes */ +#include +#include +#include + +using namespace Genode; + + +void Thread_base::_init_platform_thread(size_t, Type type) +{ + /* + * XXX initialize the 'Native_thread' structure with the thread's + * tcb_sel, ep_sel. + */ + + PDBG("not implemented"); +}