]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4sys/include/task
2fb85c3760f12e0fc9504eba20a2f9dfa70114f7
[l4.git] / l4 / pkg / l4sys / include / task
1 // vi:ft=cpp
2 /**
3  * \file
4  * \brief Common task related definitions.
5  */
6 /*
7  * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
8  *               Alexander Warg <warg@os.inf.tu-dresden.de>
9  *     economic rights: Technische Universität Dresden (Germany)
10  *
11  * This file is part of TUD:OS and distributed under the terms of the
12  * GNU General Public License 2.
13  * Please see the COPYING-GPL-2 file for details.
14  *
15  * As a special exception, you may use this file as part of a free software
16  * library without restriction.  Specifically, if other files instantiate
17  * templates or use macros or inline functions from this file, or you compile
18  * this file and link it with other files to produce an executable, this
19  * file does not by itself cause the resulting executable to be covered by
20  * the GNU General Public License.  This exception does not however
21  * invalidate any other reasons why the executable file might be covered by
22  * the GNU General Public License.
23  */
24
25 #pragma once
26
27 #include <l4/sys/task.h>
28 #include <l4/sys/capability>
29
30 namespace L4 {
31
32 /**
33  * \brief An L4 Task.
34  * \ingroup l4_task_api
35  *
36  * <c>\#include <l4/sys/task></c>
37  *
38  * \see \ref l4_task_api for an overview description.
39  *
40  */
41 class Task : public Kobject_t<Task, Kobject, L4_PROTO_TASK>
42 {
43   L4_KOBJECT(Task)
44
45 public:
46   /**
47    * \copydoc l4_task_map()
48    * \note \a dst_task is the implicit \a this pointer.
49    */
50   l4_msgtag_t map(Cap<Task> const &src_task,
51                   l4_fpage_t const &snd_fpage, l4_addr_t snd_base,
52                   l4_utcb_t *utcb = l4_utcb()) throw()
53   { return l4_task_map_u(cap(), src_task.cap(), snd_fpage, snd_base, utcb); }
54
55   /**
56    * \copydoc l4_task_unmap()
57    * \note \a task is the implicit \a this pointer.
58    */
59   l4_msgtag_t unmap(l4_fpage_t const &fpage,
60                     l4_umword_t map_mask,
61                     l4_utcb_t *utcb = l4_utcb()) throw()
62   { return l4_task_unmap_u(cap(), fpage, map_mask, utcb); }
63
64   /**
65    * \copydoc l4_task_unmap_batch()
66    * \note \a task is the implicit \a this pointer.
67    */
68   l4_msgtag_t unmap_batch(l4_fpage_t const *fpages,
69                           unsigned num_fpages,
70                           l4_umword_t map_mask,
71                           l4_utcb_t *utcb = l4_utcb()) throw()
72   { return l4_task_unmap_batch_u(cap(), fpages, num_fpages, map_mask, utcb); }
73
74   /**
75    * \copydoc l4_task_cap_valid()
76    * \note \a task is the implicit \a this pointer.
77    */
78   l4_msgtag_t cap_valid(Cap<void> const &cap,
79                         l4_utcb_t *utcb = l4_utcb()) throw()
80   { return l4_task_cap_valid_u(this->cap(), cap.cap(), utcb); }
81
82   /**
83    * \copydoc l4_task_cap_has_child()
84    * \note \a task is the implicit \a this pointer.
85    */
86   l4_msgtag_t cap_has_child(Cap<void> const &cap,
87                          l4_utcb_t *utcb = l4_utcb()) throw()
88   { return l4_task_cap_has_child_u(this->cap(), cap.cap(), utcb); }
89
90   /**
91    * \copydoc l4_task_cap_equal()
92    * \note \a task is the implicit \a this pointer.
93    */
94   l4_msgtag_t cap_equal(Cap<void> const &cap_a,
95                         Cap<void> const &cap_b,
96                         l4_utcb_t *utcb = l4_utcb()) throw()
97   { return l4_task_cap_equal_u(cap(), cap_a.cap(), cap_b.cap(), utcb); }
98
99 };
100 }
101
102