00001 /* $Id: kernel.h 30206 2007-10-03 13:57:52Z adam $ */ 00002 /*****************************************************************************/ 00008 /*****************************************************************************/ 00009 #ifndef __L4_KERNEL_H__ 00010 #define __L4_KERNEL_H__ 00011 00012 #include <l4/sys/types.h> 00013 00014 typedef struct { 00015 l4_addr_t start; 00016 l4_addr_t end; 00017 } l4_region_t; 00018 00023 typedef struct 00024 { 00025 /* offset 0x00 */ 00026 l4_uint32_t magic; 00029 l4_uint32_t version; 00030 l4_uint8_t offset_version_strings; 00031 l4_uint8_t fill0[3]; 00032 l4_uint8_t kip_sys_calls; 00033 l4_uint8_t fill1[3]; 00034 00035 /* the following stuff is undocumented; we assume that the kernel 00036 info page is located at offset 0x1000 into the L4 kernel boot 00037 image so that these declarations are consistent with section 2.9 00038 of the L4 Reference Manual */ 00039 00040 /* offset 0x10 */ 00041 /* Kernel debugger */ 00042 l4_umword_t init_default_kdebug; 00043 l4_umword_t default_kdebug_exception; 00044 l4_umword_t scheduler_granularity; 00045 l4_umword_t default_kdebug_end; 00046 00047 /* offset 0x20 */ 00048 /* Sigma0 */ 00049 l4_umword_t sigma0_esp; 00050 l4_umword_t sigma0_eip; 00051 l4_umword_t _res01[2]; 00052 00053 /* offset 0x30 */ 00054 /* Sigma1 */ 00055 l4_umword_t sigma1_esp; 00056 l4_umword_t sigma1_eip; 00057 l4_umword_t _res02[2]; 00058 00059 /* offset 0x40 */ 00060 /* Root task */ 00061 l4_umword_t root_esp; 00062 l4_umword_t root_eip; 00063 l4_umword_t _res03[2]; 00064 00065 /* offset 0x50 */ 00066 /* L4 configuration */ 00067 l4_umword_t l4_config; 00076 l4_umword_t mem_info; 00077 l4_umword_t kdebug_config; 00098 l4_umword_t kdebug_permission; 00124 /* offset 0x60 */ 00125 l4_umword_t total_ram; 00126 l4_umword_t _res04[15]; 00127 00128 /* offset 0xA0 */ 00129 volatile l4_cpu_time_t clock; 00130 volatile l4_cpu_time_t switch_time; 00137 /* offset 0xB0 */ 00138 l4_uint32_t frequency_cpu; 00139 l4_uint32_t frequency_bus; 00140 volatile l4_cpu_time_t thread_time; 00149 /* offset 0xC0 */ 00150 /* System call entries */ 00151 l4_umword_t sys_ipc; 00152 l4_umword_t sys_id_nearest; 00153 l4_umword_t sys_fpage_unmap; 00154 l4_umword_t sys_thread_switch; 00155 l4_umword_t sys_thread_schedule; 00156 l4_umword_t sys_lthread_ex_regs; 00157 l4_umword_t sys_task_new; 00158 l4_umword_t sys_privctrl; 00159 00160 l4_umword_t user_ptr; 00161 l4_umword_t vhw_offset; 00162 l4_uint8_t vkey_irq; 00163 00164 } l4_kernel_info_t; 00165 00170 #define L4_KERNEL_INFO_MAGIC (0x4BE6344CL) /* "L4ľK" */ 00171 00181 L4_INLINE int l4_kernel_info_version_offset(l4_kernel_info_t *kip); 00182 00183 00184 /************************************************************************* 00185 * Implementations 00186 *************************************************************************/ 00187 00188 L4_INLINE int 00189 l4_kernel_info_version_offset(l4_kernel_info_t *kip) 00190 { 00191 return kip->offset_version_strings << 4; 00192 } 00193 00194 #endif