1 /* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
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.
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
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 #ifndef _SYS_UCONTEXT_H
20 #define _SYS_UCONTEXT_H 1
25 /* We need the signal context definitions even if they are not used
26 included in <signal.h>. */
27 #include <bits/sigcontext.h>
30 /* Type for general register. */
33 /* Number of general registers. */
36 /* Container for all general registers. */
37 typedef greg_t gregset_t
[NGREG
];
40 /* Number of each register is the `gregset_t' array. */
44 # define REG_GS REG_GS
46 # define REG_FS REG_FS
48 # define REG_ES REG_ES
50 # define REG_DS REG_DS
52 # define REG_EDI REG_EDI
54 # define REG_ESI REG_ESI
56 # define REG_EBP REG_EBP
58 # define REG_ESP REG_ESP
60 # define REG_EBX REG_EBX
62 # define REG_EDX REG_EDX
64 # define REG_ECX REG_ECX
66 # define REG_EAX REG_EAX
68 # define REG_TRAPNO REG_TRAPNO
70 # define REG_ERR REG_ERR
72 # define REG_EIP REG_EIP
74 # define REG_CS REG_CS
76 # define REG_EFL REG_EFL
78 # define REG_UESP REG_UESP
80 # define REG_SS REG_SS
84 /* Definitions taken from the kernel headers. */
87 unsigned short int significand
[4];
88 unsigned short int exponent
;
95 unsigned long int tag
;
96 unsigned long int ipoff
;
97 unsigned long int cssel
;
98 unsigned long int dataoff
;
99 unsigned long int datasel
;
100 struct _libc_fpreg _st
[8];
101 unsigned long int status
;
104 /* Structure to describe FPU registers. */
105 typedef struct _libc_fpstate
*fpregset_t
;
107 /* Context to describe whole processor state. */
111 /* Due to Linux's history we have to use a pointer here. The SysV/i386
112 ABI requires a struct with the values. */
114 unsigned long int oldmask
;
115 unsigned long int cr2
;
118 /* Userlevel context. */
119 typedef struct ucontext
121 unsigned long int uc_flags
;
122 struct ucontext
*uc_link
;
124 mcontext_t uc_mcontext
;
125 __sigset_t uc_sigmask
;
126 struct _libc_fpstate __fpregs_mem
;
129 #endif /* sys/ucontext.h */