linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bit field endian vs endian
@ 2001-08-30 12:07 Do-Han Kim
  2001-08-30 12:27 ` Richard B. Johnson
  2001-08-30 13:08 ` Giuliano Pochini
  0 siblings, 2 replies; 3+ messages in thread
From: Do-Han Kim @ 2001-08-30 12:07 UTC (permalink / raw)
  To: linux-kernel

Hello,
In the linux kernel source tcp.h
bit field endian is appeared.
if the machine is the big endian machine, highest bit is alligned in the 
lowest location in byte?

Thank you.

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: bit field endian vs endian
  2001-08-30 12:07 bit field endian vs endian Do-Han Kim
@ 2001-08-30 12:27 ` Richard B. Johnson
  2001-08-30 13:08 ` Giuliano Pochini
  1 sibling, 0 replies; 3+ messages in thread
From: Richard B. Johnson @ 2001-08-30 12:27 UTC (permalink / raw)
  To: Do-Han Kim; +Cc: linux-kernel

On Thu, 30 Aug 2001, Do-Han Kim wrote:

> Hello,
> In the linux kernel source tcp.h
> bit field endian is appeared.
> if the machine is the big endian machine, highest bit is alligned in the 
> lowest location in byte?
> 
> Thank you.

Big endian:

Given:  unsigned long = 0xdeadface;
           Low memory <---        ---> High memory

It looks in memory, just like you typed it with your editor.
BUT... The high vs. low bits of the individual bytes are not
changed. In other words, 0xde, the high byte, still has 'd'
as the high nibble and 'e' as the low nibble. Therefore the
MSB of a longword, in big endian format, is truly at the lowest
memory location occupied by that longword.

Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

    I was going to compile a list of innovations that could be
    attributed to Microsoft. Once I realized that Ctrl-Alt-Del
    was handled in the BIOS, I found that there aren't any.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: bit field endian vs endian
  2001-08-30 12:07 bit field endian vs endian Do-Han Kim
  2001-08-30 12:27 ` Richard B. Johnson
@ 2001-08-30 13:08 ` Giuliano Pochini
  1 sibling, 0 replies; 3+ messages in thread
From: Giuliano Pochini @ 2001-08-30 13:08 UTC (permalink / raw)
  To: Do-Han Kim; +Cc: linux-kernel


On 30-Aug-2001 Do-Han Kim wrote:
> Hello,
> In the linux kernel source tcp.h
> bit field endian is appeared.
> if the machine is the big endian machine, highest bit is alligned in the
> lowest location in byte?

Bits arrangement in bitfields is defined in the ABI.


Bye.
    Giuliano Pochini ->)|(<- Shiny Network {AS6665} ->)|(<-


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-08-30 13:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-30 12:07 bit field endian vs endian Do-Han Kim
2001-08-30 12:27 ` Richard B. Johnson
2001-08-30 13:08 ` Giuliano Pochini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).