VirtualBox

source: vbox/trunk/include/VBox/types.h@ 93922

Last change on this file since 93922 was 93609, checked in by vboxsync, 3 years ago

VMM/PDMQueue: Rewrote the queue code to not use the hyper heap and be a bit safer. Added a testcase (driverless). bugref:10093

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 39.9 KB
Line 
1/** @file
2 * VirtualBox - Types.
3 */
4
5/*
6 * Copyright (C) 2006-2022 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef VBOX_INCLUDED_types_h
27#define VBOX_INCLUDED_types_h
28#ifndef RT_WITHOUT_PRAGMA_ONCE
29# pragma once
30#endif
31
32#include <VBox/cdefs.h>
33#include <iprt/types.h>
34
35
36/** @defgroup grp_types VBox Basic Types
37 * @{
38 */
39
40
41/** @defgroup grp_types_both Common Guest and Host Context Basic Types
42 * @{
43 */
44
45
46/** @defgroup grp_types_hc Host Context Basic Types
47 * @{
48 */
49
50/** @} */
51
52
53/** @defgroup grp_types_gc Guest Context Basic Types
54 * @{
55 */
56
57/** @} */
58
59
60/** Pointer to per support driver session data.
61 * (The data is a R0 entity and private to the the R0 SUP part. All
62 * other should consider this a sort of handle.) */
63typedef R0PTRTYPE(struct SUPDRVSESSION *) PSUPDRVSESSION;
64
65/** Event semaphore handle. Ring-0 / ring-3. */
66typedef R0PTRTYPE(struct SUPSEMEVENTHANDLE *) SUPSEMEVENT;
67/** Pointer to an event semaphore handle. */
68typedef SUPSEMEVENT *PSUPSEMEVENT;
69/** Nil event semaphore handle. */
70#define NIL_SUPSEMEVENT ((SUPSEMEVENT)0)
71
72/** Multiple release event semaphore handle. Ring-0 / ring-3. */
73typedef R0PTRTYPE(struct SUPSEMEVENTMULTIHANDLE *) SUPSEMEVENTMULTI;
74/** Pointer to an multiple release event semaphore handle. */
75typedef SUPSEMEVENTMULTI *PSUPSEMEVENTMULTI;
76/** Nil multiple release event semaphore handle. */
77#define NIL_SUPSEMEVENTMULTI ((SUPSEMEVENTMULTI)0)
78
79
80/** Pointer to a ring-3 VMM API vtable. */
81typedef R3PTRTYPE(const struct VMMR3VTABLE *) PCVMMR3VTABLE;
82
83/** Pointer to a VM. */
84typedef struct VM *PVM;
85/** Pointer to a const VM. */
86typedef const struct VM *PCVM;
87/** Pointer to a VM - Ring-0 Ptr. */
88typedef R0PTRTYPE(struct VM *) PVMR0;
89/** Pointer to a VM - Ring-3 Ptr. */
90typedef R3PTRTYPE(struct VM *) PVMR3;
91/** Pointer to a VM - RC Ptr. */
92typedef RCPTRTYPE(struct VM *) PVMRC;
93
94/** Pointer to a virtual CPU structure. */
95typedef struct VMCPU * PVMCPU;
96/** Pointer to a const virtual CPU structure. */
97typedef const struct VMCPU * PCVMCPU;
98/** Pointer to a virtual CPU structure - Ring-3 Ptr. */
99typedef R3PTRTYPE(struct VMCPU *) PVMCPUR3;
100/** Pointer to a virtual CPU structure - Ring-0 Ptr. */
101typedef R0PTRTYPE(struct VMCPU *) PVMCPUR0;
102/** Pointer to a virtual CPU structure - RC Ptr. */
103typedef RCPTRTYPE(struct VMCPU *) PVMCPURC;
104
105/** Pointer to a ring-0 (global) VM structure. */
106typedef R0PTRTYPE(struct GVM *) PGVM;
107/** Pointer to a const ring-0 (global) VM structure. */
108typedef R0PTRTYPE(const struct GVM *) PCGVM;
109/** Pointer to a GVMCPU structure. */
110typedef R0PTRTYPE(struct GVMCPU *) PGVMCPU;
111/** Pointer to a const GVMCPU structure. */
112typedef R0PTRTYPE(struct GVMCPU const *) PCGVMCPU;
113
114/** Pointer to a ring-3 (user mode) VM structure. */
115typedef R3PTRTYPE(struct UVM *) PUVM;
116
117/** Pointer to a ring-3 (user mode) VMCPU structure. */
118typedef R3PTRTYPE(struct UVMCPU *) PUVMCPU;
119
120/** Pointer to a context specific VM derived structure.
121 * This is PGVM in ring-0 and plain PVM in ring-3. */
122#ifdef IN_RING0
123typedef PGVM PVMCC;
124#else
125typedef PVM PVMCC;
126#endif
127/** Pointer to a const context specific VM derived structure.
128 * This is PCGVM in ring-0 and plain PCVM in ring-3. */
129#ifdef IN_RING0
130typedef PCGVM PCVMCC;
131#else
132typedef PCVM PCVMCC;
133#endif
134/** Pointer to a context specific VMCPUM derived structure.
135 * This is PGVMCPU in ring-0 and plain PVMCPU in ring-3. */
136#ifdef IN_RING0
137typedef PGVMCPU PVMCPUCC;
138#else
139typedef PVMCPU PVMCPUCC;
140#endif
141/** Pointer to a const context specific VMCPU derived structure.
142 * This is PCGVMCPU in ring-0 and plain PCVMCPU in ring-3. */
143#ifdef IN_RING0
144typedef PCGVMCPU PCVMCPUCC;
145#else
146typedef PCVMCPU PCVMCPUCC;
147#endif
148
149/** Virtual CPU ID. */
150typedef uint32_t VMCPUID;
151/** Pointer to a virtual CPU ID. */
152typedef VMCPUID *PVMCPUID;
153/** @name Special CPU ID values.
154 * Most of these are for request scheduling.
155 *
156 * @{ */
157/** All virtual CPUs. */
158#define VMCPUID_ALL UINT32_C(0xfffffff2)
159/** All virtual CPUs, descending order. */
160#define VMCPUID_ALL_REVERSE UINT32_C(0xfffffff3)
161/** Any virtual CPU.
162 * Intended for scheduling a VM request or some other task. */
163#define VMCPUID_ANY UINT32_C(0xfffffff4)
164/** Any virtual CPU; always queue for future execution.
165 * Intended for scheduling a VM request or some other task. */
166#define VMCPUID_ANY_QUEUE UINT32_C(0xfffffff5)
167/** The NIL value. */
168#define NIL_VMCPUID UINT32_C(0xfffffffd)
169/** @} */
170
171/**
172 * Virtual CPU set.
173 */
174typedef struct VMCPUSET
175{
176 /** The bitmap data. */
177 uint32_t au32Bitmap[8 /*256/32*/];
178} VMCPUSET;
179/** Pointer to a Virtual CPU set. */
180typedef VMCPUSET *PVMCPUSET;
181/** Pointer to a const Virtual CPU set. */
182typedef VMCPUSET const *PCVMCPUSET;
183
184
185/**
186 * VM State
187 */
188typedef enum VMSTATE
189{
190 /** The VM is being created. */
191 VMSTATE_CREATING = 0,
192 /** The VM is created. */
193 VMSTATE_CREATED,
194 /** The VM state is being loaded from file. */
195 VMSTATE_LOADING,
196 /** The VM is being powered on */
197 VMSTATE_POWERING_ON,
198 /** The VM is being resumed. */
199 VMSTATE_RESUMING,
200 /** The VM is runnning. */
201 VMSTATE_RUNNING,
202 /** Live save: The VM is running and the state is being saved. */
203 VMSTATE_RUNNING_LS,
204 /** Fault Tolerance: The VM is running and the state is being synced. */
205 VMSTATE_RUNNING_FT,
206 /** The VM is being reset. */
207 VMSTATE_RESETTING,
208 /** Live save: The VM is being reset and immediately suspended. */
209 VMSTATE_RESETTING_LS,
210 /** The VM is being soft/warm reset. */
211 VMSTATE_SOFT_RESETTING,
212 /** Live save: The VM is being soft/warm reset (not suspended afterwards). */
213 VMSTATE_SOFT_RESETTING_LS,
214 /** The VM is being suspended. */
215 VMSTATE_SUSPENDING,
216 /** Live save: The VM is being suspended during a live save operation, either as
217 * part of the normal flow or VMR3Reset. */
218 VMSTATE_SUSPENDING_LS,
219 /** Live save: The VM is being suspended by VMR3Suspend during live save. */
220 VMSTATE_SUSPENDING_EXT_LS,
221 /** The VM is suspended. */
222 VMSTATE_SUSPENDED,
223 /** Live save: The VM has been suspended and is waiting for the live save
224 * operation to move on. */
225 VMSTATE_SUSPENDED_LS,
226 /** Live save: The VM has been suspended by VMR3Suspend during a live save. */
227 VMSTATE_SUSPENDED_EXT_LS,
228 /** The VM is suspended and its state is being saved by EMT(0). (See SSM) */
229 VMSTATE_SAVING,
230 /** The VM is being debugged. (See DBGF.) */
231 VMSTATE_DEBUGGING,
232 /** Live save: The VM is being debugged while the live phase is going on. */
233 VMSTATE_DEBUGGING_LS,
234 /** The VM is being powered off. */
235 VMSTATE_POWERING_OFF,
236 /** Live save: The VM is being powered off and the save cancelled. */
237 VMSTATE_POWERING_OFF_LS,
238 /** The VM is switched off, awaiting destruction. */
239 VMSTATE_OFF,
240 /** Live save: Waiting for cancellation and transition to VMSTATE_OFF. */
241 VMSTATE_OFF_LS,
242 /** The VM is powered off because of a fatal error. */
243 VMSTATE_FATAL_ERROR,
244 /** Live save: Waiting for cancellation and transition to FatalError. */
245 VMSTATE_FATAL_ERROR_LS,
246 /** The VM is in guru meditation over a fatal failure. */
247 VMSTATE_GURU_MEDITATION,
248 /** Live save: Waiting for cancellation and transition to GuruMeditation. */
249 VMSTATE_GURU_MEDITATION_LS,
250 /** The VM is screwed because of a failed state loading. */
251 VMSTATE_LOAD_FAILURE,
252 /** The VM is being destroyed. */
253 VMSTATE_DESTROYING,
254 /** Terminated. */
255 VMSTATE_TERMINATED,
256 /** hack forcing the size of the enum to 32-bits. */
257 VMSTATE_MAKE_32BIT_HACK = 0x7fffffff
258} VMSTATE;
259
260/** @def VBOXSTRICTRC_STRICT_ENABLED
261 * Indicates that VBOXSTRICTRC is in strict mode.
262 */
263#if defined(__cplusplus) \
264 && ARCH_BITS == 64 /* cdecl requires classes and structs as hidden params. */ \
265 && !defined(_MSC_VER) /* trouble similar to 32-bit gcc. */ \
266 && ( defined(RT_STRICT) \
267 || defined(VBOX_STRICT) \
268 || defined(DEBUG) \
269 || defined(DOXYGEN_RUNNING) )
270# define VBOXSTRICTRC_STRICT_ENABLED 1
271#endif
272
273/** We need RTERR_STRICT_RC. */
274#if defined(VBOXSTRICTRC_STRICT_ENABLED) && !defined(RTERR_STRICT_RC)
275# define RTERR_STRICT_RC 1
276#endif
277
278/**
279 * Strict VirtualBox status code.
280 *
281 * This is normally an 32-bit integer and the only purpose of the type is to
282 * highlight the special handling that is required. But in strict build it is a
283 * class that causes compilation and runtime errors for some of the incorrect
284 * handling.
285 */
286#ifdef VBOXSTRICTRC_STRICT_ENABLED
287struct VBOXSTRICTRC
288{
289protected:
290 /** The status code. */
291 int32_t m_rc;
292
293public:
294 /** Default constructor setting the status to VERR_IPE_UNINITIALIZED_STATUS. */
295 VBOXSTRICTRC()
296#ifdef VERR_IPE_UNINITIALIZED_STATUS
297 : m_rc(VERR_IPE_UNINITIALIZED_STATUS)
298#else
299 : m_rc(-233 /*VERR_IPE_UNINITIALIZED_STATUS*/)
300#endif
301 {
302 }
303
304 /** Constructor for normal integer status codes. */
305 VBOXSTRICTRC(int32_t const rc)
306 : m_rc(rc)
307 {
308 }
309
310 /** Getter that VBOXSTRICTRC_VAL can use. */
311 int32_t getValue() const { return m_rc; }
312
313 /** @name Comparison operators
314 * @{ */
315 bool operator==(int32_t rc) const { return m_rc == rc; }
316 bool operator!=(int32_t rc) const { return m_rc != rc; }
317 bool operator<=(int32_t rc) const { return m_rc <= rc; }
318 bool operator>=(int32_t rc) const { return m_rc >= rc; }
319 bool operator<(int32_t rc) const { return m_rc < rc; }
320 bool operator>(int32_t rc) const { return m_rc > rc; }
321
322 bool operator==(const VBOXSTRICTRC &rRc) const { return m_rc == rRc.m_rc; }
323 bool operator!=(const VBOXSTRICTRC &rRc) const { return m_rc != rRc.m_rc; }
324 bool operator<=(const VBOXSTRICTRC &rRc) const { return m_rc <= rRc.m_rc; }
325 bool operator>=(const VBOXSTRICTRC &rRc) const { return m_rc >= rRc.m_rc; }
326 bool operator<(const VBOXSTRICTRC &rRc) const { return m_rc < rRc.m_rc; }
327 bool operator>(const VBOXSTRICTRC &rRc) const { return m_rc > rRc.m_rc; }
328 /** @} */
329
330 /** Special automatic cast for RT_SUCCESS_NP. */
331 operator RTErrStrictType2() const { return RTErrStrictType2(m_rc); }
332
333private:
334 /** @name Constructors that will prevent some of the bad types.
335 * @{ */
336 VBOXSTRICTRC(uint8_t rc) : m_rc(-999) { NOREF(rc); }
337 VBOXSTRICTRC(uint16_t rc) : m_rc(-999) { NOREF(rc); }
338 VBOXSTRICTRC(uint32_t rc) : m_rc(-999) { NOREF(rc); }
339 VBOXSTRICTRC(uint64_t rc) : m_rc(-999) { NOREF(rc); }
340
341 VBOXSTRICTRC(int8_t rc) : m_rc(-999) { NOREF(rc); }
342 VBOXSTRICTRC(int16_t rc) : m_rc(-999) { NOREF(rc); }
343 VBOXSTRICTRC(int64_t rc) : m_rc(-999) { NOREF(rc); }
344 /** @} */
345};
346# ifdef _MSC_VER
347# pragma warning(disable:4190)
348# endif
349#else
350typedef int32_t VBOXSTRICTRC;
351#endif
352
353/** @def VBOXSTRICTRC_VAL
354 * Explicit getter.
355 * @param rcStrict The strict VirtualBox status code.
356 */
357#ifdef VBOXSTRICTRC_STRICT_ENABLED
358# define VBOXSTRICTRC_VAL(rcStrict) ( (rcStrict).getValue() )
359#else
360# define VBOXSTRICTRC_VAL(rcStrict) (rcStrict)
361#endif
362
363/** @def VBOXSTRICTRC_TODO
364 * Returns that needs dealing with.
365 * @param rcStrict The strict VirtualBox status code.
366 */
367#define VBOXSTRICTRC_TODO(rcStrict) VBOXSTRICTRC_VAL(rcStrict)
368
369
370/** A cross context I/O port range handle. */
371typedef uint64_t IOMIOPORTHANDLE;
372/** Pointer to a cross context I/O port handle. */
373typedef IOMIOPORTHANDLE *PIOMIOPORTHANDLE;
374/** A NIL I/O port handle. */
375#define NIL_IOMIOPORTHANDLE ((uint64_t)UINT64_MAX)
376
377/** A cross context MMIO range handle. */
378typedef uint64_t IOMMMIOHANDLE;
379/** Pointer to a cross context MMIO handle. */
380typedef IOMMMIOHANDLE *PIOMMMIOHANDLE;
381/** A NIL MMIO handle. */
382#define NIL_IOMMMIOHANDLE ((uint64_t)UINT64_MAX)
383
384/** A cross context MMIO2 range handle. */
385typedef uint64_t PGMMMIO2HANDLE;
386/** Pointer to a cross context MMIO2 handle. */
387typedef PGMMMIO2HANDLE *PPGMMMIO2HANDLE;
388/** A NIL MMIO2 handle. */
389#define NIL_PGMMMIO2HANDLE ((uint64_t)UINT64_MAX)
390
391/** Pointer to a PDM Base Interface. */
392typedef struct PDMIBASE *PPDMIBASE;
393/** Pointer to a pointer to a PDM Base Interface. */
394typedef PPDMIBASE *PPPDMIBASE;
395
396/** Pointer to a PDM device instance for the current context. */
397#ifdef IN_RING3
398typedef struct PDMDEVINSR3 *PPDMDEVINS;
399#elif defined(IN_RING0) || defined(DOXYGEN_RUNNING)
400typedef struct PDMDEVINSR0 *PPDMDEVINS;
401#else
402typedef struct PDMDEVINSRC *PPDMDEVINS;
403#endif
404/** Pointer to a pointer a PDM device instance for the current context. */
405typedef PPDMDEVINS *PPPDMDEVINS;
406/** R3 pointer to a PDM device instance. */
407typedef R3PTRTYPE(struct PDMDEVINSR3 *) PPDMDEVINSR3;
408/** R0 pointer to a PDM device instance. */
409typedef R0PTRTYPE(struct PDMDEVINSR0 *) PPDMDEVINSR0;
410/** RC pointer to a PDM device instance. */
411typedef RCPTRTYPE(struct PDMDEVINSRC *) PPDMDEVINSRC;
412
413/** Pointer to a PDM PCI device structure. */
414typedef struct PDMPCIDEV *PPDMPCIDEV;
415/** Pointer to a const PDM PCI device structure. */
416typedef const struct PDMPCIDEV *PCPDMPCIDEV;
417
418/** Pointer to a PDM USB Device Instance. */
419typedef struct PDMUSBINS *PPDMUSBINS;
420/** Pointer to a pointer to a PDM USB Device Instance. */
421typedef PPDMUSBINS *PPPDMUSBINS;
422
423/** Pointer to a PDM Driver Instance. */
424typedef struct PDMDRVINS *PPDMDRVINS;
425/** Pointer to a pointer to a PDM Driver Instance. */
426typedef PPDMDRVINS *PPPDMDRVINS;
427/** R3 pointer to a PDM Driver Instance. */
428typedef R3PTRTYPE(PPDMDRVINS) PPDMDRVINSR3;
429/** R0 pointer to a PDM Driver Instance. */
430typedef R0PTRTYPE(PPDMDRVINS) PPDMDRVINSR0;
431/** RC pointer to a PDM Driver Instance. */
432typedef RCPTRTYPE(PPDMDRVINS) PPDMDRVINSRC;
433
434/** Pointer to a PDM Service Instance. */
435typedef struct PDMSRVINS *PPDMSRVINS;
436/** Pointer to a pointer to a PDM Service Instance. */
437typedef PPDMSRVINS *PPPDMSRVINS;
438
439/** Pointer to a PDM critical section. */
440typedef union PDMCRITSECT *PPDMCRITSECT;
441/** Pointer to a const PDM critical section. */
442typedef const union PDMCRITSECT *PCPDMCRITSECT;
443
444/** Pointer to a PDM read/write critical section. */
445typedef union PDMCRITSECTRW *PPDMCRITSECTRW;
446/** Pointer to a const PDM read/write critical section. */
447typedef union PDMCRITSECTRW const *PCPDMCRITSECTRW;
448
449/** PDM queue handle. */
450typedef uint64_t PDMQUEUEHANDLE;
451/** Pointer to a PDM queue handle. */
452typedef PDMQUEUEHANDLE *PPDMQUEUEHANDLE;
453/** NIL PDM queue handle. */
454#define NIL_PDMQUEUEHANDLE ((PDMQUEUEHANDLE)UINT64_MAX)
455
456/** R3 pointer to a timer. */
457typedef R3PTRTYPE(struct TMTIMER *) PTMTIMERR3;
458/** Pointer to a R3 pointer to a timer. */
459typedef PTMTIMERR3 *PPTMTIMERR3;
460
461/** R0 pointer to a timer. */
462typedef R0PTRTYPE(struct TMTIMER *) PTMTIMERR0;
463/** Pointer to a R3 pointer to a timer. */
464typedef PTMTIMERR0 *PPTMTIMERR0;
465
466/** RC pointer to a timer. */
467typedef RCPTRTYPE(struct TMTIMER *) PTMTIMERRC;
468/** Pointer to a RC pointer to a timer. */
469typedef PTMTIMERRC *PPTMTIMERRC;
470
471/** Pointer to a timer. */
472typedef CTX_SUFF(PTMTIMER) PTMTIMER;
473/** Pointer to a pointer to a timer. */
474typedef PTMTIMER *PPTMTIMER;
475
476/** A cross context timer handle. */
477typedef uint64_t TMTIMERHANDLE;
478/** Pointer to a cross context timer handle. */
479typedef TMTIMERHANDLE *PTMTIMERHANDLE;
480/** A NIL timer handle. */
481#define NIL_TMTIMERHANDLE ((uint64_t)UINT64_MAX)
482
483/** SSM Operation handle. */
484typedef struct SSMHANDLE *PSSMHANDLE;
485/** Pointer to a const SSM stream method table. */
486typedef struct SSMSTRMOPS const *PCSSMSTRMOPS;
487
488/** Pointer to a CPUMCTX. */
489typedef struct CPUMCTX *PCPUMCTX;
490/** Pointer to a const CPUMCTX. */
491typedef const struct CPUMCTX *PCCPUMCTX;
492
493/** Pointer to a CPU context core. */
494typedef struct CPUMCTXCORE *PCPUMCTXCORE;
495/** Pointer to a const CPU context core. */
496typedef const struct CPUMCTXCORE *PCCPUMCTXCORE;
497
498/** Pointer to a selector register. */
499typedef struct CPUMSELREG *PCPUMSELREG;
500/** Pointer to a const selector register. */
501typedef const struct CPUMSELREG *PCCPUMSELREG;
502
503/** Pointer to selector hidden registers.
504 * @deprecated Replaced by PCPUMSELREG */
505typedef struct CPUMSELREG *PCPUMSELREGHID;
506/** Pointer to const selector hidden registers.
507 * @deprecated Replaced by PCCPUMSELREG */
508typedef const struct CPUMSELREG *PCCPUMSELREGHID;
509
510/** A cross context DBGF tracer event source handle. */
511typedef uint64_t DBGFTRACEREVTSRC;
512/** Pointer to a cross context DBGF tracer event source handle. */
513typedef DBGFTRACEREVTSRC *PDBGFTRACEREVTSRC;
514/** A NIL DBGF tracer event source handle. */
515#define NIL_DBGFTRACEREVTSRC ((uint64_t)UINT64_MAX)
516
517/** Pointer to a DBGF tracer instance for the current context. */
518#ifdef IN_RING3
519typedef struct DBGFTRACERINSR3 *PDBGFTRACERINSCC;
520#elif defined(IN_RING0) || defined(DOXYGEN_RUNNING)
521typedef struct DBGFTRACERINSR0 *PDBGFTRACERINSCC;
522#else
523typedef struct DBGFTRACERINSRC *PDBGFTRACERINSCC;
524#endif
525/** Pointer to a pointer a DBGF tracer instance for the current context. */
526typedef PDBGFTRACERINSCC *PPDBGFTRACERINSCC;
527/** R3 pointer to a DBGF tracer instance. */
528typedef R3PTRTYPE(struct DBGFTRACERINSR3 *) PDBGFTRACERINSR3;
529/** R0 pointer to a DBGF tracer instance. */
530typedef R0PTRTYPE(struct DBGFTRACERINSR0 *) PDBGFTRACERINSR0;
531/** RC pointer to a DBGF tracer instance. */
532typedef RCPTRTYPE(struct DBGFTRACERINSRC *) PDBGFTRACERINSRC;
533
534/** A cross context DBGF breakpoint owner handle. */
535typedef uint32_t DBGFBPOWNER;
536/** Pointer to a cross context DBGF breakpoint owner handle. */
537typedef DBGFBPOWNER *PDBGFBPOWNER;
538/** A NIL DBGF breakpoint owner handle. */
539#define NIL_DBGFBPOWNER ((uint32_t)UINT32_MAX)
540
541/** A cross context DBGF breakpoint handle. */
542typedef uint32_t DBGFBP;
543/** Pointer to a cross context DBGF breakpoint handle. */
544typedef DBGFBP *PDBGFBP;
545/** A NIL DBGF breakpoint handle. */
546#define NIL_DBGFBP ((uint32_t)UINT32_MAX)
547
548/** A sample report handle. */
549typedef struct DBGFSAMPLEREPORTINT *DBGFSAMPLEREPORT;
550/** Pointer to a sample report handle. */
551typedef DBGFSAMPLEREPORT *PDBGFSAMPLEREPORT;
552/** @} */
553
554
555/** @defgroup grp_types_idt Interrupt Descriptor Table Entry.
556 * @todo This all belongs in x86.h!
557 * @{ */
558
559/** @todo VBOXIDT -> VBOXDESCIDT, skip the complex variations. We'll never use them. */
560
561/** IDT Entry, Task Gate view. */
562#pragma pack(1) /* paranoia */
563typedef struct VBOXIDTE_TASKGATE
564{
565 /** Reserved. */
566 unsigned u16Reserved1 : 16;
567 /** Task Segment Selector. */
568 unsigned u16TSS : 16;
569 /** More reserved. */
570 unsigned u8Reserved2 : 8;
571 /** Fixed value bit 0 - Set to 1. */
572 unsigned u1Fixed0 : 1;
573 /** Busy bit. */
574 unsigned u1Busy : 1;
575 /** Fixed value bit 2 - Set to 1. */
576 unsigned u1Fixed1 : 1;
577 /** Fixed value bit 3 - Set to 0. */
578 unsigned u1Fixed2 : 1;
579 /** Fixed value bit 4 - Set to 0. */
580 unsigned u1Fixed3 : 1;
581 /** Descriptor Privilege level. */
582 unsigned u2DPL : 2;
583 /** Present flag. */
584 unsigned u1Present : 1;
585 /** Reserved. */
586 unsigned u16Reserved3 : 16;
587} VBOXIDTE_TASKGATE;
588#pragma pack()
589/** Pointer to IDT Entry, Task gate view. */
590typedef VBOXIDTE_TASKGATE *PVBOXIDTE_TASKGATE;
591
592
593/** IDT Entry, Intertupt gate view. */
594#pragma pack(1) /* paranoia */
595typedef struct VBOXIDTE_INTERRUPTGATE
596{
597 /** Low offset word. */
598 unsigned u16OffsetLow : 16;
599 /** Segment Selector. */
600 unsigned u16SegSel : 16;
601 /** Reserved. */
602 unsigned u5Reserved2 : 5;
603 /** Fixed value bit 0 - Set to 0. */
604 unsigned u1Fixed0 : 1;
605 /** Fixed value bit 1 - Set to 0. */
606 unsigned u1Fixed1 : 1;
607 /** Fixed value bit 2 - Set to 0. */
608 unsigned u1Fixed2 : 1;
609 /** Fixed value bit 3 - Set to 0. */
610 unsigned u1Fixed3 : 1;
611 /** Fixed value bit 4 - Set to 1. */
612 unsigned u1Fixed4 : 1;
613 /** Fixed value bit 5 - Set to 1. */
614 unsigned u1Fixed5 : 1;
615 /** Gate size, 1 = 32 bits, 0 = 16 bits. */
616 unsigned u132BitGate : 1;
617 /** Fixed value bit 5 - Set to 0. */
618 unsigned u1Fixed6 : 1;
619 /** Descriptor Privilege level. */
620 unsigned u2DPL : 2;
621 /** Present flag. */
622 unsigned u1Present : 1;
623 /** High offset word. */
624 unsigned u16OffsetHigh : 16;
625} VBOXIDTE_INTERRUPTGATE;
626#pragma pack()
627/** Pointer to IDT Entry, Interrupt gate view. */
628typedef VBOXIDTE_INTERRUPTGATE *PVBOXIDTE_INTERRUPTGATE;
629
630/** IDT Entry, Trap Gate view. */
631#pragma pack(1) /* paranoia */
632typedef struct VBOXIDTE_TRAPGATE
633{
634 /** Low offset word. */
635 unsigned u16OffsetLow : 16;
636 /** Segment Selector. */
637 unsigned u16SegSel : 16;
638 /** Reserved. */
639 unsigned u5Reserved2 : 5;
640 /** Fixed value bit 0 - Set to 0. */
641 unsigned u1Fixed0 : 1;
642 /** Fixed value bit 1 - Set to 0. */
643 unsigned u1Fixed1 : 1;
644 /** Fixed value bit 2 - Set to 0. */
645 unsigned u1Fixed2 : 1;
646 /** Fixed value bit 3 - Set to 1. */
647 unsigned u1Fixed3 : 1;
648 /** Fixed value bit 4 - Set to 1. */
649 unsigned u1Fixed4 : 1;
650 /** Fixed value bit 5 - Set to 1. */
651 unsigned u1Fixed5 : 1;
652 /** Gate size, 1 = 32 bits, 0 = 16 bits. */
653 unsigned u132BitGate : 1;
654 /** Fixed value bit 5 - Set to 0. */
655 unsigned u1Fixed6 : 1;
656 /** Descriptor Privilege level. */
657 unsigned u2DPL : 2;
658 /** Present flag. */
659 unsigned u1Present : 1;
660 /** High offset word. */
661 unsigned u16OffsetHigh : 16;
662} VBOXIDTE_TRAPGATE;
663#pragma pack()
664/** Pointer to IDT Entry, Trap Gate view. */
665typedef VBOXIDTE_TRAPGATE *PVBOXIDTE_TRAPGATE;
666
667/** IDT Entry Generic view. */
668#pragma pack(1) /* paranoia */
669typedef struct VBOXIDTE_GENERIC
670{
671 /** Low offset word. */
672 unsigned u16OffsetLow : 16;
673 /** Segment Selector. */
674 unsigned u16SegSel : 16;
675 /** Reserved. */
676 unsigned u5Reserved : 5;
677 /** IDT Type part one (not used for task gate). */
678 unsigned u3Type1 : 3;
679 /** IDT Type part two. */
680 unsigned u5Type2 : 5;
681 /** Descriptor Privilege level. */
682 unsigned u2DPL : 2;
683 /** Present flag. */
684 unsigned u1Present : 1;
685 /** High offset word. */
686 unsigned u16OffsetHigh : 16;
687} VBOXIDTE_GENERIC;
688#pragma pack()
689/** Pointer to IDT Entry Generic view. */
690typedef VBOXIDTE_GENERIC *PVBOXIDTE_GENERIC;
691
692/** IDT Type1 value. (Reserved for task gate!) */
693#define VBOX_IDTE_TYPE1 0
694/** IDT Type2 value - Task gate. */
695#define VBOX_IDTE_TYPE2_TASK 0x5
696/** IDT Type2 value - 16 bit interrupt gate. */
697#define VBOX_IDTE_TYPE2_INT_16 0x6
698/** IDT Type2 value - 32 bit interrupt gate. */
699#define VBOX_IDTE_TYPE2_INT_32 0xe
700/** IDT Type2 value - 16 bit trap gate. */
701#define VBOX_IDTE_TYPE2_TRAP_16 0x7
702/** IDT Type2 value - 32 bit trap gate. */
703#define VBOX_IDTE_TYPE2_TRAP_32 0xf
704
705/** IDT Entry. */
706#pragma pack(1) /* paranoia */
707typedef union VBOXIDTE
708{
709 /** Task gate view. */
710 VBOXIDTE_TASKGATE Task;
711 /** Trap gate view. */
712 VBOXIDTE_TRAPGATE Trap;
713 /** Interrupt gate view. */
714 VBOXIDTE_INTERRUPTGATE Int;
715 /** Generic IDT view. */
716 VBOXIDTE_GENERIC Gen;
717
718 /** 8 bit unsigned integer view. */
719 uint8_t au8[8];
720 /** 16 bit unsigned integer view. */
721 uint16_t au16[4];
722 /** 32 bit unsigned integer view. */
723 uint32_t au32[2];
724 /** 64 bit unsigned integer view. */
725 uint64_t au64;
726} VBOXIDTE;
727#pragma pack()
728/** Pointer to IDT Entry. */
729typedef VBOXIDTE *PVBOXIDTE;
730/** Pointer to IDT Entry. */
731typedef VBOXIDTE const *PCVBOXIDTE;
732
733/** IDT Entry, 64-bit mode, Intertupt gate view. */
734#pragma pack(1) /* paranoia */
735typedef struct VBOXIDTE64_INTERRUPTGATE
736{
737 /** Low offset word. */
738 unsigned u16OffsetLow : 16;
739 /** Segment Selector. */
740 unsigned u16SegSel : 16;
741 /** Interrupt Stack Table Index. */
742 unsigned u3Ist : 3;
743 /** Fixed value bit 0 - Set to 0. */
744 unsigned u1Fixed0 : 1;
745 /** Fixed value bit 1 - Set to 0. */
746 unsigned u1Fixed1 : 1;
747 /** Fixed value bit 2 - Set to 0. */
748 unsigned u1Fixed2 : 1;
749 /** Fixed value bit 3 - Set to 0. */
750 unsigned u1Fixed3 : 1;
751 /** Fixed value bit 4 - Set to 0. */
752 unsigned u1Fixed4 : 1;
753 /** Fixed value bit 5 - Set to 0. */
754 unsigned u1Fixed5 : 1;
755 /** Fixed value bit 6 - Set to 1. */
756 unsigned u1Fixed6 : 1;
757 /** Fixed value bit 7 - Set to 1. */
758 unsigned u1Fixed7 : 1;
759 /** Gate size, 1 = 32 bits, 0 = 16 bits. */
760 unsigned u132BitGate : 1;
761 /** Fixed value bit 5 - Set to 0. */
762 unsigned u1Fixed8 : 1;
763 /** Descriptor Privilege level. */
764 unsigned u2DPL : 2;
765 /** Present flag. */
766 unsigned u1Present : 1;
767 /** High offset word. */
768 unsigned u16OffsetHigh : 16;
769 /** Offset bits 32..63. */
770 unsigned u32OffsetHigh64;
771 /** Reserved. */
772 unsigned u32Reserved;
773} VBOXIDTE64_INTERRUPTGATE;
774#pragma pack()
775/** Pointer to IDT Entry, 64-bit mode, Interrupt gate view. */
776typedef VBOXIDTE64_INTERRUPTGATE *PVBOXIDTE64_INTERRUPTGATE;
777
778/** IDT Entry, 64-bit mode, Trap gate view. */
779#pragma pack(1) /* paranoia */
780typedef struct VBOXIDTE64_TRAPGATE
781{
782 /** Low offset word. */
783 unsigned u16OffsetLow : 16;
784 /** Segment Selector. */
785 unsigned u16SegSel : 16;
786 /** Interrupt Stack Table Index. */
787 unsigned u3Ist : 3;
788 /** Fixed value bit 0 - Set to 0. */
789 unsigned u1Fixed0 : 1;
790 /** Fixed value bit 1 - Set to 0. */
791 unsigned u1Fixed1 : 1;
792 /** Fixed value bit 2 - Set to 0. */
793 unsigned u1Fixed2 : 1;
794 /** Fixed value bit 3 - Set to 0. */
795 unsigned u1Fixed3 : 1;
796 /** Fixed value bit 4 - Set to 0. */
797 unsigned u1Fixed4 : 1;
798 /** Fixed value bit 5 - Set to 1. */
799 unsigned u1Fixed5 : 1;
800 /** Fixed value bit 6 - Set to 1. */
801 unsigned u1Fixed6 : 1;
802 /** Fixed value bit 7 - Set to 1. */
803 unsigned u1Fixed7 : 1;
804 /** Gate size, 1 = 32 bits, 0 = 16 bits. */
805 unsigned u132BitGate : 1;
806 /** Fixed value bit 5 - Set to 0. */
807 unsigned u1Fixed8 : 1;
808 /** Descriptor Privilege level. */
809 unsigned u2DPL : 2;
810 /** Present flag. */
811 unsigned u1Present : 1;
812 /** High offset word. */
813 unsigned u16OffsetHigh : 16;
814 /** Offset bits 32..63. */
815 unsigned u32OffsetHigh64;
816 /** Reserved. */
817 unsigned u32Reserved;
818} VBOXIDTE64_TRAPGATE;
819#pragma pack()
820/** Pointer to IDT Entry, 64-bit mode, Trap gate view. */
821typedef VBOXIDTE64_TRAPGATE *PVBOXIDTE64_TRAPGATE;
822
823/** IDT Entry, 64-bit mode, Generic view. */
824#pragma pack(1) /* paranoia */
825typedef struct VBOXIDTE64_GENERIC
826{
827 /** Low offset word. */
828 unsigned u16OffsetLow : 16;
829 /** Segment Selector. */
830 unsigned u16SegSel : 16;
831 /** Reserved. */
832 unsigned u3Ist : 3;
833 /** Fixed value bit 0 - Set to 0. */
834 unsigned u1Fixed0 : 1;
835 /** Fixed value bit 1 - Set to 0. */
836 unsigned u1Fixed1 : 1;
837 /** IDT Type part one (not used for task gate). */
838 unsigned u3Type1 : 3;
839 /** IDT Type part two. */
840 unsigned u5Type2 : 5;
841 /** Descriptor Privilege level. */
842 unsigned u2DPL : 2;
843 /** Present flag. */
844 unsigned u1Present : 1;
845 /** High offset word. */
846 unsigned u16OffsetHigh : 16;
847 /** Offset bits 32..63. */
848 unsigned u32OffsetHigh64;
849 /** Reserved. */
850 unsigned u32Reserved;
851} VBOXIDTE64_GENERIC;
852#pragma pack()
853/** Pointer to IDT Entry, 64-bit mode, Generic view. */
854typedef VBOXIDTE64_GENERIC *PVBOXIDTE64_GENERIC;
855
856/** IDT Entry, 64-bit mode. */
857#pragma pack(1) /* paranoia */
858typedef union VBOXIDTE64
859{
860 /** Trap gate view. */
861 VBOXIDTE64_TRAPGATE Trap;
862 /** Interrupt gate view. */
863 VBOXIDTE64_INTERRUPTGATE Int;
864 /** Generic IDT view. */
865 VBOXIDTE64_GENERIC Gen;
866
867 /** 8 bit unsigned integer view. */
868 uint8_t au8[16];
869 /** 16 bit unsigned integer view. */
870 uint16_t au16[8];
871 /** 32 bit unsigned integer view. */
872 uint32_t au32[4];
873 /** 64 bit unsigned integer view. */
874 uint64_t au64[2];
875} VBOXIDTE64;
876#pragma pack()
877/** Pointer to IDT Entry. */
878typedef VBOXIDTE64 *PVBOXIDTE64;
879/** Pointer to IDT Entry. */
880typedef VBOXIDTE64 const *PCVBOXIDTE64;
881
882#pragma pack(1)
883/** IDTR */
884typedef struct VBOXIDTR
885{
886 /** Size of the IDT. */
887 uint16_t cbIdt;
888 /** Address of the IDT. */
889 uint64_t pIdt;
890} VBOXIDTR, *PVBOXIDTR;
891#pragma pack()
892
893
894/** @def VBOXIDTE_OFFSET
895 * Return the offset of an IDT entry.
896 */
897#define VBOXIDTE_OFFSET(desc) \
898 ( ((uint32_t)((desc).Gen.u16OffsetHigh) << 16) \
899 | ( (desc).Gen.u16OffsetLow ) )
900
901/** @def VBOXIDTE64_OFFSET
902 * Return the offset of an IDT entry.
903 */
904#define VBOXIDTE64_OFFSET(desc) \
905 ( ((uint64_t)((desc).Gen.u32OffsetHigh64) << 32) \
906 | ((uint32_t)((desc).Gen.u16OffsetHigh) << 16) \
907 | ( (desc).Gen.u16OffsetLow ) )
908
909#pragma pack(1)
910/** GDTR */
911typedef struct VBOXGDTR
912{
913 /** Size of the GDT. */
914 uint16_t cbGdt;
915 /** Address of the GDT. */
916 uint64_t pGdt;
917} VBOXGDTR;
918#pragma pack()
919/** Pointer to GDTR. */
920typedef VBOXGDTR *PVBOXGDTR;
921
922/** @} */
923
924
925/**
926 * 32-bit Task Segment used in raw mode.
927 * @todo Move this to SELM! Use X86TSS32 instead.
928 */
929#pragma pack(1)
930typedef struct VBOXTSS
931{
932 /** 0x00 - Back link to previous task. (static) */
933 RTSEL selPrev;
934 uint16_t padding1;
935 /** 0x04 - Ring-0 stack pointer. (static) */
936 uint32_t esp0;
937 /** 0x08 - Ring-0 stack segment. (static) */
938 RTSEL ss0;
939 uint16_t padding_ss0;
940 /** 0x0c - Ring-1 stack pointer. (static) */
941 uint32_t esp1;
942 /** 0x10 - Ring-1 stack segment. (static) */
943 RTSEL ss1;
944 uint16_t padding_ss1;
945 /** 0x14 - Ring-2 stack pointer. (static) */
946 uint32_t esp2;
947 /** 0x18 - Ring-2 stack segment. (static) */
948 RTSEL ss2;
949 uint16_t padding_ss2;
950 /** 0x1c - Page directory for the task. (static) */
951 uint32_t cr3;
952 /** 0x20 - EIP before task switch. */
953 uint32_t eip;
954 /** 0x24 - EFLAGS before task switch. */
955 uint32_t eflags;
956 /** 0x28 - EAX before task switch. */
957 uint32_t eax;
958 /** 0x2c - ECX before task switch. */
959 uint32_t ecx;
960 /** 0x30 - EDX before task switch. */
961 uint32_t edx;
962 /** 0x34 - EBX before task switch. */
963 uint32_t ebx;
964 /** 0x38 - ESP before task switch. */
965 uint32_t esp;
966 /** 0x3c - EBP before task switch. */
967 uint32_t ebp;
968 /** 0x40 - ESI before task switch. */
969 uint32_t esi;
970 /** 0x44 - EDI before task switch. */
971 uint32_t edi;
972 /** 0x48 - ES before task switch. */
973 RTSEL es;
974 uint16_t padding_es;
975 /** 0x4c - CS before task switch. */
976 RTSEL cs;
977 uint16_t padding_cs;
978 /** 0x50 - SS before task switch. */
979 RTSEL ss;
980 uint16_t padding_ss;
981 /** 0x54 - DS before task switch. */
982 RTSEL ds;
983 uint16_t padding_ds;
984 /** 0x58 - FS before task switch. */
985 RTSEL fs;
986 uint16_t padding_fs;
987 /** 0x5c - GS before task switch. */
988 RTSEL gs;
989 uint16_t padding_gs;
990 /** 0x60 - LDTR before task switch. */
991 RTSEL selLdt;
992 uint16_t padding_ldt;
993 /** 0x64 - Debug trap flag */
994 uint16_t fDebugTrap;
995 /** 0x66 - Offset relative to the TSS of the start of the I/O Bitmap
996 * and the end of the interrupt redirection bitmap. */
997 uint16_t offIoBitmap;
998 /** 0x68 - 32 bytes for the virtual interrupt redirection bitmap. (VME) */
999 uint8_t IntRedirBitmap[32];
1000} VBOXTSS;
1001#pragma pack()
1002/** Pointer to task segment. */
1003typedef VBOXTSS *PVBOXTSS;
1004/** Pointer to const task segment. */
1005typedef const VBOXTSS *PCVBOXTSS;
1006
1007
1008/** Pointer to a callback method table provided by the VM API user. */
1009typedef struct VMM2USERMETHODS const *PCVMM2USERMETHODS;
1010
1011
1012/**
1013 * Data transport buffer (scatter/gather)
1014 */
1015typedef struct PDMDATASEG
1016{
1017 /** Length of buffer in entry. */
1018 size_t cbSeg;
1019 /** Pointer to the start of the buffer. */
1020 void *pvSeg;
1021} PDMDATASEG;
1022/** Pointer to a data transport segment. */
1023typedef PDMDATASEG *PPDMDATASEG;
1024/** Pointer to a const data transport segment. */
1025typedef PDMDATASEG const *PCPDMDATASEG;
1026
1027
1028/**
1029 * Forms of generic segment offloading.
1030 */
1031typedef enum PDMNETWORKGSOTYPE
1032{
1033 /** Invalid zero value. */
1034 PDMNETWORKGSOTYPE_INVALID = 0,
1035 /** TCP/IPv4 - no CWR/ECE encoding. */
1036 PDMNETWORKGSOTYPE_IPV4_TCP,
1037 /** TCP/IPv6 - no CWR/ECE encoding. */
1038 PDMNETWORKGSOTYPE_IPV6_TCP,
1039 /** UDP/IPv4. */
1040 PDMNETWORKGSOTYPE_IPV4_UDP,
1041 /** UDP/IPv6. */
1042 PDMNETWORKGSOTYPE_IPV6_UDP,
1043 /** TCP/IPv6 over IPv4 tunneling - no CWR/ECE encoding.
1044 * The header offsets and sizes relates to IPv4 and TCP, the IPv6 header is
1045 * figured out as needed.
1046 * @todo Needs checking against facts, this is just an outline of the idea. */
1047 PDMNETWORKGSOTYPE_IPV4_IPV6_TCP,
1048 /** UDP/IPv6 over IPv4 tunneling.
1049 * The header offsets and sizes relates to IPv4 and UDP, the IPv6 header is
1050 * figured out as needed.
1051 * @todo Needs checking against facts, this is just an outline of the idea. */
1052 PDMNETWORKGSOTYPE_IPV4_IPV6_UDP,
1053 /** The end of valid GSO types. */
1054 PDMNETWORKGSOTYPE_END
1055} PDMNETWORKGSOTYPE;
1056
1057
1058/**
1059 * Generic segment offloading context.
1060 *
1061 * We generally follow the E1000 specs wrt to which header fields we change.
1062 * However the GSO type implies where the checksum fields are and that they are
1063 * always updated from scratch (no half done pseudo checksums).
1064 *
1065 * @remarks This is part of the internal network GSO packets. Take great care
1066 * when making changes. The size is expected to be exactly 8 bytes.
1067 *
1068 * @ingroup grp_pdm
1069 */
1070typedef struct PDMNETWORKGSO
1071{
1072 /** The type of segmentation offloading we're performing (PDMNETWORKGSOTYPE). */
1073 uint8_t u8Type;
1074 /** The total header size. */
1075 uint8_t cbHdrsTotal;
1076 /** The max segment size (MSS) to apply. */
1077 uint16_t cbMaxSeg;
1078
1079 /** Offset of the first header (IPv4 / IPv6). 0 if not not needed. */
1080 uint8_t offHdr1;
1081 /** Offset of the second header (TCP / UDP). 0 if not not needed. */
1082 uint8_t offHdr2;
1083 /** The header size used for segmentation (equal to offHdr2 in UFO). */
1084 uint8_t cbHdrsSeg;
1085 /** Unused. */
1086 uint8_t u8Unused;
1087} PDMNETWORKGSO;
1088/** Pointer to a GSO context.
1089 * @ingroup grp_pdm */
1090typedef PDMNETWORKGSO *PPDMNETWORKGSO;
1091/** Pointer to a const GSO context.
1092 * @ingroup grp_pdm */
1093typedef PDMNETWORKGSO const *PCPDMNETWORKGSO;
1094
1095/** Pointer to a PDM filter handle.
1096 * @ingroup grp_pdm_net_shaper */
1097typedef struct PDMNSFILTER *PPDMNSFILTER;
1098/** Pointer to a network shaper.
1099 * @ingroup grp_pdm_net_shaper */
1100typedef struct PDMNETSHAPER *PPDMNETSHAPER;
1101
1102
1103/**
1104 * The current ROM page protection.
1105 *
1106 * @remarks This is part of the saved state.
1107 * @ingroup grp_pgm
1108 */
1109typedef enum PGMROMPROT
1110{
1111 /** The customary invalid value. */
1112 PGMROMPROT_INVALID = 0,
1113 /** Read from the virgin ROM page, ignore writes.
1114 * Map the virgin page, use write access handler to ignore writes. */
1115 PGMROMPROT_READ_ROM_WRITE_IGNORE,
1116 /** Read from the virgin ROM page, write to the shadow RAM.
1117 * Map the virgin page, use write access handler to change the shadow RAM. */
1118 PGMROMPROT_READ_ROM_WRITE_RAM,
1119 /** Read from the shadow ROM page, ignore writes.
1120 * Map the shadow page read-only, use write access handler to ignore writes. */
1121 PGMROMPROT_READ_RAM_WRITE_IGNORE,
1122 /** Read from the shadow ROM page, ignore writes.
1123 * Map the shadow page read-write, disabled write access handler. */
1124 PGMROMPROT_READ_RAM_WRITE_RAM,
1125 /** The end of valid values. */
1126 PGMROMPROT_END,
1127 /** The usual 32-bit type size hack. */
1128 PGMROMPROT_32BIT_HACK = 0x7fffffff
1129} PGMROMPROT;
1130
1131
1132/**
1133 * Page mapping lock.
1134 * @ingroup grp_pgm
1135 */
1136typedef struct PGMPAGEMAPLOCK
1137{
1138#if defined(IN_RC)
1139 /** The locked page. */
1140 void *pvPage;
1141 /** Pointer to the CPU that made the mapping.
1142 * In ring-0 and raw-mode context we don't intend to ever allow long term
1143 * locking and this is a way of making sure we're still on the same CPU. */
1144 PVMCPU pVCpu;
1145#else
1146 /** Pointer to the PGMPAGE and lock type.
1147 * bit-0 abuse: set=write, clear=read. */
1148 uintptr_t uPageAndType;
1149/** Read lock type value. */
1150# define PGMPAGEMAPLOCK_TYPE_READ ((uintptr_t)0)
1151/** Write lock type value. */
1152# define PGMPAGEMAPLOCK_TYPE_WRITE ((uintptr_t)1)
1153/** Lock type mask. */
1154# define PGMPAGEMAPLOCK_TYPE_MASK ((uintptr_t)1)
1155 /** Pointer to the PGMCHUNKR3MAP. */
1156 void *pvMap;
1157#endif
1158} PGMPAGEMAPLOCK;
1159/** Pointer to a page mapping lock.
1160 * @ingroup grp_pgm */
1161typedef PGMPAGEMAPLOCK *PPGMPAGEMAPLOCK;
1162
1163
1164/** Pointer to a info helper callback structure. */
1165typedef struct DBGFINFOHLP *PDBGFINFOHLP;
1166/** Pointer to a const info helper callback structure. */
1167typedef const struct DBGFINFOHLP *PCDBGFINFOHLP;
1168
1169/** Pointer to a const register descriptor. */
1170typedef struct DBGFREGDESC const *PCDBGFREGDESC;
1171
1172
1173/** Configuration manager tree node - A key. */
1174typedef struct CFGMNODE *PCFGMNODE;
1175
1176/** Configuration manager tree leaf - A value. */
1177typedef struct CFGMLEAF *PCFGMLEAF;
1178
1179
1180/**
1181 * CPU modes.
1182 */
1183typedef enum CPUMMODE
1184{
1185 /** The usual invalid zero entry. */
1186 CPUMMODE_INVALID = 0,
1187 /** Real mode. */
1188 CPUMMODE_REAL,
1189 /** Protected mode (32-bit). */
1190 CPUMMODE_PROTECTED,
1191 /** Long mode (64-bit). */
1192 CPUMMODE_LONG
1193} CPUMMODE;
1194
1195
1196/**
1197 * CPU mode flags (DISSTATE::mode).
1198 */
1199typedef enum DISCPUMODE
1200{
1201 DISCPUMODE_INVALID = 0,
1202 DISCPUMODE_16BIT,
1203 DISCPUMODE_32BIT,
1204 DISCPUMODE_64BIT,
1205 /** hack forcing the size of the enum to 32-bits. */
1206 DISCPUMODE_MAKE_32BIT_HACK = 0x7fffffff
1207} DISCPUMODE;
1208
1209/** Pointer to the disassembler state. */
1210typedef struct DISSTATE *PDISSTATE;
1211/** Pointer to a const disassembler state. */
1212typedef struct DISSTATE const *PCDISSTATE;
1213
1214/** @deprecated PDISSTATE and change pCpu and pDisState to pDis. */
1215typedef PDISSTATE PDISCPUSTATE;
1216/** @deprecated PCDISSTATE and change pCpu and pDisState to pDis. */
1217typedef PCDISSTATE PCDISCPUSTATE;
1218
1219
1220/**
1221 * Shared region description (needed by GMM and others, thus global).
1222 * @ingroup grp_vmmdev
1223 */
1224typedef struct VMMDEVSHAREDREGIONDESC
1225{
1226 RTGCPTR64 GCRegionAddr;
1227 uint32_t cbRegion;
1228 uint32_t u32Alignment;
1229} VMMDEVSHAREDREGIONDESC;
1230
1231
1232/**
1233 * A PCI bus:device:function (BDF) identifier.
1234 *
1235 * All 16 bits of a BDF are valid according to the PCI spec. We need one extra bit
1236 * to determine whether the BDF is valid in interfaces where the BDF may be
1237 * optional.
1238 */
1239typedef uint32_t PCIBDF;
1240/** PCIBDF flag: Invalid. */
1241#define PCI_BDF_F_INVALID RT_BIT(31)
1242/** Nil PCIBDF value. */
1243#define NIL_PCIBDF PCI_BDF_F_INVALID
1244
1245/** Pointer to an MSI message struct. */
1246typedef struct MSIMSG *PMSIMSG;
1247/** Pointer to a const MSI message struct. */
1248typedef const struct MSIMSG *PCMSIMSG;
1249
1250
1251/** @} */
1252
1253#endif /* !VBOX_INCLUDED_types_h */
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