ReactOS 0.4.15-dev-5669-g09dde2c
x86context.h
Go to the documentation of this file.
1/*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: subsystems/mvdm/ntvdm/cpu/x86context.h
5 * PURPOSE: x86 CPU Context Frame definitions
6 * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
7 *
8 * NOTE: Taken from the PSDK.
9 */
10
11#ifndef __X86CONTEXT_H__
12#define __X86CONTEXT_H__
13
14#pragma once
15
16/* Clean everything that may have been defined before */
17#undef SIZE_OF_80387_REGISTERS
18#undef MAXIMUM_SUPPORTED_EXTENSION
19#undef CONTEXT_i386
20#undef CONTEXT_i486
21#undef CONTEXT_CONTROL
22#undef CONTEXT_INTEGER
23#undef CONTEXT_SEGMENTS
24#undef CONTEXT_FLOATING_POINT
25#undef CONTEXT_DEBUG_REGISTERS
26#undef CONTEXT_EXTENDED_REGISTERS
27#undef CONTEXT_FULL
28#undef CONTEXT_ALL
29#undef CONTEXT_DEBUGGER
30#undef CONTEXT_XSTATE
31
32
33
34#define SIZE_OF_80387_REGISTERS 80
35#define MAXIMUM_SUPPORTED_EXTENSION 512
36
37#define CONTEXT_i386 0x00010000
38#define CONTEXT_i486 0x00010000
39
40#define CONTEXT_CONTROL (CONTEXT_i386|0x00000001L) // SS:SP, CS:IP, FLAGS, BP
41#define CONTEXT_INTEGER (CONTEXT_i386|0x00000002L) // AX, BX, CX, DX, SI, DI
42#define CONTEXT_SEGMENTS (CONTEXT_i386|0x00000004L) // DS, ES, FS, GS
43#define CONTEXT_FLOATING_POINT (CONTEXT_i386|0x00000008L) // 387 state
44#define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386|0x00000010L) // DB 0-3,6,7
45#define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L) // CPU-specific extensions
46
47#define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)
48#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | \
49 CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS | \
50 CONTEXT_EXTENDED_REGISTERS)
51
52#define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT)
53#define CONTEXT_XSTATE (CONTEXT_i386 | 0x00000040L)
54
55
57{
68
69#include "pshpack4.h"
70/*
71 * x86 CPU Context Frame
72 */
73typedef struct _X86CONTEXT
74{
75 /*
76 * The flags values within this flag control the contents of
77 * a CONTEXT record.
78 */
80
81 /*
82 * Section specified/returned if CONTEXT_DEBUG_REGISTERS
83 * is set in ContextFlags.
84 */
91
92 /*
93 * Section specified/returned if CONTEXT_FLOATING_POINT
94 * is set in ContextFlags.
95 */
97
98 /*
99 * Section specified/returned if CONTEXT_SEGMENTS
100 * is set in ContextFlags.
101 */
106
107 /*
108 * Section specified/returned if CONTEXT_INTEGER
109 * is set in ContextFlags.
110 */
117
118 /*
119 * Section specified/returned if CONTEXT_CONTROL
120 * is set in ContextFlags.
121 */
128
129 /*
130 * Section specified/returned if CONTEXT_EXTENDED_REGISTERS
131 * is set in ContextFlags. The format and contexts are processor specific.
132 */
135#include "poppack.h"
136
137#endif /* __X86CONTEXT_H__ */
ULONG SegEs
Definition: x86context.h:104
ULONG Dr6
Definition: x86context.h:89
ULONG SegDs
Definition: x86context.h:105
ULONG Dr2
Definition: x86context.h:87
ULONG ContextFlags
Definition: x86context.h:79
ULONG EFlags
Definition: x86context.h:125
ULONG Dr7
Definition: x86context.h:90
X87FLOATING_SAVE_AREA FloatSave
Definition: x86context.h:96
ULONG SegGs
Definition: x86context.h:102
ULONG SegSs
Definition: x86context.h:127
ULONG SegCs
Definition: x86context.h:124
ULONG Dr1
Definition: x86context.h:86
ULONG Dr3
Definition: x86context.h:88
ULONG Dr0
Definition: x86context.h:85
UCHAR ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION]
Definition: x86context.h:133
ULONG SegFs
Definition: x86context.h:103
UCHAR RegisterArea[SIZE_OF_80387_REGISTERS]
Definition: x86context.h:65
uint32_t ULONG
Definition: typedefs.h:59
struct _X87FLOATING_SAVE_AREA X87FLOATING_SAVE_AREA
struct _X87FLOATING_SAVE_AREA * PX87FLOATING_SAVE_AREA
#define MAXIMUM_SUPPORTED_EXTENSION
Definition: x86context.h:35
struct _X86CONTEXT X86CONTEXT
#define SIZE_OF_80387_REGISTERS
Definition: x86context.h:34
unsigned char UCHAR
Definition: xmlstorage.h:181