base: separate native CPU from CPU session

This patch unifies the CPU session interface across all platforms. The
former differences are moved to respective "native-CPU" interfaces.

NOVA is not covered by the patch and still relies on a custom version of
the core-internal 'cpu_session_component.h'. However, this will soon be
removed once the ongoing rework of pause/single-step on NOVA is
completed.

Fixes #1922
This commit is contained in:
Norman Feske
2016-03-30 15:34:37 +02:00
committed by Christian Helmuth
parent e9dec93f4b
commit 0c299c5e08
63 changed files with 668 additions and 1207 deletions

View File

@@ -87,6 +87,8 @@ struct Genode::Cpu_session_client : Rpc_client<Cpu_session>
return call<Rpc_transfer_quota>(session, amount); }
Quota quota() override { return call<Rpc_quota>(); }
Capability<Native_cpu> native_cpu() override { return call<Rpc_native_cpu>(); }
};
#endif /* _INCLUDE__CPU_SESSION__CLIENT_H_ */

View File

@@ -299,6 +299,22 @@ struct Genode::Cpu_session : Session
static size_t quota_lim_downscale(size_t const value, size_t const limit) {
return ((T)value * limit) >> Cpu_session::QUOTA_LIMIT_LOG2; }
/*****************************************
** Access to kernel-specific interface **
*****************************************/
/**
* Common base class of kernel-specific CPU interfaces
*/
struct Native_cpu { };
/**
* Return capability to kernel-specific CPU operations
*/
virtual Capability<Native_cpu> native_cpu() = 0;
/*********************
** RPC declaration **
*********************/
@@ -331,6 +347,7 @@ struct Genode::Cpu_session : Session
GENODE_RPC(Rpc_ref_account, int, ref_account, Cpu_session_capability);
GENODE_RPC(Rpc_transfer_quota, int, transfer_quota, Cpu_session_capability, size_t);
GENODE_RPC(Rpc_quota, Quota, quota);
GENODE_RPC(Rpc_native_cpu, Capability<Native_cpu>, native_cpu);
/*
* 'GENODE_RPC_INTERFACE' declaration done manually
@@ -361,8 +378,9 @@ struct Genode::Cpu_session : Session
Meta::Type_tuple<Rpc_ref_account,
Meta::Type_tuple<Rpc_transfer_quota,
Meta::Type_tuple<Rpc_quota,
Meta::Type_tuple<Rpc_native_cpu,
Meta::Empty>
> > > > > > > > > > > > > > > > > > > > Rpc_functions;
> > > > > > > > > > > > > > > > > > > > > Rpc_functions;
};
struct Genode::Cpu_session::Quota