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.


split the vmm from the internal geekos
[palacios.releases.git] / palacios / scripts / generate_vmcs_serialization.pl
1 #!/usr/bin/perl
2
3 $#ARGV==0 or die "gimme a filename\n";
4
5 $file=shift;
6
7 @list=();
8
9 open(HEADER,">$file.h");
10 open(SOURCE,">$file.c");
11
12 print HEADER "#ifndef $file\n";
13 print HEADER "#define $file\n";
14 print HEADER "#include <geekos/vmcs.h>\n";
15
16 print SOURCE "#include <geekos/$file.h>\n";
17
18 while (<STDIN>) {
19   if (/\#define\s+(\S+)\s+/) {
20     push @list, $1;
21     GenSerUnserCode($1);
22   }
23 }
24
25 GenPrintAllCode(@list);
26
27 print HEADER "#endif\n";
28
29 sub GenSerUnserCode {
30   my $name=shift;
31
32   print SOURCE <<END
33
34 void    Set_$name(uint_t val) { VMCS_WRITE($name,val); }
35 uint_t  Get_$name() { uint_t rc; VMCS_READ($name,&rc); return rc; }
36
37 void    Print_$name() { PrintTrace("$name = %x\\n", Get_$name()); }
38
39 END
40
41 ;
42   print HEADER <<END2
43
44 void    Set_$name(uint_t val);
45 uint_t  Get_$name();
46
47 void    Print_$name();
48
49 END2
50
51 ;
52
53 }
54
55
56 sub GenPrintAllCode  {
57   print SOURCE "void PrintTrace_VMCS_ALL() {\n";
58   while (my $name=shift) { 
59     print SOURCE "  PrintTrace_$name();\n";
60   }
61   print SOURCE "}\n";
62   print HEADER "void PrintTrace_VMCS_ALL();\n";
63 }