Hi Magnus,
Is:
for (i = 0, actual_cpu_count = 0; i < MaxCountCPUs; i++) { int log_cpus = (ebx >> 16) & 0xff; log_cpus = 1UL << fls(log_cpus - 1); /* round up to power of 2 */ if ((cpuid_features & (1 << 28)) && (i & (log_cpus - 1)) != 0) continue;
equivalent to:
int log_cpus = 1; if (cpuid_features & (1 << 28)) { log_cpus = (ebx >> 16) & 0xff; log_cpus = 1UL << fls(log_cpus - 1); /* round up to power of 2 */ } for (i = 0, actual_cpu_count = 0; i < MaxCountCPUs; i+=log_cpus) {
-Kevin
Kevin O'Connor wrote:
Hi Magnus,
Is:
for (i = 0, actual_cpu_count = 0; i < MaxCountCPUs; i++) { int log_cpus = (ebx >> 16) & 0xff; log_cpus = 1UL << fls(log_cpus - 1); /* round up to power of 2 */ if ((cpuid_features & (1 << 28)) && (i & (log_cpus - 1)) != 0) continue;
equivalent to:
int log_cpus = 1; if (cpuid_features & (1 << 28)) { log_cpus = (ebx >> 16) & 0xff; log_cpus = 1UL << fls(log_cpus - 1); /* round up to power of 2 */ } for (i = 0, actual_cpu_count = 0; i < MaxCountCPUs; i+=log_cpus) {
Yes, that should do the same thing.
M.