Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc Convert the spill stack frame to use symbol...



details:   https://anonhg.NetBSD.org/src/rev/33c057b3a3dc
branches:  trunk
changeset: 525930:33c057b3a3dc
user:      kleink <kleink%NetBSD.org@localhost>
date:      Sun Apr 21 22:05:45 2002 +0000

description:
Convert the spill stack frame to use symbolic offset names; inspired by
a conversation with Matt Thomas.

diffstat:

 sys/arch/powerpc/include/frame.h     |  19 +++++++++-
 sys/arch/powerpc/mpc6xx/genassym.cf  |  16 +++++++-
 sys/arch/powerpc/powerpc/trap_subr.S |  72 ++++++++++++++++++------------------
 3 files changed, 69 insertions(+), 38 deletions(-)

diffs (161 lines):

diff -r 2172c5122778 -r 33c057b3a3dc sys/arch/powerpc/include/frame.h
--- a/sys/arch/powerpc/include/frame.h  Sun Apr 21 21:07:35 2002 +0000
+++ b/sys/arch/powerpc/include/frame.h  Sun Apr 21 22:05:45 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: frame.h,v 1.3 2002/04/18 20:08:09 matt Exp $   */
+/*     $NetBSD: frame.h,v 1.4 2002/04/21 22:05:45 kleink Exp $ */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -118,4 +118,21 @@
        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 /* _MACHINE_FRAME_H_ */
diff -r 2172c5122778 -r 33c057b3a3dc sys/arch/powerpc/mpc6xx/genassym.cf
--- a/sys/arch/powerpc/mpc6xx/genassym.cf       Sun Apr 21 21:07:35 2002 +0000
+++ b/sys/arch/powerpc/mpc6xx/genassym.cf       Sun Apr 21 22:05:45 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.cf,v 1.1 2002/04/18 20:08:10 matt Exp $
+#      $NetBSD: genassym.cf,v 1.2 2002/04/21 22:05:45 kleink Exp $
 
 #
 # Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -80,6 +80,20 @@
 define IFRAME_R3               offsetof(struct intrframe, r3)
 define IFRAME_R0               offsetof(struct intrframe, r0)
 
+define SPFRAMELEN              SPFRAMELEN
+define SPFRAME_R1              offsetof(struct spillframe, r1)
+define SPFRAME_R12             offsetof(struct spillframe, r12)
+define SPFRAME_R11             offsetof(struct spillframe, r11)
+define SPFRAME_R10             offsetof(struct spillframe, r10)
+define SPFRAME_R9              offsetof(struct spillframe, r9)
+define SPFRAME_R8              offsetof(struct spillframe, r8)
+define SPFRAME_R7              offsetof(struct spillframe, r7)
+define SPFRAME_R6              offsetof(struct spillframe, r6)
+define SPFRAME_R5              offsetof(struct spillframe, r5)
+define SPFRAME_R4              offsetof(struct spillframe, r4)
+define SPFRAME_R3              offsetof(struct spillframe, r3)
+define SPFRAME_R0              offsetof(struct spillframe, r0)
+
 define SFRAMELEN       roundup(sizeof(struct switchframe), 16)
 
 define PCB_PMR         offsetof(struct pcb, pcb_pmreal)
diff -r 2172c5122778 -r 33c057b3a3dc sys/arch/powerpc/powerpc/trap_subr.S
--- a/sys/arch/powerpc/powerpc/trap_subr.S      Sun Apr 21 21:07:35 2002 +0000
+++ b/sys/arch/powerpc/powerpc/trap_subr.S      Sun Apr 21 22:05:45 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap_subr.S,v 1.17 2002/04/18 20:08:10 matt Exp $      */
+/*     $NetBSD: trap_subr.S,v 1.18 2002/04/21 22:05:45 kleink Exp $    */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -735,18 +735,18 @@
        bc      4,1,disitrap            /* branch if table miss is false */
        lis     1,spillstk+SPILLSTK@ha
        addi    1,1,spillstk+SPILLSTK@l /* get spill stack */
