VirtualBox

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

Last change on this file since 25274 was 25274, checked in by vboxsync, 15 years ago

SUPDrvA-win.asm: export SUPR0Printf.

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

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