X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=coreboot.git;a=blobdiff_plain;f=src%2Fdevices%2Fdevice_util.c;h=5225938e192035ff385f7fda4edf65e2d6eda02e;hp=526490a8c199ab132dcce9bb9adc382e89042cbb;hb=dc8448fd8be4768ef9d5f9b8cbcf28db0a2029be;hpb=d40393e3903e57496afcfc88ec094ae17f0e9437 diff --git a/src/devices/device_util.c b/src/devices/device_util.c index 526490a8c..5225938e1 100644 --- a/src/devices/device_util.c +++ b/src/devices/device_util.c @@ -850,3 +850,21 @@ u32 find_pci_tolm(struct bus *bus) return tolm; } + +/* Count of enabled CPUs */ +int dev_count_cpu(void) +{ + device_t cpu; + int count = 0; + + for (cpu = all_devices; cpu; cpu = cpu->next) { + if ((cpu->path.type != DEVICE_PATH_APIC) || + (cpu->bus->dev->path.type != DEVICE_PATH_APIC_CLUSTER)) + continue; + if (!cpu->enabled) + continue; + count++; + } + + return count; +}