Module Name: src Committed By: tsutsui Date: Sat Mar 26 15:49:27 UTC 2011
Modified Files: src/sys/arch/pmax/stand/common: bootinit.S bootread.S clear_cache.S getchar.S printf.S start.S Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/pmax/stand/common/bootinit.S \ src/sys/arch/pmax/stand/common/bootread.S cvs rdiff -u -r1.8 -r1.9 src/sys/arch/pmax/stand/common/clear_cache.S \ src/sys/arch/pmax/stand/common/printf.S cvs rdiff -u -r1.4 -r1.5 src/sys/arch/pmax/stand/common/getchar.S cvs rdiff -u -r1.22 -r1.23 src/sys/arch/pmax/stand/common/start.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/pmax/stand/common/bootinit.S diff -u src/sys/arch/pmax/stand/common/bootinit.S:1.7 src/sys/arch/pmax/stand/common/bootinit.S:1.8 --- src/sys/arch/pmax/stand/common/bootinit.S:1.7 Mon Jan 10 16:43:29 2011 +++ src/sys/arch/pmax/stand/common/bootinit.S Sat Mar 26 15:49:26 2011 @@ -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) Index: src/sys/arch/pmax/stand/common/bootread.S diff -u src/sys/arch/pmax/stand/common/bootread.S:1.7 src/sys/arch/pmax/stand/common/bootread.S:1.8 --- src/sys/arch/pmax/stand/common/bootread.S:1.7 Mon Jan 10 16:43:29 2011 +++ src/sys/arch/pmax/stand/common/bootread.S Sat Mar 26 15:49:26 2011 @@ -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) Index: src/sys/arch/pmax/stand/common/clear_cache.S diff -u src/sys/arch/pmax/stand/common/clear_cache.S:1.8 src/sys/arch/pmax/stand/common/clear_cache.S:1.9 --- src/sys/arch/pmax/stand/common/clear_cache.S:1.8 Mon Jan 10 16:43:29 2011 +++ src/sys/arch/pmax/stand/common/clear_cache.S Sat Mar 26 15:49:26 2011 @@ -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) Index: src/sys/arch/pmax/stand/common/printf.S diff -u src/sys/arch/pmax/stand/common/printf.S:1.8 src/sys/arch/pmax/stand/common/printf.S:1.9 --- src/sys/arch/pmax/stand/common/printf.S:1.8 Mon Jan 10 16:43:29 2011 +++ src/sys/arch/pmax/stand/common/printf.S Sat Mar 26 15:49:26 2011 @@ -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) Index: src/sys/arch/pmax/stand/common/getchar.S diff -u src/sys/arch/pmax/stand/common/getchar.S:1.4 src/sys/arch/pmax/stand/common/getchar.S:1.5 --- src/sys/arch/pmax/stand/common/getchar.S:1.4 Mon Jan 10 16:43:29 2011 +++ src/sys/arch/pmax/stand/common/getchar.S Sat Mar 26 15:49:26 2011 @@ -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) Index: src/sys/arch/pmax/stand/common/start.S diff -u src/sys/arch/pmax/stand/common/start.S:1.22 src/sys/arch/pmax/stand/common/start.S:1.23 --- src/sys/arch/pmax/stand/common/start.S:1.22 Mon Jan 10 17:01:17 2011 +++ src/sys/arch/pmax/stand/common/start.S Sat Mar 26 15:49:26 2011 @@ -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)