else
continue; /* Unsupported device class */
- pci_reserve(devind);
-
/* Found a controller.
* Programming interface register tells us more.
*/
skip--;
continue;
}
+ if(pci_reserve_ok(devind) != OK) {
+ printf("at_wini%d: pci_reserve %d failed - "
+ "ignoring controller!\n",
+ w_instance, devind);
+ continue;
+ }
if ((s=sys_irqsetpolicy(irq, 0, &irq_hook)) != OK) {
printf("atapci: couldn't set IRQ policy %d\n", irq);
continue;
{
/* Ignore all init calls for a process after the first one */
}
+#if 0
else
pci_release(names[i].name);
+#endif
names[i].tasknr= mp->m_source;
mp->m_type= 0;
devind= mp->m1_i1;
- pci_reserve3(devind, mp->m_source, names[i].name);
- mp->m_type= OK;
+
+ mp->m_type= pci_reserve3(devind, mp->m_source, names[i].name);
r= send(mp->m_source, mp);
if (r != 0)
{
}
if (devind >= nr_pcidev)
return 0;
+#if 0
if (pcidev[devind].pd_inuse)
return 0;
+#endif
*devindp= devind;
return 1;
}
for (devind= 0; devind < nr_pcidev; devind++)
{
+#if 0
if (pcidev[devind].pd_inuse)
continue;
+#endif
if (!visible(aclp, devind))
continue;
break;
for (devind= *devindp+1; devind < nr_pcidev; devind++)
{
+#if 0
if (pcidev[devind].pd_inuse)
continue;
+#endif
if (!visible(aclp, devind))
continue;
break;
/*===========================================================================*
* pci_reserve3 *
*===========================================================================*/
-PUBLIC void pci_reserve3(devind, proc, name)
+PUBLIC int pci_reserve3(devind, proc, name)
int devind;
int proc;
char *name;
struct mem_range mr;
assert(devind <= nr_pcidev);
- assert(!pcidev[devind].pd_inuse);
+ if(pcidev[devind].pd_inuse)
+ return EBUSY;
pcidev[devind].pd_inuse= 1;
strcpy(pcidev[devind].pd_name, name);
proc, r);
}
}
+
+ return OK;
}
+#if 0
/*===========================================================================*
* pci_release *
*===========================================================================*/
pcidev[i].pd_inuse= 0;
}
}
+#endif
/*===========================================================================*
* pci_ids *
extern struct pci_pcibridge pci_pcibridge[];
/* Utility functions */
-_PROTOTYPE( void pci_reserve3, (int devind, int proc, char name[M3_STRING]));
+_PROTOTYPE( int pci_reserve3, (int devind, int proc, char name[M3_STRING]));
_PROTOTYPE( void pci_release, (char name[M3_STRING]) );
_PROTOTYPE( int pci_first_dev_a, (struct rs_pci *aclp, int *devindp,
u16_t *vidp, u16_t *didp) );
_PROTOTYPE( int pci_find_dev, (U8_t bus, U8_t dev, U8_t func,
int *devindp) );
_PROTOTYPE( void pci_reserve, (int devind) );
+_PROTOTYPE( int pci_reserve_ok, (int devind) );
_PROTOTYPE( void pci_ids, (int devind, u16_t *vidp, u16_t *didp) );
_PROTOTYPE( void pci_rescan_bus, (U8_t busnr) );
_PROTOTYPE( u8_t pci_attr_r8, (int devind, int port) );
panic("pci", "pci_reserve: got bad reply from PCI", m.m_type);
}
+/*===========================================================================*
+ * pci_reserve_ok *
+ *===========================================================================*/
+PUBLIC int pci_reserve_ok(devind)
+int devind;
+{
+ int r;
+ message m;
+
+ m.m1_i1= devind;
+
+ return(_taskcall(pci_procnr, BUSC_PCI_RESERVE, &m));
+}
+