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.


added linux swap header
[palacios.git] / palacios / src / vmboot / vmxassist / vmx_assist.h
1 /*
2  * vmx_assist.h: Context definitions for the VMXASSIST world switch.
3  *
4  * Leendert van Doorn, leendert@watson.ibm.com
5  * Copyright (c) 2005, International Business Machines Corporation.
6  */
7
8 #ifndef _VMX_ASSIST_H_
9 #define _VMX_ASSIST_H_
10
11 #define VMXASSIST_BASE         0xD0000
12 #define VMXASSIST_MAGIC        0x17101966
13 #define VMXASSIST_MAGIC_OFFSET (VMXASSIST_BASE+8)
14
15 #define VMXASSIST_NEW_CONTEXT (VMXASSIST_BASE + 12)
16 #define VMXASSIST_OLD_CONTEXT (VMXASSIST_NEW_CONTEXT + 4)
17
18 #ifndef __ASSEMBLY__
19
20 union vmcs_arbytes {
21     struct arbyte_fields {
22         unsigned int seg_type : 4,
23             s         : 1,
24             dpl       : 2,
25             p         : 1,
26             reserved0 : 4,
27             avl       : 1,
28             reserved1 : 1,
29             default_ops_size: 1,
30             g         : 1,
31             null_bit  : 1,
32             reserved2 : 15;
33     } fields;
34     unsigned int bytes;
35 };
36
37 /*
38  * World switch state
39  */
40 struct vmx_assist_context {
41     uint32_t  eip;        /* execution pointer */
42     uint32_t  esp;        /* stack pointer */
43     uint32_t  eflags;     /* flags register */
44     uint32_t  cr0;
45     uint32_t  cr3;        /* page table directory */
46     uint32_t  cr4;
47     uint32_t  idtr_limit; /* idt */
48     uint32_t  idtr_base;
49     uint32_t  gdtr_limit; /* gdt */
50     uint32_t  gdtr_base;
51     uint32_t  cs_sel;     /* cs selector */
52     uint32_t  cs_limit;
53     uint32_t  cs_base;
54     union vmcs_arbytes cs_arbytes;
55     uint32_t  ds_sel;     /* ds selector */
56     uint32_t  ds_limit;
57     uint32_t  ds_base;
58     union vmcs_arbytes ds_arbytes;
59     uint32_t  es_sel;     /* es selector */
60     uint32_t  es_limit;
61     uint32_t  es_base;
62     union vmcs_arbytes es_arbytes;
63     uint32_t  ss_sel;     /* ss selector */
64     uint32_t  ss_limit;
65     uint32_t  ss_base;
66     union vmcs_arbytes ss_arbytes;
67     uint32_t  fs_sel;     /* fs selector */
68     uint32_t  fs_limit;
69     uint32_t  fs_base;
70     union vmcs_arbytes fs_arbytes;
71     uint32_t  gs_sel;     /* gs selector */
72     uint32_t  gs_limit;
73     uint32_t  gs_base;
74     union vmcs_arbytes gs_arbytes;
75     uint32_t  tr_sel;     /* task selector */
76     uint32_t  tr_limit;
77     uint32_t  tr_base;
78     union vmcs_arbytes tr_arbytes;
79     uint32_t  ldtr_sel;   /* ldtr selector */
80     uint32_t  ldtr_limit;
81     uint32_t  ldtr_base;
82     union vmcs_arbytes ldtr_arbytes;
83 };
84 typedef struct vmx_assist_context vmx_assist_context_t;
85
86 #endif /* __ASSEMBLY__ */
87
88 #endif /* _VMX_ASSIST_H_ */
89
90 /*
91  * Local variables:
92  * mode: C
93  * c-set-style: "BSD"
94  * c-basic-offset: 4
95  * tab-width: 4
96  * indent-tabs-mode: nil
97  * End:
98  */