X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FStorage%2FATA%2Fmain.c;h=cc1fe62a26cfbff2f3145e524ea38d89990ce407;hb=b0a26ff18cc1e7df2442a8a967017d8c81f1de38;hp=41228d886bc2bbcc351ca87ce23482b3439ad3c1;hpb=51ab5f489bc356940c95cc936fd0508e8f07ea97;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/Storage/ATA/main.c b/KernelLand/Modules/Storage/ATA/main.c index 41228d88..cc1fe62a 100644 --- a/KernelLand/Modules/Storage/ATA/main.c +++ b/KernelLand/Modules/Storage/ATA/main.c @@ -26,12 +26,12 @@ Uint16 ATA_GetBasePort(int Disk); // Filesystem Interface char *ATA_ReadDir(tVFS_Node *Node, int Pos); tVFS_Node *ATA_FindDir(tVFS_Node *Node, const char *Name); -Uint64 ATA_ReadFS(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer); -Uint64 ATA_WriteFS(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Buffer); +size_t ATA_ReadFS(tVFS_Node *Node, off_t Offset, size_t Length, void *Buffer); +size_t ATA_WriteFS(tVFS_Node *Node, off_t Offset, size_t Length, const void *Buffer); int ATA_IOCtl(tVFS_Node *Node, int Id, void *Data); // Read/Write Interface/Quantiser -Uint ATA_ReadRaw(Uint64 Address, Uint Count, void *Buffer, Uint Disk); -Uint ATA_WriteRaw(Uint64 Address, Uint Count, const void *Buffer, Uint Disk); +Uint ATA_ReadRaw(Uint64 Address, Uint Count, void *Buffer, void *Argument); +Uint ATA_WriteRaw(Uint64 Address, Uint Count, const void *Buffer, void *Argument); // === GLOBALS === MODULE_DEFINE(0, VERSION, i386ATA, ATA_Install, NULL, "PCI", NULL); @@ -294,9 +294,9 @@ tVFS_Node *ATA_FindDir(tVFS_Node *UNUSED(Node), const char *Name) } /** - * \fn Uint64 ATA_ReadFS(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) + * \brief Read handler for VFS interface */ -Uint64 ATA_ReadFS(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) +size_t ATA_ReadFS(tVFS_Node *Node, off_t Offset, size_t Length, void *Buffer) { int disk = Node->Inode >> 8; int part = Node->Inode & 0xFF; @@ -326,7 +326,10 @@ Uint64 ATA_ReadFS(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) } { - int ret = DrvUtil_ReadBlock(Offset, Length, Buffer, ATA_ReadRaw, SECTOR_SIZE, disk); + int ret = DrvUtil_ReadBlock( + Offset, Length, Buffer, + ATA_ReadRaw, SECTOR_SIZE, (void*)(Uint)disk + ); //Log("ATA_ReadFS: disk=%i, Offset=%lli, Length=%lli", disk, Offset, Length); //Debug_HexDump("ATA_ReadFS", Buffer, Length); LEAVE('i', ret); @@ -335,9 +338,9 @@ Uint64 ATA_ReadFS(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) } /** - * \fn Uint64 ATA_WriteFS(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Buffer) + * \brief Write handler for VFS interface */ -Uint64 ATA_WriteFS(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Buffer) +size_t ATA_WriteFS(tVFS_Node *Node, off_t Offset, size_t Length, const void *Buffer) { int disk = Node->Inode >> 8; int part = Node->Inode & 0xFF; @@ -362,7 +365,10 @@ Uint64 ATA_WriteFS(tVFS_Node *Node, Uint64 Offset, Uint64 Length, const void *Bu Log("ATA_WriteFS: (Node=%p, Offset=0x%llx, Length=0x%llx, Buffer=%p)", Node, Offset, Length, Buffer); Debug_HexDump("ATA_WriteFS", Buffer, Length); - return DrvUtil_WriteBlock(Offset, Length, Buffer, ATA_ReadRaw, ATA_WriteRaw, SECTOR_SIZE, disk); + return DrvUtil_WriteBlock( + Offset, Length, Buffer, + ATA_ReadRaw, ATA_WriteRaw, SECTOR_SIZE, (void*)(Uint)disk + ); } const char *csaATA_IOCtls[] = {DRV_IOCTLNAMES, DRV_DISK_IOCTLNAMES, NULL}; @@ -389,8 +395,9 @@ int ATA_IOCtl(tVFS_Node *UNUSED(Node), int Id, void *Data) /** * \fn Uint ATA_ReadRaw(Uint64 Address, Uint Count, void *Buffer, Uint Disk) */ -Uint ATA_ReadRaw(Uint64 Address, Uint Count, void *Buffer, Uint Disk) +Uint ATA_ReadRaw(Uint64 Address, Uint Count, void *Buffer, void *Argument) { + int Disk = (tVAddr)Argument; int ret; Uint offset; Uint done = 0; @@ -424,8 +431,9 @@ Uint ATA_ReadRaw(Uint64 Address, Uint Count, void *Buffer, Uint Disk) /** * \fn Uint ATA_WriteRaw(Uint64 Address, Uint Count, const void *Buffer, Uint Disk) */ -Uint ATA_WriteRaw(Uint64 Address, Uint Count, const void *Buffer, Uint Disk) +Uint ATA_WriteRaw(Uint64 Address, Uint Count, const void *Buffer, void *Argument) { + int Disk = (tVAddr)Argument; int ret; Uint offset; Uint done = 0;