1 /* (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> */
2 /* (c) 2008, The V3VEE Project <http://www.v3vee.org> */
9 #include <palacios/vmm_types.h>
10 #include <palacios/vmm_list.h>
11 #include <palacios/vmm_dev_mgr.h>
19 struct vm_device_ops {
20 int (*init)(struct vm_device *dev);
21 int (*deinit)(struct vm_device *dev);
24 int (*reset)(struct vm_device *dev);
26 int (*start)(struct vm_device *dev);
27 int (*stop)(struct vm_device *dev);
30 //int (*save)(struct vm_device *dev, struct *iostream);
31 //int (*restore)(struct vm_device *dev, struct *iostream);
41 struct vm_device_ops * ops;
43 struct guest_info * vm;
45 struct list_head dev_link;
49 struct list_head io_hooks;
51 struct list_head mem_hooks;
53 struct list_head irq_hooks;
59 struct vm_device * allocate_device();
60 struct vm_device * create_device(char * name, struct vm_device_ops * ops, void * private_data);
61 void free_device(struct vm_device * dev);
65 int dev_hook_io(struct vm_device *dev,
67 int (*read)(ushort_t port, void * dst, uint_t length, struct vm_device * dev),
68 int (*write)(ushort_t port, void * src, uint_t length, struct vm_device * dev));
70 int dev_unhook_io(struct vm_device *dev,
73 int dev_hook_mem(struct vm_device *dev,
77 int dev_unhook_mem(struct vm_device * dev,
82 int dev_hook_irq(struct vm_device * dev,
84 int (*handler)(uint_t irq, struct vm_device * dev));
85 int dev_unhook_irq(struct vm_device * dev, uint_t irq);