From owner-freebsd-arm@FreeBSD.ORG Wed Nov 28 15:03:39 2007 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AE5B16A418 for ; Wed, 28 Nov 2007 15:03:39 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from mail.semihalf.com (mail.semihalf.com [83.15.139.206]) by mx1.freebsd.org (Postfix) with ESMTP id D9F0B13C4CE for ; Wed, 28 Nov 2007 15:03:38 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from localhost (unknown [127.0.0.1]) by mail.semihalf.com (Postfix) with ESMTP id CD180143E7; Wed, 28 Nov 2007 16:05:32 +0100 (CET) Received: from mail.semihalf.com ([127.0.0.1]) by localhost (mail.semihalf.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22632-02; Wed, 28 Nov 2007 16:05:29 +0100 (CET) Message-ID: <474D8345.30505@semihalf.com> Date: Wed, 28 Nov 2007 16:03:33 +0100 From: Rafal Jaworowski MIME-Version: 1.0 To: freebsd-arm@freebsd.org Content-Type: multipart/mixed; boundary="------------030700030908050405090503" X-Virus-Scanned: by amavisd-new at semihalf.com Subject: ARM9E issues X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2007 15:03:39 -0000 This is a multi-part message in MIME format. --------------030700030908050405090503 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit Hi, When trying to produce code for ARM9E variant I encountered the following issues with building kernel: 1. Per earlier discussion with Warner, the CPU_ARM9E is supposed to be mutually exclusive with CPU_ARM9 or other cpu idents, but there are some fixes needed to build with CPU_ARM9E alone -- see attached arm9e_cpufuncs-fix.diff. 2. When the kernel is built with -mcpu=arm9e the low-level routines (bcopy_page(), bzero_page() and friends) fail to assemble: src/sys/arm/arm/bcopy_page.S:190: Error: selected processor does not support `pld [r0]' src/sys/arm/arm/bcopy_page.S:195: Error: selected processor does not support `pld [r0,#0x18]' ... ... Those problematic instructions appear within _ARM_ARCH_5E conditionals, which confused me a lot since -mcpu=arm9e should be compliant with v5te, right? Upon further investigation and comparison with equivalent NetBSD code I noticed that all those conditional sections we now have _ARM_ARCH_5E'ed originally were __XSCALE__ conditionals... When I revert _ARM_ARCH_5E -> __XSCALE__ (xscale_v5te-low_level.diff) the kernel builds with -mcpu=arm9e (no assembly errors) and works. I assume we have imported the NetBSD base, so what was the reason for this conditionals change? Were all those sections of code considered to work on any v5te and not only Xscale? Maybe what I'm seeing is some FreeBSD/arm toolchain problem. I'll look into this further, but any comments or hints are appreciated. Rafal --------------030700030908050405090503 Content-Type: text/plain; name="arm9e_cpufuncs-fix.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="arm9e_cpufuncs-fix.diff" diff --git a/src/sys/arm/arm/cpufunc.c b/src/sys/arm/arm/cpufunc.c index 1c51140..b3f4829 100644 --- a/src/sys/arm/arm/cpufunc.c +++ b/src/sys/arm/arm/cpufunc.c @@ -737,10 +737,10 @@ struct cpu_functions cpufuncs; u_int cputype; u_int cpu_reset_needs_v4_MMU_disable; /* flag used in locore.s */ -#if defined(CPU_ARM7TDMI) || defined(CPU_ARM8) || defined(CPU_ARM9) || \ - defined (CPU_ARM10) || \ - defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ - defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ +#if defined(CPU_ARM7TDMI) || defined(CPU_ARM8) || defined(CPU_ARM9) || \ + defined(CPU_ARM9E) || defined (CPU_ARM10) || \ + defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ + defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) static void get_cachetype_cp15(void); @@ -938,7 +938,7 @@ #if defined(CPU_ARM9E) || defined(CPU_AR cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ get_cachetype_cp15(); pmap_pte_init_generic(); - return 0; + goto out; } #endif /* CPU_ARM9E || CPU_ARM10 */ #ifdef CPU_ARM10 @@ -1798,6 +1798,9 @@ #endif /* Now really make sure they are clean. */ __asm __volatile ("mcr\tp15, 0, r0, c7, c7, 0" : : ); + if (vector_page == ARM_VECTORS_HIGH) + cpuctrl |= CPU_CONTROL_VECRELOC; + /* Set the control register */ ctrl = cpuctrl; cpu_control(0xffffffff, cpuctrl); --------------030700030908050405090503 Content-Type: text/plain; name="xscale_v5e-low_level.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xscale_v5e-low_level.diff" diff --git a/src/sys/arm/arm/bcopy_page.S b/src/sys/arm/arm/bcopy_page.S index ebbd1dd..c50e152 100644 --- a/src/sys/arm/arm/bcopy_page.S +++ b/src/sys/arm/arm/bcopy_page.S @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD: src/sys/arm/arm/bcop #include "assym.s" -#ifndef _ARM_ARCH_5E +#ifndef __XSCALE__ /* #define BIG_LOOPS */ @@ -179,10 +179,10 @@ #endif ldmfd sp!, {r4-r8, pc} -#else /* _ARM_ARCH_5E */ +#else /* __XSCALE__ */ /* - * armv5e version of bcopy_page + * XSCALE version of bcopy_page */ ENTRY(bcopy_page) pld [r0] @@ -248,7 +248,7 @@ ENTRY(bcopy_page) RET /* - * armv5e version of bzero_page + * XSCALE version of bzero_page */ ENTRY(bzero_page) mov r1, #PAGE_SIZE @@ -273,4 +273,4 @@ ENTRY(bzero_page) subs r1, r1, #128 bne 1b RET -#endif /* _ARM_ARCH_5E */ +#endif /* __XSCALE__ */ diff --git a/src/sys/arm/arm/bcopyinout.S b/src/sys/arm/arm/bcopyinout.S index 1c695e6..7476d39 100644 --- a/src/sys/arm/arm/bcopyinout.S +++ b/src/sys/arm/arm/bcopyinout.S @@ -46,7 +46,7 @@ #include .word _C_LABEL(_min_memcpy_size) __FBSDID("$FreeBSD: src/sys/arm/arm/bcopyinout.S,v 1.9 2007/10/13 12:05:03 cognet Exp $"); -#ifdef _ARM_ARCH_5E +#ifdef __XSCALE__ #include #else @@ -64,7 +64,7 @@ #endif #define SAVE_REGS stmfd sp!, {r4-r11} #define RESTORE_REGS ldmfd sp!, {r4-r11} -#if defined(_ARM_ARCH_5E) +#if defined(__XSCALE__) #define HELLOCPP # #define PREFETCH(rx,o) pld [ rx , HELLOCPP (o) ] #else diff --git a/src/sys/arm/arm/in_cksum_arm.S b/src/sys/arm/arm/in_cksum_arm.S index 879a0e9..e021c7c 100644 --- a/src/sys/arm/arm/in_cksum_arm.S +++ b/src/sys/arm/arm/in_cksum_arm.S @@ -113,7 +113,7 @@ ENTRY(do_cksum) */ /* LINTSTUB: Ignore */ ASENTRY_NP(L_cksumdata) -#ifdef _ARM_ARCH_5E +#ifdef __XSCALE__ pld [r0] /* Pre-fetch the start of the buffer */ #endif mov r2, #0 @@ -147,7 +147,7 @@ #endif /* Buffer is now word aligned */ .Lcksumdata_wordaligned: -#ifdef _ARM_ARCH_5E +#ifdef __XSCALE__ cmp r1, #0x04 /* Less than 4 bytes left? */ blt .Lcksumdata_endgame /* Yup */ @@ -202,7 +202,7 @@ #ifdef _ARM_ARCH_5E adcs r2, r2, r7 adc r2, r2, #0x00 -#else /* !_ARM_ARCH_5E */ +#else /* !__XSCALE__ */ subs r1, r1, #0x40 blt .Lcksumdata_bigloop_end @@ -238,7 +238,7 @@ #endif RETeq cmp r1, #0x20 -#ifdef _ARM_ARCH_5E +#ifdef __XSCALE__ ldrged r4, [r0], #0x08 /* Avoid stalling pld and result */ blt .Lcksumdata_less_than_32 pld [r0, #0x18] diff --git a/src/sys/arm/arm/support.S b/src/sys/arm/arm/support.S index 37bd317..882888c 100644 --- a/src/sys/arm/arm/support.S +++ b/src/sys/arm/arm/support.S @@ -86,13 +86,13 @@ do_memset: /* We are now word aligned */ .Lmemset_wordaligned: orr r3, r3, r3, lsl #8 /* Extend value to 16-bits */ -#ifdef _ARM_ARCH_5E +#ifdef __XSCALE__ tst ip, #0x04 /* Quad-align for armv5e */ #else cmp r1, #0x10 #endif orr r3, r3, r3, lsl #16 /* Extend value to 32-bits */ -#ifdef _ARM_ARCH_5E +#ifdef __XSCALE__ subne r1, r1, #0x04 /* Quad-align if necessary */ strne r3, [ip], #0x04 cmp r1, #0x10 @@ -105,7 +105,7 @@ #endif /* Do 128 bytes at a time */ .Lmemset_loop128: subs r1, r1, #0x80 -#ifdef _ARM_ARCH_5E +#ifdef __XSCALE__ strged r2, [ip], #0x08 strged r2, [ip], #0x08 strged r2, [ip], #0x08 @@ -148,7 +148,7 @@ #endif /* Do 32 bytes at a time */ .Lmemset_loop32: subs r1, r1, #0x20 -#ifdef _ARM_ARCH_5E +#ifdef __XSCALE__ strged r2, [ip], #0x08 strged r2, [ip], #0x08 strged r2, [ip], #0x08 @@ -165,7 +165,7 @@ #endif adds r1, r1, #0x10 /* Partially adjust for extra sub */ /* Deal with 16 bytes or more */ -#ifdef _ARM_ARCH_5E +#ifdef __XSCALE__ strged r2, [ip], #0x08 strged r2, [ip], #0x08 #else @@ -183,7 +183,7 @@ #endif bgt .Lmemset_loop4 RETeq /* Zero length so just exit */ -#ifdef _ARM_ARCH_5E +#ifdef __XSCALE__ /* Compensate for 64-bit alignment check */ adds r1, r1, #0x04 RETeq @@ -868,7 +868,7 @@ #endif add r1, r1, #1 b .Lmemmove_bl4 -#if !defined(_ARM_ARCH_5E) +#if !defined(__XSCALE__) ENTRY(memcpy) /* save leaf functions having to store this away */ /* Do not check arm_memcpy if we're running from flash */ @@ -2870,7 +2870,7 @@ #endif strh r2, [r0, #0x09] strb r1, [r0, #0x0b] RET -#endif /* _ARM_ARCH_5E */ +#endif /* __XSCALE__ */ #ifdef GPROF diff --git a/src/sys/arm/arm/swtch.S b/src/sys/arm/arm/swtch.S index 03fabfb..3e46904 100644 --- a/src/sys/arm/arm/swtch.S +++ b/src/sys/arm/arm/swtch.S @@ -187,7 +187,7 @@ #endif /* PMAP_INCLUDE_PTE_SYNC */ ldr pc, [r9, #CF_CONTEXT_SWITCH] /* Restore all the save registers */ -#ifndef _ARM_ARCH_5E +#ifndef __XSCALE__ add r1, r7, #PCB_R8 ldmia r1, {r8-r13} #else @@ -249,7 +249,7 @@ #endif mov r4, r0 /* Save the old thread. */ /* Save all the registers in the old thread's pcb */ -#ifndef _ARM_ARCH_5E +#ifndef __XSCALE__ add r7, r2, #(PCB_R8) stmia r7, {r8-r13} #else @@ -419,7 +419,7 @@ #endif /* PMAP_INCLUDE_PTE_SYNC */ msr cpsr_c, r3 /* Restore the old mode */ /* Restore all the save registers */ -#ifndef _ARM_ARCH_5E +#ifndef __XSCALE__ add r7, r9, #PCB_R8 ldmia r7, {r8-r13} sub r7, r7, #PCB_R8 /* restore PCB pointer */ --------------030700030908050405090503-- From owner-freebsd-arm@FreeBSD.ORG Wed Nov 28 15:32:14 2007 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28FE816A417 for ; Wed, 28 Nov 2007 15:32:14 +0000 (UTC) (envelope-from mlfbsd@dong.ci0.org) Received: from dong.ci0.org (dong.ci0.org [IPv6:2001:7a8:2066:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 41B5013C45B for ; Wed, 28 Nov 2007 15:32:12 +0000 (UTC) (envelope-from mlfbsd@dong.ci0.org) Received: from dong.ci0.org (localhost.ci0.org [127.0.0.1]) by dong.ci0.org (8.14.1/8.13.8) with ESMTP id lASGQuob027533; Wed, 28 Nov 2007 17:26:56 +0100 (CET) (envelope-from mlfbsd@dong.ci0.org) Received: (from mlfbsd@localhost) by dong.ci0.org (8.14.1/8.13.8/Submit) id lASGQtfF027532; Wed, 28 Nov 2007 17:26:55 +0100 (CET) (envelope-from mlfbsd) Date: Wed, 28 Nov 2007 17:26:55 +0100 From: Olivier Houchard To: Rafal Jaworowski Message-ID: <20071128162655.GA27260@ci0.org> References: <474D8345.30505@semihalf.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <474D8345.30505@semihalf.com> User-Agent: Mutt/1.4.1i Cc: freebsd-arm@freebsd.org Subject: Re: ARM9E issues X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2007 15:32:14 -0000 Hi Rafal, On Wed, Nov 28, 2007 at 04:03:33PM +0100, Rafal Jaworowski wrote: > Hi, > > When trying to produce code for ARM9E variant I encountered the following > issues with building kernel: > > 1. Per earlier discussion with Warner, the CPU_ARM9E is supposed to be > mutually exclusive with CPU_ARM9 or other cpu idents, but there are some fixes > needed to build with CPU_ARM9E alone -- see attached arm9e_cpufuncs-fix.diff. > I'll take care of this. Thanks ! > 2. When the kernel is built with -mcpu=arm9e the low-level routines > (bcopy_page(), bzero_page() and friends) fail to assemble: > > src/sys/arm/arm/bcopy_page.S:190: Error: selected processor does not support > `pld [r0]' > src/sys/arm/arm/bcopy_page.S:195: Error: selected processor does not support > `pld [r0,#0x18]' > ... > ... > > Those problematic instructions appear within _ARM_ARCH_5E conditionals, which > confused me a lot since -mcpu=arm9e should be compliant with v5te, right? Upon > further investigation and comparison with equivalent NetBSD code I noticed > that all those conditional sections we now have _ARM_ARCH_5E'ed originally > were __XSCALE__ conditionals... When I revert _ARM_ARCH_5E -> __XSCALE__ > (xscale_v5te-low_level.diff) the kernel builds with -mcpu=arm9e (no assembly > errors) and works. > > I assume we have imported the NetBSD base, so what was the reason for this > conditionals change? Were all those sections of code considered to work on any > v5te and not only Xscale? > > Maybe what I'm seeing is some FreeBSD/arm toolchain problem. I'll look into > this further, but any comments or hints are appreciated. > This is a bug in gas. pld should work for ARM_ARCH_5E, however when you specify -mcpu=arm9e to gas, due to the way it works (by parsing its cpu list and doing a strncmp(list->cpuname, nameprovided, strlen(nameprovided)), it will match arm9e-r0, which is not armv5e. I don't know if this has been fixed in later revisions of binutils, I should check. As a workaround, you can compile your kernel with "-DCPU_ARM9E -march=armv5te" instead. Regards, Olivier From owner-freebsd-arm@FreeBSD.ORG Wed Nov 28 16:00:56 2007 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8A8C16A420 for ; Wed, 28 Nov 2007 16:00:56 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from mail.semihalf.com (mail.semihalf.com [83.15.139.206]) by mx1.freebsd.org (Postfix) with ESMTP id 7414613C45B for ; Wed, 28 Nov 2007 16:00:56 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from localhost (unknown [127.0.0.1]) by mail.semihalf.com (Postfix) with ESMTP id C353F14405; Wed, 28 Nov 2007 17:02:50 +0100 (CET) Received: from mail.semihalf.com ([127.0.0.1]) by localhost (mail.semihalf.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 13597-09; Wed, 28 Nov 2007 17:02:49 +0100 (CET) Message-ID: <474D90B4.4010400@semihalf.com> Date: Wed, 28 Nov 2007 17:00:52 +0100 From: Rafal Jaworowski MIME-Version: 1.0 To: Olivier Houchard References: <474D8345.30505@semihalf.com> <20071128162655.GA27260@ci0.org> In-Reply-To: <20071128162655.GA27260@ci0.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at semihalf.com Cc: freebsd-arm@freebsd.org Subject: Re: ARM9E issues X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2007 16:00:56 -0000 Olivier Houchard wrote: >> Maybe what I'm seeing is some FreeBSD/arm toolchain problem. I'll look into >> this further, but any comments or hints are appreciated. > > This is a bug in gas. pld should work for ARM_ARCH_5E, however when you > specify -mcpu=arm9e to gas, due to the way it works (by parsing its cpu list > and doing a strncmp(list->cpuname, nameprovided, strlen(nameprovided)), it > will match arm9e-r0, which is not armv5e. I don't know if this has been fixed > in later revisions of binutils, I should check. As a workaround, you can > compile your kernel with "-DCPU_ARM9E -march=armv5te" instead. > Hi Olivier, Thanks for confirmation, I felt it was rather something around the toolchain, as I was seeing warnings about incompatible settings when tried with both -mcpu=arm9e and -march=armv5te, which should be perfectly legal. kind regards, Rafal From owner-freebsd-arm@FreeBSD.ORG Thu Nov 29 00:24:27 2007 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2758C16A417; Thu, 29 Nov 2007 00:24:27 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from smarthost1.sentex.ca (smarthost1.sentex.ca [64.7.153.18]) by mx1.freebsd.org (Postfix) with ESMTP id E678913C455; Thu, 29 Nov 2007 00:24:26 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from smtp1.sentex.ca (smtp1c.sentex.ca [64.7.153.10]) by smarthost1.sentex.ca (8.13.8/8.13.8) with ESMTP id lAT0OQR6081832; Wed, 28 Nov 2007 19:24:26 -0500 (EST) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by smtp1.sentex.ca (8.14.1/8.14.1) with ESMTP id lAT0OPCQ014468; Wed, 28 Nov 2007 19:24:26 -0500 (EST) (envelope-from tinderbox@freebsd.org) Received: by freebsd-current.sentex.ca (Postfix, from userid 666) id D287073039; Wed, 28 Nov 2007 19:24:25 -0500 (EST) Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Message-Id: <20071129002425.D287073039@freebsd-current.sentex.ca> Date: Wed, 28 Nov 2007 19:24:25 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/4641/Tue Oct 30 15:59:09 2007 clamav-milter version 0.91.2 on clamscanner1 X-Virus-Status: Clean Cc: Subject: [head tinderbox] failure on arm/arm X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2007 00:24:27 -0000 TB --- 2007-11-29 00:05:00 - tinderbox 2.3 running on freebsd-current.sentex.ca TB --- 2007-11-29 00:05:00 - starting HEAD tinderbox run for arm/arm TB --- 2007-11-29 00:05:00 - cleaning the object tree TB --- 2007-11-29 00:05:25 - cvsupping the source tree TB --- 2007-11-29 00:05:25 - /usr/bin/csup -r 3 -g -L 1 -h localhost -s /tinderbox/HEAD/arm/arm/supfile TB --- 2007-11-29 00:05:34 - building world (CFLAGS=-O -pipe) TB --- 2007-11-29 00:05:34 - cd /src TB --- 2007-11-29 00:05:34 - /usr/bin/make -B buildworld >>> World build started on Thu Nov 29 00:05:38 UTC 2007 >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3: cross tools >>> stage 4.1: building includes >>> stage 4.2: building libraries [...] cc -O -pipe -I/src/cddl/lib/libnvpair/../../../compat/opensolaris/include -I/src/cddl/lib/libnvpair/../../../sys/compat/opensolaris -I/src/cddl/lib/libnvpair/../../../sys/contrib/opensolaris/uts/common -Wno-unknown-pragmas -c /src/cddl/lib/libnvpair/../../../contrib/opensolaris/lib/libnvpair/libnvpair.c cc -O -pipe -I/src/cddl/lib/libnvpair/../../../compat/opensolaris/include -I/src/cddl/lib/libnvpair/../../../sys/compat/opensolaris -I/src/cddl/lib/libnvpair/../../../sys/contrib/opensolaris/uts/common -Wno-unknown-pragmas -c /src/cddl/lib/libnvpair/../../../contrib/opensolaris/lib/libnvpair/nvpair_alloc_system.c cc -O -pipe -I/src/cddl/lib/libnvpair/../../../compat/opensolaris/include -I/src/cddl/lib/libnvpair/../../../sys/compat/opensolaris -I/src/cddl/lib/libnvpair/../../../sys/contrib/opensolaris/uts/common -Wno-unknown-pragmas -c /src/cddl/lib/libnvpair/../../../sys/contrib/opensolaris/common/nvpair/nvpair_alloc_fixed.c cc -O -pipe -I/src/cddl/lib/libnvpair/../../../compat/opensolaris/include -I/src/cddl/lib/libnvpair/../../../sys/compat/opensolaris -I/src/cddl/lib/libnvpair/../../../sys/contrib/opensolaris/uts/common -Wno-unknown-pragmas -c /src/cddl/lib/libnvpair/../../../sys/contrib/opensolaris/common/nvpair/nvpair.c In file included from /src/cddl/lib/libnvpair/../../../sys/contrib/opensolaris/common/nvpair/nvpair.c:33: /src/cddl/lib/libnvpair/../../../sys/compat/opensolaris/rpc/xdr.h:58: error: redefinition of 'struct xdr_bytesrec' /src/cddl/lib/libnvpair/../../../sys/compat/opensolaris/rpc/xdr.h:63: error: redefinition of typedef 'xdr_bytesrec' /src/cddl/lib/libnvpair/../../../sys/contrib/opensolaris/uts/common/rpc/xdr.h:531: error: previous declaration of 'xdr_bytesrec' was here *** Error code 1 Stop in /src/cddl/lib/libnvpair. *** Error code 1 Stop in /src/cddl/lib. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2007-11-29 00:24:25 - WARNING: /usr/bin/make returned exit code 1 TB --- 2007-11-29 00:24:25 - ERROR: failed to build world TB --- 2007-11-29 00:24:25 - tinderbox aborted TB --- 862.38 user 120.44 system 1165.10 real http://tinderbox.des.no/tinderbox-head-HEAD-arm-arm.full From owner-freebsd-arm@FreeBSD.ORG Fri Nov 30 11:53:42 2007 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B372516A46E for ; Fri, 30 Nov 2007 11:53:42 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from mail.semihalf.com (mail.semihalf.com [83.15.139.206]) by mx1.freebsd.org (Postfix) with ESMTP id BC2DC13C4F4 for ; Fri, 30 Nov 2007 11:53:41 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from localhost (unknown [127.0.0.1]) by mail.semihalf.com (Postfix) with ESMTP id 612301449F; Fri, 30 Nov 2007 12:55:46 +0100 (CET) Received: from mail.semihalf.com ([127.0.0.1]) by localhost (mail.semihalf.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15132-02; Fri, 30 Nov 2007 12:55:42 +0100 (CET) Message-ID: <474FF9BF.8090707@semihalf.com> Date: Fri, 30 Nov 2007 12:53:35 +0100 From: Rafal Jaworowski MIME-Version: 1.0 To: Olivier Houchard Content-Type: multipart/mixed; boundary="------------090709020103070600080902" X-Virus-Scanned: by amavisd-new at semihalf.com Cc: freebsd-arm@freebsd.org Subject: ARM arch subdir cleanups X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2007 11:53:42 -0000 This is a multi-part message in MIME format. --------------090709020103070600080902 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit Hi, Attached are two patches with the following cleanups: 1. Convert nexus to standard device since it's mandatory anyway, remove stale nexus_io_asm.S and nexus_io.c 2. Streamline sys/conf/files.arm (and hence the kernel image contents): move asm routines to appropriate sys/arm//files. It seems to me other items in the ARM arch subdirectory would benefit from optimization/cleanups too, for example: - Shared OBIO routines. At least these are nearly identical and could be compressed into one I guess: xscale/i80321/obio_space.c xscale/i8134x/obio_space.c xscale/pxa2x0/pxa2x0_space.c (in P4) - Shared bus space generic methods. A lot of BS methods like *_bs_map(), _bs_subregion() etc. are copied in separate files for different ARM platforms, but most of this could be placed in one file, just like we have a common assembly routines in the arm/arm/bus_space_asm_generic.S. - Others like arm/arm/machdep.c and arm/arm/sys_machdep.c seem akin, could they be merged into one file? I can work on cleaning those up, would such changes be welcome? Rafal --------------090709020103070600080902 Content-Type: text/plain; name="nexus_cleanup.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="nexus_cleanup.diff" diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c index 8103df1..3e0efc9 100644 --- a/sys/arm/arm/nexus.c +++ b/sys/arm/arm/nexus.c @@ -166,7 +166,7 @@ nexus_print_child(device_t bus, device_t int retval = 0; retval += bus_print_child_header(bus, child); - retval += printf(" on motherboard\n"); /* XXX "motherboard", ick */ + retval += printf("\n"); return (retval); } diff --git a/sys/arm/arm/nexus_io.c b/sys/arm/arm/nexus_io.c deleted file mode 100644 index 37fad02..0000000 --- a/sys/arm/arm/nexus_io.c +++ /dev/null @@ -1,202 +0,0 @@ -/* $NetBSD: mainbus_io.c,v 1.13 2003/07/15 00:24:47 lukem Exp $ */ - -/*- - * Copyright (c) 1997 Mark Brinicombe. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Mark Brinicombe. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* - * bus_space I/O functions for mainbus - */ - -#include -__FBSDID("$FreeBSD: src/sys/arm/arm/nexus_io.c,v 1.7 2006/11/19 23:46:50 sam Exp $"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include -#include - -/* Proto types for all the bus_space structure functions */ -vm_offset_t lala; -bs_protos(nexus); -/* Declare the mainbus bus space tag */ - -struct bus_space mainbus_bs_tag = { - /* cookie */ - NULL, - - /* mapping/unmapping */ - nexus_bs_map, - nexus_bs_unmap, - nexus_bs_subregion, - - /* allocation/deallocation */ - nexus_bs_alloc, - nexus_bs_free, - - /* barrier */ - nexus_bs_barrier, - - /* read (single) */ - nexus_bs_r_1, - nexus_bs_r_2, - nexus_bs_r_4, - NULL, - - /* read multiple */ - NULL, - nexus_bs_rm_2, - NULL, - NULL, - - /* read region */ - NULL, - NULL, - NULL, - NULL, - - /* write (single) */ - nexus_bs_w_1, - nexus_bs_w_2, - nexus_bs_w_4, - NULL, - - /* write multiple */ - nexus_bs_wm_1, - nexus_bs_wm_2, - NULL, - NULL, - - /* write region */ - NULL, - NULL, - NULL, - NULL, - - NULL, - NULL, - NULL, - NULL, - - /* set region */ - NULL, - NULL, - NULL, - NULL, - - /* copy */ - NULL, - NULL, - NULL, - NULL, -}; - -/* bus space functions */ - -int -nexus_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int cacheable, - bus_space_handle_t *bshp) -{ - return(0); -} - -int -nexus_bs_alloc(t, rstart, rend, size, alignment, boundary, cacheable, - bpap, bshp) - void *t; - bus_addr_t rstart, rend; - bus_size_t size, alignment, boundary; - int cacheable; - bus_addr_t *bpap; - bus_space_handle_t *bshp; -{ - panic("mainbus_bs_alloc(): Help!"); -} - - -void -nexus_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size) -{ - /* - * Temporary implementation - */ -} - -void -nexus_bs_free(t, bsh, size) - void *t; - bus_space_handle_t bsh; - bus_size_t size; -{ - - panic("mainbus_bs_free(): Help!"); - /* mainbus_bs_unmap() does all that we need to do. */ -/* mainbus_bs_unmap(t, bsh, size);*/ -} - -int -nexus_bs_subregion(t, bsh, offset, size, nbshp) - void *t; - bus_space_handle_t bsh; - bus_size_t offset, size; - bus_space_handle_t *nbshp; -{ - - *nbshp = bsh + offset; - return (0); -} - -int -nexus_bs_mmap(struct cdev *dev, vm_offset_t off, vm_paddr_t *addr, int prot) -{ - *addr = off; - return (0); -} - -void -nexus_bs_barrier(t, bsh, offset, len, flags) - void *t; - bus_space_handle_t bsh; - bus_size_t offset, len; - int flags; -{ -} - -/* End of mainbus_io.c */ diff --git a/sys/arm/arm/nexus_io_asm.S b/sys/arm/arm/nexus_io_asm.S deleted file mode 100644 index bbf7eb7..0000000 --- a/sys/arm/arm/nexus_io_asm.S +++ /dev/null @@ -1,114 +0,0 @@ -/* $NetBSD: mainbus_io_asm.S,v 1.1 2001/02/24 19:38:02 reinoud Exp $ */ - -/*- - * Copyright (c) 1997 Mark Brinicombe. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Mark Brinicombe. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include -__FBSDID("$FreeBSD: src/sys/arm/arm/nexus_io_asm.S,v 1.3 2005/01/05 21:58:47 imp Exp $"); - -/* - * bus_space I/O functions for nexus - */ - - -/* - * read single - */ - -ENTRY(nexus_bs_r_1) - ldrb r0, [r1, r2, lsl #2] - RET - -ENTRY(nexus_bs_r_2) - ldr r0, [r1, r2, lsl #2] - bic r0, r0, #0xff000000 - bic r0, r0, #0x00ff0000 - RET - -ENTRY(nexus_bs_r_4) - ldr r0, [r1, r2, lsl #2] - RET - -/* - * write single - */ - -ENTRY(nexus_bs_w_1) - strb r3, [r1, r2, lsl #2] - RET - -ENTRY(nexus_bs_w_2) - mov r3, r3, lsl #16 - orr r3, r3, r3, lsr #16 - str r3, [r1, r2, lsl #2] - RET - -ENTRY(nexus_bs_w_4) - str r3, [r1, r2, lsl #2] - RET - -/* - * read multiple - */ - -ENTRY(nexus_bs_rm_2) - add r0, r1, r2, lsl #2 - mov r1, r3 - ldr r2, [sp, #0] - b _C_LABEL(insw16) - -/* - * write multiple - */ - -ENTRY(nexus_bs_wm_1) - add r0, r1, r2, lsl #2 - ldr r2, [sp, #0] - - /* Make sure that we have a positive length */ - cmp r2, #0x00000000 - movle pc, lr - -nexus_wm_1_loop: - ldrb r1, [r3], #0x0001 - str r1, [r0] - subs r2, r2, #0x00000001 - bgt nexus_wm_1_loop - - RET - -ENTRY(nexus_bs_wm_2) - add r0, r1, r2, lsl #2 - mov r1, r3 - ldr r2, [sp, #0] - b _C_LABEL(outsw16) diff --git a/sys/arm/conf/AVILA b/sys/arm/conf/AVILA index d37d67b..94e9501 100644 --- a/sys/arm/conf/AVILA +++ b/sys/arm/conf/AVILA @@ -80,7 +80,6 @@ #options PREEMPTION #options VERBOSE_SYSINIT device genclock -device nexus device mem # Memory and kernel memory devices #device saarm diff --git a/sys/arm/conf/BWCT b/sys/arm/conf/BWCT index 1ad60a7..8dfcf16 100644 --- a/sys/arm/conf/BWCT +++ b/sys/arm/conf/BWCT @@ -73,7 +73,6 @@ device random device ether device vlan device pty -device nexus device uart device ate device mii diff --git a/sys/arm/conf/CRB b/sys/arm/conf/CRB index 4f66544..cc48b00 100644 --- a/sys/arm/conf/CRB +++ b/sys/arm/conf/CRB @@ -67,7 +67,6 @@ #options PREEMPTION device genclock device loop device ether -device nexus device mem # Memory and kernel memory devices #device saarm device miibus diff --git a/sys/arm/conf/EP80219 b/sys/arm/conf/EP80219 index 4bd600e..9c99132 100644 --- a/sys/arm/conf/EP80219 +++ b/sys/arm/conf/EP80219 @@ -69,7 +69,6 @@ #options PREEMPTION device genclock device loop device ether -device nexus device mem # Memory and kernel memory devices #device saarm device miibus diff --git a/sys/arm/conf/HL200 b/sys/arm/conf/HL200 index 6e6c4a4..f70c037 100644 --- a/sys/arm/conf/HL200 +++ b/sys/arm/conf/HL200 @@ -78,7 +78,6 @@ device random device pty device loop device ether -device nexus device uart device ate device mii diff --git a/sys/arm/conf/IQ31244 b/sys/arm/conf/IQ31244 index c05d549..86c008e 100644 --- a/sys/arm/conf/IQ31244 +++ b/sys/arm/conf/IQ31244 @@ -66,7 +66,6 @@ #options PREEMPTION device genclock device loop device ether -device nexus device mem # Memory and kernel memory devices #device saarm device miibus diff --git a/sys/arm/conf/KB920X b/sys/arm/conf/KB920X index 74c8a2d..7d6463d 100644 --- a/sys/arm/conf/KB920X +++ b/sys/arm/conf/KB920X @@ -66,7 +66,6 @@ device random device pty device loop device ether -device nexus device uart device ate device mii diff --git a/sys/arm/conf/SIMICS b/sys/arm/conf/SIMICS index b55d5fe..edc1106 100644 --- a/sys/arm/conf/SIMICS +++ b/sys/arm/conf/SIMICS @@ -58,7 +58,6 @@ device loop device ether device saip device assabet -device nexus #device saarm device rl device uart diff --git a/sys/arm/conf/SKYEYE b/sys/arm/conf/SKYEYE index a083cdf..e8efcbb 100644 --- a/sys/arm/conf/SKYEYE +++ b/sys/arm/conf/SKYEYE @@ -61,7 +61,6 @@ options KBD_INSTALL_CDEV # install a CD device genclock device loop device ether -device nexus #device saarm device rl device uart diff --git a/sys/conf/files.arm b/sys/conf/files.arm index 1cc792f..1f2b796 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -32,9 +32,7 @@ arm/arm/intr.c standard arm/arm/locore.S standard no-obj arm/arm/machdep.c standard arm/arm/mem.c optional mem -arm/arm/nexus.c optional nexus -arm/arm/nexus_io.c optional nexus -arm/arm/nexus_io_asm.S optional nexus +arm/arm/nexus.c standard arm/arm/pmap.c standard arm/arm/setcpsr.S standard arm/arm/setstack.s standard --------------090709020103070600080902 Content-Type: text/plain; name="files_arm.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="files_arm.diff" diff --git a/sys/arm/sa11x0/files.sa11x0 b/sys/arm/sa11x0/files.sa11x0 index 4f0af53..451bf03 100644 --- a/sys/arm/sa11x0/files.sa11x0 +++ b/sys/arm/sa11x0/files.sa11x0 @@ -1,4 +1,6 @@ # $FreeBSD: src/sys/arm/sa11x0/files.sa11x0,v 1.2 2004/05/14 13:26:52 cognet Exp $ +arm/arm/cpufunc_asm_sa1.S standard +arm/arm/cpufunc_asm_sa11x0.S standard arm/sa11x0/assabet_machdep.c optional assabet arm/sa11x0/sa11x0.c optional saip arm/sa11x0/sa11x0_ost.c optional saip diff --git a/sys/conf/files.arm b/sys/conf/files.arm index 1cc792f..6dcaa51 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -11,9 +11,7 @@ arm/arm/busdma_machdep.c standard arm/arm/copystr.S standard arm/arm/cpufunc.c standard arm/arm/cpufunc_asm.S standard -arm/arm/cpufunc_asm_sa1.S standard arm/arm/cpufunc_asm_armv4.S standard -arm/arm/cpufunc_asm_sa11x0.S standard arm/arm/db_disasm.c optional ddb arm/arm/db_interface.c optional ddb arm/arm/db_trace.c optional ddb --------------090709020103070600080902--