]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4sys/include/__kip-32bit.h
19292c3218e0c3ca751eec36c343c5c9e9770bb8
[l4.git] / l4 / pkg / l4sys / include / __kip-32bit.h
1 /**
2  * \internal
3  * \file
4  * \brief   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  *               Martin Pohlack <mp26@os.inf.tu-dresden.de>,
14  *               Lars Reuther <reuther@os.inf.tu-dresden.de>
15  *     economic rights: Technische Universität Dresden (Germany)
16  *
17  * This file is part of TUD:OS and distributed under the terms of the
18  * GNU General Public License 2.
19  * Please see the COPYING-GPL-2 file for details.
20  *
21  * As a special exception, you may use this file as part of a free software
22  * library without restriction.  Specifically, if other files instantiate
23  * templates or use macros or inline functions from this file, or you compile
24  * this file and link it with other files to produce an executable, this
25  * file does not by itself cause the resulting executable to be covered by
26  * the GNU General Public License.  This exception does not however
27  * invalidate any other reasons why the executable file might be covered by
28  * the GNU General Public License.
29  */
30 #pragma once
31
32 #include <l4/sys/types.h>
33
34 /**
35  * \brief L4 Kernel Interface Page.
36  * \ingroup l4_kip_api
37  */
38 typedef struct l4_kernel_info_t
39 {
40   /* offset 0x00 */
41   l4_uint32_t            magic;               /**< Kernel Info Page
42                                                **  identifier ("L4µK").
43                                                **/
44   l4_uint32_t            version;             ///< Kernel version
45   l4_uint8_t             offset_version_strings; ///< offset to version string
46   l4_uint8_t             fill0[3];            ///< reserved \internal
47   l4_uint8_t             kip_sys_calls;       ///< pointer to system calls
48   l4_uint8_t             fill1[3];            ///< reserved \internal
49
50   /* the following stuff is undocumented; we assume that the kernel
51      info page is located at offset 0x1000 into the L4 kernel boot
52      image so that these declarations are consistent with section 2.9
53      of the L4 Reference Manual */
54
55   /* offset 0x10 */
56   /* Kernel debugger */
57   l4_umword_t            init_default_kdebug; ///< Kdebug init function
58   l4_umword_t            default_kdebug_exception; ///< Kdebug exception handler
59   l4_umword_t            scheduler_granularity; ///< for rounding time slices
60   l4_umword_t            default_kdebug_end;  ///< default_kdebug_end
61
62   /* offset 0x20 */
63   /* Sigma0 */
64   l4_umword_t            sigma0_esp;          ///< Sigma0 start stack pointer
65   l4_umword_t            sigma0_eip;          ///< Sigma0 instruction pointer
66   l4_umword_t            _res01[2];           ///< reserved \internal
67
68   /* offset 0x30 */
69   /* Sigma1 */
70   l4_umword_t            sigma1_esp;          ///< Sigma1 start stack pointer
71   l4_umword_t            sigma1_eip;          ///< Sigma1 instruction pointer
72   l4_umword_t            _res02[2];           ///< reserved \internal
73
74   /* offset 0x40 */
75   /* Root task */
76   l4_umword_t            root_esp;            ///< Root task stack pointer
77   l4_umword_t            root_eip;            ///< Root task instruction pointer
78   l4_umword_t            _res03[2];           ///< reserved \internal
79
80   /* offset 0x50 */
81   /* L4 configuration */
82   l4_umword_t            l4_config;           /**< L4 kernel configuration.
83                                                **
84                                                ** Values:
85                                                **  - bits 0-7: set the number
86                                                **    of page table entries to
87                                                **    allocate
88                                                **  - bits 8-15: set the number
89                                                **    of mapping nodes.
90                                                **/
91   l4_umword_t            mem_info;            ///< memory information
92   l4_umword_t            kdebug_config;       /**< Kernel debugger config.
93                                                **
94                                                **  Values:
95                                                **  - bits 0-7: set the number
96                                                **    of pages to allocate for
97                                                **    the trace buffer
98                                                **  - bit 8: if set to 1, the
99                                                **    kernel enters kdebug
100                                                **    before starting the root
101                                                **    task
102                                                **  - bits 16-19: set the port
103                                                **    speed to use with serial
104                                                **    line (1..115.2KBd,
105                                                **    2..57.6KBd, 3..38.4KBd,
106                                                **    6..19.2KBd, 12..9.6KBD)
107                                                **  - bits 20-31: set the I/O
108                                                **    port to use with serial
109                                                **    line, 0 indicates that no
110                                                **    serial output should be
111                                                **    used
112                                                **/
113   l4_umword_t            kdebug_permission;   /**< Kernel debugger permissions.
114                                                **
115                                                **  Values:
116                                                **  - bits 0-7: if 0 all tasks
117                                                **    can enter the kernel
118                                                **    debugger, otherwise only
119                                                **    tasks with a number lower
120                                                **    the set value can enter
121                                                **    kdebug, other tasks will be
122                                                **    shut down.
123                                                **  - bit 8: if set, kdebug may
124                                                **    display mappings
125                                                **  - bit 9: if set, kdebug may
126                                                **    display user registers
127                                                **  - bit 10: if set, kdebug may
128                                                **    display user memory
129                                                **  - bit 11: if set, kdebug may
130                                                **    modify memory, registers,
131                                                **    mappings and tcbs
132                                                **  - bit 12: if set, kdebug may
133                                                **    read/write I/O ports
134                                                **  - bit 13: if set, kdebug may
135                                                **    protocol page faults and
136                                                **    IPC
137                                                **/
138
139   /* offset 0x60 */
140   l4_umword_t            total_ram;           ///< Size of RAM in bytes
141   l4_umword_t            processor_info;      ///< CPU info
142   l4_umword_t            _res04[14];          ///< reserved \internal
143
144   /* offset 0xA0 */
145   volatile l4_cpu_time_t clock;               ///< L4 system clock (µs)
146   volatile l4_cpu_time_t switch_time;         /**< timestamp of last l4 thread
147                                                **  switch (cycles)
148                                                **  - only valid if
149                                                **    FINE_GRAINED_CPU_TIME is
150                                                **    available
151                                                **/
152
153   /* offset 0xB0 */
154   l4_umword_t            frequency_cpu;       ///< CPU frequency in kHz
155   l4_umword_t            frequency_bus;       ///< Bus frequency
156   volatile l4_cpu_time_t thread_time;         /**< accumulated thread time for
157                                                ** currently running thread at
158                                                ** last l4 thread switch (in
159                                                ** cycles)
160                                                **  - only valid if
161                                                **    FINE_GRAINED_CPU_TIME is
162                                                **    available
163                                                **/
164
165   /* offset 0xC0 */
166   l4_umword_t            _res05[8];           ///< reserved \internal
167
168   /* offset 0xE0 */
169   l4_umword_t            user_ptr;            ///< user_ptr
170   l4_umword_t            vhw_offset;          ///< offset to vhw structure
171   l4_umword_t            __res06[2];
172
173   /* offset 0xF0 */
174   struct l4_kip_kernel_uart_info kernel_uart_info;
175   struct l4_kip_platform_info    platform_info;
176 } l4_kernel_info_t;