VirtualBox

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

最後變更 在這個檔案是 107893,由 vboxsync 提交於 7 週 前

VMM,VBox/types.h,VBox/err.h: Added VM target platform arch members to the VM structures (mostly for ring-0). Also added the structure sizes and svn revision to VMMR0_DO_GVMM_CREATE_VM. jiraref:VBP-1470

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 40.2 KB
 
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.alldomusa.eu.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
271/** The VM target platform architecture. */
272typedef enum VMTARGET
273{
274 VMTARGET_INVALID = 0,
275 VMTARGET_X86 = 0x8086,
276 VMTARGET_ARMV8 = 0xaa64
277} VMTARGET;
278
279/** @def VMTARGET_DEFAULT
280 * The default target according to the VBOX_VMM_TARGET_X86 /
281 * VBOX_VMM_TARGET_ARMV8 defines. */
282#if defined(VBOX_VMM_TARGET_X86) || defined(DOXYGEN_RUNNING)
283# define VMTARGET_DEFAULT VMTARGET_X86
284#elif defined(VBOX_VMM_TARGET_ARMV8)
285# define VMTARGET_DEFAULT VMTARGET_ARMV8
286#endif
287
288
289/** We need RTERR_STRICT_RC. */
290#if defined(VBOXSTRICTRC_STRICT_ENABLED) && !defined(RTERR_STRICT_RC)
291# define RTERR_STRICT_RC 1
292#endif
293
294/**
295 * Strict VirtualBox status code.
296 *
297 * This is normally an 32-bit integer and the only purpose of the type is to
298 * highlight the special handling that is required. But in strict build it is a
299 * class that causes compilation and runtime errors for some of the incorrect
300 * handling.
301 */
302#ifdef VBOXSTRICTRC_STRICT_ENABLED
303struct VBOXSTRICTRC
304{
305protected:
306 /** The status code. */
307 int32_t m_rc;
308
309public:
310 /** Default constructor setting the status to VERR_IPE_UNINITIALIZED_STATUS. */
311 VBOXSTRICTRC()
312#ifdef VERR_IPE_UNINITIALIZED_STATUS
313 : m_rc(VERR_IPE_UNINITIALIZED_STATUS)
314#else
315 : m_rc(-233 /*VERR_IPE_UNINITIALIZED_STATUS*/)
316#endif
317 {
318 }
319
320 /** Constructor for normal integer status codes. */
321 VBOXSTRICTRC(int32_t const rc)
322 : m_rc(rc)
323 {
324 }
325
326 /** Getter that VBOXSTRICTRC_VAL can use. */
327 int32_t getValue() const { return m_rc; }
328
329 /** @name Comparison operators
330 * @{ */
331 bool operator==(int32_t rc) const { return m_rc == rc; }
332 bool operator!=(int32_t rc) const { return m_rc != rc; }
333 bool operator<=(int32_t rc) const { return m_rc <= rc; }
334 bool operator>=(int32_t rc) const { return m_rc >= rc; }
335 bool operator<(int32_t rc) const { return m_rc < rc; }
336 bool operator>(int32_t rc) const { return m_rc > rc; }
337
338 bool operator==(const VBOXSTRICTRC &rRc) const { return m_rc == rRc.m_rc; }
339 bool operator!=(const VBOXSTRICTRC &rRc) const { return m_rc != rRc.m_rc; }
340 bool operator<=(const VBOXSTRICTRC &rRc) const { return m_rc <= rRc.m_rc; }
341 bool operator>=(const VBOXSTRICTRC &rRc) const { return m_rc >= rRc.m_rc; }
342 bool operator<(const VBOXSTRICTRC &rRc) const { return m_rc < rRc.m_rc; }
343 bool operator>(const VBOXSTRICTRC &rRc) const { return m_rc > rRc.m_rc; }
344 /** @} */
345
346 /** Special automatic cast for RT_SUCCESS_NP. */
347 operator RTErrStrictType2() const { return RTErrStrictType2(m_rc); }
348
349private:
350 /** @name Constructors that will prevent some of the bad types.
351 * @{ */
352 VBOXSTRICTRC(uint8_t rc) : m_rc(-999) { NOREF(rc); }
353 VBOXSTRICTRC(uint16_t rc) : m_rc(-999) { NOREF(rc); }
354 VBOXSTRICTRC(uint32_t rc) : m_rc(-999) { NOREF(rc); }
355 VBOXSTRICTRC(uint64_t rc) : m_rc(-999) { NOREF(rc); }
356
357 VBOXSTRICTRC(int8_t rc) : m_rc(-999) { NOREF(rc); }
358 VBOXSTRICTRC(int16_t rc) : m_rc(-999) { NOREF(rc); }
359 VBOXSTRICTRC(int64_t rc) : m_rc(-999) { NOREF(rc); }
360 /** @} */
361};
362# ifdef _MSC_VER
363# pragma warning(disable:4190)
364# endif
365#else
366typedef int32_t VBOXSTRICTRC;
367#endif
368
369/** @def VBOXSTRICTRC_VAL
370 * Explicit getter.
371 * @param rcStrict The strict VirtualBox status code.
372 */
373#ifdef VBOXSTRICTRC_STRICT_ENABLED
374# define VBOXSTRICTRC_VAL(rcStrict) ( (rcStrict).getValue() )
375#else
376# define VBOXSTRICTRC_VAL(rcStrict) (rcStrict)
377#endif
378
379/** @def VBOXSTRICTRC_TODO
380 * Returns that needs dealing with.
381 * @param rcStrict The strict VirtualBox status code.
382 */
383#define VBOXSTRICTRC_TODO(rcStrict) VBOXSTRICTRC_VAL(rcStrict)
384
385
386/** A cross context I/O port range handle. */
387typedef uint64_t IOMIOPORTHANDLE;
388/** Pointer to a cross context I/O port handle. */
389typedef IOMIOPORTHANDLE *PIOMIOPORTHANDLE;
390/** A NIL I/O port handle. */
391#define NIL_IOMIOPORTHANDLE ((uint64_t)UINT64_MAX)
392
393/** A cross context MMIO range handle. */
394typedef uint64_t IOMMMIOHANDLE;
395/** Pointer to a cross context MMIO handle. */
396typedef IOMMMIOHANDLE *PIOMMMIOHANDLE;
397/** A NIL MMIO handle. */
398#define NIL_IOMMMIOHANDLE ((uint64_t)UINT64_MAX)
399
400/** A cross context MMIO2 range handle. */
401typedef uint64_t PGMMMIO2HANDLE;
402/** Pointer to a cross context MMIO2 handle. */
403typedef PGMMMIO2HANDLE *PPGMMMIO2HANDLE;
404/** A NIL MMIO2 handle. */
405#define NIL_PGMMMIO2HANDLE ((uint64_t)UINT64_MAX)
406
407/** Pointer to a PDM Base Interface. */
408typedef struct PDMIBASE *PPDMIBASE;
409/** Pointer to a pointer to a PDM Base Interface. */
410typedef PPDMIBASE *PPPDMIBASE;
411
412/** Pointer to a PDM device instance for the current context. */
413#ifdef IN_RING3
414typedef struct PDMDEVINSR3 *PPDMDEVINS;
415#elif defined(IN_RING0) || defined(DOXYGEN_RUNNING)
416typedef struct PDMDEVINSR0 *PPDMDEVINS;
417#else
418typedef struct PDMDEVINSRC *PPDMDEVINS;
419#endif
420/** Pointer to a pointer a PDM device instance for the current context. */
421typedef PPDMDEVINS *PPPDMDEVINS;
422/** R3 pointer to a PDM device instance. */
423typedef R3PTRTYPE(struct PDMDEVINSR3 *) PPDMDEVINSR3;
424/** R0 pointer to a PDM device instance. */
425typedef R0PTRTYPE(struct PDMDEVINSR0 *) PPDMDEVINSR0;
426/** RC pointer to a PDM device instance. */
427typedef RCPTRTYPE(struct PDMDEVINSRC *) PPDMDEVINSRC;
428
429/** Pointer to a PDM PCI device structure. */
430typedef struct PDMPCIDEV *PPDMPCIDEV;
431/** Pointer to a const PDM PCI device structure. */
432typedef const struct PDMPCIDEV *PCPDMPCIDEV;
433
434/** Pointer to a PDM USB Device Instance. */
435typedef struct PDMUSBINS *PPDMUSBINS;
436/** Pointer to a pointer to a PDM USB Device Instance. */
437typedef PPDMUSBINS *PPPDMUSBINS;
438
439/** Pointer to a PDM Driver Instance. */
440typedef struct PDMDRVINS *PPDMDRVINS;
441/** Pointer to a pointer to a PDM Driver Instance. */
442typedef PPDMDRVINS *PPPDMDRVINS;
443/** R3 pointer to a PDM Driver Instance. */
444typedef R3PTRTYPE(PPDMDRVINS) PPDMDRVINSR3;
445/** R0 pointer to a PDM Driver Instance. */
446typedef R0PTRTYPE(PPDMDRVINS) PPDMDRVINSR0;
447/** RC pointer to a PDM Driver Instance. */
448typedef RCPTRTYPE(PPDMDRVINS) PPDMDRVINSRC;
449
450/** Pointer to a PDM Service Instance. */
451typedef struct PDMSRVINS *PPDMSRVINS;
452/** Pointer to a pointer to a PDM Service Instance. */
453typedef PPDMSRVINS *PPPDMSRVINS;
454
455/** Pointer to a PDM critical section. */
456typedef union PDMCRITSECT *PPDMCRITSECT;
457/** Pointer to a const PDM critical section. */
458typedef const union PDMCRITSECT *PCPDMCRITSECT;
459
460/** Pointer to a PDM read/write critical section. */
461typedef union PDMCRITSECTRW *PPDMCRITSECTRW;
462/** Pointer to a const PDM read/write critical section. */
463typedef union PDMCRITSECTRW const *PCPDMCRITSECTRW;
464
465/** PDM queue handle. */
466typedef uint64_t PDMQUEUEHANDLE;
467/** Pointer to a PDM queue handle. */
468typedef PDMQUEUEHANDLE *PPDMQUEUEHANDLE;
469/** NIL PDM queue handle. */
470#define NIL_PDMQUEUEHANDLE ((PDMQUEUEHANDLE)UINT64_MAX)
471
472/** R3 pointer to a timer. */
473typedef R3PTRTYPE(struct TMTIMER *) PTMTIMERR3;
474/** Pointer to a R3 pointer to a timer. */
475typedef PTMTIMERR3 *PPTMTIMERR3;
476
477/** R0 pointer to a timer. */
478typedef R0PTRTYPE(struct TMTIMER *) PTMTIMERR0;
479/** Pointer to a R3 pointer to a timer. */
480typedef PTMTIMERR0 *PPTMTIMERR0;
481
482/** RC pointer to a timer. */
483typedef RCPTRTYPE(struct TMTIMER *) PTMTIMERRC;
484/** Pointer to a RC pointer to a timer. */
485typedef PTMTIMERRC *PPTMTIMERRC;
486
487/** Pointer to a timer. */
488typedef CTX_SUFF(PTMTIMER) PTMTIMER;
489/** Pointer to a pointer to a timer. */
490typedef PTMTIMER *PPTMTIMER;
491
492/** A cross context timer handle. */
493typedef uint64_t TMTIMERHANDLE;
494/** Pointer to a cross context timer handle. */
495typedef TMTIMERHANDLE *PTMTIMERHANDLE;
496/** A NIL timer handle. */
497#define NIL_TMTIMERHANDLE ((uint64_t)UINT64_MAX)
498
499/** SSM Operation handle. */
500typedef struct SSMHANDLE *PSSMHANDLE;
501/** Pointer to a const SSM stream method table. */
502typedef struct SSMSTRMOPS const *PCSSMSTRMOPS;
503
504/** Pointer to a CPUMCTX. */
505typedef struct CPUMCTX *PCPUMCTX;
506/** Pointer to a const CPUMCTX. */
507typedef const struct CPUMCTX *PCCPUMCTX;
508
509/** Pointer to a selector register. */
510typedef struct CPUMSELREG *PCPUMSELREG;
511/** Pointer to a const selector register. */
512typedef const struct CPUMSELREG *PCCPUMSELREG;
513
514/** Pointer to selector hidden registers.
515 * @deprecated Replaced by PCPUMSELREG */
516typedef struct CPUMSELREG *PCPUMSELREGHID;
517/** Pointer to const selector hidden registers.
518 * @deprecated Replaced by PCCPUMSELREG */
519typedef const struct CPUMSELREG *PCCPUMSELREGHID;
520
521/** A cross context DBGF tracer event source handle. */
522typedef uint64_t DBGFTRACEREVTSRC;
523/** Pointer to a cross context DBGF tracer event source handle. */
524typedef DBGFTRACEREVTSRC *PDBGFTRACEREVTSRC;
525/** A NIL DBGF tracer event source handle. */
526#define NIL_DBGFTRACEREVTSRC ((uint64_t)UINT64_MAX)
527
528/** Pointer to a DBGF tracer instance for the current context. */
529#ifdef IN_RING3
530typedef struct DBGFTRACERINSR3 *PDBGFTRACERINSCC;
531#elif defined(IN_RING0) || defined(DOXYGEN_RUNNING)
532typedef struct DBGFTRACERINSR0 *PDBGFTRACERINSCC;
533#else
534typedef struct DBGFTRACERINSRC *PDBGFTRACERINSCC;
535#endif
536/** Pointer to a pointer a DBGF tracer instance for the current context. */
537typedef PDBGFTRACERINSCC *PPDBGFTRACERINSCC;
538/** R3 pointer to a DBGF tracer instance. */
539typedef R3PTRTYPE(struct DBGFTRACERINSR3 *) PDBGFTRACERINSR3;
540/** R0 pointer to a DBGF tracer instance. */
541typedef R0PTRTYPE(struct DBGFTRACERINSR0 *) PDBGFTRACERINSR0;
542/** RC pointer to a DBGF tracer instance. */
543typedef RCPTRTYPE(struct DBGFTRACERINSRC *) PDBGFTRACERINSRC;
544
545/** A cross context DBGF breakpoint owner handle. */
546typedef uint32_t DBGFBPOWNER;
547/** Pointer to a cross context DBGF breakpoint owner handle. */
548typedef DBGFBPOWNER *PDBGFBPOWNER;
549/** A NIL DBGF breakpoint owner handle. */
550#define NIL_DBGFBPOWNER ((uint32_t)UINT32_MAX)
551
552/** A cross context DBGF breakpoint handle. */
553typedef uint32_t DBGFBP;
554/** Pointer to a cross context DBGF breakpoint handle. */
555typedef DBGFBP *PDBGFBP;
556/** A NIL DBGF breakpoint handle. */
557#define NIL_DBGFBP ((uint32_t)UINT32_MAX)
558
559/** A sample report handle. */
560typedef struct DBGFSAMPLEREPORTINT *DBGFSAMPLEREPORT;
561/** Pointer to a sample report handle. */
562typedef DBGFSAMPLEREPORT *PDBGFSAMPLEREPORT;
563/** @} */
564
565
566/** @defgroup grp_types_idt Interrupt Descriptor Table Entry.
567 * @todo This all belongs in x86.h!
568 * @{ */
569
570/** @todo VBOXIDT -> VBOXDESCIDT, skip the complex variations. We'll never use them. */
571
572/** IDT Entry, Task Gate view. */
573#pragma pack(1) /* paranoia */
574typedef struct VBOXIDTE_TASKGATE
575{
576 /** Reserved. */
577 unsigned u16Reserved1 : 16;
578 /** Task Segment Selector. */
579 unsigned u16TSS : 16;
580 /** More reserved. */
581 unsigned u8Reserved2 : 8;
582 /** Fixed value bit 0 - Set to 1. */
583 unsigned u1Fixed0 : 1;
584 /** Busy bit. */
585 unsigned u1Busy : 1;
586 /** Fixed value bit 2 - Set to 1. */
587 unsigned u1Fixed1 : 1;
588 /** Fixed value bit 3 - Set to 0. */
589 unsigned u1Fixed2 : 1;
590 /** Fixed value bit 4 - Set to 0. */
591 unsigned u1Fixed3 : 1;
592 /** Descriptor Privilege level. */
593 unsigned u2DPL : 2;
594 /** Present flag. */
595 unsigned u1Present : 1;
596 /** Reserved. */
597 unsigned u16Reserved3 : 16;
598} VBOXIDTE_TASKGATE;
599#pragma pack()
600/** Pointer to IDT Entry, Task gate view. */
601typedef VBOXIDTE_TASKGATE *PVBOXIDTE_TASKGATE;
602
603
604/** IDT Entry, Intertupt gate view. */
605#pragma pack(1) /* paranoia */
606typedef struct VBOXIDTE_INTERRUPTGATE
607{
608 /** Low offset word. */
609 unsigned u16OffsetLow : 16;
610 /** Segment Selector. */
611 unsigned u16SegSel : 16;
612 /** Reserved. */
613 unsigned u5Reserved2 : 5;
614 /** Fixed value bit 0 - Set to 0. */
615 unsigned u1Fixed0 : 1;
616 /** Fixed value bit 1 - Set to 0. */
617 unsigned u1Fixed1 : 1;
618 /** Fixed value bit 2 - Set to 0. */
619 unsigned u1Fixed2 : 1;
620 /** Fixed value bit 3 - Set to 0. */
621 unsigned u1Fixed3 : 1;
622 /** Fixed value bit 4 - Set to 1. */
623 unsigned u1Fixed4 : 1;
624 /** Fixed value bit 5 - Set to 1. */
625 unsigned u1Fixed5 : 1;
626 /** Gate size, 1 = 32 bits, 0 = 16 bits. */
627 unsigned u132BitGate : 1;
628 /** Fixed value bit 5 - Set to 0. */
629 unsigned u1Fixed6 : 1;
630 /** Descriptor Privilege level. */
631 unsigned u2DPL : 2;
632 /** Present flag. */
633 unsigned u1Present : 1;
634 /** High offset word. */
635 unsigned u16OffsetHigh : 16;
636} VBOXIDTE_INTERRUPTGATE;
637#pragma pack()
638/** Pointer to IDT Entry, Interrupt gate view. */
639typedef VBOXIDTE_INTERRUPTGATE *PVBOXIDTE_INTERRUPTGATE;
640
641/** IDT Entry, Trap Gate view. */
642#pragma pack(1) /* paranoia */
643typedef struct VBOXIDTE_TRAPGATE
644{
645 /** Low offset word. */
646 unsigned u16OffsetLow : 16;
647 /** Segment Selector. */
648 unsigned u16SegSel : 16;
649 /** Reserved. */
650 unsigned u5Reserved2 : 5;
651 /** Fixed value bit 0 - Set to 0. */
652 unsigned u1Fixed0 : 1;
653 /** Fixed value bit 1 - Set to 0. */
654 unsigned u1Fixed1 : 1;
655 /** Fixed value bit 2 - Set to 0. */
656 unsigned u1Fixed2 : 1;
657 /** Fixed value bit 3 - Set to 1. */
658 unsigned u1Fixed3 : 1;
659 /** Fixed value bit 4 - Set to 1. */
660 unsigned u1Fixed4 : 1;
661 /** Fixed value bit 5 - Set to 1. */
662 unsigned u1Fixed5 : 1;
663 /** Gate size, 1 = 32 bits, 0 = 16 bits. */
664 unsigned u132BitGate : 1;
665 /** Fixed value bit 5 - Set to 0. */
666 unsigned u1Fixed6 : 1;
667 /** Descriptor Privilege level. */
668 unsigned u2DPL : 2;
669 /** Present flag. */
670 unsigned u1Present : 1;
671 /** High offset word. */
672 unsigned u16OffsetHigh : 16;
673} VBOXIDTE_TRAPGATE;
674#pragma pack()
675/** Pointer to IDT Entry, Trap Gate view. */
676typedef VBOXIDTE_TRAPGATE *PVBOXIDTE_TRAPGATE;
677
678/** IDT Entry Generic view. */
679#pragma pack(1) /* paranoia */
680typedef struct VBOXIDTE_GENERIC
681{
682 /** Low offset word. */
683 unsigned u16OffsetLow : 16;
684 /** Segment Selector. */
685 unsigned u16SegSel : 16;
686 /** Reserved. */
687 unsigned u5Reserved : 5;
688 /** IDT Type part one (not used for task gate). */
689 unsigned u3Type1 : 3;
690 /** IDT Type part two. */
691 unsigned u5Type2 : 5;
692 /** Descriptor Privilege level. */
693 unsigned u2DPL : 2;
694 /** Present flag. */
695 unsigned u1Present : 1;
696 /** High offset word. */
697 unsigned u16OffsetHigh : 16;
698} VBOXIDTE_GENERIC;
699#pragma pack()
700/** Pointer to IDT Entry Generic view. */
701typedef VBOXIDTE_GENERIC *PVBOXIDTE_GENERIC;
702
703/** IDT Type1 value. (Reserved for task gate!) */
704#define VBOX_IDTE_TYPE1 0
705/** IDT Type2 value - Task gate. */
706#define VBOX_IDTE_TYPE2_TASK 0x5
707/** IDT Type2 value - 16 bit interrupt gate. */
708#define VBOX_IDTE_TYPE2_INT_16 0x6
709/** IDT Type2 value - 32 bit interrupt gate. */
710#define VBOX_IDTE_TYPE2_INT_32 0xe
711/** IDT Type2 value - 16 bit trap gate. */
712#define VBOX_IDTE_TYPE2_TRAP_16 0x7
713/** IDT Type2 value - 32 bit trap gate. */
714#define VBOX_IDTE_TYPE2_TRAP_32 0xf
715
716/** IDT Entry. */
717#pragma pack(1) /* paranoia */
718typedef union VBOXIDTE
719{
720 /** Task gate view. */
721 VBOXIDTE_TASKGATE Task;
722 /** Trap gate view. */
723 VBOXIDTE_TRAPGATE Trap;
724 /** Interrupt gate view. */
725 VBOXIDTE_INTERRUPTGATE Int;
726 /** Generic IDT view. */
727 VBOXIDTE_GENERIC Gen;
728
729 /** 8 bit unsigned integer view. */
730 uint8_t au8[8];
731 /** 16 bit unsigned integer view. */
732 uint16_t au16[4];
733 /** 32 bit unsigned integer view. */
734 uint32_t au32[2];
735 /** 64 bit unsigned integer view. */
736 uint64_t au64;
737} VBOXIDTE;
738#pragma pack()
739/** Pointer to IDT Entry. */
740typedef VBOXIDTE *PVBOXIDTE;
741/** Pointer to IDT Entry. */
742typedef VBOXIDTE const *PCVBOXIDTE;
743
744/** IDT Entry, 64-bit mode, Intertupt gate view. */
745#pragma pack(1) /* paranoia */
746typedef struct VBOXIDTE64_INTERRUPTGATE
747{
748 /** Low offset word. */
749 unsigned u16OffsetLow : 16;
750 /** Segment Selector. */
751 unsigned u16SegSel : 16;
752 /** Interrupt Stack Table Index. */
753 unsigned u3Ist : 3;
754 /** Fixed value bit 0 - Set to 0. */
755 unsigned u1Fixed0 : 1;
756 /** Fixed value bit 1 - Set to 0. */
757 unsigned u1Fixed1 : 1;
758 /** Fixed value bit 2 - Set to 0. */
759 unsigned u1Fixed2 : 1;
760 /** Fixed value bit 3 - Set to 0. */
761 unsigned u1Fixed3 : 1;
762 /** Fixed value bit 4 - Set to 0. */
763 unsigned u1Fixed4 : 1;
764 /** Fixed value bit 5 - Set to 0. */
765 unsigned u1Fixed5 : 1;
766 /** Fixed value bit 6 - Set to 1. */
767 unsigned u1Fixed6 : 1;
768 /** Fixed value bit 7 - Set to 1. */
769 unsigned u1Fixed7 : 1;
770 /** Gate size, 1 = 32 bits, 0 = 16 bits. */
771 unsigned u132BitGate : 1;
772 /** Fixed value bit 5 - Set to 0. */
773 unsigned u1Fixed8 : 1;
774 /** Descriptor Privilege level. */
775 unsigned u2DPL : 2;
776 /** Present flag. */
777 unsigned u1Present : 1;
778 /** High offset word. */
779 unsigned u16OffsetHigh : 16;
780 /** Offset bits 32..63. */
781 unsigned u32OffsetHigh64;
782 /** Reserved. */
783 unsigned u32Reserved;
784} VBOXIDTE64_INTERRUPTGATE;
785#pragma pack()
786/** Pointer to IDT Entry, 64-bit mode, Interrupt gate view. */
787typedef VBOXIDTE64_INTERRUPTGATE *PVBOXIDTE64_INTERRUPTGATE;
788
789/** IDT Entry, 64-bit mode, Trap gate view. */
790#pragma pack(1) /* paranoia */
791typedef struct VBOXIDTE64_TRAPGATE
792{
793 /** Low offset word. */
794 unsigned u16OffsetLow : 16;
795 /** Segment Selector. */
796 unsigned u16SegSel : 16;
797 /** Interrupt Stack Table Index. */
798 unsigned u3Ist : 3;
799 /** Fixed value bit 0 - Set to 0. */
800 unsigned u1Fixed0 : 1;
801 /** Fixed value bit 1 - Set to 0. */
802 unsigned u1Fixed1 : 1;
803 /** Fixed value bit 2 - Set to 0. */
804 unsigned u1Fixed2 : 1;
805 /** Fixed value bit 3 - Set to 0. */
806 unsigned u1Fixed3 : 1;
807 /** Fixed value bit 4 - Set to 0. */
808 unsigned u1Fixed4 : 1;
809 /** Fixed value bit 5 - Set to 1. */
810 unsigned u1Fixed5 : 1;
811 /** Fixed value bit 6 - Set to 1. */
812 unsigned u1Fixed6 : 1;
813 /** Fixed value bit 7 - Set to 1. */
814 unsigned u1Fixed7 : 1;
815 /** Gate size, 1 = 32 bits, 0 = 16 bits. */
816 unsigned u132BitGate : 1;
817 /** Fixed value bit 5 - Set to 0. */
818 unsigned u1Fixed8 : 1;
819 /** Descriptor Privilege level. */
820 unsigned u2DPL : 2;
821 /** Present flag. */
822 unsigned u1Present : 1;
823 /** High offset word. */
824 unsigned u16OffsetHigh : 16;
825 /** Offset bits 32..63. */
826 unsigned u32OffsetHigh64;
827 /** Reserved. */
828 unsigned u32Reserved;
829} VBOXIDTE64_TRAPGATE;
830#pragma pack()
831/** Pointer to IDT Entry, 64-bit mode, Trap gate view. */
832typedef VBOXIDTE64_TRAPGATE *PVBOXIDTE64_TRAPGATE;
833
834/** IDT Entry, 64-bit mode, Generic view. */
835#pragma pack(1) /* paranoia */
836typedef struct VBOXIDTE64_GENERIC
837{
838 /** Low offset word. */
839 unsigned u16OffsetLow : 16;
840 /** Segment Selector. */
841 unsigned u16SegSel : 16;
842 /** Reserved. */
843 unsigned u3Ist : 3;
844 /** Fixed value bit 0 - Set to 0. */
845 unsigned u1Fixed0 : 1;
846 /** Fixed value bit 1 - Set to 0. */
847 unsigned u1Fixed1 : 1;
848 /** IDT Type part one (not used for task gate). */
849 unsigned u3Type1 : 3;
850 /** IDT Type part two. */
851 unsigned u5Type2 : 5;
852 /** Descriptor Privilege level. */
853 unsigned u2DPL : 2;
854 /** Present flag. */
855 unsigned u1Present : 1;
856 /** High offset word. */
857 unsigned u16OffsetHigh : 16;
858 /** Offset bits 32..63. */
859 unsigned u32OffsetHigh64;
860 /** Reserved. */
861 unsigned u32Reserved;
862} VBOXIDTE64_GENERIC;
863#pragma pack()
864/** Pointer to IDT Entry, 64-bit mode, Generic view. */
865typedef VBOXIDTE64_GENERIC *PVBOXIDTE64_GENERIC;
866
867/** IDT Entry, 64-bit mode. */
868#pragma pack(1) /* paranoia */
869typedef union VBOXIDTE64
870{
871 /** Trap gate view. */
872 VBOXIDTE64_TRAPGATE Trap;
873 /** Interrupt gate view. */
874 VBOXIDTE64_INTERRUPTGATE Int;
875 /** Generic IDT view. */
876 VBOXIDTE64_GENERIC Gen;
877
878 /** 8 bit unsigned integer view. */
879 uint8_t au8[16];
880 /** 16 bit unsigned integer view. */
881 uint16_t au16[8];
882 /** 32 bit unsigned integer view. */
883 uint32_t au32[4];
884 /** 64 bit unsigned integer view. */
885 uint64_t au64[2];
886} VBOXIDTE64;
887#pragma pack()
888/** Pointer to IDT Entry. */
889typedef VBOXIDTE64 *PVBOXIDTE64;
890/** Pointer to IDT Entry. */
891typedef VBOXIDTE64 const *PCVBOXIDTE64;
892
893#pragma pack(1)
894/** IDTR */
895typedef struct VBOXIDTR
896{
897 /** Size of the IDT. */
898 uint16_t cbIdt;
899 /** Address of the IDT. */
900 uint64_t pIdt;
901} VBOXIDTR, *PVBOXIDTR;
902#pragma pack()
903
904
905/** @def VBOXIDTE_OFFSET
906 * Return the offset of an IDT entry.
907 */
908#define VBOXIDTE_OFFSET(desc) \
909 ( ((uint32_t)((desc).Gen.u16OffsetHigh) << 16) \
910 | ( (desc).Gen.u16OffsetLow ) )
911
912/** @def VBOXIDTE64_OFFSET
913 * Return the offset of an IDT entry.
914 */
915#define VBOXIDTE64_OFFSET(desc) \
916 ( ((uint64_t)((desc).Gen.u32OffsetHigh64) << 32) \
917 | ((uint32_t)((desc).Gen.u16OffsetHigh) << 16) \
918 | ( (desc).Gen.u16OffsetLow ) )
919
920#pragma pack(1)
921/** GDTR */
922typedef struct VBOXGDTR
923{
924 /** Size of the GDT. */
925 uint16_t cbGdt;
926 /** Address of the GDT. */
927 uint64_t pGdt;
928} VBOXGDTR;
929#pragma pack()
930/** Pointer to GDTR. */
931typedef VBOXGDTR *PVBOXGDTR;
932
933/** @} */
934
935
936/**
937 * 32-bit Task Segment used in raw mode.
938 * @todo Move this to SELM! Use X86TSS32 instead.
939 */
940#pragma pack(1)
941typedef struct VBOXTSS
942{
943 /** 0x00 - Back link to previous task. (static) */
944 RTSEL selPrev;
945 uint16_t padding1;
946 /** 0x04 - Ring-0 stack pointer. (static) */
947 uint32_t esp0;
948 /** 0x08 - Ring-0 stack segment. (static) */
949 RTSEL ss0;
950 uint16_t padding_ss0;
951 /** 0x0c - Ring-1 stack pointer. (static) */
952 uint32_t esp1;
953 /** 0x10 - Ring-1 stack segment. (static) */
954 RTSEL ss1;
955 uint16_t padding_ss1;
956 /** 0x14 - Ring-2 stack pointer. (static) */
957 uint32_t esp2;
958 /** 0x18 - Ring-2 stack segment. (static) */
959 RTSEL ss2;
960 uint16_t padding_ss2;
961 /** 0x1c - Page directory for the task. (static) */
962 uint32_t cr3;
963 /** 0x20 - EIP before task switch. */
964 uint32_t eip;
965 /** 0x24 - EFLAGS before task switch. */
966 uint32_t eflags;
967 /** 0x28 - EAX before task switch. */
968 uint32_t eax;
969 /** 0x2c - ECX before task switch. */
970 uint32_t ecx;
971 /** 0x30 - EDX before task switch. */
972 uint32_t edx;
973 /** 0x34 - EBX before task switch. */
974 uint32_t ebx;
975 /** 0x38 - ESP before task switch. */
976 uint32_t esp;
977 /** 0x3c - EBP before task switch. */
978 uint32_t ebp;
979 /** 0x40 - ESI before task switch. */
980 uint32_t esi;
981 /** 0x44 - EDI before task switch. */
982 uint32_t edi;
983 /** 0x48 - ES before task switch. */
984 RTSEL es;
985 uint16_t padding_es;
986 /** 0x4c - CS before task switch. */
987 RTSEL cs;
988 uint16_t padding_cs;
989 /** 0x50 - SS before task switch. */
990 RTSEL ss;
991 uint16_t padding_ss;
992 /** 0x54 - DS before task switch. */
993 RTSEL ds;
994 uint16_t padding_ds;
995 /** 0x58 - FS before task switch. */
996 RTSEL fs;
997 uint16_t padding_fs;
998 /** 0x5c - GS before task switch. */
999 RTSEL gs;
1000 uint16_t padding_gs;
1001 /** 0x60 - LDTR before task switch. */
1002 RTSEL selLdt;
1003 uint16_t padding_ldt;
1004 /** 0x64 - Debug trap flag */
1005 uint16_t fDebugTrap;
1006 /** 0x66 - Offset relative to the TSS of the start of the I/O Bitmap
1007 * and the end of the interrupt redirection bitmap. */
1008 uint16_t offIoBitmap;
1009 /** 0x68 - 32 bytes for the virtual interrupt redirection bitmap. (VME) */
1010 uint8_t IntRedirBitmap[32];
1011} VBOXTSS;
1012#pragma pack()
1013/** Pointer to task segment. */
1014typedef VBOXTSS *PVBOXTSS;
1015/** Pointer to const task segment. */
1016typedef const VBOXTSS *PCVBOXTSS;
1017
1018
1019/** Pointer to a callback method table provided by the VM API user. */
1020typedef struct VMM2USERMETHODS const *PCVMM2USERMETHODS;
1021
1022
1023/**
1024 * Forms of generic segment offloading.
1025 */
1026typedef enum PDMNETWORKGSOTYPE
1027{
1028 /** Invalid zero value. */
1029 PDMNETWORKGSOTYPE_INVALID = 0,
1030 /** TCP/IPv4 - no CWR/ECE encoding. */
1031 PDMNETWORKGSOTYPE_IPV4_TCP,
1032 /** TCP/IPv6 - no CWR/ECE encoding. */
1033 PDMNETWORKGSOTYPE_IPV6_TCP,
1034 /** UDP/IPv4. */
1035 PDMNETWORKGSOTYPE_IPV4_UDP,
1036 /** UDP/IPv6. */
1037 PDMNETWORKGSOTYPE_IPV6_UDP,
1038 /** TCP/IPv6 over IPv4 tunneling - no CWR/ECE encoding.
1039 * The header offsets and sizes relates to IPv4 and TCP, 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_TCP,
1043 /** UDP/IPv6 over IPv4 tunneling.
1044 * The header offsets and sizes relates to IPv4 and UDP, the IPv6 header is
1045 * figured out as needed.
1046 * @todo Needs checking against facts, this is just an outline of the idea. */
1047 PDMNETWORKGSOTYPE_IPV4_IPV6_UDP,
1048 /** The end of valid GSO types. */
1049 PDMNETWORKGSOTYPE_END
1050} PDMNETWORKGSOTYPE;
1051
1052
1053/**
1054 * Generic segment offloading context.
1055 *
1056 * We generally follow the E1000 specs wrt to which header fields we change.
1057 * However the GSO type implies where the checksum fields are and that they are
1058 * always updated from scratch (no half done pseudo checksums).
1059 *
1060 * @remarks This is part of the internal network GSO packets. Take great care
1061 * when making changes. The size is expected to be exactly 8 bytes.
1062 *
1063 * @ingroup grp_pdm
1064 */
1065typedef struct PDMNETWORKGSO
1066{
1067 /** The type of segmentation offloading we're performing (PDMNETWORKGSOTYPE). */
1068 uint8_t u8Type;
1069 /** The total header size. */
1070 uint8_t cbHdrsTotal;
1071 /** The max segment size (MSS) to apply. */
1072 uint16_t cbMaxSeg;
1073
1074 /** Offset of the first header (IPv4 / IPv6). 0 if not not needed. */
1075 uint8_t offHdr1;
1076 /** Offset of the second header (TCP / UDP). 0 if not not needed. */
1077 uint8_t offHdr2;
1078 /** The header size used for segmentation (equal to offHdr2 in UFO). */
1079 uint8_t cbHdrsSeg;
1080 /** Unused. */
1081 uint8_t u8Unused;
1082} PDMNETWORKGSO;
1083/** Pointer to a GSO context.
1084 * @ingroup grp_pdm */
1085typedef PDMNETWORKGSO *PPDMNETWORKGSO;
1086/** Pointer to a const GSO context.
1087 * @ingroup grp_pdm */
1088typedef PDMNETWORKGSO const *PCPDMNETWORKGSO;
1089
1090/** Pointer to a PDM filter handle.
1091 * @ingroup grp_pdm_net_shaper */
1092typedef struct PDMNSFILTER *PPDMNSFILTER;
1093/** Pointer to a network shaper.
1094 * @ingroup grp_pdm_net_shaper */
1095typedef struct PDMNETSHAPER *PPDMNETSHAPER;
1096
1097
1098/**
1099 * The current ROM page protection.
1100 *
1101 * @remarks This is part of the saved state.
1102 * @ingroup grp_pgm
1103 */
1104typedef enum PGMROMPROT
1105{
1106 /** The customary invalid value. */
1107 PGMROMPROT_INVALID = 0,
1108 /** Read from the virgin ROM page, ignore writes.
1109 * Map the virgin page, use write access handler to ignore writes. */
1110 PGMROMPROT_READ_ROM_WRITE_IGNORE,
1111 /** Read from the virgin ROM page, write to the shadow RAM.
1112 * Map the virgin page, use write access handler to change the shadow RAM. */
1113 PGMROMPROT_READ_ROM_WRITE_RAM,
1114 /** Read from the shadow ROM page, ignore writes.
1115 * Map the shadow page read-only, use write access handler to ignore writes. */
1116 PGMROMPROT_READ_RAM_WRITE_IGNORE,
1117 /** Read from the shadow ROM page, ignore writes.
1118 * Map the shadow page read-write, disabled write access handler. */
1119 PGMROMPROT_READ_RAM_WRITE_RAM,
1120 /** The end of valid values. */
1121 PGMROMPROT_END,
1122 /** The usual 32-bit type size hack. */
1123 PGMROMPROT_32BIT_HACK = 0x7fffffff
1124} PGMROMPROT;
1125
1126
1127/**
1128 * Page mapping lock.
1129 * @ingroup grp_pgm
1130 */
1131typedef struct PGMPAGEMAPLOCK
1132{
1133#if defined(IN_RC)
1134 /** The locked page. */
1135 void *pvPage;
1136 /** Pointer to the CPU that made the mapping.
1137 * In ring-0 and raw-mode context we don't intend to ever allow long term
1138 * locking and this is a way of making sure we're still on the same CPU. */
1139 PVMCPU pVCpu;
1140#else
1141 /** Pointer to the PGMPAGE and lock type.
1142 * bit-0 abuse: set=write, clear=read. */
1143 uintptr_t uPageAndType;
1144/** Read lock type value. */
1145# define PGMPAGEMAPLOCK_TYPE_READ ((uintptr_t)0)
1146/** Write lock type value. */
1147# define PGMPAGEMAPLOCK_TYPE_WRITE ((uintptr_t)1)
1148/** Lock type mask. */
1149# define PGMPAGEMAPLOCK_TYPE_MASK ((uintptr_t)1)
1150 /** Pointer to the PGMCHUNKR3MAP. */
1151 void *pvMap;
1152#endif
1153} PGMPAGEMAPLOCK;
1154/** Pointer to a page mapping lock.
1155 * @ingroup grp_pgm */
1156typedef PGMPAGEMAPLOCK *PPGMPAGEMAPLOCK;
1157
1158
1159/** Pointer to a info helper callback structure. */
1160typedef struct DBGFINFOHLP *PDBGFINFOHLP;
1161/** Pointer to a const info helper callback structure. */
1162typedef const struct DBGFINFOHLP *PCDBGFINFOHLP;
1163
1164/** Pointer to a const register descriptor. */
1165typedef struct DBGFREGDESC const *PCDBGFREGDESC;
1166
1167
1168/** Configuration manager tree node - A key. */
1169typedef struct CFGMNODE *PCFGMNODE;
1170
1171/** Configuration manager tree leaf - A value. */
1172typedef struct CFGMLEAF *PCFGMLEAF;
1173
1174
1175/**
1176 * CPU modes.
1177 */
1178typedef enum CPUMMODE
1179{
1180 /** The usual invalid zero entry. */
1181 CPUMMODE_INVALID = 0,
1182 /** Real mode - x86/amd64. */
1183 CPUMMODE_REAL,
1184 /** Protected mode (32-bit) - x86/amd64. */
1185 CPUMMODE_PROTECTED,
1186 /** Long mode (64-bit) - x86/amd64. */
1187 CPUMMODE_LONG,
1188 /** ARMv8 - AARCH64 mode. */
1189 CPUMMODE_ARMV8_AARCH64,
1190 /** ARMv8 - AARCH32 mode. */
1191 CPUMMODE_ARMV8_AARCH32,
1192 /** hack forcing the size of the enum to 32-bits. */
1193 CPUMMODE_32BIT_HACK = 0x7fffffff
1194} CPUMMODE;
1195
1196
1197/**
1198 * CPU mode flags (DISSTATE::mode).
1199 */
1200typedef enum DISCPUMODE
1201{
1202 DISCPUMODE_INVALID = 0,
1203 DISCPUMODE_16BIT,
1204 DISCPUMODE_32BIT,
1205 DISCPUMODE_64BIT,
1206
1207 /** @name ARMv8 modes.
1208 * @{ */
1209 /** AArch64 A64 instruction set. */
1210 DISCPUMODE_ARMV8_A64,
1211 /** AArch32 A32 instruction set. */
1212 DISCPUMODE_ARMV8_A32,
1213 /** AArch32 T32 (aka Thumb) instruction set. */
1214 DISCPUMODE_ARMV8_T32,
1215 /** @} */
1216
1217 /** hack forcing the size of the enum to 32-bits. */
1218 DISCPUMODE_MAKE_32BIT_HACK = 0x7fffffff
1219} DISCPUMODE;
1220
1221/** Pointer to the disassembler state. */
1222typedef struct DISSTATE *PDISSTATE;
1223/** Pointer to a const disassembler state. */
1224typedef struct DISSTATE const *PCDISSTATE;
1225
1226/** Forward declaration of pointer to const opcode. */
1227typedef const struct DISOPCODE *PCDISOPCODE;
1228
1229/** Forward declaration of pointer to opcode parameter. */
1230typedef struct DISOPPARAM *PDISOPPARAM;
1231
1232
1233/**
1234 * Shared region description (needed by GMM and others, thus global).
1235 * @ingroup grp_vmmdev
1236 */
1237typedef struct VMMDEVSHAREDREGIONDESC
1238{
1239 RTGCPTR64 GCRegionAddr;
1240 uint32_t cbRegion;
1241 uint32_t u32Alignment;
1242} VMMDEVSHAREDREGIONDESC;
1243
1244
1245/**
1246 * A PCI bus:device:function (BDF) identifier.
1247 *
1248 * All 16 bits of a BDF are valid according to the PCI spec. We need one extra bit
1249 * to determine whether the BDF is valid in interfaces where the BDF may be
1250 * optional.
1251 */
1252typedef uint32_t PCIBDF;
1253/** PCIBDF flag: Invalid. */
1254#define PCI_BDF_F_INVALID RT_BIT(31)
1255/** Nil PCIBDF value. */
1256#define NIL_PCIBDF PCI_BDF_F_INVALID
1257
1258/** Pointer to an MSI message struct. */
1259typedef struct MSIMSG *PMSIMSG;
1260/** Pointer to a const MSI message struct. */
1261typedef const struct MSIMSG *PCMSIMSG;
1262
1263
1264/** @} */
1265
1266#endif /* !VBOX_INCLUDED_types_h */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette