Uninitialized vector entry?
[minix3.git] / lib / syslib / pci_init1.c
blob443ca1a98280d38fce449f5980296d93fc2bb519
1 /*
2 pci_init1.c
3 */
5 #include "pci.h"
6 #include "syslib.h"
7 #include <string.h>
8 #include <unistd.h>
9 #include <minix/sysutil.h>
11 int pci_procnr= ANY;
13 /*===========================================================================*
14 * pci_init1 *
15 *===========================================================================*/
16 PUBLIC void pci_init1(name)
17 char *name;
19 int r;
20 size_t len;
21 message m;
23 r= _pm_findproc("pci", &pci_procnr);
24 if (r != 0)
25 panic("pci", "pci_init1: _pm_findproc failed for 'pci'", r);
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
33 len= sizeof(m.m3_ca1)-1;
34 memcpy(m.m3_ca1, name, len);
35 m.m3_ca1[len]= '\0';
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);