3670f7735d
This patch makes use of the new 'Quota_transfer::Account' by the service types in base/service.h and uses 'Quota_transfer' objects in base/child.cc and init/server.cc. Furthermore, it decouples the notion of an 'Async_service' from 'Child_service'. Init's 'Routed_service' is no longer a 'Child_service' but is based on the new 'Async_service' instead. With this patch in place, quota transfers do no longer implicitly use 'Ram_session_client' objects. So transfers can in principle originate from component-local 'Ram_session_component' objects, e.g., as used by noux. Therefore, this patch removes a strumbling block for turning noux into a single threaded component in the future. Issue #2398
94 lines
2.5 KiB
C++
94 lines
2.5 KiB
C++
/*
|
|
* \brief Report-ROM slave
|
|
* \author Norman Feske
|
|
* \date 2014-02-14
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2014-2017 Genode Labs GmbH
|
|
*
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
* under the terms of the GNU Affero General Public License version 3.
|
|
*/
|
|
|
|
#ifndef _INCLUDE__GEMS__REPORT_ROM_SLAVE_H_
|
|
#define _INCLUDE__GEMS__REPORT_ROM_SLAVE_H_
|
|
|
|
/* Genode includes */
|
|
#include <base/lock.h>
|
|
#include <os/static_parent_services.h>
|
|
#include <os/slave.h>
|
|
#include <report_session/connection.h>
|
|
#include <rom_session/connection.h>
|
|
|
|
|
|
class Report_rom_slave : public Genode::Noncopyable
|
|
{
|
|
private:
|
|
|
|
class Policy
|
|
:
|
|
private Genode::Static_parent_services<Genode::Rom_session,
|
|
Genode::Cpu_session,
|
|
Genode::Pd_session,
|
|
Genode::Ram_session,
|
|
Genode::Log_session>,
|
|
public Genode::Slave::Policy
|
|
{
|
|
private:
|
|
|
|
Genode::Root_capability _report_root_cap;
|
|
Genode::Root_capability _rom_root_cap;
|
|
bool _announced;
|
|
|
|
protected:
|
|
|
|
static Name _name() { return "report_rom"; }
|
|
static Genode::Ram_quota _quota() { return { 1024*1024 }; }
|
|
|
|
public:
|
|
|
|
Policy(Genode::Rpc_entrypoint &ep,
|
|
Genode::Region_map &rm,
|
|
Genode::Ram_session &ref_ram,
|
|
Genode::Ram_session_capability ref_ram_cap,
|
|
const char *config)
|
|
:
|
|
Genode::Slave::Policy(_name(), _name(), *this, ep, rm,
|
|
ref_ram, ref_ram_cap, _quota())
|
|
{
|
|
if (config)
|
|
configure(config);
|
|
}
|
|
};
|
|
|
|
Genode::size_t const _ep_stack_size = 4*1024*sizeof(Genode::addr_t);
|
|
Genode::Rpc_entrypoint _ep;
|
|
Policy _policy;
|
|
Genode::Child _child;
|
|
|
|
public:
|
|
|
|
/**
|
|
* Constructor
|
|
*
|
|
* \param ep entrypoint used for child thread
|
|
* \param ram RAM session used to allocate the configuration
|
|
* dataspace
|
|
*/
|
|
Report_rom_slave(Genode::Pd_session &pd,
|
|
Genode::Region_map &rm,
|
|
Genode::Ram_session &ram,
|
|
Genode::Ram_session_capability ram_cap,
|
|
char const *config)
|
|
:
|
|
_ep(&pd, _ep_stack_size, "report_rom"),
|
|
_policy(_ep, rm, ram, ram_cap, config),
|
|
_child(rm, _ep, _policy)
|
|
{ }
|
|
|
|
Genode::Slave::Policy &policy() { return _policy; }
|
|
};
|
|
|
|
#endif /* _INCLUDE__GEMS__REPORT_ROM_SLAVE_H_ */
|