Rename struct ucontext tag (bug 21457).
[glibc.git] / sysdeps / arm / sys / ucontext.h
blob464a353a51d6422243ba4621b76ae12c4e65a4e5
1 /* Copyright (C) 1998-2017 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
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.
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.
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/>. */
18 /* System V/ARM ABI compliant context switching support. */
20 #ifndef _SYS_UCONTEXT_H
21 #define _SYS_UCONTEXT_H 1
23 #include <features.h>
25 #include <bits/types/sigset_t.h>
26 #include <bits/sigcontext.h>
27 #include <bits/types/stack_t.h>
30 typedef int greg_t;
32 /* Number of general registers. */
33 #define __NGREG 16
34 #ifdef __USE_MISC
35 # define NGREG __NGREG
36 #endif
38 /* Container for all general registers. */
39 typedef greg_t gregset_t[__NGREG];
41 #ifdef __USE_MISC
42 /* Number of each register is the `gregset_t' array. */
43 enum
45 R0 = 0,
46 # define R0 R0
47 R1 = 1,
48 # define R1 R1
49 R2 = 2,
50 # define R2 R2
51 R3 = 3,
52 # define R3 R3
53 R4 = 4,
54 # define R4 R4
55 R5 = 5,
56 # define R5 R5
57 R6 = 6,
58 # define R6 R6
59 R7 = 7,
60 # define R7 R7
61 R8 = 8,
62 # define R8 R8
63 R9 = 9,
64 # define R9 R9
65 R10 = 10,
66 # define R10 R10
67 R11 = 11,
68 # define R11 R11
69 R12 = 12,
70 # define R12 R12
71 R13 = 13,
72 # define R13 R13
73 R14 = 14,
74 # define R14 R14
75 R15 = 15,
76 # define R15 R15
78 #endif
80 #ifdef __USE_MISC
81 # define __ctx(fld) fld
82 #else
83 # define __ctx(fld) __ ## fld
84 #endif
86 /* Structure to describe FPU registers. */
87 typedef struct fpregset
89 } fpregset_t;
91 /* Context to describe whole processor state. */
92 typedef struct
94 gregset_t __ctx(gregs);
95 fpregset_t __ctx(fpregs);
96 } mcontext_t;
98 #undef __ctx
100 /* Userlevel context. */
101 typedef struct ucontext_t
103 unsigned long int uc_flags;
104 struct ucontext_t *uc_link;
105 sigset_t uc_sigmask;
106 stack_t uc_stack;
107 mcontext_t uc_mcontext;
108 long int uc_filler[5];
109 } ucontext_t;
111 #endif /* sys/ucontext.h */