summaryrefslogtreecommitdiffstats
path: root/include/iprt/win/context-amd64.mac
blob: 5a1ec6499126742e9e98d13b7c70c40e6429bd69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
;; @file
; IPRT - Windows - AMD64 CPU Context Record for NASM/YASM.
;

;
; Copyright (C) 2022 Oracle and/or its affiliates.
;
; This file is part of VirtualBox base platform packages, as
; available from https://www.virtualbox.org.
;
; This program is free software; you can redistribute it and/or
; modify it under the terms of the GNU General Public License
; as published by the Free Software Foundation, in version 3 of the
; License.
;
; This program is distributed in the hope that it will be useful, but
; WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
; General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, see <https://www.gnu.org/licenses>.
;
; The contents of this file may alternatively be used under the terms
; of the Common Development and Distribution License Version 1.0
; (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
; in the VirtualBox distribution, in which case the provisions of the
; CDDL are applicable instead of those of the GPL.
;
; You may elect to license modified versions of this file under the
; terms and conditions of either the GPL or the CDDL or both.
;
; SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
;

%ifndef ___iprt_win_context_amd64_mac
%define ___iprt_win_context_amd64_mac

%include "iprt/asmdefs.mac"

struc CONTEXT
        .P1Home                 resq 1
        .P2Home                 resq 1
        .P3Home                 resq 1
        .P4Home                 resq 1
        .P5Home                 resq 1
        .P6Home                 resq 1

        .ContextFlags           resd 1
        .MxCsr                  resd 1

        .SegCs                  resw 1          ; CONTEXT_CONTROL
        .SegDs                  resw 1
        .SegEs                  resw 1
        .SegFs                  resw 1
        .SegGs                  resw 1
        .SegSs                  resw 1          ; CONTEXT_CONTROL
        .EFlags                 resd 1          ; CONTEXT_CONTROL

        .Dr0                    resq 1          ; CONTEXT_DEBUG_REGISTERS
        .Dr1                    resq 1          ; CONTEXT_DEBUG_REGISTERS
        .Dr2                    resq 1          ; CONTEXT_DEBUG_REGISTERS
        .Dr3                    resq 1          ; CONTEXT_DEBUG_REGISTERS
        .Dr6                    resq 1          ; CONTEXT_DEBUG_REGISTERS
        .Dr7                    resq 1          ; CONTEXT_DEBUG_REGISTERS

        .Rax                    resq 1          ; CONTEXT_INTEGER
        .Rcx                    resq 1          ; CONTEXT_INTEGER
        .Rdx                    resq 1          ; CONTEXT_INTEGER
        .Rbx                    resq 1          ; CONTEXT_INTEGER
        .Rsp                    resq 1          ; CONTEXT_CONTROL
        .Rbp                    resq 1          ; CONTEXT_INTEGER
        .Rsi                    resq 1          ; CONTEXT_INTEGER
        .Rdi                    resq 1          ; CONTEXT_INTEGER
        .R8                     resq 1          ; CONTEXT_INTEGER
        .R9                     resq 1          ; CONTEXT_INTEGER
        .R10                    resq 1          ; CONTEXT_INTEGER
        .R11                    resq 1          ; CONTEXT_INTEGER
        .R12                    resq 1          ; CONTEXT_INTEGER
        .R13                    resq 1          ; CONTEXT_INTEGER
        .R14                    resq 1          ; CONTEXT_INTEGER
        .R15                    resq 1          ; CONTEXT_INTEGER

        .Rip                    resq 1          ; CONTEXT_CONTROL

        .FltSave                resb 512        ; X86FXSTATE - CONTEXT_FLOATING_POINT = Xmm0-Xmm15

        .VectorRegisters        resb (26 * 16)
        .VectorControl          resq 1

        .DebugControl           resq 1
        .LastBranchToRip        resq 1
        .LastBranchFromRip      resq 1
        .LastExceptionToRip     resq 1
        .LastExceptionFromRip   resq 1
endstruc
%define CONTEXT_SIZE            (0x4d0)
AssertCompileSize(CONTEXT, CONTEXT_SIZE)

%define CONTEXT_AMD64               (0x00100000)
%define CONTEXT_CONTROL             (0x00000001 | CONTEXT_AMD64)
%define CONTEXT_INTEGER             (0x00000002 | CONTEXT_AMD64)
%define CONTEXT_SEGMENTS            (0x00000004 | CONTEXT_AMD64)
%define CONTEXT_FLOATING_POINT      (0x00000008 | CONTEXT_AMD64)
%define CONTEXT_DEBUG_REGISTERS     (0x00000010 | CONTEXT_AMD64)
%define CONTEXT_FULL                (0x0000000b | CONTEXT_AMD64)
%define CONTEXT_ALL                 (0x0000001f | CONTEXT_AMD64)

%define CONTEXT_XSTATE              (0x00000040 | CONTEXT_AMD64)
%define CONTEXT_KERNEL_CET          (0x00000080 | CONTEXT_AMD64)
%define CONTEXT_EXCEPTION_ACTIVE    (0x08000000)
%define CONTEXT_SERVICE_ACTIVE      (0x10000000)
%define CONTEXT_UNWOUND_TO_CALL     (0x20000000)
%define CONTEXT_EXCEPTION_REQUEST   (0x40000000)
%define CONTEXT_EXCEPTION_REPORTING (0x80000000)

%endif