From owner-svn-src-all@FreeBSD.ORG Sun Feb 9 01:21:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A2DE078F; Sun, 9 Feb 2014 01:21:31 +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 7ECCF1188; Sun, 9 Feb 2014 01:21:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s191LVlK004857; Sun, 9 Feb 2014 01:21:31 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s191LUj2004851; Sun, 9 Feb 2014 01:21:30 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201402090121.s191LUj2004851@svn.freebsd.org> From: Ian Lepore Date: Sun, 9 Feb 2014 01:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261646 - in head/sys/arm: at91 econa s3c2xx0 xscale/ixp425 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 01:21:31 -0000 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 #include -/* 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 */