#include <drv_pci.h>\r
#include <drv_pci_int.h>\r
\r
+#define USE_PORT_BITMAP 0\r
#define LIST_DEVICES 1\r
\r
// === STRUCTURES ===\r
.Type = &gPCI_RootNodeType\r
}\r
};\r
+#if USE_PORT_BITMAP\r
Uint32 *gaPCI_PortBitmap = NULL;\r
+#endif\r
Uint32 gaPCI_BusBitmap[256/32];\r
\r
// === CODE ===\r
*/\r
int PCI_Install(char **Arguments)\r
{\r
- int i, ret, bus;\r
+ int ret, bus;\r
void *tmpPtr;\r
\r
+ #if USE_PORT_BITMAP\r
// Build Portmap\r
gaPCI_PortBitmap = malloc( 1 << 13 );\r
if( !gaPCI_PortBitmap ) {\r
return MODULE_ERR_MALLOC;\r
}\r
memset( gaPCI_PortBitmap, 0, 1 << 13 );\r
+ int i;\r
for( i = 0; i < MAX_RESERVED_PORT / 32; i ++ )\r
gaPCI_PortBitmap[i] = -1;\r
for( i = 0; i < MAX_RESERVED_PORT % 32; i ++ )\r
gaPCI_PortBitmap[MAX_RESERVED_PORT / 32] = 1 << i;\r
- \r
+ #endif \r
+\r
// Scan Bus (Bus 0, Don't fill gPCI_Devices)\r
for( bus = 0; bus < giPCI_BusCount; bus ++ )\r
{\r
ret = PCI_ScanBus(bus, 0);\r
- if(ret != MODULE_ERR_OK) return i;\r
+ if(ret != MODULE_ERR_OK) return ret;\r
}\r
\r
if(giPCI_DeviceCount == 0) {\r