Module Name: src
Committed By: uwe
Date: Tue Feb 1 01:54:14 UTC 2011
Modified Files:
src/sys/arch/sh3/sh3: locore_subr.S vm_machdep.c
Log Message:
cpu_setfunc() must use lwp_trampoline to arrange for the recycled lwp
to go through lwp_startup() the first time it's switched to.
This makes NetBSD-4.x SA binaries work on current. Tested with dig(1)
in NetBSD-4.x chroot on landisk.
Looks like this mistake of mine was picked up and replicated in
several other ports, sorry.
Reported by chuck@ in PR kern/44500
To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/sh3/sh3/locore_subr.S
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/sh3/sh3/vm_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/sh3/sh3/locore_subr.S
diff -u src/sys/arch/sh3/sh3/locore_subr.S:1.53 src/sys/arch/sh3/sh3/locore_subr.S:1.54
--- src/sys/arch/sh3/sh3/locore_subr.S:1.53 Sat Mar 20 23:31:30 2010
+++ src/sys/arch/sh3/sh3/locore_subr.S Tue Feb 1 01:54:14 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: locore_subr.S,v 1.53 2010/03/20 23:31:30 chs Exp $ */
+/* $NetBSD: locore_subr.S,v 1.54 2011/02/01 01:54:14 uwe Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
#include <sh3/mmu_sh3.h>
#include <sh3/mmu_sh4.h>
-__KERNEL_RCSID(0, "$NetBSD: locore_subr.S,v 1.53 2010/03/20 23:31:30 chs Exp $")
+__KERNEL_RCSID(0, "$NetBSD: locore_subr.S,v 1.54 2011/02/01 01:54:14 uwe Exp $")
/*
@@ -388,7 +388,6 @@
mov r0, r4 /* previous lwp returned by cpu_switchto */
jsr @r1
mov r10, r5 /* my struct lwp */
-ALTENTRY(lwp_setfunc_trampoline)
jsr @r12
mov r11, r4
__EXCEPTION_RETURN
Index: src/sys/arch/sh3/sh3/vm_machdep.c
diff -u src/sys/arch/sh3/sh3/vm_machdep.c:1.69 src/sys/arch/sh3/sh3/vm_machdep.c:1.70
--- src/sys/arch/sh3/sh3/vm_machdep.c:1.69 Fri Jan 14 02:06:31 2011
+++ src/sys/arch/sh3/sh3/vm_machdep.c Tue Feb 1 01:54:14 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.69 2011/01/14 02:06:31 rmind Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.70 2011/02/01 01:54:14 uwe Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.69 2011/01/14 02:06:31 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.70 2011/02/01 01:54:14 uwe Exp $");
#include "opt_kstack_debug.h"
@@ -107,7 +107,6 @@
#include <sh3/userret.h>
extern void lwp_trampoline(void);
-extern void lwp_setfunc_trampoline(void);
static void sh3_setup_uarea(struct lwp *);
@@ -176,7 +175,8 @@
l->l_md.md_regs->tf_ssr = PSL_USERSET;
/* When lwp is switched to, jump to the trampoline */
- sf->sf_pr = (int)lwp_setfunc_trampoline;
+ sf->sf_pr = (int)lwp_trampoline;
+ sf->sf_r10 = (int)l; /* "new" lwp for lwp_startup() */
sf->sf_r11 = (int)arg; /* hook function/argument */
sf->sf_r12 = (int)func;
}