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.


added new copyright and license
[palacios.git] / palacios / include / palacios / vmm_dev_mgr.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_DEV_MGR
21 #define _VMM_DEV_MGR
22
23 #ifdef __V3VEE__
24
25 #include <palacios/vmm_types.h>
26 #include <palacios/vmm_list.h>
27 #include <palacios/vmm_string.h>
28
29 struct vm_device;
30 struct guest_info;
31
32
33 struct vmm_dev_mgr {
34   uint_t num_devs;
35   struct list_head dev_list;
36
37   uint_t num_io_hooks;
38   struct list_head io_hooks;
39   
40   uint_t num_mem_hooks;
41   struct list_head mem_hooks;
42
43 };
44
45
46
47 // Registration of devices
48
49 //
50 // The following device manager functions should only be called
51 // when the guest is stopped
52 //
53
54 int v3_attach_device(struct guest_info *vm, struct vm_device * dev);
55 int v3_unattach_device(struct vm_device *dev);
56
57
58
59
60
61
62 struct dev_io_hook {
63   ushort_t port;
64   
65   int (*read)(ushort_t port, void * dst, uint_t length, struct vm_device * dev);
66   int (*write)(ushort_t port, void * src, uint_t length, struct vm_device * dev);
67
68   struct vm_device * dev;
69
70   // Do not touch anything below this  
71
72   struct list_head dev_list;
73   struct list_head mgr_list;
74 };
75
76 struct dev_mem_hook {
77   void  *addr_start;
78   void  *addr_end;
79
80   struct vm_device * dev;
81
82   // Do not touch anything below this
83   struct list_head dev_list;
84   struct list_head mgr_list;
85 };
86
87
88 int dev_mgr_init(struct guest_info * info);
89 int dev_mgr_deinit(struct guest_info * info);
90
91 void PrintDebugDevMgr(struct guest_info * info);
92 void PrintDebugDev(struct vm_device * dev);
93 void PrintDebugDevIO(struct vm_device * dev);
94 void PrintDebugDevMgrIO(struct vmm_dev_mgr * mgr);
95
96 #endif // ! __V3VEE__
97
98 #endif