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  * Return whether the kernel is running natively or under UX.
30  *
31  * \return  1 when running under UX, 0 if not running under UX.
32  */
33 L4_CV int l4util_kip_kernel_is_ux(l4_kernel_info_t *);
34 
35 /**
36  * Check if kernel supports a feature.
37  *
38  * \param str  Feature name to check.
39  *
40  * \return  1 if the kernel supports the feature, 0 if not.
41  *
42  * Checks the feature field in the KIP for the given string.
43  */
44 L4_CV int l4util_kip_kernel_has_feature(l4_kernel_info_t *, const char *str);
45 
46 /**
47  * Return kernel ABI version.
48  *
49  * \return  Kernel ABI version.
50  */
51 L4_CV unsigned long l4util_kip_kernel_abi_version(l4_kernel_info_t *);
52 
53 EXTERN_C_END
54 
55 /**
56  * Cycle through kernel features given in the KIP.
57  *
58  * Cycles through all KIP kernel feature strings. s must be a character
59  * pointer (char const *) initialized with l4_kip_version_string().
60  */
61 #define l4util_kip_for_each_feature(s)				\
62 		for (s += strlen(s) + 1; *s; s += strlen(s) + 1)
63 
64 /*@}*/
65 
66