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>
28 struct v3_symmod_loader_ops {
30 int (*load_module)(struct v3_vm_info * vm, char * name, int len, void * priv_data);
34 struct v3_symmod_state {
36 struct v3_symmod_loader_ops * loader_ops;
39 struct hashtable * module_table;
42 #define V3_SYMMOD_INV (0x00000000)
43 #define V3_SYMMOD_LNX (0x00000001)
44 #define V3_SYMMOD_MOD (0x00000002)
45 #define V3_SYMMOD_SEC (0x00000003)
46 union v3_symmod_flags {
50 } __attribute__((packed));
51 } __attribute__((packed));
54 struct v3_sym_module {
58 uint32_t flags; // see 'struct v3_symmod_flags'
59 } __attribute__((packed));
64 int v3_set_symmod_loader(struct v3_vm_info * vm, struct v3_symmod_loader_ops * ops, void * priv_data);
66 int v3_load_sym_module(struct v3_vm_info * vm, char * mod_name);
68 int v3_init_symmod_vm(struct v3_vm_info * vm, v3_cfg_tree_t * cfg);
70 struct v3_sym_module * v3_get_sym_module(struct v3_vm_info * vm, char * name);
75 #define register_module(name, start, end, flags) \
76 static char v3_module_name[] = name; \
77 static struct v3_sym_module _v3_module \
78 __attribute__((__used__)) \
79 __attribute__((unused, __section__ ("_v3_modules"), \
80 aligned(sizeof(addr_t)))) \
81 = {v3_module_name, start, end, flags};