]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/moe/server/src/app_task.h
fa9b60de65c6134a3804c441d4c850133f83f26c
[l4.git] / l4 / pkg / moe / server / src / app_task.h
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 #include "sched_proxy.h"
16
17 #include <l4/cxx/ipc_server>
18 #include <l4/sys/capability>
19
20 #include <cstring>
21
22 class App_task : public L4::Server_object
23 {
24
25 private:
26   L4::Cap<L4::Task> _task;
27   L4::Cap<L4::Thread> _thread;
28
29
30   Region_map _rm;
31   Allocator *_alloc;
32
33 public:
34   Sched_proxy _sched;
35   Moe::Log   log;
36
37   App_task();
38   Allocator *allocator() const { return _alloc; }
39   void set_allocator(Allocator *a) { _alloc = a; }
40
41   int dispatch(l4_umword_t obj, L4::Ipc_iostream &ios);
42
43
44   Region_map *rm() { return &_rm; }
45
46   void task_cap(L4::Cap<L4::Task> const &c) { _task = c; }
47   void thread_cap(L4::Cap<L4::Thread> const &c) { _thread = c; }
48
49   L4::Cap<L4::Task> task_cap() const { return _task; }
50   L4::Cap<L4::Thread> thread_cap() const { return _thread; }
51
52   virtual ~App_task();
53 };