]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/s390/sys/ucontext.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / s390 / sys / ucontext.h
1 /* Copyright (C) 2000-2020 Free Software Foundation, Inc.
2 Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19 #ifndef _SYS_UCONTEXT_H
20 #define _SYS_UCONTEXT_H 1
21
22 #include <features.h>
23
24 #include <bits/types/sigset_t.h>
25 #include <bits/types/stack_t.h>
26
27
28 #ifdef __USE_MISC
29 # define __ctx(fld) fld
30 #else
31 # define __ctx(fld) __ ## fld
32 #endif
33
34 /* Type for a program status word. */
35 typedef struct
36 {
37 unsigned long __ctx(mask);
38 unsigned long __ctx(addr);
39 } __attribute__ ((__aligned__(8))) __psw_t;
40
41 /* Type for a general-purpose register. */
42 typedef unsigned long greg_t;
43
44 /* And the whole bunch of them. We should have used `struct s390_regs',
45 but to avoid name space pollution and since the tradition says that
46 the register set is an array, we make gregset_t a simple array
47 that has the same size as s390_regs. This is needed for the
48 elf_prstatus structure. */
49 #if __WORDSIZE == 64
50 # define __NGREG 27
51 #else
52 # define __NGREG 36
53 #endif
54 #ifdef __USE_MISC
55 # define NGREG __NGREG
56 #endif
57 /* Must match kernels psw_t alignment. */
58 typedef greg_t gregset_t[__NGREG] __attribute__ ((__aligned__(8)));
59
60 typedef union
61 {
62 double __ctx(d);
63 float __ctx(f);
64 } fpreg_t;
65
66 /* Register set for the floating-point registers. */
67 typedef struct
68 {
69 unsigned int __ctx(fpc);
70 fpreg_t __ctx(fprs)[16];
71 } fpregset_t;
72
73 /* Context to describe whole processor state. */
74 typedef struct
75 {
76 __psw_t __ctx(psw);
77 unsigned long __ctx(gregs)[16];
78 unsigned int __ctx(aregs)[16];
79 fpregset_t __ctx(fpregs);
80 } mcontext_t;
81
82 /* Userlevel context. */
83 typedef struct ucontext_t
84 {
85 unsigned long int __ctx(uc_flags);
86 struct ucontext_t *uc_link;
87 stack_t uc_stack;
88 mcontext_t uc_mcontext;
89 sigset_t uc_sigmask;
90 } ucontext_t;
91
92 #undef __ctx
93
94
95 #endif /* sys/ucontext.h */