Imported Upstream version 1.1
[platform/upstream/libunwind.git] / src / x86_64 / ucontext_i.h
1 /* Copyright (C) 2004 Hewlett-Packard Co.
2      Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
3
4 This file is part of libunwind.
5
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 "Software"), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
13
14 The above copyright notice and this permission notice shall be
15 included in all copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
24
25 #if defined __linux__
26 #define UC_MCONTEXT_GREGS_R8    0x28
27 #define UC_MCONTEXT_GREGS_R9    0x30
28 #define UC_MCONTEXT_GREGS_R10   0x38
29 #define UC_MCONTEXT_GREGS_R11   0x40
30 #define UC_MCONTEXT_GREGS_R12   0x48
31 #define UC_MCONTEXT_GREGS_R13   0x50
32 #define UC_MCONTEXT_GREGS_R14   0x58
33 #define UC_MCONTEXT_GREGS_R15   0x60
34 #define UC_MCONTEXT_GREGS_RDI   0x68
35 #define UC_MCONTEXT_GREGS_RSI   0x70
36 #define UC_MCONTEXT_GREGS_RBP   0x78
37 #define UC_MCONTEXT_GREGS_RBX   0x80
38 #define UC_MCONTEXT_GREGS_RDX   0x88
39 #define UC_MCONTEXT_GREGS_RAX   0x90
40 #define UC_MCONTEXT_GREGS_RCX   0x98
41 #define UC_MCONTEXT_GREGS_RSP   0xa0
42 #define UC_MCONTEXT_GREGS_RIP   0xa8
43 #define UC_MCONTEXT_FPREGS_PTR  0x1a8
44 #define UC_MCONTEXT_FPREGS_MEM  0xe0
45 #define UC_SIGMASK              0x128
46 #define FPREGS_OFFSET_MXCSR     0x18
47 #elif defined __FreeBSD__
48 #define UC_SIGMASK              0x0
49 #define UC_MCONTEXT_GREGS_RDI   0x18
50 #define UC_MCONTEXT_GREGS_RSI   0x20
51 #define UC_MCONTEXT_GREGS_RDX   0x28
52 #define UC_MCONTEXT_GREGS_RCX   0x30
53 #define UC_MCONTEXT_GREGS_R8    0x38
54 #define UC_MCONTEXT_GREGS_R9    0x40
55 #define UC_MCONTEXT_GREGS_RAX   0x48
56 #define UC_MCONTEXT_GREGS_RBX   0x50
57 #define UC_MCONTEXT_GREGS_RBP   0x58
58 #define UC_MCONTEXT_GREGS_R10   0x60
59 #define UC_MCONTEXT_GREGS_R11   0x68
60 #define UC_MCONTEXT_GREGS_R12   0x70
61 #define UC_MCONTEXT_GREGS_R13   0x78
62 #define UC_MCONTEXT_GREGS_R14   0x80
63 #define UC_MCONTEXT_GREGS_R15   0x88
64 #define UC_MCONTEXT_FS          0x94
65 #define UC_MCONTEXT_GS          0x96
66 #define UC_MCONTEXT_FLAGS       0xa0
67 #define UC_MCONTEXT_ES          0xa4
68 #define UC_MCONTEXT_DS          0xa6
69 #define UC_MCONTEXT_GREGS_RIP   0xb0
70 #define UC_MCONTEXT_CS          0xb8
71 #define UC_MCONTEXT_RFLAGS      0xc0
72 #define UC_MCONTEXT_GREGS_RSP   0xc8
73 #define UC_MCONTEXT_SS          0xd0
74 #define UC_MCONTEXT_MC_LEN      0xd8
75 #define UC_MCONTEXT_FPFORMAT    0xe0
76 #define UC_MCONTEXT_OWNEDFP     0xe8
77 #define UC_MCONTEXT_FPSTATE     0xf0
78 #define UC_MCONTEXT_FPOWNED_FPU 0x20001
79 #define UC_MCONTEXT_FPFMT_XMM   0x10002
80 #define UC_MCONTEXT_MC_LEN_VAL  0x320
81
82 #endif