]>
Commit | Line | Data |
---|---|---|
2b778ceb | 1 | /* Copyright (C) 1999-2021 Free Software Foundation, Inc. |
3846ef75 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 | |
41bdb6e2 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. | |
3846ef75 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 | |
41bdb6e2 | 12 | Lesser General Public License for more details. |
3846ef75 | 13 | |
41bdb6e2 | 14 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 15 | License along with the GNU C Library; if not, see |
5a82c748 | 16 | <https://www.gnu.org/licenses/>. */ |
3846ef75 UD |
17 | |
18 | /* Where is System V/SH ABI? */ | |
19 | ||
20 | #ifndef _SYS_UCONTEXT_H | |
21 | #define _SYS_UCONTEXT_H 1 | |
22 | ||
23 | #include <features.h> | |
3846ef75 | 24 | |
cfed8ece | 25 | #include <bits/types/sigset_t.h> |
0bcec532 | 26 | #include <bits/types/stack_t.h> |
3846ef75 UD |
27 | |
28 | ||
29 | typedef int greg_t; | |
30 | ||
31 | /* Number of general registers. */ | |
139904b7 JM |
32 | #define __NGREG 16 |
33 | #ifdef __USE_MISC | |
34 | # define NGREG __NGREG | |
35 | #endif | |
3846ef75 UD |
36 | |
37 | /* Container for all general registers. */ | |
139904b7 | 38 | typedef greg_t gregset_t[__NGREG]; |
3846ef75 | 39 | |
5df4854e | 40 | #ifdef __USE_MISC |
3846ef75 UD |
41 | /* Number of each register is the `gregset_t' array. */ |
42 | enum | |
43 | { | |
3e1b5185 | 44 | REG_R0 = 0, |
5df4854e | 45 | # define REG_R0 REG_R0 |
3e1b5185 | 46 | REG_R1 = 1, |
5df4854e | 47 | # define REG_R1 REG_R1 |
3e1b5185 | 48 | REG_R2 = 2, |
5df4854e | 49 | # define REG_R2 REG_R2 |
3e1b5185 | 50 | REG_R3 = 3, |
5df4854e | 51 | # define REG_R3 REG_R3 |
3e1b5185 | 52 | REG_R4 = 4, |
5df4854e | 53 | # define REG_R4 REG_R4 |
3e1b5185 | 54 | REG_R5 = 5, |
5df4854e | 55 | # define REG_R5 REG_R5 |
3e1b5185 | 56 | REG_R6 = 6, |
5df4854e | 57 | # define REG_R6 REG_R6 |
3e1b5185 | 58 | REG_R7 = 7, |
5df4854e | 59 | # define REG_R7 REG_R7 |
3e1b5185 | 60 | REG_R8 = 8, |
5df4854e | 61 | # define REG_R8 REG_R8 |
3e1b5185 | 62 | REG_R9 = 9, |
5df4854e | 63 | # define REG_R9 REG_R9 |
3e1b5185 | 64 | REG_R10 = 10, |
5df4854e | 65 | # define REG_R10 REG_R10 |
3e1b5185 | 66 | REG_R11 = 11, |
5df4854e | 67 | # define REG_R11 REG_R11 |
3e1b5185 | 68 | REG_R12 = 12, |
5df4854e | 69 | # define REG_R12 REG_R12 |
3e1b5185 | 70 | REG_R13 = 13, |
5df4854e | 71 | # define REG_R13 REG_R13 |
3e1b5185 | 72 | REG_R14 = 14, |
5df4854e | 73 | # define REG_R14 REG_R14 |
3e1b5185 | 74 | REG_R15 = 15, |
5df4854e | 75 | # define REG_R15 REG_R15 |
3846ef75 | 76 | }; |
5df4854e | 77 | #endif |
3846ef75 UD |
78 | |
79 | typedef int freg_t; | |
80 | ||
81 | /* Number of FPU registers. */ | |
139904b7 JM |
82 | #define __NFPREG 16 |
83 | #ifdef __USE_MISC | |
84 | # define NFPREG __NFPREG | |
85 | #endif | |
3846ef75 UD |
86 | |
87 | /* Structure to describe FPU registers. */ | |
139904b7 JM |
88 | typedef freg_t fpregset_t[__NFPREG]; |
89 | ||
90 | #ifdef __USE_MISC | |
91 | # define __ctx(fld) fld | |
92 | #else | |
93 | # define __ctx(fld) __ ## fld | |
94 | #endif | |
3846ef75 UD |
95 | |
96 | /* Context to describe whole processor state. */ | |
97 | typedef struct | |
98 | { | |
139904b7 JM |
99 | unsigned int __ctx(oldmask); |
100 | gregset_t __ctx(gregs); | |
101 | unsigned int __ctx(pc); | |
102 | unsigned int __ctx(pr); | |
103 | unsigned int __ctx(sr); | |
104 | unsigned int __ctx(gbr); | |
105 | unsigned int __ctx(mach); | |
106 | unsigned int __ctx(macl); | |
107 | fpregset_t __ctx(fpregs); | |
108 | fpregset_t __ctx(xfpregs); | |
109 | unsigned int __ctx(fpscr); | |
110 | unsigned int __ctx(fpul); | |
111 | unsigned int __ctx(ownedfp); | |
3846ef75 UD |
112 | } mcontext_t; |
113 | ||
114 | /* Userlevel context. */ | |
25128773 | 115 | typedef struct ucontext_t |
3846ef75 | 116 | { |
3d452dab | 117 | unsigned long int __ctx(uc_flags); |
25128773 | 118 | struct ucontext_t *uc_link; |
3846ef75 UD |
119 | stack_t uc_stack; |
120 | mcontext_t uc_mcontext; | |
cfed8ece | 121 | sigset_t uc_sigmask; |
3846ef75 UD |
122 | } ucontext_t; |
123 | ||
3d452dab JM |
124 | #undef __ctx |
125 | ||
3846ef75 | 126 | #endif /* sys/ucontext.h */ |