svn commit: r261649 - in head/sys/arm: arm at91 econa include s3c2xx0 sa11x0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa

Ian Lepore ian at FreeBSD.org
Sun Feb 9 02:39:04 UTC 2014


Author: ian
Date: Sun Feb  9 02:39:00 2014
New Revision: 261649
URL: http://svnweb.freebsd.org/changeset/base/261649

Log:
  It turns out a global variable is the only straightforward way to
  communicate the kernel's physical load address from where it's known in
  initarm() into cpu_mp_start() which is called from non-arm code and
  takes no parameters.
  
  This adds the global variable and ensures that all the various copies
  of initarm() set it.  It uses the variable in cpu_mp_start(), eliminating
  the last uses of KERNPHYSADDR outside of locore.S (where we can now
  calculate it instead of relying on the constant).

Modified:
  head/sys/arm/arm/machdep.c
  head/sys/arm/arm/mp_machdep.c
  head/sys/arm/arm/physmem.c
  head/sys/arm/at91/at91_machdep.c
  head/sys/arm/econa/econa_machdep.c
  head/sys/arm/include/physmem.h
  head/sys/arm/s3c2xx0/s3c24x0_machdep.c
  head/sys/arm/sa11x0/assabet_machdep.c
  head/sys/arm/xscale/i80321/ep80219_machdep.c
  head/sys/arm/xscale/i80321/iq31244_machdep.c
  head/sys/arm/xscale/i8134x/crb_machdep.c
  head/sys/arm/xscale/ixp425/avila_machdep.c
  head/sys/arm/xscale/pxa/pxa_machdep.c

Modified: head/sys/arm/arm/machdep.c
==============================================================================
--- head/sys/arm/arm/machdep.c	Sun Feb  9 02:06:12 2014	(r261648)
+++ head/sys/arm/arm/machdep.c	Sun Feb  9 02:39:00 2014	(r261649)
@@ -1032,6 +1032,8 @@ initarm(struct arm_boot_params *abp)
 	int i, j, err_devmap, mem_regions_sz;
 
 	lastaddr = parse_boot_param(abp);
+	arm_physmem_kernaddr = abp->abp_physaddr;
+
 	memsize = 0;
 	set_cpufuncs();
 

Modified: head/sys/arm/arm/mp_machdep.c
==============================================================================
--- head/sys/arm/arm/mp_machdep.c	Sun Feb  9 02:06:12 2014	(r261648)
+++ head/sys/arm/arm/mp_machdep.c	Sun Feb  9 02:39:00 2014	(r261649)
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/smp.h>
 #include <machine/pcb.h>
 #include <machine/pte.h>
+#include <machine/physmem.h>
 #include <machine/intr.h>
 #include <machine/vmparam.h>
 #ifdef VFP
@@ -120,16 +121,16 @@ cpu_mp_start(void)
 		    M_WAITOK | M_ZERO);
 	temp_pagetable_va = (vm_offset_t)contigmalloc(L1_TABLE_SIZE,
 	    M_TEMP, 0, 0x0, 0xffffffff, L1_TABLE_SIZE, 0);
-	addr = KERNPHYSADDR;
-	addr_end = (vm_offset_t)&_end - KERNVIRTADDR + KERNPHYSADDR;
+	addr = arm_physmem_kernaddr;
+	addr_end = (vm_offset_t)&_end - KERNVIRTADDR + arm_physmem_kernaddr;
 	addr_end &= ~L1_S_OFFSET;
 	addr_end += L1_S_SIZE;
 	bzero((void *)temp_pagetable_va,  L1_TABLE_SIZE);
-	for (addr = KERNPHYSADDR; addr <= addr_end; addr += L1_S_SIZE) { 
+	for (addr = arm_physmem_kernaddr; addr <= addr_end; addr += L1_S_SIZE) { 
 		((int *)(temp_pagetable_va))[addr >> L1_S_SHIFT] =
 		    L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr;
 		((int *)(temp_pagetable_va))[(addr -
-			KERNPHYSADDR + KERNVIRTADDR) >> L1_S_SHIFT] = 
+			arm_physmem_kernaddr + KERNVIRTADDR) >> L1_S_SHIFT] = 
 		    L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr;
 	}
 

