xref: /minix3/minix/lib/libsys/pci_reserve.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1 /*
2 pci_reserve.c
3 */
4 
5 #include "pci.h"
6 #include "syslib.h"
7 #include <minix/sysutil.h>
8 
9 /*===========================================================================*
10  *				pci_reserve				     *
11  *===========================================================================*/
pci_reserve(devind)12 void pci_reserve(devind)
13 int devind;
14 {
15 	int r;
16 	message m;
17 
18 	m.m_type= BUSC_PCI_RESERVE;
19 	m.m1_i1= devind;
20 
21 	r= ipc_sendrec(pci_procnr, &m);
22 	if (r != 0)
23 		panic("pci_reserve: can't talk to PCI: %d", r);
24 
25 	if (m.m_type != 0)
26 		panic("pci_reserve: got bad reply from PCI: %d", m.m_type);
27 }
28 
29 /*===========================================================================*
30  *                              pci_reserve_ok                               *
31  *===========================================================================*/
pci_reserve_ok(int devind)32 int pci_reserve_ok(int devind)
33 {
34         message m;
35 
36         m.m1_i1= devind;
37 
38         return(_taskcall(pci_procnr, BUSC_PCI_RESERVE, &m));
39 }
40 
41