VirtualBox

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

Last change on this file since 82842 was 81624, checked in by vboxsync, 5 years ago

PDM,PGM: Added handled based MMIO2 interface. Made some adjustments to the PCI I/O region registrations. (Preps for VMMDev.) bugref:9218

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