From owner-freebsd-arm@FreeBSD.ORG Thu Jan 18 20:09:45 2007 Return-Path: X-Original-To: freebsd-arm@freebsd.org Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C31BA16A494 for ; Thu, 18 Jan 2007 20:09:45 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 5467D13C457 for ; Thu, 18 Jan 2007 20:09:45 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de ([10.1.1.7]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id l0IK9gHm038357; Thu, 18 Jan 2007 21:09:42 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.13.4/8.13.4) with ESMTP id l0IK9WsN095220 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Jan 2007 21:09:35 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.13.4/8.13.3) with ESMTP id l0IK9WGG018958; Thu, 18 Jan 2007 21:09:32 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.13.4/8.13.3/Submit) id l0IK9WAK018957; Thu, 18 Jan 2007 21:09:32 +0100 (CET) (envelope-from ticso) Date: Thu, 18 Jan 2007 21:09:31 +0100 From: Bernd Walter To: Olivier Houchard Message-ID: <20070118200931.GD9200@cicely12.cicely.de> References: <20070111101528.GV80390@cicely12.cicely.de> <20070118191823.GB42638@ci0.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070118191823.GB42638@ci0.org> X-Operating-System: FreeBSD cicely12.cicely.de 5.4-STABLE alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED=-1.8, BAYES_00=-2.599 autolearn=ham version=3.1.7 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on cicely12.cicely.de Cc: Bernd Walter , freebsd-arm@freebsd.org, ticso@cicely.de Subject: Re: memcpy limitation X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2007 20:09:45 -0000 On Thu, Jan 18, 2007 at 08:18:23PM +0100, Olivier Houchard wrote: > On Thu, Jan 11, 2007 at 11:15:28AM +0100, Bernd Walter wrote: > > I get a sigbus with the following: > > #0 0x00033158 in $a () at lcp.c:939 > > 939 memcpy(&req, opt, sizeof req); > > (gdb) print req > > $1 = {hdr = {id = 0 '\0', len = 0 '\0'}, proto = 0, period = 0} > > (gdb) print &req > > $2 = (struct lqrreq *) 0xbfffe4a0 > > (gdb) print opt > > $3 = (struct fsm_opt *) 0xbfffe5b6 > > > > Shouldn't memcpy work with any alignment? > > > > It certainly does. Would you have a simple test case which reproduce this ? > Or does it happen as soon as you try to do an unaligned copy ? > I'm quite confused on why it would happen, memcpy is shared between the kernel > and the userland, and in kernel I'm sure it does unaligned copies. It's a while back, but I remember from looking at the dissassembly that it had nothing in common with our assembly function. I thought this is a compiler internal. Will try to do a small test case. As a workaround I exchange the memcpy call with a bcopy. -- B.Walter http://www.bwct.de http://www.fizon.de bernd@bwct.de info@bwct.de support@fizon.de