VirtualBox

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

Last change on this file since 20141 was 20124, checked in by vboxsync, 16 years ago

IPRT,SUP: Minor driver version change - added RTThreadPreemptIsPendingTrusty (for Windows and Darwin were we're doing really ugly stuff).

  • Property svn:eol-style set to native
File size: 16.0 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, SUPR0ObjAddRefEx
63NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ObjRelease
64NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ObjVerifyAccess
65NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0LockMem
66NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0UnlockMem
67NtWrapDyn2DrvFunctionWith5Params supdrvNtWrap, SUPR0ContAlloc
68NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0ContFree
69NtWrapDyn2DrvFunctionWith5Params supdrvNtWrap, SUPR0LowAlloc
70NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0LowFree
71NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0MemAlloc
72NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0MemGetPhys
73NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0MemFree
74NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0PageAlloc
75NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0PageFree
76;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0Printf - cannot wrap this buster.
77NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPSemEventCreate
78NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPSemEventClose
79NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPSemEventSignal
80NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPSemEventWait
81NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPSemEventWaitNoResume
82NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPSemEventMultiCreate
83NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPSemEventMultiClose
84NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPSemEventMultiSignal
85NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPSemEventMultiReset
86NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPSemEventMultiWait
87NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPSemEventMultiWaitNoResume
88NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, SUPR0GetPagingMode
89NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemAlloc
90NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemAllocZ
91NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemFree
92NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemDup
93NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemDupEx
94NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMemRealloc
95NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocLow
96NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocPage
97NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocPhys
98NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocPhysNC
99NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAllocCont
100NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjEnterPhys
101NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjLockUser
102NtWrapDyn2DrvFunctionWith5Params supdrvNtWrap, RTR0MemObjMapKernel
103NtWrapDyn2DrvFunctionWith7Params supdrvNtWrap, RTR0MemObjMapKernelEx
104NtWrapDyn2DrvFunctionWith6Params supdrvNtWrap, RTR0MemObjMapUser
105;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAddress - not necessary
106;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjAddressR3 - not necessary
107;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjSize - not necessary
108;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjIsMapping - not necessary
109;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjGetPagePhysAddr - not necessary
110NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0MemObjFree
111;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTProcSelf - not necessary
112;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTR0ProcHandleSelf - not necessary
113NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemFastMutexCreate
114NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemFastMutexDestroy
115NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemFastMutexRequest
116NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemFastMutexRelease
117NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventCreate
118NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventSignal
119NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventWait
120NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventWaitNoResume
121NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventDestroy
122NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiCreate
123NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiSignal
124NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiReset
125NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiWait
126NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiWaitNoResume
127NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSemEventMultiDestroy
128NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockCreate
129NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockDestroy
130NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockAcquire
131NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockRelease
132NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockAcquireNoInts
133NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTSpinlockReleaseNoInts
134;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTTimeNanoTS - not necessary
135;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTTimeMilliTS - not necessary
136;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTTimeSystemNanoTS - not necessary
137;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTTimeSystemMilliTS - not necessary
138;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadNativeSelf - not necessary
139NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadSleep
140NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadYield
141%if 0 ; Thread APIs, Part 2
142;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadSelf
143NtWrapDyn2DrvFunctionWith7Params supdrvNtWrap, RTThreadCreate
144NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadGetNative
145NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadWait
146NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadWaitNoResume
147NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadGetName
148NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadSelfName
149NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadGetType
150NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadUserSignal
151NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadUserReset
152NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadUserWait
153NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadUserWaitNoResume
154%endif
155;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadPreemptIsEnabled - not necessary
156;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadPreemptIsPending - not necessary
157;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadPreemptIsPendingTrusty - not necessary
158;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadPreemptDisable - not necessary
159NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTThreadPreemptRestore
160;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogDefaultInstance - a bit of a gamble, but we do not want the overhead!
161;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpCpuId - not necessary
162;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpCpuIdFromSetIndex - not necessary
163;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpCpuIdToSetIndex - not necessary
164;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpIsCpuPossible - not necessary
165;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetCount - not necessary
166;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetMaxCpuId - not necessary
167;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetOnlineCount - not necessary
168;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetOnlineSet - not necessary
169;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpGetSet - not necessary
170;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpIsCpuOnline - not necessary
171NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpIsCpuWorkPending
172NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpOnAll
173NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpOnOthers
174NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpOnSpecific
175NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTMpPokeCpu
176;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogRelDefaultInstance - not necessary.
177NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogSetDefaultInstanceThread
178;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogLogger - can't wrap this buster.
179;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogLoggerEx - can't wrap this buster.
180NtWrapDyn2DrvFunctionWith5Params supdrvNtWrap, RTLogLoggerExV
181;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogPrintf - can't wrap this buster. ;; @todo provide va_list log wrappers in RuntimeR0.
182NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, RTLogPrintfV
183NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, AssertMsg1
184;NtWrapDyn2DrvFunctionWithAllRegParams supdrvNtWrap, AssertMsg2 - can't wrap this buster.
185NtWrapDrv2DynFunctionWithAllRegParams supdrvNtWrap, RTPowerSignalEvent
186
187
188;;
189; @cproto DECLASM(int) supdrvNtWrapVMMR0EntryEx(PFNRT pfnVMMR0EntryEx, PVM pVM, unsigned idCpu, unsigned uOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg, PSUPDRVSESSION pSession);
190;
191; @param pfnVMMR0EntryEx rcx
192; @param pVM rdx
193; @param idCpu r8
194; @param uOperation r9
195; @param pReq [rsp + 28h] / [rbp + 30h]
196; @param u64Arg [rsp + 30h] / [rbp + 38h]
197; @param pSession [rsp + 38h] / [rbp + 40h]
198;
199BEGINPROC supdrvNtWrapVMMR0EntryEx
200 NtWrapProlog supdrvNtWrapVMMR0EntryEx
201 NtWrapCreateMarker
202
203 mov rax, rcx
204 mov rcx, rdx
205 mov rdx, r8
206 mov r8, r9
207 mov r9, [rbp + 30h]
208 mov r11, [rbp + 38h]
209 mov [rsp + 20h], r11
210 mov r11, [rbp + 40h]
211 mov [rsp + 28h], r11
212 call rax
213
214 NtWrapDestroyMarker
215 NtWrapEpilog supdrvNtWrapVMMR0EntryEx
216ENDPROC supdrvNtWrapVMMR0EntryEx
217
218
219;;
220; @cproto DECLASM(int) supdrvNtWrapVMMR0EntryFast(PFNRT pfnVMMR0EntryFast, PVM pVM, unsigned idCPU, unsigned uOperation);
221;
222; @param pfnVMMR0EntryFast rcx
223; @param pVM rdx
224; @param idCPU r8
225; @param uOperation r9
226;
227BEGINPROC supdrvNtWrapVMMR0EntryFast
228 NtWrapProlog supdrvNtWrapVMMR0EntryFast
229 NtWrapCreateMarker
230
231 mov rax, rcx
232 mov rcx, rdx
233 mov rdx, r8
234 mov r8, r9
235 call rax
236
237 NtWrapDestroyMarker
238 NtWrapEpilog supdrvNtWrapVMMR0EntryFast
239ENDPROC supdrvNtWrapVMMR0EntryFast
240
241
242;;
243; @cproto DECLASM(void) supdrvNtWrapObjDestructor(PFNRT pfnDestruction, void *pvObj, void *pvUser1, void *pvUser2);
244;
245; @param pfnDestruction rcx
246; @param pvObj rdx
247; @param pvUser1 r8
248; @param pvUser2 r9
249;
250BEGINPROC supdrvNtWrapObjDestructor
251 NtWrapProlog supdrvNtWrapObjDestructor
252 NtWrapCreateMarker
253
254 mov rax, rcx
255 mov rcx, rdx
256 mov rdx, r8
257 mov r8, r9
258 call rax
259
260 NtWrapDestroyMarker
261 NtWrapEpilog supdrvNtWrapObjDestructor
262ENDPROC supdrvNtWrapObjDestructor
263
264
265;;
266; @cproto DECLASM(void *) supdrvNtWrapQueryFactoryInterface(PFNRT pfnQueryFactoryInterface, struct SUPDRVFACTORY const *pSupDrvFactory,
267; PSUPDRVSESSION pSession, const char *pszInterfaceUuid);
268;
269; @param pfnQueryFactoryInterface rcx
270; @param pSupDrvFactory rdx
271; @param pSession r8
272; @param pszInterfaceUuid r9
273;
274BEGINPROC supdrvNtWrapQueryFactoryInterface
275 NtWrapProlog supdrvNtWrapQueryFactoryInterface
276 NtWrapCreateMarker
277
278 mov rax, rcx
279 mov rcx, rdx
280 mov rdx, r8
281 mov r8, r9
282 call rax
283
284 NtWrapDestroyMarker
285 NtWrapEpilog supdrvNtWrapQueryFactoryInterface
286ENDPROC supdrvNtWrapQueryFactoryInterface
287
288
289;;
290; @cproto DECLASM(int) supdrvNtWrapModuleInit(PFNRT pfnModuleInit);
291;
292; @param pfnModuleInit rcx
293;
294BEGINPROC supdrvNtWrapModuleInit
295 NtWrapProlog supdrvNtWrapModuleInit
296 NtWrapCreateMarker
297
298 call rcx
299
300 NtWrapDestroyMarker
301 NtWrapEpilog supdrvNtWrapModuleInit
302ENDPROC supdrvNtWrapModuleInit
303
304
305;;
306; @cproto DECLASM(void) supdrvNtWrapModuleTerm(PFNRT pfnModuleTerm);
307;
308; @param pfnModuleInit rcx
309;
310BEGINPROC supdrvNtWrapModuleTerm
311 NtWrapProlog supdrvNtWrapModuleTerm
312 NtWrapCreateMarker
313
314 call rcx
315
316 NtWrapDestroyMarker
317 NtWrapEpilog supdrvNtWrapModuleTerm
318ENDPROC supdrvNtWrapModuleTerm
319
320
321;;
322; @cproto DECLASM(int) supdrvNtWrapServiceReqHandler(PFNRT pfnServiceReqHandler, PSUPDRVSESSION pSession, uint32_t uOperation, uint64_t u64Arg, PSUPR0SERVICEREQHDR pReqHdr);
323;
324; @param pfnSerivceReqHandler rcx
325; @param pSession rdx
326; @param uOperation r8
327; @param u64Arg r9
328; @param pReq [rsp + 28h] / [rbp + 30h]
329;
330BEGINPROC supdrvNtWrapServiceReqHandler
331 NtWrapProlog supdrvNtWrapServiceReqHandler
332 NtWrapCreateMarker
333
334 mov rax, rcx
335 mov rcx, rdx
336 mov rdx, r8
337 mov r8, r9
338 mov r9, [rbp + 30h]
339 call rax
340
341 NtWrapDestroyMarker
342 NtWrapEpilog supdrvNtWrapServiceReqHandler
343ENDPROC supdrvNtWrapServiceReqHandler
344
345
346 %endif ; RT_ARCH_AMD64
347%endif ; RT_WITH_W64_UNWIND_HACK
348
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