include/device/path.h: use functions for enabled cpu selection
Add function defs and prototypes of functions checking whether a device is {a cpu,an enabled cpu} TEST: compile test and qemu executed successfully with coreinfo payload Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Change-Id: Iabc0e59d604ae4572921518a8dad47dc3d149f81 Reviewed-on: https://review.coreboot.org/c/coreboot/+/67502 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
@@ -957,3 +957,14 @@ void log_resource(const char *type, const struct device *dev, const struct resou
|
||||
srcfile, line, type, dev_path(dev), res->index, res->base,
|
||||
resource_end(res), res->size / KiB);
|
||||
}
|
||||
|
||||
bool is_cpu(const struct device *cpu)
|
||||
{
|
||||
return cpu->path.type == DEVICE_PATH_APIC &&
|
||||
cpu->bus->dev->path.type == DEVICE_PATH_CPU_CLUSTER;
|
||||
}
|
||||
|
||||
bool is_enabled_cpu(const struct device *cpu)
|
||||
{
|
||||
return is_cpu(cpu) && cpu->enabled;
|
||||
}
|
||||
|
Reference in New Issue
Block a user