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.


reverted creation ordering
[palacios.git] / linux_module / linux-exts.c
1
2 #include "linux-exts.h"
3
4 /* 
5  * This is a place holder to ensure that the _lnx_exts section gets created by gcc
6  */
7 static struct {} null_ext  __attribute__((__used__))                    \
8     __attribute__((unused, __section__ ("_lnx_exts"),                \
9                    aligned(sizeof(void *))));
10
11
12
13
14 int init_vm_extensions(struct v3_guest * guest) {
15     extern struct linux_ext * __start__lnx_exts;
16     extern struct linux_ext * __stop__lnx_exts;
17     struct linux_ext * tmp_ext = __start__lnx_exts;
18     int i = 0;
19
20     while (tmp_ext != __stop__lnx_exts) {
21         printk("Registering Linux Extension (%s)\n", tmp_ext->name);
22         tmp_ext->init();
23
24         tmp_ext = &(__start__lnx_exts[++i]);
25     }
26     
27     return 0;
28
29 }
30
31 int init_lnx_extensions( void ) {
32     extern struct linux_ext * __start__lnx_exts;
33     extern struct linux_ext * __stop__lnx_exts;
34     struct linux_ext * tmp_ext = __start__lnx_exts;
35     int i = 0;
36
37     while (tmp_ext != __stop__lnx_exts) {
38         printk("Registering Linux Extension (%s)\n", tmp_ext->name);
39         tmp_ext->init();
40
41         tmp_ext = &(__start__lnx_exts[++i]);
42     }
43     
44     return 0;
45 }
46
47
48 int deinit_lnx_extensions( void ) {
49     extern struct linux_ext * __start__lnx_exts;
50     extern struct linux_ext * __stop__lnx_exts;
51     struct linux_ext * tmp_ext = __start__lnx_exts;
52     int i = 0;
53
54     while (tmp_ext != __stop__lnx_exts) {
55         printk("Cleaning up Linux Extension (%s)\n", tmp_ext->name);
56         tmp_ext->deinit();
57
58         tmp_ext = &(__start__lnx_exts[++i]);
59     }
60     
61     return 0;
62 }