DMPAPI(void*) pci_Alloc(unsigned char bus, unsigned char dev, unsigned char fun) { // just ignore wrong dev & fun :p dev = dev & 0x1f; fun = fun & 0x07; // check VID & DID if (pci_indw(PCI_GET_CF8(bus, dev, fun)) == 0xffffffffUL) //&& if (fun == 0) { err_print("%s: invalid PCI device!\n", __FUNCTION__); return NULL; } return alloc_pci(bus, dev, fun); }
DMPAPI(void*) pci_Alloc(unsigned char bus, unsigned char dev, unsigned char fun) { unsigned long tmpid; // just ignore wrong dev & fun :p dev = dev & 0x1f; fun = fun & 0x07; // get VID & DID io_DisableINT(); tmpid = pci_indw(PCI_GET_CF8(bus, dev, fun)); io_RestoreINT(); if (tmpid == 0xffffffffUL) if (fun == 0) { err_print((char*)"%s: invalid PCI device!\n", __FUNCTION__); return NULL; } return alloc_pci(bus, dev, fun); }