00001
00008
00009
00010
00011
00012 #ifndef __CFG_H_
00013 #define __CFG_H_
00014
00015 #include <l4/sys/types.h>
00016 #include <l4/dm_generic/types.h>
00017 #include <l4/env/env.h>
00018 #include "kquota.h"
00019 #ifdef USE_INTEGRITY
00020 #include "integrity-types.h"
00021 #endif
00022
00023 #define CFG_MAX_MODULE 16
00024 #define CFG_MAX_MEM 4
00025 #define CFG_MAX_TASK 16
00026
00027 typedef struct
00028 {
00029 const char *fname;
00030 const char *args;
00031 l4_addr_t low;
00032 l4_addr_t high;
00033 } cfg_module_t;
00034
00035 typedef struct
00036 {
00037 l4_addr_t low;
00038 l4_addr_t high;
00039 l4_size_t size;
00040 l4_uint16_t flags;
00041 #define CFG_M_DMA_ABLE 0x00000001
00042 #define CFG_M_CONTIGUOUS 0x00000002
00043 #define CFG_M_DIRECT_MAPPED 0x00000004
00044 #define CFG_M_NOSUPERPAGES 0x00000008
00045 l4_uint16_t pool;
00046 } cfg_mem_t;
00047
00048 typedef struct cfg_cap_t
00049 {
00050 struct cfg_cap_t *next;
00051 char *dest;
00052 char type;
00053 #define CAP_TYPE_ALLOW 1
00054 #define CAP_TYPE_DENY 2
00055 } cfg_cap_t;
00056
00057 #ifdef USE_INTEGRITY
00058 typedef struct
00059 {
00060 char * integrity_service;
00061 integrity_id_t id;
00062 integrity_id_t parent_id;
00063 } cfg_integrity_t;
00064 #endif
00065 #define CFG_INTEGRITY_ID 1
00066 #define CFG_INTEGRITY_PARENT_ID 2
00067 #define CFG_INTEGRITY_SERVICE_ID 3
00068
00069 typedef struct
00070 {
00071 cfg_module_t task;
00072 cfg_module_t module[CFG_MAX_MODULE];
00073 cfg_module_t *next_module;
00074 cfg_mem_t mem[CFG_MAX_MEM];
00075 cfg_mem_t *next_mem;
00076 char *iobitmap;
00077 unsigned int taskno;
00078 unsigned int prio;
00079 unsigned int mcp;
00080 l4_threadid_t fprov_id;
00082 l4_threadid_t dsm_id;
00084 l4_threadid_t caphandler;
00085 cfg_cap_t *caplist;
00086 cfg_kquota_t *kquota;
00087 l4_addr_t image;
00088 l4_size_t sz_image;
00089 l4dm_dataspace_t ds_image;
00090 l4_taskid_t task_id;
00091 l4_uint32_t flags;
00092 #ifdef USE_INTEGRITY
00093 cfg_integrity_t integrity;
00094 #endif
00095 #define CFG_F_TEMPLATE 0x00000001
00096 #define CFG_F_MEMDUMP 0x00000002
00097 #define CFG_F_DIRECT_MAPPED 0x00000004
00098 #define CFG_F_ALLOW_KILL 0x00000008
00099 #define CFG_F_ALLOW_VGA 0x00000010
00100 #define CFG_F_SLEEP 0x00000020
00101 #define CFG_F_NO_SIGMA0 0x00000040
00102 #define CFG_F_ALLOW_CLI 0x00000080
00103 #define CFG_F_SHOW_APP_AREAS 0x00000100
00104 #define CFG_F_STOP 0x00000200
00105 #define CFG_F_NOSUPERPAGES 0x00000400
00106 #define CFG_F_INTERPRETER 0x00000800
00107 #define CFG_F_ALL_WRITABLE 0x00001000
00108 #define CFG_F_L4ENV_BINARY 0x00002000
00109 #define CFG_F_ALLOW_BIOS 0x00004000
00110 #define CFG_F_HASH_BINARY 0x00008000
00111 #define CFG_F_HASH_MODULES 0x00010000
00112 } cfg_task_t;
00113
00114 extern unsigned int cfg_verbose;
00115 extern unsigned int cfg_fiasco_symbols;
00116 extern unsigned int cfg_fiasco_lines;
00117 extern char cfg_binpath[L4ENV_MAXPATH];
00118 extern char cfg_libpath[L4ENV_MAXPATH];
00119 extern char cfg_modpath[L4ENV_MAXPATH];
00120
00121 int cfg_new_task(const char *fname, const char *args);
00122 void cfg_new_task_template(void);
00123 int cfg_new_module(const char *fname, const char *args,
00124 l4_addr_t low, l4_addr_t high);
00125 int cfg_new_mem(l4_size_t size, l4_addr_t low, l4_addr_t high,
00126 l4_umword_t flags);
00127 int cfg_new_ioport(int low, int high);
00128 cfg_task_t** cfg_next_task(void);
00129 int cfg_task_no (unsigned int no);
00130 int cfg_task_prio(unsigned int prio);
00131 int cfg_task_mcp (unsigned int mcp);
00132 int cfg_task_flag(unsigned int flag);
00133 int cfg_task_fprov(const char *fname);
00134 int cfg_task_dsm(const char *fname);
00135 int cfg_task_caphandler(const char *fname);
00136 int cfg_task_kquota(const char *name);
00137 int cfg_task_ipc(const char *name, int type);
00138 int cfg_task_integrity_id(const char *id64, int type);
00139
00140 int cfg_lookup_name(const char *name, l4_threadid_t *id);
00141 void cfg_setup_input(const char *cfg_buffer, int size);
00142 void cfg_done(void);
00143 int cfg_parse(void);
00144 int cfg_parse_init(void);
00145 int cfg_job(unsigned int flag, unsigned int number);
00146 int load_config_script(const char *fname_and_arg, l4_threadid_t fprov_id,
00147 const l4dm_dataspace_t *cfg_ds, l4_addr_t cfg_addr,
00148 l4_size_t cfg_size, l4_taskid_t owner,
00149 l4_uint32_t flags, int *is_binary,
00150 l4_taskid_t task_ids[]);
00151 int load_config_script_from_file(const char *fname_and_arg,
00152 l4_threadid_t fprov_id, l4_taskid_t owner,
00153 l4_uint32_t flags, l4_taskid_t task_ids[]);
00154 int cfg_init(void);
00155
00156 #endif