]>
Commit | Line | Data |
---|---|---|
0f0c35e4 | 1 | /* Copyright (C) 2000-2014 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 */ |
22 | struct ucontext; | |
23 | typedef 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. */ |
32 | typedef 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. */ |
39 | typedef 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 | 52 | typedef greg_t gregset_t[NGREG] __attribute__ ((__aligned__(8))); |
847b055c | 53 | |
a0386a0d | 54 | typedef 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 |
61 | typedef struct |
62 | { | |
63 | unsigned int fpc; | |
64 | fpreg_t fprs[16]; | |
65 | } fpregset_t; | |
847b055c | 66 | |
05d138ef | 67 | /* Bit is set if the uc_high_gprs field contains the upper halfs of |
0f0c35e4 AK |
68 | the 64 bit general purpose registers. Since the uc_high_gprs field |
69 | is only available in the 32 bit version of ucontext_t it will never | |
70 | be set for 64 bit. */ | |
05d138ef AK |
71 | #define UCONTEXT_UC_FLAGS_HIGH_GPRS (1UL << 0) |
72 | ||
73 | /* A new uc_flags constant will be defined when actually making use of | |
74 | the reserved space: UCONTEXT_UCFLAGS_RESERVED (1UL << 1). */ | |
75 | ||
847b055c AJ |
76 | /* Context to describe whole processor state. */ |
77 | typedef struct | |
78 | { | |
62ed552b UD |
79 | __psw_t psw; |
80 | unsigned long gregs[16]; | |
8e294940 | 81 | unsigned int aregs[16]; |
62ed552b | 82 | fpregset_t fpregs; |
847b055c AJ |
83 | } mcontext_t; |
84 | ||
85 | /* Userlevel context. */ | |
a0386a0d | 86 | struct ucontext |
847b055c AJ |
87 | { |
88 | unsigned long int uc_flags; | |
397fa451 | 89 | struct ucontext *uc_link; |
847b055c AJ |
90 | stack_t uc_stack; |
91 | mcontext_t uc_mcontext; | |
8e294940 | 92 | __sigset_t uc_sigmask; |
0f0c35e4 | 93 | #ifndef __s390x__ |
05d138ef | 94 | unsigned long uc_high_gprs[16]; |
0f0c35e4 | 95 | #endif |
05d138ef | 96 | char __reserved[512]; |
a0386a0d UD |
97 | }; |
98 | ||
847b055c AJ |
99 | |
100 | #endif /* sys/ucontext.h */ |