4 #include <palacios/vm_dev.h>
7 // The generic device simply hooks ranges of ports, addresses, and irqs
8 // if they are not already hooked
10 // for each hooked port, it simply executes reads and writes and the same physical port,
11 // for each hooked memory range, it simply executes reads and writes on the same
12 // physical memory addresses
13 // for each hooked irq, it simply injects the irq into the VM
15 // These operations are also logged to serial (optionaly)
17 // If you attach a generic device *last*, you can capture all ops that are not
18 // already hooked, and capture a log of VM activity with respect to them.
20 // The effects of using the generic device should be identical to
21 // doing passthrough I/O, but with logging, and, of course, slower
25 // A port range is low..high, inclusive
26 typedef uint_t generic_port_range_type[2];
27 // A memory range is low..high, inclusive
28 typedef void *generic_address_range_type[2];
29 // An interrupt ory map range is low..high, inclusive
30 typedef uint_t generic_irq_range_type[2];
32 struct vm_device *create_generic(generic_port_range_type port_ranges[],
33 uint_t num_port_ranges,
34 generic_address_range_type addess_ranges[],
35 uint_t num_address_ranges,
36 generic_irq_range_type irq_ranges[],
37 uint_t num_irqranges);