Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm/rpi Make the first 8 pages available for use.



details:   https://anonhg.NetBSD.org/src/rev/984af55cbff6
branches:  trunk
changeset: 782164:984af55cbff6
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Oct 19 12:33:27 2012 +0000

description:
Make the first 8 pages available for use.

diffstat:

 sys/arch/evbarm/rpi/rpi_machdep.c |  17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diffs (53 lines):

diff -r 1f77e4e34a94 -r 984af55cbff6 sys/arch/evbarm/rpi/rpi_machdep.c
--- a/sys/arch/evbarm/rpi/rpi_machdep.c Fri Oct 19 11:57:58 2012 +0000
+++ b/sys/arch/evbarm/rpi/rpi_machdep.c Fri Oct 19 12:33:27 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpi_machdep.c,v 1.14 2012/10/19 11:31:50 skrll Exp $   */
+/*     $NetBSD: rpi_machdep.c,v 1.15 2012/10/19 12:33:27 skrll Exp $   */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.14 2012/10/19 11:31:50 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.15 2012/10/19 12:33:27 skrll Exp $");
 
 #include "opt_evbarm_boardtype.h"
 
@@ -67,6 +67,9 @@
 
 #include "ksyms.h"
 
+extern int KERNEL_BASE_phys[];
+extern int KERNEL_BASE_virt[];
+
 BootConfig bootconfig;         /* Boot config storage */
 static char bootargs[MAX_BOOT_STRING];
 char *boot_args = NULL;
@@ -77,12 +80,10 @@
  * Macros to translate between physical and virtual for a subset of the
  * kernel address space.  *Not* for general use.
  */
-#define        KERNEL_BASE_PHYS (paddr_t)0
 
-#define KERN_VTOPHYS(va) \
-       ((paddr_t)((vaddr_t)va - KERNEL_BASE + KERNEL_BASE_PHYS))
-#define KERN_PHYSTOV(pa) \
-       ((vaddr_t)((paddr_t)pa - KERNEL_BASE_PHYS + KERNEL_BASE))
+#define        KERN_VTOPDIFF   ((vaddr_t)KERNEL_BASE_phys - (vaddr_t)KERNEL_BASE_virt)
+#define KERN_VTOPHYS(va) ((paddr_t)((vaddr_t)va + KERN_VTOPDIFF))
+#define KERN_PHYSTOV(pa) ((vaddr_t)((paddr_t)pa - KERN_VTOPDIFF))
 
 #define        PLCONADDR 0x20201000
 
@@ -318,7 +319,7 @@
        printf("initarm: Configuring system ...\n");
 #endif
        arm32_bootmem_init(bootconfig.dram[0].address,
-           bootconfig.dram[0].pages * PAGE_SIZE, bootconfig.dram[0].address);
+           bootconfig.dram[0].pages * PAGE_SIZE, (uintptr_t)KERNEL_BASE_phys);
 
        arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0, rpi_devmap,
            false);



Home | Main Index | Thread Index | Old Index