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".
23 #include <palacios/vmm_types.h>
24 #include <palacios/vmm_list.h>
25 #include <palacios/vmm_dev_mgr.h>
33 struct vm_device_ops {
34 int (*init)(struct vm_device *dev);
35 int (*deinit)(struct vm_device *dev);
38 int (*reset)(struct vm_device *dev);
40 int (*start)(struct vm_device *dev);
41 int (*stop)(struct vm_device *dev);
44 //int (*save)(struct vm_device *dev, struct *iostream);
45 //int (*restore)(struct vm_device *dev, struct *iostream);
55 struct vm_device_ops * ops;
57 struct guest_info * vm;
59 struct list_head dev_link;
63 struct list_head io_hooks;
65 struct list_head mem_hooks;
67 struct list_head irq_hooks;
73 struct vm_device * allocate_device();
74 struct vm_device * create_device(char * name, struct vm_device_ops * ops, void * private_data);
75 void free_device(struct vm_device * dev);
79 int dev_hook_io(struct vm_device *dev,
81 int (*read)(ushort_t port, void * dst, uint_t length, struct vm_device * dev),
82 int (*write)(ushort_t port, void * src, uint_t length, struct vm_device * dev));
84 int dev_unhook_io(struct vm_device *dev,
87 int dev_hook_mem(struct vm_device *dev,
91 int dev_unhook_mem(struct vm_device * dev,
96 int dev_hook_irq(struct vm_device * dev,
98 int (*handler)(uint_t irq, struct vm_device * dev));
99 int dev_unhook_irq(struct vm_device * dev, uint_t irq);