From owner-svn-src-all@FreeBSD.ORG Sun Feb 9 02:39:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1346A714; Sun, 9 Feb 2014 02:39:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F08EA1655; Sun, 9 Feb 2014 02:39:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s192d3ow039426; Sun, 9 Feb 2014 02:39:03 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s192d1bo039399; Sun, 9 Feb 2014 02:39:01 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402090239.s192d1bo039399@svn.freebsd.org> From: Ian Lepore Date: Sun, 9 Feb 2014 02:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261649 - in head/sys/arm: arm at91 econa include s3c2xx0 sa11x0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Feb 2014 02:39:04 -0000 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 #include #include +#include #include #include #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 #include #include +#include + #include #include @@ -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 #include #include +#include #include #include @@ -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 #include #include +#include #include #include @@ -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 #include #include +#include #include @@ -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 #include #include +#include #include #include @@ -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);