2.9
[glibc/nacl-glibc.git] / sysdeps / unix / sysv / linux / s390 / sys / ucontext.h
blob4e32361c3b770bb6ce3e7ea874fdaa0ec12861fd
1 /* Copyright (C) 2000, 2001, 2002 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, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
20 #ifndef _SYS_UCONTEXT_H
21 #define _SYS_UCONTEXT_H 1
22 /* Forward definition to avoid parse errors */
23 struct ucontext;
24 typedef struct ucontext ucontext_t;
25 #include <features.h>
26 #include <signal.h>
28 /* We need the signal context definitions even if they are not used
29 included in <signal.h>. */
30 #include <bits/sigcontext.h>
32 /* Type for a program status word. */
33 typedef struct
35 unsigned long mask;
36 unsigned long addr;
37 } __attribute__ ((aligned(8))) __psw_t;
39 /* Type for a general-purpose register. */
40 typedef unsigned long greg_t;
42 /* And the whole bunch of them. We should have used `struct s390_regs',
43 but to avoid name space pollution and since the tradition says that
44 the register set is an array, we make gregset_t a simple array
45 that has the same size as s390_regs. This is needed for the
46 elf_prstatus structure. */
47 #if __WORDSIZE == 64
48 # define NGREG 27
49 #else
50 # define NGREG 36
51 #endif
52 /* Must match kernels psw_t alignment. */
53 typedef greg_t gregset_t[NGREG] __attribute__ ((aligned(8)));
55 typedef union
57 double d;
58 float f;
59 } fpreg_t;
61 /* Register set for the floating-point registers. */
62 typedef struct
64 unsigned int fpc;
65 fpreg_t fprs[16];
66 } fpregset_t;
68 /* Context to describe whole processor state. */
69 typedef struct
71 __psw_t psw;
72 unsigned long gregs[16];
73 unsigned int aregs[16];
74 fpregset_t fpregs;
75 } mcontext_t;
77 /* Userlevel context. */
78 struct ucontext
80 unsigned long int uc_flags;
81 struct ucontext *uc_link;
82 stack_t uc_stack;
83 mcontext_t uc_mcontext;
84 __sigset_t uc_sigmask;
88 #endif /* sys/ucontext.h */