2011-12-22 16:19:25 +01:00
|
|
|
/*
|
2012-08-15 19:14:05 +02:00
|
|
|
* \brief Linux-specific PD session
|
2011-12-22 16:19:25 +01:00
|
|
|
* \author Norman Feske
|
2012-08-15 19:14:05 +02:00
|
|
|
* \date 2012-08-15
|
2011-12-22 16:19:25 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2013-01-10 21:44:47 +01:00
|
|
|
* Copyright (C) 2012-2013 Genode Labs GmbH
|
2011-12-22 16:19:25 +01:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
2012-08-15 19:14:05 +02:00
|
|
|
#ifndef _CORE__INCLUDE__PD_SESSION_COMPONENT_H_
|
|
|
|
#define _CORE__INCLUDE__PD_SESSION_COMPONENT_H_
|
2011-12-22 16:19:25 +01:00
|
|
|
|
|
|
|
/* Genode includes */
|
2015-04-09 15:33:20 +02:00
|
|
|
#include <base/allocator.h>
|
2011-12-22 16:19:25 +01:00
|
|
|
#include <base/rpc_server.h>
|
2012-08-15 19:14:05 +02:00
|
|
|
#include <linux_pd_session/linux_pd_session.h>
|
2011-12-22 16:19:25 +01:00
|
|
|
|
2012-08-15 19:14:05 +02:00
|
|
|
/* core includes */
|
|
|
|
#include <platform_pd.h>
|
2011-12-22 16:19:25 +01:00
|
|
|
|
|
|
|
namespace Genode {
|
|
|
|
|
2012-08-15 19:14:05 +02:00
|
|
|
class Pd_session_component : public Rpc_object<Linux_pd_session, Pd_session_component>
|
2011-12-22 16:19:25 +01:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
2012-10-24 16:27:26 +02:00
|
|
|
enum { LABEL_MAX_LEN = 1024 };
|
|
|
|
enum { ROOT_PATH_MAX_LEN = 512 };
|
2012-10-11 20:57:10 +02:00
|
|
|
|
2012-08-15 19:14:05 +02:00
|
|
|
unsigned long _pid;
|
2012-10-11 20:57:10 +02:00
|
|
|
char _label[LABEL_MAX_LEN];
|
2012-10-24 16:27:26 +02:00
|
|
|
char _root[ROOT_PATH_MAX_LEN];
|
2012-11-21 15:20:21 +01:00
|
|
|
unsigned _uid;
|
|
|
|
unsigned _gid;
|
2012-08-15 19:14:05 +02:00
|
|
|
Parent_capability _parent;
|
|
|
|
Rpc_entrypoint *_ds_ep;
|
2011-12-22 16:19:25 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2012-08-15 19:14:05 +02:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
2015-04-09 15:33:20 +02:00
|
|
|
* \param ds_ep entrypoint where the dataspaces are managed
|
|
|
|
* \param md_alloc meta-data allocator
|
|
|
|
* \param args additional session arguments
|
2012-08-15 19:14:05 +02:00
|
|
|
*/
|
2015-04-09 15:33:20 +02:00
|
|
|
Pd_session_component(Rpc_entrypoint *ds_ep, Allocator * md_alloc,
|
|
|
|
const char *args);
|
2011-12-22 16:19:25 +01:00
|
|
|
|
|
|
|
~Pd_session_component();
|
|
|
|
|
2015-05-05 08:50:16 +02:00
|
|
|
/**
|
|
|
|
* Register quota donation at allocator guard
|
|
|
|
*/
|
|
|
|
void upgrade_ram_quota(size_t ram_quota) { }
|
|
|
|
|
2011-12-22 16:19:25 +01:00
|
|
|
|
2012-08-15 19:14:05 +02:00
|
|
|
/**************************
|
|
|
|
** PD session interface **
|
|
|
|
**************************/
|
2011-12-22 16:19:25 +01:00
|
|
|
|
2012-08-15 19:14:05 +02:00
|
|
|
int bind_thread(Thread_capability);
|
|
|
|
int assign_parent(Parent_capability parent);
|
|
|
|
|
|
|
|
|
|
|
|
/******************************
|
|
|
|
** Linux-specific extension **
|
|
|
|
******************************/
|
2011-12-22 16:19:25 +01:00
|
|
|
|
2012-10-11 20:57:10 +02:00
|
|
|
void start(Capability<Dataspace> binary);
|
2011-12-22 16:19:25 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2012-08-15 19:14:05 +02:00
|
|
|
#endif /* _CORE__INCLUDE__PD_SESSION_COMPONENT_H_ */
|