From 1e4672db4af41f0469e71956fb8fefb8cb72f66e Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Mon, 23 May 2016 18:50:31 +0200 Subject: [PATCH] Noux: support PD session upgrade Fixes #1979 --- repos/ports/src/noux/child.h | 5 ++- repos/ports/src/noux/local_pd_service.h | 58 +++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 repos/ports/src/noux/local_pd_service.h diff --git a/repos/ports/src/noux/child.h b/repos/ports/src/noux/child.h index 5753e19fa3..6f026f7c7e 100644 --- a/repos/ports/src/noux/child.h +++ b/repos/ports/src/noux/child.h @@ -39,6 +39,7 @@ #include #include #include +#include #include namespace Noux { @@ -250,6 +251,7 @@ namespace Noux { Parent_service _parent_ram_service; Parent_service _parent_pd_service; Local_cpu_service _local_cpu_service; + Local_pd_service _local_pd_service; Local_rom_service _local_rom_service; Service_registry &_parent_services; @@ -405,6 +407,7 @@ namespace Noux { _parent_ram_service(""), _parent_pd_service(""), _local_cpu_service(_entrypoint, _resources.cpu.cpu_cap()), + _local_pd_service(_entrypoint, _pd.core_pd_cap()), _local_rom_service(_entrypoint, _ds_registry), _parent_services(parent_services), _binary_ds_info(_ds_registry, _elf._binary_ds), @@ -425,7 +428,7 @@ namespace Noux { _resources.ram.cap(), _resources.ram, _resources.cpu.cap(), _initial_thread, *Genode::env()->rm_session(), _address_space, - _entrypoint, _child_policy, _parent_pd_service, + _entrypoint, _child_policy, _local_pd_service, _parent_ram_service, _local_cpu_service) { if (verbose) diff --git a/repos/ports/src/noux/local_pd_service.h b/repos/ports/src/noux/local_pd_service.h new file mode 100644 index 0000000000..99e29aaefe --- /dev/null +++ b/repos/ports/src/noux/local_pd_service.h @@ -0,0 +1,58 @@ +/* + * \brief PD service provided to Noux processes + * \author Christian Prochaska + * \date 2016-05-23 + */ + +/* + * Copyright (C) 2016 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 _NOUX__LOCAL_PD_SERVICE_H_ +#define _NOUX__LOCAL_PD_SERVICE_H_ + +/* Genode includes */ +#include + +/* Noux includes */ +#include + +namespace Noux { + + class Local_pd_service : public Service + { + private: + + Rpc_entrypoint &_ep; + Pd_session_capability _cap; + + public: + + Local_pd_service(Rpc_entrypoint &ep, Pd_session_capability cap) + : + Service(Pd_session::service_name()), _ep(ep), + _cap(cap) + { } + + Genode::Session_capability session(const char *args, Affinity const &) override + { + PDBG("not implemented"); + return Genode::Session_capability(); + } + + void upgrade(Genode::Session_capability, const char *args) override + { + env()->parent()->upgrade(_cap, args); + } + + void close(Genode::Session_capability session) override + { + PDBG("not implemented"); + } + }; +} + +#endif /* _NOUX__LOCAL_PD_SERVICE_H_ */