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.


20dd3019281ab62b0aeee9de552d80d414b7a07e
[palacios.git] / palacios / include / palacios / vmm_io.h
1 /*
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.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
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.
13  *
14  * Author: Jack Lange <jarusl@cs.northwestern.edu>
15  *
16  * This is free software.  You are permitted to use,
17  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
18  */
19
20 #ifndef __VMM_IO_H
21 #define __VMM_IO_H
22
23
24 #ifdef __V3VEE__
25
26 #include <palacios/vmm_types.h>
27 #include <palacios/vmm_util.h>
28 #include <palacios/vmm_rbtree.h>
29
30 typedef struct rb_root v3_io_map_t;
31
32
33 struct guest_info;
34
35 void v3_init_io_map(struct guest_info * info);
36
37
38
39
40 /* External API */
41 int v3_hook_io_port(struct guest_info * info, uint_t port, 
42                     int (*read)(ushort_t port, void * dst, uint_t length, void * priv_data),
43                     int (*write)(ushort_t port, void * src, uint_t length, void * priv_data), 
44                     void * priv_data);
45
46 int v3_unhook_io_port(struct guest_info * info, uint_t port);
47
48
49
50
51 struct v3_io_hook {
52     ushort_t port;
53
54     // Reads data into the IO port (IN, INS)
55     int (*read)(ushort_t port, void * dst, uint_t length, void * priv_data);
56
57     // Writes data from the IO port (OUT, OUTS)
58     int (*write)(ushort_t port, void * src, uint_t length, void * priv_data);
59
60     void * priv_data;
61   
62     struct rb_node tree_node;
63
64 };
65
66
67 struct v3_io_hook * v3_get_io_hook(struct guest_info * info, uint_t port);
68
69
70 void v3_print_io_map(struct guest_info * info);
71
72
73
74
75 void v3_outb(ushort_t port, uchar_t value);
76 uchar_t v3_inb(ushort_t port);
77
78 void v3_outw(ushort_t port, ushort_t value);
79 ushort_t v3_inw(ushort_t port);
80
81 void v3_outdw(ushort_t port, uint_t value);
82 uint_t v3_indw(ushort_t port);
83
84
85
86 #endif // !__V3VEE__
87
88
89
90
91
92 #endif