dtc: Address an assortment of portability problems

Scott Wood scottwood at freescale.com
Sat Jun 28 00:53:03 EST 2008


David Gibson wrote:
> On Thu, Jun 26, 2008 at 10:25:28AM -0500, Scott Wood wrote:
>> On Thu, Jun 26, 2008 at 11:03:49AM +1000, David Gibson wrote:
>>> 	- the endian handling functions in libfdt_env.h, based on
>>> endian.h and byteswap.h are replaced with some portable open-coded
>>> versions.  Unfortunately, these result in fairly crappy code when
>>> compiled, but as far as I can determine there doesn't seem to be any
>>> POSIX, SUS or de facto standard way of determining endianness at
>>> compile time, nor standard names for byteswapping functions.
>> Since device-tree and network byte order happen to be the same, we could use
>> ntohl/htonl.
> 
> Not for the 64-bit version.

Why?  They operate on uint32_t despite the "l" in the name, and there 
are no 64-bit fields in the device tree...

-Scott



More information about the Linuxppc-dev mailing list