Update copyright notices with scripts/update-copyrights.
[jlayton/glibc.git] / ports / sysdeps / am33 / sys / ucontext.h
1 /* Copyright 1997-2013 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 Library General Public License as
6    published by the Free Software Foundation; either version 2 of the
7    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    Library General Public License for more details.
13
14    You should have received a copy of the GNU Library General Public
15    License along with the GNU C Library.  If not, see
16    <http://www.gnu.org/licenses/>.  */
17
18 /* AM33/2.0 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   28
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_D0 = 0,
39 #define REG_D0  REG_D0
40   REG_D1,
41 #define REG_D1  REG_D1
42   REG_D2,
43 #define REG_D2  REG_D2
44   REG_D3,
45 #define REG_D3  REG_D3
46   REG_A0,
47 #define REG_A0  REG_A0
48   REG_A1,
49 #define REG_A1  REG_A1
50   REG_A2,
51 #define REG_A2  REG_A2
52   REG_A3,
53 #define REG_A3  REG_A3
54   REG_E0,
55 #define REG_E0  REG_E0
56   REG_E1,
57 #define REG_E1  REG_E1
58   REG_E2,
59 #define REG_E2  REG_E2
60   REG_E3,
61 #define REG_E3  REG_E3
62   REG_E4,
63 #define REG_E4  REG_E4
64   REG_E5,
65 #define REG_E5  REG_E5
66   REG_E6,
67 #define REG_E6  REG_E6
68   REG_E7,
69 #define REG_E7  REG_E7
70   REG_LAR,
71 #define REG_LAR REG_LAR
72   REG_LIR,
73 #define REG_LIR REG_LIR
74   REG_MDR,
75 #define REG_MDR REG_MDR
76   REG_MCVF,
77 #define REG_MCVF        REG_MCVF
78   REG_MCRL,
79 #define REG_MCRL        REG_MCRL
80   REG_MCRH,
81 #define REG_MCRH        REG_MCRH
82   REG_MDRQ,
83 #define REG_MDRQ        REG_MDRQ
84   REG_SP,
85 #define REG_SP  REG_SP
86   REG_EPSW,
87 #define REG_EPSW        REG_EPSW
88   REG_PC,
89 #define REG_PC  REG_PC
90 };
91
92 typedef int freg_t;
93
94 /* Structure to describe FPU registers.  */
95 typedef struct {
96   union {
97     double fp_dregs[16];
98     float fp_fregs[32];
99     freg_t fp_regs[32];
100   } regs;
101   freg_t fpcr;
102 } fpregset_t;
103
104 /* Context to describe whole processor state.  */
105 typedef struct
106   {
107     gregset_t gregs;
108     fpregset_t fpregs;
109   } mcontext_t;
110
111 /* Userlevel context.  */
112 typedef struct ucontext
113   {
114     unsigned long int uc_flags;
115     struct ucontext *uc_link;
116     __sigset_t uc_sigmask;
117     stack_t uc_stack;
118     mcontext_t uc_mcontext;
119     long int uc_filler[5];
120   } ucontext_t;
121
122 #endif /* sys/ucontext.h */