Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Use FRAME_Rn (like ibm4xx and oea) instead of FRAME_n.
details: https://anonhg.NetBSD.org/src/rev/468778cc19cc
branches: trunk
changeset: 766186:468778cc19cc
user: matt <matt%NetBSD.org@localhost>
date: Sat Jun 18 06:37:38 2011 +0000
description:
Use FRAME_Rn (like ibm4xx and oea) instead of FRAME_n.
Include psl.h to get PSL_* values instead of getting them from assym.h
diffstat:
sys/arch/evbppc/mpc85xx/mpc85xx_start.S | 5 +-
sys/arch/powerpc/booke/genassym.cf | 81 ++++++++++++++-----------------
sys/arch/powerpc/booke/trap_subr.S | 84 ++++++++++++++++----------------
3 files changed, 82 insertions(+), 88 deletions(-)
diffs (287 lines):
diff -r b0f869774e06 -r 468778cc19cc sys/arch/evbppc/mpc85xx/mpc85xx_start.S
--- a/sys/arch/evbppc/mpc85xx/mpc85xx_start.S Sat Jun 18 06:36:25 2011 +0000
+++ b/sys/arch/evbppc/mpc85xx/mpc85xx_start.S Sat Jun 18 06:37:38 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mpc85xx_start.S,v 1.4 2011/06/08 05:09:21 matt Exp $ */
+/* $NetBSD: mpc85xx_start.S,v 1.5 2011/06/18 06:37:38 matt Exp $ */
/*-
* Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#include <powerpc/asm.h>
-RCSID("$NetBSD: mpc85xx_start.S,v 1.4 2011/06/08 05:09:21 matt Exp $")
+RCSID("$NetBSD: mpc85xx_start.S,v 1.5 2011/06/18 06:37:38 matt Exp $")
#include "opt_altivec.h"
#include "opt_ddb.h"
@@ -54,6 +54,7 @@
#include <powerpc/spr.h>
#include <powerpc/trap.h>
+#include <powerpc/psl.h>
#include <powerpc/booke/pte.h>
#include <powerpc/booke/spr.h>
#define LBC_PRIVATE
diff -r b0f869774e06 -r 468778cc19cc sys/arch/powerpc/booke/genassym.cf
--- a/sys/arch/powerpc/booke/genassym.cf Sat Jun 18 06:36:25 2011 +0000
+++ b/sys/arch/powerpc/booke/genassym.cf Sat Jun 18 06:37:38 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.4 2011/06/15 17:47:45 matt Exp $
+# $NetBSD: genassym.cf,v 1.5 2011/06/18 06:37:38 matt Exp $
#-
# Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -66,38 +66,38 @@
define FRAMELEN FRAMELEN
define FRAME_TF offsetof(struct ktrapframe, ktf_tf)
-define FRAME_0 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[0])
-define FRAME_1 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[1])
-define FRAME_2 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[2])
-define FRAME_3 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[3])
-define FRAME_4 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[4])
-define FRAME_5 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[5])
-define FRAME_6 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[6])
-define FRAME_7 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[7])
-define FRAME_8 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[8])
-define FRAME_9 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[9])
-define FRAME_10 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[10])
-define FRAME_11 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[11])
-define FRAME_12 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[12])
-define FRAME_13 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[13])
-define FRAME_14 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[14])
-define FRAME_15 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[15])
-define FRAME_16 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[16])
-define FRAME_17 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[17])
-define FRAME_18 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[18])
-define FRAME_19 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[19])
-define FRAME_20 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[20])
-define FRAME_21 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[21])
-define FRAME_22 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[22])
-define FRAME_23 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[23])
-define FRAME_24 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[24])
-define FRAME_25 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[25])
-define FRAME_26 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[26])
-define FRAME_27 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[27])
-define FRAME_28 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[28])
-define FRAME_29 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[29])
-define FRAME_30 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[30])
-define FRAME_31 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[31])
+define FRAME_R0 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[0])
+define FRAME_R1 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[1])
+define FRAME_R2 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[2])
+define FRAME_R3 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[3])
+define FRAME_R4 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[4])
+define FRAME_R5 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[5])
+define FRAME_R6 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[6])
+define FRAME_R7 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[7])
+define FRAME_R8 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[8])
+define FRAME_R9 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[9])
+define FRAME_R10 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[10])
+define FRAME_R11 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[11])
+define FRAME_R12 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[12])
+define FRAME_R13 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[13])
+define FRAME_R14 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[14])
+define FRAME_R15 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[15])
+define FRAME_R16 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[16])
+define FRAME_R17 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[17])
+define FRAME_R18 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[18])
+define FRAME_R19 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[19])
+define FRAME_R20 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[20])
+define FRAME_R21 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[21])
+define FRAME_R22 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[22])
+define FRAME_R23 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[23])
+define FRAME_R24 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[24])
+define FRAME_R25 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[25])
+define FRAME_R26 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[26])
+define FRAME_R27 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[27])
+define FRAME_R28 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[28])
+define FRAME_R29 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[29])
+define FRAME_R30 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[30])
+define FRAME_R31 offsetof(struct ktrapframe, ktf_tf.tf_fixreg[31])
define FRAME_LR offsetof(struct ktrapframe, ktf_tf.tf_lr)
define FRAME_CR offsetof(struct ktrapframe, ktf_tf.tf_cr)
define FRAME_CTR offsetof(struct ktrapframe, ktf_tf.tf_ctr)
@@ -262,16 +262,9 @@
define PTE_SCALESHIFT ilog2(sizeof(pt_entry_t))
define PTR_SCALESHIFT ilog2(sizeof(void *))
-define PSL_CE PSL_CE
-define PSL_DE PSL_DE
-define PSL_EE PSL_EE
-define PSL_ME PSL_ME
-define PSL_PR PSL_PR
-define MSR_PR 31 - ilog2(PSL_PR)
-define PSL_DS PSL_DS
-define MSR_DS 31 - ilog2(PSL_DS)
-define PSL_IS PSL_IS
-define MSR_IS 31 - ilog2(PSL_IS)
-
define NSEGPG_SCALESHIFT PAGE_SHIFT - ilog2(sizeof(void *))
define NPTEPG_SCALESHIFT PAGE_SHIFT - ilog2(sizeof(pt_entry_t))
+
+define MSR_PR 31 - ilog2(PSL_PR)
+define MSR_DS 31 - ilog2(PSL_DS)
+define MSR_IS 31 - ilog2(PSL_IS)
diff -r b0f869774e06 -r 468778cc19cc sys/arch/powerpc/booke/trap_subr.S
--- a/sys/arch/powerpc/booke/trap_subr.S Sat Jun 18 06:36:25 2011 +0000
+++ b/sys/arch/powerpc/booke/trap_subr.S Sat Jun 18 06:37:38 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap_subr.S,v 1.4 2011/06/15 17:47:45 matt Exp $ */
+/* $NetBSD: trap_subr.S,v 1.5 2011/06/18 06:37:38 matt Exp $ */
/*-
* Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -34,7 +34,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-RCSID("$NetBSD: trap_subr.S,v 1.4 2011/06/15 17:47:45 matt Exp $")
+RCSID("$NetBSD: trap_subr.S,v 1.5 2011/06/18 06:37:38 matt Exp $")
.globl _C_LABEL(sctrapexit), _C_LABEL(trapexit), _C_LABEL(intrcall)
@@ -177,9 +177,9 @@
1: \
stw %r30, CFRAME_LR(%r1); /* save in previous callframe */ \
stwu %r31, -FRAMELEN(%r1); /* get space for trapframe */ \
- stw %r0, FRAME_0(%r1); /* save r0 */ \
- stw %r31, FRAME_1(%r1); /* save (saved) r1 */ \
- stw %r26, FRAME_2(%r1); /* save (saved) r2 */ \
+ stw %r0, FRAME_R0(%r1); /* save r0 */ \
+ stw %r31, FRAME_R1(%r1); /* save (saved) r1 */ \
+ stw %r26, FRAME_R2(%r1); /* save (saved) r2 */ \
save_prologue; /* save SPRG1/ESR/DEAR */ \
/* At this point, r26, r29, and r31 have been saved so we */ \
/* can use them for LR, CTR, and SRR1. */ \
@@ -193,7 +193,7 @@
addi %r2,%r2,-4*(32-start); /* find our save area */ \
lmw %r##start,0(%r2); /* get start-r31 */ \
mtsprg3 %r2; /* save updated pointer */ \
- stmw %r3, FRAME_3(%r1); /* save r2-r31 */ \
+ stmw %r3, FRAME_R3(%r1); /* save r2-r31 */ \
/* Now everything has been saved */ \
mr %r31, %r0; /* move SRR1 back to r31 */ \
mfsprg2 %r13; /* put curlwp in r13 */ \
@@ -212,9 +212,9 @@
mtxer %r28; /* restore XER */ \
mtcr %r27; /* restore CR */ \
mtlr %r26; /* restore LR */ \
- lmw %r2, FRAME_2(%r1); /* restore r2-r31 */ \
- lwz %r0, FRAME_0(%r1); /* restore r0 */ \
- lwz %r1, FRAME_1(%r1); /* restore r1 */ \
+ lmw %r2, FRAME_R2(%r1); /* restore r2-r31 */ \
+ lwz %r0, FRAME_R0(%r1); /* restore r0 */ \
+ lwz %r1, FRAME_R1(%r1); /* restore r1 */ \
rfi /* return from interrupt */
@@ -264,26 +264,26 @@
get_intr_sp; /* get kernel stack pointer */ \
stw %r30, CFRAME_LR(%r1); /* save in .. */ \
stwu %r31, -FRAMELEN(%r1); /* get space for trapframe */ \
- stw %r0, FRAME_0(%r1); /* save r0 */ \
- stw %r31, FRAME_1(%r1); /* save (saved) r1 */ \
- stw %r26, FRAME_2(%r1); /* save (saved) r2 */ \
+ stw %r0, FRAME_R0(%r1); /* save r0 */ \
+ stw %r31, FRAME_R1(%r1); /* save (saved) r1 */ \
+ stw %r26, FRAME_R2(%r1); /* save (saved) r2 */ \
save_prologue; /* save SPRG1 (maybe) */ \
mflr %r26; /* get LR */ \
mfctr %r29; /* get CTR */ \
mfcr %r31; /* get SRR1 */ \
stmw %r26, FRAME_LR(%r1); /* save LR CR XER CTR SRR0/1 */ \
FRAME_SAVE_SRR0_FOR_DDB; \
- stw %r3, FRAME_3(%r1); /* save r3 */ \
- stw %r4, FRAME_4(%r1); /* save r4 */ \
- stw %r5, FRAME_5(%r1); /* save r5 */ \
- stw %r6, FRAME_6(%r1); /* save r6 */ \
- stw %r7, FRAME_7(%r1); /* save r7 */ \
- stw %r8, FRAME_8(%r1); /* save r8 */ \
- stw %r9, FRAME_9(%r1); /* save r9 */ \
- stw %r10, FRAME_10(%r1); /* save r10 */ \
- stw %r11, FRAME_11(%r1); /* save r11 */ \
- stw %r12, FRAME_12(%r1); /* save r12 */ \
- stw %r13, FRAME_13(%r1); /* save r13 */ \
+ stw %r3, FRAME_R3(%r1); /* save r3 */ \
+ stw %r4, FRAME_R4(%r1); /* save r4 */ \
+ stw %r5, FRAME_R5(%r1); /* save r5 */ \
+ stw %r6, FRAME_R6(%r1); /* save r6 */ \
+ stw %r7, FRAME_R7(%r1); /* save r7 */ \
+ stw %r8, FRAME_R8(%r1); /* save r8 */ \
+ stw %r9, FRAME_R9(%r1); /* save r9 */ \
+ stw %r10, FRAME_R10(%r1); /* save r10 */ \
+ stw %r11, FRAME_R11(%r1); /* save r11 */ \
+ stw %r12, FRAME_R12(%r1); /* save r12 */ \
+ stw %r13, FRAME_R13(%r1); /* save r13 */ \
mfsprg3 %r2; /* get save_area pointer */ \
addi %r2,%r2,-4*(32-start); /* find our save area */ \
lmw %r##start,0(%r2); /* get start-r31 */ \
@@ -306,20 +306,20 @@
mtxer %r10; /* restore XER */ \
mtcr %r9; /* restore CR */ \
mtlr %r8; /* restore LR */ \
- lwz %r13, FRAME_13(%r1); /* restore r13 */ \
- lwz %r12, FRAME_12(%r1); /* restore r12 */ \
- lwz %r11, FRAME_11(%r1); /* restore r11 */ \
- lwz %r10, FRAME_10(%r1); /* restore r10 */ \
- lwz %r9, FRAME_9(%r1); /* restore r9 */ \
- lwz %r8, FRAME_8(%r1); /* restore r8 */ \
- lwz %r7, FRAME_7(%r1); /* restore r7 */ \
- lwz %r6, FRAME_6(%r1); /* restore r6 */ \
- lwz %r5, FRAME_5(%r1); /* restore r5 */ \
- lwz %r4, FRAME_4(%r1); /* restore r4 */ \
- lwz %r3, FRAME_3(%r1); /* restore r3 */ \
- lwz %r2, FRAME_2(%r1); /* restore r2 */ \
- lwz %r0, FRAME_0(%r1); /* restore r0 */ \
- lwz %r1, FRAME_1(%r1); /* restore r1 */ \
+ lwz %r13, FRAME_R13(%r1); /* restore r13 */ \
+ lwz %r12, FRAME_R12(%r1); /* restore r12 */ \
+ lwz %r11, FRAME_R11(%r1); /* restore r11 */ \
+ lwz %r10, FRAME_R10(%r1); /* restore r10 */ \
+ lwz %r9, FRAME_R9(%r1); /* restore r9 */ \
+ lwz %r8, FRAME_R8(%r1); /* restore r8 */ \
+ lwz %r7, FRAME_R7(%r1); /* restore r7 */ \
+ lwz %r6, FRAME_R6(%r1); /* restore r6 */ \
+ lwz %r5, FRAME_R5(%r1); /* restore r5 */ \
+ lwz %r4, FRAME_R4(%r1); /* restore r4 */ \
+ lwz %r3, FRAME_R3(%r1); /* restore r3 */ \
+ lwz %r2, FRAME_R2(%r1); /* restore r2 */ \
+ lwz %r0, FRAME_R0(%r1); /* restore r0 */ \
+ lwz %r1, FRAME_R1(%r1); /* restore r1 */ \
rfi /* return from interrupt */
#define FRAME_INTR_ENTER(exc) \
@@ -416,7 +416,7 @@
lwz %r4, L_MD_ASTPENDING(%r13) /* get ast pending */
cmplwi %r4, 0 /* is there an ast pending */
beq+ intrexit /* nope, proceed to exit */
- stmw %r14, FRAME_14(%r1) /* save rest of registers */
+ stmw %r14, FRAME_R14(%r1) /* save rest of registers */
FRAME_SAVE_SPEFSCR
mr %r31, %r5 /* needed for trapagain */
li %r4, EXC_AST /* */
@@ -877,8 +877,8 @@
addi %r1,%r10,4096-CALLFRAMELEN
1:
stwu %r4,-FRAMELEN(%r1)
- stw %r4,FRAME_1(%r1)
- stmw %r13,FRAME_13(%r1)
+ stw %r4,FRAME_R1(%r1)
+ stmw %r13,FRAME_R13(%r1)
mr %r26,%r0
mfcr %r27
mfxer %r28
@@ -899,8 +899,8 @@
mtxer %r28
mtctr %r29
mr %r0,%r31
- lmw %r13,FRAME_13(%r1)
- lwz %r1,FRAME_1(%r1)
+ lmw %r13,FRAME_R13(%r1)
+ lwz %r1,FRAME_R1(%r1)
wrtee %r0
blr
#endif /* notyet */
Home |
Main Index |
Thread Index |
Old Index