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 full device support
[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_device_types.h>
6 #include <palacios/vmm_list.h>
7 #include <palacios/vmm_string.h>
8
9
10 struct vm_device;
11 struct guest_info;
12
13 struct vm_dev_list {
14   struct vm_device * head;
15   uint_t num_devs;
16 };
17
18
19 struct dev_io_hook_list {
20   struct dev_io_hook * head;
21   uint_t num_hooks;
22 };
23
24
25 struct dev_mem_hook_list {
26   struct dev_mem_hook * head;
27   uint_t num_hooks;
28 };
29
30
31
32 struct vmm_dev_mgr {
33   struct vm_dev_list dev_list;
34   struct dev_io_hook_list io_hooks;
35   struct dev_mem_hook_list mem_hooks;
36 };
37
38
39
40 struct dev_io_hook {
41   ushort_t port;
42   
43   int (*read)(ushort_t port, void * dst, uint_t length, struct vm_device * dev);
44   int (*write)(ushort_t port, void * src, uint_t length, struct vm_device * dev);
45
46   struct vm_device * dev;
47
48   // Do not touch anything below this  
49   struct dev_io_hook *dev_next, *dev_prev;
50   struct dev_io_hook *mgr_next, *mgr_prev;
51 };
52
53 struct dev_mem_hook {
54   void             *addr_start;
55   void             *addr_end;
56
57   // Do not touch anything below this
58   struct dev_mem_hook *dev_next, *dev_prev;
59   struct dev_mem_hook *mgr_next, *mgr_prev;
60 };
61
62
63
64 // Registration of devices
65
66 //
67 // The following device manager functions should only be called
68 // when the guest is stopped
69 //
70
71 int dev_mgr_init(struct vmm_dev_mgr *mgr);
72 int dev_mgr_deinit(struct vmm_dev_mgr * mgr);
73
74
75
76 int attach_device(struct guest_info *vm, struct vm_device * dev);
77 int unattach_device(struct vm_device *dev);
78
79
80 int dev_mgr_add_device(struct vmm_dev_mgr * mgr, struct vm_device * dev);
81 int dev_mgr_remove_device(struct vmm_dev_mgr * mgr, struct vm_device * dev);
82
83
84 void PrintDebugDevMgr(struct vmm_dev_mgr * mgr);
85 void PrintDebugDev(struct vm_device * dev);
86 void PrintDebugDevIO(struct vm_device * dev);
87 void PrintDebugDevMgrIO(struct vmm_dev_mgr * mgr);
88
89 #endif