svn commit: r261646 - in head/sys/arm: at91 econa s3c2xx0 xscale/ixp425

Ian Lepore ian at FreeBSD.org
Sun Feb 9 01:21:31 UTC 2014


Author: ian
Date: Sun Feb  9 01:21:30 2014
New Revision: 261646
URL: http://svnweb.freebsd.org/changeset/base/261646

Log:
  Replace compile-time constant KERNPHYSADDR with abp_physaddr (determined
  at runtime) where it's trivial to do so.  Another breadcrumb on the trail
  to a kernel that can be loaded at any 1MB boundary.

Modified:
  head/sys/arm/at91/at91_machdep.c
  head/sys/arm/econa/econa_machdep.c
  head/sys/arm/s3c2xx0/s3c24x0_machdep.c
  head/sys/arm/xscale/ixp425/avila_machdep.c

Modified: head/sys/arm/at91/at91_machdep.c
==============================================================================
--- head/sys/arm/at91/at91_machdep.c	Sun Feb  9 00:37:16 2014	(r261645)
+++ head/sys/arm/at91/at91_machdep.c	Sun Feb  9 01:21:30 2014	(r261646)
@@ -471,7 +471,7 @@ initarm(struct arm_boot_params *abp)
 	/* Define a macro to simplify memory allocation */
 #define valloc_pages(var, np)						\
 	alloc_pages((var).pv_va, (np));					\
-	(var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR);
+	(var).pv_pa = (var).pv_va + (abp->abp_physaddr - KERNVIRTADDR);
 
 #define alloc_pages(var, np)						\
 	(var) = freemempos;						\
@@ -491,7 +491,7 @@ initarm(struct arm_boot_params *abp)
 			    L2_TABLE_SIZE_REAL;
 			kernel_pt_table[i].pv_pa =
 			    kernel_pt_table[i].pv_va - KERNVIRTADDR +
-			    KERNPHYSADDR;
+			    abp->abp_physaddr;
 		}
 	}
 	/*

Modified: head/sys/arm/econa/econa_machdep.c
==============================================================================
--- head/sys/arm/econa/econa_machdep.c	Sun Feb  9 00:37:16 2014	(r261645)
+++ head/sys/arm/econa/econa_machdep.c	Sun Feb  9 01:21:30 2014	(r261646)
@@ -189,7 +189,7 @@ initarm(struct arm_boot_params *abp)
 	/* Define a macro to simplify memory allocation */
 #define	valloc_pages(var, np)                   \
 	alloc_pages((var).pv_va, (np));         \
-	(var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR);
+	(var).pv_pa = (var).pv_va + (abp->abp_physaddr - KERNVIRTADDR);
 
 #define	alloc_pages(var, np)			\
 	(var) = freemempos;		\
@@ -209,7 +209,7 @@ initarm(struct arm_boot_params *abp)
 			    L2_TABLE_SIZE_REAL;
 			kernel_pt_table[loop].pv_pa =
 			    kernel_pt_table[loop].pv_va - KERNVIRTADDR +
-			    KERNPHYSADDR;
+			    abp->abp_physaddr;
 		}
 	}
 	/*

Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c
==============================================================================
--- head/sys/arm/s3c2xx0/s3c24x0_machdep.c	Sun Feb  9 00:37:16 2014	(r261645)
+++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c	Sun Feb  9 01:21:30 2014	(r261646)
@@ -239,7 +239,7 @@ initarm(struct arm_boot_params *abp)
 	/* Define a macro to simplify memory allocation */
 #define valloc_pages(var, np)			\
 	alloc_pages((var).pv_va, (np));		\
-	(var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR);
+	(var).pv_pa = (var).pv_va + (abp->abp_physaddr - KERNVIRTADDR);
 
 #define alloc_pages(var, np)			\
 	(var) = freemempos;			\
@@ -259,7 +259,7 @@ initarm(struct arm_boot_params *abp)
 			    L2_TABLE_SIZE_REAL;
 			kernel_pt_table[loop].pv_pa =
 			    kernel_pt_table[loop].pv_va - KERNVIRTADDR +
-			    KERNPHYSADDR;
+			    abp->abp_physaddr;
 		}
 	}
 	/*

Modified: head/sys/arm/xscale/ixp425/avila_machdep.c
==============================================================================
--- head/sys/arm/xscale/ixp425/avila_machdep.c	Sun Feb  9 00:37:16 2014	(r261645)
+++ head/sys/arm/xscale/ixp425/avila_machdep.c	Sun Feb  9 01:21:30 2014	(r261646)
@@ -92,11 +92,6 @@ __FBSDID("$FreeBSD$");
 #include <arm/xscale/ixp425/ixp425reg.h>
 #include <arm/xscale/ixp425/ixp425var.h>
 
-/* kernel text starts where we were loaded at boot */
-#define	KERNEL_TEXT_OFF		(KERNPHYSADDR  - PHYSADDR)
-#define	KERNEL_TEXT_BASE	(KERNBASE + KERNEL_TEXT_OFF)
-#define	KERNEL_TEXT_PHYS	(PHYSADDR + KERNEL_TEXT_OFF)
-
 #define KERNEL_PT_SYS		0	/* Page table for mapping proc0 zero page */
 #define	KERNEL_PT_IO		1
 #define KERNEL_PT_IO_NUM	3
@@ -221,6 +216,11 @@ initarm(struct arm_boot_params *abp)
 	vm_offset_t lastaddr;
 	uint32_t memsize;
 
+	/* kernel text starts where we were loaded at boot */
+#define	KERNEL_TEXT_OFF		(abp->abp_physaddr  - PHYSADDR)
+#define	KERNEL_TEXT_BASE	(KERNBASE + KERNEL_TEXT_OFF)
+#define	KERNEL_TEXT_PHYS	(PHYSADDR + KERNEL_TEXT_OFF)
+
 	lastaddr = parse_boot_param(abp);
 	set_cpufuncs();		/* NB: sets cputype */
 	pcpu_init(pcpup, 0, sizeof(struct pcpu));
@@ -238,7 +238,7 @@ initarm(struct arm_boot_params *abp)
 	 * write-through).  Note this leaves a gap for expansion
 	 * (or might be repurposed).
 	 */
-	freemempos = KERNPHYSADDR;
+	freemempos = abp->abp_physaddr;
 
 	/* macros to simplify initial memory allocation */
 #define alloc_pages(var, np) do {					\
@@ -249,7 +249,7 @@ initarm(struct arm_boot_params *abp)
 } while (0)
 #define	valloc_pages(var, np) do {					\
 	alloc_pages((var).pv_pa, (np));					\
-	(var).pv_va = (var).pv_pa + (KERNVIRTADDR - KERNPHYSADDR);	\
+	(var).pv_va = (var).pv_pa + (KERNVIRTADDR - abp->abp_physaddr);	\
 } while (0)
 
 	/* force L1 page table alignment */
@@ -268,7 +268,7 @@ initarm(struct arm_boot_params *abp)
 			    L2_TABLE_SIZE_REAL;
 			kernel_pt_table[loop].pv_va =
 			    kernel_pt_table[loop].pv_pa +
-				(KERNVIRTADDR - KERNPHYSADDR);
+				(KERNVIRTADDR - abp->abp_physaddr);
 		}
 	}
 	freemem_pt = freemempos;		/* base of allocated pt's */


More information about the svn-src-head mailing list