VirtualBox

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

Last change on this file since 96407 was 96407, checked in by vboxsync, 2 years ago

scm copyright and license note update

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