Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


modified copyright tags
[palacios.git] / palacios / include / devices / generic.h
1 /* (c) 2008, Peter Dinda <pdinda@northwestern.edu> */
2 /* (c) 2008, The V3VEE Project <http://www.v3vee.org> */
3
4 #ifndef __GENERIC_H
5 #define __GENERIC_H
6
7 #include <palacios/vm_dev.h>
8
9 //
10 // The generic device simply hooks ranges of ports, addresses, and irqs
11 // if they are not already hooked
12 //
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
17 //
18 // These operations are also logged to serial (optionaly)
19 //
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.
22 //
23 // The effects of using the generic device should be identical to 
24 // doing passthrough I/O, but with logging, and, of course, slower
25 //
26
27
28 #define GENERIC_PRINT_AND_PASSTHROUGH 0
29 #define GENERIC_PRINT_AND_IGNORE      1
30
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];
37
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[]);  
42
43 #endif