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 list_head dev_link;
44 struct list_head io_hooks;
46 struct list_head mem_hooks;
48 struct list_head irq_hooks;
54 struct vm_device * allocate_device();
55 struct vm_device * create_device(char * name, struct vm_device_ops * ops, void * private_data);
56 void free_device(struct vm_device * dev);
60 int dev_hook_io(struct vm_device *dev,
62 int (*read)(ushort_t port, void * dst, uint_t length, struct vm_device * dev),
63 int (*write)(ushort_t port, void * src, uint_t length, struct vm_device * dev));
65 int dev_unhook_io(struct vm_device *dev,
68 int dev_hook_mem(struct vm_device *dev,
72 int dev_unhook_mem(struct vm_device * dev,
77 int dev_hook_irq(struct vm_device * dev,
79 int (*handler)(uint_t irq, struct vm_device * dev));
80 int dev_unhook_irq(struct vm_device * dev, uint_t irq);