From: Andrew Morton <akpm@osdl.org>
To: Keith Owens <kaos@ocs.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH][2.6] IBM PowerPC Virtual Ethernet Driver
Date: Tue, 17 Feb 2004 20:42:47 -0800 [thread overview]
Message-ID: <20040217204247.13cc035a.akpm@osdl.org> (raw)
In-Reply-To: <7789.1077077976@kao2.melbourne.sgi.com>
Keith Owens <kaos@ocs.com.au> wrote:
>
> On Wed, 18 Feb 2004 11:45:20 +1100,
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> >BITFIELDS ARE EVIL !!!
> >The compiler is perfectly free, afaik, to re-order them
>
> Not it is not. C standard (ISO/IEC 9899:1999 (E)), section 6.7.2.1.
>
> 10 ... If enough space remains, a bit-field that immediately follows
> another bit-field in a structure shall be packed into adjacent bits
> of the same unit. ...
>
> 13 Within a structure object, the non-bit-field members and the units
> in which bit-fields reside have addresses that increase in the order
> in which they are declared. ...
>
> There is no scope for a compiler to reorder the members or the bit
> fields of a structure.
Problem is portability between different architectures, especially little
endian versus big endian. The 3c59x driver used to use a bitfield to
represent hardware registers and had some lovely ifdeffery to make it work
on ppc hardware.
It's safe enough in arch-specific code but one may as well use the same
idioms as are used in generic code.
next prev parent reply other threads:[~2004-02-18 4:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-17 22:48 [PATCH][2.6] IBM PowerPC Virtual Ethernet Driver Santiago Leon
2004-02-18 0:45 ` Benjamin Herrenschmidt
2004-02-18 4:01 ` Dave Jones
2004-02-18 4:23 ` viro
2004-02-18 4:46 ` Linus Torvalds
2004-02-18 5:03 ` Benjamin Herrenschmidt
2004-02-18 16:39 ` Linus Torvalds
2004-02-18 5:04 ` viro
2004-02-18 4:19 ` Keith Owens
2004-02-18 4:42 ` Andrew Morton [this message]
2004-02-18 4:48 ` Linus Torvalds
2004-02-20 23:26 ` Santiago Leon
2004-02-22 22:11 ` Pavel Machek
2004-02-26 5:52 ` Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040217204247.13cc035a.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=kaos@ocs.com.au \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox