Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/stand/bootblk Fix shifting by zero.



details:   https://anonhg.NetBSD.org/src/rev/80d8fe91155f
branches:  trunk
changeset: 752930:80d8fe91155f
user:      eeh <eeh%NetBSD.org@localhost>
date:      Thu Mar 11 19:28:55 2010 +0000

description:
Fix shifting by zero.

diffstat:

 sys/arch/sparc/stand/bootblk/bootblk.fth |  26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diffs (77 lines):

diff -r ba5651d13715 -r 80d8fe91155f sys/arch/sparc/stand/bootblk/bootblk.fth
--- a/sys/arch/sparc/stand/bootblk/bootblk.fth  Thu Mar 11 17:27:40 2010 +0000
+++ b/sys/arch/sparc/stand/bootblk/bootblk.fth  Thu Mar 11 19:28:55 2010 +0000
@@ -1,4 +1,4 @@
-\      $NetBSD: bootblk.fth,v 1.11 2010/02/17 15:49:19 eeh Exp $
+\      $NetBSD: bootblk.fth,v 1.12 2010/03/11 19:28:55 eeh Exp $
 \
 \      IEEE 1275 Open Firmware Boot Block
 \
@@ -85,15 +85,19 @@
 : d-and ( d1 d2 -- d1-and-d2 )  rot and -rot and swap ;
 : d*u ( d1 u -- d2 )           tuck um* drop -rot um* rot + ;
 : d<< ( d1 n -- d1<<n )        \ Hope this works
-   tuck <<                     ( d.lo n d.hi' )
-   -rot 2dup <<                        ( d.hi' d.lo n d.lo' )
-   -rot d# 32 swap - >>                ( d.hi' d.lo' lo.hi )
-   rot +
+   ?dup  if  \ Shifting by 0 doesn't appear to work properly.
+      tuck <<                  ( d.lo n d.hi' )
+      -rot 2dup <<             ( d.hi' d.lo n d.lo' )
+      -rot d# 32 swap - >>     ( d.hi' d.lo' lo.hi )
+      rot +
+   then
 ;
 : d>> ( d1 n -- d1>>n )        \ Hope this works
-   rot over >> -rot            ( d.lo' d.hi n )
-   2dup >> -rot                        ( d.lo' d.hi' d.hi n )
-   d# 32 swap - << rot + swap
+   ?dup  if  \ Shifting by 0 doesn't appear to work properly.
+      rot over >>      -rot    ( d.lo' d.hi n )
+      2dup >> -rot             ( d.lo' d.hi' d.hi n )
+      d# 32 swap - << rot + swap
+   then
 ;
 : d> ( d1 d2 -- d1>d2? )
    rot swap 2dup = if
@@ -549,6 +553,7 @@
 
 
 : init-ffs-v1 ( -- )
+   boot-debug?  if  ." FFS v1" cr  then
    init-ffs-common
    ' di1_size  to  di-size
    ' di1_mode  to  di-mode
@@ -561,6 +566,7 @@
 ;
 
 : init-ffs-v2 ( -- )
+   boot-debug?  if  ." FFS v2" cr  then
    init-ffs-common
    ' di2_size  to  di-size
    ' di2_mode  to  di-mode
@@ -588,6 +594,7 @@
 ;
 
 : init-lfs-v1 ( -- )
+   boot-debug?  if  ." LFS v1" cr  then
    init-lfs-common
    ' lfs_ibsize  to  fs-bsize
    ' ifile_v1_SIZEOF  to  /ifile
@@ -595,6 +602,7 @@
 ;   
 
 : init-lfs-v2 ( -- )
+   boot-debug?  if  ." LFS v2" cr  then
    init-lfs-common
    ' lfs_bsize  to  fs-bsize
    ' ifile_SIZEOF  to  /ifile
@@ -880,7 +888,7 @@
 
 : do-boot ( bootfile -- )
    ." NetBSD IEEE 1275 Multi-FS Bootblock" cr
-   ." Version $NetBSD: bootblk.fth,v 1.11 2010/02/17 15:49:19 eeh Exp $" cr
+   ." Version $NetBSD: bootblk.fth,v 1.12 2010/03/11 19:28:55 eeh Exp $" cr
    boot-path load-file ( -- load-base )
    dup 0<>  if  " init-program " evaluate  then
 ; 



Home | Main Index | Thread Index | Old Index