Source-Changes-HG archive

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

[src/trunk]: src/sys/sys A boot block on alpha is always little endian, so re...



details:   https://anonhg.NetBSD.org/src/rev/abb23e49ff65
branches:  trunk
changeset: 748529:abb23e49ff65
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Mon Oct 26 14:22:47 2009 +0000

description:
A boot block on alpha is always little endian, so read and store values
in little endian via le64toh() and htole64() in ALPHA_BOOT_BLOCK_CKSUM().
Fixes installboot(8) (and future endian-aware disklabel(8)) for alpha
on big endian machines.

diffstat:

 sys/sys/bootblock.h |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r 927586712997 -r abb23e49ff65 sys/sys/bootblock.h
--- a/sys/sys/bootblock.h       Mon Oct 26 11:19:47 2009 +0000
+++ b/sys/sys/bootblock.h       Mon Oct 26 14:22:47 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bootblock.h,v 1.47 2009/08/15 00:26:52 mishka Exp $    */
+/*     $NetBSD: bootblock.h,v 1.48 2009/10/26 14:22:47 tsutsui Exp $   */
 
 /*-
  * Copyright (c) 2002-2004 The NetBSD Foundation, Inc.
@@ -793,8 +793,8 @@
                for (_i = 0;                                            \
                    _i < (sizeof _bb->bb_data / sizeof _bb->bb_data[0]); \
                    _i++)                                               \
-                       _cksum += _bb->bb_data[_i];                     \
-               *(cksum) = _cksum;                                      \
+                       _cksum += le64toh(_bb->bb_data[_i]);            \
+               *(cksum) = htole64(_cksum);                             \
        } while (/*CONSTCOND*/ 0)
 
 /* ------------------------------------------



Home | Main Index | Thread Index | Old Index