diff options
| author | Dave Chapman <dave@dchapman.com> | 2006-01-18 14:04:30 +0000 |
|---|---|---|
| committer | Dave Chapman <dave@dchapman.com> | 2006-01-18 14:04:30 +0000 |
| commit | cf0e3d355c78d6f2f71b0276706ce5c002d3e0f3 (patch) | |
| tree | befe1eae3a069b588689e16514fa9b9c829ddb80 | |
| parent | 4d83cb35f0dacea1424e2320557ee1d3ceba4fa2 (diff) | |
| download | rockbox-cf0e3d355c78d6f2f71b0276706ce5c002d3e0f3.zip rockbox-cf0e3d355c78d6f2f71b0276706ce5c002d3e0f3.tar.gz rockbox-cf0e3d355c78d6f2f71b0276706ce5c002d3e0f3.tar.bz2 rockbox-cf0e3d355c78d6f2f71b0276706ce5c002d3e0f3.tar.xz | |
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
| -rw-r--r-- | firmware/drivers/ata.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 198f393..5c1a19e 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++; |