2
* DBGF - Debugger Facility, selector interface partly shared with SELM. (VMM)
6
* Copyright (C) 2006-2009 Oracle Corporation
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.
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.
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.
27
#ifndef ___VBox_dbgfsel_h
28
#define ___VBox_dbgfsel_h
30
#include <VBox/types.h>
33
/** @addtogroup grp_dbgf
37
* Selector information structure.
39
typedef struct DBGFSELINFO
42
* For gate descriptors, this is the target address. */
45
* For gate descriptors, this is set to zero. */
47
/** The raw descriptor. */
55
/** The target selector for a gate.
56
* This is 0 if non-gate descriptor. */
61
/** Pointer to a SELM selector information struct. */
62
typedef DBGFSELINFO *PDBGFSELINFO;
63
/** Pointer to a const SELM selector information struct. */
64
typedef const DBGFSELINFO *PCDBGFSELINFO;
66
/** @name DBGFSELINFO::fFlags
68
/** The CPU is in real mode. */
69
#define DBGFSELINFO_FLAGS_REAL_MODE RT_BIT_32(0)
70
/** The CPU is in protected mode. */
71
#define DBGFSELINFO_FLAGS_PROT_MODE RT_BIT_32(1)
72
/** The CPU is in long mode. */
73
#define DBGFSELINFO_FLAGS_LONG_MODE RT_BIT_32(2)
74
/** The selector is a hyper selector. */
75
#define DBGFSELINFO_FLAGS_HYPER RT_BIT_32(3)
76
/** The selector is a gate selector. */
77
#define DBGFSELINFO_FLAGS_GATE RT_BIT_32(4)
78
/** The selector is invalid. */
79
#define DBGFSELINFO_FLAGS_INVALID RT_BIT_32(5)
80
/** The selector not present. */
81
#define DBGFSELINFO_FLAGS_NOT_PRESENT RT_BIT_32(6)
86
* Tests whether the selector info describes an expand-down selector or now.
88
* @returns true / false.
89
* @param pSelInfo The selector info.
91
DECLINLINE(bool) DBGFSelInfoIsExpandDown(PCDBGFSELINFO pSelInfo)
93
return (pSelInfo)->u.Raw.Gen.u1DescType
94
&& ((pSelInfo)->u.Raw.Gen.u4Type & (X86_SEL_TYPE_DOWN | X86_SEL_TYPE_CODE)) == X86_SEL_TYPE_DOWN;
98
VMMR3DECL(int) DBGFR3SelInfoValidateCS(PCDBGFSELINFO pSelInfo, RTSEL SelCPL);