Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/pmax/stand/common Use .set reorder to entrust compi...



details:   https://anonhg.NetBSD.org/src/rev/de91ae2d17c4
branches:  trunk
changeset: 763578:de91ae2d17c4
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Mar 26 15:49:26 2011 +0000

description:
Use .set reorder to entrust compiler hazards and BDslots to avoid future botch
since there is no critical instructions in these sources.

Tested on 3MIN.

diffstat:

 sys/arch/pmax/stand/common/bootinit.S    |   7 ++-----
 sys/arch/pmax/stand/common/bootread.S    |   7 ++-----
 sys/arch/pmax/stand/common/clear_cache.S |   7 ++-----
 sys/arch/pmax/stand/common/getchar.S     |   7 ++-----
 sys/arch/pmax/stand/common/printf.S      |  10 +++-------
 sys/arch/pmax/stand/common/start.S       |  11 +++--------
 6 files changed, 14 insertions(+), 35 deletions(-)

diffs (185 lines):

diff -r 494567230e59 -r de91ae2d17c4 sys/arch/pmax/stand/common/bootinit.S
--- a/sys/arch/pmax/stand/common/bootinit.S     Sat Mar 26 12:40:07 2011 +0000
+++ b/sys/arch/pmax/stand/common/bootinit.S     Sat Mar 26 15:49:26 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bootinit.S,v 1.7 2011/01/10 16:43:29 tsutsui Exp $     */
+/*     $NetBSD: bootinit.S,v 1.8 2011/03/26 15:49:26 tsutsui Exp $     */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,12 +33,9 @@
 #include <mips/cpuregs.h>
 #include <machine/dec_prom.h>
 
-       .set    noreorder
+       .set    reorder         # make as(1) handle hazard and BDslot
 LEAF(bootinit)
        lw      v0, _C_LABEL(callv)     # get pointer to call back vectors
-       nop
        lw      v0, 0x54(v0)    # offset for callv->_bootinit
-       nop
        j       v0              # call PROM bootinit
-        nop
 END(bootinit)
diff -r 494567230e59 -r de91ae2d17c4 sys/arch/pmax/stand/common/bootread.S
--- a/sys/arch/pmax/stand/common/bootread.S     Sat Mar 26 12:40:07 2011 +0000
+++ b/sys/arch/pmax/stand/common/bootread.S     Sat Mar 26 15:49:26 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bootread.S,v 1.7 2011/01/10 16:43:29 tsutsui Exp $     */
+/*     $NetBSD: bootread.S,v 1.8 2011/03/26 15:49:26 tsutsui Exp $     */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,12 +33,9 @@
 #include <mips/cpuregs.h>
 #include <machine/dec_prom.h>
 
-       .set    noreorder
+       .set    reorder         # make as(1) handle hazard and BDslot
 LEAF(bootread)
        lw      v0, _C_LABEL(callv)     # get pointer to call back vectors
-       nop
        lw      v0, 0x58(v0)    # offset for callv->_bootread
-       nop
        j       v0              # call PROM bootread
-        nop
 END(bootread)
diff -r 494567230e59 -r de91ae2d17c4 sys/arch/pmax/stand/common/clear_cache.S
--- a/sys/arch/pmax/stand/common/clear_cache.S  Sat Mar 26 12:40:07 2011 +0000
+++ b/sys/arch/pmax/stand/common/clear_cache.S  Sat Mar 26 15:49:26 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clear_cache.S,v 1.8 2011/01/10 16:43:29 tsutsui Exp $  */
+/*     $NetBSD: clear_cache.S,v 1.9 2011/03/26 15:49:26 tsutsui Exp $  */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,12 +33,9 @@
 #include <mips/cpuregs.h>
 #include <machine/dec_prom.h>
 
-       .set    noreorder
+       .set    reorder         # make as(1) handle hazard and BDslot
 LEAF(clear_cache)
        lw      v0, _C_LABEL(callv)     # get pointer to call back vectors
-       nop
        lw      v0, 0x7c(v0)    # offset for callv->_clear_cache
-       nop
        j       v0              # call PROM clear_cache
-        nop
 END(clear_cache)
