From owner-freebsd-alpha@FreeBSD.ORG Tue Jan 3 18:32:17 2006 Return-Path: X-Original-To: freebsd-alpha@freebsd.org Delivered-To: freebsd-alpha@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E946816A41F; Tue, 3 Jan 2006 18:32:17 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 501A443D60; Tue, 3 Jan 2006 18:32:16 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 5183975 for multiple; Tue, 03 Jan 2006 13:30:18 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k03IW6e9094586; Tue, 3 Jan 2006 13:32:07 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: ticso@cicely.de Date: Tue, 3 Jan 2006 13:29:40 -0500 User-Agent: KMail/1.8.2 References: <20051228163557.GE563@cicely12.cicely.de> <200512300836.25701.jhb@freebsd.org> <20051231115518.GA15282@cicely12.cicely.de> In-Reply-To: <20051231115518.GA15282@cicely12.cicely.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200601031329.41635.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1226/Tue Jan 3 11:51:16 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Bernd Walter , freebsd-alpha@freebsd.org Subject: Re: re(4) unaligned panic on -current X-BeenThere: freebsd-alpha@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the Alpha List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2006 18:32:18 -0000 On Saturday 31 December 2005 06:55 am, Bernd Walter wrote: > On Fri, Dec 30, 2005 at 08:36:24AM -0500, John Baldwin wrote: > > On Friday 30 December 2005 05:00 am, Ruslan Ermilov wrote: > > > On Thu, Dec 29, 2005 at 11:40:17AM -0500, John Baldwin wrote: > > > > On Wednesday 28 December 2005 11:49 pm, Bernd Walter wrote: > > > > > On Wed, Dec 28, 2005 at 11:01:47PM -0500, John Baldwin wrote: > > > > > > On Dec 28, 2005, at 11:35 AM, Bernd Walter wrote: > > > > > > > > > > Your guess looks right - will try your bcopy suggestion. > > [52]cicely4# cvs diff > cvs diff: Diffing . > Index: if_re.c > =================================================================== > RCS file: /home/ncvs/src/sys/dev/re/if_re.c,v > retrieving revision 1.62 > diff -u -r1.62 if_re.c > --- if_re.c 18 Dec 2005 18:24:26 -0000 1.62 > +++ if_re.c 31 Dec 2005 11:36:13 -0000 > @@ -2097,6 +2097,10 @@ > struct ifnet *ifp = sc->rl_ifp; > struct mii_data *mii; > u_int32_t rxcfg = 0; > + union { > + uint32_t align_dummy; > + u_char eaddr[ETHER_ADDR_LEN]; > + } eaddr; > > RL_LOCK_ASSERT(sc); > > @@ -2123,11 +2127,13 @@ > * documentation doesn't mention it, we need to enter "Config > * register write enable" mode to modify the ID registers. > */ > + /* Copy MAC address on stack to align. */ > + bcopy(IF_LLADDR(ifp), eaddr.eaddr, ETHER_ADDR_LEN); > CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_WRITECFG); > CSR_WRITE_STREAM_4(sc, RL_IDR0, > - *(u_int32_t *)(&IF_LLADDR(sc->rl_ifp)[0])); > + *(u_int32_t *)(&eaddr.eaddr[0])); > CSR_WRITE_STREAM_4(sc, RL_IDR4, > - *(u_int32_t *)(&IF_LLADDR(sc->rl_ifp)[4])); > + *(u_int32_t *)(&eaddr.eaddr[4])); > CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); > > /* > > It works: > [54]cicely4# ifconfig re0 > re0: flags=8843 mtu 1500 > options=18 > inet 10.1.1.6 netmask 0xffffff00 broadcast 10.1.1.255 > ether 00:40:f4:d0:8d:eb > media: Ethernet autoselect (1000baseTX ) > status: active Commit! :) -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org