1 /* $NetBSD: vmx_assist.h,v 1.3 2007/10/17 19:58:31 garbled Exp $ */
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)
39 #define NR_EXCEPTION_HANDLER 32
40 #define NR_INTERRUPT_HANDLERS 16
41 #define NR_TRAPS (NR_EXCEPTION_HANDLER+NR_INTERRUPT_HANDLERS)
44 struct arbyte_fields
{
45 unsigned int seg_type
: 4,
63 struct vmx_assist_context
{
64 uint32_t eip
; /* execution pointer */
65 uint32_t esp
; /* stack pointer */
66 uint32_t eflags
; /* flags register */
68 uint32_t cr3
; /* page table directory */
70 uint32_t idtr_limit
; /* idt */
72 uint32_t gdtr_limit
; /* gdt */
74 uint32_t cs_sel
; /* cs selector */
77 union vmcs_arbytes cs_arbytes
;
78 uint32_t ds_sel
; /* ds selector */
81 union vmcs_arbytes ds_arbytes
;
82 uint32_t es_sel
; /* es selector */
85 union vmcs_arbytes es_arbytes
;
86 uint32_t ss_sel
; /* ss selector */
89 union vmcs_arbytes ss_arbytes
;
90 uint32_t fs_sel
; /* fs selector */
93 union vmcs_arbytes fs_arbytes
;
94 uint32_t gs_sel
; /* gs selector */
97 union vmcs_arbytes gs_arbytes
;
98 uint32_t tr_sel
; /* task selector */
101 union vmcs_arbytes tr_arbytes
;
102 uint32_t ldtr_sel
; /* ldtr selector */
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_ */
121 * indent-tabs-mode: nil