From owner-freebsd-alpha@FreeBSD.ORG Sat Dec 31 11:55:31 2005 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 3C0C716A41F; Sat, 31 Dec 2005 11:55:31 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from ant.bwct.de (ant.bwct.de [85.159.14.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id D481B43D4C; Sat, 31 Dec 2005 11:55:29 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de ([10.1.1.7]) by ant.bwct.de (8.12.11/8.12.11) with ESMTP id jBVBtQGq025595; Sat, 31 Dec 2005 12:55:27 +0100 (CET) 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 jBVBtKPL033911 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 31 Dec 2005 12:55:21 +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 jBVBtK6M027388; Sat, 31 Dec 2005 12:55:20 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.13.4/8.13.3/Submit) id jBVBtKpf027387; Sat, 31 Dec 2005 12:55:20 +0100 (CET) (envelope-from ticso) Date: Sat, 31 Dec 2005 12:55:19 +0100 From: Bernd Walter To: John Baldwin Message-ID: <20051231115518.GA15282@cicely12.cicely.de> References: <20051228163557.GE563@cicely12.cicely.de> <200512291140.19610.jhb@freebsd.org> <20051230100018.GH52756@ip.net.ua> <200512300836.25701.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200512300836.25701.jhb@freebsd.org> X-Operating-System: FreeBSD cicely12.cicely.de 5.4-STABLE alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-5.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 X-Spam-Report: * -3.3 ALL_TRUSTED Did not pass through any untrusted hosts * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on cicely12.cicely.de Cc: Bernd Walter , ticso@cicely.de, 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 Reply-To: ticso@cicely.de List-Id: Porting FreeBSD to the Alpha List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2005 11:55:31 -0000 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 -- B.Walter BWCT http://www.bwct.de bernd@bwct.de info@bwct.de