Fix sys/ucontext.h namespace from signal.h etc. inclusion (bug 21457).
[glibc.git] / sysdeps / unix / sysv / linux / s390 / sys / ucontext.h
blob80410fa38ccef126aec4ef2b3281bb5ff91b9d72
1 /* Copyright (C) 2000-2017 Free Software Foundation, Inc.
2 Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com).
3 This file is part of the GNU C Library.
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.
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.
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 <http://www.gnu.org/licenses/>. */
19 #ifndef _SYS_UCONTEXT_H
20 #define _SYS_UCONTEXT_H 1
22 #include <features.h>
24 #include <bits/types/sigset_t.h>
25 #include <bits/sigcontext.h>
26 #include <bits/types/stack_t.h>
29 /* Type for a program status word. */
30 typedef struct
32 unsigned long mask;
33 unsigned long addr;
34 } __attribute__ ((__aligned__(8))) __psw_t;
36 /* Type for a general-purpose register. */
37 typedef unsigned long greg_t;
39 /* And the whole bunch of them. We should have used `struct s390_regs',
40 but to avoid name space pollution and since the tradition says that
41 the register set is an array, we make gregset_t a simple array
42 that has the same size as s390_regs. This is needed for the
43 elf_prstatus structure. */
44 #if __WORDSIZE == 64
45 # define NGREG 27
46 #else
47 # define NGREG 36
48 #endif
49 /* Must match kernels psw_t alignment. */
50 typedef greg_t gregset_t[NGREG] __attribute__ ((__aligned__(8)));
52 typedef union
54 double d;
55 float f;
56 } fpreg_t;
58 /* Register set for the floating-point registers. */
59 typedef struct
61 unsigned int fpc;
62 fpreg_t fprs[16];
63 } fpregset_t;
65 /* Context to describe whole processor state. */
66 typedef struct
68 __psw_t psw;
69 unsigned long gregs[16];
70 unsigned int aregs[16];
71 fpregset_t fpregs;
72 } mcontext_t;
74 /* Userlevel context. */
75 typedef struct ucontext
77 unsigned long int uc_flags;
78 struct ucontext *uc_link;
79 stack_t uc_stack;
80 mcontext_t uc_mcontext;
81 sigset_t uc_sigmask;
82 } ucontext_t;
85 #endif /* sys/ucontext.h */