1 | ;; @file
|
---|
2 | ; IPRT - Windows - X86 CPU Context Record for NASM/YASM.
|
---|
3 | ;
|
---|
4 |
|
---|
5 | ;
|
---|
6 | ; Copyright (C) 2022-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 ___iprt_win_context_x86_mac
|
---|
37 | %define ___iprt_win_context_x86_mac
|
---|
38 |
|
---|
39 | %include "iprt/asmdefs.mac"
|
---|
40 |
|
---|
41 | struc CONTEXT
|
---|
42 | .ContextFlags resd 1
|
---|
43 |
|
---|
44 | ; CONTEXT_DEBUG_REGISTERS:
|
---|
45 | .Dr0 resd 1
|
---|
46 | .Dr1 resd 1
|
---|
47 | .Dr2 resd 1
|
---|
48 | .Dr3 resd 1
|
---|
49 | .Dr6 resd 1
|
---|
50 | .Dr7 resd 1
|
---|
51 |
|
---|
52 | ; CONTEXT_FLOATING_POINT:
|
---|
53 | .FloatSave resb 112 ; X86FPUSTATE + 4 bytes
|
---|
54 |
|
---|
55 | ; CONTEXT_SEGMENTS:
|
---|
56 | .SegGs resd 1
|
---|
57 | .SegFs resd 1
|
---|
58 | .SegEs resd 1
|
---|
59 | .SegDs resd 1
|
---|
60 |
|
---|
61 | ; CONTEXT_INTEGER:
|
---|
62 | .Edi resd 1
|
---|
63 | .Esi resd 1
|
---|
64 | .Ebx resd 1
|
---|
65 | .Edx resd 1
|
---|
66 | .Ecx resd 1
|
---|
67 | .Eax resd 1
|
---|
68 |
|
---|
69 | ; CONTEXT_CONTROL:
|
---|
70 | .Ebp resd 1
|
---|
71 | .Eip resd 1
|
---|
72 | .SegCs resd 1
|
---|
73 | .EFlags resd 1
|
---|
74 | .Esp resd 1
|
---|
75 | .SegSs resd 1
|
---|
76 |
|
---|
77 | ; CONTEXT_EXTENDED_REGISTERS:
|
---|
78 | .ExtendedRegisters resb 512
|
---|
79 | endstruc
|
---|
80 | %define CONTEXT_SIZE (0x2cc)
|
---|
81 | AssertCompileSize(CONTEXT, CONTEXT_SIZE)
|
---|
82 |
|
---|
83 | %define CONTEXT_i386 (0x00010000)
|
---|
84 | %define CONTEXT_CONTROL (0x00000001 | CONTEXT_i386)
|
---|
85 | %define CONTEXT_INTEGER (0x00000002 | CONTEXT_i386)
|
---|
86 | %define CONTEXT_SEGMENTS (0x00000004 | CONTEXT_i386)
|
---|
87 | %define CONTEXT_FLOATING_POINT (0x00000008 | CONTEXT_i386)
|
---|
88 | %define CONTEXT_DEBUG_REGISTERS (0x00000010 | CONTEXT_i386)
|
---|
89 | %define CONTEXT_EXTENDED_REGISTERS (0x00000020 | CONTEXT_i386)
|
---|
90 | %define CONTEXT_FULL (0x00000007 | CONTEXT_i386)
|
---|
91 | %define CONTEXT_ALL (0x0000003f | CONTEXT_i386)
|
---|
92 |
|
---|
93 | %define CONTEXT_XSTATE (0x00000040 | CONTEXT_i386)
|
---|
94 | %define CONTEXT_EXCEPTION_ACTIVE (0x08000000)
|
---|
95 | %define CONTEXT_SERVICE_ACTIVE (0x10000000)
|
---|
96 | ; 0x20000000 = CONTEXT_UNWOUND_TO_CALL ?
|
---|
97 | %define CONTEXT_EXCEPTION_REQUEST (0x40000000)
|
---|
98 | %define CONTEXT_EXCEPTION_REPORTING (0x80000000)
|
---|
99 |
|
---|
100 | %endif
|
---|
101 |
|
---|