1 /**
2  * \internal
3  * \file
4  * Kernel Interface Page (KIP).
5  * \ingroup l4_kip_api
6  */
7 /*
8  * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
9  *               Alexander Warg <warg@os.inf.tu-dresden.de>,
10  *               Björn Döbel <doebel@os.inf.tu-dresden.de>,
11  *               Frank Mehnert <fm3@os.inf.tu-dresden.de>,
12  *               Torsten Frenzel <frenzel@os.inf.tu-dresden.de>
13  *     economic rights: Technische Universität Dresden (Germany)
14  *
15  * This file is part of TUD:OS and distributed under the terms of the
16  * GNU General Public License 2.
17  * Please see the COPYING-GPL-2 file for details.
18  *
19  * As a special exception, you may use this file as part of a free software
20  * library without restriction.  Specifically, if other files instantiate
21  * templates or use macros or inline functions from this file, or you compile
22  * this file and link it with other files to produce an executable, this
23  * file does not by itself cause the resulting executable to be covered by
24  * the GNU General Public License.  This exception does not however
25  * invalidate any other reasons why the executable file might be covered by
26  * the GNU General Public License.
27  */
28 #pragma once
29 
30 #include <l4/sys/types.h>
31 
32 /**
33  * L4 Kernel Interface Page.
34  * \ingroup l4_kip_api
35  */
36 typedef struct l4_kernel_info_t
37 {
38   /* offset 0x00 */
39   l4_uint64_t            magic;               /**< Kernel Info Page
40 					       **  identifier ("L4µK").
41 					       **/
42   l4_uint64_t            version;             ///< Kernel version
43   l4_uint8_t             offset_version_strings; ///< offset to version string
44   l4_uint8_t             fill2[7];            ///< reserved \internal
45   l4_uint8_t             kip_sys_calls;       ///< pointer to system calls
46   l4_uint8_t             fill3[7];            ///< reserved \internal
47 
48   /* the following stuff is undocumented; we assume that the kernel
49      info page is located at offset 0x1000 into the L4 kernel boot
50      image so that these declarations are consistent with section 2.9
51      of the L4 Reference Manual */
52 
53   /* offset 0x20 */
54   /* Kernel debugger */
55   l4_umword_t            scheduler_granularity; ///< for rounding time slices
56   l4_umword_t            _res00[3];           ///< default_kdebug_end
57 
58   /* offset 0x40 */
59   /* Sigma0 */
60   l4_umword_t            sigma0_esp;          ///< Sigma0 start stack pointer
61   l4_umword_t            sigma0_eip;          ///< Sigma0 instruction pointer
62   l4_umword_t            _res01[2];           ///< reserved \internal
63 
64   /* offset 0x60 */
65   /* Sigma1 */
66   l4_umword_t            sigma1_esp;          ///< Sigma1 start stack pointer
67   l4_umword_t            sigma1_eip;          ///< Sigma1 instruction pointer
68   l4_umword_t            _res02[2];           ///< reserved \internal
69 
70   /* offset 0x80 */
71   /* Root task */
72   l4_umword_t            root_esp;            ///< Root task stack pointer
73   l4_umword_t            root_eip;            ///< Root task instruction pointer
74   l4_umword_t            _res03[2];           ///< reserved \internal
75 
76   /* offset 0xA0 */
77   /* L4 configuration */
78   l4_umword_t            _res_a0[1];          ///< reserved \internal
79   l4_umword_t            mem_info;            ///< memory information
80   l4_umword_t            _res_b0[2];          ///< reserver \internal
81 
82   /* offset 0xC0 */
83   l4_umword_t            _res04[16];          ///< reserved \internal
84 
85   /* offset 0x140 */
86   volatile l4_cpu_time_t _clock_val;          ///< \internal
87   l4_umword_t            _res05[1];           ///< reserved \internal
88   l4_umword_t            frequency_cpu;       ///< CPU frequency in kHz
89   l4_umword_t            frequency_bus;       ///< Bus frequency
90 
91   /* offset 0x160 */
92   l4_umword_t            _res06[12];          ///< reserved \internal
93 
94   /* offset 0x1C0 */
95   l4_umword_t		 user_ptr;            ///< user_ptr
96   l4_umword_t		 vhw_offset;          ///< offset to vhw structure
97   l4_umword_t            _res07[2];
98 
99   /* offset 0x1E0 */
100   struct l4_kip_platform_info    platform_info;
101 } l4_kernel_info_t;
102