Re: seperator error in __mask_snprintf_len

From: Paul Jackson
Date: Fri Jan 09 2004 - 09:58:09 EST


Paul M, replying to Paul J:
> > If this request proceeds as expected, I will follow up with a patch to
> > lib/mask.c that will likely make use of the cpu_to_le32() and
> > le32_to_cpu() macros in byteorder.h to swap bytes in the u32 words being
> > displayed and parsed.
>
> That would be the wrong approach IMHO.

Ok - I agree that this would be wrong for 64 bit sparc and ppc, for
these architectures use native big endian byte order within cpumasks,
not little endian.

Indeed, I take it that this applies not just to cpumasks, but to any
mask-like operand that bitops such as ffs() are applied to.

I also need to examine the 32 bit big endian architectures, to see
whether their cpumasks, and other bitop operands, are big or little
endian. If they are big endian (native order) then my mask printing and
scanning code should always presume native byte order, and only has to
special case the order of two u32 words within a u64 long on 64 bit big
endian architectures. If they are little endian, then I'll also need to
make use of the cpu_to_le32() and le32_to_cpu() macros in byteorder.h to
swap bytes in the u32 words being displayed and parsed (but _not_ for
sparc64 or ppc).

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@xxxxxxx> 1.650.933.1373
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/