Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/ibm4xx Use regnames (%rX %crX), use m[ft]sp...



details:   https://anonhg.NetBSD.org/src/rev/c4661dc7d30c
branches:  trunk
changeset: 760469:c4661dc7d30c
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Jan 05 18:47:28 2011 +0000

description:
Use regnames (%rX %crX), use m[ft]sprg[0-9].  No binary difference.

diffstat:

 sys/arch/powerpc/ibm4xx/trap_subr.S |  634 ++++++++++++++++++------------------
 1 files changed, 317 insertions(+), 317 deletions(-)

diffs (truncated from 853 to 300 lines):

diff -r 5257e35662fd -r c4661dc7d30c sys/arch/powerpc/ibm4xx/trap_subr.S
--- a/sys/arch/powerpc/ibm4xx/trap_subr.S       Wed Jan 05 18:13:54 2011 +0000
+++ b/sys/arch/powerpc/ibm4xx/trap_subr.S       Wed Jan 05 18:47:28 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap_subr.S,v 1.11 2007/10/17 19:56:39 garbled Exp $   */
+/*     $NetBSD: trap_subr.S,v 1.12 2011/01/05 18:47:28 matt Exp $      */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -88,30 +88,30 @@
        lwz     rX,CI_CURPCB(rX)
 
 #define        STANDARD_PROLOG(savearea)       \
-       mtsprg  1,1;                    /* save SP */           \
-       stmw    28,savearea(0);         /* free r28-r31 */      \
-       mflr    28;                     /* save LR */           \
-       mfcr    29;                     /* save CR */           \
-       mfsrr1  31; /* Test whether we already had PR set */    \
-       mtcr    31;                                             \
-       bc      4,17,1f;        /* branch if PSL_PR is clear */ \
-       GET_PCB(1);                                             \
-       addi    1,1,USPACE;     /* stack is top of user struct */ \
+       mtsprg1 %r1;                    /* save SP */           \
+       stmw    %r28,savearea(%r0);     /* free r28-r31 */      \
+       mflr    %r28;                   /* save LR */           \
+       mfcr    %r29;                   /* save CR */           \
+       mfsrr1  %r31; /* Test whether we already had PR set */  \
+       mtcr    %r31;                                           \
+       bc      %cr4,17,1f;     /* branch if PSL_PR is clear */ \
+       GET_PCB(%r1);                                           \
+       addi    %r1,%r1,USPACE; /* stack is top of user struct */ \
 1:
 
 #define        CRITICAL_PROLOG(savearea)       \
-       mtsprg  1,1;                    /* save SP */           \
-       stmw    28,savearea(0);         /* free r28-r31 */      \
-       mflr    28;                     /* save LR */           \
-       mfcr    29;                     /* save CR */           \
-       mfsrr2  30; /* Fake a standard trap */                  \
-       mtsrr0  30;                                             \
-       mfsrr3  31; /* Test whether we already had PR set */    \
-       mtsrr1  31;                                             \
-       mtcr    31;                                             \
-       bc      4,17,1f;        /* branch if PSL_PR is clear */ \
-       GET_PCB(1);                                             \
-       addi    1,1,USPACE;     /* stack is top of user struct */ \
+       mtsprg1 %r1;                    /* save SP */           \
+       stmw    %r28,savearea(%r0);     /* free r28-r31 */      \
+       mflr    %r28;                   /* save LR */           \
+       mfcr    %r29;                   /* save CR */           \
+       mfsrr2  %r30; /* Fake a standard trap */                \
+       mtsrr0  %r30;                                           \
+       mfsrr3  %r31; /* Test whether we already had PR set */  \
+       mtsrr1  %r31;                                           \
+       mtcr    %r31;                                           \
+       bc      %cr4,17,1f;     /* branch if PSL_PR is clear */ \
+       GET_PCB(%r1);                                           \
+       addi    %r1,%r1,USPACE; /* stack is top of user struct */ \
 1:
 
 
