1995-02-18 01:27:10 +00:00
|
|
|
/* Machine-dependent signal context structure for GNU Hurd. i386 version.
|
2019-01-01 00:11:28 +00:00
|
|
|
Copyright (C) 1991-2019 Free Software Foundation, Inc.
|
1997-06-23 21:55:26 +00:00
|
|
|
This file is part of the GNU C Library.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1997-06-23 21:55:26 +00:00
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1997-06-23 21:55:26 +00:00
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 04:58:11 +00:00
|
|
|
Lesser General Public License for more details.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
Installed-header hygiene (BZ#20366): stack_t.
sys/ucontext.h unconditionally uses stack_t, and it does not make
sense to change that. But signal.h only declares stack_t under
__USE_XOPEN_EXTENDED || __USE_XOPEN2K8. The actual definition is
already in a bits header, bits/sigstack.h, but that header insists on
only being included by signal.h, so we have to change that as well as
all of the sys/ucontext.h variants. (Some but not all variants of
bits/sigcontext.h, which sys/ucontext.h may also need, had already
received this adjustment; for consistency, I made them all the same,
even if that's not strictly necessary in some configurations.)
bits/sigcontext.h and bits/sigstack.h also all need to receive
multiple inclusion guards.
* sysdeps/generic/sys/ucontext.h
* sysdeps/arm/sys/ucontext.h
* sysdeps/i386/sys/ucontext.h
* sysdeps/m68k/sys/ucontext.h
* sysdeps/mips/sys/ucontext.h
* sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
* sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
* sysdeps/unix/sysv/linux/arm/sys/ucontext.h
* sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
* sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
* sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
* sysdeps/unix/sysv/linux/mips/sys/ucontext.h
* sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
* sysdeps/unix/sysv/linux/s390/sys/ucontext.h
* sysdeps/unix/sysv/linux/sh/sys/ucontext.h
* sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
* sysdeps/unix/sysv/linux/tile/sys/ucontext.h
* sysdeps/unix/sysv/linux/x86/sys/ucontext.h:
Include both bits/sigcontext.h and bits/sigstack.h.
Fix grammar error in comment, if present.
* bits/sigstack.h
* sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h
* sysdeps/unix/sysv/linux/alpha/bits/sigstack.h
* sysdeps/unix/sysv/linux/bits/sigstack.h
* sysdeps/unix/sysv/linux/ia64/bits/sigstack.h
* sysdeps/unix/sysv/linux/mips/bits/sigstack.h
* sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
* sysdeps/unix/sysv/linux/sparc/bits/sigstack.h
* bits/sigcontext.h
* sysdeps/mach/hurd/i386/bits/sigcontext.h
* sysdeps/unix/sysv/linux/bits/sigcontext.h
* sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
* sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h:
Add multiple inclusion guard. Permit inclusion by sys/ucontext.h
as well as signal.h, if this was not already allowed. Request
definition of size_t if necessary. Minimize semantically-null
differences across files.
2016-07-13 20:11:57 +00:00
|
|
|
#ifndef _BITS_SIGCONTEXT_H
|
|
|
|
#define _BITS_SIGCONTEXT_H 1
|
|
|
|
|
2002-01-02 09:52:33 +00:00
|
|
|
#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
|
1997-11-26 04:23:08 +00:00
|
|
|
# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
|
|
|
|
#endif
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
/* Signal handlers are actually called:
|
|
|
|
void handler (int sig, int code, struct sigcontext *scp); */
|
|
|
|
|
Remove __need macros from signal.h.
The types affected are __sig_atomic_t, sig_atomic_t, __sigset_t,
sigset_t, sigval_t, sigevent_t, and siginfo_t. __sig_atomic_t is a
scalar, so it's now directly available from bits/types.h. The others
get bits/types/ headers.
Side effects include: There have been small changes to which
non-signal headers expose which subset of the signal-related types.
A couple of architectures' nested siginfo_t fields had to be renamed
to prevent undesired macro expansion. Internal code that wants to
manipulate signal masks must now include <sigsetops.h> (which is not
installed) and should be aware that __sigaddset, __sigandset,
__sigdelset, __sigemptyset, and __sigorset no longer return a value
(unlike the public API). Relatedly, the public signal.h no longer
declares any of those functions. The obsolete sigmask() macro no
longer has a system-specific definition -- in the cases where it
matters, it didn't work anyway.
New Linux architectures should create bits/siginfo-arch.h and/or
bits/siginfo-consts-arch.h to customize their siginfo_t, rather than
duplicating everything in bits/siginfo.h (which no longer exists).
Add new __SI_* macros if necessary. Ports to other operating systems
are strongly encouraged to generalize this scheme further.
* bits/sigevent-consts.h
* bits/siginfo-consts.h
* bits/types/__sigset_t.h
* bits/types/sigevent_t.h
* bits/types/siginfo_t.h
* sysdeps/unix/sysv/linux/bits/sigevent-consts.h
* sysdeps/unix/sysv/linux/bits/siginfo-consts.h
* sysdeps/unix/sysv/linux/bits/types/__sigset_t.h
* sysdeps/unix/sysv/linux/bits/types/sigevent_t.h
* sysdeps/unix/sysv/linux/bits/types/siginfo_t.h:
New system-dependent bits headers.
* sysdeps/unix/sysv/linux/bits/siginfo-arch.h
* sysdeps/unix/sysv/linux/bits/siginfo-consts-arch.h
* sysdeps/unix/sysv/linux/ia64/bits/siginfo-arch.h
* sysdeps/unix/sysv/linux/ia64/bits/siginfo-consts-arch.h
* sysdeps/unix/sysv/linux/mips/bits/siginfo-arch.h
* sysdeps/unix/sysv/linux/sparc/bits/siginfo-arch.h
* sysdeps/unix/sysv/linux/tile/bits/siginfo-arch.h
* sysdeps/unix/sysv/linux/tile/bits/siginfo-consts-arch.h
* sysdeps/unix/sysv/linux/x86/bits/siginfo-arch.h:
New Linux-only system-dependent bits headers.
* signal/bits/types/sig_atomic_t.h
* signal/bits/types/sigset_t.h
* signal/bits/types/sigval_t.h:
New non-system-dependent bits headers.
* sysdeps/generic/sigsetops.h
* sysdeps/unix/sysv/linux/sigsetops.h:
New internal headers.
* include/bits/types/sig_atomic_t.h
* include/bits/types/sigset_t.h
* include/bits/types/sigval_t.h:
New wrappers.
* signal/sigsetops.h
* bits/siginfo.h
* bits/sigset.h
* sysdeps/unix/sysv/linux/bits/siginfo.h
* sysdeps/unix/sysv/linux/bits/sigset.h
* sysdeps/unix/sysv/linux/ia64/bits/siginfo.h
* sysdeps/unix/sysv/linux/mips/bits/siginfo.h
* sysdeps/unix/sysv/linux/s390/bits/siginfo.h
* sysdeps/unix/sysv/linux/sparc/bits/siginfo.h
* sysdeps/unix/sysv/linux/tile/bits/siginfo.h
* sysdeps/unix/sysv/linux/x86/bits/siginfo.h:
Deleted.
* signal/Makefile, sysdeps/unix/sysv/linux/Makefile:
Update lists of installed headers.
* posix/bits/types.h: Define __sig_atomic_t here.
* signal/signal.h: Use the new bits headers; no need to handle
__need_sig_atomic_t nor __need_sigset_t. Don't use __sigmask
to define sigmask.
* include/signal.h: No need to handle __need_sig_atomic_t
nor __need_sigset_t. Don't define __sigemptyset.
* io/sys/poll.h, setjmp/setjmp.h
* sysdeps/arm/sys/ucontext.h, sysdeps/generic/sys/ucontext.h
* sysdeps/i386/sys/ucontext.h, sysdeps/m68k/sys/ucontext.h
* sysdeps/mach/hurd/i386/bits/sigcontext.h
* sysdeps/mips/sys/ucontext.h, sysdeps/powerpc/novmxsetjmp.h
* sysdeps/pthread/bits/sigthread.h
* sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
* sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
* sysdeps/unix/sysv/linux/mips/sys/ucontext.h
* sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
* sysdeps/unix/sysv/linux/s390/sys/ucontext.h
* sysdeps/unix/sysv/linux/sh/sys/ucontext.h
* sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
* sysdeps/unix/sysv/linux/tile/sys/ucontext.h
* sysdeps/unix/sysv/linux/x86/sys/ucontext.h:
Use bits/types/__sigset_t.h.
* misc/sys/select.h, posix/spawn.h
* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
* sysdeps/unix/sysv/linux/sys/epoll.h
* sysdeps/unix/sysv/linux/sys/signalfd.h:
Use bits/types/sigset_t.h.
* resolv/netdb.h, rt/mqueue.h: Use bits/types/sigevent_t.h.
* rt/aio.h: Use bits/types/sigevent_t.h and bits/sigevent-consts.h.
* socket/sys/socket.h: Don't include bits/sigset.h.
* login/utmp_file.c, shadow/lckpwdf.c, signal/sigandset.c
* signal/sigisempty.c, stdlib/abort.c, sysdeps/posix/profil.c
* sysdeps/posix/sigignore.c, sysdeps/posix/sigintr.c
* sysdeps/posix/signal.c, sysdeps/posix/sigset.c
* sysdeps/posix/sprofil.c, sysdeps/posix/sysv_signal.c
* sysdeps/unix/sysv/linux/nptl-signals.h:
Include sigsetops.h.
* signal/sigaddset.c, signal/sigandset.c, signal/sigdelset.c
* signal/sigorset.c, stdlib/abort.c, sysdeps/posix/sigignore.c
* sysdeps/posix/signal.c, sysdeps/posix/sigset.c:
__sigaddset, __sigandset, __sigdelset, __sigemptyset, __sigorset
now return no value.
* signal/sigaddset.c, signal/sigdelset.c, signal/sigismem.c
Include <errno.h>, <signal.h>, and <sigsetops.h> instead of
"sigsetops.h".
* signal/sigsetops.c: Explicitly define __sigismember,
__sigaddset, and __sigdelset as compatibility symbols.
* signal/Versions: Correct commentary on __sigpause,
__sigaddset, __sigdelset, __sigismember.
* inet/rcmd.c: Include sigsetops.h. Convert old code using
__sigblock/__sigsetmask to use __sigprocmask and friends.
2016-12-02 00:24:13 +00:00
|
|
|
#include <bits/types/__sigset_t.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
#include <mach/machine/fp_reg.h>
|
|
|
|
|
|
|
|
/* State of this thread when the signal was taken. */
|
|
|
|
struct sigcontext
|
|
|
|
{
|
|
|
|
/* These first members are machine-independent. */
|
|
|
|
|
|
|
|
int sc_onstack; /* Nonzero if running on sigstack. */
|
|
|
|
__sigset_t sc_mask; /* Blocked signals to restore. */
|
|
|
|
|
|
|
|
/* MiG reply port this thread is using. */
|
|
|
|
unsigned int sc_reply_port;
|
|
|
|
|
|
|
|
/* Port this thread is doing an interruptible RPC on. */
|
|
|
|
unsigned int sc_intr_port;
|
|
|
|
|
|
|
|
/* Error code associated with this signal (interpreted as `error_t'). */
|
|
|
|
int sc_error;
|
|
|
|
|
|
|
|
/* All following members are machine-dependent. The rest of this
|
|
|
|
structure is written to be laid out identically to:
|
|
|
|
{
|
1997-06-23 21:55:26 +00:00
|
|
|
struct i386_thread_state basic;
|
|
|
|
struct i386_float_state fpu;
|
1995-02-18 01:27:10 +00:00
|
|
|
}
|
|
|
|
trampoline.c knows this, so it must be changed if this changes. */
|
|
|
|
|
|
|
|
#define sc_i386_thread_state sc_gs /* Beginning of correspondence. */
|
|
|
|
/* Segment registers. */
|
|
|
|
int sc_gs;
|
|
|
|
int sc_fs;
|
|
|
|
int sc_es;
|
|
|
|
int sc_ds;
|
1997-06-23 21:55:26 +00:00
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
/* "General" registers. These members are in the order that the i386
|
|
|
|
`pusha' and `popa' instructions use (`popa' ignores %esp). */
|
|
|
|
int sc_edi;
|
|
|
|
int sc_esi;
|
|
|
|
int sc_ebp;
|
|
|
|
int sc_esp; /* Not used; sc_uesp is used instead. */
|
|
|
|
int sc_ebx;
|
|
|
|
int sc_edx;
|
|
|
|
int sc_ecx;
|
|
|
|
int sc_eax;
|
1997-06-23 21:55:26 +00:00
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
int sc_eip; /* Instruction pointer. */
|
|
|
|
int sc_cs; /* Code segment register. */
|
1997-06-23 21:55:26 +00:00
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
int sc_efl; /* Processor flags. */
|
|
|
|
|
|
|
|
int sc_uesp; /* This stack pointer is used. */
|
|
|
|
int sc_ss; /* Stack segment register. */
|
|
|
|
|
|
|
|
/* Following mimics struct i386_float_state. Structures and symbolic
|
|
|
|
values can be found in <mach/i386/fp_reg.h>. */
|
|
|
|
#define sc_i386_float_state sc_fpkind
|
|
|
|
int sc_fpkind; /* FP_NO, FP_387, etc. */
|
|
|
|
int sc_fpused; /* If zero, ignore rest of float state. */
|
|
|
|
struct i386_fp_save sc_fpsave;
|
|
|
|
struct i386_fp_regs sc_fpregs;
|
|
|
|
int sc_fpexcsr; /* FPSR including exception bits. */
|
|
|
|
};
|
|
|
|
|
* sysdeps/mach/hurd/i386/bits/sigcontext.h (sc_sp, sc_fp, sc_pc, sc_ps): Define as aliases for sc_uesp, sc_ebl, sc_eip and sc_efl.
* sysdeps/mach/hurd/i386/bits/sigcontext.h (sc_sp, sc_fp, sc_pc,
sc_ps): Define as aliases for sc_uesp, sc_ebl, sc_eip and sc_efl.
2001-03-24 21:53:18 +00:00
|
|
|
/* Traditional BSD names for some members. */
|
|
|
|
#define sc_sp sc_uesp /* Stack pointer. */
|
|
|
|
#define sc_fp sc_ebp /* Frame pointer. */
|
|
|
|
#define sc_pc sc_eip /* Process counter. */
|
|
|
|
#define sc_ps sc_efl
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
/* Codes for SIGFPE. */
|
|
|
|
#define FPE_INTOVF_TRAP 0x1 /* integer overflow */
|
|
|
|
#define FPE_INTDIV_FAULT 0x2 /* integer divide by zero */
|
|
|
|
#define FPE_FLTOVF_FAULT 0x3 /* floating overflow */
|
|
|
|
#define FPE_FLTDIV_FAULT 0x4 /* floating divide by zero */
|
|
|
|
#define FPE_FLTUND_FAULT 0x5 /* floating underflow */
|
|
|
|
#define FPE_SUBRNG_FAULT 0x7 /* BOUNDS instruction failed */
|
|
|
|
#define FPE_FLTDNR_FAULT 0x8 /* denormalized operand */
|
|
|
|
#define FPE_FLTINX_FAULT 0x9 /* floating loss of precision */
|
|
|
|
#define FPE_EMERR_FAULT 0xa /* mysterious emulation error 33 */
|
|
|
|
#define FPE_EMBND_FAULT 0xb /* emulation BOUNDS instruction failed */
|
|
|
|
|
|
|
|
/* Codes for SIGILL. */
|
|
|
|
#define ILL_INVOPR_FAULT 0x1 /* invalid operation */
|
|
|
|
#define ILL_STACK_FAULT 0x2 /* fault on microkernel stack access */
|
|
|
|
#define ILL_FPEOPR_FAULT 0x3 /* invalid floating operation */
|
|
|
|
|
|
|
|
/* Codes for SIGTRAP. */
|
|
|
|
#define DBG_SINGLE_TRAP 0x1 /* single step */
|
|
|
|
#define DBG_BRKPNT_FAULT 0x2 /* breakpoint instruction */
|
2002-01-02 09:52:33 +00:00
|
|
|
|
Installed-header hygiene (BZ#20366): stack_t.
sys/ucontext.h unconditionally uses stack_t, and it does not make
sense to change that. But signal.h only declares stack_t under
__USE_XOPEN_EXTENDED || __USE_XOPEN2K8. The actual definition is
already in a bits header, bits/sigstack.h, but that header insists on
only being included by signal.h, so we have to change that as well as
all of the sys/ucontext.h variants. (Some but not all variants of
bits/sigcontext.h, which sys/ucontext.h may also need, had already
received this adjustment; for consistency, I made them all the same,
even if that's not strictly necessary in some configurations.)
bits/sigcontext.h and bits/sigstack.h also all need to receive
multiple inclusion guards.
* sysdeps/generic/sys/ucontext.h
* sysdeps/arm/sys/ucontext.h
* sysdeps/i386/sys/ucontext.h
* sysdeps/m68k/sys/ucontext.h
* sysdeps/mips/sys/ucontext.h
* sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
* sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
* sysdeps/unix/sysv/linux/arm/sys/ucontext.h
* sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
* sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
* sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
* sysdeps/unix/sysv/linux/mips/sys/ucontext.h
* sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
* sysdeps/unix/sysv/linux/s390/sys/ucontext.h
* sysdeps/unix/sysv/linux/sh/sys/ucontext.h
* sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
* sysdeps/unix/sysv/linux/tile/sys/ucontext.h
* sysdeps/unix/sysv/linux/x86/sys/ucontext.h:
Include both bits/sigcontext.h and bits/sigstack.h.
Fix grammar error in comment, if present.
* bits/sigstack.h
* sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h
* sysdeps/unix/sysv/linux/alpha/bits/sigstack.h
* sysdeps/unix/sysv/linux/bits/sigstack.h
* sysdeps/unix/sysv/linux/ia64/bits/sigstack.h
* sysdeps/unix/sysv/linux/mips/bits/sigstack.h
* sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
* sysdeps/unix/sysv/linux/sparc/bits/sigstack.h
* bits/sigcontext.h
* sysdeps/mach/hurd/i386/bits/sigcontext.h
* sysdeps/unix/sysv/linux/bits/sigcontext.h
* sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
* sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h:
Add multiple inclusion guard. Permit inclusion by sys/ucontext.h
as well as signal.h, if this was not already allowed. Request
definition of size_t if necessary. Minimize semantically-null
differences across files.
2016-07-13 20:11:57 +00:00
|
|
|
#endif /* bits/sigcontext.h */
|