1 /*
2  * (c) 2008-2009 Alexander Warg <warg@os.inf.tu-dresden.de>
3  *     economic rights: Technische Universität Dresden (Germany)
4  *
5  * This file is part of TUD:OS and distributed under the terms of the
6  * GNU General Public License 2.
7  * Please see the COPYING-GPL-2 file for details.
8  */
9 #pragma once
10 
11 #include "dataspace.h"
12 #include "log.h"
13 #include "alloc.h"
14 #include "region.h"
15 
16 #include <l4/sys/cxx/ipc_epiface>
17 #include <l4/sys/capability>
18 #include <l4/re/parent>
19 
20 #include <cstring>
21 
22 class App_task : public L4::Epiface_t<App_task, L4Re::Parent, Moe::Server_object>
23 {
24 
25 private:
26   L4::Cap<L4::Task> _task;
27   L4::Cap<L4::Thread> _thread;
28 
29 
30   Allocator *_alloc;
31   cxx::Weak_ref<Region_map> _rm;
32 
33 public:
34   App_task();
allocator()35   Allocator *allocator() const { return _alloc; }
36 
rm()37   cxx::Weak_ref<Region_map> const &rm() { return _rm; }
38   long op_signal(L4Re::Parent::Rights, unsigned long, unsigned long);
39 
task_cap(L4::Cap<L4::Task> const & c)40   void task_cap(L4::Cap<L4::Task> const &c) { _task = c; }
thread_cap(L4::Cap<L4::Thread> const & c)41   void thread_cap(L4::Cap<L4::Thread> const &c) { _thread = c; }
42 
task_cap()43   L4::Cap<L4::Task> task_cap() const { return _task; }
thread_cap()44   L4::Cap<L4::Thread> thread_cap() const { return _thread; }
45 
46   virtual ~App_task();
47 };
48