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.


192a2b50f4d12aed05593d3a002f16fd98451e50
[palacios.git] / palacios / include / palacios / vm_dev.h
1 #ifndef __VM_DEV_H
2 #define __VM_DEV_H
3
4 #include <palacios/vmm_types.h>
5 #include <palacios/vmm_list.h>
6 #include <palacios/vmm_dev_mgr.h>
7
8 struct guest_info;
9
10
11 struct vm_device;
12
13
14 struct vm_device_ops {
15   int (*init)(struct vm_device *dev);
16   int (*deinit)(struct vm_device *dev);
17
18
19   int (*reset)(struct vm_device *dev);
20
21   int (*start)(struct vm_device *dev);
22   int (*stop)(struct vm_device *dev);
23
24
25   //int (*save)(struct vm_device *dev, struct *iostream);
26   //int (*restore)(struct vm_device *dev, struct *iostream);
27 };
28
29
30
31 struct vm_device {
32   char name[32];
33   
34   void *private_data;
35
36   struct vm_device_ops * ops;
37
38   struct guest_info * vm;
39
40   struct vm_device   *next, *prev;
41
42
43   struct dev_io_hook_list io_hooks;
44   struct dev_mem_hook_list mem_hooks;
45 };
46
47
48
49 struct vm_device * allocate_device();
50 struct vm_device * create_device(char * name, struct vm_device_ops * ops, void * private_data);
51 void free_device(struct vm_device * dev);
52
53
54
55 int dev_hook_io(struct vm_device   *dev,
56                 ushort_t            port,
57                 int (*read)(ushort_t port, void * dst, uint_t length, struct vm_device * dev),
58                 int (*write)(ushort_t port, void * src, uint_t length, struct vm_device * dev));
59
60 int dev_unhook_io(struct vm_device   *dev,
61                   ushort_t            port);
62
63 int dev_hook_mem(struct vm_device   *dev,
64                  void               *start,
65                  void               *end);
66
67 int dev_unhook_mem(struct vm_device   * dev,
68                    void               * start,
69                    void               * end);
70
71
72
73
74
75 #endif