Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


57ef01c59d6739a07b7e4f255969c53716747e95
[palacios.releases.git] / palacios / include / palacios / vmm_symmod.h
1 /* 
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.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
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.
13  *
14  * Author: Jack Lange <jarusl@cs.northwestern.edu>
15  *
16  * This is free software.  You are permitted to use,
17  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
18  */
19
20 #ifndef __VMM_SYM_MOD_H__
21 #define __VMM_SYM_MOD_H__
22
23 #ifdef __V3VEE__
24
25 #include <palacios/vmm_config.h>
26 #include <palacios/vmm_hashtable.h>
27
28
29
30
31
32
33
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 {
39     uint32_t flags;
40     struct {
41         uint8_t type;
42     } __attribute__((packed));
43 } __attribute__((packed));
44
45
46 struct v3_sym_module {
47     char * name;
48     void * start_addr;
49     void * end_addr;
50     uint32_t flags; // see 'struct v3_symmod_flags'
51 } __attribute__((packed));
52
53
54
55 struct v3_symmod_loader_ops {
56
57     int (*load_module)(struct v3_vm_info * vm, struct v3_sym_module * mod,  void * priv_data);
58 };
59
60
61 struct v3_symmod_state {
62
63     struct v3_symmod_loader_ops * loader_ops;
64     void * loader_data;
65
66     struct hashtable * module_table;
67
68     /* List containing V3 symbols */
69     /* (defined in vmm_symmod.c)  */
70     struct list_head v3_sym_list;
71 };
72
73
74
75 int v3_set_symmod_loader(struct v3_vm_info * vm, struct v3_symmod_loader_ops * ops, void * priv_data);
76
77 int v3_load_sym_module(struct v3_vm_info * vm, char * mod_name);
78
79 int v3_init_symmod_vm(struct v3_vm_info * vm, v3_cfg_tree_t * cfg);
80
81 struct v3_sym_module * v3_get_sym_module(struct v3_vm_info * vm, char * name);
82
83
84
85
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};
93
94
95 int V3_init_symmod();
96
97
98
99
100
101
102
103 #endif
104
105 #endif