]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/mips/sys/ucontext.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / mips / sys / ucontext.h
CommitLineData
04277e02 1/* Copyright (C) 1997-2019 Free Software Foundation, Inc. This file is part of the GNU C Library.
1b1d9381
UD
2
3 The GNU C Library is free software; you can redistribute it and/or
3214b89b
AJ
4 modify it under the terms of the GNU Lesser General Public
5 License as published by the Free Software Foundation; either
6 version 2.1 of the License, or (at your option) any later version.
1b1d9381
UD
7
8 The GNU C Library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3214b89b 11 Lesser General Public License for more details.
1b1d9381 12
3214b89b 13 You should have received a copy of the GNU Lesser General Public
ab84e3ff
PE
14 License along with the GNU C Library. If not, see
15 <http://www.gnu.org/licenses/>. */
1b1d9381
UD
16
17/* Don't rely on this, the interface is currently messed up and may need to
18 be broken to be fixed. */
19#ifndef _SYS_UCONTEXT_H
20#define _SYS_UCONTEXT_H 1
21
22#include <features.h>
1b1d9381 23
cfed8ece 24#include <bits/types/sigset_t.h>
0bcec532 25#include <bits/types/stack_t.h>
c66b29f9
ZW
26
27#include <sgidefs.h>
28
1b1d9381 29
d25102aa
AO
30/* Type for general register. Even in o32 we assume 64-bit registers,
31 like the kernel. */
ca2b264c 32__extension__ typedef unsigned long long int greg_t;
1b1d9381
UD
33
34/* Number of general registers. */
139904b7
JM
35#define __NGREG 32
36#define __NFPREG 32
37#ifdef __USE_MISC
38# define NGREG __NGREG
39# define NFPREG __NFPREG
40#endif
1b1d9381
UD
41
42/* Container for all general registers. */
139904b7
JM
43typedef greg_t gregset_t[__NGREG];
44
45#ifdef __USE_MISC
46# define __ctx(fld) fld
47#else
48# define __ctx(fld) __ ## fld
49#endif
c3b737cb 50
1b1d9381 51/* Container for all FPU registers. */
d57cb319 52typedef struct {
1b1d9381 53 union {
139904b7 54 double __ctx(fp_dregs)[__NFPREG];
1b1d9381
UD
55 struct {
56 float _fp_fregs;
57 unsigned int _fp_pad;
139904b7
JM
58 } __ctx(fp_fregs)[__NFPREG];
59 } __ctx(fp_r);
1b1d9381
UD
60} fpregset_t;
61
ba747ea1 62
1b1d9381 63/* Context to describe whole processor state. */
b8ddf7a1 64#if _MIPS_SIM == _ABIO32
d25102aa
AO
65/* Earlier versions of glibc for mips had an entirely different
66 definition of mcontext_t, that didn't even resemble the
ff347533
JM
67 corresponding kernel data structure. Fortunately, makecontext,
68 [gs]etcontext et all were not implemented back then, so this can
69 still be rectified. */
d25102aa
AO
70typedef struct
71 {
139904b7
JM
72 unsigned int __ctx(regmask);
73 unsigned int __ctx(status);
74 greg_t __ctx(pc);
75 gregset_t __ctx(gregs);
76 fpregset_t __ctx(fpregs);
77 unsigned int __ctx(fp_owned);
78 unsigned int __ctx(fpc_csr);
79 unsigned int __ctx(fpc_eir);
80 unsigned int __ctx(used_math);
81 unsigned int __ctx(dsp);
82 greg_t __ctx(mdhi);
83 greg_t __ctx(mdlo);
84 unsigned long __ctx(hi1);
85 unsigned long __ctx(lo1);
86 unsigned long __ctx(hi2);
87 unsigned long __ctx(lo2);
88 unsigned long __ctx(hi3);
89 unsigned long __ctx(lo3);
d25102aa
AO
90 } mcontext_t;
91#else
1b1d9381
UD
92typedef struct
93 {
139904b7
JM
94 gregset_t __ctx(gregs);
95 fpregset_t __ctx(fpregs);
96 greg_t __ctx(mdhi);
97 greg_t __ctx(hi1);
98 greg_t __ctx(hi2);
99 greg_t __ctx(hi3);
100 greg_t __ctx(mdlo);
101 greg_t __ctx(lo1);
102 greg_t __ctx(lo2);
103 greg_t __ctx(lo3);
104 greg_t __ctx(pc);
105 unsigned int __ctx(fpc_csr);
106 unsigned int __ctx(used_math);
107 unsigned int __ctx(dsp);
fd9f30f6 108 unsigned int __glibc_reserved1;
1b1d9381 109 } mcontext_t;
d25102aa 110#endif
1b1d9381
UD
111
112/* Userlevel context. */
25128773 113typedef struct ucontext_t
1b1d9381 114 {
3d452dab 115 unsigned long int __ctx(uc_flags);
25128773 116 struct ucontext_t *uc_link;
1b1d9381
UD
117 stack_t uc_stack;
118 mcontext_t uc_mcontext;
cfed8ece 119 sigset_t uc_sigmask;
1b1d9381
UD
120 } ucontext_t;
121
3d452dab
JM
122#undef __ctx
123
1b1d9381 124#endif /* sys/ucontext.h */