]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4sys/include/__kip-64bit.h
update
[l4.git] / l4 / pkg / l4sys / include / __kip-64bit.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  *     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  * \brief 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            init_default_kdebug; ///< Kdebug init function
56   l4_umword_t            default_kdebug_exception; ///< Kdebug exception handler
57   l4_umword_t            scheduler_granularity; ///< for rounding time slices
58   l4_umword_t            default_kdebug_end;  ///< default_kdebug_end
59
60   /* offset 0x40 */
61   /* Sigma0 */
62   l4_umword_t            sigma0_esp;          ///< Sigma0 start stack pointer
63   l4_umword_t            sigma0_eip;          ///< Sigma0 instruction pointer
64   l4_umword_t            _res01[2];           ///< reserved \internal
65
66   /* offset 0x60 */
67   /* Sigma1 */
68   l4_umword_t            sigma1_esp;          ///< Sigma1 start stack pointer
69   l4_umword_t            sigma1_eip;          ///< Sigma1 instruction pointer
70   l4_umword_t            _res02[2];           ///< reserved \internal
71
72   /* offset 0x80 */
73   /* Root task */
74   l4_umword_t            root_esp;            ///< Root task stack pointer
75   l4_umword_t            root_eip;            ///< Root task instruction pointer
76   l4_umword_t            _res03[2];           ///< reserved \internal
77
78   /* offset 0xA0 */
79   /* L4 configuration */
80   l4_umword_t            l4_config;           /**< L4 kernel configuration.
81                                                **
82                                                ** Values:
83                                                **  - bits 0-7: set the number
84                                                **    of page table entries to
85                                                **    allocate
86                                                **  - bits 8-15: set the number
87                                                **    of mapping nodes.
88                                                **/
89   l4_umword_t            mem_info;            ///< memory information
90   l4_umword_t            kdebug_config;       /**< Kernel debugger config.
91                                                **
92                                                **  Values:
93                                                **  - bits 0-7: set the number
94                                                **    of pages to allocate for
95                                                **    the trace buffer
96                                                **  - bit 8: if set to 1, the
97                                                **    kernel enters kdebug
98                                                **    before starting the root
99                                                **    task
100                                                **  - bits 16-19: set the port
101                                                **    speed to use with serial
102                                                **    line (1..115.2KBd,
103                                                **    2..57.6KBd, 3..38.4KBd,
104                                                **    6..19.2KBd, 12..9.6KBD)
105                                                **  - bits 20-31: set the I/O
106                                                **    port to use with serial
107                                                **    line, 0 indicates that no
108                                                **    serial output should be
109                                                **    used
110                                                **/
111   l4_umword_t            kdebug_permission;   /**< Kernel debugger permissions.
112                                                **
113                                                **  Values:
114                                                **  - bits 0-7: if 0 all tasks
115                                                **    can enter the kernel
116                                                **    debugger, otherwise only
117                                                **    tasks with a number lower
118                                                **    the set value can enter
119                                                **    kdebug, other tasks will be
120                                                **    shut down.
121                                                **  - bit 8: if set, kdebug may
122                                                **    display mappings
123                                                **  - bit 9: if set, kdebug may
124                                                **    display user registers
125                                                **  - bit 10: if set, kdebug may
126                                                **    display user memory
127                                                **  - bit 11: if set, kdebug may
128                                                **    modify memory, registers,
129                                                **    mappings and tcbs
130                                                **  - bit 12: if set, kdebug may
131                                                **    read/write I/O ports
132                                                **  - bit 13: if set, kdebug may
133                                                **    protocol page faults and
134                                                **    IPC
135                                                **/
136
137   /* offset 0xC0 */
138   l4_umword_t            total_ram;           ///< Size of RAM in bytes
139   l4_umword_t            processor_info;      ///< CPU info
140   l4_umword_t            _res04[14];          ///< reserved \internal
141
142   /* offset 0x140 */
143   volatile l4_cpu_time_t clock;               ///< L4 system clock (µs)
144   l4_umword_t            _res05[1];           ///< reserved \internal
145
146   /* offset 0x160 */
147   l4_umword_t            frequency_cpu;       ///< CPU frequency in kHz
148   l4_umword_t            frequency_bus;       ///< Bus frequency
149
150   /* offset 0x178 */
151   l4_umword_t            _res06[5];           ///< reserved \internal
152
153   /* offset 0x1A0 */
154   l4_umword_t            _res07[4];           ///< reserved \internal
155
156   /* offset 0x1C0 */
157   l4_umword_t            user_ptr;            ///< user_ptr
158   l4_umword_t            vhw_offset;          ///< offset to vhw structure
159   l4_umword_t            _res08[2];
160
161   /* offset 0x1E0 */
162   struct l4_kip_platform_info    platform_info;
163 } l4_kernel_info_t;