X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_symmod.h;h=57ef01c59d6739a07b7e4f255969c53716747e95;hb=b1f2d60bdd24fb6f758ad049c0a6859966a38955;hp=bf360d24099b6e85f26951612204cb59cab41374;hpb=4cc3e8965ada59e7f5a9e55e8ccbc9563d997b93;p=palacios.git diff --git a/palacios/include/palacios/vmm_symmod.h b/palacios/include/palacios/vmm_symmod.h index bf360d2..57ef01c 100644 --- a/palacios/include/palacios/vmm_symmod.h +++ b/palacios/include/palacios/vmm_symmod.h @@ -25,9 +25,36 @@ #include #include + + + + + + +#define V3_SYMMOD_INV (0x00000000) +#define V3_SYMMOD_LNX (0x00000001) +#define V3_SYMMOD_MOD (0x00000002) +#define V3_SYMMOD_SEC (0x00000003) +union v3_symmod_flags { + uint32_t flags; + struct { + uint8_t type; + } __attribute__((packed)); +} __attribute__((packed)); + + +struct v3_sym_module { + char * name; + void * start_addr; + void * end_addr; + uint32_t flags; // see 'struct v3_symmod_flags' +} __attribute__((packed)); + + + struct v3_symmod_loader_ops { - int (*load_module)(struct v3_vm_info * vm, char * name, int len, void * priv_data); + int (*load_module)(struct v3_vm_info * vm, struct v3_sym_module * mod, void * priv_data); }; @@ -36,46 +63,33 @@ struct v3_symmod_state { struct v3_symmod_loader_ops * loader_ops; void * loader_data; - struct hashtable * module_table; -}; - -struct v3_sym_module { - char name[32]; - uint16_t num_bytes; - char * data; + /* List containing V3 symbols */ + /* (defined in vmm_symmod.c) */ + struct list_head v3_sym_list; }; + int v3_set_symmod_loader(struct v3_vm_info * vm, struct v3_symmod_loader_ops * ops, void * priv_data); int v3_load_sym_module(struct v3_vm_info * vm, char * mod_name); - int v3_init_symmod_vm(struct v3_vm_info * vm, v3_cfg_tree_t * cfg); - struct v3_sym_module * v3_get_sym_module(struct v3_vm_info * vm, char * name); - -struct v3_module_hdr { - char * name; - void * start_addr; - void * end_addr; -} __attribute__((packed)); - - -#define register_module(name, start, end) \ +#define register_module(name, start, end, flags) \ static char v3_module_name[] = name; \ - static struct v3_module_hdr _v3_module \ + static struct v3_sym_module _v3_module \ __attribute__((__used__)) \ __attribute__((unused, __section__ ("_v3_modules"), \ aligned(sizeof(addr_t)))) \ - = {v3_module_name, start, end}; + = {v3_module_name, start, end, flags}; int V3_init_symmod();