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 irq initial setup
[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   uint_t num_irq_hooks;
23   struct list_head irq_hooks;
24   */
25 };
26
27
28
29 struct dev_io_hook {
30   ushort_t port;
31   
32   int (*read)(ushort_t port, void * dst, uint_t length, struct vm_device * dev);
33   int (*write)(ushort_t port, void * src, uint_t length, struct vm_device * dev);
34
35   struct vm_device * dev;
36
37   // Do not touch anything below this  
38   /*
39     struct dev_io_hook *dev_next, *dev_prev;
40     struct dev_io_hook *mgr_next, *mgr_prev;
41   */
42   struct list_head dev_list;
43   struct list_head mgr_list;
44 };
45
46 struct dev_mem_hook {
47   void  *addr_start;
48   void  *addr_end;
49
50   struct vm_device * dev;
51
52   // Do not touch anything below this
53   struct list_head dev_list;
54   struct list_head mgr_list;
55 };
56
57 /*
58 struct dev_irq_hook {
59   uint_t irq;
60
61   int (*handler)(uint_t irq, struct vm_device * dev);
62
63   struct vm_device * dev;
64
65   struct list_head dev_list;
66   struct list_head mgr_list;
67 };
68
69 */
70 // Registration of devices
71
72 //
73 // The following device manager functions should only be called
74 // when the guest is stopped
75 //
76
77 int dev_mgr_init(struct vmm_dev_mgr *mgr);
78 int dev_mgr_deinit(struct vmm_dev_mgr * mgr);
79
80
81
82 int attach_device(struct guest_info *vm, struct vm_device * dev);
83 int unattach_device(struct vm_device *dev);
84
85
86 int dev_mgr_add_device(struct vmm_dev_mgr * mgr, struct vm_device * dev);
87 int dev_mgr_remove_device(struct vmm_dev_mgr * mgr, struct vm_device * dev);
88
89
90 /*
91   int dev_mgr_add_io_hook(struct vmm_dev_mgr * mgr, struct dev_io_hook * hook);
92   int dev_mgr_remove_io_hook(struct vmm_dev_mgr * mgr, struct dev_io_hook * hook);
93   int dev_add_io_hook(struct vmm_dev_mgr * mgr, struct dev_io_hook * hook);
94   int dev_remove_io_hook(struct vmm_dev_mgr * mgr, struct dev_io_hook * hook);
95   struct dev_io_hook * dev_find_io_hook(struct vm_device * dev, ushort_t port);
96   struct dev_io_hook * dev_mgr_find_io_hook(struct vmm_dev_mgr * mgr, ushort_t port)
97 */
98
99 void PrintDebugDevMgr(struct vmm_dev_mgr * mgr);
100 void PrintDebugDev(struct vm_device * dev);
101 void PrintDebugDevIO(struct vm_device * dev);
102 void PrintDebugDevMgrIO(struct vmm_dev_mgr * mgr);
103
104 #endif