@@ -128,9 +128,9 @@
        .globl  _C_LABEL(name ## trap),_C_LABEL(name ## size) ; \
 _C_LABEL(name ## trap):                                                \
        STANDARD_PROLOG(tempsave);                              \
-       mfdear  30;                                             \
-       mfesr   31;                                             \
-       stmw    30,16+tempsave(0);                              \
+       mfdear  %r30;                                           \
+       mfesr   %r31;                                           \
+       stmw    %r30,16+tempsave(%r0);                          \
        bla     s_trap  ;                                       \
 _C_LABEL(name ## size) = .-_C_LABEL(name ## trap)
 
@@ -160,18 +160,18 @@
  */
        .globl  _C_LABEL(extint),_C_LABEL(extsize)
 _C_LABEL(extint):
-       mtsprg  1,1                     /* save SP */
-       stmw    28,tempsave(0)          /* free r28-r31 */
-       mflr    28                      /* save LR */
-       mfcr    29                      /* save CR */
-       mfxer   30                      /* save XER */
-       GET_CPUINFO(1)
-       lwz     31,CI_INTRDEPTH(1)      /* were we already running on intstk? */
-       addic.  31,31,1
-       stw     31,CI_INTRDEPTH(1)
-       lwz     1,CI_INTSTK(1)          /* get intstk */
+       mtsprg1 %r1                     /* save SP */
+       stmw    %r28,tempsave(%r0)              /* free r28-r31 */
+       mflr    %r28                    /* save LR */
+       mfcr    %r29                    /* save CR */
+       mfxer   %r30                    /* save XER */
+       GET_CPUINFO(%r1)
+       lwz     %r31,CI_INTRDEPTH(%r1)  /* were we already running on intstk? */
+       addic.  %r31,%r31,1
+       stw     %r31,CI_INTRDEPTH(%r1)
+       lwz     %r1,CI_INTSTK(%r1)      /* get intstk */
        beq     1f
-       mfsprg  1,1                     /* yes, get old SP */
+       mfsprg1 %r1                     /* yes, get old SP */
 1:
        ba      extintr
 _C_LABEL(extsize) = .-_C_LABEL(extint)
@@ -187,12 +187,12 @@
 
        .globl  _C_LABEL(ddblow),_C_LABEL(ddbsize)
 _C_LABEL(ddblow):
-       mtsprg  1,1                     /* save SP */
-       stmw    28,ddbsave(0)           /* free r28-r31 */
-       mflr    28                      /* save LR */
-       mfcr    29                      /* save CR */
-       lis     1,ddbstk+INTSTK@ha      /* get new SP */
-       addi    1,1,ddbstk+INTSTK@l
+       mtsprg1 %r1                     /* save SP */
+       stmw    %r28,ddbsave(%r0)               /* free r28-r31 */
+       mflr    %r28                    /* save LR */
+       mfcr    %r29                    /* save CR */
+       lis     %r1,ddbstk+INTSTK@ha    /* get new SP */
+       addi    %r1,%r1,ddbstk+INTSTK@l
        bla     ddbtrap
 _C_LABEL(ddbsize) = .-_C_LABEL(ddblow)
 #endif /* DDB || KGDB */
@@ -208,12 +208,12 @@
 
        .globl  _C_LABEL(ipkdblow),_C_LABEL(ipkdbsize)
 _C_LABEL(ipkdblow):
-       mtsprg  1,1                     /* save SP */
-       stmw    28,ipkdbsave(0)         /* free r28-r31 */
-       mflr    28                      /* save LR */
-       mfcr    29                      /* save CR */
-       lis     1,ipkdbstk+INTSTK@ha    /* get new SP */
-       addi    1,1,ipkdbstk+INTSTK@l
+       mtsprg1 %r1                     /* save SP */
+       stmw    %r28,ipkdbsave(%r0)             /* free r28-r31 */
+       mflr    %r28                    /* save LR */
+       mfcr    %r29                    /* save CR */
+       lis     %r1,ipkdbstk+INTSTK@ha  /* get new SP */
+       addi    %r1,%r1,ipkdbstk+INTSTK@l
        bla     ipkdbtrap
 _C_LABEL(ipkdbsize) = .-_C_LABEL(ipkdblow)
 #endif /* IPKDB */
@@ -226,7 +226,7 @@
 
 /*
  * FRAME_SETUP assumes:
- *     SPRG1           SP (1)
+ *     SPRG1           SP (r1)
  *     savearea        r28-r31,DEAR,ESR (DEAR & ESR only for DSI traps)
  *     28              LR
  *     29              CR
@@ -236,77 +236,77 @@
  */
 #define        FRAME_SETUP(savearea)                                           \
 /* Have to enable translation to allow access of kernel stack: */      \
-       mfsrr0  30;                                                     \
-       mfsrr1  31;                                                     \
-       stmw    30,savearea+24(0);                                      \
-       mfpid   30;                                                     \
-       li      31,KERNEL_PID;                                          \
-       mtpid   31;                                                     \
-       mfmsr   31;                                                     \
-       ori     31,31,(PSL_DR|PSL_IR)@l;                                \
-       mtmsr   31;                                                     \
+       mfsrr0  %r30;                                                   \
+       mfsrr1  %r31;                                                   \
+       stmw    %r30,savearea+24(%r0);                                  \
+       mfpid   %r30;                                                   \
+       li      %r31,KERNEL_PID;                                        \
+       mtpid   %r31;                                                   \
+       mfmsr   %r31;                                                   \
+       ori     %r31,%r31,(PSL_DR|PSL_IR)@l;                            \
+       mtmsr   %r31;                                                   \
        isync;                                                          \
-       mfsprg  31,1;                                                   \
-       stwu    31,-FRAMELEN(1);                                        \
-       stw     30,FRAME_PID+8(1);                                      \
-       stw     0,FRAME_0+8(1);                                         \
-       stw     31,FRAME_1+8(1);                                        \
-       stw     28,FRAME_LR+8(1);                                       \
-       stw     29,FRAME_CR+8(1);                                       \
-       lmw     28,savearea(0);                                         \
-       stmw    2,FRAME_2+8(1);                                         \
-       lmw     28,savearea+16(0);                                      \
-       mfxer   3;                                                      \
-       mfctr   4;                                                      \
-       mflr    5;                                                      \
-       andi.   5,5,0xff00;                                             \
-       stw     3,FRAME_XER+8(1);                                       \
-       stw     4,FRAME_CTR+8(1);                                       \
-       stw     5,FRAME_EXC+8(1);                                       \
-       stw     28,FRAME_DEAR+8(1);                                     \
-       stw     29,FRAME_ESR+8(1);                                      \
-       stw     30,FRAME_SRR0+8(1);                                     \
-       stw     31,FRAME_SRR1+8(1)
+       mfsprg1 %r31;                                                   \
+       stwu    %r31,-FRAMELEN(%r1);                                    \
+       stw     %r30,FRAME_PID+8(%r1);                                  \
+       stw     %r0,FRAME_0+8(%r1);                                     \
+       stw     %r31,FRAME_1+8(%r1);                                    \
+       stw     %r28,FRAME_LR+8(%r1);                                   \
+       stw     %r29,FRAME_CR+8(%r1);                                   \
+       lmw     %r28,savearea(%r0);                                     \
+       stmw    %r2,FRAME_2+8(%r1);                                     \
+       lmw     %r28,savearea+16(%r0);                                  \
+       mfxer   %r3;                                                    \
+       mfctr   %r4;                                                    \
+       mflr    %r5;                                                    \
+       andi.   %r5,%r5,0xff00;                                         \
+       stw     %r3,FRAME_XER+8(%r1);                                   \
+       stw     %r4,FRAME_CTR+8(%r1);                                   \
+       stw     %r5,FRAME_EXC+8(%r1);                                   \
+       stw     %r28,FRAME_DEAR+8(%r1);                                 \
+       stw     %r29,FRAME_ESR+8(%r1);                                  \
+       stw     %r30,FRAME_SRR0+8(%r1);                                 \
+       stw     %r31,FRAME_SRR1+8(%r1)
 
 #define        FRAME_LEAVE(savearea)                                           \
 /* Now restore regs: */                                                        \
-       lwz     3,FRAME_PID+8(1);                                       \
-       lwz     4,FRAME_SRR1+8(1);                                      \
+       lwz     %r3,FRAME_PID+8(%r1);                                   \
+       lwz     %r4,FRAME_SRR1+8(%r1);                                  \
        bl      _C_LABEL(ctx_setup);                                    \
-       TRAP_IF_ZERO(3);                                                \
-       stw     3,FRAME_PID+8(1);                                       \
-       lmw     26,FRAME_LR+8(1);                                       \
-       mtlr    26;                                                     \
-       mtcr    27;                                                     \
-       mtxer   28;                                                     \
-       mtctr   29;                                                     \
-       mtsrr0  30;                                                     \
-       mtsrr1  31;                                                     \
-       lmw     2,FRAME_2+8(1);                                         \
-       lwz     0,FRAME_0+8(1);                                         \
-       stmw    29,savearea(0);                                         \
-       lwz     30,FRAME_PID+8(1);                                      \
-       lwz     1,FRAME_1+8(1);                                         \
-       mfmsr   31;                                                     \
-       li      29,(PSL_DR|PSL_IR)@l;                                   \
-       andc    31,31,29;                                               \
-       mfcr    29;                                                     \
-       mtcr    29;                                                     \
-       mtmsr   31;                                                     \
+       TRAP_IF_ZERO(%r3);                                              \
+       stw     %r3,FRAME_PID+8(%r1);                                   \
+       lmw     %r26,FRAME_LR+8(%r1);                                   \
+       mtlr    %r26;                                                   \
+       mtcr    %r27;                                                   \
+       mtxer   %r28;                                                   \
+       mtctr   %r29;                                                   \
+       mtsrr0  %r30;                                                   \
+       mtsrr1  %r31;                                                   \
+       lmw     %r2,FRAME_2+8(%r1);                                     \
+       lwz     %r0,FRAME_0+8(%r1);                                     \
+       stmw    %r29,savearea(%r0);                                     \
+       lwz     %r30,FRAME_PID+8(%r1);                                  \
+       lwz     %r1,FRAME_1+8(%r1);                                     \
+       mfmsr   %r31;                                                   \
+       li      %r29,(PSL_DR|PSL_IR)@l;                                 \
+       andc    %r31,%r31,%r29;                                         \
+       mfcr    %r29;                                                   \
+       mtcr    %r29;                                                   \
+       mtmsr   %r31;                                                   \
        isync;                                                          \
-       TRAP_IF_ZERO(30);                                               \
-       mtpid   30;                                                     \
-       lmw     29,savearea(0)
+       TRAP_IF_ZERO(%r30);                                             \
+       mtpid   %r30;                                                   \
+       lmw     %r29,savearea(%r0)
 
 realtrap:      /* entry point after IPKDB is done with exception */
        /* Test whether we already had PR set */
-       mfsrr1  1
-       mtcr    1
-       mfsprg  1,1                     /* restore SP (might have been
+       mfsrr1  %r1
+       mtcr    %r1
+       mfsprg1 %r1                     /* restore SP (might have been
                                           overwritten) */
-       bc      4,17,s_trap             /* branch if PSL_PR is false */
-       GET_PCB(1)
-       addi    1,1,USPACE              /* stack is top of user struct */
+       bc      %cr4,17,s_trap          /* branch if PSL_PR is false */
+       GET_PCB(%r1)
+       addi    %r1,%r1,USPACE          /* stack is top of user struct */
 /*
  * Now the common trap catching code.
  */
@@ -316,22 +316,22 @@
 trapagain:
        wrteei  1                       /* Enable interrupts */
 /* Call C trap code: */
-       addi    3,1,8
+       addi    %r3,%r1,8
        bl      _C_LABEL(trap)
        .globl  _C_LABEL(trapexit)
 _C_LABEL(trapexit):
        /* Disable interrupts: */



Home | Main Index | Thread Index | Old Index