Endianess problem



Hi,

I am writing a driver for a ethernet controller. The controller is
connected to the io memory and expects data to be in the Little endian
format (will call it LE now and BE for big endian). The main cpu which
runs the driver code is a BE machine. During the startup I write the
descriptors into the io memory in the LE format. In the send and receive
routine which is called by the IP stack I have pointers that access the
descriptors. The pointers are actually pointing to data which is in LE
format, so if I want to access a bit(a part of the desc bit field) like
ptr->own_bit it will refer to the wrong bit. How can I come over this
problem.

wr,
Sid



.



Relevant Pages

  • Re: 9bit arithmetics in C
    ... implmentation dependant based on his computer architecture. ... for down casting a 2s complement number down to whatever 9bit format then is ... wants to know how a section of memory from the hypothecial processor would ... necessary byteswap on the little endian Intel 386 architecture. ...
    (comp.lang.c)
  • Re: Endianess problem
    ... I am writing a driver for a ethernet controller. ... format (will call it LE now and BE for big endian). ... descriptors into the io memory in the LE format. ...
    (comp.arch.embedded)
  • Re: Endianess problem
    ... I am writing a driver for a ethernet controller. ... format (will call it LE now and BE for big endian). ... descriptors into the io memory in the LE format. ...
    (comp.arch.embedded)
  • Re: Endianess problem
    ... I am writing a driver for a ethernet controller. ... format (will call it LE now and BE for big endian). ... descriptors into the io memory in the LE format. ...
    (comp.arch.embedded)
  • Re: Endianess problem
    ... format (will call it LE now and BE for big endian). ... descriptors into the io memory in the LE format. ... In the past I have written alternate forms of struct definitions, with the bitfields appropriately adjusted to align. ...
    (comp.arch.embedded)