+2012-06-06 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/disk/pata.c (grub_pata_pio_read)
+ [GRUB_MACHINE_MIPS_QEMU_MIPS]: Don't byteswap even on mipseb.
+ (grub_pata_pio_write) [GRUB_MACHINE_MIPS_QEMU_MIPS]: Likewise.
+
2012-06-06 Vladimir Serbinenko <phcoder@gmail.com>
Extend automated tests to qemu-mips.
grub_millisleep (50);
}
+#ifdef GRUB_MACHINE_MIPS_QEMU_MIPS
+#define grub_ata_to_cpu16(x) ((grub_uint16_t) (x))
+#define grub_cpu_to_ata16(x) ((grub_uint16_t) (x))
+#else
+#define grub_ata_to_cpu16 grub_le_to_cpu16
+#define grub_cpu_to_ata16 grub_cpu_to_le16
+#endif
+
static void
grub_pata_pio_read (struct grub_pata_device *dev, char *buf, grub_size_t size)
{
/* Read in the data, word by word. */
for (i = 0; i < size / 2; i++)
grub_set_unaligned16 (buf + 2 * i,
- grub_le_to_cpu16 (grub_inw(dev->ioaddress
+ grub_ata_to_cpu16 (grub_inw(dev->ioaddress
+ GRUB_ATA_REG_DATA)));
if (size & 1)
- buf[size - 1] = (char) grub_le_to_cpu16 (grub_inw (dev->ioaddress
+ buf[size - 1] = (char) grub_ata_to_cpu16 (grub_inw (dev->ioaddress
+ GRUB_ATA_REG_DATA));
}
/* Write the data, word by word. */
for (i = 0; i < size / 2; i++)
- grub_outw(grub_cpu_to_le16 (grub_get_unaligned16 (buf + 2 * i)), dev->ioaddress + GRUB_ATA_REG_DATA);
+ grub_outw(grub_cpu_to_ata16 (grub_get_unaligned16 (buf + 2 * i)), dev->ioaddress + GRUB_ATA_REG_DATA);
}
/* ATA pass through support, used by hdparm.mod. */