]> git.ipfire.org Git - thirdparty/glibc.git/blame - 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
CommitLineData
b168057a 1/* Copyright (C) 2000-2015 Free Software Foundation, Inc.
847b055c
AJ
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
41bdb6e2
AJ
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.
847b055c
AJ
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
41bdb6e2 13 Lesser General Public License for more details.
847b055c 14
41bdb6e2 15 You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
847b055c
AJ
18
19#ifndef _SYS_UCONTEXT_H
20#define _SYS_UCONTEXT_H 1
a0386a0d
UD
21/* Forward definition to avoid parse errors */
22struct ucontext;
23typedef struct ucontext ucontext_t;
847b055c
AJ
24#include <features.h>
25#include <signal.h>
26
27/* We need the signal context definitions even if they are not used
28 included in <signal.h>. */
29#include <bits/sigcontext.h>
30
8e294940
UD
31/* Type for a program status word. */
32typedef struct
33{
34 unsigned long mask;
35 unsigned long addr;
cc03b296 36} __attribute__ ((__aligned__(8))) __psw_t;
847b055c 37
a0386a0d
UD
38/* Type for a general-purpose register. */
39typedef unsigned long greg_t;
847b055c 40
62ed552b
UD
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. */
7bf75551
UD
46#if __WORDSIZE == 64
47# define NGREG 27
48#else
49# define NGREG 36
50#endif
62ed552b 51/* Must match kernels psw_t alignment. */
cc03b296 52typedef greg_t gregset_t[NGREG] __attribute__ ((__aligned__(8)));
847b055c 53
a0386a0d 54typedef union
62ed552b
UD
55 {
56 double d;
57 float f;
58 } fpreg_t;
847b055c 59
a0386a0d 60/* Register set for the floating-point registers. */
62ed552b
UD
61typedef struct
62 {
63 unsigned int fpc;
64 fpreg_t fprs[16];
65 } fpregset_t;
847b055c
AJ
66
67/* Context to describe whole processor state. */
68typedef struct
69 {
62ed552b
UD
70 __psw_t psw;
71 unsigned long gregs[16];
8e294940 72 unsigned int aregs[16];
62ed552b 73 fpregset_t fpregs;
847b055c
AJ
74 } mcontext_t;
75
76/* Userlevel context. */
a0386a0d 77struct ucontext
847b055c
AJ
78 {
79 unsigned long int uc_flags;
397fa451 80 struct ucontext *uc_link;
847b055c
AJ
81 stack_t uc_stack;
82 mcontext_t uc_mcontext;
8e294940 83 __sigset_t uc_sigmask;
a0386a0d
UD
84 };
85
847b055c
AJ
86
87#endif /* sys/ucontext.h */