Source-Changes-HG archive

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

[src/netbsd-2-0]: src/sys/arch/hpc/hpc Pullup rev 1.12 (requested by uwe in t...



details:   https://anonhg.NetBSD.org/src/rev/cb8f269397e9
branches:  netbsd-2-0
changeset: 561361:cb8f269397e9
user:      jmc <jmc%NetBSD.org@localhost>
date:      Mon Jun 14 04:16:27 2004 +0000

description:
Pullup rev 1.12 (requested by uwe in ticket #471)

As the 2nd stage loader uses simple word-by-word copy, make sure that
destination addresses of page tags are properly aligned.

diffstat:

 sys/arch/hpc/hpc/kloader.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r ebeb26d8ac70 -r cb8f269397e9 sys/arch/hpc/hpc/kloader.c
--- a/sys/arch/hpc/hpc/kloader.c        Mon Jun 14 04:15:39 2004 +0000
+++ b/sys/arch/hpc/hpc/kloader.c        Mon Jun 14 04:16:27 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kloader.c,v 1.11 2004/03/27 02:01:07 uwe Exp $ */
+/*     $NetBSD: kloader.c,v 1.11.2.1 2004/06/14 04:16:27 jmc Exp $     */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kloader.c,v 1.11 2004/03/27 02:01:07 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kloader.c,v 1.11.2.1 2004/06/14 04:16:27 jmc Exp $");
 
 #include "debug_kloader.h"
 
@@ -289,7 +289,7 @@
        for (i = 0, p = ph; i < eh.e_phnum; i++, p++) {
                if (p->p_type == PT_LOAD) {
                        kloader_load_segment(p);
-                       kv = p->p_vaddr + p->p_memsz;
+                       kv = p->p_vaddr + ROUND4(p->p_memsz);
                }
        }
 
@@ -455,6 +455,12 @@
        addr = PG_VADDR(pg);
        tag = (void *)addr;
 
+       /*
+        * 2nd loader uses simple word-by-word copy, so destination
+        * address of a tag must be properly aligned.
+        */
+       KASSERT(ALIGNED_POINTER(dst, register_t));
+
        tag->src = addr + sizeof(struct kloader_page_tag);
        tag->dst = dst;
        tag->sz = 0;



Home | Main Index | Thread Index | Old Index