VirtualBox

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

Last change on this file since 90347 was 89622, checked in by vboxsync, 4 years ago

VMM/DBGFR3SampleReport: Some prototype code to allow creating guest sample reports in order to get more insight into what a guest is doing, bugref:10025

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