From owner-freebsd-arch@FreeBSD.ORG Sun Feb 5 08:48:21 2006 Return-Path: X-Original-To: arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7911416A420 for ; Sun, 5 Feb 2006 08:48:21 +0000 (GMT) (envelope-from stefan@fafoe.narf.at) Received: from viefep20-int.chello.at (viefep12-int.chello.at [213.46.255.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 59BA543D45 for ; Sun, 5 Feb 2006 08:48:19 +0000 (GMT) (envelope-from stefan@fafoe.narf.at) Received: from wombat.fafoe.narf.at ([213.47.85.26]) by viefep20-int.chello.at (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with ESMTP id <20060205084817.DFCI24926.viefep20-int.chello.at@wombat.fafoe.narf.at>; Sun, 5 Feb 2006 09:48:17 +0100 Received: by wombat.fafoe.narf.at (Postfix, from userid 1001) id 47A30BC8C; Sun, 5 Feb 2006 09:48:15 +0100 (CET) Date: Sun, 5 Feb 2006 09:48:15 +0100 From: Stefan Farfeleder To: "M. Warner Losh" Message-ID: <20060205084813.GN21806@wombat.fafoe.narf.at> References: <20060204211357.GD7604@ip.net.ua> <20060204.143353.109955782.imp@bsdimp.com> <86fymyn5il.fsf@xps.des.no> <20060204.155856.39766510.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060204.155856.39766510.imp@bsdimp.com> User-Agent: Mutt/1.5.11 Cc: des@des.no, arch@FreeBSD.org Subject: Re: [releng_6 tinderbox] failure on sparc64/sparc64 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2006 08:48:21 -0000 On Sat, Feb 04, 2006 at 03:58:56PM -0700, M. Warner Losh wrote: > > This driver wants to access these structures as arrays of uint32_t. > It used to cast directly, but that isn't allowed. So, I've passed > the cast through a (void *). Is that allowed? Eg: > > struct foo foo; > ((uint32_t *)(void *)&foo)[3] = 12; > > is that OK? I'm afraid that only silences the warning without solving the underlying problem. I don't think there's a Standard conforming way to treat a struct foo as an uint32_t array. Stefan From owner-freebsd-arch@FreeBSD.ORG Sun Feb 5 15:45:49 2006 Return-Path: X-Original-To: arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6C71416A420; Sun, 5 Feb 2006 15:45:49 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id C563E43D5F; Sun, 5 Feb 2006 15:45:40 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 5150E2081; Sun, 5 Feb 2006 16:45:35 +0100 (CET) X-Spam-Tests: AWL,BAYES_00,FORGED_RCVD_HELO X-Spam-Learn: ham X-Spam-Score: -3.1/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on tim.des.no Received: from xps.des.no (des.no [80.203.243.180]) by tim.des.no (Postfix) with ESMTP id BC5FA2080; Sun, 5 Feb 2006 16:45:34 +0100 (CET) Received: by xps.des.no (Postfix, from userid 1001) id 9705133C22; Sun, 5 Feb 2006 16:45:34 +0100 (CET) To: Stefan Farfeleder References: <20060204211357.GD7604@ip.net.ua> <20060204.143353.109955782.imp@bsdimp.com> <86fymyn5il.fsf@xps.des.no> <20060204.155856.39766510.imp@bsdimp.com> <20060205084813.GN21806@wombat.fafoe.narf.at> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Sun, 05 Feb 2006 16:45:34 +0100 In-Reply-To: <20060205084813.GN21806@wombat.fafoe.narf.at> (Stefan Farfeleder's message of "Sun, 5 Feb 2006 09:48:15 +0100") Message-ID: <867j89n71d.fsf@xps.des.no> User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: arch@FreeBSD.org Subject: Re: [releng_6 tinderbox] failure on sparc64/sparc64 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2006 15:45:49 -0000 Stefan Farfeleder writes: > On Sat, Feb 04, 2006 at 03:58:56PM -0700, M. Warner Losh wrote: > > This driver wants to access these structures as arrays of uint32_t. > > It used to cast directly, but that isn't allowed. So, I've passed > > the cast through a (void *). Is that allowed? Eg: > >=20 > > struct foo foo; > > ((uint32_t *)(void *)&foo)[3] =3D 12; > >=20 > > is that OK? > I'm afraid that only silences the warning without solving the underlying > problem. I don't think there's a Standard conforming way to treat a > struct foo as an uint32_t array. A union should do the trick. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-arch@FreeBSD.ORG Sun Feb 5 15:55:48 2006 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9657716A420; Sun, 5 Feb 2006 15:55:48 +0000 (GMT) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.183]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8645943D48; Sun, 5 Feb 2006 15:55:47 +0000 (GMT) (envelope-from max@love2party.net) Received: from [84.163.254.207] (helo=amd64.laiers.local) by mrelayeu.kundenserver.de (node=mrelayeu1) with ESMTP (Nemesis), id 0MKwpI-1F5mEj1vLf-0006zT; Sun, 05 Feb 2006 16:55:38 +0100 From: Max Laier Organization: FreeBSD To: "M. Warner Losh" Date: Sun, 5 Feb 2006 16:56:57 +0100 User-Agent: KMail/1.9.1 References: <20060204211357.GD7604@ip.net.ua> <20060204.155856.39766510.imp@bsdimp.com> <20060205084813.GN21806@wombat.fafoe.narf.at> In-Reply-To: <20060205084813.GN21806@wombat.fafoe.narf.at> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2221331.id6B1i7EH1"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200602051657.06224.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de login:61c499deaeeba3ba5be80f48ecc83056 Cc: des@des.no, Stefan Farfeleder , freebsd-arch@freebsd.org Subject: Re: [releng_6 tinderbox] failure on sparc64/sparc64 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2006 15:55:48 -0000 --nextPart2221331.id6B1i7EH1 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 05 February 2006 09:48, Stefan Farfeleder wrote: > On Sat, Feb 04, 2006 at 03:58:56PM -0700, M. Warner Losh wrote: > > This driver wants to access these structures as arrays of uint32_t. > > It used to cast directly, but that isn't allowed. So, I've passed > > the cast through a (void *). Is that allowed? Eg: > > > > struct foo foo; > > ((uint32_t *)(void *)&foo)[3] =3D 12; > > > > is that OK? > > I'm afraid that only silences the warning without solving the underlying > problem. I don't think there's a Standard conforming way to treat a > struct foo as an uint32_t array. You could embed the original struct contents with an uint32_t array in an=20 union. That way you don't even have to cast. e.g.: struct foo { union { struct foo_orig { field1; field2; } orig; uint32_t array[SIZE]; } wrap; #define field1 wrap.orig.field1 #define field2 wrap.orig.field2 }; You should obviously make sure that the fields are named uniquely and the=20 header is private to you. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart2221331.id6B1i7EH1 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQBD5iBSXyyEoT62BG0RAjqVAJ9RTT6uq28fZJonsL/m6tHgrGRTFQCdGZ5h 3I+Fc5f8wAk89tmqE9IwXxk= =FiKF -----END PGP SIGNATURE----- --nextPart2221331.id6B1i7EH1-- From owner-freebsd-arch@FreeBSD.ORG Sun Feb 5 16:27:18 2006 Return-Path: X-Original-To: arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 05AB716A420; Sun, 5 Feb 2006 16:27:18 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9631743D46; Sun, 5 Feb 2006 16:27:17 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id k15GP4FM029015; Sun, 5 Feb 2006 09:25:04 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 05 Feb 2006 09:25:07 -0700 (MST) Message-Id: <20060205.092507.58804812.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: <867j89n71d.fsf@xps.des.no> References: <20060204.155856.39766510.imp@bsdimp.com> <20060205084813.GN21806@wombat.fafoe.narf.at> <867j89n71d.fsf@xps.des.no> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Sun, 05 Feb 2006 09:25:04 -0700 (MST) Cc: arch@FreeBSD.org, stefanf@FreeBSD.org Subject: Re: [releng_6 tinderbox] failure on sparc64/sparc64 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2006 16:27:18 -0000 In message: <867j89n71d.fsf@xps.des.no> des@des.no (Dag-Erling Sm=F8rgrav) writes: : Stefan Farfeleder writes: : > On Sat, Feb 04, 2006 at 03:58:56PM -0700, M. Warner Losh wrote: : > > This driver wants to access these structures as arrays of uint32_= t. : > > It used to cast directly, but that isn't allowed. So, I've passe= d : > > the cast through a (void *). Is that allowed? Eg: : > > = : > > struct foo foo; : > > ((uint32_t *)(void *)&foo)[3] =3D 12; : > > = : > > is that OK? : > I'm afraid that only silences the warning without solving the under= lying : > problem. I don't think there's a Standard conforming way to treat = a : > struct foo as an uint32_t array. : = : A union should do the trick. Does the answer change when all that's being done is reading the contents of the memory to be sent out over, say, the pci bus to a specific memory location? The code I corrected in an does originally was: for (i =3D 0; i < sizeof(an_rx_desc) / 4; i++) CSR_MEM_AUX_WRITE_4(sc, AN_RX_DESC_OFFSET = + (desc * sizeof(an_rx_desc)) + (i * 4), ((u_int32_t*)&an_rx_desc)[i]); where the second arg is the offset in the card's memory and the third arg is the 32-bit word to write. an_rx_desc looks like: struct an_card_rx_desc { unsigned an_ctrl:15; unsigned an_done:1; unsigned an_len:15; unsigned an_valid:1; u_int64_t an_phys; }; (note to self: this can't work on a big endian machine). I can re-write these things with a union, but isn't there any other way= ? Warner From owner-freebsd-arch@FreeBSD.ORG Sun Feb 5 22:02:13 2006 Return-Path: X-Original-To: arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C3ABF16A422 for ; Sun, 5 Feb 2006 22:02:13 +0000 (GMT) (envelope-from ertr1013@student.uu.se) Received: from pne-smtpout1-sn2.hy.skanova.net (pne-smtpout1-sn2.hy.skanova.net [81.228.8.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id 04B9E43D48 for ; Sun, 5 Feb 2006 22:02:12 +0000 (GMT) (envelope-from ertr1013@student.uu.se) Received: from falcon.midgard.homeip.net (83.253.29.241) by pne-smtpout1-sn2.hy.skanova.net (7.2.070) id 43E2F55D000C88A6 for arch@FreeBSD.org; Sun, 5 Feb 2006 23:02:12 +0100 Received: (qmail 5226 invoked by uid 1001); 5 Feb 2006 23:02:11 +0100 Date: Sun, 5 Feb 2006 23:02:11 +0100 From: Erik Trulsson To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20060205220211.GA5151@falcon.midgard.homeip.net> Mail-Followup-To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , Stefan Farfeleder , arch@FreeBSD.org References: <20060204211357.GD7604@ip.net.ua> <20060204.143353.109955782.imp@bsdimp.com> <86fymyn5il.fsf@xps.des.no> <20060204.155856.39766510.imp@bsdimp.com> <20060205084813.GN21806@wombat.fafoe.narf.at> <867j89n71d.fsf@xps.des.no> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <867j89n71d.fsf@xps.des.no> User-Agent: Mutt/1.5.11 Cc: arch@FreeBSD.org, Stefan Farfeleder Subject: Re: [releng_6 tinderbox] failure on sparc64/sparc64 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2006 22:02:13 -0000 On Sun, Feb 05, 2006 at 04:45:34PM +0100, Dag-Erling Sm=F8rgrav wrote: > Stefan Farfeleder writes: > > On Sat, Feb 04, 2006 at 03:58:56PM -0700, M. Warner Losh wrote: > > > This driver wants to access these structures as arrays of uint32_t. > > > It used to cast directly, but that isn't allowed. So, I've passed > > > the cast through a (void *). Is that allowed? Eg: > > >=20 > > > struct foo foo; > > > ((uint32_t *)(void *)&foo)[3] =3D 12; > > >=20 > > > is that OK? > > I'm afraid that only silences the warning without solving the underlying > > problem. I don't think there's a Standard conforming way to treat a > > struct foo as an uint32_t array. >=20 > A union should do the trick. No, it will not. If you have a struct foo and try to access it as an array of int, the program will have unspecified (and maybe even undefined) behaviour. It does not matter if you do it with a union or by casting pointers. In general, if you have an object of type X, then the only ways it can be accessed is either as an object of type X, or as an array of [unsigned] char. =20 --=20 Erik Trulsson ertr1013@student.uu.se From owner-freebsd-arch@FreeBSD.ORG Fri Feb 10 07:32:38 2006 Return-Path: X-Original-To: arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 10BDF16A420; Fri, 10 Feb 2006 07:32:38 +0000 (GMT) (envelope-from ivan@serezhkin.com) Received: from serezhkin.com (urh.ru [217.107.212.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id A14FA43D45; Fri, 10 Feb 2006 07:32:37 +0000 (GMT) (envelope-from ivan@serezhkin.com) Received: from [192.168.1.2] (ppp83-237-27-180.pppoe.mtu-net.ru [83.237.27.180]) by serezhkin.com (Postfix) with ESMTP id 5EA43D260AF; Fri, 10 Feb 2006 07:01:57 +0300 (MSK) Message-ID: <43EC106D.1020100@serezhkin.com> Date: Fri, 10 Feb 2006 07:02:53 +0300 From: "Ivan B. Serezhkin" User-Agent: Thunderbird 1.5 (X11/20060112) MIME-Version: 1.0 To: Gleb Smirnoff References: <20060113170552.GF83922@FreeBSD.org> In-Reply-To: <20060113170552.GF83922@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 8bit Cc: arch@FreeBSD.org, re@FreeBSD.org Subject: Re: review: patch to restore VLAN kernel API in RELENG_6 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2006 07:32:38 -0000 Gleb Smirnoff wrote: thanks, this chunk compiles, but can you decride you doings in tommorow ? Блин. Я не настолько хорошо говорю по английски, чтоб понимать твои коментарии. Тоесть все по диффу понятно, а нафига в целом ...полное безобразие. вообщем английский я учить не перестану, но и проить объяснить тоже не брошу =) Если честно, то понятно только тем, кто прочёл магию kobj =) -- Ivan. B. Serezhkin.