VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/Support/win/SUPDrvA-win.asm@ 13730

Last change on this file since 13730 was 13536, checked in by vboxsync, 16 years ago

Wrong macro

File size: 13.6 KB
Line 
1; $Id$
2;; @file
3; VirtualBox Support Driver - Windows NT specific assembly parts.
4;
5
6;
7; Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 (GPL) as published by the Free Software
13; Foundation, in version 2 as it comes in the "COPYING" file of the
14; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16;
17; The contents of this file may alternatively be used under the terms
18; of the Common Development and Distribution License Version 1.0
19; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20; VirtualBox OSE distribution, in which case the provisions of the
21; CDDL are applicable instead of those of the GPL.
22;
23; You may elect to license modified versions of this file under the
24; terms and conditions of either the GPL or the CDDL or both.
25;
26; Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
27; Clara, CA 95054 USA or visit http://www.sun.com if you need
28; additional information or have any questions.
29;
30
31;*******************************************************************************
32;* Header Files *
33;*******************************************************************************
34%include "iprt/ntwrap.mac"
35
36BEGINCODE
37%ifdef RT_ARCH_AMD64
38%define _DbgPrint DbgPrint
39%endif
40extern _DbgPrint
41
42%if 1 ; see alternative in SUPDrv-win.cpp
43;;
44; Kind of alias for DbgPrint
45BEGINPROC SUPR0Printf
46 jmp _DbgPrint
47ENDPROC SUPR0Printf
48%endif
49
50
51%ifdef RT_WITH_W64_UNWIND_HACK
52 %ifdef RT_ARCH_AMD64
53
54;
55; This has the same order as the list in SUPDrv.c
56;
57NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ComponentRegisterFactory
58NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ComponentDeregisterFactory
59NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ComponentQueryFactory
60NtWrapDyn2DrvFunctionWith5Params supdrvNtWrap, SUPR0ObjRegister
61NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ObjAddRef
62NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ObjRelease
63NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ObjVerifyAccess
64NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0LockMem
65NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0UnlockMem
66NtWrapDyn2DrvFunctionWith5Params supdrvNtWrap, SUPR0ContAlloc
67NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ContFree
68NtWrapDyn2DrvFunctionWith5Params supdrvNtWrap, SUPR0LowAlloc
69NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0LowFree
70NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0MemAlloc
71NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0MemGetPhys
72NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0MemFree
73NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0PageAlloc
74NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0PageFree
75;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0Printf - cannot wrap this buster.
76NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemAlloc
77NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemAllocZ
78NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemFree
79NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemDup
80NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemDupEx
81NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemRealloc
82NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocLow
83NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocPage
84NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocPhys
85NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocPhysNC
86NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocCont
87NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjLockUser
88NtWrapDyn2DrvFunctionWith5Params supdrvNtWrap, RTR0MemObjMapKernel
89NtWrapDyn2DrvFunctionWith6Params supdrvNtWrap, RTR0MemObjMapUser
90;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAddress - not necessary
91;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAddressR3 - not necessary
92;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjSize - not necessary
93;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjIsMapping - not necessary
94;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjGetPagePhysAddr - not necessary
95NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjFree
96;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTProcSelf - not necessary
97;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0ProcHandleSelf - not necessary
98NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemFastMutexCreate
99NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemFastMutexDestroy
100NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemFastMutexRequest
101NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemFastMutexRelease
102NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventCreate
103NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventSignal
104NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventWait
105NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventWaitNoResume
106NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventDestroy
107NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiCreate
108NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiSignal
109NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiReset
110NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiWait
111NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiWaitNoResume
112NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiDestroy
113NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockCreate
114NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockDestroy
115NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockAcquire
116NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockRelease
117NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockAcquireNoInts
118NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockReleaseNoInts
119;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTTimeNanoTS - not necessary
120;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTTimeMilliTS - not necessary
121;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTTimeSystemNanoTS - not necessary
122;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTTimeSystemMilliTS - not necessary
123;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadNativeSelf - not necessary
124NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadSleep
125NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadYield
126%if 0 ; Thread APIs, Part 2
127;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadSelf
128NtWrapDyn2DrvFunctionWith7Params supdrvNtWrap, RTThreadCreate
129NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadGetNative
130NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadWait
131NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadWaitNoResume
132NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadGetName
133NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadSelfName
134NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadGetType
135NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadUserSignal
136NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadUserReset
137NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadUserWait
138NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadUserWaitNoResume
139%endif
140;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogDefaultInstance - a bit of a gamble, but we do not want the overhead!
141;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpCpuId - not necessary
142;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpCpuIdFromSetIndex - not necessary
143;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpCpuIdToSetIndex - not necessary
144;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpIsCpuPossible - not necessary
145;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetCount - not necessary
146;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetMaxCpuId - not necessary
147;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetOnlineCount - not necessary
148;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetOnlineSet - not necessary
149;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetSet - not necessary
150;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpIsCpuOnline - not necessary
151NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpOnAll
152NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpOnOthers
153NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpOnSpecific
154;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogRelDefaultInstance - not necessary.
155NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogSetDefaultInstanceThread
156;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogLogger - can't wrap this buster.
157;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogLoggerEx - can't wrap this buster.
158NtWrapDyn2DrvFunctionWith5Params supdrvNtWrap, RTLogLoggerExV
159;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogPrintf - can't wrap this buster. ;; @todo provide va_list log wrappers in RuntimeR0.
160NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogPrintfV
161NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, AssertMsg1
162;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, AssertMsg2 - can't wrap this buster.
163NtWrapDrv2DynFunctionWithAllRegParams supdrvNtWrap, RTPowerSignalEvent
164
165
166;;
167; @cproto DECLASM(int) supdrvNtWrapVMMR0EntryEx(PFNRT pfnVMMR0EntryEx, PVM pVM, unsigned uOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION pSession);
168;
169; @param pfnVMMR0EntryEx rcx
170; @param pVM rdx
171; @param uOperation r8
172; @param pReq r9
173; @param u64Arg [rsp + 28h] / [rbp + 30h]
174; @param pSession [rsp + 30h] / [rbp + 38h]
175;
176BEGINPROC supdrvNtWrapVMMR0EntryEx
177 NtWrapProlog supdrvNtWrapVMMR0EntryEx
178 NtWrapCreateMarker
179
180 mov rax, rcx
181 mov rcx, rdx
182 mov rdx, r8
183 mov r8, r9
184 mov r9, [rbp + 30h]
185 mov r11, [rbp + 38h]
186 mov [rsp + 20h], r11
187 call rax
188
189 NtWrapDestroyMarker
190 NtWrapEpilog supdrvNtWrapVMMR0EntryEx
191ENDPROC supdrvNtWrapVMMR0EntryEx
192
193
194;;
195; @cproto DECLASM(int) supdrvNtWrapVMMR0EntryFast(PFNRT pfnVMMR0EntryFast, PVM pVM, unsigned uOperation);
196;
197; @param pfnVMMR0EntryFast rcx
198; @param pVM rdx
199; @param uOperation r8
200;
201BEGINPROC supdrvNtWrapVMMR0EntryFast
202 NtWrapProlog supdrvNtWrapVMMR0EntryFast
203 NtWrapCreateMarker
204
205 mov rax, rcx
206 mov rcx, rdx
207 mov rdx, r8
208 call rax
209
210 NtWrapDestroyMarker
211 NtWrapEpilog supdrvNtWrapVMMR0EntryFast
212ENDPROC supdrvNtWrapVMMR0EntryFast
213
214
215;;
216; @cproto DECLASM(void) supdrvNtWrapObjDestructor(PFNRT pfnDestruction, void *pvObj, void *pvUser1, void *pvUser2);
217;
218; @param pfnDestruction rcx
219; @param pvObj rdx
220; @param pvUser1 r8
221; @param pvUser2 r9
222;
223BEGINPROC supdrvNtWrapObjDestructor
224 NtWrapProlog supdrvNtWrapObjDestructor
225 NtWrapCreateMarker
226
227 mov rax, rcx
228 mov rcx, rdx
229 mov rdx, r8
230 mov r8, r9
231 call rax
232
233 NtWrapDestroyMarker
234 NtWrapEpilog supdrvNtWrapObjDestructor
235ENDPROC supdrvNtWrapObjDestructor
236
237
238;;
239; @cproto DECLASM(void *) supdrvNtWrapQueryFactoryInterface(PFNRT pfnQueryFactoryInterface, struct SUPDRVFACTORY const *pSupDrvFactory,
240; PSUPDRVSESSION pSession, const char *pszInterfaceUuid);
241;
242; @param pfnQueryFactoryInterface rcx
243; @param pSupDrvFactory rdx
244; @param pSession r8
245; @param pszInterfaceUuid r9
246;
247BEGINPROC supdrvNtWrapQueryFactoryInterface
248 NtWrapProlog supdrvNtWrapQueryFactoryInterface
249 NtWrapCreateMarker
250
251 mov rax, rcx
252 mov rcx, rdx
253 mov rdx, r8
254 mov r8, r9
255 call rax
256
257 NtWrapDestroyMarker
258 NtWrapEpilog supdrvNtWrapQueryFactoryInterface
259ENDPROC supdrvNtWrapQueryFactoryInterface
260
261
262;;
263; @cproto DECLASM(int) supdrvNtWrapModuleInit(PFNRT pfnModuleInit);
264;
265; @param pfnModuleInit rcx
266;
267BEGINPROC supdrvNtWrapModuleInit
268 NtWrapProlog supdrvNtWrapModuleInit
269 NtWrapCreateMarker
270
271 call rcx
272
273 NtWrapDestroyMarker
274 NtWrapEpilog supdrvNtWrapModuleInit
275ENDPROC supdrvNtWrapModuleInit
276
277
278;;
279; @cproto DECLASM(void) supdrvNtWrapModuleTerm(PFNRT pfnModuleTerm);
280;
281; @param pfnModuleInit rcx
282;
283BEGINPROC supdrvNtWrapModuleTerm
284 NtWrapProlog supdrvNtWrapModuleTerm
285 NtWrapCreateMarker
286
287 call rcx
288
289 NtWrapDestroyMarker
290 NtWrapEpilog supdrvNtWrapModuleTerm
291ENDPROC supdrvNtWrapModuleTerm
292
293
294 %endif ; RT_ARCH_AMD64
295%endif ; RT_WITH_W64_UNWIND_HACK
296
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