Modified: head/sys/arm/arm/physmem.c
==============================================================================
--- head/sys/arm/arm/physmem.c	Sun Feb  9 02:06:12 2014	(r261648)
+++ head/sys/arm/arm/physmem.c	Sun Feb  9 02:39:00 2014	(r261649)
@@ -89,6 +89,9 @@ vm_paddr_t dump_avail[MAX_AVAIL_ENTRIES 
 /* This is the total number of hardware pages, excluded or not. */
 long realmem;
 
+/* The address at which the kernel was loaded.  Set early in initarm(). */
+vm_offset_t arm_physmem_kernaddr;
+
 /*
  * Print the contents of the physical and excluded region tables using the
  * provided printf-like output function (which will be either printf or

Modified: head/sys/arm/at91/at91_machdep.c
==============================================================================
--- head/sys/arm/at91/at91_machdep.c	Sun Feb  9 02:06:12 2014	(r261648)
+++ head/sys/arm/at91/at91_machdep.c	Sun Feb  9 02:39:00 2014	(r261649)
@@ -461,6 +461,7 @@ initarm(struct arm_boot_params *abp)
 	vm_offset_t lastaddr;
 
 	lastaddr = parse_boot_param(abp);
+	arm_physmem_kernaddr = abp->abp_physaddr;
 	set_cpufuncs();
 	pcpu0_init();
 

Modified: head/sys/arm/econa/econa_machdep.c
==============================================================================
--- head/sys/arm/econa/econa_machdep.c	Sun Feb  9 02:06:12 2014	(r261648)
+++ head/sys/arm/econa/econa_machdep.c	Sun Feb  9 02:39:00 2014	(r261649)
@@ -178,6 +178,7 @@ initarm(struct arm_boot_params *abp)
 
 	boothowto = RB_VERBOSE;
 	lastaddr = parse_boot_param(abp);
+	arm_physmem_kernaddr = abp->abp_physaddr;
 	set_cpufuncs();
 	pcpu0_init();
 

Modified: head/sys/arm/include/physmem.h
==============================================================================
--- head/sys/arm/include/physmem.h	Sun Feb  9 02:06:12 2014	(r261648)
+++ head/sys/arm/include/physmem.h	Sun Feb  9 02:39:00 2014	(r261649)
@@ -30,6 +30,11 @@
 #define	_MACHINE_PHYSMEM_H_
 
 /*
+ * The physical address at which the kernel was loaded.
+ */
+extern vm_offset_t arm_physmem_kernaddr;
+
+/*
  * Routines to help configure physical ram.
  *
  * Multiple regions of contiguous physical ram can be added (in any order).

Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c
==============================================================================
--- head/sys/arm/s3c2xx0/s3c24x0_machdep.c	Sun Feb  9 02:06:12 2014	(r261648)
+++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c	Sun Feb  9 02:39:00 2014	(r261649)
@@ -225,6 +225,7 @@ initarm(struct arm_boot_params *abp)
 
 	boothowto = 0;  /* Likely not needed */
 	lastaddr = parse_boot_param(abp);
+	arm_physmem_kernaddr = abp->abp_physaddr;
 	i = 0;
 	set_cpufuncs();
 	cpufuncs.cf_sleep = s3c24x0_sleep;

Modified: head/sys/arm/sa11x0/assabet_machdep.c
==============================================================================
--- head/sys/arm/sa11x0/assabet_machdep.c	Sun Feb  9 02:06:12 2014	(r261648)
+++ head/sys/arm/sa11x0/assabet_machdep.c	Sun Feb  9 02:39:00 2014	(r261649)
@@ -87,6 +87,8 @@ __FBSDID("$FreeBSD$");
 #include <machine/machdep.h>
 #include <machine/metadata.h>
 #include <machine/armreg.h>
+#include <machine/physmem.h>
+
 #include <machine/bus.h>
 #include <sys/reboot.h>
 
@@ -200,6 +202,7 @@ initarm(struct arm_boot_params *abp)
 
 	boothowto = RB_VERBOSE | RB_SINGLE;     /* Default value */
 	lastaddr = parse_boot_param(abp);
+	arm_physmem_kernaddr = abp->abp_physaddr;
 	cninit();
 	set_cpufuncs();
 	physmem = memsize / PAGE_SIZE;

Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c
==============================================================================
--- head/sys/arm/xscale/i80321/ep80219_machdep.c	Sun Feb  9 02:06:12 2014	(r261648)
+++ head/sys/arm/xscale/i80321/ep80219_machdep.c	Sun Feb  9 02:39:00 2014	(r261649)
@@ -86,6 +86,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/metadata.h>
 #include <machine/armreg.h>
 #include <machine/bus.h>
+#include <machine/physmem.h>
 #include <sys/reboot.h>
 
 #include <arm/xscale/i80321/i80321reg.h>
@@ -175,6 +176,7 @@ initarm(struct arm_boot_params *abp)
 	uint32_t memsize, memstart;
 
 	lastaddr = parse_boot_param(abp);
+	arm_physmem_kernaddr = abp->abp_physaddr;
 	set_cpufuncs();
 	pcpu_init(pcpup, 0, sizeof(struct pcpu));
 	PCPU_SET(curthread, &thread0);

Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c
==============================================================================
--- head/sys/arm/xscale/i80321/iq31244_machdep.c	Sun Feb  9 02:06:12 2014	(r261648)
+++ head/sys/arm/xscale/i80321/iq31244_machdep.c	Sun Feb  9 02:39:00 2014	(r261649)
@@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/msgbuf.h>
 #include <machine/reg.h>
 #include <machine/cpu.h>
+#include <machine/physmem.h>
 
 #include <vm/vm.h>
 #include <vm/pmap.h>
@@ -176,6 +177,7 @@ initarm(struct arm_boot_params *abp)
 	uint32_t memsize, memstart;
 
 	lastaddr = parse_boot_param(abp);
+	arm_physmem_kernaddr = abp->abp_physaddr;
 	set_cpufuncs();
 	pcpu_init(pcpup, 0, sizeof(struct pcpu));
 	PCPU_SET(curthread, &thread0);

Modified: head/sys/arm/xscale/i8134x/crb_machdep.c
==============================================================================
--- head/sys/arm/xscale/i8134x/crb_machdep.c	Sun Feb  9 02:06:12 2014	(r261648)
+++ head/sys/arm/xscale/i8134x/crb_machdep.c	Sun Feb  9 02:39:00 2014	(r261649)
@@ -86,6 +86,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/metadata.h>
 #include <machine/armreg.h>
 #include <machine/bus.h>
+#include <machine/physmem.h>
 #include <sys/reboot.h>
 
 
@@ -175,6 +176,7 @@ initarm(struct arm_boot_params *abp)
 	uint32_t memsize, memstart;
 
 	lastaddr = parse_boot_param(abp);
+	arm_physmem_kernaddr = abp->abp_physaddr;
 	set_cpufuncs();
 	pcpu_init(pcpup, 0, sizeof(struct pcpu));
 	PCPU_SET(curthread, &thread0);

Modified: head/sys/arm/xscale/ixp425/avila_machdep.c
==============================================================================
--- head/sys/arm/xscale/ixp425/avila_machdep.c	Sun Feb  9 02:06:12 2014	(r261648)
+++ head/sys/arm/xscale/ixp425/avila_machdep.c	Sun Feb  9 02:39:00 2014	(r261649)
@@ -222,6 +222,7 @@ initarm(struct arm_boot_params *abp)
 #define	KERNEL_TEXT_PHYS	(PHYSADDR + KERNEL_TEXT_OFF)
 
 	lastaddr = parse_boot_param(abp);
+	arm_physmem_kernaddr = abp->abp_physaddr;
 	set_cpufuncs();		/* NB: sets cputype */
 	pcpu_init(pcpup, 0, sizeof(struct pcpu));
 	PCPU_SET(curthread, &thread0);

Modified: head/sys/arm/xscale/pxa/pxa_machdep.c
==============================================================================
--- head/sys/arm/xscale/pxa/pxa_machdep.c	Sun Feb  9 02:06:12 2014	(r261648)
+++ head/sys/arm/xscale/pxa/pxa_machdep.c	Sun Feb  9 02:39:00 2014	(r261649)
@@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/metadata.h>
 #include <machine/armreg.h>
 #include <machine/bus.h>
+#include <machine/physmem.h>
 #include <sys/reboot.h>
 
 #include <arm/xscale/pxa/pxareg.h>
@@ -157,6 +158,7 @@ initarm(struct arm_boot_params *abp)
 	uint32_t memsize[PXA2X0_SDRAM_BANKS], memstart[PXA2X0_SDRAM_BANKS];
 
 	lastaddr = parse_boot_param(abp);
+	arm_physmem_kernaddr = abp->abp_physaddr;
 	set_cpufuncs();
 	pcpu_init(pcpup, 0, sizeof(struct pcpu));
 	PCPU_SET(curthread, &thread0);


More information about the svn-src-all mailing list