From owner-freebsd-current@FreeBSD.ORG Sun Nov 12 23:31:52 2006 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A19D216A4D2; Sun, 12 Nov 2006 23:31:52 +0000 (UTC) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (relay0.rambler.ru [81.19.66.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7894243E2A; Sun, 12 Nov 2006 23:31:02 +0000 (GMT) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (localhost [127.0.0.1]) by relay0.rambler.ru (Postfix) with ESMTP id 2F02560B9; Mon, 13 Nov 2006 02:30:55 +0300 (MSK) Received: from edoofus.park.rambler.ru (unknown [81.19.65.108]) by relay0.rambler.ru (Postfix) with ESMTP id 43EAA5D3B; Mon, 13 Nov 2006 02:28:50 +0300 (MSK) Received: (from ru@localhost) by edoofus.park.rambler.ru (8.13.8/8.13.8) id kACNSshA048101; Mon, 13 Nov 2006 02:28:54 +0300 (MSK) (envelope-from ru) Date: Mon, 13 Nov 2006 02:28:54 +0300 From: Ruslan Ermilov To: "M. Warner Losh" , Joseph Koshy Message-ID: <20061112232854.GC45238@rambler-co.ru> References: <20061112132105.6bac38d6@kan.dnsalias.net> <20061112192810.GC1173@rambler-co.ru> <4557825E.3070009@errno.com> <20061112.160539.-1350496508.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MW5yreqqjyrRcusr" Content-Disposition: inline In-Reply-To: <20061112.160539.-1350496508.imp@bsdimp.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: No virus found Cc: arm@FreeBSD.org, keramida@FreeBSD.org, current@FreeBSD.org Subject: Re: [head tinderbox] failure on arm/arm X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Nov 2006 23:31:52 -0000 --MW5yreqqjyrRcusr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 12, 2006 at 04:05:39PM -0700, M. Warner Losh wrote: > Yea, that's clearly bogus of it. It does this because it thinks that > eh is going to be 4-byte aligned, which it isn't in this case. I > think that we may need to change: >=20 > /* > * Structure of a 10Mb/s Ethernet header. > */ > struct ether_header { > u_char ether_dhost[ETHER_ADDR_LEN]; > u_char ether_shost[ETHER_ADDR_LEN]; > u_short ether_type; > }; >=20 > to be >=20 > struct ether_header { > u_char ether_dhost[ETHER_ADDR_LEN]; > u_char ether_shost[ETHER_ADDR_LEN]; > u_short ether_type; > } __packed; >=20 > since that would fit. >=20 "fit" =3D=3D avoid 32-bit loads (I've similarly checked adding __packed to "struct ar_hdr" here, and it indeed stops using 32-bit loads instructions now): %%% Index: ar.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/include/ar.h,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 ar.h --- ar.h 24 May 1994 09:57:26 -0000 1.1.1.1 +++ ar.h 12 Nov 2006 23:26:38 -0000 @@ -44,6 +44,8 @@ #ifndef _AR_H_ #define _AR_H_ =20 +#include + /* Pre-4BSD archives had these magic numbers in them. */ #define OARMAG1 0177555 #define OARMAG2 0177545 @@ -62,6 +64,6 @@ struct ar_hdr { char ar_size[10]; /* size in bytes */ #define ARFMAG "`\n" char ar_fmag[2]; /* consistency check */ -}; +} __packed; =20 #endif /* !_AR_H_ */ %%% > There's one caveat that I'd caution people about. NetBSD had lots of > issues with gcc4 and packed when the struct doesn't need to be packed. >=20 We don't have a lot of packed structs yet, and we should certainly have more of them. :-) Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --MW5yreqqjyrRcusr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFV642qRfpzJluFF4RAvxsAJsHxNw7Xu078RVRV7gZUGmpWnvSaACfbZ5G psteO64afQgekuYrzw6kJu8= =MhYA -----END PGP SIGNATURE----- --MW5yreqqjyrRcusr--