summaryrefslogtreecommitdiff
path: root/src/device/device_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/device/device_util.c')
-rw-r--r--src/device/device_util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/device/device_util.c b/src/device/device_util.c
index f33c9250dc..ec2d1591ab 100644
--- a/src/device/device_util.c
+++ b/src/device/device_util.c
@@ -5,6 +5,7 @@
#include <console/console.h>
#include <device/device.h>
#include <device/pci_def.h>
+#include <device/pci_ids.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -969,3 +970,10 @@ bool is_pci_bridge(const struct device *pci)
{
return is_pci(pci) && ((pci->hdr_type & 0x7f) == PCI_HEADER_TYPE_BRIDGE);
}
+
+bool is_pci_ioapic(const struct device *pci)
+{
+ return is_pci(pci) && ((pci->class >> 16) == PCI_BASE_CLASS_SYSTEM) &&
+ ((pci->class >> 8) == PCI_CLASS_SYSTEM_PIC) &&
+ ((pci->class & 0xff) >= 0x10);
+}