Drop main() prototype. Syncs with NetBSD-8
[minix.git] / minix / lib / libsys / pci_first_dev.c
blob566df39434437f1e234de359d9d633eba3bc1d98
1 /*
2 pci_first_dev.c
3 */
5 #include "pci.h"
6 #include "syslib.h"
7 #include <minix/sysutil.h>
9 /*===========================================================================*
10 * pci_first_dev *
11 *===========================================================================*/
12 int pci_first_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_FIRST_DEV;
21 r= ipc_sendrec(pci_procnr, &m);
22 if (r != 0)
23 panic("pci_first_dev: can't talk to PCI: %d", r);
24 if (m.m_type == 1)
26 *devindp= m.m1_i1;
27 *vidp= m.m1_i2;
28 *didp= m.m1_i3;
29 #ifdef DEBUG
30 printf("pci_first_dev: got device %d, %04x/%04x\n",
31 *devindp, *vidp, *didp);
32 #endif
33 return 1;
35 if (m.m_type != 0)
36 panic("pci_first_dev: got bad reply from PCI: %d", m.m_type);
38 #ifdef DEBUG
39 printf("pci_first_dev: got nothing\n");
40 #endif
41 return 0;