[coreboot] Notes on CBFS

Rudolf Marek r.marek at assembler.cz
Sun Apr 12 11:35:40 CEST 2009


> on all platforms, but I think little-endian makes much more sense (eg,
> rename the ntohl() calls to le32_to_cpu() ).

Hi,

Why not to use instead:

#define ntohl(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | \
                   (((x)&0xff0000) >> 8) | (((x)&0xff000000) >> 24))

#define ntohl(x) __asm__("bswap %0" : "=r" (x) : "0" (x));

Will do the trick perhaps?

Thanks,
Rudolf




More information about the coreboot mailing list