00001
00002
00027
00028 #ifndef _L4_ENV_ENV_H
00029 #define _L4_ENV_ENV_H
00030
00031
00032 #include <l4/sys/types.h>
00033 #include <l4/env/cdefs.h>
00034 #include <l4/env/system.h>
00035 #include <l4/dm_generic/types.h>
00036
00037
00038
00039
00040
00041 #define L4ENV_MAXSECT 64
00042 #define L4ENV_MAXPATH 256
00043
00044
00049 typedef struct
00050 {
00051 l4_uint32_t major_id;
00052 l4_uint32_t minor_id;
00053 l4_uint8_t arch_data;
00054 l4_uint8_t arch_class;
00055 l4_uint16_t arch;
00056 l4_uint32_t flags;
00057 } l4env_version_info_t;
00058
00059
00060
00062 #define L4_DSTYPE_READ 0x0001
00063
00065 #define L4_DSTYPE_WRITE 0x0002
00066
00068 #define L4_DSTYPE_EXECUTE 0x0004
00069
00072 #define L4_DSTYPE_RELOCME 0x0008
00073
00075 #define L4_DSTYPE_LINKME 0x0010
00076
00079 #define L4_DSTYPE_PAGEME 0x0020
00080
00082 #define L4_DSTYPE_RESERVEME 0x0040
00083
00086 #define L4_DSTYPE_SHARE 0x0080
00087
00089 #define L4_DSTYPE_OBJ_BEGIN 0x0100
00090
00092 #define L4_DSTYPE_OBJ_END 0x0200
00093
00096 #define L4_DSTYPE_ERRLINK 0x0400
00097
00099 #define L4_DSTYPE_STARTUP 0x0800
00100
00102 #define L4_DSTYPE_APP_IS_OWNER 0x1000
00103
00105 #define L4_DSTYPE_EXEC_IS_OWNER 0x2000
00106
00108 #define L4ENV_INFOPAGE_MAGIC 0x7634456e
00109
00114 typedef struct
00115 {
00116 unsigned id:16;
00117 unsigned type:16;
00118 } l4exec_info_t;
00119
00124 typedef struct
00125 {
00126 l4_addr_t addr;
00127 l4_size_t size;
00128 l4dm_dataspace_t ds;
00129 l4exec_info_t info;
00130 } l4exec_section_t;
00131
00136 typedef struct
00137 {
00138 int has_x86_vga : 1;
00139 int has_x86_bios : 1;
00140 int hash_dyn_libs : 1;
00141 } l4env_loader_info_t;
00142
00147 typedef struct
00148 {
00149
00150 l4env_system_info_t sys_info;
00151 l4env_version_info_t ver_info;
00152 l4_uint32_t num_threads;
00153 l4_uint32_t stack_size;
00154 l4_addr_t vm_low;
00155 l4_addr_t vm_high;
00156
00157 l4_threadid_t names_id;
00158 l4_threadid_t memserv_id;
00159 l4_threadid_t taskserv_id;
00160 l4_threadid_t fprov_id;
00161 l4_threadid_t loader_id;
00162 l4_threadid_t parent_id;
00163
00164
00165
00166 l4_threadid_t image_dm_id;
00167 l4_threadid_t text_dm_id;
00168 l4_threadid_t data_dm_id;
00169 l4_threadid_t stack_dm_id;
00170 l4_addr_t entry_1st;
00171 l4_addr_t entry_2nd;
00172
00173
00174 int section_num;
00175 l4exec_section_t section[L4ENV_MAXSECT];
00176
00177
00178
00179
00180 l4_addr_t addr_libloader;
00181
00182 l4_addr_t stack_low;
00183 l4_addr_t stack_high;
00184
00185
00186 char binpath[L4ENV_MAXPATH];
00187 char libpath[L4ENV_MAXPATH];
00188
00189 l4_addr_t addr_mb_info;
00190
00191
00192 l4_addr_t interp;
00193 l4_addr_t phdr;
00194 l4_uint32_t phnum;
00195 int num_init_fn;
00196 l4_addr_t init_fn[64];
00197
00198 l4env_loader_info_t loader_info;
00199
00200 l4_uint32_t magic;
00201 } l4env_infopage_t;
00202
00203
00204
00205
00206
00207
00208
00209 #define L4ENV_MEMORY_SERVER 0x00000001
00210 #define L4ENV_TASK_SERVER 0x00000002
00211 #define L4ENV_NAME_SERVER 0x00000003
00212 #define L4ENV_FPROV_SERVER 0x00000004
00213 #define L4ENV_SIGMA0 0x00000005
00214
00215 #define L4ENV_MAX_THREADS 0x00000010
00216 #define L4ENV_DEFAULT_STACK_SIZE 0x00000011
00217 #define L4ENV_MAX_STACK_SIZE 0x00000012
00218 #define L4ENV_DEFAULT_PRIO 0x00000013
00219 #define L4ENV_VM_LOW 0x00000014
00220 #define L4ENV_VM_HIGH 0x00000015
00221
00222 __BEGIN_DECLS;
00223
00224
00237
00238 L4_CV int
00239 l4env_request_service(l4_uint32_t key,
00240 l4_threadid_t * service);
00241
00242
00255
00256 L4_CV int
00257 l4env_request_config_u32(l4_uint32_t key,
00258 l4_addr_t * cfg);
00259
00260
00274
00275 L4_CV int
00276 l4env_request_config_string(l4_uint32_t key,
00277 char * str,
00278 int max_len);
00279
00280
00288
00289 L4_CV l4env_infopage_t *
00290 l4env_get_infopage(void);
00291
00292
00301
00302 L4_CV void
00303 l4env_set_sigma0_id(l4_threadid_t id);
00304
00305
00312
00313 L4_CV void
00314 l4env_set_default_dsm(l4_threadid_t id);
00315
00316
00322
00323 L4_CV l4_threadid_t
00324 l4env_get_default_dsm(void);
00325
00326
00332
00333 L4_CV l4_threadid_t
00334 l4env_get_parent(void);
00335
00336
00342
00343 L4_CV unsigned
00344 l4env_startup_done(void);
00345
00346 __END_DECLS;
00347
00348 #endif
00349