genode/repos/base-hw/src/test/cpu_quota/include/sync_session/client.h
Martin Stein c9272937e7 CPU session: apply quota via relative weightings
Physical CPU quota was previously given to a thread on construction only
by directly specifying a percentage of the quota of the according CPU
session. Now, a new thread is given a weighting that can be any value.
The physical counter-value of such a weighting depends on the weightings
of the other threads at the CPU session. Thus, the physical quota of all
threads of a CPU session must be updated when a weighting is added or
removed. This is each time the session creates or destroys a thread.

This commit also adapts the "cpu_quota" test in base-hw accordingly.

Ref #1464
2015-05-06 10:55:16 +02:00

44 lines
921 B
C++

/*
* \brief Client-side Sync-session interface
* \author Martin Stein
* \date 2015-04-07
*/
/*
* 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 _SYNC_SESSION__CLIENT_H_
#define _SYNC_SESSION__CLIENT_H_
/* Genode includes */
#include <base/rpc_client.h>
/* local includes */
#include <sync_session/capability.h>
namespace Sync
{
using Genode::Rpc_client;
struct Session_client;
}
struct Sync::Session_client : Rpc_client<Session>
{
explicit Session_client(Session_capability session)
: Rpc_client<Session>(session) { }
void threshold(unsigned id, unsigned threshold) override {
call<Rpc_threshold>(id, threshold); }
void submit(unsigned id, Signal_context_capability sigc) override {
call<Rpc_submit>(id, sigc); }
};
#endif /* _SYNC_SESSION__CLIENT_H_ */