lkml.org 
[lkml]   [2003]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: format_cpumask()
Date
From
> +	for (k = sizeof(cpumask_t)/sizeof(long) - 1; k >= 0; ++k) {
> + int m;
> + cpumask_t tmp;
> +
> + cpus_shift_right(tmp, cpus, BITS_PER_LONG*k);
> + if (BITS_PER_LONG == 32)
> + m = sprintf(buf, "%08lx", cpus_coerce(tmp));
> + else /* BITS_PER_LONG == 64 */
> + m = sprintf(buf, "%16lx", cpus_coerce(tmp));
> + len += m;
> + buf += m;
> + }

That makes it had to write portable shell scripts (etc.) that can
parse these values on both 32-bit and 64-bit systems? A bitmask with
just cpu0 set looks like:

0000000100000000

on a 32-bit machine. And like:

0000000000000001

on a 64-bit machine. Heaven help the architectures (ia64, sparc, ppc)
that support both 32-bit and 64-bit applications!

-Tony Luck

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.044 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site