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;
40 struct hashtable * module_table;
44 struct v3_sym_module {
48 } __attribute__((packed));
51 int v3_set_symmod_loader(struct v3_vm_info * vm, struct v3_symmod_loader_ops * ops, void * priv_data);
53 int v3_load_sym_module(struct v3_vm_info * vm, char * mod_name);
56 int v3_init_symmod_vm(struct v3_vm_info * vm, v3_cfg_tree_t * cfg);
59 struct v3_sym_module * v3_get_sym_module(struct v3_vm_info * vm, char * name);
64 #define register_module(name, start, end) \
65 static char v3_module_name[] = name; \
66 static struct v3_sym_module _v3_module \
67 __attribute__((__used__)) \
68 __attribute__((unused, __section__ ("_v3_modules"), \
69 aligned(sizeof(addr_t)))) \
70 = {v3_module_name, start, end};