1 /* Northwestern University */
2 /* (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> */
7 #include <palacios/vmm_types.h>
8 #include <palacios/vmm_list.h>
9 #include <palacios/vmm_dev_mgr.h>
17 struct vm_device_ops {
18 int (*init)(struct vm_device *dev);
19 int (*deinit)(struct vm_device *dev);
22 int (*reset)(struct vm_device *dev);
24 int (*start)(struct vm_device *dev);
25 int (*stop)(struct vm_device *dev);
28 //int (*save)(struct vm_device *dev, struct *iostream);
29 //int (*restore)(struct vm_device *dev, struct *iostream);
39 struct vm_device_ops * ops;
41 struct guest_info * vm;
43 struct list_head dev_link;
47 struct list_head io_hooks;
49 struct list_head mem_hooks;
51 struct list_head irq_hooks;
57 struct vm_device * allocate_device();
58 struct vm_device * create_device(char * name, struct vm_device_ops * ops, void * private_data);
59 void free_device(struct vm_device * dev);
63 int dev_hook_io(struct vm_device *dev,
65 int (*read)(ushort_t port, void * dst, uint_t length, struct vm_device * dev),
66 int (*write)(ushort_t port, void * src, uint_t length, struct vm_device * dev));
68 int dev_unhook_io(struct vm_device *dev,
71 int dev_hook_mem(struct vm_device *dev,
75 int dev_unhook_mem(struct vm_device * dev,
80 int dev_hook_irq(struct vm_device * dev,
82 int (*handler)(uint_t irq, struct vm_device * dev));
83 int dev_unhook_irq(struct vm_device * dev, uint_t irq);