Update copyright dates with scripts/update-copyrights.
[glibc.git] / sysdeps / unix / sysv / linux / s390 / sys / ucontext.h
blob2fc779b1ddff6b2439fe5594f2758721288ff324
1 /* Copyright (C) 2000-2015 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
21 /* Forward definition to avoid parse errors */
22 struct ucontext;
23 typedef struct ucontext ucontext_t;
24 #include <features.h>
25 #include <signal.h>
27 /* We need the signal context definitions even if they are not used
28 included in <signal.h>. */
29 #include <bits/sigcontext.h>
31 /* Type for a program status word. */
32 typedef struct
34 unsigned long mask;
35 unsigned long addr;
36 } __attribute__ ((__aligned__(8))) __psw_t;
38 /* Type for a general-purpose register. */
39 typedef unsigned long greg_t;
41 /* And the whole bunch of them. We should have used `struct s390_regs',
42 but to avoid name space pollution and since the tradition says that
43 the register set is an array, we make gregset_t a simple array
44 that has the same size as s390_regs. This is needed for the
45 elf_prstatus structure. */
46 #if __WORDSIZE == 64
47 # define NGREG 27
48 #else
49 # define NGREG 36
50 #endif
51 /* Must match kernels psw_t alignment. */
52 typedef greg_t gregset_t[NGREG] __attribute__ ((__aligned__(8)));
54 typedef union
56 double d;
57 float f;
58 } fpreg_t;
60 /* Register set for the floating-point registers. */
61 typedef struct
63 unsigned int fpc;
64 fpreg_t fprs[16];
65 } fpregset_t;
67 /* Context to describe whole processor state. */
68 typedef struct
70 __psw_t psw;
71 unsigned long gregs[16];
72 unsigned int aregs[16];
73 fpregset_t fpregs;
74 } mcontext_t;
76 /* Userlevel context. */
77 struct ucontext
79 unsigned long int uc_flags;
80 struct ucontext *uc_link;
81 stack_t uc_stack;
82 mcontext_t uc_mcontext;
83 __sigset_t uc_sigmask;
87 #endif /* sys/ucontext.h */