VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMInternal.h@ 20854

最後變更 在這個檔案從20854是 20854,由 vboxsync 提交於 16 年 前

VMM: Use the custom logger prefix to indicate the virtual CPU ID.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 21.2 KB
 
1/* $Id: VMMInternal.h 20854 2009-06-23 16:32:12Z vboxsync $ */
2/** @file
3 * VMM - Internal header file.
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.alldomusa.eu.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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22#ifndef ___VMMInternal_h
23#define ___VMMInternal_h
24
25#include <VBox/cdefs.h>
26#include <VBox/stam.h>
27#include <VBox/log.h>
28#include <iprt/critsect.h>
29
30
31#if !defined(IN_VMM_R3) && !defined(IN_VMM_R0) && !defined(IN_VMM_RC)
32# error "Not in VMM! This is an internal header!"
33#endif
34
35
36/** @defgroup grp_vmm_int Internals
37 * @ingroup grp_vmm
38 * @internal
39 * @{
40 */
41
42/** @def VBOX_WITH_RC_RELEASE_LOGGING
43 * Enables RC release logging. */
44#define VBOX_WITH_RC_RELEASE_LOGGING
45
46/** @def VBOX_WITH_R0_LOGGING
47 * Enables Ring-0 logging (non-release).
48 *
49 * Ring-0 logging isn't 100% safe yet (thread id reuse / process exit cleanup),
50 * so you have to sign up here by adding your defined(DEBUG_<userid>) to the
51 * #if, or by adding VBOX_WITH_R0_LOGGING to your LocalConfig.kmk.
52 *
53 * You might also wish to enable the AssertMsg1/2 overrides in VMMR0.cpp when
54 * enabling this.
55 */
56#if defined(DEBUG_sandervl) || defined(DEBUG_frank) || defined(DOXYGEN_RUNNING)
57# define VBOX_WITH_R0_LOGGING
58#endif
59
60/** @def VBOX_STRICT_VMM_STACK
61 * Enables VMM stack guard pages to catch stack over- and underruns. */
62#if defined(VBOX_STRICT) || defined(DOXYGEN_RUNNING)
63# define VBOX_STRICT_VMM_STACK
64#endif
65
66
67/**
68 * Converts a VMM pointer into a VM pointer.
69 * @returns Pointer to the VM structure the VMM is part of.
70 * @param pVMM Pointer to VMM instance data.
71 */
72#define VMM2VM(pVMM) ( (PVM)((char*)pVMM - pVMM->offVM) )
73
74
75/**
76 * Switcher function, HC to RC.
77 *
78 * @param pVM The VM handle.
79 * @returns Return code indicating the action to take.
80 */
81typedef DECLASMTYPE(int) FNVMMSWITCHERHC(PVM pVM);
82/** Pointer to switcher function. */
83typedef FNVMMSWITCHERHC *PFNVMMSWITCHERHC;
84
85/**
86 * Switcher function, RC to HC.
87 *
88 * @param rc VBox status code.
89 */
90typedef DECLASMTYPE(void) FNVMMSWITCHERRC(int rc);
91/** Pointer to switcher function. */
92typedef FNVMMSWITCHERRC *PFNVMMSWITCHERRC;
93
94
95/**
96 * The ring-0 logger instance wrapper.
97 *
98 * We need to be able to find the VM handle from the logger instance, so we wrap
99 * it in this structure.
100 */
101typedef struct VMMR0LOGGER
102{
103 /** Pointer to the VM handle. */
104 R0PTRTYPE(PVM) pVM;
105 /** Size of the allocated logger instance (Logger). */
106 uint32_t cbLogger;
107 /** Flag indicating whether we've create the logger Ring-0 instance yet. */
108 bool fCreated;
109 /** Flag indicating whether we've disabled flushing (world switch) or not. */
110 bool fFlushingDisabled;
111 /** Flag indicating whether we've registered the instance already. */
112 bool fRegistered;
113 bool a8Alignment;
114 /** The CPU ID. */
115 VMCPUID idCpu;
116#if HC_ARCH_BITS == 64
117 uint32_t u32Alignment;
118#endif
119 /** The ring-0 logger instance. This extends beyond the size. */
120 RTLOGGER Logger;
121} VMMR0LOGGER;
122/** Pointer to a ring-0 logger instance wrapper. */
123typedef VMMR0LOGGER *PVMMR0LOGGER;
124
125
126/**
127 * Jump buffer for the setjmp/longjmp like constructs used to
128 * quickly 'call' back into Ring-3.
129 */
130typedef struct VMMR0JMPBUF
131{
132 /** Traditional jmp_buf stuff
133 * @{ */
134#if HC_ARCH_BITS == 32
135 uint32_t ebx;
136 uint32_t esi;
137 uint32_t edi;
138 uint32_t ebp;
139 uint32_t esp;
140 uint32_t eip;
141 uint32_t u32Padding;
142#endif
143#if HC_ARCH_BITS == 64
144 uint64_t rbx;
145# ifdef RT_OS_WINDOWS
146 uint64_t rsi;
147 uint64_t rdi;
148# endif
149 uint64_t rbp;
150 uint64_t r12;
151 uint64_t r13;
152 uint64_t r14;
153 uint64_t r15;
154 uint64_t rsp;
155 uint64_t rip;
156#endif
157 /** @} */
158
159 /** Flag that indicates that we've done a ring-3 call. */
160 bool fInRing3Call;
161 /** The number of bytes we've saved. */
162 uint32_t cbSavedStack;
163 /** Pointer to the buffer used to save the stack.
164 * This is assumed to be 8KB. */
165 RTR0PTR pvSavedStack;
166 /** Esp we we match against esp on resume to make sure the stack wasn't relocated. */
167 RTHCUINTREG SpCheck;
168 /** The esp we should resume execution with after the restore. */
169 RTHCUINTREG SpResume;
170 /** ESP/RSP at the time of the jump to ring 3. */
171 RTHCUINTREG SavedEsp;
172 /** EBP/RBP at the time of the jump to ring 3. */
173 RTHCUINTREG SavedEbp;
174
175 /** Stats: Max amount of stack used. */
176 uint32_t cbUsedMax;
177 /** Stats: Average stack usage. (Avg = cbUsedTotal / cUsedTotal) */
178 uint32_t cbUsedAvg;
179 /** Stats: Total amount of stack used. */
180 uint64_t cbUsedTotal;
181 /** Stats: Number of stack usages. */
182 uint64_t cUsedTotal;
183} VMMR0JMPBUF;
184/** Pointer to a ring-0 jump buffer. */
185typedef VMMR0JMPBUF *PVMMR0JMPBUF;
186
187
188/**
189 * VMM Data (part of VM)
190 */
191typedef struct VMM
192{
193 /** Offset to the VM structure.
194 * See VMM2VM(). */
195 RTINT offVM;
196
197 /** @name World Switcher and Related
198 * @{
199 */
200 /** Size of the core code. */
201 RTUINT cbCoreCode;
202 /** Physical address of core code. */
203 RTHCPHYS HCPhysCoreCode;
204 /** Pointer to core code ring-3 mapping - contiguous memory.
205 * At present this only means the context switcher code. */
206 RTR3PTR pvCoreCodeR3;
207 /** Pointer to core code ring-0 mapping - contiguous memory.
208 * At present this only means the context switcher code. */
209 RTR0PTR pvCoreCodeR0;
210 /** Pointer to core code guest context mapping. */
211 RTRCPTR pvCoreCodeRC;
212 RTRCPTR pRCPadding0; /**< Alignment padding */
213#ifdef VBOX_WITH_NMI
214 /** The guest context address of the APIC (host) mapping. */
215 RTRCPTR GCPtrApicBase;
216 RTRCPTR pRCPadding1; /**< Alignment padding */
217#endif
218 /** The current switcher.
219 * This will be set before the VMM is fully initialized. */
220 VMMSWITCHER enmSwitcher;
221 /** Flag to disable the switcher permanently (VMX) (boolean) */
222 bool fSwitcherDisabled;
223 /** Array of offsets to the different switchers within the core code. */
224 RTUINT aoffSwitchers[VMMSWITCHER_MAX];
225
226 /** Resume Guest Execution. See CPUMGCResumeGuest(). */
227 RTRCPTR pfnCPUMRCResumeGuest;
228 /** Resume Guest Execution in V86 mode. See CPUMGCResumeGuestV86(). */
229 RTRCPTR pfnCPUMRCResumeGuestV86;
230 /** Call Trampoline. See vmmGCCallTrampoline(). */
231 RTRCPTR pfnCallTrampolineRC;
232 /** Guest to host switcher entry point. */
233 RCPTRTYPE(PFNVMMSWITCHERRC) pfnGuestToHostRC;
234 /** Host to guest switcher entry point. */
235 R0PTRTYPE(PFNVMMSWITCHERHC) pfnHostToGuestR0;
236 /** @} */
237
238 /** @name Logging
239 * @{
240 */
241 /** Size of the allocated logger instance (pRCLoggerRC/pRCLoggerR3). */
242 uint32_t cbRCLogger;
243 /** Pointer to the RC logger instance - RC Ptr.
244 * This is NULL if logging is disabled. */
245 RCPTRTYPE(PRTLOGGERRC) pRCLoggerRC;
246 /** Pointer to the GC logger instance - R3 Ptr.
247 * This is NULL if logging is disabled. */
248 R3PTRTYPE(PRTLOGGERRC) pRCLoggerR3;
249 /** Pointer to the GC release logger instance - R3 Ptr. */
250 R3PTRTYPE(PRTLOGGERRC) pRCRelLoggerR3;
251 /** Pointer to the GC release logger instance - RC Ptr. */
252 RCPTRTYPE(PRTLOGGERRC) pRCRelLoggerRC;
253 /** Size of the allocated release logger instance (pRCRelLoggerRC/pRCRelLoggerR3).
254 * This may differ from cbRCLogger. */
255 uint32_t cbRCRelLogger;
256 /** @} */
257
258 /** The EMT yield timer. */
259 PTMTIMERR3 pYieldTimer;
260 /** The period to the next timeout when suspended or stopped.
261 * This is 0 when running. */
262 uint32_t cYieldResumeMillies;
263 /** The EMT yield timer interval (milliseconds). */
264 uint32_t cYieldEveryMillies;
265 /** The timestamp of the previous yield. (nano) */
266 uint64_t u64LastYield;
267
268 /** Critical section.
269 * Use for synchronizing all VCPUs
270 */
271 RTCRITSECT CritSectSync;
272
273 /** @name EMT Rendezvous
274 * @{ */
275 /** Semaphore to wait on upon entering for one-by-one execution. */
276 RTSEMEVENT hEvtRendezvousEnterOneByOne;
277 /** Semaphore to wait on upon entering for all-at-once execution. */
278 RTSEMEVENTMULTI hEvtMulRendezvousEnterAllAtOnce;
279 /** Semaphore to wait on when done. */
280 RTSEMEVENTMULTI hEvtMulRendezvousDone;
281 /** Semaphore the VMMR3EmtRendezvous caller waits on at the end. */
282 RTSEMEVENT hEvtRendezvousDoneCaller;
283 /** Callback. */
284 R3PTRTYPE(PFNVMMEMTRENDEZVOUS) volatile pfnRendezvous;
285 /** The user argument for the callback. */
286 RTR3PTR volatile pvRendezvousUser;
287 /** Flags. */
288 volatile uint32_t fRendezvousFlags;
289 /** The number of EMTs that has entered. */
290 volatile uint32_t cRendezvousEmtsEntered;
291 /** The number of EMTs that has done their job. */
292 volatile uint32_t cRendezvousEmtsDone;
293 /** The number of EMTs that has returned. */
294 volatile uint32_t cRendezvousEmtsReturned;
295 /** The status code. */
296 volatile int32_t i32RendezvousStatus;
297 /** Spin lock. */
298 volatile uint32_t u32RendezvousLock;
299 /** @} */
300
301 /** Buffer for storing the standard assertion message for a ring-0 assertion.
302 * Used for saving the assertion message text for the release log and guru
303 * meditation dump. */
304 char szRing0AssertMsg1[512];
305 /** Buffer for storing the custom message for a ring-0 assertion. */
306 char szRing0AssertMsg2[256];
307
308 /** Number of VMMR0_DO_RUN_GC calls. */
309 STAMCOUNTER StatRunRC;
310
311 /** Statistics for each of the RC/R0 return codes.
312 * @{ */
313 STAMCOUNTER StatRZRetNormal;
314 STAMCOUNTER StatRZRetInterrupt;
315 STAMCOUNTER StatRZRetInterruptHyper;
316 STAMCOUNTER StatRZRetGuestTrap;
317 STAMCOUNTER StatRZRetRingSwitch;
318 STAMCOUNTER StatRZRetRingSwitchInt;
319 STAMCOUNTER StatRZRetExceptionPrivilege;
320 STAMCOUNTER StatRZRetStaleSelector;
321 STAMCOUNTER StatRZRetIRETTrap;
322 STAMCOUNTER StatRZRetEmulate;
323 STAMCOUNTER StatRZRetIOBlockEmulate;
324 STAMCOUNTER StatRZRetPatchEmulate;
325 STAMCOUNTER StatRZRetIORead;
326 STAMCOUNTER StatRZRetIOWrite;
327 STAMCOUNTER StatRZRetMMIORead;
328 STAMCOUNTER StatRZRetMMIOWrite;
329 STAMCOUNTER StatRZRetMMIOPatchRead;
330 STAMCOUNTER StatRZRetMMIOPatchWrite;
331 STAMCOUNTER StatRZRetMMIOReadWrite;
332 STAMCOUNTER StatRZRetLDTFault;
333 STAMCOUNTER StatRZRetGDTFault;
334 STAMCOUNTER StatRZRetIDTFault;
335 STAMCOUNTER StatRZRetTSSFault;
336 STAMCOUNTER StatRZRetPDFault;
337 STAMCOUNTER StatRZRetCSAMTask;
338 STAMCOUNTER StatRZRetSyncCR3;
339 STAMCOUNTER StatRZRetMisc;
340 STAMCOUNTER StatRZRetPatchInt3;
341 STAMCOUNTER StatRZRetPatchPF;
342 STAMCOUNTER StatRZRetPatchGP;
343 STAMCOUNTER StatRZRetPatchIretIRQ;
344 STAMCOUNTER StatRZRetRescheduleREM;
345 STAMCOUNTER StatRZRetToR3;
346 STAMCOUNTER StatRZRetTimerPending;
347 STAMCOUNTER StatRZRetInterruptPending;
348 STAMCOUNTER StatRZRetCallHost;
349 STAMCOUNTER StatRZRetPATMDuplicateFn;
350 STAMCOUNTER StatRZRetPGMChangeMode;
351 STAMCOUNTER StatRZRetEmulHlt;
352 STAMCOUNTER StatRZRetPendingRequest;
353 STAMCOUNTER StatRZCallPDMLock;
354 STAMCOUNTER StatRZCallLogFlush;
355 STAMCOUNTER StatRZCallPDMQueueFlush;
356 STAMCOUNTER StatRZCallPGMPoolGrow;
357 STAMCOUNTER StatRZCallPGMMapChunk;
358 STAMCOUNTER StatRZCallPGMAllocHandy;
359 STAMCOUNTER StatRZCallRemReplay;
360 STAMCOUNTER StatRZCallVMSetError;
361 STAMCOUNTER StatRZCallVMSetRuntimeError;
362 STAMCOUNTER StatRZCallPGMLock;
363 /** @} */
364} VMM;
365/** Pointer to VMM. */
366typedef VMM *PVMM;
367
368
369/**
370 * VMMCPU Data (part of VMCPU)
371 */
372typedef struct VMMCPU
373{
374 /** Offset to the VMCPU structure.
375 * See VMM2VMCPU(). */
376 RTINT offVMCPU;
377
378 /** The last RC/R0 return code. */
379 int32_t iLastGZRc;
380
381 /** VMM stack, pointer to the top of the stack in R3.
382 * Stack is allocated from the hypervisor heap and is page aligned
383 * and always writable in RC. */
384 R3PTRTYPE(uint8_t *) pbEMTStackR3;
385 /** Pointer to the bottom of the stack - needed for doing relocations. */
386 RCPTRTYPE(uint8_t *) pbEMTStackRC;
387 /** Pointer to the bottom of the stack - needed for doing relocations. */
388 RCPTRTYPE(uint8_t *) pbEMTStackBottomRC;
389
390#ifdef LOG_ENABLED
391 /** Pointer to the R0 logger instance - R3 Ptr.
392 * This is NULL if logging is disabled. */
393 R3PTRTYPE(PVMMR0LOGGER) pR0LoggerR3;
394 /** Pointer to the R0 logger instance - R0 Ptr.
395 * This is NULL if logging is disabled. */
396 R0PTRTYPE(PVMMR0LOGGER) pR0LoggerR0;
397#endif
398
399 /** @name CallHost
400 * @{ */
401 /** The pending operation. */
402 VMMCALLHOST enmCallHostOperation;
403 /** The result of the last operation. */
404 int32_t rcCallHost;
405#if HC_ARCH_BITS == 32
406 uint32_t padding;
407#endif
408 /** The argument to the operation. */
409 uint64_t u64CallHostArg;
410 /** The Ring-0 jmp buffer. */
411 VMMR0JMPBUF CallHostR0JmpBuf;
412 /** @} */
413
414} VMMCPU;
415/** Pointer to VMMCPU. */
416typedef VMMCPU *PVMMCPU;
417
418
419/**
420 * The VMMGCEntry() codes.
421 */
422typedef enum VMMGCOPERATION
423{
424 /** Do GC module init. */
425 VMMGC_DO_VMMGC_INIT = 1,
426
427 /** The first Trap testcase. */
428 VMMGC_DO_TESTCASE_TRAP_FIRST = 0x0dead000,
429 /** Trap 0 testcases, uArg selects the variation. */
430 VMMGC_DO_TESTCASE_TRAP_0 = VMMGC_DO_TESTCASE_TRAP_FIRST,
431 /** Trap 1 testcases, uArg selects the variation. */
432 VMMGC_DO_TESTCASE_TRAP_1,
433 /** Trap 2 testcases, uArg selects the variation. */
434 VMMGC_DO_TESTCASE_TRAP_2,
435 /** Trap 3 testcases, uArg selects the variation. */
436 VMMGC_DO_TESTCASE_TRAP_3,
437 /** Trap 4 testcases, uArg selects the variation. */
438 VMMGC_DO_TESTCASE_TRAP_4,
439 /** Trap 5 testcases, uArg selects the variation. */
440 VMMGC_DO_TESTCASE_TRAP_5,
441 /** Trap 6 testcases, uArg selects the variation. */
442 VMMGC_DO_TESTCASE_TRAP_6,
443 /** Trap 7 testcases, uArg selects the variation. */
444 VMMGC_DO_TESTCASE_TRAP_7,
445 /** Trap 8 testcases, uArg selects the variation. */
446 VMMGC_DO_TESTCASE_TRAP_8,
447 /** Trap 9 testcases, uArg selects the variation. */
448 VMMGC_DO_TESTCASE_TRAP_9,
449 /** Trap 0a testcases, uArg selects the variation. */
450 VMMGC_DO_TESTCASE_TRAP_0A,
451 /** Trap 0b testcases, uArg selects the variation. */
452 VMMGC_DO_TESTCASE_TRAP_0B,
453 /** Trap 0c testcases, uArg selects the variation. */
454 VMMGC_DO_TESTCASE_TRAP_0C,
455 /** Trap 0d testcases, uArg selects the variation. */
456 VMMGC_DO_TESTCASE_TRAP_0D,
457 /** Trap 0e testcases, uArg selects the variation. */
458 VMMGC_DO_TESTCASE_TRAP_0E,
459 /** The last trap testcase (exclusive). */
460 VMMGC_DO_TESTCASE_TRAP_LAST,
461 /** Testcase for checking interrupt forwarding. */
462 VMMGC_DO_TESTCASE_HYPER_INTERRUPT,
463 /** Switching testing and profiling stub. */
464 VMMGC_DO_TESTCASE_NOP,
465 /** Testcase for checking interrupt masking.. */
466 VMMGC_DO_TESTCASE_INTERRUPT_MASKING,
467 /** Switching testing and profiling stub. */
468 VMMGC_DO_TESTCASE_HWACCM_NOP,
469
470 /** The usual 32-bit hack. */
471 VMMGC_DO_32_BIT_HACK = 0x7fffffff
472} VMMGCOPERATION;
473
474
475RT_C_DECLS_BEGIN
476
477#ifdef IN_RING3
478int vmmR3SwitcherInit(PVM pVM);
479void vmmR3SwitcherRelocate(PVM pVM, RTGCINTPTR offDelta);
480#endif /* IN_RING3 */
481
482#ifdef IN_RING0
483/**
484 * World switcher assembly routine.
485 * It will call VMMGCEntry().
486 *
487 * @returns return code from VMMGCEntry().
488 * @param pVM The VM in question.
489 * @param uArg See VMMGCEntry().
490 * @internal
491 */
492DECLASM(int) vmmR0WorldSwitch(PVM pVM, unsigned uArg);
493
494/**
495 * Callback function for vmmR0CallHostSetJmp.
496 *
497 * @returns VBox status code.
498 * @param pVM The VM handle.
499 */
500typedef DECLCALLBACK(int) FNVMMR0SETJMP(PVM pVM, PVMCPU pVCpu);
501/** Pointer to FNVMMR0SETJMP(). */
502typedef FNVMMR0SETJMP *PFNVMMR0SETJMP;
503
504/**
505 * The setjmp variant used for calling Ring-3.
506 *
507 * This differs from the normal setjmp in that it will resume VMMR0CallHost if we're
508 * in the middle of a ring-3 call. Another differences is the function pointer and
509 * argument. This has to do with resuming code and the stack frame of the caller.
510 *
511 * @returns VINF_SUCCESS on success or whatever is passed to vmmR0CallHostLongJmp.
512 * @param pJmpBuf The jmp_buf to set.
513 * @param pfn The function to be called when not resuming..
514 * @param pVM The argument of that function.
515 */
516DECLASM(int) vmmR0CallHostSetJmp(PVMMR0JMPBUF pJmpBuf, PFNVMMR0SETJMP pfn, PVM pVM, PVMCPU pVCpu);
517
518/**
519 * Callback function for vmmR0CallHostSetJmpEx.
520 *
521 * @returns VBox status code.
522 * @param pvUser The user argument.
523 */
524typedef DECLCALLBACK(int) FNVMMR0SETJMPEX(void *pvUser);
525/** Pointer to FNVMMR0SETJMP(). */
526typedef FNVMMR0SETJMPEX *PFNVMMR0SETJMPEX;
527
528/**
529 * Same as vmmR0CallHostSetJmp except for the function signature.
530 *
531 * @returns VINF_SUCCESS on success or whatever is passed to vmmR0CallHostLongJmp.
532 * @param pJmpBuf The jmp_buf to set.
533 * @param pfn The function to be called when not resuming..
534 * @param pvUser The argument of that function.
535 */
536DECLASM(int) vmmR0CallHostSetJmpEx(PVMMR0JMPBUF pJmpBuf, PFNVMMR0SETJMPEX pfn, void *pvUser);
537
538
539/**
540 * Worker for VMMR0CallHost.
541 * This will save the stack and registers.
542 *
543 * @returns rc.
544 * @param pJmpBuf Pointer to the jump buffer.
545 * @param rc The return code.
546 */
547DECLASM(int) vmmR0CallHostLongJmp(PVMMR0JMPBUF pJmpBuf, int rc);
548
549/**
550 * Internal R0 logger worker: Logger wrapper.
551 */
552VMMR0DECL(void) vmmR0LoggerWrapper(const char *pszFormat, ...);
553
554/**
555 * Internal R0 logger worker: Flush logger.
556 *
557 * @param pLogger The logger instance to flush.
558 * @remark This function must be exported!
559 */
560VMMR0DECL(void) vmmR0LoggerFlush(PRTLOGGER pLogger);
561
562/**
563 * Interal R0 logger worker: Custom prefix.
564 *
565 * @returns Number of chars written.
566 *
567 * @param pLogger The logger instance.
568 * @param pchBuf The output buffer.
569 * @param cchBuf The size of the buffer.
570 * @param pvUser User argument (ignored).
571 */
572VMMR0DECL(size_t) vmmR0LoggerPrefix(PRTLOGGER pLogger, char *pchBuf, size_t cchBuf, void *pvUser);
573
574#endif /* IN_RING0 */
575#ifdef IN_RC
576
577/**
578 * Internal GC logger worker: Logger wrapper.
579 */
580VMMRCDECL(void) vmmGCLoggerWrapper(const char *pszFormat, ...);
581
582/**
583 * Internal GC release logger worker: Logger wrapper.
584 */
585VMMRCDECL(void) vmmGCRelLoggerWrapper(const char *pszFormat, ...);
586
587/**
588 * Internal GC logger worker: Flush logger.
589 *
590 * @returns VINF_SUCCESS.
591 * @param pLogger The logger instance to flush.
592 * @remark This function must be exported!
593 */
594VMMRCDECL(int) vmmGCLoggerFlush(PRTLOGGERRC pLogger);
595
596/** @name Trap testcases and related labels.
597 * @{ */
598DECLASM(void) vmmGCEnableWP(void);
599DECLASM(void) vmmGCDisableWP(void);
600DECLASM(int) vmmGCTestTrap3(void);
601DECLASM(int) vmmGCTestTrap8(void);
602DECLASM(int) vmmGCTestTrap0d(void);
603DECLASM(int) vmmGCTestTrap0e(void);
604DECLASM(int) vmmGCTestTrap0e_FaultEIP(void); /**< a label */
605DECLASM(int) vmmGCTestTrap0e_ResumeEIP(void); /**< a label */
606/** @} */
607
608#endif /* IN_RC */
609
610RT_C_DECLS_END
611
612/** @} */
613
614#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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