Uninitialized vector entry?
[minix3.git] / lib / syslib / pci_find_dev.c
blobc498ddec632d84610b666fb97613f47a24553b0c
1 /*
2 pci_find_dev.c
3 */
5 #include "pci.h"
6 #include "syslib.h"
7 #include <minix/sysutil.h>
9 /*===========================================================================*
10 * pci_find_dev *
11 *===========================================================================*/
12 PUBLIC int pci_find_dev(bus, dev, func, devindp)
13 u8_t bus;
14 u8_t dev;
15 u8_t func;
16 int *devindp;
18 int r;
19 message m;
21 m.m_type= BUSC_PCI_FIND_DEV;
22 m.m1_i1= bus;
23 m.m1_i2= dev;
24 m.m1_i3= func;
26 r= sendrec(pci_procnr, &m);
27 if (r != 0)
28 panic("pci", "pci_find_dev: can't talk to PCI", r);
30 if (m.m_type == 1)
32 *devindp= m.m1_i1;
33 printf("pci_find_dev: got device %d for %d.%d.%d\n",
34 *devindp, bus, dev, func);
35 return 1;
37 if (m.m_type != 0)
38 panic("pci", "pci_find_dev: got bad reply from PCI", m.m_type);
40 printf("pci_find_dev: got nothing\n");
41 return 0;