Module: xenomai-2.6
Branch: master
Commit: a27a0c4a2475d66710b3ad753b2efaad73bd5d3c
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=a27a0c4a2475d66710b3ad753b2efaad73bd5d3c

Author: Wolfgang Mauerer <wolfgang.maue...@siemens.com>
Date:   Tue Sep 25 15:19:18 2012 +0200

hal: 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>

---

 ksrc/arch/generic/hal.c |    2 +-
 ksrc/nucleus/intr.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ksrc/arch/generic/hal.c b/ksrc/arch/generic/hal.c
index b2c424f..cf9f3cb 100644
--- a/ksrc/arch/generic/hal.c
+++ b/ksrc/arch/generic/hal.c
@@ -542,7 +542,7 @@ int rthal_init(void)
     int cpu;
     cpus_clear(rthal_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, rthal_supported_cpus);
 #endif /* CONFIG_SMP */
 
diff --git a/ksrc/nucleus/intr.c b/ksrc/nucleus/intr.c
index c75fcac..ba61f31 100644
--- a/ksrc/nucleus/intr.c
+++ b/ksrc/nucleus/intr.c
@@ -1073,7 +1073,7 @@ static int affinity_vfile_show(struct 
xnvfile_regular_iterator *it,
 
        for (cpu = 0; cpu < BITS_PER_LONG; cpu++)
                if (xnarch_cpu_isset(cpu, nkaffinity))
-                       val |= (1 << cpu);
+                       val |= (1ul << cpu);
 
        xnvfile_printf(it, "%08lx\n", val);
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to