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.


3b67c61d65b6c8eee28ef8fa5fd7a81e5f60df26
[palacios.git] / palacios / include / palacios / vmm_dev.h
1 #ifndef __VMM_DEV_H
2 #define __VMM_DEV_H
3
4 #include <palacios/vmm_types.h>
5
6 struct vm_guest;
7 struct vm_device_io_hook;
8 struct vm_device_mem_hook;
9
10
11 //
12 // This structure defines an abstract io and/or memory-mapped device
13 // It currently does not define the interaction with actual hardware
14 //
15
16
17
18 struct vm_device {
19   int (*init_device)(struct vm_device *dev, struct vm_guest *vm);
20   int (*deinit_device)(struct vm_device *dev);
21
22
23   int (*reset_device)(struct vm_device *dev);
24
25   int (*start_device)(struct vm_device *dev);
26   int (*stop_device)(struct vm_device *dev);
27
28
29   //
30   // To understand how to register these callbacks
31   // see vmm_dev_mgr.h
32   //
33   // Note that callbacks like these are only called
34   // when the port/memory is hooked as EMULATED
35   //
36
37
38   //
39   // If your device is I/O mapped, this function will
40   // be called on an I/O read
41   //
42
43   int (*read_io_port)(ushort_t port_read,
44                       void   *address, 
45                       uint_t length,
46                       struct vm_device *dev);
47
48   //
49   // If your device is I/O mapped, this function will
50   // be called on an I/O write
51   //
52
53   int (*write_io_port)(ushort_t port_written,
54                        void *address, 
55                        uint_t length,
56                        struct vm_device *dev);
57
58
59   //
60   // If your device is memory mapped, this function will
61   // be called on an memory read
62   //
63
64   int (*read_mapped_memory)(void   *address_read,
65                             void   *address, 
66                             uint_t length,
67                             struct vm_device *dev);
68
69   //
70   // If your device is memory mapped, this function will
71   // be called on an memory read
72   //
73
74   int (*write_mapped_memory)(void   *address_written,
75                              void   *address, 
76                              uint_t length,
77                              struct vm_device *dev);
78   
79
80   //int (*save_device)(struct vm_device *dev, struct *iostream);
81   //int (*restore_device)(struct vm_device *dev, struct *iostream);
82
83   struct guest_info  *vm;
84
85   void *private_data;
86
87   // Do not touch anything below this!
88
89   struct vm_device   *next, *prev;
90
91   struct vm_device_io_hook  *io_hooks;
92   struct vm_device_mem_hook *mem_hooks;
93
94 };
95
96
97 #endif