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 emulator
[palacios.git] / palacios / include / palacios / vmm_emulator.h
1 #ifndef __VMM_EMULATOR_H__
2 #define __VMM_EMULATOR_H__
3
4 #ifdef __V3VEE__
5
6 #include <palacios/vmm_list.h>
7 #include <palacios/vmm_shadow_paging.h>
8 #include <palacios/vmm_paging.h>
9
10
11
12
13
14 struct emulated_page {
15   addr_t page_addr;
16   addr_t va;
17   pte32_t pte;
18   struct list_head page_list;
19 };
20
21 struct saved_page {
22   addr_t va;
23   pte32_t pte;
24   struct list_head page_list;
25 };
26
27
28 struct write_region {
29   void * write_data;
30   
31   uint_t length;
32   int (*write)(addr_t write_addr, void * src, uint_t length, void * priv_data);
33   addr_t write_addr;
34   void * private_data;
35   
36   struct list_head write_list;
37 };
38
39
40 struct emulation_state {
41   uint_t num_emulated_pages;
42   struct list_head emulated_pages;
43
44   uint_t num_saved_pages;
45   struct list_head saved_pages;
46
47   uint_t num_write_regions;
48   struct list_head write_regions;
49
50   uint_t running : 1;
51   uint_t instr_length;
52 };
53
54
55 int init_emulator(struct guest_info * info);
56
57
58 int v3_emulation_exit_handler(struct guest_info * info);
59
60 int v3_emulate_memory_write(struct guest_info * info, addr_t fault_gva,
61                             int (*write)(addr_t write_addr, void * src, uint_t length, void * priv_data), 
62                             addr_t write_addr, void * private_data);
63 int v3_emulate_memory_read(struct guest_info * info, addr_t fault_gva, 
64                            int (*read)(addr_t read_addr, void * dst, uint_t length, void * priv_data), 
65                            addr_t read_addr, void * private_data);
66
67
68 #endif // !__V3VEE__
69
70 #endif