Line | |
---|
1 | /*
|
---|
2 | pci_init1.c
|
---|
3 | */
|
---|
4 |
|
---|
5 | #include "pci.h"
|
---|
6 | #include "syslib.h"
|
---|
7 | #include <string.h>
|
---|
8 | #include <unistd.h>
|
---|
9 | #include <minix/sysutil.h>
|
---|
10 |
|
---|
11 | int pci_procnr= ANY;
|
---|
12 |
|
---|
13 | /*===========================================================================*
|
---|
14 | * pci_init1 *
|
---|
15 | *===========================================================================*/
|
---|
16 | PUBLIC void pci_init1(name)
|
---|
17 | char *name;
|
---|
18 | {
|
---|
19 | int r;
|
---|
20 | size_t len;
|
---|
21 | message m;
|
---|
22 |
|
---|
23 | r= _pm_findproc("pci", &pci_procnr);
|
---|
24 | if (r != 0)
|
---|
25 | panic("pci", "pci_init1: _pm_findproc failed for 'pci'", r);
|
---|
26 |
|
---|
27 | m.m_type= BUSC_PCI_INIT;
|
---|
28 | len= strlen(name);
|
---|
29 | if (len+1 <= sizeof(m.m3_ca1))
|
---|
30 | strcpy(m.m3_ca1, name);
|
---|
31 | else
|
---|
32 | {
|
---|
33 | len= sizeof(m.m3_ca1)-1;
|
---|
34 | memcpy(m.m3_ca1, name, len);
|
---|
35 | m.m3_ca1[len]= '\0';
|
---|
36 | }
|
---|
37 | r= sendrec(pci_procnr, &m);
|
---|
38 | if (r != 0)
|
---|
39 | panic("pci", "pci_init1: can't talk to PCI", r);
|
---|
40 | if (m.m_type != 0)
|
---|
41 | panic("pci", "pci_init1: got bad reply from PCI", m.m_type);
|
---|
42 | }
|
---|
43 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.