Modules - x86_64 compile fix to ATA and LVM
[tpg/acess2.git] / KernelLand / Modules / Storage / ATA / main.c
index 41228d8..cc1fe62 100644 (file)
@@ -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;

UCC git Repository :: git.ucc.asn.au