Uninitialized vector entry?
[minix3.git] / lib / syslib / pci_next_dev.c
blob399c72d4e85564a00a56aae032a75fd066a9eed1
1 /*
2 pci_next_dev.c
3 */
5 #include "pci.h"
6 #include "syslib.h"
7 #include <minix/sysutil.h>
9 /*===========================================================================*
10 * pci_next_dev *
11 *===========================================================================*/
12 PUBLIC int pci_next_dev(devindp, vidp, didp)
13 int *devindp;
14 u16_t *vidp;
15 u16_t *didp;
17 int r;
18 message m;
20 m.m_type= BUSC_PCI_NEXT_DEV;
21 m.m1_i1= *devindp;
23 r= sendrec(pci_procnr, &m);
24 if (r != 0)
25 panic("pci", "pci_next_dev: can't talk to PCI", r);
27 if (m.m_type == 1)
29 *devindp= m.m1_i1;
30 *vidp= m.m1_i2;
31 *didp= m.m1_i3;
32 #if 0
33 printf("pci_next_dev: got device %d, %04x/%04x\n",
34 *devindp, *vidp, *didp);
35 #endif
36 return 1;
38 if (m.m_type != 0)
39 panic("pci", "pci_next_dev: got bad reply from PCI", m.m_type);
41 return 0;