summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/ucontext.h
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>1999-10-04 19:33:58 +0000
committermarcel <marcel@FreeBSD.org>1999-10-04 19:33:58 +0000
commit05e89da65f3f17ac5d45847a1070dff333d05e7a (patch)
tree5374ca102220e75048c919ed852c428f9646cddf /sys/i386/include/ucontext.h
parent77802960193ff746b91be4aae32ed2a9ed8b5090 (diff)
downloadFreeBSD-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/ucontext.h')
-rw-r--r--sys/i386/include/ucontext.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/sys/i386/include/ucontext.h b/sys/i386/include/ucontext.h
index bdf2e1d..0d72716 100644
--- a/sys/i386/include/ucontext.h
+++ b/sys/i386/include/ucontext.h
@@ -29,15 +29,22 @@
*/
#ifndef _MACHINE_UCONTEXT_H_
-#define _MACHINE_UCONTEXT_H_ 1
+#define _MACHINE_UCONTEXT_H_
#include <machine/frame.h>
-typedef struct {
- int mc_gs; /* %gs */
- struct trapframe mc_tf; /* trapframe */
- int mc_fpregs[28]; /* env87 + fpacc87 + u_long */
- int __spare__[17];
+typedef struct __mcontext {
+ /*
+ * The first 3 fields must match the definition of
+ * sigcontext. So that we can support sigcontext
+ * and ucontext_t at the same time.
+ */
+ int mc_onstack; /* XXX - sigcontext compat. */
+ int mc_gs;
+ struct trapframe mc_tf;
+
+ int mc_fpregs[28]; /* env87 + fpacc87 + u_long */
+ int __spare__[17];
} mcontext_t;
-#endif /* _MACHINE_UCONTEXT_H_ */
+#endif /* !_MACHINE_UCONTEXT_H_ */
OpenPOWER on IntegriCloud