VirtualBox

source: vbox/trunk/src/recompiler/new/VBoxREMWrapper.cpp@ 1111

Last change on this file since 1111 was 1107, checked in by vboxsync, 18 years ago

Another attempt at fixing the build

  • Property svn:keywords set to Id
File size: 94.9 KB
Line 
1/* $Id: VBoxREMWrapper.cpp 1107 2007-02-28 13:08:52Z vboxsync $ */
2/** @file
3 *
4 * VBoxREM Win64 DLL Wrapper.
5 *
6 * InnoTek Systemberatung GmbH confidential
7 *
8 * Copyright (c) 2006 InnoTek Systemberatung GmbH
9 *
10 * Author: knut st. osmundsen <[email protected]>
11 *
12 * All Rights Reserved
13 *
14 */
15
16
17/** @page pg_vboxrem_amd64 VBoxREM Hacks on AMD64
18 *
19 * There are problems with building BoxREM both on WIN64 and 64-bit linux.
20 *
21 * On linux binutils refuses to link shared objects without -fPIC compiled code
22 * (bitches about some fixup types). But when trying to build with -fPIC dyngen
23 * doesn't like the code anymore. Sweet. The current solution is to build the
24 * VBoxREM code as a relocatable module and use our ELF loader to load it.
25 *
26 * On WIN64 we're not aware of any GCC port which can emit code using the MSC
27 * calling convention. So, we're in for some real fun here. The choice is between
28 * porting GCC to AMD64 WIN64 and comming up with some kind of wrapper around
29 * either the win32 build or the 64-bit linux build.
30 *
31 * -# Porting GCC will be a lot of work. For one thing the calling convention differs
32 * and messing with such stuff can easily create ugly bugs. We would also have to
33 * do some binutils changes, but I think those are rather small compared to GCC.
34 * (That said, the MSC calling convention is far simpler than the linux one, it
35 * reminds me of _Optlink which we have working already.)
36 * -# Wrapping win32 code will work, but addresses outside the first 4GB are
37 * inaccessible and we will have to create 32-64 thunks for all imported functions.
38 * (To switch between 32-bit and 64-bit is load the right CS using far jmps (32->64)
39 * or far returns (both).)
40 * -# Wrapping 64-bit linux code might be the easier solution. The requirements here
41 * are:
42 * - Remove all CRT references we possibly, either by using intrinsics or using
43 * IPRT. Part of IPRT will be linked into VBoxREM2.rel, this will be yet another
44 * IPRT mode which I've dubbed 'no-crt'. The no-crt mode provide basic non-system
45 * dependent stuff.
46 * - Compile and link it into a relocatable object (include the gcc intrinsics
47 * in libgcc). Call this VBoxREM2.rel.
48 * - Write a wrapper dll, VBoxREM.dll, for which during REMR3Init() will load
49 * VBoxREM2.rel (using IPRT) and generate calling convention wrappers
50 * for all IPRT functions and VBoxVMM functions that it uses. All exports
51 * will be wrapped vice versa.
52 * - For building on windows hosts, we will use a mingw32 hosted cross compiler.
53 * and add a 'no-crt' mode to IPRT where it provides the necessary CRT headers
54 * and function implementations.
55 *
56 * The 3rd solution will be tried out first since it requires the least effort and
57 * will let us make use of the full 64-bit register set.
58 *
59 *
60 *
61 * @section sec_vboxrem_amd64_compare Comparing the GCC and MSC calling conventions
62 *
63 * GCC expects the following (cut & past from page 20 in the ABI draft 0.96):
64 *
65 * %rax temporary register; with variable arguments passes information about the
66 * number of SSE registers used; 1st return register.
67 * [Not preserved]
68 * %rbx callee-saved register; optionally used as base pointer.
69 * [Preserved]
70 * %rcx used to pass 4th integer argument to functions.
71 * [Not preserved]
72 * %rdx used to pass 3rd argument to functions; 2nd return register
73 * [Not preserved]
74 * %rsp stack pointer
75 * [Preserved]
76 * %rbp callee-saved register; optionally used as frame pointer
77 * [Preserved]
78 * %rsi used to pass 2nd argument to functions
79 * [Not preserved]
80 * %rdi used to pass 1st argument to functions
81 * [Not preserved]
82 * %r8 used to pass 5th argument to functions
83 * [Not preserved]
84 * %r9 used to pass 6th argument to functions
85 * [Not preserved]
86 * %r10 temporary register, used for passing a function’s static chain pointer
87 * [Not preserved]
88 * %r11 temporary register
89 * [Not preserved]
90 * %r12-r15 callee-saved registers
91 * [Preserved]
92 * %xmm0–%xmm1 used to pass and return floating point arguments
93 * [Not preserved]
94 * %xmm2–%xmm7 used to pass floating point arguments
95 * [Not preserved]
96 * %xmm8–%xmm15 temporary registers
97 * [Not preserved]
98 * %mmx0–%mmx7 temporary registers
99 * [Not preserved]
100 * %st0 temporary register; used to return long double arguments
101 * [Not preserved]
102 * %st1 temporary registers; used to return long double arguments
103 * [Not preserved]
104 * %st2–%st7 temporary registers
105 * [Not preserved]
106 * %fs Reserved for system use (as thread specific data register)
107 * [Not preserved]
108 *
109 * Direction flag is preserved as cleared.
110 * The stack must be aligned on a 16-byte boundrary before the 'call/jmp' instruction.
111 *
112 *
113 *
114 * MSC expects the following:
115 * rax return value, not preserved.
116 * rbx preserved.
117 * rcx 1st argument, integer, not preserved.
118 * rdx 2nd argument, integer, not preserved.
119 * rbp preserved.
120 * rsp preserved.
121 * rsi preserved.
122 * rdi preserved.
123 * r8 3rd argument, integer, not preserved.
124 * r9 4th argument, integer, not preserved.
125 * r10 scratch register, not preserved.
126 * r11 scratch register, not preserved.
127 * r12-r15 preserved.
128 * xmm0 1st argument, fp, return value, not preserved.
129 * xmm1 2st argument, fp, not preserved.
130 * xmm2 3st argument, fp, not preserved.
131 * xmm3 4st argument, fp, not preserved.
132 * xmm4-xmm5 scratch, not preserved.
133 * xmm6-xmm15 preserved.
134 *
135 * Dunno what the direction flag is...
136 * The stack must be aligned on a 16-byte boundrary before the 'call/jmp' instruction.
137 *
138 *
139 * Thus, When GCC code is calling MSC code we don't really have to preserve
140 * anything. But but MSC code is calling GCC code, we'll have to save esi and edi.
141 *
142 */
143
144
145/*******************************************************************************
146* Defined Constants And Macros *
147*******************************************************************************/
148/** @def USE_REM_STUBS
149 * Define USE_REM_STUBS to stub the entire REM stuff. This is useful during
150 * early porting (before we start running stuff).
151 */
152#if defined(__DOXYGEN__)
153# define USE_REM_STUBS
154#endif
155
156/** @def USE_REM_CALLING_CONVENTION_GLUE
157 * Define USE_REM_CALLING_CONVENTION_GLUE for platforms where it's necessary to
158 * use calling convention wrappers.
159 */
160#if (defined(__AMD64__) && defined(__WIN__)) || defined(__DOXYGEN__)
161# define USE_REM_CALLING_CONVENTION_GLUE
162#endif
163
164/** @def USE_REM_IMPORT_JUMP_GLUE
165 * Define USE_REM_IMPORT_JUMP_GLUE for platforms where we need to
166 * emit some jump glue to deal with big addresses.
167 */
168#if (defined(__AMD64__) && !defined(USE_REM_CALLING_CONVENTION_GLUE) && !defined(__DARWIN__)) || defined(__DOXYGEN__)
169# define USE_REM_IMPORT_JUMP_GLUE
170#endif
171
172
173/*******************************************************************************
174* Header Files *
175*******************************************************************************/
176#define LOG_GROUP LOG_GROUP_REM
177#include <VBox/rem.h>
178#include <VBox/vmm.h>
179#include <VBox/dbgf.h>
180#include <VBox/dbg.h>
181#include <VBox/csam.h>
182#include <VBox/mm.h>
183#include <VBox/em.h>
184#include <VBox/ssm.h>
185#include <VBox/hwaccm.h>
186#include <VBox/patm.h>
187#include <VBox/pdm.h>
188#include <VBox/pgm.h>
189#include <VBox/iom.h>
190#include <VBox/vm.h>
191#include <VBox/err.h>
192#include <VBox/log.h>
193#include <VBox/dis.h>
194
195#include <iprt/alloc.h>
196#include <iprt/assert.h>
197#include <iprt/ldr.h>
198#include <iprt/param.h>
199#include <iprt/path.h>
200#include <iprt/string.h>
201#include <iprt/stream.h>
202
203
204/*******************************************************************************
205* Structures and Typedefs *
206*******************************************************************************/
207/**
208 * Parameter descriptor.
209 */
210typedef struct REMPARMDESC
211{
212 /** Parameter flags (REMPARMDESC_FLAGS_*). */
213 uint8_t fFlags;
214 /** The parameter size if REMPARMDESC_FLAGS_SIZE is set. */
215 uint8_t cb;
216} REMPARMDESC, *PREMPARMDESC;
217/** Pointer to a constant parameter descriptor. */
218typedef const REMPARMDESC *PCREMPARMDESC;
219
220/** @name Parameter descriptor flags.
221 * @{ */
222/** The parameter type is a kind of integer which could fit in a register. This includes pointers. */
223#define REMPARMDESC_FLAGS_INT 0
224/** The parameter is a GC pointer. */
225#define REMPARMDESC_FLAGS_GCPTR 1
226/** The parameter is a GC physical address. */
227#define REMPARMDESC_FLAGS_GCPHYS 2
228/** The parameter is a HC physical address. */
229#define REMPARMDESC_FLAGS_HCPHYS 3
230/** The parameter type is a kind of floating point. */
231#define REMPARMDESC_FLAGS_FLOAT 4
232/** The parameter value is a struct. This type takes a size. */
233#define REMPARMDESC_FLAGS_STRUCT 5
234/** The parameter is an elipsis. */
235#define REMPARMDESC_FLAGS_ELLIPSIS 6
236/** The parameter is a va_list. */
237#define REMPARMDESC_FLAGS_VALIST 7
238/** The parameter type mask. */
239#define REMPARMDESC_FLAGS_TYPE_MASK 7
240/** The parameter size field is valid. */
241#define REMPARMDESC_FLAGS_SIZE BIT(7)
242/** @} */
243
244/**
245 * Function descriptor.
246 */
247typedef struct REMFNDESC
248{
249 /** The function name. */
250 const char *pszName;
251 /** Exports: Pointer to the function pointer.
252 * Imports: Pointer to the function. */
253 void *pv;
254 /** Array of parameter descriptors. */
255 PCREMPARMDESC paParams;
256 /** The number of parameter descriptors pointed to by paParams. */
257 uint8_t cParams;
258 /** Function flags (REMFNDESC_FLAGS_*). */
259 uint8_t fFlags;
260 /** The size of the return value. */
261 uint8_t cbReturn;
262 /** Pointer to the wrapper code for imports. */
263 void *pvWrapper;
264} REMFNDESC, *PREMFNDESC;
265/** Pointer to a constant function descriptor. */
266typedef const REMFNDESC *PCREMFNDESC;
267
268/** @name Function descriptor flags.
269 * @{ */
270/** The return type is void. */
271#define REMFNDESC_FLAGS_RET_VOID 0
272/** The return type is a kind of integer passed in rax/eax. This includes pointers. */
273#define REMFNDESC_FLAGS_RET_INT 1
274/** The return type is a kind of floating point. */
275#define REMFNDESC_FLAGS_RET_FLOAT 2
276/** The return value is a struct. This type take a size. */
277#define REMFNDESC_FLAGS_RET_STRUCT 3
278/** The return type mask. */
279#define REMFNDESC_FLAGS_RET_TYPE_MASK 7
280/** The argument list contains one or more va_list arguments (i.e. problems). */
281#define REMFNDESC_FLAGS_VALIST BIT(6)
282/** The function has an ellipsis (i.e. a problem). */
283#define REMFNDESC_FLAGS_ELLIPSIS BIT(7)
284/** @} */
285
286/**
287 * Chunk of read-write-executable memory.
288 */
289typedef struct REMEXECMEM
290{
291 /** The number of bytes left. */
292 struct REMEXECMEM *pNext;
293 /** The size of this chunk. */
294 uint32_t cb;
295 /** The offset of the next code block. */
296 uint32_t off;
297#if ARCH_BITS == 32
298 uint32_t padding;
299#endif
300} REMEXECMEM, *PREMEXECMEM;
301
302
303/*******************************************************************************
304* Global Variables *
305*******************************************************************************/
306#ifndef USE_REM_STUBS
307/** Loader handle of the REM object/DLL. */
308static RTLDRMOD g_ModREM2;
309/** Pointer to the memory containing the loaded REM2 object/DLL. */
310static void *g_pvREM2;
311
312/** Linux object export addresses.
313 * These are references from the assembly wrapper code.
314 * @{ */
315static DECLCALLBACKPTR(int, pfnREMR3Init)(PVM);
316static DECLCALLBACKPTR(int, pfnREMR3Term)(PVM);
317static DECLCALLBACKPTR(void, pfnREMR3Reset)(PVM);
318static DECLCALLBACKPTR(int, pfnREMR3Step)(PVM);
319static DECLCALLBACKPTR(int, pfnREMR3BreakpointSet)(PVM, RTGCUINTPTR);
320static DECLCALLBACKPTR(int, pfnREMR3BreakpointClear)(PVM, RTGCUINTPTR);
321static DECLCALLBACKPTR(int, pfnREMR3EmulateInstruction)(PVM);
322static DECLCALLBACKPTR(int, pfnREMR3Run)(PVM);
323static DECLCALLBACKPTR(int, pfnREMR3State)(PVM);
324static DECLCALLBACKPTR(int, pfnREMR3StateBack)(PVM);
325static DECLCALLBACKPTR(void, pfnREMR3StateUpdate)(PVM);
326static DECLCALLBACKPTR(void, pfnREMR3A20Set)(PVM, bool);
327static DECLCALLBACKPTR(void, pfnREMR3ReplayInvalidatedPages)(PVM);
328static DECLCALLBACKPTR(void, pfnREMR3ReplayHandlerNotifications)(PVM pVM);
329static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamRegister)(PVM, RTGCPHYS, RTUINT, void *, unsigned);
330static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamChunkRegister)(PVM, RTGCPHYS, RTUINT, RTHCUINTPTR, unsigned);
331static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysReserve)(PVM, RTGCPHYS, RTUINT);
332static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRomRegister)(PVM, RTGCPHYS, RTUINT, void *);
333static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalModify)(PVM, PGMPHYSHANDLERTYPE, RTGCPHYS, RTGCPHYS, RTGCPHYS, bool, void *);
334static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalRegister)(PVM, PGMPHYSHANDLERTYPE, RTGCPHYS, RTGCPHYS, bool);
335static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalDeregister)(PVM, PGMPHYSHANDLERTYPE, RTGCPHYS, RTGCPHYS, bool, void *);
336static DECLCALLBACKPTR(void, pfnREMR3NotifyInterruptSet)(PVM);
337static DECLCALLBACKPTR(void, pfnREMR3NotifyInterruptClear)(PVM);
338static DECLCALLBACKPTR(void, pfnREMR3NotifyTimerPending)(PVM);
339static DECLCALLBACKPTR(void, pfnREMR3NotifyDmaPending)(PVM);
340static DECLCALLBACKPTR(void, pfnREMR3NotifyQueuePending)(PVM);
341static DECLCALLBACKPTR(void, pfnREMR3NotifyFF)(PVM);
342static DECLCALLBACKPTR(int, pfnREMR3NotifyCodePageChanged)(PVM, RTGCPTR);
343static DECLCALLBACKPTR(void, pfnREMR3NotifyPendingInterrupt)(PVM, uint8_t);
344static DECLCALLBACKPTR(uint32_t, pfnREMR3QueryPendingInterrupt)(PVM);
345static DECLCALLBACKPTR(int, pfnREMR3DisasEnableStepping)(PVM, bool);
346static DECLCALLBACKPTR(bool, pfnREMR3IsPageAccessHandled)(PVM, RTGCPHYS);
347/** @} */
348
349/** Export and import parameter descriptors.
350 * @{
351 */
352/* Common args. */
353static const REMPARMDESC g_aArgsSIZE_T[] =
354{
355 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }
356};
357static const REMPARMDESC g_aArgsPTR[] =
358{
359 { REMPARMDESC_FLAGS_INT, sizeof(void *) }
360};
361static const REMPARMDESC g_aArgsVM[] =
362{
363 { REMPARMDESC_FLAGS_INT, sizeof(PVM) }
364};
365
366/* REM args */
367static const REMPARMDESC g_aArgsBreakpoint[] =
368{
369 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
370 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINTPTR) }
371};
372static const REMPARMDESC g_aArgsA20Set[] =
373{
374 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
375 { REMPARMDESC_FLAGS_INT, sizeof(bool) }
376};
377static const REMPARMDESC g_aArgsNotifyPhysRamRegister[] =
378{
379 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
380 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
381 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT) },
382 { REMPARMDESC_FLAGS_INT, sizeof(void *) },
383 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) }
384};
385static const REMPARMDESC g_aArgsNotifyPhysRamChunkRegister[] =
386{
387 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
388 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
389 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT) },
390 { REMPARMDESC_FLAGS_INT, sizeof(RTHCUINTPTR) },
391 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) }
392};
393static const REMPARMDESC g_aArgsNotifyPhysReserve[] =
394{
395 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
396 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
397 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT) }
398};
399static const REMPARMDESC g_aArgsNotifyPhysRomRegister[] =
400{
401 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
402 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
403 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT) },
404 { REMPARMDESC_FLAGS_INT, sizeof(void *) }
405};
406static const REMPARMDESC g_aArgsNotifyHandlerPhysicalModify[] =
407{
408 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
409 { REMPARMDESC_FLAGS_INT, sizeof(PGMPHYSHANDLERTYPE) },
410 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
411 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
412 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
413 { REMPARMDESC_FLAGS_INT, sizeof(bool) },
414 { REMPARMDESC_FLAGS_INT, sizeof(void *) }
415};
416static const REMPARMDESC g_aArgsNotifyHandlerPhysicalRegister[] =
417{
418 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
419 { REMPARMDESC_FLAGS_INT, sizeof(PGMPHYSHANDLERTYPE) },
420 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
421 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
422 { REMPARMDESC_FLAGS_INT, sizeof(bool) }
423};
424static const REMPARMDESC g_aArgsNotifyHandlerPhysicalDeregister[] =
425{
426 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
427 { REMPARMDESC_FLAGS_INT, sizeof(PGMPHYSHANDLERTYPE) },
428 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
429 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
430 { REMPARMDESC_FLAGS_INT, sizeof(bool) },
431 { REMPARMDESC_FLAGS_INT, sizeof(void *) }
432};
433static const REMPARMDESC g_aArgsNotifyCodePageChanged[] =
434{
435 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
436 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINTPTR) }
437};
438static const REMPARMDESC g_aArgsNotifyPendingInterrupt[] =
439{
440 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
441 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t) }
442};
443static const REMPARMDESC g_aArgsDisasEnableStepping[] =
444{
445 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
446 { REMPARMDESC_FLAGS_INT, sizeof(bool) }
447};
448static const REMPARMDESC g_aArgsIsPageAccessHandled[] =
449{
450 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
451 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) }
452};
453
454
455/* VMM args */
456static const REMPARMDESC g_aArgsCPUMGetGuestCpuId[] =
457{
458 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
459 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },
460 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) },
461 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) },
462 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) },
463 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) }
464};
465static const REMPARMDESC g_aArgsCPUMQueryGuestCtxPtr[] =
466{
467 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
468 { REMPARMDESC_FLAGS_INT, sizeof(PCPUMCTX *) }
469};
470static const REMPARMDESC g_aArgsCSAMR3MonitorPage[] =
471{
472 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
473 { REMPARMDESC_FLAGS_INT, sizeof(RTGCPTR) },
474 { REMPARMDESC_FLAGS_INT, sizeof(CSAMTAG) }
475};
476static const REMPARMDESC g_aArgsDBGCRegisterCommands[] =
477{
478 { REMPARMDESC_FLAGS_INT, sizeof(PCDBGCCMD) },
479 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) }
480};
481static const REMPARMDESC g_aArgsDBGFR3DisasInstrEx[] =
482{
483 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
484 { REMPARMDESC_FLAGS_INT, sizeof(RTSEL) },
485 { REMPARMDESC_FLAGS_INT, sizeof(RTGCPTR) },
486 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },
487 { REMPARMDESC_FLAGS_INT, sizeof(char *) },
488 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },
489 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) }
490};
491static const REMPARMDESC g_aArgsDBGFR3Info[] =
492{
493 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
494 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },
495 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },
496 { REMPARMDESC_FLAGS_INT, sizeof(PCDBGFINFOHLP) }
497};
498static const REMPARMDESC g_aArgsDBGFR3SymbolByAddr[] =
499{
500 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
501 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINTPTR) },
502 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCINTPTR) },
503 { REMPARMDESC_FLAGS_INT, sizeof(PDBGFSYMBOL) }
504};
505static const REMPARMDESC g_aArgsDISInstr[] =
506{
507 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
508 { REMPARMDESC_FLAGS_INT, sizeof(RTUINTPTR) },
509 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },
510 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) },
511 { REMPARMDESC_FLAGS_INT, sizeof(char *) }
512};
513static const REMPARMDESC g_aArgsEMR3FatalError[] =
514{
515 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
516 { REMPARMDESC_FLAGS_INT, sizeof(int) }
517};
518static const REMPARMDESC g_aArgsHWACCMR3CanExecuteGuest[] =
519{
520 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
521 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },
522 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },
523 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }
524};
525static const REMPARMDESC g_aArgsIOMIOPortRead[] =
526{
527 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
528 { REMPARMDESC_FLAGS_INT, sizeof(RTIOPORT) },
529 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) },
530 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }
531};
532static const REMPARMDESC g_aArgsIOMIOPortWrite[] =
533{
534 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
535 { REMPARMDESC_FLAGS_INT, sizeof(RTIOPORT) },
536 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },
537 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }
538};
539static const REMPARMDESC g_aArgsIOMMMIORead[] =
540{
541 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
542 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
543 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) },
544 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }
545};
546static const REMPARMDESC g_aArgsIOMMMIOWrite[] =
547{
548 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
549 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
550 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },
551 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }
552};
553static const REMPARMDESC g_aArgsMMR3HeapAlloc[] =
554{
555 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
556 { REMPARMDESC_FLAGS_INT, sizeof(MMTAG) },
557 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }
558};
559static const REMPARMDESC g_aArgsPATMIsPatchGCAddr[] =
560{
561 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
562 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR) }
563};
564static const REMPARMDESC g_aArgsPATMR3QueryOpcode[] =
565{
566 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
567 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR) },
568 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t *) }
569};
570static const REMPARMDESC g_aArgsPATMR3QueryPatchMem[] =
571{
572 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
573 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) }
574};
575static const REMPARMDESC g_aArgsPDMApicGetBase[] =
576{
577 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
578 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t *) }
579};
580static const REMPARMDESC g_aArgsPDMApicGetTPR[] =
581{
582 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
583 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t *) }
584};
585static const REMPARMDESC g_aArgsPDMApicSetBase[] =
586{
587 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
588 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t) }
589};
590static const REMPARMDESC g_aArgsPDMApicSetTPR[] =
591{
592 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
593 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t) }
594};
595static const REMPARMDESC g_aArgsPDMGetInterrupt[] =
596{
597 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
598 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t *) }
599};
600static const REMPARMDESC g_aArgsPDMIsaSetIrq[] =
601{
602 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
603 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t) },
604 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t) }
605};
606static const REMPARMDESC g_aArgsPGMGstGetPage[] =
607{
608 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
609 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR) },
610 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t *) },
611 { REMPARMDESC_FLAGS_INT, sizeof(PRTGCPHYS) }
612};
613static const REMPARMDESC g_aArgsPGMInvalidatePage[] =
614{
615 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
616 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR) }
617};
618static const REMPARMDESC g_aArgsPGMPhysGCPhys2HCPtr[] =
619{
620 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
621 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
622 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT) },
623 { REMPARMDESC_FLAGS_INT, sizeof(PRTHCPTR) }
624};
625static const REMPARMDESC g_aArgsPGMPhysGCPtr2HCPtrByGstCR3[] =
626{
627 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
628 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
629 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },
630 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },
631 { REMPARMDESC_FLAGS_INT, sizeof(PRTHCPTR) }
632};
633static const REMPARMDESC g_aArgsPGMPhysRead[] =
634{
635 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
636 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
637 { REMPARMDESC_FLAGS_INT, sizeof(void *) },
638 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }
639};
640static const REMPARMDESC g_aArgsPGMPhysReadGCPtr[] =
641{
642 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
643 { REMPARMDESC_FLAGS_INT, sizeof(void *) },
644 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR) },
645 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }
646};
647static const REMPARMDESC g_aArgsPGMPhysWrite[] =
648{
649 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
650 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
651 { REMPARMDESC_FLAGS_INT, sizeof(const void *) },
652 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }
653};
654static const REMPARMDESC g_aArgsPGMChangeMode[] =
655{
656 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
657 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },
658 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },
659 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t) }
660};
661static const REMPARMDESC g_aArgsPGMFlushTLB[] =
662{
663 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
664 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },
665 { REMPARMDESC_FLAGS_INT, sizeof(bool) }
666};
667static const REMPARMDESC g_aArgsPGMR3PhysReadUxx[] =
668{
669 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
670 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) }
671};
672static const REMPARMDESC g_aArgsPGMR3PhysWriteU8[] =
673{
674 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
675 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
676 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t) }
677};
678static const REMPARMDESC g_aArgsPGMR3PhysWriteU16[] =
679{
680 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
681 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
682 { REMPARMDESC_FLAGS_INT, sizeof(uint16_t) }
683};
684static const REMPARMDESC g_aArgsPGMR3PhysWriteU32[] =
685{
686 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
687 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
688 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) }
689};
690static const REMPARMDESC g_aArgsPGMR3PhysWriteU64[] =
691{
692 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
693 { REMPARMDESC_FLAGS_GCPHYS, sizeof(RTGCPHYS) },
694 { REMPARMDESC_FLAGS_INT, sizeof(uint64_t) }
695};
696static const REMPARMDESC g_aArgsSSMR3GetGCPtr[] =
697{
698 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },
699 { REMPARMDESC_FLAGS_INT, sizeof(PRTGCPTR) }
700};
701static const REMPARMDESC g_aArgsSSMR3GetMem[] =
702{
703 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },
704 { REMPARMDESC_FLAGS_INT, sizeof(void *) },
705 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }
706};
707static const REMPARMDESC g_aArgsSSMR3GetU32[] =
708{
709 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },
710 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t *) }
711};
712static const REMPARMDESC g_aArgsSSMR3GetUInt[] =
713{
714 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },
715 { REMPARMDESC_FLAGS_INT, sizeof(PRTUINT) }
716};
717static const REMPARMDESC g_aArgsSSMR3PutGCPtr[] =
718{
719 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },
720 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCPTR) }
721};
722static const REMPARMDESC g_aArgsSSMR3PutMem[] =
723{
724 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },
725 { REMPARMDESC_FLAGS_INT, sizeof(const void *) },
726 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }
727};
728static const REMPARMDESC g_aArgsSSMR3PutU32[] =
729{
730 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },
731 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },
732};
733static const REMPARMDESC g_aArgsSSMR3PutUInt[] =
734{
735 { REMPARMDESC_FLAGS_INT, sizeof(PSSMHANDLE) },
736 { REMPARMDESC_FLAGS_INT, sizeof(RTUINT) },
737};
738static const REMPARMDESC g_aArgsSSMR3RegisterInternal[] =
739{
740 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
741 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },
742 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },
743 { REMPARMDESC_FLAGS_INT, sizeof(uint32_t) },
744 { REMPARMDESC_FLAGS_INT, sizeof(size_t) },
745 { REMPARMDESC_FLAGS_INT, sizeof(PFNSSMINTSAVEPREP) },
746 { REMPARMDESC_FLAGS_INT, sizeof(PFNSSMINTSAVEEXEC) },
747 { REMPARMDESC_FLAGS_INT, sizeof(PFNSSMINTSAVEDONE) },
748 { REMPARMDESC_FLAGS_INT, sizeof(PFNSSMINTLOADPREP) },
749 { REMPARMDESC_FLAGS_INT, sizeof(PFNSSMINTLOADEXEC) },
750 { REMPARMDESC_FLAGS_INT, sizeof(PFNSSMINTLOADDONE) },
751};
752static const REMPARMDESC g_aArgsSTAMR3Register[] =
753{
754 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
755 { REMPARMDESC_FLAGS_INT, sizeof(void *) },
756 { REMPARMDESC_FLAGS_INT, sizeof(STAMTYPE) },
757 { REMPARMDESC_FLAGS_INT, sizeof(STAMVISIBILITY) },
758 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },
759 { REMPARMDESC_FLAGS_INT, sizeof(STAMUNIT) },
760 { REMPARMDESC_FLAGS_INT, sizeof(const char *) }
761};
762static const REMPARMDESC g_aArgsTRPMAssertTrap[] =
763{
764 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
765 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t) },
766 { REMPARMDESC_FLAGS_INT, sizeof(bool) }
767};
768static const REMPARMDESC g_aArgsTRPMQueryTrap[] =
769{
770 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
771 { REMPARMDESC_FLAGS_INT, sizeof(uint8_t *) },
772 { REMPARMDESC_FLAGS_INT, sizeof(bool *) }
773};
774static const REMPARMDESC g_aArgsTRPMSetErrorCode[] =
775{
776 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
777 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINT) }
778};
779static const REMPARMDESC g_aArgsTRPMSetFaultAddress[] =
780{
781 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
782 { REMPARMDESC_FLAGS_GCPTR, sizeof(RTGCUINT) }
783};
784static const REMPARMDESC g_aArgsVMR3ReqCall[] =
785{
786 { REMPARMDESC_FLAGS_INT, sizeof(PVM) },
787 { REMPARMDESC_FLAGS_INT, sizeof(PVMREQ *) },
788 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },
789 { REMPARMDESC_FLAGS_INT, sizeof(void *) },
790 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },
791 { REMPARMDESC_FLAGS_ELLIPSIS, 0 }
792};
793static const REMPARMDESC g_aArgsVMR3ReqFree[] =
794{
795 { REMPARMDESC_FLAGS_INT, sizeof(PVMREQ) }
796};
797
798
799/* IPRT args */
800static const REMPARMDESC g_aArgsAssertMsg1[] =
801{
802 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },
803 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },
804 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },
805 { REMPARMDESC_FLAGS_INT, sizeof(const char *) }
806};
807static const REMPARMDESC g_aArgsAssertMsg2[] =
808{
809 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },
810 { REMPARMDESC_FLAGS_ELLIPSIS, 0 }
811};
812static const REMPARMDESC g_aArgsRTLogFlags[] =
813{
814 { REMPARMDESC_FLAGS_INT, sizeof(PRTLOGGER) },
815 { REMPARMDESC_FLAGS_INT, sizeof(const char *) }
816};
817static const REMPARMDESC g_aArgsRTLogLoggerEx[] =
818{
819 { REMPARMDESC_FLAGS_INT, sizeof(PRTLOGGER) },
820 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },
821 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },
822 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },
823 { REMPARMDESC_FLAGS_ELLIPSIS, 0 }
824};
825static const REMPARMDESC g_aArgsRTLogLoggerExV[] =
826{
827 { REMPARMDESC_FLAGS_INT, sizeof(PRTLOGGER) },
828 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },
829 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) },
830 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },
831 { REMPARMDESC_FLAGS_VALIST, 0 }
832};
833static const REMPARMDESC g_aArgsRTLogPrintf[] =
834{
835 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },
836 { REMPARMDESC_FLAGS_ELLIPSIS, 0 }
837};
838static const REMPARMDESC g_aArgsRTMemProtect[] =
839{
840 { REMPARMDESC_FLAGS_INT, sizeof(void *) },
841 { REMPARMDESC_FLAGS_INT, sizeof(size_t) },
842 { REMPARMDESC_FLAGS_INT, sizeof(unsigned) }
843};
844static const REMPARMDESC g_aArgsRTStrPrintf[] =
845{
846 { REMPARMDESC_FLAGS_INT, sizeof(char *) },
847 { REMPARMDESC_FLAGS_INT, sizeof(size_t) },
848 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },
849 { REMPARMDESC_FLAGS_ELLIPSIS, 0 }
850};
851static const REMPARMDESC g_aArgsRTStrPrintfV[] =
852{
853 { REMPARMDESC_FLAGS_INT, sizeof(char *) },
854 { REMPARMDESC_FLAGS_INT, sizeof(size_t) },
855 { REMPARMDESC_FLAGS_INT, sizeof(const char *) },
856 { REMPARMDESC_FLAGS_VALIST, 0 }
857};
858
859
860/* CRT args */
861static const REMPARMDESC g_aArgsmemcpy[] =
862{
863 { REMPARMDESC_FLAGS_INT, sizeof(void *) },
864 { REMPARMDESC_FLAGS_INT, sizeof(const void *) },
865 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }
866};
867static const REMPARMDESC g_aArgsmemset[] =
868{
869 { REMPARMDESC_FLAGS_INT, sizeof(void *) },
870 { REMPARMDESC_FLAGS_INT, sizeof(int) },
871 { REMPARMDESC_FLAGS_INT, sizeof(size_t) }
872};
873
874
875/** @} */
876
877/**
878 * Descriptors for the exported functions.
879 */
880static const REMFNDESC g_aExports[] =
881{ /* pszName, (void *)pv, pParams, cParams, fFlags, cb, pvWrapper. */
882 { "REMR3Init", (void *)&pfnREMR3Init, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
883 { "REMR3Term", (void *)&pfnREMR3Term, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
884 { "REMR3Reset", (void *)&pfnREMR3Reset, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
885 { "REMR3Step", (void *)&pfnREMR3Step, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
886 { "REMR3BreakpointSet", (void *)&pfnREMR3BreakpointSet, &g_aArgsBreakpoint[0], ELEMENTS(g_aArgsBreakpoint), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
887 { "REMR3BreakpointClear", (void *)&pfnREMR3BreakpointClear, &g_aArgsBreakpoint[0], ELEMENTS(g_aArgsBreakpoint), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
888 { "REMR3EmulateInstruction", (void *)&pfnREMR3EmulateInstruction, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
889 { "REMR3Run", (void *)&pfnREMR3Run, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
890 { "REMR3State", (void *)&pfnREMR3State, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
891 { "REMR3StateBack", (void *)&pfnREMR3StateBack, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
892 { "REMR3StateUpdate", (void *)&pfnREMR3StateUpdate, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
893 { "REMR3A20Set", (void *)&pfnREMR3A20Set, &g_aArgsA20Set[0], ELEMENTS(g_aArgsA20Set), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
894 { "REMR3ReplayInvalidatedPages", (void *)&pfnREMR3ReplayInvalidatedPages, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
895 { "REMR3ReplayHandlerNotifications", (void *)&pfnREMR3ReplayHandlerNotifications, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
896 { "REMR3NotifyPhysRamRegister", (void *)&pfnREMR3NotifyPhysRamRegister, &g_aArgsNotifyPhysRamRegister[0], ELEMENTS(g_aArgsNotifyPhysRamRegister), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
897 { "REMR3NotifyPhysRamChunkRegister", (void *)&pfnREMR3NotifyPhysRamChunkRegister, &g_aArgsNotifyPhysRamChunkRegister[0], ELEMENTS(g_aArgsNotifyPhysRamChunkRegister), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
898 { "REMR3NotifyPhysReserve", (void *)&pfnREMR3NotifyPhysReserve, &g_aArgsNotifyPhysReserve[0], ELEMENTS(g_aArgsNotifyPhysReserve), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
899 { "REMR3NotifyPhysRomRegister", (void *)&pfnREMR3NotifyPhysRomRegister, &g_aArgsNotifyPhysRomRegister[0], ELEMENTS(g_aArgsNotifyPhysRomRegister), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
900 { "REMR3NotifyHandlerPhysicalModify", (void *)&pfnREMR3NotifyHandlerPhysicalModify, &g_aArgsNotifyHandlerPhysicalModify[0], ELEMENTS(g_aArgsNotifyHandlerPhysicalModify), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
901 { "REMR3NotifyHandlerPhysicalRegister", (void *)&pfnREMR3NotifyHandlerPhysicalRegister, &g_aArgsNotifyHandlerPhysicalRegister[0], ELEMENTS(g_aArgsNotifyHandlerPhysicalRegister), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
902 { "REMR3NotifyHandlerPhysicalDeregister", (void *)&pfnREMR3NotifyHandlerPhysicalDeregister, &g_aArgsNotifyHandlerPhysicalDeregister[0], ELEMENTS(g_aArgsNotifyHandlerPhysicalDeregister), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
903 { "REMR3NotifyInterruptSet", (void *)&pfnREMR3NotifyInterruptSet, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
904 { "REMR3NotifyInterruptClear", (void *)&pfnREMR3NotifyInterruptClear, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
905 { "REMR3NotifyTimerPending", (void *)&pfnREMR3NotifyTimerPending, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
906 { "REMR3NotifyDmaPending", (void *)&pfnREMR3NotifyDmaPending, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
907 { "REMR3NotifyQueuePending", (void *)&pfnREMR3NotifyQueuePending, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
908 { "REMR3NotifyFF", (void *)&pfnREMR3NotifyFF, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
909 { "REMR3NotifyCodePageChanged", (void *)&pfnREMR3NotifyCodePageChanged, &g_aArgsNotifyCodePageChanged[0], ELEMENTS(g_aArgsNotifyCodePageChanged), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
910 { "REMR3NotifyPendingInterrupt", (void *)&pfnREMR3NotifyPendingInterrupt, &g_aArgsNotifyPendingInterrupt[0], ELEMENTS(g_aArgsNotifyPendingInterrupt), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
911 { "REMR3QueryPendingInterrupt", (void *)&pfnREMR3QueryPendingInterrupt, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(uint32_t), NULL },
912 { "REMR3DisasEnableStepping", (void *)&pfnREMR3DisasEnableStepping, &g_aArgsDisasEnableStepping[0], ELEMENTS(g_aArgsDisasEnableStepping), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
913 { "REMR3IsPageAccessHandled", (void *)&pfnREMR3IsPageAccessHandled, &g_aArgsIsPageAccessHandled[0], ELEMENTS(g_aArgsIsPageAccessHandled), REMFNDESC_FLAGS_RET_INT, sizeof(bool), NULL }
914};
915
916
917/**
918 * Descriptors for the functions imported from VBoxVMM.
919 */
920static REMFNDESC g_aVMMImports[] =
921{
922 { "CPUMGetAndClearChangedFlagsREM", (void *)(uintptr_t)&CPUMGetAndClearChangedFlagsREM, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(unsigned), NULL },
923 { "CPUMGetGuestCpuId", (void *)(uintptr_t)&CPUMGetGuestCpuId, &g_aArgsCPUMGetGuestCpuId[0], ELEMENTS(g_aArgsCPUMGetGuestCpuId), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
924 { "CPUMGetGuestEAX", (void *)(uintptr_t)&CPUMGetGuestEAX, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(uint32_t), NULL },
925 { "CPUMGetGuestEBP", (void *)(uintptr_t)&CPUMGetGuestEBP, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(uint32_t), NULL },
926 { "CPUMGetGuestEBX", (void *)(uintptr_t)&CPUMGetGuestEBX, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(uint32_t), NULL },
927 { "CPUMGetGuestECX", (void *)(uintptr_t)&CPUMGetGuestECX, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(uint32_t), NULL },
928 { "CPUMGetGuestEDI", (void *)(uintptr_t)&CPUMGetGuestEDI, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(uint32_t), NULL },
929 { "CPUMGetGuestEDX", (void *)(uintptr_t)&CPUMGetGuestEDX, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(uint32_t), NULL },
930 { "CPUMGetGuestEIP", (void *)(uintptr_t)&CPUMGetGuestEIP, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(uint32_t), NULL },
931 { "CPUMGetGuestESI", (void *)(uintptr_t)&CPUMGetGuestESI, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(uint32_t), NULL },
932 { "CPUMGetGuestESP", (void *)(uintptr_t)&CPUMGetGuestESP, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(uint32_t), NULL },
933 { "CPUMQueryGuestCtxPtr", (void *)(uintptr_t)&CPUMQueryGuestCtxPtr, &g_aArgsCPUMQueryGuestCtxPtr[0], ELEMENTS(g_aArgsCPUMQueryGuestCtxPtr), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
934 { "CSAMR3MonitorPage", (void *)(uintptr_t)&CSAMR3MonitorPage, &g_aArgsCSAMR3MonitorPage[0], ELEMENTS(g_aArgsCSAMR3MonitorPage), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
935 { "DBGCRegisterCommands", (void *)(uintptr_t)&DBGCRegisterCommands, &g_aArgsDBGCRegisterCommands[0], ELEMENTS(g_aArgsDBGCRegisterCommands), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
936 { "DBGFR3DisasInstrEx", (void *)(uintptr_t)&DBGFR3DisasInstrEx, &g_aArgsDBGFR3DisasInstrEx[0], ELEMENTS(g_aArgsDBGFR3DisasInstrEx), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
937 { "DBGFR3Info", (void *)(uintptr_t)&DBGFR3Info, &g_aArgsDBGFR3Info[0], ELEMENTS(g_aArgsDBGFR3Info), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
938 { "DBGFR3InfoLogRelHlp", (void *)(uintptr_t)&DBGFR3InfoLogRelHlp, NULL, 0, REMFNDESC_FLAGS_RET_INT, sizeof(void *), NULL },
939 { "DBGFR3SymbolByAddr", (void *)(uintptr_t)&DBGFR3SymbolByAddr, &g_aArgsDBGFR3SymbolByAddr[0], ELEMENTS(g_aArgsDBGFR3SymbolByAddr), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
940 { "DISInstr", (void *)(uintptr_t)&DISInstr, &g_aArgsDISInstr[0], ELEMENTS(g_aArgsDISInstr), REMFNDESC_FLAGS_RET_INT, sizeof(bool), NULL },
941 { "EMR3FatalError", (void *)(uintptr_t)&EMR3FatalError, &g_aArgsEMR3FatalError[0], ELEMENTS(g_aArgsEMR3FatalError), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
942 { "HWACCMR3CanExecuteGuest", (void *)(uintptr_t)&HWACCMR3CanExecuteGuest, &g_aArgsHWACCMR3CanExecuteGuest[0], ELEMENTS(g_aArgsHWACCMR3CanExecuteGuest), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
943 { "IOMIOPortRead", (void *)(uintptr_t)&IOMIOPortRead, &g_aArgsIOMIOPortRead[0], ELEMENTS(g_aArgsIOMIOPortRead), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
944 { "IOMIOPortWrite", (void *)(uintptr_t)&IOMIOPortWrite, &g_aArgsIOMIOPortWrite[0], ELEMENTS(g_aArgsIOMIOPortWrite), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
945 { "IOMMMIORead", (void *)(uintptr_t)&IOMMMIORead, &g_aArgsIOMMMIORead[0], ELEMENTS(g_aArgsIOMMMIORead), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
946 { "IOMMMIOWrite", (void *)(uintptr_t)&IOMMMIOWrite, &g_aArgsIOMMMIOWrite[0], ELEMENTS(g_aArgsIOMMMIOWrite), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
947 { "MMR3HeapAlloc", (void *)(uintptr_t)&MMR3HeapAlloc, &g_aArgsMMR3HeapAlloc[0], ELEMENTS(g_aArgsMMR3HeapAlloc), REMFNDESC_FLAGS_RET_INT, sizeof(void *), NULL },
948 { "MMR3PhysGetRamSize", (void *)(uintptr_t)&MMR3PhysGetRamSize, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(uint64_t), NULL },
949 { "PATMIsPatchGCAddr", (void *)(uintptr_t)&PATMIsPatchGCAddr, &g_aArgsPATMIsPatchGCAddr[0], ELEMENTS(g_aArgsPATMIsPatchGCAddr), REMFNDESC_FLAGS_RET_INT, sizeof(bool), NULL },
950 { "PATMR3QueryOpcode", (void *)(uintptr_t)&PATMR3QueryOpcode, &g_aArgsPATMR3QueryOpcode[0], ELEMENTS(g_aArgsPATMR3QueryOpcode), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
951 { "PATMR3QueryPatchMemGC", (void *)(uintptr_t)&PATMR3QueryPatchMemGC, &g_aArgsPATMR3QueryPatchMem[0], ELEMENTS(g_aArgsPATMR3QueryPatchMem), REMFNDESC_FLAGS_RET_INT, sizeof(RTGCPTR), NULL },
952 { "PATMR3QueryPatchMemHC", (void *)(uintptr_t)&PATMR3QueryPatchMemHC, &g_aArgsPATMR3QueryPatchMem[0], ELEMENTS(g_aArgsPATMR3QueryPatchMem), REMFNDESC_FLAGS_RET_INT, sizeof(void *), NULL },
953 { "PDMApicGetBase", (void *)(uintptr_t)&PDMApicGetBase, &g_aArgsPDMApicGetBase[0], ELEMENTS(g_aArgsPDMApicGetBase), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
954 { "PDMApicGetTPR", (void *)(uintptr_t)&PDMApicGetTPR, &g_aArgsPDMApicGetTPR[0], ELEMENTS(g_aArgsPDMApicGetTPR), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
955 { "PDMApicSetBase", (void *)(uintptr_t)&PDMApicSetBase, &g_aArgsPDMApicSetBase[0], ELEMENTS(g_aArgsPDMApicSetBase), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
956 { "PDMApicSetTPR", (void *)(uintptr_t)&PDMApicSetTPR, &g_aArgsPDMApicSetTPR[0], ELEMENTS(g_aArgsPDMApicSetTPR), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
957 { "PDMR3DmaRun", (void *)(uintptr_t)&PDMR3DmaRun, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
958 { "PDMGetInterrupt", (void *)(uintptr_t)&PDMGetInterrupt, &g_aArgsPDMGetInterrupt[0], ELEMENTS(g_aArgsPDMGetInterrupt), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
959 { "PDMIsaSetIrq", (void *)(uintptr_t)&PDMIsaSetIrq, &g_aArgsPDMIsaSetIrq[0], ELEMENTS(g_aArgsPDMIsaSetIrq), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
960 { "PGMGstGetPage", (void *)(uintptr_t)&PGMGstGetPage, &g_aArgsPGMGstGetPage[0], ELEMENTS(g_aArgsPGMGstGetPage), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
961 { "PGMInvalidatePage", (void *)(uintptr_t)&PGMInvalidatePage, &g_aArgsPGMInvalidatePage[0], ELEMENTS(g_aArgsPGMInvalidatePage), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
962 { "PGMPhysGCPhys2HCPtr", (void *)(uintptr_t)&PGMPhysGCPhys2HCPtr, &g_aArgsPGMPhysGCPhys2HCPtr[0], ELEMENTS(g_aArgsPGMPhysGCPhys2HCPtr), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
963 { "PGMPhysGCPtr2HCPtrByGstCR3", (void *)(uintptr_t)&PGMPhysGCPtr2HCPtrByGstCR3, &g_aArgsPGMPhysGCPtr2HCPtrByGstCR3[0], ELEMENTS(g_aArgsPGMPhysGCPtr2HCPtrByGstCR3), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
964 { "PGMPhysIsA20Enabled", (void *)(uintptr_t)&PGMPhysIsA20Enabled, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(bool), NULL },
965 { "PGMPhysRead", (void *)(uintptr_t)&PGMPhysRead, &g_aArgsPGMPhysRead[0], ELEMENTS(g_aArgsPGMPhysRead), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
966 { "PGMPhysReadGCPtr", (void *)(uintptr_t)&PGMPhysReadGCPtr, &g_aArgsPGMPhysReadGCPtr[0], ELEMENTS(g_aArgsPGMPhysReadGCPtr), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
967 { "PGMPhysReadGCPtr", (void *)(uintptr_t)&PGMPhysReadGCPtr, &g_aArgsPGMPhysReadGCPtr[0], ELEMENTS(g_aArgsPGMPhysReadGCPtr), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
968 { "PGMPhysWrite", (void *)(uintptr_t)&PGMPhysWrite, &g_aArgsPGMPhysWrite[0], ELEMENTS(g_aArgsPGMPhysWrite), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
969 { "PGMChangeMode", (void *)(uintptr_t)&PGMChangeMode, &g_aArgsPGMChangeMode[0], ELEMENTS(g_aArgsPGMChangeMode), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
970 { "PGMFlushTLB", (void *)(uintptr_t)&PGMFlushTLB, &g_aArgsPGMFlushTLB[0], ELEMENTS(g_aArgsPGMFlushTLB), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
971 { "PGMR3PhysReadByte", (void *)(uintptr_t)&PGMR3PhysReadByte, &g_aArgsPGMR3PhysReadUxx[0], ELEMENTS(g_aArgsPGMR3PhysReadUxx), REMFNDESC_FLAGS_RET_INT, sizeof(uint8_t), NULL },
972 { "PGMR3PhysReadDword", (void *)(uintptr_t)&PGMR3PhysReadDword, &g_aArgsPGMR3PhysReadUxx[0], ELEMENTS(g_aArgsPGMR3PhysReadUxx), REMFNDESC_FLAGS_RET_INT, sizeof(uint32_t), NULL },
973 { "PGMR3PhysReadWord", (void *)(uintptr_t)&PGMR3PhysReadWord, &g_aArgsPGMR3PhysReadUxx[0], ELEMENTS(g_aArgsPGMR3PhysReadUxx), REMFNDESC_FLAGS_RET_INT, sizeof(uint16_t), NULL },
974 { "PGMR3PhysWriteByte", (void *)(uintptr_t)&PGMR3PhysWriteByte, &g_aArgsPGMR3PhysWriteU8[0], ELEMENTS(g_aArgsPGMR3PhysWriteU8), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
975 { "PGMR3PhysWriteDword", (void *)(uintptr_t)&PGMR3PhysWriteDword, &g_aArgsPGMR3PhysWriteU32[0], ELEMENTS(g_aArgsPGMR3PhysWriteU32), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
976 { "PGMR3PhysWriteWord", (void *)(uintptr_t)&PGMR3PhysWriteWord, &g_aArgsPGMR3PhysWriteU16[0], ELEMENTS(g_aArgsPGMR3PhysWriteU16), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
977 { "SSMR3GetGCPtr", (void *)(uintptr_t)&SSMR3GetGCPtr, &g_aArgsSSMR3GetGCPtr[0], ELEMENTS(g_aArgsSSMR3GetGCPtr), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
978 { "SSMR3GetMem", (void *)(uintptr_t)&SSMR3GetMem, &g_aArgsSSMR3GetMem[0], ELEMENTS(g_aArgsSSMR3GetMem), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
979 { "SSMR3GetU32", (void *)(uintptr_t)&SSMR3GetU32, &g_aArgsSSMR3GetU32[0], ELEMENTS(g_aArgsSSMR3GetU32), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
980 { "SSMR3GetUInt", (void *)(uintptr_t)&SSMR3GetUInt, &g_aArgsSSMR3GetUInt[0], ELEMENTS(g_aArgsSSMR3GetUInt), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
981 { "SSMR3PutGCPtr", (void *)(uintptr_t)&SSMR3PutGCPtr, &g_aArgsSSMR3PutGCPtr[0], ELEMENTS(g_aArgsSSMR3PutGCPtr), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
982 { "SSMR3PutMem", (void *)(uintptr_t)&SSMR3PutMem, &g_aArgsSSMR3PutMem[0], ELEMENTS(g_aArgsSSMR3PutMem), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
983 { "SSMR3PutU32", (void *)(uintptr_t)&SSMR3PutU32, &g_aArgsSSMR3PutU32[0], ELEMENTS(g_aArgsSSMR3PutU32), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
984 { "SSMR3PutUInt", (void *)(uintptr_t)&SSMR3PutUInt, &g_aArgsSSMR3PutUInt[0], ELEMENTS(g_aArgsSSMR3PutUInt), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
985 { "SSMR3RegisterInternal", (void *)(uintptr_t)&SSMR3RegisterInternal, &g_aArgsSSMR3RegisterInternal[0], ELEMENTS(g_aArgsSSMR3RegisterInternal), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
986 { "STAMR3Register", (void *)(uintptr_t)&STAMR3Register, &g_aArgsSTAMR3Register[0], ELEMENTS(g_aArgsSTAMR3Register), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
987 { "TMCpuTickGet", (void *)(uintptr_t)&TMCpuTickGet, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(uint64_t), NULL },
988 { "TMCpuTickPause", (void *)(uintptr_t)&TMCpuTickPause, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
989 { "TMCpuTickResume", (void *)(uintptr_t)&TMCpuTickResume, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
990 { "TMTimerPoll", (void *)(uintptr_t)&TMTimerPoll, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(uint64_t), NULL },
991 { "TMR3TimerQueuesDo", (void *)(uintptr_t)&TMR3TimerQueuesDo, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
992 { "TMVirtualPause", (void *)(uintptr_t)&TMVirtualPause, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
993 { "TMVirtualResume", (void *)(uintptr_t)&TMVirtualResume, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
994 { "TRPMAssertTrap", (void *)(uintptr_t)&TRPMAssertTrap, &g_aArgsTRPMAssertTrap[0], ELEMENTS(g_aArgsTRPMAssertTrap), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
995 { "TRPMGetErrorCode", (void *)(uintptr_t)&TRPMGetErrorCode, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(RTGCUINT), NULL },
996 { "TRPMGetFaultAddress", (void *)(uintptr_t)&TRPMGetFaultAddress, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(RTGCUINTPTR),NULL },
997 { "TRPMQueryTrap", (void *)(uintptr_t)&TRPMQueryTrap, &g_aArgsTRPMQueryTrap[0], ELEMENTS(g_aArgsTRPMQueryTrap), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
998 { "TRPMResetTrap", (void *)(uintptr_t)&TRPMResetTrap, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
999 { "TRPMSetErrorCode", (void *)(uintptr_t)&TRPMSetErrorCode, &g_aArgsTRPMSetErrorCode[0], ELEMENTS(g_aArgsTRPMSetErrorCode), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
1000 { "TRPMSetFaultAddress", (void *)(uintptr_t)&TRPMSetFaultAddress, &g_aArgsTRPMSetFaultAddress[0], ELEMENTS(g_aArgsTRPMSetFaultAddress), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
1001 { "VMMR3Lock", (void *)(uintptr_t)&VMMR3Lock, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
1002 { "VMMR3Unlock", (void *)(uintptr_t)&VMMR3Unlock, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
1003 { "VMR3ReqCall", (void *)(uintptr_t)&VMR3ReqCall, &g_aArgsVMR3ReqCall[0], ELEMENTS(g_aArgsVMR3ReqCall), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
1004 { "VMR3ReqFree", (void *)(uintptr_t)&VMR3ReqFree, &g_aArgsVMR3ReqFree[0], ELEMENTS(g_aArgsVMR3ReqFree), REMFNDESC_FLAGS_RET_INT | REMFNDESC_FLAGS_ELLIPSIS, sizeof(int), NULL },
1005// { "", (void *)(uintptr_t)&, &g_aArgsVM[0], ELEMENTS(g_aArgsVM), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
1006};
1007
1008
1009/**
1010 * Descriptors for the functions imported from VBoxRT.
1011 */
1012static REMFNDESC g_aRTImports[] =
1013{
1014 { "AssertMsg1", (void *)(uintptr_t)&AssertMsg1, &g_aArgsAssertMsg1[0], ELEMENTS(g_aArgsAssertMsg1), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
1015 { "AssertMsg2", (void *)(uintptr_t)&AssertMsg2, &g_aArgsAssertMsg2[0], ELEMENTS(g_aArgsAssertMsg2), REMFNDESC_FLAGS_RET_VOID | REMFNDESC_FLAGS_ELLIPSIS, 0, NULL },
1016 { "RTAssertDoBreakpoint", (void *)(uintptr_t)&RTAssertDoBreakpoint, NULL, 0, REMFNDESC_FLAGS_RET_INT, sizeof(bool), NULL },
1017 { "RTLogDefaultInstance", (void *)(uintptr_t)&RTLogDefaultInstance, NULL, 0, REMFNDESC_FLAGS_RET_INT, sizeof(PRTLOGGER), NULL },
1018 { "RTLogRelDefaultInstance", (void *)(uintptr_t)&RTLogRelDefaultInstance, NULL, 0, REMFNDESC_FLAGS_RET_INT, sizeof(PRTLOGGER), NULL },
1019 { "RTLogFlags", (void *)(uintptr_t)&RTLogFlags, &g_aArgsRTLogFlags[0], ELEMENTS(g_aArgsRTLogFlags), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
1020 { "RTLogLoggerEx", (void *)(uintptr_t)&RTLogLoggerEx, &g_aArgsRTLogLoggerEx[0], ELEMENTS(g_aArgsRTLogLoggerEx), REMFNDESC_FLAGS_RET_VOID | REMFNDESC_FLAGS_ELLIPSIS, 0, NULL },
1021 { "RTLogLoggerExV", (void *)(uintptr_t)&RTLogLoggerExV, &g_aArgsRTLogLoggerExV[0], ELEMENTS(g_aArgsRTLogLoggerExV), REMFNDESC_FLAGS_RET_VOID | REMFNDESC_FLAGS_VALIST, 0, NULL },
1022 { "RTLogPrintf", (void *)(uintptr_t)&RTLogPrintf, &g_aArgsRTLogPrintf[0], ELEMENTS(g_aArgsRTLogPrintf), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
1023 { "RTMemAlloc", (void *)(uintptr_t)&RTMemAlloc, &g_aArgsSIZE_T[0], ELEMENTS(g_aArgsSIZE_T), REMFNDESC_FLAGS_RET_INT, sizeof(void *), NULL },
1024 { "RTMemExecAlloc", (void *)(uintptr_t)&RTMemExecAlloc, &g_aArgsSIZE_T[0], ELEMENTS(g_aArgsSIZE_T), REMFNDESC_FLAGS_RET_INT, sizeof(void *), NULL },
1025 { "RTMemExecFree", (void *)(uintptr_t)&RTMemExecFree, &g_aArgsPTR[0], ELEMENTS(g_aArgsPTR), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
1026 { "RTMemFree", (void *)(uintptr_t)&RTMemFree, &g_aArgsPTR[0], ELEMENTS(g_aArgsPTR), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
1027 { "RTMemPageAlloc", (void *)(uintptr_t)&RTMemPageAlloc, &g_aArgsSIZE_T[0], ELEMENTS(g_aArgsSIZE_T), REMFNDESC_FLAGS_RET_INT, sizeof(void *), NULL },
1028 { "RTMemPageFree", (void *)(uintptr_t)&RTMemPageFree, &g_aArgsPTR[0], ELEMENTS(g_aArgsPTR), REMFNDESC_FLAGS_RET_VOID, 0, NULL },
1029 { "RTMemProtect", (void *)(uintptr_t)&RTMemProtect, &g_aArgsRTMemProtect[0], ELEMENTS(g_aArgsRTMemProtect), REMFNDESC_FLAGS_RET_INT, sizeof(int), NULL },
1030 { "RTStrPrintf", (void *)(uintptr_t)&RTStrPrintf, &g_aArgsRTStrPrintf[0], ELEMENTS(g_aArgsRTStrPrintf), REMFNDESC_FLAGS_RET_INT | REMFNDESC_FLAGS_ELLIPSIS, sizeof(size_t), NULL },
1031 { "RTStrPrintfV", (void *)(uintptr_t)&RTStrPrintfV, &g_aArgsRTStrPrintfV[0], ELEMENTS(g_aArgsRTStrPrintfV), REMFNDESC_FLAGS_RET_INT | REMFNDESC_FLAGS_VALIST, sizeof(size_t), NULL },
1032 { "RTThreadNativeSelf", (void *)(uintptr_t)&RTThreadNativeSelf, NULL, 0, REMFNDESC_FLAGS_RET_INT, sizeof(RTNATIVETHREAD), NULL },
1033};
1034
1035
1036/**
1037 * Descriptors for the functions imported from VBoxRT.
1038 */
1039static REMFNDESC g_aCRTImports[] =
1040{
1041 { "memcpy", (void *)(uintptr_t)&memcpy, &g_aArgsmemcpy[0], ELEMENTS(g_aArgsmemcpy), REMFNDESC_FLAGS_RET_INT, sizeof(void *), NULL },
1042 { "memset", (void *)(uintptr_t)&memset, &g_aArgsmemset[0], ELEMENTS(g_aArgsmemset), REMFNDESC_FLAGS_RET_INT, sizeof(void *), NULL }
1043/*
1044floor floor
1045memcpy memcpy
1046sqrt sqrt
1047sqrtf sqrtf
1048*/
1049};
1050
1051
1052# if defined(USE_REM_CALLING_CONVENTION_GLUE) || defined(USE_REM_IMPORT_JUMP_GLUE)
1053/** LIFO of read-write-executable memory chunks used for wrappers. */
1054static PREMEXECMEM g_pExecMemHead;
1055# endif
1056
1057
1058/*******************************************************************************
1059* Internal Functions *
1060*******************************************************************************/
1061# ifdef USE_REM_CALLING_CONVENTION_GLUE
1062DECLASM(int) WrapGCC2MSC0Int(void); DECLASM(int) WrapGCC2MSC0Int_EndProc(void);
1063DECLASM(int) WrapGCC2MSC1Int(void); DECLASM(int) WrapGCC2MSC1Int_EndProc(void);
1064DECLASM(int) WrapGCC2MSC2Int(void); DECLASM(int) WrapGCC2MSC2Int_EndProc(void);
1065DECLASM(int) WrapGCC2MSC3Int(void); DECLASM(int) WrapGCC2MSC3Int_EndProc(void);
1066DECLASM(int) WrapGCC2MSC4Int(void); DECLASM(int) WrapGCC2MSC4Int_EndProc(void);
1067DECLASM(int) WrapGCC2MSC5Int(void); DECLASM(int) WrapGCC2MSC5Int_EndProc(void);
1068DECLASM(int) WrapGCC2MSC6Int(void); DECLASM(int) WrapGCC2MSC6Int_EndProc(void);
1069DECLASM(int) WrapGCC2MSC7Int(void); DECLASM(int) WrapGCC2MSC7Int_EndProc(void);
1070DECLASM(int) WrapGCC2MSC8Int(void); DECLASM(int) WrapGCC2MSC8Int_EndProc(void);
1071DECLASM(int) WrapGCC2MSC9Int(void); DECLASM(int) WrapGCC2MSC9Int_EndProc(void);
1072DECLASM(int) WrapGCC2MSC10Int(void); DECLASM(int) WrapGCC2MSC10Int_EndProc(void);
1073DECLASM(int) WrapGCC2MSC11Int(void); DECLASM(int) WrapGCC2MSC11Int_EndProc(void);
1074DECLASM(int) WrapGCC2MSC12Int(void); DECLASM(int) WrapGCC2MSC12Int_EndProc(void);
1075DECLASM(int) WrapGCC2MSCVariadictInt(void); DECLASM(int) WrapGCC2MSCVariadictInt_EndProc(void);
1076
1077DECLASM(int) WrapMSC2GCC0Int(void); DECLASM(int) WrapMSC2GCC0Int_EndProc(void);
1078DECLASM(int) WrapMSC2GCC1Int(void); DECLASM(int) WrapMSC2GCC1Int_EndProc(void);
1079DECLASM(int) WrapMSC2GCC2Int(void); DECLASM(int) WrapMSC2GCC2Int_EndProc(void);
1080DECLASM(int) WrapMSC2GCC3Int(void); DECLASM(int) WrapMSC2GCC3Int_EndProc(void);
1081DECLASM(int) WrapMSC2GCC4Int(void); DECLASM(int) WrapMSC2GCC4Int_EndProc(void);
1082DECLASM(int) WrapMSC2GCC5Int(void); DECLASM(int) WrapMSC2GCC5Int_EndProc(void);
1083DECLASM(int) WrapMSC2GCC6Int(void); DECLASM(int) WrapMSC2GCC6Int_EndProc(void);
1084DECLASM(int) WrapMSC2GCC7Int(void); DECLASM(int) WrapMSC2GCC7Int_EndProc(void);
1085DECLASM(int) WrapMSC2GCC8Int(void); DECLASM(int) WrapMSC2GCC8Int_EndProc(void);
1086DECLASM(int) WrapMSC2GCC9Int(void); DECLASM(int) WrapMSC2GCC9Int_EndProc(void);
1087# endif
1088
1089
1090# if defined(USE_REM_CALLING_CONVENTION_GLUE) || defined(USE_REM_IMPORT_JUMP_GLUE)
1091/**
1092 * Allocates a block of memory for glue code.
1093 *
1094 * The returned memory is padded with INT3s.
1095 *
1096 * @returns Pointer to the allocated memory.
1097 * @param The amount of memory to allocate.
1098 */
1099static void *remAllocGlue(size_t cb)
1100{
1101 PREMEXECMEM pCur = g_pExecMemHead;
1102 uint32_t cbAligned = (uint32_t)RT_ALIGN_32(cb, 32);
1103 while (pCur)
1104 {
1105 if (pCur->cb - pCur->off >= cbAligned)
1106 {
1107 void *pv = (uint8_t *)pCur + pCur->off;
1108 pCur->off += cbAligned;
1109 return memset(pv, 0xcc, cbAligned);
1110 }
1111 pCur = pCur->pNext;
1112 }
1113
1114 /* add a new chunk */
1115 AssertReturn(_64K - RT_ALIGN_Z(sizeof(*pCur), 32) > cbAligned, NULL);
1116 pCur = (PREMEXECMEM)RTMemExecAlloc(_64K);
1117 AssertReturn(pCur, NULL);
1118 pCur->cb = _64K;
1119 pCur->off = RT_ALIGN_32(sizeof(*pCur), 32) + cbAligned;
1120 pCur->pNext = g_pExecMemHead;
1121 g_pExecMemHead = pCur;
1122 return memset((uint8_t *)pCur + RT_ALIGN_Z(sizeof(*pCur), 32), 0xcc, cbAligned);
1123}
1124# endif /* USE_REM_CALLING_CONVENTION_GLUE || USE_REM_IMPORT_JUMP_GLUE */
1125
1126
1127# ifdef USE_REM_CALLING_CONVENTION_GLUE
1128/**
1129 * Checks if a function is all straight forward integers.
1130 *
1131 * @returns True if it's simple, false if it's bothersome.
1132 * @param pDesc The function descriptor.
1133 */
1134static bool remIsFunctionAllInts(PCREMFNDESC pDesc)
1135{
1136 if ( ( (pDesc->fFlags & REMFNDESC_FLAGS_RET_TYPE_MASK) != REMFNDESC_FLAGS_RET_INT
1137 || pDesc->cbReturn > sizeof(uint64_t))
1138 && (pDesc->fFlags & REMFNDESC_FLAGS_RET_TYPE_MASK) != REMFNDESC_FLAGS_RET_VOID)
1139 return false;
1140 unsigned i = pDesc->cParams;
1141 while (i-- > 0)
1142 switch (pDesc->paParams[i].fFlags & REMPARMDESC_FLAGS_TYPE_MASK)
1143 {
1144 case REMPARMDESC_FLAGS_INT:
1145 case REMPARMDESC_FLAGS_GCPTR:
1146 case REMPARMDESC_FLAGS_GCPHYS:
1147 case REMPARMDESC_FLAGS_HCPHYS:
1148 break;
1149
1150 default:
1151 AssertReleaseMsgFailed(("Invalid param flags %#x for #%d of %s!\n", pDesc->paParams[i].fFlags, i, pDesc->pszName));
1152 case REMPARMDESC_FLAGS_VALIST:
1153 case REMPARMDESC_FLAGS_ELLIPSIS:
1154 case REMPARMDESC_FLAGS_FLOAT:
1155 case REMPARMDESC_FLAGS_STRUCT:
1156 return false;
1157 }
1158 return true;
1159}
1160
1161
1162/**
1163 * Checks if the function has an ellipsis (...) argument.
1164 *
1165 * @returns true if it has an ellipsis, otherwise false.
1166 * @param pDesc The function descriptor.
1167 */
1168static bool remHasFunctionEllipsis(PCREMFNDESC pDesc)
1169{
1170 unsigned i = pDesc->cParams;
1171 while (i-- > 0)
1172 if ((pDesc->paParams[i].fFlags & REMPARMDESC_FLAGS_TYPE_MASK) == REMPARMDESC_FLAGS_ELLIPSIS)
1173 return true;
1174 return false;
1175}
1176
1177
1178/**
1179 * Checks if the function uses floating point (FP) arguments or return value.
1180 *
1181 * @returns true if it uses floating point, otherwise false.
1182 * @param pDesc The function descriptor.
1183 */
1184static bool remIsFunctionUsingFP(PCREMFNDESC pDesc)
1185{
1186 if ((pDesc->fFlags & REMFNDESC_FLAGS_RET_TYPE_MASK) == REMFNDESC_FLAGS_RET_FLOAT)
1187 return true;
1188 unsigned i = pDesc->cParams;
1189 while (i-- > 0)
1190 if ((pDesc->paParams[i].fFlags & REMPARMDESC_FLAGS_TYPE_MASK) == REMPARMDESC_FLAGS_FLOAT)
1191 return true;
1192 return false;
1193}
1194
1195
1196/**
1197 * Fixes export glue.
1198 *
1199 * @param pvGlue The glue code.
1200 * @param cb The size of the glue code.
1201 * @param pvExport The address of the export we're wrapping.
1202 * @param pDesc The export descriptor.
1203 */
1204static void remGenerateExportGlueFixup(void *pvGlue, size_t cb, uintptr_t uExport, PCREMFNDESC pDesc)
1205{
1206 union
1207 {
1208 uint8_t *pu8;
1209 int32_t *pi32;
1210 uint32_t *pu32;
1211 uint64_t *pu64;
1212 void *pv;
1213 } u;
1214 u.pv = pvGlue;
1215
1216 while (cb >= 4)
1217 {
1218 if (*u.pu32 == 0xdeadbeef)
1219 {
1220 /* 32-bit rel jmp/call to real export. */
1221 *u.pi32 = uExport - (uintptr_t)(u.pi32 + 1);
1222 Assert((uintptr_t)(u.pi32 + 1) + *u.pi32 == uExport);
1223 u.pi32++;
1224 cb -= 4;
1225 continue;
1226 }
1227 if (cb >= 8 && *u.pu64 == UINT64_C(0xdeadf00df00ddead))
1228 {
1229 /* 64-bit address to the real export. */
1230 *u.pu64++ = uExport;
1231 cb -= 8;
1232 continue;
1233 }
1234
1235 /* move on. */
1236 u.pu8++;
1237 cb--;
1238 }
1239}
1240
1241
1242/**
1243 * Fixes import glue.
1244 *
1245 * @param pvGlue The glue code.
1246 * @param cb The size of the glue code.
1247 * @param pDesc The import descriptor.
1248 */
1249static void remGenerateImportGlueFixup(void *pvGlue, size_t cb, PCREMFNDESC pDesc)
1250{
1251 union
1252 {
1253 uint8_t *pu8;
1254 int32_t *pi32;
1255 uint32_t *pu32;
1256 uint64_t *pu64;
1257 void *pv;
1258 } u;
1259 u.pv = pvGlue;
1260
1261 while (cb >= 4)
1262 {
1263 if (*u.pu32 == 0xdeadbeef)
1264 {
1265 /* 32-bit rel jmp/call to real function. */
1266 *u.pi32 = (uintptr_t)pDesc->pv - (uintptr_t)(u.pi32 + 1);
1267 Assert((uintptr_t)(u.pi32 + 1) + *u.pi32 == (uintptr_t)pDesc->pv);
1268 u.pi32++;
1269 cb -= 4;
1270 continue;
1271 }
1272 if (cb >= 8 && *u.pu64 == UINT64_C(0xdeadf00df00ddead))
1273 {
1274 /* 64-bit address to the real function. */
1275 *u.pu64++ = (uintptr_t)pDesc->pv;
1276 cb -= 8;
1277 continue;
1278 }
1279
1280 /* move on. */
1281 u.pu8++;
1282 cb--;
1283 }
1284}
1285
1286# endif /* USE_REM_CALLING_CONVENTION_GLUE */
1287
1288
1289/**
1290 * Generate wrapper glue code for an export.
1291 *
1292 * This is only used on win64 when loading a 64-bit linux module. So, on other
1293 * platforms it will not do anything.
1294 *
1295 * @returns VBox status code.
1296 * @param pValue IN: Where to get the address of the function to wrap.
1297 * OUT: Where to store the glue address.
1298 * @param pDesc The export descriptor.
1299 */
1300static int remGenerateExportGlue(PRTUINTPTR pValue, PCREMFNDESC pDesc)
1301{
1302# ifdef USE_REM_CALLING_CONVENTION_GLUE
1303 uintptr_t *ppfn = (uintptr_t *)pDesc->pv;
1304 if (!*ppfn)
1305 {
1306 if (remIsFunctionAllInts(pDesc))
1307 {
1308 static const struct { void *pvStart, *pvEnd; } s_aTemplates[] =
1309 {
1310 { (void *)&WrapMSC2GCC0Int, (void *)&WrapMSC2GCC0Int_EndProc },
1311 { (void *)&WrapMSC2GCC1Int, (void *)&WrapMSC2GCC1Int_EndProc },
1312 { (void *)&WrapMSC2GCC2Int, (void *)&WrapMSC2GCC2Int_EndProc },
1313 { (void *)&WrapMSC2GCC3Int, (void *)&WrapMSC2GCC3Int_EndProc },
1314 { (void *)&WrapMSC2GCC4Int, (void *)&WrapMSC2GCC4Int_EndProc },
1315 { (void *)&WrapMSC2GCC5Int, (void *)&WrapMSC2GCC5Int_EndProc },
1316 { (void *)&WrapMSC2GCC6Int, (void *)&WrapMSC2GCC6Int_EndProc },
1317 { (void *)&WrapMSC2GCC7Int, (void *)&WrapMSC2GCC7Int_EndProc },
1318 { (void *)&WrapMSC2GCC8Int, (void *)&WrapMSC2GCC8Int_EndProc },
1319 { (void *)&WrapMSC2GCC9Int, (void *)&WrapMSC2GCC9Int_EndProc },
1320 };
1321 const unsigned i = pDesc->cParams;
1322 AssertReleaseMsg(i < ELEMENTS(s_aTemplates), ("%d (%s)\n", i, pDesc->pszName));
1323
1324 /* duplicate the patch. */
1325 const size_t cb = (uintptr_t)s_aTemplates[i].pvEnd - (uintptr_t)s_aTemplates[i].pvStart;
1326 uint8_t *pb = (uint8_t *)remAllocGlue(cb);
1327 AssertReturn(pb, VERR_NO_MEMORY);
1328 memcpy(pb, s_aTemplates[i].pvStart, cb);
1329
1330 /* fix it up. */
1331 remGenerateExportGlueFixup(pb, cb, *pValue, pDesc);
1332 *ppfn = (uintptr_t)pb;
1333 }
1334 else
1335 {
1336 /* annoying stuff, later. */
1337#if 1
1338 AssertReleaseMsgFailed(("Not implemented! %s\n", pDesc->pszName));
1339 return VERR_NOT_IMPLEMENTED;
1340#else
1341 AssertMsg2("annoying: %s\n", pDesc->pszName);
1342 uint8_t *pb;
1343 pb = (uint8_t *)remAllocGlue(3);
1344 AssertReturn(pb, VERR_NO_MEMORY);
1345 *pb++ = 0xcc;
1346 *pb++ = 0x90;
1347 *pb++ = 0xc3;
1348 *ppfn = (uintptr_t)pb;
1349#endif
1350 }
1351 }
1352 *pValue = *ppfn;
1353 return VINF_SUCCESS;
1354# else /* !USE_REM_CALLING_CONVENTION_GLUE */
1355 return VINF_SUCCESS;
1356# endif /* !USE_REM_CALLING_CONVENTION_GLUE */
1357}
1358
1359
1360/**
1361 * Generate wrapper glue code for an import.
1362 *
1363 * This is only used on win64 when loading a 64-bit linux module. So, on other
1364 * platforms it will simply return the address of the imported function
1365 * without generating any glue code.
1366 *
1367 * @returns VBox status code.
1368 * @param pValue Where to store the glue address.
1369 * @param pDesc The export descriptor.
1370 */
1371static int remGenerateImportGlue(PRTUINTPTR pValue, PREMFNDESC pDesc)
1372{
1373# if defined(USE_REM_CALLING_CONVENTION_GLUE) || defined(USE_REM_IMPORT_JUMP_GLUE)
1374 if (!pDesc->pvWrapper)
1375 {
1376# ifdef USE_REM_CALLING_CONVENTION_GLUE
1377 if (remIsFunctionAllInts(pDesc))
1378 {
1379 static const struct { void *pvStart, *pvEnd; } s_aTemplates[] =
1380 {
1381 { (void *)&WrapGCC2MSC0Int, (void *)&WrapGCC2MSC0Int_EndProc },
1382 { (void *)&WrapGCC2MSC1Int, (void *)&WrapGCC2MSC1Int_EndProc },
1383 { (void *)&WrapGCC2MSC2Int, (void *)&WrapGCC2MSC2Int_EndProc },
1384 { (void *)&WrapGCC2MSC3Int, (void *)&WrapGCC2MSC3Int_EndProc },
1385 { (void *)&WrapGCC2MSC4Int, (void *)&WrapGCC2MSC4Int_EndProc },
1386 { (void *)&WrapGCC2MSC5Int, (void *)&WrapGCC2MSC5Int_EndProc },
1387 { (void *)&WrapGCC2MSC6Int, (void *)&WrapGCC2MSC6Int_EndProc },
1388 { (void *)&WrapGCC2MSC7Int, (void *)&WrapGCC2MSC7Int_EndProc },
1389 { (void *)&WrapGCC2MSC8Int, (void *)&WrapGCC2MSC8Int_EndProc },
1390 { (void *)&WrapGCC2MSC9Int, (void *)&WrapGCC2MSC9Int_EndProc },
1391 { (void *)&WrapGCC2MSC10Int, (void *)&WrapGCC2MSC10Int_EndProc },
1392 { (void *)&WrapGCC2MSC11Int, (void *)&WrapGCC2MSC11Int_EndProc },
1393 { (void *)&WrapGCC2MSC12Int, (void *)&WrapGCC2MSC12Int_EndProc }
1394 };
1395 const unsigned i = pDesc->cParams;
1396 AssertReleaseMsg(i < ELEMENTS(s_aTemplates), ("%d (%s)\n", i, pDesc->pszName));
1397
1398 /* duplicate the patch. */
1399 const size_t cb = (uintptr_t)s_aTemplates[i].pvEnd - (uintptr_t)s_aTemplates[i].pvStart;
1400 pDesc->pvWrapper = remAllocGlue(cb);
1401 AssertReturn(pDesc->pvWrapper, VERR_NO_MEMORY);
1402 memcpy(pDesc->pvWrapper, s_aTemplates[i].pvStart, cb);
1403
1404 /* fix it up. */
1405 remGenerateImportGlueFixup((uint8_t *)pDesc->pvWrapper, cb, pDesc);
1406 }
1407 else if ( remHasFunctionEllipsis(pDesc)
1408 && !remIsFunctionUsingFP(pDesc))
1409 {
1410 /* duplicate the patch. */
1411 const size_t cb = (uintptr_t)&WrapGCC2MSCVariadictInt_EndProc - (uintptr_t)&WrapGCC2MSCVariadictInt;
1412 pDesc->pvWrapper = remAllocGlue(cb);
1413 AssertReturn(pDesc->pvWrapper, VERR_NO_MEMORY);
1414 memcpy(pDesc->pvWrapper, (void *)&WrapGCC2MSCVariadictInt, cb);
1415
1416 /* fix it up. */
1417 remGenerateImportGlueFixup((uint8_t *)pDesc->pvWrapper, cb, pDesc);
1418 }
1419 else
1420 {
1421 /* annoying stuff, later. */
1422#if 0
1423 AssertReleaseMsgFailed(("Not implemented! %s\n", pDesc->pszName));
1424 return VERR_NOT_IMPLEMENTED;
1425#else
1426 AssertMsg2("annoying: %s\n", pDesc->pszName);
1427 uint8_t *pb;
1428 pDesc->pvWrapper = pb = (uint8_t *)remAllocGlue(3);
1429 AssertReturn(pDesc->pvWrapper, VERR_NO_MEMORY);
1430 *pb++ = 0xcc;
1431 *pb++ = 0x90;
1432 *pb++ = 0xc3;
1433#endif
1434 }
1435# else /* !USE_REM_CALLING_CONVENTION_GLUE */
1436
1437 /*
1438 * Generate a jump patch.
1439 */
1440 uint8_t *pb;
1441# ifdef __AMD64__
1442 pDesc->pvWrapper = pb = (uint8_t *)remAllocGlue(32);
1443 AssertReturn(pDesc->pvWrapper, VERR_NO_MEMORY);
1444 /**pb++ = 0xcc;*/
1445 *pb++ = 0xff;
1446 *pb++ = 0x24;
1447 *pb++ = 0x25;
1448 *(uint32_t *)pb = (uintptr_t)pb + 5;
1449 pb += 5;
1450 *(uint64_t *)pb = (uint64_t)pDesc->pv;
1451# else
1452 pDesc->pvWrapper = pb = (uint8_t *)remAllocGlue(8);
1453 AssertReturn(pDesc->pvWrapper, VERR_NO_MEMORY);
1454 *pb++ = 0xea;
1455 *(uint32_t *)pb = (uint32_t)pDesc->pv;
1456# endif
1457# endif /* !USE_REM_CALLING_CONVENTION_GLUE */
1458 }
1459 *pValue = (uintptr_t)pDesc->pvWrapper;
1460# else /* !USE_REM_CALLING_CONVENTION_GLUE */
1461 *pValue = (uintptr_t)pDesc->pv;
1462# endif /* !USE_REM_CALLING_CONVENTION_GLUE */
1463 return VINF_SUCCESS;
1464}
1465
1466
1467/**
1468 * Resolve an external symbol during RTLdrGetBits().
1469 *
1470 * @returns iprt status code.
1471 * @param hLdrMod The loader module handle.
1472 * @param pszModule Module name.
1473 * @param pszSymbol Symbol name, NULL if uSymbol should be used.
1474 * @param uSymbol Symbol ordinal, ~0 if pszSymbol should be used.
1475 * @param pValue Where to store the symbol value (address).
1476 * @param pvUser User argument.
1477 */
1478static DECLCALLBACK(int) remGetImport(RTLDRMOD hLdrMod, const char *pszModule, const char *pszSymbol, unsigned uSymbol, RTUINTPTR *pValue, void *pvUser)
1479{
1480 unsigned i;
1481 for (i = 0; i < ELEMENTS(g_aVMMImports); i++)
1482 if (!strcmp(g_aVMMImports[i].pszName, pszSymbol))
1483 return remGenerateImportGlue(pValue, &g_aVMMImports[i]);
1484 for (i = 0; i < ELEMENTS(g_aRTImports); i++)
1485 if (!strcmp(g_aRTImports[i].pszName, pszSymbol))
1486 return remGenerateImportGlue(pValue, &g_aRTImports[i]);
1487 for (i = 0; i < ELEMENTS(g_aCRTImports); i++)
1488 if (!strcmp(g_aCRTImports[i].pszName, pszSymbol))
1489 return remGenerateImportGlue(pValue, &g_aCRTImports[i]);
1490#if 1
1491 AssertMsg2("missing: %s\n", pszSymbol);
1492 return remGenerateImportGlue(pValue, &g_aCRTImports[0]);
1493#else
1494 *pValue = 0;
1495 AssertMsgFailed(("%s.%s\n", pszModule, pszSymbol));
1496 return VERR_SYMBOL_NOT_FOUND;
1497#endif
1498}
1499
1500/**
1501 * Loads the linux object, resolves all imports and exports.
1502 *
1503 * @returns VBox status code.
1504 */
1505static int remLoadLinuxObj(void)
1506{
1507 size_t offFilename;
1508 char szPath[RTPATH_MAX];
1509 int rc = RTPathProgram(szPath, sizeof(szPath) - 32);
1510 AssertRCReturn(rc, rc);
1511 offFilename = strlen(szPath);
1512
1513 /*
1514 * Load the VBoxREM2.rel object/DLL.
1515 */
1516 strcpy(&szPath[offFilename], "/VBoxREM2.rel");
1517 rc = RTLdrOpen(szPath, &g_ModREM2);
1518 if (VBOX_SUCCESS(rc))
1519 {
1520 g_pvREM2 = RTMemExecAlloc(RTLdrSize(g_ModREM2));
1521 if (g_pvREM2)
1522 {
1523#ifdef DEBUG /* How to load the VBoxREM2.rel symbols into the GNU debugger. */
1524 RTPrintf("VBoxREMWrapper: (gdb) add-symbol-file %s 0x%p\n", szPath, g_pvREM2);
1525#endif
1526 Log(("Loading %s at 0x%p (%d bytes)\n"
1527 "(gdb) add-symbol-file %s 0x%p\n",
1528 szPath, g_pvREM2, RTLdrSize(g_ModREM2), szPath, g_pvREM2));
1529 rc = RTLdrGetBits(g_ModREM2, g_pvREM2, (RTUINTPTR)g_pvREM2, remGetImport, NULL);
1530 if (VBOX_SUCCESS(rc))
1531 {
1532 /*
1533 * Resolve exports.
1534 */
1535 unsigned i;
1536 for (i = 0; i < ELEMENTS(g_aExports); i++)
1537 {
1538 RTUINTPTR Value;
1539 rc = RTLdrGetSymbolEx(g_ModREM2, g_pvREM2, (RTUINTPTR)g_pvREM2, g_aExports[i].pszName, &Value);
1540 AssertMsgRC(rc, ("%s rc=%VRc\n", g_aExports[i].pszName, rc));
1541 if (VBOX_FAILURE(rc))
1542 break;
1543 rc = remGenerateExportGlue(&Value, &g_aExports[i]);
1544 if (VBOX_FAILURE(rc))
1545 break;
1546 *(void **)g_aExports[i].pv = (void *)(uintptr_t)Value;
1547 }
1548 return rc;
1549 }
1550 RTMemExecFree(g_pvREM2);
1551 }
1552 RTLdrClose(g_ModREM2);
1553 g_ModREM2 = NIL_RTLDRMOD;
1554 }
1555 return rc;
1556}
1557
1558
1559/**
1560 * Unloads the linux object, freeing up all resources (dlls and
1561 * import glue) we allocated during remLoadLinuxObj().
1562 */
1563static void remUnloadLinuxObj(void)
1564{
1565 unsigned i;
1566
1567 /* close modules. */
1568 RTLdrClose(g_ModREM2);
1569 g_ModREM2 = NIL_RTLDRMOD;
1570 RTMemExecFree(g_pvREM2);
1571 g_pvREM2 = NULL;
1572
1573 /* clear the pointers. */
1574 for (i = 0; i < ELEMENTS(g_aExports); i++)
1575 *(void **)g_aExports[i].pv = NULL;
1576# if defined(USE_REM_CALLING_CONVENTION_GLUE) || defined(USE_REM_IMPORT_JUMP_GLUE)
1577 for (i = 0; i < ELEMENTS(g_aVMMImports); i++)
1578 g_aVMMImports[i].pvWrapper = NULL;
1579 for (i = 0; i < ELEMENTS(g_aRTImports); i++)
1580 g_aRTImports[i].pvWrapper = NULL;
1581 for (i = 0; i < ELEMENTS(g_aCRTImports); i++)
1582 g_aCRTImports[i].pvWrapper = NULL;
1583
1584 /* free wrapper memory. */
1585 while (g_pExecMemHead)
1586 {
1587 PREMEXECMEM pCur = g_pExecMemHead;
1588 g_pExecMemHead = pCur->pNext;
1589 memset(pCur, 0xcc, pCur->cb);
1590 RTMemExecFree(pCur);
1591 }
1592# endif
1593}
1594#endif
1595
1596
1597REMR3DECL(int) REMR3Init(PVM pVM)
1598{
1599#ifdef USE_REM_STUBS
1600 return VINF_SUCCESS;
1601#else
1602 if (!pfnREMR3Init)
1603 {
1604 int rc = remLoadLinuxObj();
1605 if (VBOX_FAILURE(rc))
1606 return rc;
1607 }
1608 return pfnREMR3Init(pVM);
1609#endif
1610}
1611
1612REMR3DECL(int) REMR3Term(PVM pVM)
1613{
1614#ifdef USE_REM_STUBS
1615 return VINF_SUCCESS;
1616#else
1617 int rc;
1618 Assert(VALID_PTR(pfnREMR3Term));
1619 rc = pfnREMR3Term(pVM);
1620 remUnloadLinuxObj();
1621 return rc;
1622#endif
1623}
1624
1625REMR3DECL(void) REMR3Reset(PVM pVM)
1626{
1627#ifndef USE_REM_STUBS
1628 Assert(VALID_PTR(pfnREMR3Reset));
1629 pfnREMR3Reset(pVM);
1630#endif
1631}
1632
1633REMR3DECL(int) REMR3Step(PVM pVM)
1634{
1635#ifdef USE_REM_STUBS
1636 return VERR_NOT_IMPLEMENTED;
1637#else
1638 Assert(VALID_PTR(pfnREMR3Step));
1639 return pfnREMR3Step(pVM);
1640#endif
1641}
1642
1643REMR3DECL(int) REMR3BreakpointSet(PVM pVM, RTGCUINTPTR Address)
1644{
1645#ifdef USE_REM_STUBS
1646 return VERR_REM_NO_MORE_BP_SLOTS;
1647#else
1648 Assert(VALID_PTR(pfnREMR3BreakpointSet));
1649 return pfnREMR3BreakpointSet(pVM, Address);
1650#endif
1651}
1652
1653REMR3DECL(int) REMR3BreakpointClear(PVM pVM, RTGCUINTPTR Address)
1654{
1655#ifdef USE_REM_STUBS
1656 return VERR_NOT_IMPLEMENTED;
1657#else
1658 Assert(VALID_PTR(pfnREMR3BreakpointClear));
1659 return pfnREMR3BreakpointClear(pVM, Address);
1660#endif
1661}
1662
1663REMR3DECL(int) REMR3EmulateInstruction(PVM pVM)
1664{
1665#ifdef USE_REM_STUBS
1666 return VERR_NOT_IMPLEMENTED;
1667#else
1668 Assert(VALID_PTR(pfnREMR3EmulateInstruction));
1669 return pfnREMR3EmulateInstruction(pVM);
1670#endif
1671}
1672
1673REMR3DECL(int) REMR3Run(PVM pVM)
1674{
1675#ifdef USE_REM_STUBS
1676 return VERR_NOT_IMPLEMENTED;
1677#else
1678 Assert(VALID_PTR(pfnREMR3Run));
1679 return pfnREMR3Run(pVM);
1680#endif
1681}
1682
1683REMR3DECL(int) REMR3State(PVM pVM)
1684{
1685#ifdef USE_REM_STUBS
1686 return VERR_NOT_IMPLEMENTED;
1687#else
1688 Assert(VALID_PTR(pfnREMR3State));
1689 return pfnREMR3State(pVM);
1690#endif
1691}
1692
1693REMR3DECL(int) REMR3StateBack(PVM pVM)
1694{
1695#ifdef USE_REM_STUBS
1696 return VERR_NOT_IMPLEMENTED;
1697#else
1698 Assert(VALID_PTR(pfnREMR3StateBack));
1699 return pfnREMR3StateBack(pVM);
1700#endif
1701}
1702
1703REMR3DECL(void) REMR3StateUpdate(PVM pVM)
1704{
1705#ifndef USE_REM_STUBS
1706 Assert(VALID_PTR(pfnREMR3StateUpdate));
1707 pfnREMR3StateUpdate(pVM);
1708#endif
1709}
1710
1711REMR3DECL(void) REMR3A20Set(PVM pVM, bool fEnable)
1712{
1713#ifndef USE_REM_STUBS
1714 Assert(VALID_PTR(pfnREMR3A20Set));
1715 pfnREMR3A20Set(pVM, fEnable);
1716#endif
1717}
1718
1719REMR3DECL(void) REMR3ReplayInvalidatedPages(PVM pVM)
1720{
1721#ifndef USE_REM_STUBS
1722 Assert(VALID_PTR(pfnREMR3ReplayInvalidatedPages));
1723 pfnREMR3ReplayInvalidatedPages(pVM);
1724#endif
1725}
1726
1727REMR3DECL(void) REMR3ReplayHandlerNotifications(PVM pVM)
1728{
1729#ifndef USE_REM_STUBS
1730 Assert(VALID_PTR(pfnREMR3ReplayHandlerNotifications));
1731 pfnREMR3ReplayHandlerNotifications(pVM);
1732#endif
1733}
1734
1735REMR3DECL(int) REMR3NotifyCodePageChanged(PVM pVM, RTGCPTR pvCodePage)
1736{
1737#ifdef USE_REM_STUBS
1738 return VINF_SUCCESS;
1739#else
1740 Assert(VALID_PTR(pfnREMR3NotifyCodePageChanged));
1741 return pfnREMR3NotifyCodePageChanged(pVM, pvCodePage);
1742#endif
1743}
1744
1745REMR3DECL(void) REMR3NotifyPhysRamRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, void *pvRam, unsigned fFlags)
1746{
1747#ifndef USE_REM_STUBS
1748 Assert(VALID_PTR(pfnREMR3NotifyPhysRamRegister));
1749 pfnREMR3NotifyPhysRamRegister(pVM, GCPhys, cb, pvRam, fFlags);
1750#endif
1751}
1752
1753REMR3DECL(void) REMR3NotifyPhysRamChunkRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, RTHCUINTPTR pvRam, unsigned fFlags)
1754{
1755#ifndef USE_REM_STUBS
1756 Assert(VALID_PTR(pfnREMR3NotifyPhysRamChunkRegister));
1757 pfnREMR3NotifyPhysRamChunkRegister(pVM, GCPhys, cb, pvRam, fFlags);
1758#endif
1759}
1760
1761REMR3DECL(void) REMR3NotifyPhysRomRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, void *pvCopy)
1762{
1763#ifndef USE_REM_STUBS
1764 Assert(VALID_PTR(pfnREMR3NotifyPhysRomRegister));
1765 pfnREMR3NotifyPhysRomRegister(pVM, GCPhys, cb, pvCopy);
1766#endif
1767}
1768
1769REMR3DECL(void) REMR3NotifyPhysReserve(PVM pVM, RTGCPHYS GCPhys, RTUINT cb)
1770{
1771#ifndef USE_REM_STUBS
1772 Assert(VALID_PTR(pfnREMR3NotifyPhysReserve));
1773 pfnREMR3NotifyPhysReserve(pVM, GCPhys, cb);
1774#endif
1775}
1776
1777REMR3DECL(void) REMR3NotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler)
1778{
1779#ifndef USE_REM_STUBS
1780 Assert(VALID_PTR(pfnREMR3NotifyHandlerPhysicalRegister));
1781 pfnREMR3NotifyHandlerPhysicalRegister(pVM, enmType, GCPhys, cb, fHasHCHandler);
1782#endif
1783}
1784
1785REMR3DECL(void) REMR3NotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler, void *pvHCPtr)
1786{
1787#ifndef USE_REM_STUBS
1788 Assert(VALID_PTR(pfnREMR3NotifyHandlerPhysicalDeregister));
1789 pfnREMR3NotifyHandlerPhysicalDeregister(pVM, enmType, GCPhys, cb, fHasHCHandler, pvHCPtr);
1790#endif
1791}
1792
1793REMR3DECL(void) REMR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, void *pvHCPtr)
1794{
1795#ifndef USE_REM_STUBS
1796 Assert(VALID_PTR(pfnREMR3NotifyHandlerPhysicalModify));
1797 pfnREMR3NotifyHandlerPhysicalModify(pVM, enmType, GCPhysOld, GCPhysNew, cb, fHasHCHandler, pvHCPtr);
1798#endif
1799}
1800
1801REMDECL(bool) REMR3IsPageAccessHandled(PVM pVM, RTGCPHYS GCPhys)
1802{
1803#ifdef USE_REM_STUBS
1804 return false;
1805#else
1806 Assert(VALID_PTR(pfnREMR3IsPageAccessHandled));
1807 return pfnREMR3IsPageAccessHandled(pVM, GCPhys);
1808#endif
1809}
1810
1811REMR3DECL(int) REMR3DisasEnableStepping(PVM pVM, bool fEnable)
1812{
1813#ifdef USE_REM_STUBS
1814 return VERR_NOT_IMPLEMENTED;
1815#else
1816 Assert(VALID_PTR(pfnREMR3DisasEnableStepping));
1817 return pfnREMR3DisasEnableStepping(pVM, fEnable);
1818#endif
1819}
1820
1821REMR3DECL(void) REMR3NotifyPendingInterrupt(PVM pVM, uint8_t u8Interrupt)
1822{
1823#ifndef USE_REM_STUBS
1824 Assert(VALID_PTR(pfnREMR3NotifyPendingInterrupt));
1825 pfnREMR3NotifyPendingInterrupt(pVM, u8Interrupt);
1826#endif
1827}
1828
1829REMR3DECL(uint32_t) REMR3QueryPendingInterrupt(PVM pVM)
1830{
1831#ifdef USE_REM_STUBS
1832 return REM_NO_PENDING_IRQ;
1833#else
1834 Assert(VALID_PTR(pfnREMR3QueryPendingInterrupt));
1835 return pfnREMR3QueryPendingInterrupt(pVM);
1836#endif
1837}
1838
1839REMR3DECL(void) REMR3NotifyInterruptSet(PVM pVM)
1840{
1841#ifndef USE_REM_STUBS
1842 Assert(VALID_PTR(pfnREMR3NotifyInterruptSet));
1843 pfnREMR3NotifyInterruptSet(pVM);
1844#endif
1845}
1846
1847REMR3DECL(void) REMR3NotifyInterruptClear(PVM pVM)
1848{
1849#ifndef USE_REM_STUBS
1850 Assert(VALID_PTR(pfnREMR3NotifyInterruptClear));
1851 pfnREMR3NotifyInterruptClear(pVM);
1852#endif
1853}
1854
1855REMR3DECL(void) REMR3NotifyTimerPending(PVM pVM)
1856{
1857#ifndef USE_REM_STUBS
1858 Assert(VALID_PTR(pfnREMR3NotifyTimerPending));
1859 pfnREMR3NotifyTimerPending(pVM);
1860#endif
1861}
1862
1863REMR3DECL(void) REMR3NotifyDmaPending(PVM pVM)
1864{
1865#ifndef USE_REM_STUBS
1866 Assert(VALID_PTR(pfnREMR3NotifyDmaPending));
1867 pfnREMR3NotifyDmaPending(pVM);
1868#endif
1869}
1870
1871REMR3DECL(void) REMR3NotifyQueuePending(PVM pVM)
1872{
1873#ifndef USE_REM_STUBS
1874 Assert(VALID_PTR(pfnREMR3NotifyQueuePending));
1875 pfnREMR3NotifyQueuePending(pVM);
1876#endif
1877}
1878
1879REMR3DECL(void) REMR3NotifyFF(PVM pVM)
1880{
1881#ifndef USE_REM_STUBS
1882 /* the timer can call this early on, so don't be picky. */
1883 if (pfnREMR3NotifyFF)
1884 pfnREMR3NotifyFF(pVM);
1885#endif
1886}
1887
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