4 #include <palacios/vmm_types.h>
5 #include <palacios/vmm_list.h>
6 #include <palacios/vmm_dev_mgr.h>
14 struct vm_device_ops {
15 int (*init)(struct vm_device *dev);
16 int (*deinit)(struct vm_device *dev);
19 int (*reset)(struct vm_device *dev);
21 int (*start)(struct vm_device *dev);
22 int (*stop)(struct vm_device *dev);
25 //int (*save)(struct vm_device *dev, struct *iostream);
26 //int (*restore)(struct vm_device *dev, struct *iostream);
36 struct vm_device_ops * ops;
38 struct guest_info * vm;
40 struct vm_device *next, *prev;
43 struct dev_io_hook_list io_hooks;
44 struct dev_mem_hook_list mem_hooks;
49 struct vm_device * allocate_device();
50 struct vm_device * create_device(char * name, struct vm_device_ops * ops, void * private_data);
51 void free_device(struct vm_device * dev);
55 int dev_hook_io(struct vm_device *dev,
57 int (*read)(ushort_t port, void * dst, uint_t length, struct vm_device * dev),
58 int (*write)(ushort_t port, void * src, uint_t length, struct vm_device * dev));
60 int dev_unhook_io(struct vm_device *dev,
63 int dev_hook_mem(struct vm_device *dev,
67 int dev_unhook_mem(struct vm_device * dev,