]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4re-core/l4util/include/kip.h
Update
[l4.git] / l4 / pkg / l4re-core / l4util / include / kip.h
1 /**
2  * \file
3  * \ingroup l4util_kip_api
4  */
5 /*
6  * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
7  *               Alexander Warg <warg@os.inf.tu-dresden.de>
8  *     economic rights: Technische Universität Dresden (Germany)
9  * This file is part of TUD:OS and distributed under the terms of the
10  * GNU Lesser General Public License 2.1.
11  * Please see the COPYING-LGPL-2.1 file for details.
12  */
13
14 #pragma once
15
16 #include <l4/sys/kip.h>
17 #include <l4/sys/compiler.h>
18
19 /**
20  * \defgroup l4util_kip_api Kernel Interface Page API
21  * \ingroup l4util_api
22  */
23 /*@{*/
24
25
26 EXTERN_C_BEGIN
27
28 /**
29  * \brief Return whether the kernel is running native or under UX.
30  *
31  * Returns whether the kernel is running natively or under UX. The KIP will
32  * be mapped if not already mapped. The KIP will not be unmapped again.
33  *
34  * \return 1 when running under UX, 0 if not running under UX
35  */
36 L4_CV int l4util_kip_kernel_is_ux(l4_kernel_info_t *);
37
38 /**
39  * \brief Check if kernel supports a feature.
40  *
41  * \param str   Feature name to check.
42  *
43  * \return 1 if the kernel supports the feature, 0 if not.
44  *
45  * Checks the feature field in the KIP for the given string. The KIP will be
46  * mapped if not already mapped. The KIP will not be unmapped again.
47  */
48 L4_CV int l4util_kip_kernel_has_feature(l4_kernel_info_t *, const char *str);
49
50 /**
51  * \brief Return kernel ABI version.
52  *
53  * \return Kernel ABI version.
54  */
55 L4_CV unsigned long l4util_kip_kernel_abi_version(l4_kernel_info_t *);
56
57 /**
58  * \brief Return end of virtual memory.
59  * \ingroup l4util_memdesc
60  *
61  * \return 0 if memory descriptor could not be found,
62  *         last address of address space otherwise
63  */
64 L4_CV l4_addr_t l4util_memdesc_vm_high(l4_kernel_info_t *kinfo);
65
66 EXTERN_C_END
67
68 /**
69  * \brief Cycle through kernel features given in the KIP.
70  *
71  * Cycles through all KIP kernel feature strings. s must be a character
72  * pointer (char *) initialized with l4util_kip_version_string().
73  */
74 #define l4util_kip_for_each_feature(s)                          \
75                 for (s += strlen(s) + 1; *s; s += strlen(s) + 1)
76
77 /*@}*/
78