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.


added module directory tree and build configuration
[palacios.git] / palacios / src / palacios / vmm_symmod.c
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 #include <palacios/vmm.h>
20 #include <palacios/vmm_symmod.h>
21 #include <palacios/vmm_symbiotic.h>
22 #include <palacios/vm_guest.h>
23
24 static struct v3_sym_module  test_module;
25
26 int V3_init_symmod() {
27
28     return -1;
29 }
30
31
32
33 int v3_init_symmod_vm(struct v3_vm_info * info, v3_cfg_tree_t * cfg) {
34     return 0;
35 }
36
37
38
39 int v3_set_symmod_loader(struct v3_vm_info * vm, struct v3_symmod_loader_ops * ops, void * priv_data) {
40     struct v3_symmod_state * symmod_state = &(vm->sym_vm_state.symmod_state);
41     extern uint8_t symmod_start[];
42     extern uint8_t symmod_end[];
43
44
45
46
47     struct v3_sym_module tmp_mod = {
48         .name = "test",
49         .num_bytes = symmod_end - symmod_start,
50         .data = symmod_start,
51     };
52     
53     
54     test_module = tmp_mod;
55
56
57     symmod_state->loader_ops = ops;
58     symmod_state->loader_data = priv_data;
59
60     
61     return 0;
62
63 }
64
65
66
67
68
69 int v3_load_sym_module(struct v3_vm_info * vm, char * mod_name) {
70     struct v3_symmod_state * symmod_state = &(vm->sym_vm_state.symmod_state);
71
72     PrintDebug("Loading Module (%s)\n", mod_name);
73
74     return symmod_state->loader_ops->load_module(vm, test_module.name, test_module.num_bytes, symmod_state->loader_data);
75 }
76
77
78
79
80 struct v3_sym_module * v3_get_sym_module(struct v3_vm_info * vm, char * name) {
81     return &test_module;
82 }