2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
11 * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Jack Lange <jarusl@cs.northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
20 #ifndef __VMM_SYM_MOD_H__
21 #define __VMM_SYM_MOD_H__
25 #include <palacios/vmm_config.h>
26 #include <palacios/vmm_hashtable.h>
34 #define V3_SYMMOD_INV (0x00000000)
35 #define V3_SYMMOD_LNX (0x00000001)
36 #define V3_SYMMOD_MOD (0x00000002)
37 #define V3_SYMMOD_SEC (0x00000003)
38 union v3_symmod_flags {
42 } __attribute__((packed));
43 } __attribute__((packed));
46 struct v3_sym_module {
50 uint32_t flags; // see 'struct v3_symmod_flags'
51 } __attribute__((packed));
55 struct v3_symmod_loader_ops {
57 int (*load_module)(struct v3_vm_info * vm, struct v3_sym_module * mod, void * priv_data);
61 struct v3_symmod_state {
63 struct v3_symmod_loader_ops * loader_ops;
66 struct hashtable * module_table;
68 /* List containing V3 symbols */
69 /* (defined in vmm_symmod.c) */
70 struct list_head v3_sym_list;
75 int v3_set_symmod_loader(struct v3_vm_info * vm, struct v3_symmod_loader_ops * ops, void * priv_data);
77 int v3_load_sym_module(struct v3_vm_info * vm, char * mod_name);
79 int v3_init_symmod_vm(struct v3_vm_info * vm, v3_cfg_tree_t * cfg);
81 struct v3_sym_module * v3_get_sym_module(struct v3_vm_info * vm, char * name);
86 #define register_module(name, start, end, flags) \
87 static char v3_module_name[] = name; \
88 static struct v3_sym_module _v3_module \
89 __attribute__((__used__)) \
90 __attribute__((unused, __section__ ("_v3_modules"), \
91 aligned(sizeof(addr_t)))) \
92 = {v3_module_name, start, end, flags};