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.


real->protected mode switch should work now
[palacios.git] / palacios / include / geekos / vmm_ctrl_regs.h
1 #ifndef __VMM_CTRL_REGS_H
2 #define __VMM_CTRL_REGS_H
3
4
5 struct cr0_real {
6   uint_t pe    : 1;
7   uint_t mp    : 1;
8   uint_t em    : 1;
9   uint_t ts    : 1;
10 };
11
12
13 struct cr0_32 {
14   uint_t pe    : 1;
15   uint_t mp    : 1;
16   uint_t em    : 1;
17   uint_t ts    : 1;
18   uint_t et    : 1;
19   uint_t ne    : 1;
20   uint_t rsvd1 : 10;
21   uint_t wp    : 1;
22   uint_t rsvd2 : 1;
23   uint_t am    : 1;
24   uint_t rsvd3 : 10;
25   uint_t nw    : 1;
26   uint_t cd    : 1;
27   uint_t pg    : 1;
28 };
29
30
31 struct cr0_64 {
32   uint_t pe    : 1;
33   uint_t mp    : 1;
34   uint_t em    : 1;
35   uint_t ts    : 1;
36   uint_t et    : 1;
37   uint_t ne    : 1;
38   uint_t rsvd1 : 10;
39   uint_t wp    : 1;
40   uint_t rsvd2 : 1;
41   uint_t am    : 1;
42   uint_t rsvd3 : 10;
43   uint_t nw    : 1;
44   uint_t cd    : 1;
45   uint_t pg    : 1;
46
47   uint_t  rsvd4;  // MBZ
48 };
49
50
51 struct cr2_32 {
52   uint_t pf_vaddr;
53 };
54
55 struct cr2_64 {
56   ullong_t pf_vaddr;
57 };
58
59
60 struct cr3_32 {
61   uint_t rsvd1             : 3;
62   uint_t pwt               : 1;
63   uint_t pcd               : 1;
64   uint_t rsvd2             : 7;
65   uint_t pdt_base_addr    : 20;
66 };
67
68
69 struct cr3_32_PAE {
70   uint_t rsvd1             : 3;
71   uint_t pwt               : 1;
72   uint_t pcd               : 1;
73   uint_t pdpt_base_addr    : 27;
74 };
75
76
77 struct cr3_64 {
78   uint_t rsvd1             : 3;
79   uint_t pwt               : 1;
80   uint_t pcd               : 1;
81   uint_t rsvd2             : 7;
82   ullong_t pml4t_base_addr : 40;
83   uint_t rsvd3             : 12; 
84 };
85
86
87 struct cr4_32 {
88   uint_t vme               : 1;
89   uint_t pvi               : 1;
90   uint_t tsd               : 1;
91   uint_t de                : 1;
92   uint_t pse               : 1;
93   uint_t pae               : 1;
94   uint_t mce               : 1;
95   uint_t pge               : 1;
96   uint_t pce               : 1;
97   uint_t osf_xsr           : 1;
98   uint_t osx               : 1;
99   uint_t rsvd1             : 21;
100 };
101
102 struct cr4_64 {
103   uint_t vme               : 1;
104   uint_t pvi               : 1;
105   uint_t tsd               : 1;
106   uint_t de                : 1;
107   uint_t pse               : 1;
108   uint_t pae               : 1;
109   uint_t mce               : 1;
110   uint_t pge               : 1;
111   uint_t pce               : 1;
112   uint_t osf_xsr           : 1;
113   uint_t osx               : 1;
114   uint_t rsvd1             : 21;
115   uint_t rsvd2             : 32;
116 };
117
118 #endif