linux-mips-fnet
[Top] [All Lists]

IDE CDROM

To: linux-mips@fnet.fr
Subject: IDE CDROM
From: Systemkennung Linux <linux@mailhost.uni-koblenz.de>
Date: Wed, 27 Mar 1996 09:33:18 +0100 (MET)
Hi all,

enclosed below are the diffs that fix some alignments bugs in the
IDE CD driver.  Works now for me like a charme.

happy IDE-ing (yikes ...),

   Ralf

diff -urN /home/ralf/release/v1.3/linux-1.3.62/drivers/block/ide-cd.c 
linux-1.3.62/drivers/block/ide-cd.c
--- /home/ralf/release/v1.3/linux-1.3.62/drivers/block/ide-cd.c Mon Feb 12 
04:23:29 1996
+++ linux-1.3.62/drivers/block/ide-cd.c Wed Mar 27 08:25:04 1996
@@ -1160,7 +1160,10 @@
   pc.c[0] = READ_10;
   pc.c[7] = (nframes >> 8);
   pc.c[8] = (nframes & 0xff);
-  *(int *)(&pc.c[2]) = htonl (frame);
+  pc.c[2] = (frame >> 24);     /* Convert to big endian */
+  pc.c[3] = (frame >> 16);
+  pc.c[4] = (frame >> 8);
+  pc.c[5] = frame;
 
   /* Send the command to the drive and return. */
   (void) cdrom_transfer_packet_command (drive, pc.c, sizeof (pc.c),
diff -urN /home/ralf/release/v1.3/linux-1.3.62/drivers/block/ide.h 
linux-1.3.62/drivers/block/ide.h
--- /home/ralf/release/v1.3/linux-1.3.62/drivers/block/ide.h    Sun Feb 11 
08:44:53 1996
+++ linux-1.3.62/drivers/block/ide.h    Wed Mar 27 07:49:39 1996
@@ -318,8 +318,12 @@
        byte            usage;          /* current "open()" count for drive */
        byte            head;           /* "real" number of heads */
        byte            sect;           /* "real" sectors per track */
-       byte            bios_head;      /* BIOS/fdisk/LILO number of heads */
-       byte            bios_sect;      /* BIOS/fdisk/LILO sectors per track */
+       /*
+        * HACK: enforce alignment for sake of IDE CDROM driver on
+        * architectures with strict alignment rules.
+        */
+       byte            bios_head __attribute__ ((aligned (8)));        /* 
BIOS/fdisk/LILO number of heads */
+       byte            bios_sect __attribute__ ((aligned (8)));        /* 
BIOS/fdisk/LILO sectors per track */
        unsigned short  bios_cyl;       /* BIOS/fdisk/LILO number of cyls */
        unsigned short  cyl;            /* "real" number of cyls */
        void              *hwif;        /* actually (ide_hwif_t *) */

<Prev in Thread] Current Thread [Next in Thread>
  • IDE CDROM, Systemkennung Linux <=