Drop main() prototype. Syncs with NetBSD-8
[minix.git] / minix / lib / libsys / pci_get_bar.c
blob7fff04341a35f168cf29e49096699df0b2a86460
1 /*
2 pci_get_bar.c
3 */
5 #include "pci.h"
6 #include "syslib.h"
7 #include <minix/sysutil.h>
9 /*===========================================================================*
10 * pci_get_bar *
11 *===========================================================================*/
12 int pci_get_bar(devind, port, base, size, ioflag)
13 int devind;
14 int port;
15 u32_t *base;
16 u32_t *size;
17 int *ioflag;
19 int r;
20 message m;
22 m.m_type= BUSC_PCI_GET_BAR;
23 m.m_lsys_pci_busc_get_bar.devind = devind;
24 m.m_lsys_pci_busc_get_bar.port = port;
26 r= ipc_sendrec(pci_procnr, &m);
27 if (r != 0)
28 panic("pci_get_bar: can't talk to PCI: %d", r);
30 if (m.m_type == 0)
32 *base= m.m_pci_lsys_busc_get_bar.base;
33 *size= m.m_pci_lsys_busc_get_bar.size;
34 *ioflag= m.m_pci_lsys_busc_get_bar.flags;
36 return m.m_type;