Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/oea Update some #ifdef PMAC_G5 for previous...



details:   https://anonhg.NetBSD.org/src/rev/e5427d9ceba3
branches:  trunk
changeset: 959587:e5427d9ceba3
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Feb 19 18:10:51 2021 +0000

description:
Update some #ifdef PMAC_G5 for previous change that I missed before.

diffstat:

 sys/arch/powerpc/oea/ofwoea_machdep.c |  23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diffs (53 lines):

diff -r 909c3611d0c4 -r e5427d9ceba3 sys/arch/powerpc/oea/ofwoea_machdep.c
--- a/sys/arch/powerpc/oea/ofwoea_machdep.c     Fri Feb 19 18:05:42 2021 +0000
+++ b/sys/arch/powerpc/oea/ofwoea_machdep.c     Fri Feb 19 18:10:51 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofwoea_machdep.c,v 1.52 2021/02/19 05:21:39 thorpej Exp $ */
+/* $NetBSD: ofwoea_machdep.c,v 1.53 2021/02/19 18:10:51 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.52 2021/02/19 05:21:39 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.53 2021/02/19 18:10:51 thorpej Exp $");
 
 #include "ksyms.h"
 #include "wsdisplay.h"
@@ -242,6 +242,7 @@
        if (oeacpufeat & OEACPU_64_BRIDGE) {
                vaddr_t va;
                paddr_t pa;
+               vsize_t size;
                int i;
 
                pmap_setup_segment0_map(0, msgbuf_paddr, msgbuf_paddr,
@@ -249,12 +250,22 @@
 
                /* Map OFW code+data */
 
-               for (i = 0; i < ofmaplen / sizeof(struct ofw_translations); i++) {
-                       if (ofmap[i].va < 0xff800000)
+               for (i = 0; i < __arraycount(ofw_translations); i++) {
+                       va = ofw_translations[i].virt;
+                       size = ofw_translations[i].size;
+                       pa = ofw_translations[i].phys;
+                       /* XXX mode */
+
+                       if (size == 0) {
+                               /* No more, all done! */
+                               break;
+                       }
+
+                       if (va < 0xff800000)
                                continue;
 
-                       for (va = ofmap[i].va, pa = ofmap[i].pa;
-                           va < ofmap[i].va + ofmap[i].len;
+
+                       for (; va < (ofw_translations[i].virt + size);
                            va += PAGE_SIZE, pa += PAGE_SIZE) {
                                pmap_enter(pmap_kernel(), va, pa, VM_PROT_ALL,
                                    VM_PROT_ALL | PMAP_WIRED);



Home | Main Index | Thread Index | Old Index