From cf0e3d355c78d6f2f71b0276706ce5c002d3e0f3 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Wed, 18 Jan 2006 14:04:30 +0000 Subject: iPod: Fix endian bug with disk reads and writes to a non-aligned memory buffer. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8369 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/ata.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'firmware/drivers/ata.c') diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 198f3936c1..5c1a19ea8e 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -380,7 +380,7 @@ static void copy_read_sectors(unsigned char* buf, int wordcount) { /* loop compiles to 9 assembler instructions */ /* takes 14 clock cycles (2 pipeline stalls, 1 wait) */ tmp = ATA_DATA; -#ifdef SWAP_WORDS +#if defined(SWAP_WORDS) || defined(ROCKBOX_LITTLE_ENDIAN) *buf++ = tmp & 0xff; /* I assume big endian */ *buf++ = tmp >> 8; /* and don't use the SWAB16 macro */ #else @@ -691,7 +691,7 @@ static void copy_write_sectors(const unsigned char* buf, int wordcount) const unsigned char* bufend = buf + wordcount*2; do { -#ifdef SWAP_WORDS +#if defined(SWAP_WORDS) || defined(ROCKBOX_LITTLE_ENDIAN) /* SH1: loop compiles to 9 assembler instructions */ /* takes 13 clock cycles (2 pipeline stalls) */ tmp = (unsigned short) *buf++; -- cgit v1.2.3