From 633f33517135c668560edc68bc57865a61c1576c Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Fri, 1 May 2015 20:03:08 +0200 Subject: [PATCH] sel4: core skeleton --- repos/base-sel4/run/core.run | 9 ++ repos/base-sel4/src/core/core_rm_session.cc | 33 ++++ .../base-sel4/src/core/cpu_session_support.cc | 30 ++++ .../src/core/include/core_rm_session.h | 52 +++++++ repos/base-sel4/src/core/include/map_local.h | 51 +++++++ repos/base-sel4/src/core/include/platform.h | 72 +++++++++ .../base-sel4/src/core/include/platform_pd.h | 71 +++++++++ .../src/core/include/platform_thread.h | 144 ++++++++++++++++++ repos/base-sel4/src/core/include/util.h | 43 ++++++ .../src/core/io_mem_session_support.cc | 26 ++++ .../src/core/irq_session_component.cc | 95 ++++++++++++ repos/base-sel4/src/core/platform.cc | 96 ++++++++++++ repos/base-sel4/src/core/platform_pd.cc | 48 ++++++ repos/base-sel4/src/core/platform_thread.cc | 78 ++++++++++ .../base-sel4/src/core/ram_session_support.cc | 32 ++++ .../base-sel4/src/core/rm_session_support.cc | 23 +++ repos/base-sel4/src/core/target.inc | 58 +++++++ repos/base-sel4/src/core/target.mk | 1 + repos/base-sel4/src/core/thread_start.cc | 56 +++++++ 19 files changed, 1018 insertions(+) create mode 100644 repos/base-sel4/run/core.run create mode 100644 repos/base-sel4/src/core/core_rm_session.cc create mode 100644 repos/base-sel4/src/core/cpu_session_support.cc create mode 100644 repos/base-sel4/src/core/include/core_rm_session.h create mode 100644 repos/base-sel4/src/core/include/map_local.h create mode 100644 repos/base-sel4/src/core/include/platform.h create mode 100644 repos/base-sel4/src/core/include/platform_pd.h create mode 100644 repos/base-sel4/src/core/include/platform_thread.h create mode 100644 repos/base-sel4/src/core/include/util.h create mode 100644 repos/base-sel4/src/core/io_mem_session_support.cc create mode 100644 repos/base-sel4/src/core/irq_session_component.cc create mode 100644 repos/base-sel4/src/core/platform.cc create mode 100644 repos/base-sel4/src/core/platform_pd.cc create mode 100644 repos/base-sel4/src/core/platform_thread.cc create mode 100644 repos/base-sel4/src/core/ram_session_support.cc create mode 100644 repos/base-sel4/src/core/rm_session_support.cc create mode 100644 repos/base-sel4/src/core/target.inc create mode 100644 repos/base-sel4/src/core/target.mk create mode 100644 repos/base-sel4/src/core/thread_start.cc diff --git a/repos/base-sel4/run/core.run b/repos/base-sel4/run/core.run new file mode 100644 index 0000000000..547fac2b23 --- /dev/null +++ b/repos/base-sel4/run/core.run @@ -0,0 +1,9 @@ +build { core } + +create_boot_directory + +build_boot_image "core" + +append qemu_args " -nographic -m 64 " + +run_genode_until forever diff --git a/repos/base-sel4/src/core/core_rm_session.cc b/repos/base-sel4/src/core/core_rm_session.cc new file mode 100644 index 0000000000..3ecdeb7577 --- /dev/null +++ b/repos/base-sel4/src/core/core_rm_session.cc @@ -0,0 +1,33 @@ +/* + * \brief Core-local RM session + * \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 + +/* core includes */ +#include +#include +#include + +using namespace Genode; + + +Rm_session::Local_addr +Core_rm_session::attach(Dataspace_capability ds_cap, size_t size, + off_t offset, bool use_local_addr, + Rm_session::Local_addr local_addr, + bool executable) +{ + PDBG("not implemented"); + return 0; +} diff --git a/repos/base-sel4/src/core/cpu_session_support.cc b/repos/base-sel4/src/core/cpu_session_support.cc new file mode 100644 index 0000000000..9a7f732e20 --- /dev/null +++ b/repos/base-sel4/src/core/cpu_session_support.cc @@ -0,0 +1,30 @@ +/* + * \brief Platform-specific parts of cores CPU-service + * \author Martin Stein + * \date 2012-04-17 + */ + +/* + * Copyright (C) 2009-2013 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 + +/* Core includes */ +#include + +using namespace Genode; + + +Ram_dataspace_capability Cpu_session_component::utcb(Thread_capability) +{ + PDBG("not implemented"); + return Ram_dataspace_capability(); +} + + +Cpu_session::Quota Cpu_session_component::quota() { return Quota(); } diff --git a/repos/base-sel4/src/core/include/core_rm_session.h b/repos/base-sel4/src/core/include/core_rm_session.h new file mode 100644 index 0000000000..79a7f10be2 --- /dev/null +++ b/repos/base-sel4/src/core/include/core_rm_session.h @@ -0,0 +1,52 @@ +/* + * \brief Core-local RM session + * \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. + */ + +#ifndef _CORE__INCLUDE__CORE_RM_SESSION_H_ +#define _CORE__INCLUDE__CORE_RM_SESSION_H_ + +/* Genode includes */ +#include +#include + +/* core includes */ +#include + +namespace Genode { class Core_rm_session; } + + +class Genode::Core_rm_session : public Rm_session +{ + public: + + Core_rm_session(Rpc_entrypoint *) { } + + Local_addr attach(Dataspace_capability ds_cap, size_t size = 0, + off_t offset = 0, bool use_local_addr = false, + Local_addr local_addr = 0, + bool executable = false) override; + + void detach(Local_addr) override { PDBG("not implemented"); } + + Pager_capability add_client(Thread_capability) override { + return Pager_capability(); } + + void remove_client(Pager_capability) override { } + + void fault_handler(Signal_context_capability) override { } + + State state() override { return State(); } + + Dataspace_capability dataspace() override { return Dataspace_capability(); } +}; + +#endif /* _CORE__INCLUDE__CORE_RM_SESSION_H_ */ diff --git a/repos/base-sel4/src/core/include/map_local.h b/repos/base-sel4/src/core/include/map_local.h new file mode 100644 index 0000000000..c5f6b1e0ce --- /dev/null +++ b/repos/base-sel4/src/core/include/map_local.h @@ -0,0 +1,51 @@ +/* + * \brief Core-local memory mapping + * \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. + */ + +#ifndef _CORE__INCLUDE__MAP_LOCAL_H_ +#define _CORE__INCLUDE__MAP_LOCAL_H_ + +/* Genode includes */ +#include + +/* core includes */ +#include + + +namespace Genode { + + /** + * Map physical pages to core-local virtual address range + * + * \param from_phys physical source address + * \param to_virt core-local destination address + * \param num_pages number of pages to map + * + * \return true on success + */ + inline bool map_local(addr_t from_phys, addr_t to_virt, size_t num_pages) + { + PDBG("not implemented"); + + return false; + } + + + inline bool unmap_local(addr_t virt_addr, size_t num_pages) + { + PDBG("not implemented"); + + return false; + } +} + +#endif /* _CORE__INCLUDE__MAP_LOCAL_H_ */ diff --git a/repos/base-sel4/src/core/include/platform.h b/repos/base-sel4/src/core/include/platform.h new file mode 100644 index 0000000000..6a9e6e02ae --- /dev/null +++ b/repos/base-sel4/src/core/include/platform.h @@ -0,0 +1,72 @@ +/* + * \brief Platform 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. + */ + +#ifndef _CORE__INCLUDE__PLATFORM_H_ +#define _CORE__INCLUDE__PLATFORM_H_ + +/* Genode includes */ +#include + +/* local includes */ +#include +#include + +namespace Genode { class Platform; } + + +class Genode::Platform : public Platform_generic +{ + private: + + typedef Core_mem_allocator::Phys_allocator Phys_allocator; + + Core_mem_allocator _core_mem_alloc; /* core-accessible memory */ + Phys_allocator _io_mem_alloc; /* MMIO allocator */ + Phys_allocator _io_port_alloc; /* I/O port allocator */ + Phys_allocator _irq_alloc; /* IRQ allocator */ + Rom_fs _rom_fs; /* ROM file system */ + + /** + * Virtual address range usable by non-core processes + */ + addr_t _vm_base; + size_t _vm_size; + + int _init_rom_fs(); + + public: + + /** + * Constructor + */ + Platform(); + + + /******************************** + ** Generic platform interface ** + ********************************/ + + Range_allocator *ram_alloc() { return _core_mem_alloc.phys_alloc(); } + Range_allocator *io_mem_alloc() { return &_io_mem_alloc; } + Range_allocator *io_port_alloc() { return &_io_port_alloc; } + Range_allocator *irq_alloc() { return &_irq_alloc; } + Range_allocator *region_alloc() { return _core_mem_alloc.virt_alloc(); } + Range_allocator *core_mem_alloc() { return &_core_mem_alloc; } + addr_t vm_start() const { return _vm_base; } + size_t vm_size() const { return _vm_size; } + Rom_fs *rom_fs() { return &_rom_fs; } + + void wait_for_exit(); +}; + +#endif /* _CORE__INCLUDE__PLATFORM_H_ */ diff --git a/repos/base-sel4/src/core/include/platform_pd.h b/repos/base-sel4/src/core/include/platform_pd.h new file mode 100644 index 0000000000..9cfd131f13 --- /dev/null +++ b/repos/base-sel4/src/core/include/platform_pd.h @@ -0,0 +1,71 @@ +/* + * \brief Protection-domain facility + * \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. + */ + +#ifndef _CORE__INCLUDE__PLATFORM_PD_H_ +#define _CORE__INCLUDE__PLATFORM_PD_H_ + +/* Genode includes */ +#include + +/* core includes */ +#include +#include + + +namespace Genode { class Platform_pd; } + + +class Genode::Platform_pd : public Address_space +{ + public: + + /** + * Constructors + */ + Platform_pd(Allocator * md_alloc, size_t ram_quota, + char const *, signed pd_id = -1, bool create = true); + + /** + * Destructor + */ + ~Platform_pd(); + + /** + * Bind thread to protection domain + * + * \return 0 on success or + * -1 if thread ID allocation failed. + */ + int bind_thread(Platform_thread *thread); + + /** + * Unbind thread from protection domain + * + * Free the thread's slot and update thread object. + */ + void unbind_thread(Platform_thread *thread); + + /** + * Assign parent interface to protection domain + */ + int assign_parent(Native_capability parent) { return 0; } + + + /***************************** + ** Address-space interface ** + *****************************/ + + void flush(addr_t, size_t) { PDBG("not implemented"); } +}; + +#endif /* _CORE__INCLUDE__PLATFORM_PD_H_ */ diff --git a/repos/base-sel4/src/core/include/platform_thread.h b/repos/base-sel4/src/core/include/platform_thread.h new file mode 100644 index 0000000000..436f46347e --- /dev/null +++ b/repos/base-sel4/src/core/include/platform_thread.h @@ -0,0 +1,144 @@ +/* + * \brief Thread facility + * \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. + */ + +#ifndef _CORE__INCLUDE__PLATFORM_THREAD_H_ +#define _CORE__INCLUDE__PLATFORM_THREAD_H_ + +/* Genode includes */ +#include +#include +#include + +/* core includes */ +#include + +namespace Genode { + + class Platform_pd; + class Platform_thread; +} + + + +class Genode::Platform_thread +{ + private: + + Pager_object *_pager = nullptr; + + Weak_ptr _address_space; + + friend class Platform_pd; + + public: + + /** + * Constructor + */ + Platform_thread(size_t, const char *name = 0, unsigned priority = 0, + addr_t utcb = 0); + + /** + * Destructor + */ + ~Platform_thread(); + + /** + * Start thread + * + * \param ip instruction pointer to start at + * \param sp stack pointer to use + * \param cpu_no target cpu + * + * \retval 0 successful + * \retval -1 thread could not be started + */ + int start(void *ip, void *sp, unsigned int cpu_no = 0); + + /** + * Pause this thread + */ + void pause(); + + /** + * Resume this thread + */ + void resume(); + + /** + * Cancel currently blocking operation + */ + void cancel_blocking(); + + /** + * Override thread state with 's' + * + * \throw Cpu_session::State_access_failed + */ + void state(Thread_state s); + + /** + * Read thread state + * + * \throw Cpu_session::State_access_failed + */ + Thread_state state(); + + /** + * Return the address space to which the thread is bound + */ + Weak_ptr address_space(); + + + /************************ + ** Accessor functions ** + ************************/ + + /** + * Set pager capability + */ + Pager_object *pager(Pager_object *pager) const { return _pager; } + void pager(Pager_object *pager) { _pager = pager; } + Pager_object *pager() { return _pager; } + + /** + * Return identification of thread when faulting + */ + unsigned long pager_object_badge() const + { + PDBG("not implemented"); + return 0; + } + + /** + * Set the executing CPU for this thread + */ + void affinity(Affinity::Location) { } + + /** + * Get the executing CPU for this thread + */ + Affinity::Location affinity() { return Affinity::Location(); } + + /** + * Set CPU quota of the thread + */ + void quota(size_t) { /* not supported */ } + + /** + * Get thread name + */ + const char *name() const { return "noname"; } +}; + +#endif /* _CORE__INCLUDE__PLATFORM_THREAD_H_ */ diff --git a/repos/base-sel4/src/core/include/util.h b/repos/base-sel4/src/core/include/util.h new file mode 100644 index 0000000000..66c61b0e6c --- /dev/null +++ b/repos/base-sel4/src/core/include/util.h @@ -0,0 +1,43 @@ +/* + * \brief Core-internal utilities + * \author Norman Feske + * \date 2009-10-02 + */ + +/* + * Copyright (C) 2009-2013 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. + */ + +#ifndef _CORE__INCLUDE__UTIL_H_ +#define _CORE__INCLUDE__UTIL_H_ + +/* Genode includes */ +#include +#include + +namespace Genode { + + constexpr size_t get_page_size_log2() { return 12; } + constexpr size_t get_page_size() { return 1 << get_page_size_log2(); } + constexpr addr_t get_page_mask() { return ~(get_page_size() - 1); } + inline addr_t trunc_page(addr_t addr) { return addr & get_page_mask(); } + inline addr_t round_page(addr_t addr) { return trunc_page(addr + get_page_size() - 1); } + + inline addr_t map_src_addr(addr_t core_local, addr_t phys) { return phys; } + inline size_t constrain_map_size_log2(size_t size_log2) { return get_page_size_log2(); } + + inline void print_page_fault(const char *msg, addr_t pf_addr, addr_t pf_ip, + Rm_session::Fault_type pf_type, + unsigned long faulter_badge) + { + printf("%s (%s pf_addr=%p pf_ip=%p from %02lx)\n", msg, + pf_type == Rm_session::WRITE_FAULT ? "WRITE" : "READ", + (void *)pf_addr, (void *)pf_ip, + faulter_badge); + } +} + +#endif /* _CORE__INCLUDE__UTIL_H_ */ diff --git a/repos/base-sel4/src/core/io_mem_session_support.cc b/repos/base-sel4/src/core/io_mem_session_support.cc new file mode 100644 index 0000000000..7e8c8aba94 --- /dev/null +++ b/repos/base-sel4/src/core/io_mem_session_support.cc @@ -0,0 +1,26 @@ +/* + * \brief Implementation of the IO_MEM session 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. + */ + +/* core includes */ +#include + + +using namespace Genode; + + +void Io_mem_session_component::_unmap_local(addr_t base, size_t size) +{ } + + +addr_t Io_mem_session_component::_map_local(addr_t base, size_t size) +{ return 0; } diff --git a/repos/base-sel4/src/core/irq_session_component.cc b/repos/base-sel4/src/core/irq_session_component.cc new file mode 100644 index 0000000000..d9aaa1edb7 --- /dev/null +++ b/repos/base-sel4/src/core/irq_session_component.cc @@ -0,0 +1,95 @@ +/* + * \brief Implementation of IRQ session component + * \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 + +/* core includes */ +#include + + +using namespace Genode; + + +bool Irq_object::_associate() { return true; } + + +void Irq_object::_wait_for_irq() +{ + PDBG("not implemented"); +} + + +void Irq_object::start() +{ + PDBG("not implemented"); +} + + +void Irq_object::entry() +{ + PDBG("not implemented"); +} + + +Irq_object::Irq_object(unsigned irq) +: + Thread<4096>("irq"), + _sync_ack(Lock::LOCKED), _sync_bootup(Lock::LOCKED), + _irq(irq) +{ } + + +Irq_session_component::Irq_session_component(Range_allocator *irq_alloc, + const char *args) +: + _irq_number(Arg_string::find_arg(args, "irq_number").long_value(-1)), + _irq_alloc(irq_alloc), + _irq_object(_irq_number) +{ + long msi = Arg_string::find_arg(args, "device_config_phys").long_value(0); + if (msi) + throw Root::Unavailable(); + + if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).is_error()) { + PERR("Unavailable IRQ 0x%x requested", _irq_number); + throw Root::Unavailable(); + } + + _irq_object.start(); +} + + +Irq_session_component::~Irq_session_component() +{ + PERR("Not yet implemented."); +} + + +void Irq_session_component::ack_irq() +{ + _irq_object.ack_irq(); +} + + +void Irq_session_component::sigh(Genode::Signal_context_capability cap) +{ + _irq_object.sigh(cap); +} + + +Genode::Irq_session::Info Irq_session_component::info() +{ + /* no MSI support */ + return { .type = Genode::Irq_session::Info::Type::INVALID }; +} diff --git a/repos/base-sel4/src/core/platform.cc b/repos/base-sel4/src/core/platform.cc new file mode 100644 index 0000000000..97309b9112 --- /dev/null +++ b/repos/base-sel4/src/core/platform.cc @@ -0,0 +1,96 @@ +/* + * \brief Platform interface implementation + * \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 + +/* core includes */ +#include +#include +#include + +using namespace Genode; + +static bool const verbose_boot_info = true; + + +/* + * Memory-layout information provided by the linker script + */ + +/* virtual address range consumed by core's program image */ +extern unsigned _prog_img_beg, _prog_img_end; + + +/**************************************** + ** Support for core memory management ** + ****************************************/ + +bool Core_mem_allocator::Mapped_mem_allocator::_map_local(addr_t virt_addr, + addr_t phys_addr, + unsigned size) +{ + return map_local(phys_addr, virt_addr, size / get_page_size()); +} + + +bool Core_mem_allocator::Mapped_mem_allocator::_unmap_local(addr_t virt_addr, + unsigned size) +{ + return unmap_local(virt_addr, size / get_page_size()); +} + + +/************************ + ** Platform interface ** + ************************/ + +Platform::Platform() : + _io_mem_alloc(core_mem_alloc()), _io_port_alloc(core_mem_alloc()), + _irq_alloc(core_mem_alloc()), _vm_base(0), _vm_size(0) +{ + /* initialize core allocators */ + + /* remove core image from core's virtual address allocator */ + + /* preserve context area in core's virtual address space */ + + /* remove used core memory from physical memory allocator */ + + /* add boot modules to ROM fs */ + + /* initialize interrupt allocator */ + _irq_alloc.add_range(0, 255); + + /* + * Print statistics about allocator initialization + */ + printf("VM area at [%08lx,%08lx)\n", _vm_base, _vm_base + _vm_size); + + if (verbose_boot_info) { + printf(":phys_alloc: "); _core_mem_alloc.phys_alloc()->raw()->dump_addr_tree(); + printf(":virt_alloc: "); _core_mem_alloc.virt_alloc()->raw()->dump_addr_tree(); + printf(":io_mem_alloc: "); _io_mem_alloc.raw()->dump_addr_tree(); + } +} + + +void Platform::wait_for_exit() +{ + sleep_forever(); +} + + +void Core_parent::exit(int exit_value) { } diff --git a/repos/base-sel4/src/core/platform_pd.cc b/repos/base-sel4/src/core/platform_pd.cc new file mode 100644 index 0000000000..e276e2feb3 --- /dev/null +++ b/repos/base-sel4/src/core/platform_pd.cc @@ -0,0 +1,48 @@ +/* + * \brief Protection-domain facility + * \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 + +/* core includes */ +#include +#include +#include + +using namespace Genode; + + +int Platform_pd::bind_thread(Platform_thread *thread) +{ + PDBG("not implemented"); + return 0; +} + + +void Platform_pd::unbind_thread(Platform_thread *thread) +{ + PDBG("not implemented"); +} + + +Platform_pd::Platform_pd(Allocator * md_alloc, size_t ram_quota, + char const *, signed pd_id, bool create) +{ + PDBG("not implemented"); +} + + +Platform_pd::~Platform_pd() +{ + PWRN("not implemented"); +} diff --git a/repos/base-sel4/src/core/platform_thread.cc b/repos/base-sel4/src/core/platform_thread.cc new file mode 100644 index 0000000000..ae24e10a17 --- /dev/null +++ b/repos/base-sel4/src/core/platform_thread.cc @@ -0,0 +1,78 @@ +/* + * \brief Thread facility + * \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 + +/* core includes */ +#include + +using namespace Genode; + + +int Platform_thread::start(void *ip, void *sp, unsigned int cpu_no) +{ + PDBG("not implemented"); + return 0; +} + + +void Platform_thread::pause() +{ + PDBG("not implemented"); +} + + +void Platform_thread::resume() +{ + PDBG("not implemented"); +} + + +void Platform_thread::state(Thread_state s) +{ + PDBG("Not implemented"); + throw Cpu_session::State_access_failed(); +} + + +Thread_state Platform_thread::state() +{ + PDBG("Not implemented"); + throw Cpu_session::State_access_failed(); +} + + +void Platform_thread::cancel_blocking() +{ + PDBG("not implemented"); +} + + +Weak_ptr Platform_thread::address_space() +{ + return _address_space; +} + + +Platform_thread::Platform_thread(size_t, const char *name, unsigned, addr_t) +{ + PDBG("not implemented"); +} + + +Platform_thread::~Platform_thread() +{ + PDBG("not implemented"); +} diff --git a/repos/base-sel4/src/core/ram_session_support.cc b/repos/base-sel4/src/core/ram_session_support.cc new file mode 100644 index 0000000000..cda7a35ead --- /dev/null +++ b/repos/base-sel4/src/core/ram_session_support.cc @@ -0,0 +1,32 @@ +/* + * \brief Export and initialize RAM dataspace + * \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 + +/* core includes */ +#include +#include +#include + + +using namespace Genode; + +void Ram_session_component::_export_ram_ds(Dataspace_component *ds) { } +void Ram_session_component::_revoke_ram_ds(Dataspace_component *ds) { } + + +void Ram_session_component::_clear_ds (Dataspace_component *ds) +{ + PDBG("not implemented"); +} diff --git a/repos/base-sel4/src/core/rm_session_support.cc b/repos/base-sel4/src/core/rm_session_support.cc new file mode 100644 index 0000000000..5bca8c263d --- /dev/null +++ b/repos/base-sel4/src/core/rm_session_support.cc @@ -0,0 +1,23 @@ +/* + * \brief Kernel-specific supplements of the RM service + * \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. + */ + +/* core includes */ +#include + +using namespace Genode; + + +void Rm_client::unmap(addr_t core_local_base, addr_t virt_base, size_t size) +{ + PDBG("not implemented"); +} diff --git a/repos/base-sel4/src/core/target.inc b/repos/base-sel4/src/core/target.inc new file mode 100644 index 0000000000..a0c5a30433 --- /dev/null +++ b/repos/base-sel4/src/core/target.inc @@ -0,0 +1,58 @@ +TARGET = core + +GEN_CORE_DIR = $(BASE_DIR)/src/core + +SRC_CC += \ + main.cc \ + ram_session_component.cc \ + ram_session_support.cc \ + rom_session_component.cc \ + cap_session_component.cc \ + cpu_session_component.cc \ + cpu_session_support.cc \ + pd_session_component.cc \ + io_mem_session_component.cc \ + io_mem_session_support.cc \ + thread_start.cc \ + platform_thread.cc \ + platform_pd.cc \ + platform_services.cc \ + platform.cc \ + dataspace_component.cc \ + rm_session_component.cc \ + rm_session_support.cc \ + irq_session_component.cc \ + signal_session_component.cc \ + signal_source_component.cc \ + trace_session_component.cc \ + core_rm_session.cc \ + core_mem_alloc.cc \ + dump_alloc.cc \ + context_area.cc + +LIBS += core_printf base-common syscall + +INC_DIR += $(REP_DIR)/src/core/include \ + $(GEN_CORE_DIR)/include \ + $(BASE_DIR)/src/base/thread + +include $(GEN_CORE_DIR)/version.inc + +vpath main.cc $(GEN_CORE_DIR) +vpath ram_session_component.cc $(GEN_CORE_DIR) +vpath rom_session_component.cc $(GEN_CORE_DIR) +vpath cap_session_component.cc $(GEN_CORE_DIR) +vpath cpu_session_component.cc $(GEN_CORE_DIR) +vpath pd_session_component.cc $(GEN_CORE_DIR) +vpath rm_session_component.cc $(GEN_CORE_DIR) +vpath io_mem_session_component.cc $(GEN_CORE_DIR) +vpath io_mem_session_support.cc $(GEN_CORE_DIR) +vpath platform_services.cc $(GEN_CORE_DIR) +vpath signal_session_component.cc $(GEN_CORE_DIR) +vpath signal_source_component.cc $(GEN_CORE_DIR) +vpath trace_session_component.cc $(GEN_CORE_DIR) +vpath dataspace_component.cc $(GEN_CORE_DIR) +vpath core_mem_alloc.cc $(GEN_CORE_DIR) +vpath dump_alloc.cc $(GEN_CORE_DIR) +vpath context_area.cc $(GEN_CORE_DIR) +vpath %.cc $(REP_DIR)/src/core diff --git a/repos/base-sel4/src/core/target.mk b/repos/base-sel4/src/core/target.mk new file mode 100644 index 0000000000..310689bf0c --- /dev/null +++ b/repos/base-sel4/src/core/target.mk @@ -0,0 +1 @@ +include $(PRG_DIR)/target.inc diff --git a/repos/base-sel4/src/core/thread_start.cc b/repos/base-sel4/src/core/thread_start.cc new file mode 100644 index 0000000000..56103f8421 --- /dev/null +++ b/repos/base-sel4/src/core/thread_start.cc @@ -0,0 +1,56 @@ +/* + * \brief Implementation of Thread API interface for core + * \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 + +/* core includes */ +#include +#include + +using namespace Genode; + + +void Thread_base::_init_platform_thread(size_t, Type type) +{ + PDBG("not implemented"); +} + + +void Thread_base::_deinit_platform_thread() +{ + PDBG("not implemented"); +} + + +void Thread_base::_thread_start() +{ + Thread_base::myself()->_thread_bootstrap(); + Thread_base::myself()->entry(); + sleep_forever(); +} + + +void Thread_base::start() +{ + PDBG("not implemented"); +} + + +void Thread_base::cancel_blocking() +{ + PWRN("not implemented"); +} +