On Fri, Nov 12, 2010 at 08:31:39PM +0000, Eduardo Horvath wrote: > > If you look at sys/endian.h, that is exactly the kind of abstraction the > > API makes easy to use. Just provide the proper inline functions for your > > platform. > > No it doesen't because all those macros assume the value is being > transferred from one register to another rather than regiser to memory. > The assignment: > > foo.size = htole64(size); > > Cannot be replaced with: > > __inline __asm("stxa %1, [%0] ASI_LITLE" : &foo.size : size);
the htole*/letoh* macros have been designed from the ntoh*/hton* ones. It's not something new and you can't blame some recent x86-centric design for this (I suspect it's actually a vax-centric design, from history :) -- Manuel Bouyer <bou...@antioche.eu.org> NetBSD: 26 ans d'experience feront toujours la difference --