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/installboot Make sure to load/store bbi...



details:   https://anonhg.NetBSD.org/src/rev/2b804f434eb2
branches:  trunk
changeset: 516793:2b804f434eb2
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Oct 30 05:52:30 2001 +0000

description:
Make sure to load/store bbinfo values as big-endian.

diffstat:

 sys/arch/sparc/stand/installboot/installboot.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (53 lines):

diff -r 5a741962f867 -r 2b804f434eb2 sys/arch/sparc/stand/installboot/installboot.c
--- a/sys/arch/sparc/stand/installboot/installboot.c    Tue Oct 30 05:13:09 2001 +0000
+++ b/sys/arch/sparc/stand/installboot/installboot.c    Tue Oct 30 05:52:30 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: installboot.c,v 1.9 2001/10/30 05:13:10 thorpej Exp $ */
+/*     $NetBSD: installboot.c,v 1.10 2001/10/30 05:52:30 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -259,7 +259,7 @@
                return NULL;
        }
 
-       max_block_count = bbinfop->bbi_block_count;
+       max_block_count = ntohl(bbinfop->bbi_block_count);
 
        if (verbose) {
                printf("%s: entry point %#lx\n", fname, en);
@@ -363,7 +363,7 @@
        /*
         * Register filesystem block size.
         */
-       bbinfop->bbi_block_size = fs->fs_bsize;
+       bbinfop->bbi_block_size = htonl(fs->fs_bsize);
 
        /*
         * Get the block numbers; we don't handle fragments
@@ -375,14 +375,14 @@
        /*
         * Register block count.
         */
-       bbinfop->bbi_block_count = ndb;
+       bbinfop->bbi_block_count = htonl(ndb);
 
        if (verbose)
                printf("%s: block numbers: ", boot);
        ap = ip->di_db;
        for (i = 0; i < NDADDR && *ap && ndb; i++, ap++, ndb--) {
                blk = fsbtodb(fs, *ap);
-               bbinfop->bbi_block_table[i] = blk;
+               bbinfop->bbi_block_table[i] = htonl(blk);
                if (verbose)
                        printf("%d ", blk);
        }
@@ -403,7 +403,7 @@
        ap = (daddr_t *)buf;
        for (; i < NINDIR(fs) && *ap && ndb; i++, ap++, ndb--) {
                blk = fsbtodb(fs, *ap);
-               bbinfop->bbi_block_table[i] = blk;
+               bbinfop->bbi_block_table[i] = htonl(blk);
                if (verbose)
                        printf("%d ", blk);
        }



Home | Main Index | Thread Index | Old Index