summaryrefslogtreecommitdiff
path: root/lang/sr/patches/patch-au
diff options
context:
space:
mode:
authoris <is@pkgsrc.org>2005-03-02 13:21:34 +0000
committeris <is@pkgsrc.org>2005-03-02 13:21:34 +0000
commit3a99b11388a6d46a3496818d63636eb87fe3f958 (patch)
tree42a7420f48d58d9f84b8ce83eec0838e9933a854 /lang/sr/patches/patch-au
parent2a0caba344e53f61cbc87602868e7f9176842397 (diff)
downloadpkgsrc-3a99b11388a6d46a3496818d63636eb87fe3f958.tar.gz
Be more careful when abusing libpthread internals. Should help SR on
RISC machines. Version bump to 2.3.3nb1.
Diffstat (limited to 'lang/sr/patches/patch-au')
-rw-r--r--lang/sr/patches/patch-au28
1 files changed, 12 insertions, 16 deletions
diff --git a/lang/sr/patches/patch-au b/lang/sr/patches/patch-au
index 17fbdac5ba0..beb4a68bd5a 100644
--- a/lang/sr/patches/patch-au
+++ b/lang/sr/patches/patch-au
@@ -1,8 +1,8 @@
-$NetBSD: patch-au,v 1.2 2005/03/01 10:00:47 is Exp $
+$NetBSD: patch-au,v 1.3 2005/03/02 13:21:34 is Exp $
---- csw/netbsd.c.orig 2005-03-01 09:35:06.000000000 +0000
+--- csw/netbsd.c.orig 2005-03-02 13:00:06.000000000 +0000
+++ csw/netbsd.c
-@@ -0,0 +1,116 @@
+@@ -0,0 +1,112 @@
+/*
+ * netbsd.c -- context switch code for NetBSD 2.
+ *
@@ -11,31 +11,25 @@ $NetBSD: patch-au,v 1.2 2005/03/01 10:00:47 is Exp $
+
+#include <ucontext.h>
+
-+static void startup();
-+void sr_stk_underflow();
++void sr_stk_underflow(void);
++void sr_stk_corrupted(void);
++
++static void startup(void (*)(void), unsigned long, unsigned long, unsigned long, unsigned long);
+
+#ifdef __i386__
+void pthread__i386_init(void);
+
-+#define _getcontext_u(uc) (*_md_getcontext_u)(uc)
+#define _setcontext_u(uc) (*_md_setcontext_u)(uc)
+#define _swapcontext_u(oc,nc) (*_md_swapcontext_u)(oc,nc)
+
-+static void sr_getcontext_u(ucontext_t *);
+static void sr_setcontext_u(ucontext_t *);
+static void sr_swapcontext_u(ucontext_t *, ucontext_t *);
+
-+void (*_md_getcontext_u) (ucontext_t *) = sr_getcontext_u;
++void (*_md_getcontext_u) (ucontext_t *);
+void (*_md_setcontext_u) (ucontext_t *) = sr_setcontext_u;
+void (*_md_swapcontext_u)(ucontext_t *, ucontext_t *) = sr_swapcontext_u;
+
+static void
-+sr_getcontext_u(ucontext_t *uc) {
-+ pthread__i386_init();
-+ _getcontext_u(uc);
-+}
-+
-+static void
+sr_setcontext_u(ucontext_t *uc) {
+ pthread__i386_init();
+ _setcontext_u(uc);
@@ -65,7 +59,9 @@ $NetBSD: patch-au,v 1.2 2005/03/01 10:00:47 is Exp $
+{
+ ucontext_t *uc = (ucontext_t *) buf; /* put header at front of buf */
+
-+ _getcontext_u(uc); /* initialize context */
++ if (0 != getcontext(uc)) { /* initialize context */
++ sr_stk_corrupted();
++ }
+
+ uc->uc_stack.ss_sp = buf + sizeof (ucontext_t);
+ uc->uc_stack.ss_size = bufsize - sizeof (ucontext_t);
@@ -75,7 +71,7 @@ $NetBSD: patch-au,v 1.2 2005/03/01 10:00:47 is Exp $
+}
+
+/*
-+ * startup (func, stk) -- intermediary for startup and underflow detection.
++ * startup (func, a,b,c,d) -- intermediary for startup and underflow detection.
+ */
+static void
+startup (func, arg1, arg2, arg3, arg4)