2012-05-30 20:13:09 +02:00
|
|
|
/*
|
|
|
|
* \brief Platform specific parts of CPU session
|
|
|
|
* \author Martin Stein
|
|
|
|
* \date 2012-04-17
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 13:23:52 +01:00
|
|
|
* Copyright (C) 2012-2017 Genode Labs GmbH
|
2012-05-30 20:13:09 +02:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 13:23:52 +01:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2012-05-30 20:13:09 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* Genode includes */
|
|
|
|
#include <dataspace/capability.h>
|
|
|
|
|
|
|
|
/* core includes */
|
|
|
|
#include <cpu_session_component.h>
|
2019-09-26 14:24:28 +02:00
|
|
|
#include "kernel/configuration.h"
|
2012-05-30 20:13:09 +02:00
|
|
|
|
|
|
|
using namespace Genode;
|
|
|
|
|
|
|
|
|
2016-05-10 18:05:38 +02:00
|
|
|
Dataspace_capability Cpu_thread_component::utcb()
|
2012-05-30 20:13:09 +02:00
|
|
|
{
|
2016-05-10 18:05:38 +02:00
|
|
|
return _platform_thread.utcb();
|
2012-05-30 20:13:09 +02:00
|
|
|
}
|
|
|
|
|
2015-03-27 14:05:55 +01:00
|
|
|
|
|
|
|
Cpu_session::Quota Cpu_session_component::quota()
|
|
|
|
{
|
2016-05-18 12:20:04 +02:00
|
|
|
size_t const spu = Kernel::cpu_quota_us;
|
2015-03-27 14:05:55 +01:00
|
|
|
size_t const u = quota_lim_downscale<sizet_arithm_t>(_quota, spu);
|
|
|
|
return { spu, u };
|
|
|
|
}
|