Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / xen / include / xen3-public / hvm / vmx_assist.h
blobe581287cd848bd650396c54a70dc2e172a2d52e2
1 /* $NetBSD: vmx_assist.h,v 1.3 2007/10/17 19:58:31 garbled Exp $ */
2 /*
3 * vmx_assist.h: Context definitions for the VMXASSIST world switch.
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to
7 * deal in the Software without restriction, including without limitation the
8 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 * sell copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
23 * Leendert van Doorn, leendert@watson.ibm.com
24 * Copyright (c) 2005, International Business Machines Corporation.
27 #ifndef _VMX_ASSIST_H_
28 #define _VMX_ASSIST_H_
30 #define VMXASSIST_BASE 0xD0000
31 #define VMXASSIST_MAGIC 0x17101966
32 #define VMXASSIST_MAGIC_OFFSET (VMXASSIST_BASE+8)
34 #define VMXASSIST_NEW_CONTEXT (VMXASSIST_BASE + 12)
35 #define VMXASSIST_OLD_CONTEXT (VMXASSIST_NEW_CONTEXT + 4)
37 #ifndef __ASSEMBLY__
39 #define NR_EXCEPTION_HANDLER 32
40 #define NR_INTERRUPT_HANDLERS 16
41 #define NR_TRAPS (NR_EXCEPTION_HANDLER+NR_INTERRUPT_HANDLERS)
43 union vmcs_arbytes {
44 struct arbyte_fields {
45 unsigned int seg_type : 4,
46 s : 1,
47 dpl : 2,
48 p : 1,
49 reserved0 : 4,
50 avl : 1,
51 reserved1 : 1,
52 default_ops_size: 1,
53 g : 1,
54 null_bit : 1,
55 reserved2 : 15;
56 } fields;
57 unsigned int bytes;
61 * World switch state
63 struct vmx_assist_context {
64 uint32_t eip; /* execution pointer */
65 uint32_t esp; /* stack pointer */
66 uint32_t eflags; /* flags register */
67 uint32_t cr0;
68 uint32_t cr3; /* page table directory */
69 uint32_t cr4;
70 uint32_t idtr_limit; /* idt */
71 uint32_t idtr_base;
72 uint32_t gdtr_limit; /* gdt */
73 uint32_t gdtr_base;
74 uint32_t cs_sel; /* cs selector */
75 uint32_t cs_limit;
76 uint32_t cs_base;
77 union vmcs_arbytes cs_arbytes;
78 uint32_t ds_sel; /* ds selector */
79 uint32_t ds_limit;
80 uint32_t ds_base;
81 union vmcs_arbytes ds_arbytes;
82 uint32_t es_sel; /* es selector */
83 uint32_t es_limit;
84 uint32_t es_base;
85 union vmcs_arbytes es_arbytes;
86 uint32_t ss_sel; /* ss selector */
87 uint32_t ss_limit;
88 uint32_t ss_base;
89 union vmcs_arbytes ss_arbytes;
90 uint32_t fs_sel; /* fs selector */
91 uint32_t fs_limit;
92 uint32_t fs_base;
93 union vmcs_arbytes fs_arbytes;
94 uint32_t gs_sel; /* gs selector */
95 uint32_t gs_limit;
96 uint32_t gs_base;
97 union vmcs_arbytes gs_arbytes;
98 uint32_t tr_sel; /* task selector */
99 uint32_t tr_limit;
100 uint32_t tr_base;
101 union vmcs_arbytes tr_arbytes;
102 uint32_t ldtr_sel; /* ldtr selector */
103 uint32_t ldtr_limit;
104 uint32_t ldtr_base;
105 union vmcs_arbytes ldtr_arbytes;
107 unsigned char rm_irqbase[2];
109 typedef struct vmx_assist_context vmx_assist_context_t;
111 #endif /* __ASSEMBLY__ */
113 #endif /* _VMX_ASSIST_H_ */
116 * Local variables:
117 * mode: C
118 * c-set-style: "BSD"
119 * c-basic-offset: 4
120 * tab-width: 4
121 * indent-tabs-mode: nil
122 * End: