diff options
Diffstat (limited to 'util/msrtool/sys.c')
-rw-r--r-- | util/msrtool/sys.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/util/msrtool/sys.c b/util/msrtool/sys.c index 95539c8677..cc2cc4e7c0 100644 --- a/util/msrtool/sys.c +++ b/util/msrtool/sys.c @@ -17,6 +17,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <pci/pci.h> + #include "msrtool.h" static struct cpuid_t id; @@ -40,3 +42,18 @@ struct cpuid_t *cpuid(void) { } return &id; } + +struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device) { + struct pci_dev *temp; + struct pci_filter filter; + + pci_filter_init(NULL, &filter); + filter.vendor = vendor; + filter.device = device; + + for (temp = pacc->devices; temp; temp = temp->next) + if (pci_filter_match(&filter, temp)) + return temp; + + return NULL; +} |