xref: /minix3/minix/lib/libsys/pci_init.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc /*
2*433d6423SLionel Sambuc pci_init.c
3*433d6423SLionel Sambuc */
4*433d6423SLionel Sambuc 
5*433d6423SLionel Sambuc #include "syslib.h"
6*433d6423SLionel Sambuc #include <minix/ds.h>
7*433d6423SLionel Sambuc #include <minix/sysutil.h>
8*433d6423SLionel Sambuc 
9*433d6423SLionel Sambuc endpoint_t pci_procnr= ANY;
10*433d6423SLionel Sambuc 
11*433d6423SLionel Sambuc /*===========================================================================*
12*433d6423SLionel Sambuc  *				pci_init				     *
13*433d6423SLionel Sambuc  *===========================================================================*/
pci_init(void)14*433d6423SLionel Sambuc void pci_init(void)
15*433d6423SLionel Sambuc {
16*433d6423SLionel Sambuc 	int r;
17*433d6423SLionel Sambuc 	message m;
18*433d6423SLionel Sambuc 
19*433d6423SLionel Sambuc 	r= ds_retrieve_label_endpt("pci", &pci_procnr);
20*433d6423SLionel Sambuc 	if (r != 0)
21*433d6423SLionel Sambuc 		panic("pci_init: unable to obtain label for 'pci': %d", r);
22*433d6423SLionel Sambuc 
23*433d6423SLionel Sambuc 	m.m_type= BUSC_PCI_INIT;
24*433d6423SLionel Sambuc 	r= ipc_sendrec(pci_procnr, &m);
25*433d6423SLionel Sambuc 	if (r != 0)
26*433d6423SLionel Sambuc 		panic("pci_init: can't talk to PCI: %d", r);
27*433d6423SLionel Sambuc 	if (m.m_type != 0)
28*433d6423SLionel Sambuc 		panic("pci_init: got bad reply from PCI: %d", m.m_type);
29*433d6423SLionel Sambuc }
30*433d6423SLionel Sambuc 
31