VirtualBox

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

Last change on this file since 93593 was 93444, checked in by vboxsync, 3 years ago

VMM,Main,HostServices: Use a function table for accessing the VBoxVMM.dll/so/dylib functionality, and load it dynamically when the Console object is initialized. Also converted a few drivers in Main to use device helpers to get config values and such. bugref:10074

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 39.7 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/** R3 pointer to a timer. */
450typedef R3PTRTYPE(struct TMTIMER *) PTMTIMERR3;
451/** Pointer to a R3 pointer to a timer. */
452typedef PTMTIMERR3 *PPTMTIMERR3;
453
454/** R0 pointer to a timer. */
455typedef R0PTRTYPE(struct TMTIMER *) PTMTIMERR0;
456/** Pointer to a R3 pointer to a timer. */
457typedef PTMTIMERR0 *PPTMTIMERR0;
458
459/** RC pointer to a timer. */
460typedef RCPTRTYPE(struct TMTIMER *) PTMTIMERRC;
461/** Pointer to a RC pointer to a timer. */
462typedef PTMTIMERRC *PPTMTIMERRC;
463
464/** Pointer to a timer. */
465typedef CTX_SUFF(PTMTIMER) PTMTIMER;
466/** Pointer to a pointer to a timer. */
467typedef PTMTIMER *PPTMTIMER;
468
469/** A cross context timer handle. */
470typedef uint64_t TMTIMERHANDLE;
471/** Pointer to a cross context timer handle. */
472typedef TMTIMERHANDLE *PTMTIMERHANDLE;
473/** A NIL timer handle. */
474#define NIL_TMTIMERHANDLE ((uint64_t)UINT64_MAX)
475
476/** SSM Operation handle. */
477typedef struct SSMHANDLE *PSSMHANDLE;
478/** Pointer to a const SSM stream method table. */
479typedef struct SSMSTRMOPS const *PCSSMSTRMOPS;
480
481/** Pointer to a CPUMCTX. */
482typedef struct CPUMCTX *PCPUMCTX;
483/** Pointer to a const CPUMCTX. */
484typedef const struct CPUMCTX *PCCPUMCTX;
485
486/** Pointer to a CPU context core. */
487typedef struct CPUMCTXCORE *PCPUMCTXCORE;
488/** Pointer to a const CPU context core. */
489typedef const struct CPUMCTXCORE *PCCPUMCTXCORE;
490
491/** Pointer to a selector register. */
492typedef struct CPUMSELREG *PCPUMSELREG;
493/** Pointer to a const selector register. */
494typedef const struct CPUMSELREG *PCCPUMSELREG;
495
496/** Pointer to selector hidden registers.
497 * @deprecated Replaced by PCPUMSELREG */
498typedef struct CPUMSELREG *PCPUMSELREGHID;
499/** Pointer to const selector hidden registers.
500 * @deprecated Replaced by PCCPUMSELREG */
501typedef const struct CPUMSELREG *PCCPUMSELREGHID;
502
503/** A cross context DBGF tracer event source handle. */
504typedef uint64_t DBGFTRACEREVTSRC;
505/** Pointer to a cross context DBGF tracer event source handle. */
506typedef DBGFTRACEREVTSRC *PDBGFTRACEREVTSRC;
507/** A NIL DBGF tracer event source handle. */
508#define NIL_DBGFTRACEREVTSRC ((uint64_t)UINT64_MAX)
509
510/** Pointer to a DBGF tracer instance for the current context. */
511#ifdef IN_RING3
512typedef struct DBGFTRACERINSR3 *PDBGFTRACERINSCC;
513#elif defined(IN_RING0) || defined(DOXYGEN_RUNNING)
514typedef struct DBGFTRACERINSR0 *PDBGFTRACERINSCC;
515#else
516typedef struct DBGFTRACERINSRC *PDBGFTRACERINSCC;
517#endif
518/** Pointer to a pointer a DBGF tracer instance for the current context. */
519typedef PDBGFTRACERINSCC *PPDBGFTRACERINSCC;
520/** R3 pointer to a DBGF tracer instance. */
521typedef R3PTRTYPE(struct DBGFTRACERINSR3 *) PDBGFTRACERINSR3;
522/** R0 pointer to a DBGF tracer instance. */
523typedef R0PTRTYPE(struct DBGFTRACERINSR0 *) PDBGFTRACERINSR0;
524/** RC pointer to a DBGF tracer instance. */
525typedef RCPTRTYPE(struct DBGFTRACERINSRC *) PDBGFTRACERINSRC;
526
527/** A cross context DBGF breakpoint owner handle. */
528typedef uint32_t DBGFBPOWNER;
529/** Pointer to a cross context DBGF breakpoint owner handle. */
530typedef DBGFBPOWNER *PDBGFBPOWNER;
531/** A NIL DBGF breakpoint owner handle. */
532#define NIL_DBGFBPOWNER ((uint32_t)UINT32_MAX)
533
534/** A cross context DBGF breakpoint handle. */
535typedef uint32_t DBGFBP;
536/** Pointer to a cross context DBGF breakpoint handle. */
537typedef DBGFBP *PDBGFBP;
538/** A NIL DBGF breakpoint handle. */
539#define NIL_DBGFBP ((uint32_t)UINT32_MAX)
540
541/** A sample report handle. */
542typedef struct DBGFSAMPLEREPORTINT *DBGFSAMPLEREPORT;
543/** Pointer to a sample report handle. */
544typedef DBGFSAMPLEREPORT *PDBGFSAMPLEREPORT;
545/** @} */
546
547
548/** @defgroup grp_types_idt Interrupt Descriptor Table Entry.
549 * @todo This all belongs in x86.h!
550 * @{ */
551
552/** @todo VBOXIDT -> VBOXDESCIDT, skip the complex variations. We'll never use them. */
553
554/** IDT Entry, Task Gate view. */
555#pragma pack(1) /* paranoia */
556typedef struct VBOXIDTE_TASKGATE
557{
558 /** Reserved. */
559 unsigned u16Reserved1 : 16;
560 /** Task Segment Selector. */
561 unsigned u16TSS : 16;
562 /** More reserved. */
563 unsigned u8Reserved2 : 8;
564 /** Fixed value bit 0 - Set to 1. */
565 unsigned u1Fixed0 : 1;
566 /** Busy bit. */
567 unsigned u1Busy : 1;
568 /** Fixed value bit 2 - Set to 1. */
569 unsigned u1Fixed1 : 1;
570 /** Fixed value bit 3 - Set to 0. */
571 unsigned u1Fixed2 : 1;
572 /** Fixed value bit 4 - Set to 0. */
573 unsigned u1Fixed3 : 1;
574 /** Descriptor Privilege level. */
575 unsigned u2DPL : 2;
576 /** Present flag. */
577 unsigned u1Present : 1;
578 /** Reserved. */
579 unsigned u16Reserved3 : 16;
580} VBOXIDTE_TASKGATE;
581#pragma pack()
582/** Pointer to IDT Entry, Task gate view. */
583typedef VBOXIDTE_TASKGATE *PVBOXIDTE_TASKGATE;
584
585
586/** IDT Entry, Intertupt gate view. */
587#pragma pack(1) /* paranoia */
588typedef struct VBOXIDTE_INTERRUPTGATE
589{
590 /** Low offset word. */
591 unsigned u16OffsetLow : 16;
592 /** Segment Selector. */
593 unsigned u16SegSel : 16;
594 /** Reserved. */
595 unsigned u5Reserved2 : 5;
596 /** Fixed value bit 0 - Set to 0. */
597 unsigned u1Fixed0 : 1;
598 /** Fixed value bit 1 - Set to 0. */
599 unsigned u1Fixed1 : 1;
600 /** Fixed value bit 2 - Set to 0. */
601 unsigned u1Fixed2 : 1;
602 /** Fixed value bit 3 - Set to 0. */
603 unsigned u1Fixed3 : 1;
604 /** Fixed value bit 4 - Set to 1. */
605 unsigned u1Fixed4 : 1;
606 /** Fixed value bit 5 - Set to 1. */
607 unsigned u1Fixed5 : 1;
608 /** Gate size, 1 = 32 bits, 0 = 16 bits. */
609 unsigned u132BitGate : 1;
610 /** Fixed value bit 5 - Set to 0. */
611 unsigned u1Fixed6 : 1;
612 /** Descriptor Privilege level. */
613 unsigned u2DPL : 2;
614 /** Present flag. */
615 unsigned u1Present : 1;
616 /** High offset word. */
617 unsigned u16OffsetHigh : 16;
618} VBOXIDTE_INTERRUPTGATE;
619#pragma pack()
620/** Pointer to IDT Entry, Interrupt gate view. */
621typedef VBOXIDTE_INTERRUPTGATE *PVBOXIDTE_INTERRUPTGATE;
622
623/** IDT Entry, Trap Gate view. */
624#pragma pack(1) /* paranoia */
625typedef struct VBOXIDTE_TRAPGATE
626{
627 /** Low offset word. */
628 unsigned u16OffsetLow : 16;
629 /** Segment Selector. */
630 unsigned u16SegSel : 16;
631 /** Reserved. */
632 unsigned u5Reserved2 : 5;
633 /** Fixed value bit 0 - Set to 0. */
634 unsigned u1Fixed0 : 1;
635 /** Fixed value bit 1 - Set to 0. */
636 unsigned u1Fixed1 : 1;
637 /** Fixed value bit 2 - Set to 0. */
638 unsigned u1Fixed2 : 1;
639 /** Fixed value bit 3 - Set to 1. */
640 unsigned u1Fixed3 : 1;
641 /** Fixed value bit 4 - Set to 1. */
642 unsigned u1Fixed4 : 1;
643 /** Fixed value bit 5 - Set to 1. */
644 unsigned u1Fixed5 : 1;
645 /** Gate size, 1 = 32 bits, 0 = 16 bits. */
646 unsigned u132BitGate : 1;
647 /** Fixed value bit 5 - Set to 0. */
648 unsigned u1Fixed6 : 1;
649 /** Descriptor Privilege level. */
650 unsigned u2DPL : 2;
651 /** Present flag. */
652 unsigned u1Present : 1;
653 /** High offset word. */
654 unsigned u16OffsetHigh : 16;
655} VBOXIDTE_TRAPGATE;
656#pragma pack()
657/** Pointer to IDT Entry, Trap Gate view. */
658typedef VBOXIDTE_TRAPGATE *PVBOXIDTE_TRAPGATE;
659
660/** IDT Entry Generic view. */
661#pragma pack(1) /* paranoia */
662typedef struct VBOXIDTE_GENERIC
663{
664 /** Low offset word. */
665 unsigned u16OffsetLow : 16;
666 /** Segment Selector. */
667 unsigned u16SegSel : 16;
668 /** Reserved. */
669 unsigned u5Reserved : 5;
670 /** IDT Type part one (not used for task gate). */
671 unsigned u3Type1 : 3;
672 /** IDT Type part two. */
673 unsigned u5Type2 : 5;
674 /** Descriptor Privilege level. */
675 unsigned u2DPL : 2;
676 /** Present flag. */
677 unsigned u1Present : 1;
678 /** High offset word. */
679 unsigned u16OffsetHigh : 16;
680} VBOXIDTE_GENERIC;
681#pragma pack()
682/** Pointer to IDT Entry Generic view. */
683typedef VBOXIDTE_GENERIC *PVBOXIDTE_GENERIC;
684
685/** IDT Type1 value. (Reserved for task gate!) */
686#define VBOX_IDTE_TYPE1 0
687/** IDT Type2 value - Task gate. */
688#define VBOX_IDTE_TYPE2_TASK 0x5
689/** IDT Type2 value - 16 bit interrupt gate. */
690#define VBOX_IDTE_TYPE2_INT_16 0x6
691/** IDT Type2 value - 32 bit interrupt gate. */
692#define VBOX_IDTE_TYPE2_INT_32 0xe
693/** IDT Type2 value - 16 bit trap gate. */
694#define VBOX_IDTE_TYPE2_TRAP_16 0x7
695/** IDT Type2 value - 32 bit trap gate. */
696#define VBOX_IDTE_TYPE2_TRAP_32 0xf
697
698/** IDT Entry. */
699#pragma pack(1) /* paranoia */
700typedef union VBOXIDTE
701{
702 /** Task gate view. */
703 VBOXIDTE_TASKGATE Task;
704 /** Trap gate view. */
705 VBOXIDTE_TRAPGATE Trap;
706 /** Interrupt gate view. */
707 VBOXIDTE_INTERRUPTGATE Int;
708 /** Generic IDT view. */
709 VBOXIDTE_GENERIC Gen;
710
711 /** 8 bit unsigned integer view. */
712 uint8_t au8[8];
713 /** 16 bit unsigned integer view. */
714 uint16_t au16[4];
715 /** 32 bit unsigned integer view. */
716 uint32_t au32[2];
717 /** 64 bit unsigned integer view. */
718 uint64_t au64;
719} VBOXIDTE;
720#pragma pack()
721/** Pointer to IDT Entry. */
722typedef VBOXIDTE *PVBOXIDTE;
723/** Pointer to IDT Entry. */
724typedef VBOXIDTE const *PCVBOXIDTE;
725
726/** IDT Entry, 64-bit mode, Intertupt gate view. */
727#pragma pack(1) /* paranoia */
728typedef struct VBOXIDTE64_INTERRUPTGATE
729{
730 /** Low offset word. */
731 unsigned u16OffsetLow : 16;
732 /** Segment Selector. */
733 unsigned u16SegSel : 16;
734 /** Interrupt Stack Table Index. */
735 unsigned u3Ist : 3;
736 /** Fixed value bit 0 - Set to 0. */
737 unsigned u1Fixed0 : 1;
738 /** Fixed value bit 1 - Set to 0. */
739 unsigned u1Fixed1 : 1;
740 /** Fixed value bit 2 - Set to 0. */
741 unsigned u1Fixed2 : 1;
742 /** Fixed value bit 3 - Set to 0. */
743 unsigned u1Fixed3 : 1;
744 /** Fixed value bit 4 - Set to 0. */
745 unsigned u1Fixed4 : 1;
746 /** Fixed value bit 5 - Set to 0. */
747 unsigned u1Fixed5 : 1;
748 /** Fixed value bit 6 - Set to 1. */
749 unsigned u1Fixed6 : 1;
750 /** Fixed value bit 7 - Set to 1. */
751 unsigned u1Fixed7 : 1;
752 /** Gate size, 1 = 32 bits, 0 = 16 bits. */
753 unsigned u132BitGate : 1;
754 /** Fixed value bit 5 - Set to 0. */
755 unsigned u1Fixed8 : 1;
756 /** Descriptor Privilege level. */
757 unsigned u2DPL : 2;
758 /** Present flag. */
759 unsigned u1Present : 1;
760 /** High offset word. */
761 unsigned u16OffsetHigh : 16;
762 /** Offset bits 32..63. */
763 unsigned u32OffsetHigh64;
764 /** Reserved. */
765 unsigned u32Reserved;
766} VBOXIDTE64_INTERRUPTGATE;
767#pragma pack()
768/** Pointer to IDT Entry, 64-bit mode, Interrupt gate view. */
769typedef VBOXIDTE64_INTERRUPTGATE *PVBOXIDTE64_INTERRUPTGATE;
770
771/** IDT Entry, 64-bit mode, Trap gate view. */
772#pragma pack(1) /* paranoia */
773typedef struct VBOXIDTE64_TRAPGATE
774{
775 /** Low offset word. */
776 unsigned u16OffsetLow : 16;
777 /** Segment Selector. */
778 unsigned u16SegSel : 16;
779 /** Interrupt Stack Table Index. */
780 unsigned u3Ist : 3;
781 /** Fixed value bit 0 - Set to 0. */
782 unsigned u1Fixed0 : 1;
783 /** Fixed value bit 1 - Set to 0. */
784 unsigned u1Fixed1 : 1;
785 /** Fixed value bit 2 - Set to 0. */
786 unsigned u1Fixed2 : 1;
787 /** Fixed value bit 3 - Set to 0. */
788 unsigned u1Fixed3 : 1;
789 /** Fixed value bit 4 - Set to 0. */
790 unsigned u1Fixed4 : 1;
791 /** Fixed value bit 5 - Set to 1. */
792 unsigned u1Fixed5 : 1;
793 /** Fixed value bit 6 - Set to 1. */
794 unsigned u1Fixed6 : 1;
795 /** Fixed value bit 7 - Set to 1. */
796 unsigned u1Fixed7 : 1;
797 /** Gate size, 1 = 32 bits, 0 = 16 bits. */
798 unsigned u132BitGate : 1;
799 /** Fixed value bit 5 - Set to 0. */
800 unsigned u1Fixed8 : 1;
801 /** Descriptor Privilege level. */
802 unsigned u2DPL : 2;
803 /** Present flag. */
804 unsigned u1Present : 1;
805 /** High offset word. */
806 unsigned u16OffsetHigh : 16;
807 /** Offset bits 32..63. */
808 unsigned u32OffsetHigh64;
809 /** Reserved. */
810 unsigned u32Reserved;
811} VBOXIDTE64_TRAPGATE;
812#pragma pack()
813/** Pointer to IDT Entry, 64-bit mode, Trap gate view. */
814typedef VBOXIDTE64_TRAPGATE *PVBOXIDTE64_TRAPGATE;
815
816/** IDT Entry, 64-bit mode, Generic view. */
817#pragma pack(1) /* paranoia */
818typedef struct VBOXIDTE64_GENERIC
819{
820 /** Low offset word. */
821 unsigned u16OffsetLow : 16;
822 /** Segment Selector. */
823 unsigned u16SegSel : 16;
824 /** Reserved. */
825 unsigned u3Ist : 3;
826 /** Fixed value bit 0 - Set to 0. */
827 unsigned u1Fixed0 : 1;
828 /** Fixed value bit 1 - Set to 0. */
829 unsigned u1Fixed1 : 1;
830 /** IDT Type part one (not used for task gate). */
831 unsigned u3Type1 : 3;
832 /** IDT Type part two. */
833 unsigned u5Type2 : 5;
834 /** Descriptor Privilege level. */
835 unsigned u2DPL : 2;
836 /** Present flag. */
837 unsigned u1Present : 1;
838 /** High offset word. */
839 unsigned u16OffsetHigh : 16;
840 /** Offset bits 32..63. */
841 unsigned u32OffsetHigh64;
842 /** Reserved. */
843 unsigned u32Reserved;
844} VBOXIDTE64_GENERIC;
845#pragma pack()
846/** Pointer to IDT Entry, 64-bit mode, Generic view. */
847typedef VBOXIDTE64_GENERIC *PVBOXIDTE64_GENERIC;
848
849/** IDT Entry, 64-bit mode. */
850#pragma pack(1) /* paranoia */
851typedef union VBOXIDTE64
852{
853 /** Trap gate view. */
854 VBOXIDTE64_TRAPGATE Trap;
855 /** Interrupt gate view. */
856 VBOXIDTE64_INTERRUPTGATE Int;
857 /** Generic IDT view. */
858 VBOXIDTE64_GENERIC Gen;
859
860 /** 8 bit unsigned integer view. */
861 uint8_t au8[16];
862 /** 16 bit unsigned integer view. */
863 uint16_t au16[8];
864 /** 32 bit unsigned integer view. */
865 uint32_t au32[4];
866 /** 64 bit unsigned integer view. */
867 uint64_t au64[2];
868} VBOXIDTE64;
869#pragma pack()
870/** Pointer to IDT Entry. */
871typedef VBOXIDTE64 *PVBOXIDTE64;
872/** Pointer to IDT Entry. */
873typedef VBOXIDTE64 const *PCVBOXIDTE64;
874
875#pragma pack(1)
876/** IDTR */
877typedef struct VBOXIDTR
878{
879 /** Size of the IDT. */
880 uint16_t cbIdt;
881 /** Address of the IDT. */
882 uint64_t pIdt;
883} VBOXIDTR, *PVBOXIDTR;
884#pragma pack()
885
886
887/** @def VBOXIDTE_OFFSET
888 * Return the offset of an IDT entry.
889 */
890#define VBOXIDTE_OFFSET(desc) \
891 ( ((uint32_t)((desc).Gen.u16OffsetHigh) << 16) \
892 | ( (desc).Gen.u16OffsetLow ) )
893
894/** @def VBOXIDTE64_OFFSET
895 * Return the offset of an IDT entry.
896 */
897#define VBOXIDTE64_OFFSET(desc) \
898 ( ((uint64_t)((desc).Gen.u32OffsetHigh64) << 32) \
899 | ((uint32_t)((desc).Gen.u16OffsetHigh) << 16) \
900 | ( (desc).Gen.u16OffsetLow ) )
901
902#pragma pack(1)
903/** GDTR */
904typedef struct VBOXGDTR
905{
906 /** Size of the GDT. */
907 uint16_t cbGdt;
908 /** Address of the GDT. */
909 uint64_t pGdt;
910} VBOXGDTR;
911#pragma pack()
912/** Pointer to GDTR. */
913typedef VBOXGDTR *PVBOXGDTR;
914
915/** @} */
916
917
918/**
919 * 32-bit Task Segment used in raw mode.
920 * @todo Move this to SELM! Use X86TSS32 instead.
921 */
922#pragma pack(1)
923typedef struct VBOXTSS
924{
925 /** 0x00 - Back link to previous task. (static) */
926 RTSEL selPrev;
927 uint16_t padding1;
928 /** 0x04 - Ring-0 stack pointer. (static) */
929 uint32_t esp0;
930 /** 0x08 - Ring-0 stack segment. (static) */
931 RTSEL ss0;
932 uint16_t padding_ss0;
933 /** 0x0c - Ring-1 stack pointer. (static) */
934 uint32_t esp1;
935 /** 0x10 - Ring-1 stack segment. (static) */
936 RTSEL ss1;
937 uint16_t padding_ss1;
938 /** 0x14 - Ring-2 stack pointer. (static) */
939 uint32_t esp2;
940 /** 0x18 - Ring-2 stack segment. (static) */
941 RTSEL ss2;
942 uint16_t padding_ss2;
943 /** 0x1c - Page directory for the task. (static) */
944 uint32_t cr3;
945 /** 0x20 - EIP before task switch. */
946 uint32_t eip;
947 /** 0x24 - EFLAGS before task switch. */
948 uint32_t eflags;
949 /** 0x28 - EAX before task switch. */
950 uint32_t eax;
951 /** 0x2c - ECX before task switch. */
952 uint32_t ecx;
953 /** 0x30 - EDX before task switch. */
954 uint32_t edx;
955 /** 0x34 - EBX before task switch. */
956 uint32_t ebx;
957 /** 0x38 - ESP before task switch. */
958 uint32_t esp;
959 /** 0x3c - EBP before task switch. */
960 uint32_t ebp;
961 /** 0x40 - ESI before task switch. */
962 uint32_t esi;
963 /** 0x44 - EDI before task switch. */
964 uint32_t edi;
965 /** 0x48 - ES before task switch. */
966 RTSEL es;
967 uint16_t padding_es;
968 /** 0x4c - CS before task switch. */
969 RTSEL cs;
970 uint16_t padding_cs;
971 /** 0x50 - SS before task switch. */
972 RTSEL ss;
973 uint16_t padding_ss;
974 /** 0x54 - DS before task switch. */
975 RTSEL ds;
976 uint16_t padding_ds;
977 /** 0x58 - FS before task switch. */
978 RTSEL fs;
979 uint16_t padding_fs;
980 /** 0x5c - GS before task switch. */
981 RTSEL gs;
982 uint16_t padding_gs;
983 /** 0x60 - LDTR before task switch. */
984 RTSEL selLdt;
985 uint16_t padding_ldt;
986 /** 0x64 - Debug trap flag */
987 uint16_t fDebugTrap;
988 /** 0x66 - Offset relative to the TSS of the start of the I/O Bitmap
989 * and the end of the interrupt redirection bitmap. */
990 uint16_t offIoBitmap;
991 /** 0x68 - 32 bytes for the virtual interrupt redirection bitmap. (VME) */
992 uint8_t IntRedirBitmap[32];
993} VBOXTSS;
994#pragma pack()
995/** Pointer to task segment. */
996typedef VBOXTSS *PVBOXTSS;
997/** Pointer to const task segment. */
998typedef const VBOXTSS *PCVBOXTSS;
999
1000
1001/** Pointer to a callback method table provided by the VM API user. */
1002typedef struct VMM2USERMETHODS const *PCVMM2USERMETHODS;
1003
1004
1005/**
1006 * Data transport buffer (scatter/gather)
1007 */
1008typedef struct PDMDATASEG
1009{
1010 /** Length of buffer in entry. */
1011 size_t cbSeg;
1012 /** Pointer to the start of the buffer. */
1013 void *pvSeg;
1014} PDMDATASEG;
1015/** Pointer to a data transport segment. */
1016typedef PDMDATASEG *PPDMDATASEG;
1017/** Pointer to a const data transport segment. */
1018typedef PDMDATASEG const *PCPDMDATASEG;
1019
1020
1021/**
1022 * Forms of generic segment offloading.
1023 */
1024typedef enum PDMNETWORKGSOTYPE
1025{
1026 /** Invalid zero value. */
1027 PDMNETWORKGSOTYPE_INVALID = 0,
1028 /** TCP/IPv4 - no CWR/ECE encoding. */
1029 PDMNETWORKGSOTYPE_IPV4_TCP,
1030 /** TCP/IPv6 - no CWR/ECE encoding. */
1031 PDMNETWORKGSOTYPE_IPV6_TCP,
1032 /** UDP/IPv4. */
1033 PDMNETWORKGSOTYPE_IPV4_UDP,
1034 /** UDP/IPv6. */
1035 PDMNETWORKGSOTYPE_IPV6_UDP,
1036 /** TCP/IPv6 over IPv4 tunneling - no CWR/ECE encoding.
1037 * The header offsets and sizes relates to IPv4 and TCP, the IPv6 header is
1038 * figured out as needed.
1039 * @todo Needs checking against facts, this is just an outline of the idea. */
1040 PDMNETWORKGSOTYPE_IPV4_IPV6_TCP,
1041 /** UDP/IPv6 over IPv4 tunneling.
1042 * The header offsets and sizes relates to IPv4 and UDP, the IPv6 header is
1043 * figured out as needed.
1044 * @todo Needs checking against facts, this is just an outline of the idea. */
1045 PDMNETWORKGSOTYPE_IPV4_IPV6_UDP,
1046 /** The end of valid GSO types. */
1047 PDMNETWORKGSOTYPE_END
1048} PDMNETWORKGSOTYPE;
1049
1050
1051/**
1052 * Generic segment offloading context.
1053 *
1054 * We generally follow the E1000 specs wrt to which header fields we change.
1055 * However the GSO type implies where the checksum fields are and that they are
1056 * always updated from scratch (no half done pseudo checksums).
1057 *
1058 * @remarks This is part of the internal network GSO packets. Take great care
1059 * when making changes. The size is expected to be exactly 8 bytes.
1060 *
1061 * @ingroup grp_pdm
1062 */
1063typedef struct PDMNETWORKGSO
1064{
1065 /** The type of segmentation offloading we're performing (PDMNETWORKGSOTYPE). */
1066 uint8_t u8Type;
1067 /** The total header size. */
1068 uint8_t cbHdrsTotal;
1069 /** The max segment size (MSS) to apply. */
1070 uint16_t cbMaxSeg;
1071
1072 /** Offset of the first header (IPv4 / IPv6). 0 if not not needed. */
1073 uint8_t offHdr1;
1074 /** Offset of the second header (TCP / UDP). 0 if not not needed. */
1075 uint8_t offHdr2;
1076 /** The header size used for segmentation (equal to offHdr2 in UFO). */
1077 uint8_t cbHdrsSeg;
1078 /** Unused. */
1079 uint8_t u8Unused;
1080} PDMNETWORKGSO;
1081/** Pointer to a GSO context.
1082 * @ingroup grp_pdm */
1083typedef PDMNETWORKGSO *PPDMNETWORKGSO;
1084/** Pointer to a const GSO context.
1085 * @ingroup grp_pdm */
1086typedef PDMNETWORKGSO const *PCPDMNETWORKGSO;
1087
1088/** Pointer to a PDM filter handle.
1089 * @ingroup grp_pdm_net_shaper */
1090typedef struct PDMNSFILTER *PPDMNSFILTER;
1091/** Pointer to a network shaper.
1092 * @ingroup grp_pdm_net_shaper */
1093typedef struct PDMNETSHAPER *PPDMNETSHAPER;
1094
1095
1096/**
1097 * The current ROM page protection.
1098 *
1099 * @remarks This is part of the saved state.
1100 * @ingroup grp_pgm
1101 */
1102typedef enum PGMROMPROT
1103{
1104 /** The customary invalid value. */
1105 PGMROMPROT_INVALID = 0,
1106 /** Read from the virgin ROM page, ignore writes.
1107 * Map the virgin page, use write access handler to ignore writes. */
1108 PGMROMPROT_READ_ROM_WRITE_IGNORE,
1109 /** Read from the virgin ROM page, write to the shadow RAM.
1110 * Map the virgin page, use write access handler to change the shadow RAM. */
1111 PGMROMPROT_READ_ROM_WRITE_RAM,
1112 /** Read from the shadow ROM page, ignore writes.
1113 * Map the shadow page read-only, use write access handler to ignore writes. */
1114 PGMROMPROT_READ_RAM_WRITE_IGNORE,
1115 /** Read from the shadow ROM page, ignore writes.
1116 * Map the shadow page read-write, disabled write access handler. */
1117 PGMROMPROT_READ_RAM_WRITE_RAM,
1118 /** The end of valid values. */
1119 PGMROMPROT_END,
1120 /** The usual 32-bit type size hack. */
1121 PGMROMPROT_32BIT_HACK = 0x7fffffff
1122} PGMROMPROT;
1123
1124
1125/**
1126 * Page mapping lock.
1127 * @ingroup grp_pgm
1128 */
1129typedef struct PGMPAGEMAPLOCK
1130{
1131#if defined(IN_RC)
1132 /** The locked page. */
1133 void *pvPage;
1134 /** Pointer to the CPU that made the mapping.
1135 * In ring-0 and raw-mode context we don't intend to ever allow long term
1136 * locking and this is a way of making sure we're still on the same CPU. */
1137 PVMCPU pVCpu;
1138#else
1139 /** Pointer to the PGMPAGE and lock type.
1140 * bit-0 abuse: set=write, clear=read. */
1141 uintptr_t uPageAndType;
1142/** Read lock type value. */
1143# define PGMPAGEMAPLOCK_TYPE_READ ((uintptr_t)0)
1144/** Write lock type value. */
1145# define PGMPAGEMAPLOCK_TYPE_WRITE ((uintptr_t)1)
1146/** Lock type mask. */
1147# define PGMPAGEMAPLOCK_TYPE_MASK ((uintptr_t)1)
1148 /** Pointer to the PGMCHUNKR3MAP. */
1149 void *pvMap;
1150#endif
1151} PGMPAGEMAPLOCK;
1152/** Pointer to a page mapping lock.
1153 * @ingroup grp_pgm */
1154typedef PGMPAGEMAPLOCK *PPGMPAGEMAPLOCK;
1155
1156
1157/** Pointer to a info helper callback structure. */
1158typedef struct DBGFINFOHLP *PDBGFINFOHLP;
1159/** Pointer to a const info helper callback structure. */
1160typedef const struct DBGFINFOHLP *PCDBGFINFOHLP;
1161
1162/** Pointer to a const register descriptor. */
1163typedef struct DBGFREGDESC const *PCDBGFREGDESC;
1164
1165
1166/** Configuration manager tree node - A key. */
1167typedef struct CFGMNODE *PCFGMNODE;
1168
1169/** Configuration manager tree leaf - A value. */
1170typedef struct CFGMLEAF *PCFGMLEAF;
1171
1172
1173/**
1174 * CPU modes.
1175 */
1176typedef enum CPUMMODE
1177{
1178 /** The usual invalid zero entry. */
1179 CPUMMODE_INVALID = 0,
1180 /** Real mode. */
1181 CPUMMODE_REAL,
1182 /** Protected mode (32-bit). */
1183 CPUMMODE_PROTECTED,
1184 /** Long mode (64-bit). */
1185 CPUMMODE_LONG
1186} CPUMMODE;
1187
1188
1189/**
1190 * CPU mode flags (DISSTATE::mode).
1191 */
1192typedef enum DISCPUMODE
1193{
1194 DISCPUMODE_INVALID = 0,
1195 DISCPUMODE_16BIT,
1196 DISCPUMODE_32BIT,
1197 DISCPUMODE_64BIT,
1198 /** hack forcing the size of the enum to 32-bits. */
1199 DISCPUMODE_MAKE_32BIT_HACK = 0x7fffffff
1200} DISCPUMODE;
1201
1202/** Pointer to the disassembler state. */
1203typedef struct DISSTATE *PDISSTATE;
1204/** Pointer to a const disassembler state. */
1205typedef struct DISSTATE const *PCDISSTATE;
1206
1207/** @deprecated PDISSTATE and change pCpu and pDisState to pDis. */
1208typedef PDISSTATE PDISCPUSTATE;
1209/** @deprecated PCDISSTATE and change pCpu and pDisState to pDis. */
1210typedef PCDISSTATE PCDISCPUSTATE;
1211
1212
1213/**
1214 * Shared region description (needed by GMM and others, thus global).
1215 * @ingroup grp_vmmdev
1216 */
1217typedef struct VMMDEVSHAREDREGIONDESC
1218{
1219 RTGCPTR64 GCRegionAddr;
1220 uint32_t cbRegion;
1221 uint32_t u32Alignment;
1222} VMMDEVSHAREDREGIONDESC;
1223
1224
1225/**
1226 * A PCI bus:device:function (BDF) identifier.
1227 *
1228 * All 16 bits of a BDF are valid according to the PCI spec. We need one extra bit
1229 * to determine whether the BDF is valid in interfaces where the BDF may be
1230 * optional.
1231 */
1232typedef uint32_t PCIBDF;
1233/** PCIBDF flag: Invalid. */
1234#define PCI_BDF_F_INVALID RT_BIT(31)
1235/** Nil PCIBDF value. */
1236#define NIL_PCIBDF PCI_BDF_F_INVALID
1237
1238/** Pointer to an MSI message struct. */
1239typedef struct MSIMSG *PMSIMSG;
1240/** Pointer to a const MSI message struct. */
1241typedef const struct MSIMSG *PCMSIMSG;
1242
1243
1244/** @} */
1245
1246#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