]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/i386/sys/ucontext.h
Update copyright dates with scripts/update-copyrights
[thirdparty/glibc.git] / sysdeps / i386 / sys / ucontext.h
CommitLineData
2b778ceb 1/* Copyright (C) 1997-2021 Free Software Foundation, Inc.
dfd2257a
UD
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
dfd2257a
UD
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 12 Lesser General Public License for more details.
dfd2257a 13
41bdb6e2 14 You should have received a copy of the GNU Lesser General Public
59ba27a6 15 License along with the GNU C Library; if not, see
5a82c748 16 <https://www.gnu.org/licenses/>. */
dfd2257a
UD
17
18/* System V/i386 ABI compliant context switching support. */
19
20#ifndef _SYS_UCONTEXT_H
21#define _SYS_UCONTEXT_H 1
22
23#include <features.h>
dfd2257a 24
cfed8ece 25#include <bits/types/sigset_t.h>
0bcec532 26#include <bits/types/stack_t.h>
c66b29f9
ZW
27
28
dfd2257a
UD
29/* Type for general register. */
30typedef int greg_t;
31
32/* Number of general registers. */
139904b7
JM
33#define __NGREG 19
34#ifdef __USE_MISC
35# define NGREG __NGREG
36#endif
dfd2257a
UD
37
38/* Container for all general registers. */
139904b7 39typedef greg_t gregset_t[__NGREG];
dfd2257a 40
5df4854e 41#ifdef __USE_MISC
dfd2257a
UD
42/* Number of each register is the `gregset_t' array. */
43enum
44{
4ae18693 45 REG_GS = 0,
5df4854e 46# define REG_GS REG_GS
4ae18693 47 REG_FS,
5df4854e 48# define REG_FS REG_FS
4ae18693 49 REG_ES,
5df4854e 50# define REG_ES REG_ES
4ae18693 51 REG_DS,
5df4854e 52# define REG_DS REG_DS
4ae18693 53 REG_EDI,
5df4854e 54# define REG_EDI REG_EDI
4ae18693 55 REG_ESI,
5df4854e 56# define REG_ESI REG_ESI
4ae18693 57 REG_EBP,
5df4854e 58# define REG_EBP REG_EBP
4ae18693 59 REG_ESP,
5df4854e 60# define REG_ESP REG_ESP
4ae18693 61 REG_EBX,
5df4854e 62# define REG_EBX REG_EBX
4ae18693 63 REG_EDX,
5df4854e 64# define REG_EDX REG_EDX
4ae18693 65 REG_ECX,
5df4854e 66# define REG_ECX REG_ECX
4ae18693 67 REG_EAX,
5df4854e 68# define REG_EAX REG_EAX
4ae18693 69 REG_TRAPNO,
5df4854e 70# define REG_TRAPNO REG_TRAPNO
4ae18693 71 REG_ERR,
5df4854e 72# define REG_ERR REG_ERR
4ae18693 73 REG_EIP,
5df4854e 74# define REG_EIP REG_EIP
4ae18693 75 REG_CS,
5df4854e 76# define REG_CS REG_CS
4ae18693 77 REG_EFL,
5df4854e 78# define REG_EFL REG_EFL
4ae18693 79 REG_UESP,
5df4854e 80# define REG_UESP REG_UESP
4ae18693 81 REG_SS
5df4854e 82# define REG_SS REG_SS
dfd2257a 83};
5df4854e 84#endif
dfd2257a 85
139904b7
JM
86#ifdef __USE_MISC
87# define __ctx(fld) fld
88# define __ctxt(tag) tag
89#else
90# define __ctx(fld) __ ## fld
91# define __ctxt(tag) /* Empty. */
92#endif
93
dfd2257a 94/* Structure to describe FPU registers. */
81b032c8 95typedef struct
dfd2257a
UD
96 {
97 union
98 {
139904b7 99 struct __ctxt(fpchip_state)
dfd2257a 100 {
139904b7
JM
101 int __ctx(state)[27];
102 int __ctx(status);
103 } __ctx(fpchip_state);
dfd2257a 104
139904b7 105 struct __ctxt(fp_emul_space)
dfd2257a 106 {
139904b7
JM
107 char __ctx(fp_emul)[246];
108 char __ctx(fp_epad)[2];
109 } __ctx(fp_emul_space);
dfd2257a 110
139904b7
JM
111 int __ctx(f_fpregs)[62];
112 } __ctx(fp_reg_set);
dfd2257a 113
139904b7 114 long int __ctx(f_wregs)[33];
dfd2257a
UD
115 } fpregset_t;
116
117/* Context to describe whole processor state. */
118typedef struct
119 {
139904b7
JM
120 gregset_t __ctx(gregs);
121 fpregset_t __ctx(fpregs);
dfd2257a
UD
122 } mcontext_t;
123
124/* Userlevel context. */
25128773 125typedef struct ucontext_t
dfd2257a 126 {
3d452dab 127 unsigned long int __ctx(uc_flags);
25128773 128 struct ucontext_t *uc_link;
cfed8ece 129 sigset_t uc_sigmask;
dfd2257a
UD
130 stack_t uc_stack;
131 mcontext_t uc_mcontext;
3d452dab 132 long int __glibc_reserved1[5];
dfd2257a
UD
133 } ucontext_t;
134
3d452dab
JM
135#undef __ctx
136#undef __ctxt
137
dfd2257a 138#endif /* sys/ucontext.h */