diff options
author | marcel <marcel@FreeBSD.org> | 1999-10-04 19:33:58 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 1999-10-04 19:33:58 +0000 |
commit | 05e89da65f3f17ac5d45847a1070dff333d05e7a (patch) | |
tree | 5374ca102220e75048c919ed852c428f9646cddf /sys/i386/include/signal.h | |
parent | 77802960193ff746b91be4aae32ed2a9ed8b5090 (diff) | |
download | FreeBSD-src-05e89da65f3f17ac5d45847a1070dff333d05e7a.zip FreeBSD-src-05e89da65f3f17ac5d45847a1070dff333d05e7a.tar.gz |
Re-introduction of sigcontext.
struct sigcontext and ucontext_t/mcontext_t are defined in such
a way that both (ie struct sigcontext and ucontext_t) can be
passed on to sigreturn. The signal handler is still given a
ucontext_t for maximum flexibility.
For backward compatibility sigreturn restores the state for the
alternate signal stack from sigcontext.sc_onstack and not from
ucontext_t.uc_stack. A good way to determine which value the
application has set and thus which value to use, is still open
for discussion.
NOTE: This change should only affect those binaries that use
sigcontext and/or ucontext_t. In the source tree itself
this is only doscmd. Recompilation is required for those
applications.
This commit also fixes a lot of style bugs without hopefully
adding new ones.
NOTE: struct sigaltstack.ss_size now has type size_t again. For
some reason I changed that into unsigned int.
Parts submitted by: bde
sigaltstack bug found by: bde
Diffstat (limited to 'sys/i386/include/signal.h')
-rw-r--r-- | sys/i386/include/signal.h | 73 |
1 files changed, 51 insertions, 22 deletions
diff --git a/sys/i386/include/signal.h b/sys/i386/include/signal.h index e9f739e..f02539e 100644 --- a/sys/i386/include/signal.h +++ b/sys/i386/include/signal.h @@ -57,33 +57,62 @@ typedef int sig_atomic_t; typedef unsigned int osigset_t; struct osigcontext { - int sc_onstack; /* sigstack state to restore */ - osigset_t sc_mask; /* signal mask to restore */ - int sc_esp; /* machine state */ - int sc_ebp; - int sc_isp; - int sc_eip; - int sc_efl; - int sc_es; - int sc_ds; - int sc_cs; - int sc_ss; - int sc_edi; - int sc_esi; - int sc_ebx; - int sc_edx; - int sc_ecx; - int sc_eax; - int sc_gs; - int sc_fs; + int sc_onstack; /* sigstack state to restore */ + osigset_t sc_mask; /* signal mask to restore */ + int sc_esp; /* machine state */ + int sc_ebp; + int sc_isp; + int sc_eip; + int sc_efl; + int sc_es; + int sc_ds; + int sc_cs; + int sc_ss; + int sc_edi; + int sc_esi; + int sc_ebx; + int sc_edx; + int sc_ecx; + int sc_eax; + int sc_gs; + int sc_fs; + int sc_trapno; + int sc_err; +}; + +/* + * The sequence of the fields/registers in sigcontext should match + * those in mcontext_t. + */ +struct sigcontext { + sigset_t sc_mask; /* signal mask to restore */ + int sc_onstack; /* sigstack state to restore */ + int sc_gs; + int sc_fs; + int sc_es; + int sc_ds; + int sc_edi; + int sc_esi; + int sc_ebp; + int sc_isp; + int sc_ebx; + int sc_edx; + int sc_ecx; + int sc_eax; + int sc_trapno; + int sc_err; + int sc_eip; + int sc_cs; + int sc_efl; + int sc_esp; /* machine state */ + int sc_ss; +}; + #define sc_sp sc_esp #define sc_fp sc_ebp #define sc_pc sc_eip #define sc_ps sc_efl #define sc_eflags sc_efl - int sc_trapno; - int sc_err; -}; #endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */ |