X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fdrv%2Fpci.c;h=98232080e9d298cb9a2430e5c49587afeef5f26e;hb=ca05044548d5c1de87c030d625a305731a6cc665;hp=c52ab63a117551b33ae451fbf1b41b8deecef97c;hpb=f013b667c76be64a32ae1d934d440dfb50226661;p=tpg%2Facess2.git diff --git a/Kernel/drv/pci.c b/Kernel/drv/pci.c index c52ab63a..98232080 100644 --- a/Kernel/drv/pci.c +++ b/Kernel/drv/pci.c @@ -2,8 +2,9 @@ * AcessOS/AcessBasic v0.1 * PCI Bus Driver */ -#define DEBUG 1 -#include +#define DEBUG 0 +#include +#include #include #include #include @@ -89,7 +90,6 @@ int PCI_Install(char **Arguments) gaPCI_PortBitmap[i] = -1; for( i = 0; i < MAX_RESERVED_PORT % 32; i ++ ) gaPCI_PortBitmap[MAX_RESERVED_PORT / 32] = 1 << i; - //LogF("Done.\n"); // Scan Busses for( bus = 0; bus < giPCI_BusCount; bus++ ) @@ -140,11 +140,14 @@ int PCI_Install(char **Arguments) if(tmpPtr != gPCI_Devices) break; } + + if(giPCI_DeviceCount == 0) + return MODULE_ERR_NOTNEEDED; + tmpPtr = realloc(gPCI_Devices, giPCI_DeviceCount*sizeof(t_pciDevice)); if(tmpPtr == NULL) - return 0; + return MODULE_ERR_MALLOC; gPCI_Devices = tmpPtr; - //LogF("Done.\n"); // Complete Driver Structure gPCI_DriverStruct.RootNode.Size = giPCI_DeviceCount; @@ -152,7 +155,7 @@ int PCI_Install(char **Arguments) // And add to DevFS DevFS_AddDevice(&gPCI_DriverStruct); - return 1; + return MODULE_ERR_OK; } /** @@ -553,9 +556,10 @@ Uint8 PCI_CfgReadByte(Uint16 bus, Uint16 dev, Uint16 func, Uint16 offset) // === EXPORTS === -/* +//* EXPORT(PCI_CountDevices); EXPORT(PCI_GetDevice); +EXPORT(PCI_GetDeviceByClass); EXPORT(PCI_AssignPort); EXPORT(PCI_GetIRQ); -*/ +//*/