2017-01-06 13:23:53 +00:00
|
|
|
/*
|
|
|
|
* \brief Helper class to make the Genode Env globally available
|
|
|
|
* \author Sebastian Sumpf
|
|
|
|
* \date 2016-06-21
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 12:23:52 +00:00
|
|
|
* Copyright (C) 2016-2017 Genode Labs GmbH
|
2017-01-06 13:23:53 +00:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 12:23:52 +00:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2017-01-06 13:23:53 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE__RUMP__ENV_H_
|
|
|
|
#define _INCLUDE__RUMP__ENV_H_
|
|
|
|
|
|
|
|
#include <base/attached_rom_dataspace.h>
|
|
|
|
#include <base/env.h>
|
|
|
|
#include <base/heap.h>
|
|
|
|
#include <util/reconstructible.h>
|
2019-01-18 10:40:23 +00:00
|
|
|
#include <rump/timed_semaphore.h>
|
2017-01-06 13:23:53 +00:00
|
|
|
|
|
|
|
namespace Rump {
|
|
|
|
class Env;
|
|
|
|
|
|
|
|
Env &env();
|
|
|
|
|
|
|
|
void construct_env(Genode::Env &env);
|
|
|
|
}
|
|
|
|
|
|
|
|
class Rump::Env
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
|
|
|
Genode::Env &_env;
|
2019-01-18 10:40:23 +00:00
|
|
|
Timeout_entrypoint _timeout_ep { _env };
|
2017-01-06 13:23:53 +00:00
|
|
|
Genode::Heap _heap { _env.ram(), _env.rm() };
|
|
|
|
Genode::Attached_rom_dataspace _config { _env, "config" };
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2019-10-02 12:23:28 +00:00
|
|
|
Env(Genode::Env &env);
|
2017-01-06 13:23:53 +00:00
|
|
|
|
|
|
|
Genode::Env &env() { return _env; }
|
2019-01-18 10:40:23 +00:00
|
|
|
Timeout_entrypoint &timeout_ep() { return _timeout_ep; }
|
2017-01-06 13:23:53 +00:00
|
|
|
Genode::Heap &heap() { return _heap; }
|
|
|
|
Genode::Attached_rom_dataspace &config_rom() { return _config; }
|
|
|
|
};
|
|
|
|
|
2018-04-20 08:54:45 +00:00
|
|
|
/**
|
|
|
|
* Set rump MEMLIMIT
|
|
|
|
*
|
|
|
|
* In case limit is zero, the available RAM quota will be used.
|
|
|
|
*/
|
|
|
|
void rump_set_memlimit(Genode::size_t limit);
|
|
|
|
|
2017-01-06 13:23:53 +00:00
|
|
|
#endif /* _INCLUDE__RUMP__ENV_H_ */
|