VirtualBox

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

Last change on this file since 107558 was 107200, checked in by vboxsync, 2 months ago

VMM/IEM: Deal with hidden pointer to VBOXSTRICTRC return struct on win.arm64. jiraref:VBP-1466

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