diff -r 494567230e59 -r de91ae2d17c4 sys/arch/pmax/stand/common/getchar.S
--- a/sys/arch/pmax/stand/common/getchar.S      Sat Mar 26 12:40:07 2011 +0000
+++ b/sys/arch/pmax/stand/common/getchar.S      Sat Mar 26 15:49:26 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getchar.S,v 1.4 2011/01/10 16:43:29 tsutsui Exp $      */
+/*     $NetBSD: getchar.S,v 1.5 2011/03/26 15:49:26 tsutsui Exp $      */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,12 +33,9 @@
 #include <mips/cpuregs.h>
 #include <machine/dec_prom.h>
 
-       .set    noreorder
+       .set    reorder         # make as(1) handle hazard and BDslot
 LEAF(getchar)
        lw      v0, _C_LABEL(callv)     # get pointer to call back vectors
-       nop
        lw      v0, 0x24(v0)    # offset for callv->_getchar
-       nop
        j       v0              # call PROM getchar
-        nop
 END(getchar)
diff -r 494567230e59 -r de91ae2d17c4 sys/arch/pmax/stand/common/printf.S
--- a/sys/arch/pmax/stand/common/printf.S       Sat Mar 26 12:40:07 2011 +0000
+++ b/sys/arch/pmax/stand/common/printf.S       Sat Mar 26 15:49:26 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: printf.S,v 1.8 2011/01/10 16:43:29 tsutsui Exp $       */
+/*     $NetBSD: printf.S,v 1.9 2011/03/26 15:49:26 tsutsui Exp $       */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -33,12 +33,10 @@
 #include <mips/cpuregs.h>
 #include <machine/dec_prom.h>
 
-       .set    noreorder
+       .set    reorder         # make as(1) handle hazard and BDslot
 LEAF(printf)
        lw      v0, _C_LABEL(callv)     # get pointer to call back vectors
-       nop
        lw      t9, 0x30(v0)    # offset for callv->_printf
-       nop
 #ifdef __mips_n32
        /*
         * If someone calls printf with more than 4 args on n32,
@@ -52,12 +50,10 @@
        sw      a7, 28(sp)
        sw      ra, 44(sp)
        jalr    t9              # call PROM printf
-        nop
        lw      ra, 44(sp)
+       addu    sp, sp, 48
        j       ra
-        addu   sp, sp, 48
 #else
        j       t9              # call PROM printf
-        nop
 #endif
 END(printf)
diff -r 494567230e59 -r de91ae2d17c4 sys/arch/pmax/stand/common/start.S
--- a/sys/arch/pmax/stand/common/start.S        Sat Mar 26 12:40:07 2011 +0000
+++ b/sys/arch/pmax/stand/common/start.S        Sat Mar 26 15:49:26 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: start.S,v 1.22 2011/01/10 17:01:17 tsutsui Exp $       */
+/*     $NetBSD: start.S,v 1.23 2011/03/26 15:49:26 tsutsui Exp $       */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -113,44 +113,39 @@
        j       _C_LABEL(prom_restart)          # restart...
         nop
 
+       .set    reorder         # make as(1) handle hazard and BDslot
 LEAF(prom_restart)
 XLEAF(_rtt)
        lw      v0, _C_LABEL (callv)
-       nop
        lw      v0, 0x9C(v0)                    /* halt */
        move    a0, zero                        /* Don't print anything. */
+       move    a1, zero
        j       v0
-        move   a1, zero
 END(prom_restart)
 
 LEAF(prom_open)
        li      v0, DEC_PROM_OPEN
        j       v0
-        nop
 END(prom_open)
 
 #ifndef LIBSA_NO_DEV_CLOSE
 LEAF(prom_close)
        li      v0, DEC_PROM_CLOSE
        j       v0
-        nop
 END(prom_close)
 #endif
 
 LEAF(prom_lseek)
        li      v0, DEC_PROM_LSEEK
        j       v0
-        nop
 END(prom_lseek)
 
 LEAF(prom_read)
        li      v0, DEC_PROM_READ
        j       v0
-        nop
 END(prom_read)
 
 LEAF(prom_write)
        li      v0, DEC_PROM_WRITE
        j       v0
-        nop
 END(prom_write)



Home | Main Index | Thread Index | Old Index