VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMSwitcher/VMMSwitcher.mac@ 850

Last change on this file since 850 was 19, checked in by vboxsync, 18 years ago

nasm.mac -> asmdefs.mac + header adjustments.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1; $Id: VMMSwitcher.mac 19 2007-01-15 13:07:05Z vboxsync $
2;; @file
3; VMM - World Switchers.
4;
5
6;
7; Copyright (C) 2006 InnoTek Systemberatung GmbH
8;
9; This file is part of VirtualBox Open Source Edition (OSE), as
10; available from http://www.virtualbox.org. This file is free software;
11; you can redistribute it and/or modify it under the terms of the GNU
12; General Public License as published by the Free Software Foundation,
13; in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14; distribution. VirtualBox OSE is distributed in the hope that it will
15; be useful, but WITHOUT ANY WARRANTY of any kind.
16;
17; If you received this file as part of a commercial VirtualBox
18; distribution, then only the terms of your commercial VirtualBox
19; license agreement apply instead of the previous paragraph.
20;
21
22%ifndef __VMMSwitcher_mac__
23%define __VMMSwitcher_mac__
24
25%include "iprt/asmdefs.mac"
26
27; enum VMMSWITCHER {
28%define VMMSWITCHER_INVALID 0
29%define VMMSWITCHER_32_TO_32 1
30%define VMMSWITCHER_32_TO_PAE 2
31%define VMMSWITCHER_32_TO_AMD64 3
32%define VMMSWITCHER_PAE_TO_32BIT 4
33%define VMMSWITCHER_PAE_TO_PAE 5
34%define VMMSWITCHER_PAE_TO_AMD64 6
35%define VMMSWITCHER_AMD64_TO_PAE 7
36%define VMMSWITCHER_AMD64_TO_AMD64 8
37%define VMMSWITCHER_HOST_TO_VMX 9
38%define VMMSWITCHER_HOST_TO_SVM 10
39%define VMMSWITCHER_MAX 11
40; }
41
42
43struc VMMSWITCHERDEF
44 .pvCode: RTCCPTR_RES 1
45 .pvFixups: RTCCPTR_RES 1
46 .pszDesc: RTCCPTR_RES 1
47 .pfnRelocate: RTCCPTR_RES 1
48 .enmType: resd 1
49 .cbCode: resd 1
50 .offR0HostToGuest: resd 1
51 .offGCGuestToHost: resd 1
52 .offGCCallTrampoline: resd 1
53 .offGCGuestToHostAsm: resd 1
54 .offGCGuestToHostAsmHyperCtx: resd 1
55 .offGCGuestToHostAsmGuestCtx: resd 1
56 ; disasm help
57 .offHCCode0: resd 1
58 .cbHCCode0: resd 1
59 .offHCCode1: resd 1
60 .cbHCCode1: resd 1
61 .offIDCode0: resd 1
62 .cbIDCode0: resd 1
63 .offIDCode1: resd 1
64 .cbIDCode1: resd 1
65 .offGCCode: resd 1
66 .cbGCCode: resd 1
67endstruc
68
69
70;/** @name Fixup Types.
71; * @{
72; */
73%define FIX_HC_2_GC_NEAR_REL 1
74%define FIX_HC_2_ID_NEAR_REL 2
75%define FIX_GC_2_HC_NEAR_REL 3
76%define FIX_GC_2_ID_NEAR_REL 4
77%define FIX_ID_2_HC_NEAR_REL 5
78%define FIX_ID_2_GC_NEAR_REL 6
79%define FIX_GC_FAR32 7
80%define FIX_GC_CPUM_OFF 8
81%define FIX_GC_VM_OFF 9
82%define FIX_HC_CPUM_OFF 10
83%define FIX_HC_VM_OFF 11
84%define FIX_INTER_32BIT_CR3 12
85%define FIX_INTER_PAE_CR3 13
86%define FIX_INTER_AMD64_CR3 14
87%define FIX_HYPER_32BIT_CR3 15
88%define FIX_HYPER_PAE_CR3 16
89%define FIX_HYPER_AMD64_CR3 17
90%define FIX_HYPER_CS 18
91%define FIX_HYPER_DS 19
92%define FIX_HYPER_TSS 20
93%define FIX_GC_TSS_GDTE_DW2 21
94%define FIX_CR4_MASK 22
95%define FIX_CR4_OSFSXR 23
96%define FIX_NO_FXSAVE_JMP 24
97%define FIX_NO_SYSENTER_JMP 25
98%define FIX_NO_SYSCALL_JMP 26
99%define FIX_HC_64BIT 27
100%define FIX_HC_64BIT_CPUM 28
101%define FIX_ID_32BIT 29
102%define FIX_ID_64BIT 30
103%define FIX_ID_FAR32_TO_64BIT_MODE 31
104%define FIX_GC_APIC_BASE_32BIT 32
105%define FIX_THE_END 255
106;/** @} */
107
108
109;;
110; Generate a fixup label.
111; @param %1 Type of fixup (use one of those %defines)
112; @param %2 Offset into the instruction.
113; @param %3 Optional fixup data.
114%macro FIXUP 2-*
115BEGINDATA
116 db %1 ; the type
117 dd %%instruction + %2 - NAME(Start)
118 %rotate 2
119 %rep %0 - 2
120 dd %1
121 %rotate 1
122 %endrep
123
124BEGINCODE
125%%instruction:
126%endmacro
127
128
129;; IMPORTANT all COM_ functions trashes esi, some edi and the LOOP_SHORT_WHILE kills ecx.
130;%define DEBUG_STUFF 1
131
132%ifdef DEBUG_STUFF
133 %define DEBUG_CHAR(ch) COM_CHAR ch
134 %define DEBUG_S_CHAR(ch) COM_CHAR ch
135%else
136 %define DEBUG_CHAR(ch)
137 %define DEBUG_S_CHAR(ch)
138%endif
139
140%endif ; !__VMMSwitcher_mac__
141
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette