2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
11 * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Jack Lange <jarusl@cs.northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
25 #include <palacios/vmm_types.h>
26 #include <palacios/vmm_list.h>
27 #include <palacios/vmm_dev_mgr.h>
35 struct vm_device_ops {
36 int (*init)(struct vm_device *dev);
37 int (*deinit)(struct vm_device *dev);
40 int (*reset)(struct vm_device *dev);
42 int (*start)(struct vm_device *dev);
43 int (*stop)(struct vm_device *dev);
46 //int (*save)(struct vm_device *dev, struct *iostream);
47 //int (*restore)(struct vm_device *dev, struct *iostream);
57 struct vm_device_ops * ops;
59 struct guest_info * vm;
61 struct list_head dev_link;
65 struct list_head io_hooks;
67 struct list_head mem_hooks;
69 struct list_head irq_hooks;
75 struct vm_device * allocate_device();
76 struct vm_device * create_device(char * name, struct vm_device_ops * ops, void * private_data);
77 void free_device(struct vm_device * dev);
81 int dev_hook_io(struct vm_device *dev,
83 int (*read)(ushort_t port, void * dst, uint_t length, struct vm_device * dev),
84 int (*write)(ushort_t port, void * src, uint_t length, struct vm_device * dev));
86 int dev_unhook_io(struct vm_device *dev,
89 int dev_hook_mem(struct vm_device *dev,
93 int dev_unhook_mem(struct vm_device * dev,
98 int dev_hook_irq(struct vm_device * dev,
100 int (*handler)(uint_t irq, struct vm_device * dev));
101 int dev_unhook_irq(struct vm_device * dev, uint_t irq);
105 #endif // ! __V3VEE__