msrtool: Use libpci to let system and target probes find PCI devices.
And some more notes in TODO. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3770 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user