1 /*
2 * \brief Protection domain (PD) session interface
3 * \author Christian Helmuth
4 * \date 2006-06-27
5 *
6 * A pd session represents the protection domain of a program.
7 */
8
9 /*
10 * Copyright (C) 2006-2013 Genode Labs GmbH
11 *
12 * This file is part of the Genode OS framework, which is distributed
13 * under the terms of the GNU General Public License version 2.
14 */
15
16 #ifndef _INCLUDE__PD_SESSION__PD_SESSION_H_
17 #define _INCLUDE__PD_SESSION__PD_SESSION_H_
18
19 #include <thread/capability.h>
20 #include <parent/capability.h>
21 #include <session/session.h>
22
23 namespace Genode {
24
25 struct Pd_session : Session
26 {
27 static const char *service_name() { return "PD"; }
28
29 virtual ~Pd_session() { }
30
31 /**
32 * Bind thread to protection domain
33 *
34 * \param thread capability of thread to bind
35 *
36 * \return 0 on success or negative error code
37 *
38 * After successful bind, the thread will execute inside this
39 * protection domain when started.
40 */
41 virtual int bind_thread(Thread_capability thread) = 0;
42
43 /**
44 * Assign parent to protection domain
45 *
46 * \param parent capability of parent interface
47 * \return 0 on success, or negative error code
48 */
49 virtual int assign_parent(Parent_capability parent) = 0;
50
51
52 /*********************
53 ** RPC declaration **
54 *********************/
55
56 GENODE_RPC(Rpc_bind_thread, int, bind_thread, Thread_capability);
57 GENODE_RPC(Rpc_assign_parent, int, assign_parent, Parent_capability);
58
59 GENODE_RPC_INTERFACE(Rpc_bind_thread, Rpc_assign_parent);
60 };
61 }
62
63 #endif /* _INCLUDE__PD_SESSION__PD_SESSION_H_ */