Module: xenomai-forge Branch: master Commit: d403da94355d4649be28c55ce8f282b7854245f0 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=d403da94355d4649be28c55ce8f282b7854245f0
Author: Wolfgang Mauerer <wolfgang.maue...@siemens.com> Date: Tue Sep 25 15:19:18 2012 +0200 cobalt/nucleus: fix cpu bitmap handling Don't left-shift further than the bit-width of the shifted type allows. In this particular constellation, this leads to selecting CPUs that are not specified in supported_cpus_arg on systems with more than 32 cores. Signed-off-by: Wolfgang Mauerer <wolfgang.maue...@siemens.com> --- kernel/cobalt/nucleus/intr.c | 2 +- kernel/cobalt/nucleus/module.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/cobalt/nucleus/intr.c b/kernel/cobalt/nucleus/intr.c index 3cb5c75..a76d36a 100644 --- a/kernel/cobalt/nucleus/intr.c +++ b/kernel/cobalt/nucleus/intr.c @@ -1069,7 +1069,7 @@ static int affinity_vfile_show(struct xnvfile_regular_iterator *it, for (cpu = 0; cpu < BITS_PER_LONG; cpu++) if (cpu_isset(cpu, nkaffinity)) - val |= (1 << cpu); + val |= (1UL << cpu); xnvfile_printf(it, "%08lx\n", val); diff --git a/kernel/cobalt/nucleus/module.c b/kernel/cobalt/nucleus/module.c index 3b319e8..13552c2 100644 --- a/kernel/cobalt/nucleus/module.c +++ b/kernel/cobalt/nucleus/module.c @@ -81,7 +81,7 @@ static int __init mach_setup(void) #ifdef CONFIG_SMP cpus_clear(xnarch_machdata.supported_cpus); for (cpu = 0; cpu < num_online_cpus(); cpu++) - if (supported_cpus_arg & (1 << cpu)) + if (supported_cpus_arg & (1UL << cpu)) cpu_set(cpu, xnarch_machdata.supported_cpus); #endif /* CONFIG_SMP */ _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git