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.


Avoid strict-aliasing related issues when compiling with optimization
[palacios.git] / linux_module / linux-exts.h
1 #include "palacios.h"
2
3
4
5
6
7 struct linux_ext {
8     char * name;
9     int (*init)( void );
10     int (*deinit)( void );
11     int (*guest_init)(struct v3_guest * guest, void ** priv_data);
12     int (*guest_deinit)(struct v3_guest * guest, void * priv_data);
13 };
14
15
16
17 int init_lnx_extensions( void );
18 int deinit_lnx_extensions( void );
19
20 int init_vm_extensions(struct v3_guest * guest);
21 int deinit_vm_extensions(struct v3_guest * guest);
22
23 void * get_vm_ext_data(struct v3_guest * guest, char * ext_name);
24
25
26
27 struct global_ctrl {
28     unsigned int cmd;
29
30     int (*handler)(unsigned int cmd, unsigned long arg);
31
32     struct rb_node tree_node;
33 };
34
35 int add_global_ctrl(unsigned int cmd, 
36                     int (*handler)(unsigned int cmd, unsigned long arg));
37
38 struct global_ctrl * get_global_ctrl(unsigned int cmd);
39
40 int remove_global_ctrl(unsigned int cmd);
41
42
43 #define register_extension(ext)                                 \
44     static struct linux_ext * _lnx_ext                          \
45     __attribute__((used))                                       \
46         __attribute__((unused, __section__("_lnx_exts"),                \
47                        aligned(sizeof(void *))))                \
48         = ext;