Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/cats/cats The free block after the kernel from arm3...



details:   https://anonhg.NetBSD.org/src/rev/f3b4213a8fff
branches:  trunk
changeset: 450797:f3b4213a8fff
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Apr 26 07:32:40 2019 +0000

description:
The free block after the kernel from arm32_bootmem_init doesn't
account for bt_memavail.  Adjust for this.

diffstat:

 sys/arch/cats/cats/cats_machdep.c |  25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diffs (53 lines):

diff -r 2e801a5d2fe7 -r f3b4213a8fff sys/arch/cats/cats/cats_machdep.c
--- a/sys/arch/cats/cats/cats_machdep.c Fri Apr 26 06:33:33 2019 +0000
+++ b/sys/arch/cats/cats/cats_machdep.c Fri Apr 26 07:32:40 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cats_machdep.c,v 1.86 2017/08/15 08:52:41 maya Exp $   */
+/*     $NetBSD: cats_machdep.c,v 1.87 2019/04/26 07:32:40 skrll Exp $  */
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.86 2017/08/15 08:52:41 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.87 2019/04/26 07:32:40 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -333,6 +333,24 @@
        arm32_bootmem_init(ebsabootinfo.bt_memstart, ram_size,
            ebsabootinfo.bt_memstart);
 
+       /*
+        * The free block after the kernel from arm32_bootmem_init doesn't
+        * account for bt_memavail.  Adjust for this.
+        */
+       extern struct bootmem_info bootmem_info;
+       struct bootmem_info * const bmi = &bootmem_info;
+
+       pv_addr_t *pv0 = &bmi->bmi_freeblocks[0];
+       KASSERTMSG(pv0->pv_pa == bmi->bmi_kernelend,
+           "pv_pa %#lx kernelend %#lx", pv0->pv_pa, bmi->bmi_kernelend);
+
+       pv0->pv_pa = ebsabootinfo.bt_memavail;
+       pv0->pv_va = KERN_PHYSTOV(pv0->pv_pa);
+       pv0->pv_size = bmi->bmi_end - pv0->pv_pa;
+
+       printf("First freeblock adjusted to: %lx -> %lx\n", pv0->pv_pa,
+           pv0->pv_pa + pv0->pv_size - 1);
+
        arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_LOW, 0, cats_devmap,
            mapallmem_p);
 
@@ -364,9 +382,6 @@
                    ebsabootinfo.bt_pargp, VM_PROT_READ, PTE_CACHE);
        }
 
-       extern struct bootmem_info bootmem_info;
-       struct bootmem_info * const bmi = &bootmem_info;
-
        printf("Doing freeblocks: %d\n", bmi->bmi_nfreeblocks);
 
        for (size_t i = 0; i < bmi->bmi_nfreeblocks; i++) {



Home | Main Index | Thread Index | Old Index