[ofw] Re: [ofa-general] [RFC] 3/5: IB ACM: libibacm

Jason Gunthorpe jgunthorpe at obsidianresearch.com
Fri Sep 18 17:20:37 PDT 2009


On Fri, Sep 18, 2009 at 05:05:39PM -0700, Ira Weiny wrote:

> > I'd say just use the ntohl, ntohs, and bswap64 macros directly and
> > Window can provide headers with whatever it needs instead. They are
> > already doing this..
> 
> I agree but ntohl etc do not seem to work for the macros which are defined.

Yah, thats right they don't work for case labels, that is about the
only case they don't work for.. Might even be a gcc bug?

> #define IB_MAD_ATTR_CLASS_PORT_INFO			(CL_HTON16(0x0001))

OMG that is gross

> Thus the 
> 
> #define __bswap_constant_16(x) \
>      ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))

Well, no, that is to support the __builtin_constant_p method I
clipped, that macro isn't for user use.

Guess you are stuck with the upper and lower case versions of the
macros. Sucky

Jason



More information about the general mailing list