VirtualBox

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

Last change on this file since 20889 was 20875, checked in by vboxsync, 16 years ago

VMM: Renamed almost all references to CallHost to CallRing3.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 21.5 KB
Line 
1/* $Id: VMMInternal.h 20875 2009-06-24 02:29:17Z 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.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * 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 /** Whether log flushing has been disabled or not. */
257 bool fRCLoggerFlushingDisabled;
258 bool afAlignment[7]; /**< Alignment padding. */
259 /** @} */
260
261 /** The EMT yield timer. */
262 PTMTIMERR3 pYieldTimer;
263 /** The period to the next timeout when suspended or stopped.
264 * This is 0 when running. */
265 uint32_t cYieldResumeMillies;
266 /** The EMT yield timer interval (milliseconds). */
267 uint32_t cYieldEveryMillies;
268 /** The timestamp of the previous yield. (nano) */
269 uint64_t u64LastYield;
270
271 /** Critical section.
272 * Use for synchronizing all VCPUs
273 */
274 RTCRITSECT CritSectSync;
275
276 /** @name EMT Rendezvous
277 * @{ */
278 /** Semaphore to wait on upon entering for one-by-one execution. */
279 RTSEMEVENT hEvtRendezvousEnterOneByOne;
280 /** Semaphore to wait on upon entering for all-at-once execution. */
281 RTSEMEVENTMULTI hEvtMulRendezvousEnterAllAtOnce;
282 /** Semaphore to wait on when done. */
283 RTSEMEVENTMULTI hEvtMulRendezvousDone;
284 /** Semaphore the VMMR3EmtRendezvous caller waits on at the end. */
285 RTSEMEVENT hEvtRendezvousDoneCaller;
286 /** Callback. */
287 R3PTRTYPE(PFNVMMEMTRENDEZVOUS) volatile pfnRendezvous;
288 /** The user argument for the callback. */
289 RTR3PTR volatile pvRendezvousUser;
290 /** Flags. */
291 volatile uint32_t fRendezvousFlags;
292 /** The number of EMTs that has entered. */
293 volatile uint32_t cRendezvousEmtsEntered;
294 /** The number of EMTs that has done their job. */
295 volatile uint32_t cRendezvousEmtsDone;
296 /** The number of EMTs that has returned. */
297 volatile uint32_t cRendezvousEmtsReturned;
298 /** The status code. */
299 volatile int32_t i32RendezvousStatus;
300 /** Spin lock. */
301 volatile uint32_t u32RendezvousLock;
302 /** @} */
303
304 /** Buffer for storing the standard assertion message for a ring-0 assertion.
305 * Used for saving the assertion message text for the release log and guru
306 * meditation dump. */
307 char szRing0AssertMsg1[512];
308 /** Buffer for storing the custom message for a ring-0 assertion. */
309 char szRing0AssertMsg2[256];
310
311 /** Number of VMMR0_DO_RUN_GC calls. */
312 STAMCOUNTER StatRunRC;
313
314 /** Statistics for each of the RC/R0 return codes.
315 * @{ */
316 STAMCOUNTER StatRZRetNormal;
317 STAMCOUNTER StatRZRetInterrupt;
318 STAMCOUNTER StatRZRetInterruptHyper;
319 STAMCOUNTER StatRZRetGuestTrap;
320 STAMCOUNTER StatRZRetRingSwitch;
321 STAMCOUNTER StatRZRetRingSwitchInt;
322 STAMCOUNTER StatRZRetExceptionPrivilege;
323 STAMCOUNTER StatRZRetStaleSelector;
324 STAMCOUNTER StatRZRetIRETTrap;
325 STAMCOUNTER StatRZRetEmulate;
326 STAMCOUNTER StatRZRetIOBlockEmulate;
327 STAMCOUNTER StatRZRetPatchEmulate;
328 STAMCOUNTER StatRZRetIORead;
329 STAMCOUNTER StatRZRetIOWrite;
330 STAMCOUNTER StatRZRetMMIORead;
331 STAMCOUNTER StatRZRetMMIOWrite;
332 STAMCOUNTER StatRZRetMMIOPatchRead;
333 STAMCOUNTER StatRZRetMMIOPatchWrite;
334 STAMCOUNTER StatRZRetMMIOReadWrite;
335 STAMCOUNTER StatRZRetLDTFault;
336 STAMCOUNTER StatRZRetGDTFault;
337 STAMCOUNTER StatRZRetIDTFault;
338 STAMCOUNTER StatRZRetTSSFault;
339 STAMCOUNTER StatRZRetPDFault;
340 STAMCOUNTER StatRZRetCSAMTask;
341 STAMCOUNTER StatRZRetSyncCR3;
342 STAMCOUNTER StatRZRetMisc;
343 STAMCOUNTER StatRZRetPatchInt3;
344 STAMCOUNTER StatRZRetPatchPF;
345 STAMCOUNTER StatRZRetPatchGP;
346 STAMCOUNTER StatRZRetPatchIretIRQ;
347 STAMCOUNTER StatRZRetRescheduleREM;
348 STAMCOUNTER StatRZRetToR3;
349 STAMCOUNTER StatRZRetTimerPending;
350 STAMCOUNTER StatRZRetInterruptPending;
351 STAMCOUNTER StatRZRetCallRing3;
352 STAMCOUNTER StatRZRetPATMDuplicateFn;
353 STAMCOUNTER StatRZRetPGMChangeMode;
354 STAMCOUNTER StatRZRetEmulHlt;
355 STAMCOUNTER StatRZRetPendingRequest;
356 STAMCOUNTER StatRZCallPDMLock;
357 STAMCOUNTER StatRZCallLogFlush;
358 STAMCOUNTER StatRZCallPDMQueueFlush;
359 STAMCOUNTER StatRZCallPGMPoolGrow;
360 STAMCOUNTER StatRZCallPGMMapChunk;
361 STAMCOUNTER StatRZCallPGMAllocHandy;
362 STAMCOUNTER StatRZCallRemReplay;
363 STAMCOUNTER StatRZCallVMSetError;
364 STAMCOUNTER StatRZCallVMSetRuntimeError;
365 STAMCOUNTER StatRZCallPGMLock;
366 /** @} */
367} VMM;
368/** Pointer to VMM. */
369typedef VMM *PVMM;
370
371
372/**
373 * VMMCPU Data (part of VMCPU)
374 */
375typedef struct VMMCPU
376{
377 /** Offset to the VMCPU structure.
378 * See VMM2VMCPU(). */
379 RTINT offVMCPU;
380
381 /** The last RC/R0 return code. */
382 int32_t iLastGZRc;
383
384 /** VMM stack, pointer to the top of the stack in R3.
385 * Stack is allocated from the hypervisor heap and is page aligned
386 * and always writable in RC. */
387 R3PTRTYPE(uint8_t *) pbEMTStackR3;
388 /** Pointer to the bottom of the stack - needed for doing relocations. */
389 RCPTRTYPE(uint8_t *) pbEMTStackRC;
390 /** Pointer to the bottom of the stack - needed for doing relocations. */
391 RCPTRTYPE(uint8_t *) pbEMTStackBottomRC;
392
393#ifdef LOG_ENABLED
394 /** Pointer to the R0 logger instance - R3 Ptr.
395 * This is NULL if logging is disabled. */
396 R3PTRTYPE(PVMMR0LOGGER) pR0LoggerR3;
397 /** Pointer to the R0 logger instance - R0 Ptr.
398 * This is NULL if logging is disabled. */
399 R0PTRTYPE(PVMMR0LOGGER) pR0LoggerR0;
400#endif
401
402 /** @name Call Ring-3
403 * Formerly known as host calls.
404 * @{ */
405 /** The disable counter. */
406 uint32_t cCallRing3Disabled;
407 /** The pending operation. */
408 VMMCALLRING3 enmCallRing3Operation;
409 /** The result of the last operation. */
410 int32_t rcCallRing3;
411#if HC_ARCH_BITS == 64
412 uint32_t padding;
413#endif
414 /** The argument to the operation. */
415 uint64_t u64CallRing3Arg;
416 /** The Ring-0 jmp buffer. */
417 VMMR0JMPBUF CallRing3JmpBufR0;
418 /** @} */
419
420} VMMCPU;
421/** Pointer to VMMCPU. */
422typedef VMMCPU *PVMMCPU;
423
424
425/**
426 * The VMMGCEntry() codes.
427 */
428typedef enum VMMGCOPERATION
429{
430 /** Do GC module init. */
431 VMMGC_DO_VMMGC_INIT = 1,
432
433 /** The first Trap testcase. */
434 VMMGC_DO_TESTCASE_TRAP_FIRST = 0x0dead000,
435 /** Trap 0 testcases, uArg selects the variation. */
436 VMMGC_DO_TESTCASE_TRAP_0 = VMMGC_DO_TESTCASE_TRAP_FIRST,
437 /** Trap 1 testcases, uArg selects the variation. */
438 VMMGC_DO_TESTCASE_TRAP_1,
439 /** Trap 2 testcases, uArg selects the variation. */
440 VMMGC_DO_TESTCASE_TRAP_2,
441 /** Trap 3 testcases, uArg selects the variation. */
442 VMMGC_DO_TESTCASE_TRAP_3,
443 /** Trap 4 testcases, uArg selects the variation. */
444 VMMGC_DO_TESTCASE_TRAP_4,
445 /** Trap 5 testcases, uArg selects the variation. */
446 VMMGC_DO_TESTCASE_TRAP_5,
447 /** Trap 6 testcases, uArg selects the variation. */
448 VMMGC_DO_TESTCASE_TRAP_6,
449 /** Trap 7 testcases, uArg selects the variation. */
450 VMMGC_DO_TESTCASE_TRAP_7,
451 /** Trap 8 testcases, uArg selects the variation. */
452 VMMGC_DO_TESTCASE_TRAP_8,
453 /** Trap 9 testcases, uArg selects the variation. */
454 VMMGC_DO_TESTCASE_TRAP_9,
455 /** Trap 0a testcases, uArg selects the variation. */
456 VMMGC_DO_TESTCASE_TRAP_0A,
457 /** Trap 0b testcases, uArg selects the variation. */
458 VMMGC_DO_TESTCASE_TRAP_0B,
459 /** Trap 0c testcases, uArg selects the variation. */
460 VMMGC_DO_TESTCASE_TRAP_0C,
461 /** Trap 0d testcases, uArg selects the variation. */
462 VMMGC_DO_TESTCASE_TRAP_0D,
463 /** Trap 0e testcases, uArg selects the variation. */
464 VMMGC_DO_TESTCASE_TRAP_0E,
465 /** The last trap testcase (exclusive). */
466 VMMGC_DO_TESTCASE_TRAP_LAST,
467 /** Testcase for checking interrupt forwarding. */
468 VMMGC_DO_TESTCASE_HYPER_INTERRUPT,
469 /** Switching testing and profiling stub. */
470 VMMGC_DO_TESTCASE_NOP,
471 /** Testcase for checking interrupt masking.. */
472 VMMGC_DO_TESTCASE_INTERRUPT_MASKING,
473 /** Switching testing and profiling stub. */
474 VMMGC_DO_TESTCASE_HWACCM_NOP,
475
476 /** The usual 32-bit hack. */
477 VMMGC_DO_32_BIT_HACK = 0x7fffffff
478} VMMGCOPERATION;
479
480
481RT_C_DECLS_BEGIN
482
483#ifdef IN_RING3
484int vmmR3SwitcherInit(PVM pVM);
485void vmmR3SwitcherRelocate(PVM pVM, RTGCINTPTR offDelta);
486#endif /* IN_RING3 */
487
488#ifdef IN_RING0
489/**
490 * World switcher assembly routine.
491 * It will call VMMGCEntry().
492 *
493 * @returns return code from VMMGCEntry().
494 * @param pVM The VM in question.
495 * @param uArg See VMMGCEntry().
496 * @internal
497 */
498DECLASM(int) vmmR0WorldSwitch(PVM pVM, unsigned uArg);
499
500/**
501 * Callback function for vmmR0CallRing3SetJmp.
502 *
503 * @returns VBox status code.
504 * @param pVM The VM handle.
505 */
506typedef DECLCALLBACK(int) FNVMMR0SETJMP(PVM pVM, PVMCPU pVCpu);
507/** Pointer to FNVMMR0SETJMP(). */
508typedef FNVMMR0SETJMP *PFNVMMR0SETJMP;
509
510/**
511 * The setjmp variant used for calling Ring-3.
512 *
513 * This differs from the normal setjmp in that it will resume VMMRZCallRing3 if we're
514 * in the middle of a ring-3 call. Another differences is the function pointer and
515 * argument. This has to do with resuming code and the stack frame of the caller.
516 *
517 * @returns VINF_SUCCESS on success or whatever is passed to vmmR0CallRing3LongJmp.
518 * @param pJmpBuf The jmp_buf to set.
519 * @param pfn The function to be called when not resuming..
520 * @param pVM The argument of that function.
521 */
522DECLASM(int) vmmR0CallRing3SetJmp(PVMMR0JMPBUF pJmpBuf, PFNVMMR0SETJMP pfn, PVM pVM, PVMCPU pVCpu);
523
524/**
525 * Callback function for vmmR0CallRing3SetJmpEx.
526 *
527 * @returns VBox status code.
528 * @param pvUser The user argument.
529 */
530typedef DECLCALLBACK(int) FNVMMR0SETJMPEX(void *pvUser);
531/** Pointer to FNVMMR0SETJMP(). */
532typedef FNVMMR0SETJMPEX *PFNVMMR0SETJMPEX;
533
534/**
535 * Same as vmmR0CallRing3SetJmp except for the function signature.
536 *
537 * @returns VINF_SUCCESS on success or whatever is passed to vmmR0CallRing3LongJmp.
538 * @param pJmpBuf The jmp_buf to set.
539 * @param pfn The function to be called when not resuming..
540 * @param pvUser The argument of that function.
541 */
542DECLASM(int) vmmR0CallRing3SetJmpEx(PVMMR0JMPBUF pJmpBuf, PFNVMMR0SETJMPEX pfn, void *pvUser);
543
544
545/**
546 * Worker for VMMRZCallRing3.
547 * This will save the stack and registers.
548 *
549 * @returns rc.
550 * @param pJmpBuf Pointer to the jump buffer.
551 * @param rc The return code.
552 */
553DECLASM(int) vmmR0CallRing3LongJmp(PVMMR0JMPBUF pJmpBuf, int rc);
554
555/**
556 * Internal R0 logger worker: Logger wrapper.
557 */
558VMMR0DECL(void) vmmR0LoggerWrapper(const char *pszFormat, ...);
559
560/**
561 * Internal R0 logger worker: Flush logger.
562 *
563 * @param pLogger The logger instance to flush.
564 * @remark This function must be exported!
565 */
566VMMR0DECL(void) vmmR0LoggerFlush(PRTLOGGER pLogger);
567
568/**
569 * Interal R0 logger worker: Custom prefix.
570 *
571 * @returns Number of chars written.
572 *
573 * @param pLogger The logger instance.
574 * @param pchBuf The output buffer.
575 * @param cchBuf The size of the buffer.
576 * @param pvUser User argument (ignored).
577 */
578VMMR0DECL(size_t) vmmR0LoggerPrefix(PRTLOGGER pLogger, char *pchBuf, size_t cchBuf, void *pvUser);
579
580#endif /* IN_RING0 */
581#ifdef IN_RC
582
583/**
584 * Internal GC logger worker: Logger wrapper.
585 */
586VMMRCDECL(void) vmmGCLoggerWrapper(const char *pszFormat, ...);
587
588/**
589 * Internal GC release logger worker: Logger wrapper.
590 */
591VMMRCDECL(void) vmmGCRelLoggerWrapper(const char *pszFormat, ...);
592
593/**
594 * Internal GC logger worker: Flush logger.
595 *
596 * @returns VINF_SUCCESS.
597 * @param pLogger The logger instance to flush.
598 * @remark This function must be exported!
599 */
600VMMRCDECL(int) vmmGCLoggerFlush(PRTLOGGERRC pLogger);
601
602/** @name Trap testcases and related labels.
603 * @{ */
604DECLASM(void) vmmGCEnableWP(void);
605DECLASM(void) vmmGCDisableWP(void);
606DECLASM(int) vmmGCTestTrap3(void);
607DECLASM(int) vmmGCTestTrap8(void);
608DECLASM(int) vmmGCTestTrap0d(void);
609DECLASM(int) vmmGCTestTrap0e(void);
610DECLASM(int) vmmGCTestTrap0e_FaultEIP(void); /**< a label */
611DECLASM(int) vmmGCTestTrap0e_ResumeEIP(void); /**< a label */
612/** @} */
613
614#endif /* IN_RC */
615
616RT_C_DECLS_END
617
618/** @} */
619
620#endif
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