Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sun2/sun2 In prom_init, when making our local copy ...



details:   https://anonhg.NetBSD.org/src/rev/1d222da8fb72
branches:  trunk
changeset: 508370:1d222da8fb72
user:      fredette <fredette%NetBSD.org@localhost>
date:      Tue Apr 10 12:40:53 2001 +0000

description:
In prom_init, when making our local copy of the bootparams,
be sure to calculate the shift in terms of chars, not struct
bootparams, and don't shift undefined arguments.

diffstat:

 sys/arch/sun2/sun2/promlib.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r a8f5b58bb718 -r 1d222da8fb72 sys/arch/sun2/sun2/promlib.c
--- a/sys/arch/sun2/sun2/promlib.c      Tue Apr 10 12:39:56 2001 +0000
+++ b/sys/arch/sun2/sun2/promlib.c      Tue Apr 10 12:40:53 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: promlib.c,v 1.1 2001/04/06 15:05:57 fredette Exp $     */
+/*     $NetBSD: promlib.c,v 1.2 2001/04/10 12:40:53 fredette Exp $     */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -356,8 +356,8 @@
        old_bp = *romVectorPtr->bootParam;
        new_bp = &sunmon_bootparam;
        *new_bp = *old_bp;
-       bp_shift = new_bp - old_bp;
-       for(i = 0; i < 8; i++) {
+       bp_shift = ((char *) new_bp) - ((char *) old_bp);
+       for(i = 0; i < 8 && new_bp->argPtr[i] != NULL; i++) {
                new_bp->argPtr[i] += bp_shift;
        }
        new_bp->fileName += bp_shift;



Home | Main Index | Thread Index | Old Index