Module Name:    src
Committed By:   skrll
Date:           Fri Oct 19 12:33:27 UTC 2012

Modified Files:
        src/sys/arch/evbarm/rpi: rpi_machdep.c

Log Message:
Make the first 8 pages available for use.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/rpi/rpi_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/rpi/rpi_machdep.c
diff -u src/sys/arch/evbarm/rpi/rpi_machdep.c:1.14 src/sys/arch/evbarm/rpi/rpi_machdep.c:1.15
--- src/sys/arch/evbarm/rpi/rpi_machdep.c:1.14	Fri Oct 19 11:31:50 2012
+++ src/sys/arch/evbarm/rpi/rpi_machdep.c	Fri Oct 19 12:33:27 2012
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: rpi_machdep.
 
 #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 @@ void rpi_bootparams(void);
  * 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 @@ initarm(void *arg)
 	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);

Reply via email to