OSDN Git Service

4b3654da317abf19d7263c6c88b278d92c56e30d
[uclinux-h8/uClibc.git] / libc / sysdeps / linux / bfin / sys / ucontext.h
1 /* Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc.
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
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.
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
12    Lesser General Public License for more details.
13
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library; if not, see
16    <http://www.gnu.org/licenses/>.  */
17
18 /* System V/blackfin ABI compliant context switching support.  */
19
20 #ifndef _SYS_UCONTEXT_H
21 #define _SYS_UCONTEXT_H 1
22
23 #include <features.h>
24 #include <signal.h>
25
26 /* Type for general register.  */
27 typedef int greg_t;
28
29 /* Number of general registers.  */
30 #define NGREG   47
31
32 /* Container for all general registers.  */
33 typedef greg_t gregset_t[NGREG];
34
35 /* Number of each register is the `gregset_t' array.  */
36 enum
37 {
38   REG_R0 = 0,
39 #define REG_R0  REG_R0
40   REG_R1 = 1,
41 #define REG_R1  REG_R1
42   REG_R2 = 2,
43 #define REG_R2  REG_R2
44   REG_R3 = 3,
45 #define REG_R3  REG_R3
46   REG_R4 = 4,
47 #define REG_R4  REG_R4
48   REG_R5 = 5,
49 #define REG_R5  REG_R5
50   REG_R6 = 6,
51 #define REG_R6  REG_R6
52   REG_R7 = 7,
53 #define REG_R7  REG_R7
54   REG_P0 = 8,
55 #define REG_P0  REG_P0
56   REG_P1 = 9,
57 #define REG_P1  REG_P1
58   REG_P2 = 10,
59 #define REG_P2  REG_P2
60   REG_P3 = 11,
61 #define REG_P3  REG_P3
62   REG_P4 = 12,
63 #define REG_P4  REG_P4
64   REG_P5 = 13,
65 #define REG_P5  REG_P5
66   REG_USP = 14,
67 #define REG_USP REG_USP
68   REG_A0W = 15,
69 #define REG_A0W REG_A0W
70   REG_A1W = 16,
71 #define REG_A1W REG_A1W
72   REG_A0X = 17,
73 #define REG_A0X REG_A0X
74   REG_A1X = 18,
75 #define REG_A1X REG_A1X
76   REG_ASTAT = 19,
77 #define REG_ASTAT       REG_ASTAT
78   REG_RETS = 20,
79 #define REG_RETS        REG_RETS
80   REG_PC= 21,
81 #define REG_PC  REG_PC
82   REG_RETX = 22,
83 #define REG_RETX        REG_RETX
84   REG_FP = 23,
85 #define REG_FP  REG_FP
86   REG_I0 = 24,
87 #define REG_I0  REG_I0
88   REG_I1 = 25,
89 #define REG_I1  REG_I1
90   REG_I2 = 26,
91 #define REG_I2  REG_I2
92   REG_I3 = 27,
93 #define REG_I3  REG_I3
94   REG_M0 = 28,
95 #define REG_M0  REG_M0
96   REG_M1 = 29,
97 #define REG_M1  REG_M1
98   REG_M2 = 30,
99 #define REG_M2  REG_M2
100   REG_M3 = 31,
101 #define REG_M3  REG_M3
102   REG_L0 = 32,
103 #define REG_L0  REG_L0
104   REG_L1 = 33,
105 #define REG_L1  REG_L1
106   REG_L2 = 34,
107 #define REG_L2  REG_L2
108   REG_L3 = 35,
109 #define REG_L3  REG_L3
110   REG_B_0 = 36,
111 #define REG_B0  REG_B0
112   REG_B1 = 37,
113 #define REG_B1  REG_B1
114   REG_B2 = 38,
115 #define REG_B2  REG_B2
116   REG_B3 = 39,
117 #define REG_B3  REG_B3
118   REG_LC0 = 40,
119 #define REG_LC0 REG_LC0
120   REG_LC1 = 41,
121 #define REG_LC1 REG_LC1
122   REG_LT0 = 42,
123 #define REG_LT0 REG_LT0
124   REG_LT1 = 43,
125 #define REG_LT1 REG_LT1
126   REG_LB0 = 44,
127 #define REG_LB0 REG_LB0
128   REG_LB1 = 45,
129 #define REG_LB1 REG_LB1
130   REG_SEQSTAT = 46
131 #define REG_SEQSTAT     REG_SEQSTAT
132 };
133
134 /* Context to describe whole processor state.  */
135 typedef struct
136 {
137   gregset_t gregs;
138 } mcontext_t;
139
140
141 /* Userlevel context.  */
142 typedef struct ucontext
143 {
144   unsigned long int uc_flags;
145   struct ucontext *uc_link;
146   stack_t uc_stack;
147   mcontext_t uc_mcontext;
148   __sigset_t uc_sigmask;
149 } ucontext_t;
150
151 #endif /* sys/ucontext.h */