-       stwu    1,-52(1)
-       stw     0,48(1)                 /* save non-volatile registers */
-       stw     3,44(1)
-       stw     4,40(1)
-       stw     5,36(1)
-       stw     6,32(1)
-       stw     7,28(1)
-       stw     8,24(1)
-       stw     9,20(1)
-       stw     10,16(1)
-       stw     11,12(1)
-       stw     12,8(1)
+       stwu    1,-SPFRAMELEN(1)
+       stw     0,SPFRAME_R0(1)         /* save non-volatile registers */
+       stw     3,SPFRAME_R3(1)
+       stw     4,SPFRAME_R4(1)
+       stw     5,SPFRAME_R5(1)
+       stw     6,SPFRAME_R6(1)
+       stw     7,SPFRAME_R7(1)
+       stw     8,SPFRAME_R8(1)
+       stw     9,SPFRAME_R9(1)
+       stw     10,SPFRAME_R10(1)
+       stw     11,SPFRAME_R11(1)
+       stw     12,SPFRAME_R12(1)
        mflr    30                      /* save trap type */
        mfctr   31                      /* & CTR */
        mfdar   3
@@ -757,17 +757,17 @@
        mtlr    30                      /* and trap type */
        mfsprg  31,2                    /* get saved XER */
        mtxer   31                      /* restore XER */
-       lwz     12,8(1)                 /* restore non-volatile registers */
-       lwz     11,12(1)
-       lwz     10,16(1)
-       lwz     9,20(1)
-       lwz     8,24(1)
-       lwz     7,28(1)
-       lwz     6,32(1)
-       lwz     5,36(1)
-       lwz     4,40(1)
-       lwz     3,44(1)
-       lwz     0,48(1)
+       lwz     12,SPFRAME_R12(1)       /* restore non-volatile registers */
+       lwz     11,SPFRAME_R11(1)
+       lwz     10,SPFRAME_R10(1)
+       lwz     9,SPFRAME_R9(1)
+       lwz     8,SPFRAME_R8(1)
+       lwz     7,SPFRAME_R7(1)
+       lwz     6,SPFRAME_R6(1)
+       lwz     5,SPFRAME_R5(1)
+       lwz     4,SPFRAME_R4(1)
+       lwz     3,SPFRAME_R3(1)
+       lwz     0,SPFRAME_R0(1)
        beq     disitrap
        mfsprg  1,1                     /* restore SP */
        mtcr    29                      /* restore CR */
@@ -786,18 +786,18 @@
        bc      4,1,disitrap            /* branch if table miss is false */
        lis     1,spillstk+SPILLSTK@ha
        addi    1,1,spillstk+SPILLSTK@l /* get spill stack */
-       stwu    1,-52(1)
-       stw     0,48(1)                 /* save non-volatile registers */
-       stw     3,44(1)
-       stw     4,40(1)
-       stw     5,36(1)
-       stw     6,32(1)
-       stw     7,28(1)
-       stw     8,24(1)
-       stw     9,20(1)
-       stw     10,16(1)
-       stw     11,12(1)
-       stw     12,8(1)
+       stwu    1,-SPFRAMELEN(1)
+       stw     0,SPFRAME_R0(1)         /* save non-volatile registers */
+       stw     3,SPFRAME_R3(1)
+       stw     4,SPFRAME_R4(1)
+       stw     5,SPFRAME_R5(1)
+       stw     6,SPFRAME_R6(1)
+       stw     7,SPFRAME_R7(1)
+       stw     8,SPFRAME_R8(1)
+       stw     9,SPFRAME_R9(1)
+       stw     10,SPFRAME_R10(1)
+       stw     11,SPFRAME_R11(1)
+       stw     12,SPFRAME_R12(1)
        mfxer   30                      /* save XER */
        mtsprg  2,30
        mflr    30                      /* save trap type */



Home | Main Index | Thread Index | Old Index