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.


code clean up
[palacios.git] / palacios / include / palacios / vmm_dev_mgr.h
1 #ifndef _VMM_DEV_MGR
2 #define _VMM_DEV_MGR
3
4 #include <palacios/vmm_types.h>
5 #include <palacios/vmm_list.h>
6 #include <palacios/vmm_string.h>
7
8 struct vm_device;
9 struct guest_info;
10
11
12 struct vmm_dev_mgr {
13   uint_t num_devs;
14   struct list_head dev_list;
15
16   uint_t num_io_hooks;
17   struct list_head io_hooks;
18   
19   uint_t num_mem_hooks;
20   struct list_head mem_hooks;
21
22 };
23
24
25
26 // Registration of devices
27
28 //
29 // The following device manager functions should only be called
30 // when the guest is stopped
31 //
32
33 int v3_attach_device(struct guest_info *vm, struct vm_device * dev);
34 int v3_unattach_device(struct vm_device *dev);
35
36
37
38
39 #ifdef __V3VEE__
40
41 struct dev_io_hook {
42   ushort_t port;
43   
44   int (*read)(ushort_t port, void * dst, uint_t length, struct vm_device * dev);
45   int (*write)(ushort_t port, void * src, uint_t length, struct vm_device * dev);
46
47   struct vm_device * dev;
48
49   // Do not touch anything below this  
50
51   struct list_head dev_list;
52   struct list_head mgr_list;
53 };
54
55 struct dev_mem_hook {
56   void  *addr_start;
57   void  *addr_end;
58
59   struct vm_device * dev;
60
61   // Do not touch anything below this
62   struct list_head dev_list;
63   struct list_head mgr_list;
64 };
65
66
67 int dev_mgr_init(struct guest_info * info);
68 int dev_mgr_deinit(struct guest_info * info);
69
70 void PrintDebugDevMgr(struct guest_info * info);
71 void PrintDebugDev(struct vm_device * dev);
72 void PrintDebugDevIO(struct vm_device * dev);
73 void PrintDebugDevMgrIO(struct vmm_dev_mgr * mgr);
74
75 #endif // ! __V3VEE__
76
77 #endif