pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/sr/patches Be more careful when abusing libpthrea...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/56a75d246958
branches:  trunk
changeset: 490023:56a75d246958
user:      is <is%pkgsrc.org@localhost>
date:      Wed Mar 02 13:21:34 2005 +0000

description:
Be more careful when abusing libpthread internals. Should help SR on
RISC machines. Version bump to 2.3.3nb1.

diffstat:

 lang/sr/patches/patch-au |  28 ++++++++++++----------------
 1 files changed, 12 insertions(+), 16 deletions(-)

diffs (72 lines):

diff -r 8a151e34ddbf -r 56a75d246958 lang/sr/patches/patch-au
--- a/lang/sr/patches/patch-au  Wed Mar 02 13:21:33 2005 +0000
+++ b/lang/sr/patches/patch-au  Wed Mar 02 13:21:34 2005 +0000
@@ -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 @@
 +
 +#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 @@
 +{
 +    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 @@
 +}
 +
 +/*
-+ *  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)



Home | Main Index | Thread Index | Old Index