* AcessOS/AcessBasic v0.1\r
* PCI Bus Driver\r
*/\r
-#define DEBUG 1\r
-#include <common.h>\r
+#define DEBUG 0\r
+#include <acess.h>\r
+#include <modules.h>\r
#include <vfs.h>\r
#include <fs_devfs.h>\r
#include <drv_pci.h>\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
- //LogF("Done.\n");\r
\r
// Scan Busses\r
for( bus = 0; bus < giPCI_BusCount; bus++ )\r
if(tmpPtr != gPCI_Devices)\r
break;\r
}\r
+ \r
+ if(giPCI_DeviceCount == 0)\r
+ return MODULE_ERR_NOTNEEDED;\r
+ \r
tmpPtr = realloc(gPCI_Devices, giPCI_DeviceCount*sizeof(t_pciDevice));\r
if(tmpPtr == NULL)\r
- return 0;\r
+ return MODULE_ERR_MALLOC;\r
gPCI_Devices = tmpPtr;\r
- //LogF("Done.\n");\r
\r
// Complete Driver Structure \r
gPCI_DriverStruct.RootNode.Size = giPCI_DeviceCount;\r
// And add to DevFS\r
DevFS_AddDevice(&gPCI_DriverStruct);\r
\r
- return 1;\r
+ return MODULE_ERR_OK;\r
}\r
\r
/**\r
\r
\r
// === EXPORTS ===\r
-/*\r
+//*\r
EXPORT(PCI_CountDevices);\r
EXPORT(PCI_GetDevice);\r
+EXPORT(PCI_GetDeviceByClass);\r
EXPORT(PCI_AssignPort);\r
EXPORT(PCI_GetIRQ);\r
-*/\r
+//*/\r