Messages in this thread | | | Date | Fri, 9 Jan 2004 06:46:19 -0800 | From | Paul Jackson <> | Subject | Re: seperator error in __mask_snprintf_len |
| |
Paul M wrote: > Hmmm, well, that comment is a bit misleading. Bitmasks on ppc64 (and > other bigendian 64-bit architectures such as sparc64) are stored as an > array of unsigned longs, i.e. 64-bit values.
Ok - thank you for educating me on this.
So the byte order for 64 bit big endian cpumasks is:
7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 23 22 ...
rather than the little endian byte order of:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...
I suspect that you are right, that I need a macro to pick the 'other' half of a long, as you suggested:
#define BITMAP_WORD(p, n) (((u32 *)(p))[(n) ^ 1])
This would be defined in the include/asm-sparc64/cpumask.h and include/asm-ppc64/cpumask.h files, with a no-op default in the include/asm-generic/cpumask.h file for other architectures that don't need it. It would be used in lib/mask.c when printing and scanning cpumasks.
I'm technically on vacation this week - If it doesn't cause anyone heartburn, I likely won't get this patch out until mid next week. If that hurts, squawk, and I'll work harder ;).
-- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson <pj@sgi.com> 1.650.933.1373 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |