diff options
-rw-r--r-- | src/device/device_util.c | 10 | ||||
-rw-r--r-- | src/include/device/device.h | 2 | ||||
-rw-r--r-- | src/soc/intel/xeon_sp/include/soc/chip_common.h | 3 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/device/device_util.c b/src/device/device_util.c index 6a4577026c..2e97ece2a5 100644 --- a/src/device/device_util.c +++ b/src/device/device_util.c @@ -261,6 +261,16 @@ const struct device *dev_get_domain(const struct device *dev) return NULL; } +bool is_domain0(const struct device *dev) +{ + return dev && dev->path.type == DEVICE_PATH_DOMAIN && dev->path.domain.domain == 0; +} + +bool is_dev_on_domain0(const struct device *dev) +{ + return is_domain0(dev_get_domain(dev)); +} + /** * Allocate 64 more resources to the free list. * diff --git a/src/include/device/device.h b/src/include/device/device.h index 1b2e097772..ac8a1171c5 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -194,6 +194,8 @@ bool is_pci(const struct device *pci); bool is_enabled_pci(const struct device *pci); bool is_pci_dev_on_bus(const struct device *pci, unsigned int bus); bool is_pci_bridge(const struct device *pci); +bool is_domain0(const struct device *dev); +bool is_dev_on_domain0(const struct device *dev); /* Returns whether there is a hotplug port on the path to the given device. */ bool dev_path_hotplug(const struct device *); diff --git a/src/soc/intel/xeon_sp/include/soc/chip_common.h b/src/soc/intel/xeon_sp/include/soc/chip_common.h index c5553c0f5f..4731bec2d7 100644 --- a/src/soc/intel/xeon_sp/include/soc/chip_common.h +++ b/src/soc/intel/xeon_sp/include/soc/chip_common.h @@ -83,9 +83,6 @@ bool is_cxl_domain(const struct device *dev); #define is_dev_on_ubox_domain(dev) is_ubox_domain(dev_get_domain(dev)) #define is_dev_on_cxl_domain(dev) is_cxl_domain(dev_get_domain(dev)) -#define is_domain0(dev) (dev && dev->path.type == DEVICE_PATH_DOMAIN &&\ - dev->path.domain.domain == 0) -#define is_dev_on_domain0(dev) (is_domain0(dev_get_domain(dev))) #define is_stack0(socket, stack) (socket == 0 && stack == IioStack0) void unlock_pam_regions(void); |