1 /* (c) 2008, Peter Dinda <pdinda@northwestern.edu> */
2 /* (c) 2008, The V3VEE Project <http://www.v3vee.org> */
7 #include <palacios/vm_dev.h>
10 // The generic device simply hooks ranges of ports, addresses, and irqs
11 // if they are not already hooked
13 // for each hooked port, it simply executes reads and writes and the same physical port,
14 // for each hooked memory range, it simply executes reads and writes on the same
15 // physical memory addresses
16 // for each hooked irq, it simply injects the irq into the VM
18 // These operations are also logged to serial (optionaly)
20 // If you attach a generic device *last*, you can capture all ops that are not
21 // already hooked, and capture a log of VM activity with respect to them.
23 // The effects of using the generic device should be identical to
24 // doing passthrough I/O, but with logging, and, of course, slower
28 #define GENERIC_PRINT_AND_PASSTHROUGH 0
29 #define GENERIC_PRINT_AND_IGNORE 1
31 // A port range is low..high, inclusive, third value is one of the above
32 typedef uint_t generic_port_range_type[3];
33 // A memory range is low..high, inclusive, flags
34 typedef void *generic_address_range_type[3];
35 // An interrupt ory map range is low..high, inclusive, flags
36 typedef uint_t generic_irq_range_type[3];
38 // The lists given are null terminated
39 struct vm_device *create_generic(generic_port_range_type port_ranges[],
40 generic_address_range_type addess_ranges[],
41 generic_irq_range_type irq_ranges[]);