Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc Move SFRAMELEN to frame.h and use it in vm_...
details: https://anonhg.NetBSD.org/src/rev/87b6268a732e
branches: trunk
changeset: 551034:87b6268a732e
user: matt <matt%NetBSD.org@localhost>
date: Wed Aug 27 20:20:07 2003 +0000
description:
Move SFRAMELEN to frame.h and use it in vm_machdep.c. In setfunc, setup
callframe linkages correctly. Restore use of ldptr to locore_subr.S
[pthreads and gdb no longer crash/hang the system]
diffstat:
sys/arch/powerpc/ibm4xx/genassym.cf | 4 ++--
sys/arch/powerpc/include/frame.h | 28 ++++++----------------------
sys/arch/powerpc/oea/genassym.cf | 4 ++--
sys/arch/powerpc/powerpc/locore_subr.S | 4 ++--
sys/arch/powerpc/powerpc/vm_machdep.c | 12 +++++-------
5 files changed, 17 insertions(+), 35 deletions(-)
diffs (152 lines):
diff -r 6801c16fff3a -r 87b6268a732e sys/arch/powerpc/ibm4xx/genassym.cf
--- a/sys/arch/powerpc/ibm4xx/genassym.cf Wed Aug 27 20:18:41 2003 +0000
+++ b/sys/arch/powerpc/ibm4xx/genassym.cf Wed Aug 27 20:20:07 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.7 2003/08/12 18:34:47 matt Exp $
+# $NetBSD: genassym.cf,v 1.8 2003/08/27 20:20:07 matt Exp $
#
# Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -113,7 +113,7 @@
define CFRAME_R30 offsetof(struct callframe, r30)
define CFRAME_R31 offsetof(struct callframe, r31)
-define SFRAMELEN roundup(sizeof(struct switchframe), CALLFRAMELEN)
+define SFRAMELEN SFRAMELEN
define SFRAME_SP offsetof(struct switchframe, sp)
define SFRAME_LR offsetof(struct switchframe, lr)
define SFRAME_USER_SR offsetof(struct switchframe, user_sr)
diff -r 6801c16fff3a -r 87b6268a732e sys/arch/powerpc/include/frame.h
--- a/sys/arch/powerpc/include/frame.h Wed Aug 27 20:18:41 2003 +0000
+++ b/sys/arch/powerpc/include/frame.h Wed Aug 27 20:20:07 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: frame.h,v 1.16 2003/08/12 18:34:48 matt Exp $ */
+/* $NetBSD: frame.h,v 1.17 2003/08/27 20:20:08 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -99,14 +99,15 @@
/*
* This is to ensure alignment of the stackpointer
*/
-#define FRAMELEN roundup(sizeof(struct trapframe) + 8, CALLFRAMELEN)
-#define trapframe(l) ((struct trapframe *)((char *)(l)->l_addr + USPACE - FRAMELEN + 8))
+#define FRAMELEN roundup(sizeof(struct trapframe) + 2*sizeof(register_t), CALLFRAMELEN)
+#define trapframe(l) ((struct trapframe *)((char *)(l)->l_addr + USPACE - FRAMELEN + 2*sizeof(register_t)))
+#define SFRAMELEN roundup(sizeof(struct switchframe), CALLFRAMELEN)
struct switchframe {
register_t sp;
register_t lr;
- register_t user_sr; /* VSID on IBM4XX */
- register_t cr;
+ register_t user_sr; /* VSID on IBM4XX */
+ register_t cr; /* why? CR is volatile. */
register_t fixreg2;
register_t fixreg[19]; /* R13-R31 */
};
@@ -164,21 +165,4 @@
register_t r0; /* 84 */
};
-#define SPFRAMELEN sizeof(struct spillframe)
-struct spillframe {
- register_t r1; /* 0 */
- register_t _pad4; /* 4 */
- register_t r12; /* 8 */
- register_t r11; /* 12 */
- register_t r10; /* 16 */
- register_t r9; /* 20 */
- register_t r8; /* 24 */
- register_t r7; /* 28 */
- register_t r6; /* 32 */
- register_t r5; /* 36 */
- register_t r4; /* 40 */
- register_t r3; /* 44 */
- register_t r0; /* 48 */
-};
-
#endif /* _POWERPC_FRAME_H_ */
diff -r 6801c16fff3a -r 87b6268a732e sys/arch/powerpc/oea/genassym.cf
--- a/sys/arch/powerpc/oea/genassym.cf Wed Aug 27 20:18:41 2003 +0000
+++ b/sys/arch/powerpc/oea/genassym.cf Wed Aug 27 20:20:07 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.5 2003/08/12 18:34:49 matt Exp $
+# $NetBSD: genassym.cf,v 1.6 2003/08/27 20:20:07 matt Exp $
#
# Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -126,7 +126,7 @@
define CFRAME_R30 offsetof(struct callframe, r30)
define CFRAME_R31 offsetof(struct callframe, r31)
-define SFRAMELEN roundup(sizeof(struct switchframe), CALLFRAMELEN)
+define SFRAMELEN SFRAMELEN
define SFRAME_SP offsetof(struct switchframe, sp)
define SFRAME_LR offsetof(struct switchframe, lr)
define SFRAME_USER_SR offsetof(struct switchframe, user_sr)
diff -r 6801c16fff3a -r 87b6268a732e sys/arch/powerpc/powerpc/locore_subr.S
--- a/sys/arch/powerpc/powerpc/locore_subr.S Wed Aug 27 20:18:41 2003 +0000
+++ b/sys/arch/powerpc/powerpc/locore_subr.S Wed Aug 27 20:20:07 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore_subr.S,v 1.19 2003/08/27 19:45:28 matt Exp $ */
+/* $NetBSD: locore_subr.S,v 1.20 2003/08/27 20:20:08 matt Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -443,7 +443,7 @@
*/
ldreg %r31,CFRAME_R31(%r1) /* restore saved registers */
ldreg %r30,CFRAME_R30(%r1)
-#if 1
+#if 0
addi %r1,%r1,CALLFRAMELEN
#else
ldreg %r1,CFRAME_SP(%r1) /* pop stack frmae */
diff -r 6801c16fff3a -r 87b6268a732e sys/arch/powerpc/powerpc/vm_machdep.c
--- a/sys/arch/powerpc/powerpc/vm_machdep.c Wed Aug 27 20:18:41 2003 +0000
+++ b/sys/arch/powerpc/powerpc/vm_machdep.c Wed Aug 27 20:20:07 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.55 2003/08/12 18:34:50 matt Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.56 2003/08/27 20:20:08 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.55 2003/08/12 18:34:50 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.56 2003/08/27 20:20:08 matt Exp $");
#include "opt_altivec.h"
#include "opt_multiprocessor.h"
@@ -155,7 +155,7 @@
/*
* Below that, we allocate the switch frame:
*/
- stktop2 -= roundup(sizeof *sf, CALLFRAMELEN); /* must match SFRAMELEN in genassym */
+ stktop2 -= SFRAMELEN; /* must match SFRAMELEN in genassym */
sf = (struct switchframe *)stktop2;
memset((void *)sf, 0, sizeof *sf); /* just in case */
sf->sp = (register_t)cf;
@@ -178,17 +178,15 @@
struct trapframe *tf;
struct callframe *cf;
struct switchframe *sf;
- caddr_t vaddr;
tf = trapframe(l);
cf = (struct callframe *) ((uintptr_t)tf & ~(CALLFRAMELEN-1));
cf->lr = (register_t) fork_trampoline;
cf--;
+ cf->sp = (register_t) (cf+1);
cf->r31 = (register_t) func;
cf->r30 = (register_t) arg;
- vaddr = (unsigned char *) cf;
- vaddr -= roundup(sizeof *sf, CALLFRAMELEN);
- sf = (struct switchframe *) vaddr;
+ sf = (struct switchframe *) ((uintptr_t) cf - SFRAMELEN);
memset((void *)sf, 0, sizeof *sf); /* just in case */
sf->sp = (register_t) cf;
#ifdef PPC_OEA
Home |
Main Index |
Thread Index |
Old Index