]>
Commit | Line | Data |
---|---|---|
04277e02 | 1 | /* Copyright (C) 1997-2019 Free Software Foundation, Inc. |
ff3e4969 UD |
2 | This file is part of the GNU C Library. |
3 | ||
4 | The GNU C Library is free software; you can redistribute it and/or | |
3214b89b AJ |
5 | modify it under the terms of the GNU Lesser General Public |
6 | License as published by the Free Software Foundation; either | |
7 | version 2.1 of the License, or (at your option) any later version. | |
ff3e4969 UD |
8 | |
9 | The GNU C Library is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
3214b89b | 12 | Lesser General Public License for more details. |
ff3e4969 | 13 | |
3214b89b | 14 | You should have received a copy of the GNU Lesser General Public |
ab84e3ff PE |
15 | License along with the GNU C Library. If not, see |
16 | <http://www.gnu.org/licenses/>. */ | |
ff3e4969 UD |
17 | |
18 | /* Don't rely on this, the interface is currently messed up and may need to | |
19 | be broken to be fixed. */ | |
20 | #ifndef _SYS_UCONTEXT_H | |
21 | #define _SYS_UCONTEXT_H 1 | |
22 | ||
23 | #include <features.h> | |
ff3e4969 | 24 | |
cfed8ece | 25 | #include <bits/types/sigset_t.h> |
0bcec532 | 26 | #include <bits/types/stack_t.h> |
ff3e4969 UD |
27 | |
28 | ||
4fa9b3bf JM |
29 | #ifdef __USE_MISC |
30 | # define __ctx(fld) fld | |
31 | #else | |
32 | # define __ctx(fld) __ ## fld | |
33 | #endif | |
34 | ||
5df4854e | 35 | #ifdef __USE_MISC |
ff3e4969 UD |
36 | /* Type for general register. */ |
37 | typedef unsigned long int greg_t; | |
38 | ||
39 | /* Number of general registers. */ | |
5df4854e JM |
40 | # define NGREG 80 |
41 | # define NFPREG 32 | |
ff3e4969 UD |
42 | |
43 | /* Container for all general registers. */ | |
2d4515fc UD |
44 | typedef struct gregset |
45 | { | |
46 | greg_t g_regs[32]; | |
21e7ad57 UD |
47 | greg_t sr_regs[8]; |
48 | greg_t cr_regs[24]; | |
49 | greg_t g_pad[16]; | |
2d4515fc | 50 | } gregset_t; |
ff3e4969 UD |
51 | |
52 | /* Container for all FPU registers. */ | |
81b032c8 | 53 | typedef struct |
2d4515fc UD |
54 | { |
55 | double fp_dregs[32]; | |
56 | } fpregset_t; | |
5df4854e | 57 | #endif |
ff3e4969 UD |
58 | |
59 | /* Context to describe whole processor state. */ | |
4fa9b3bf JM |
60 | typedef struct |
61 | { | |
62 | unsigned long int __ctx(sc_flags); | |
63 | unsigned long int __ctx(sc_gr)[32]; | |
64 | unsigned long long int __ctx(sc_fr)[32]; | |
65 | unsigned long int __ctx(sc_iasq)[2]; | |
66 | unsigned long int __ctx(sc_iaoq)[2]; | |
67 | unsigned long int __ctx(sc_sar); | |
68 | } mcontext_t; | |
3d452dab | 69 | |
ff3e4969 | 70 | /* Userlevel context. */ |
25128773 | 71 | typedef struct ucontext_t |
ff3e4969 | 72 | { |
3d452dab | 73 | unsigned long int __ctx(uc_flags); |
25128773 | 74 | struct ucontext_t *uc_link; |
ff3e4969 UD |
75 | stack_t uc_stack; |
76 | mcontext_t uc_mcontext; | |
cfed8ece | 77 | sigset_t uc_sigmask; |
ff3e4969 UD |
78 | } ucontext_t; |
79 | ||
3d452dab JM |
80 | #undef __ctx |
81 | ||
ff3e4969 | 82 | #endif /* sys/ucontext.h */ |