arch/tile: make glibc's sysconf(_SC_NPROCESSORS_CONF) work correctly
authorChris Metcalf <cmetcalf@tilera.com>
Wed, 24 Nov 2010 18:42:15 +0000 (13:42 -0500)
committerChris Metcalf <cmetcalf@tilera.com>
Wed, 24 Nov 2010 18:42:15 +0000 (13:42 -0500)
glibc assumes that it can count /sys/devices/system/cpu/cpu* to get
the number of configured cpus.  For this to be valid on tile, we need
to generate a "cpu" entry for all cpus, including the ones that are
not currently allocated for Linux's use.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
arch/tile/kernel/setup.c

index fb0b3cbeae149081a5b3011f0230fbd48f4d56dd..f18573643ed1e940c34af318e2ecf81a949be92e 100644 (file)
@@ -840,7 +840,7 @@ static int __init topology_init(void)
        for_each_online_node(i)
                register_one_node(i);
 
-       for_each_present_cpu(i)
+       for (i = 0; i < smp_height * smp_width; ++i)
                register_cpu(&cpu_devices[i], i);
 
        return 0;