Noux: support PD session upgrade

Fixes #1979
This commit is contained in:
Christian Prochaska 2016-05-23 18:50:31 +02:00 committed by Christian Helmuth
parent 783da4ee1d
commit 1e4672db4a
2 changed files with 62 additions and 1 deletions

View File

@ -39,6 +39,7 @@
#include <kill_broadcaster.h>
#include <parent_execve.h>
#include <local_cpu_service.h>
#include <local_pd_service.h>
#include <local_rom_service.h>
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)

View File

@ -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 <base/service.h>
/* Noux includes */
#include <pd_session_component.h>
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_ */