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.


restored file
[palacios.git] / palacios / include / palacios / vmm_io.h
1 #ifndef __VMM_IO_H
2 #define __VMM_IO_H
3
4 #include <palacios/vmm_types.h>
5
6 #include <palacios/vmm_util.h>
7
8 // FOREACH_IO_HOOK(vmm_io_map_t * io_map, vmm_io_hook_t * io_hook)
9 #define FOREACH_IO_HOOK(io_map, io_hook) for (io_hook = (io_map).head; io_hook != NULL; io_hook = (io_hook)->next)
10
11
12 typedef struct vmm_io_hook {
13   ushort_t port;
14
15   // Reads data into the IO port (IN, INS)
16   int (*read)(ushort_t port, void * dst, uint_t length);
17
18   // Writes data from the IO port (OUT, OUTS)
19   int (*write)(ushort_t port, void * src, uint_t length);
20
21   struct vmm_io_hook * next;
22   struct vmm_io_hook * prev;
23
24 } vmm_io_hook_t;
25
26
27 typedef struct vmm_io_map {
28   uint_t num_ports;
29
30
31   vmm_io_hook_t * head;
32
33 } vmm_io_map_t;
34
35
36 void add_io_hook(vmm_io_map_t * io_map, vmm_io_hook_t * io_hook);
37
38
39
40 vmm_io_hook_t * get_io_hook(vmm_io_map_t * io_map, uint_t port);
41
42
43 /* External API */
44 void hook_io_port(vmm_io_map_t * io_map, uint_t port, 
45                   int (*read)(ushort_t port, void * dst, uint_t length),
46                   int (*write)(ushort_t port, void * src, uint_t length));
47
48 void init_vmm_io_map(vmm_io_map_t * io_map);
49
50 void PrintDebugIOMap(vmm_io_map_t * io_map);
51
52
53 #endif