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 /firmware/drivers/ata.c | |
parent | 4d83cb35f0dacea1424e2320557ee1d3ceba4fa2 (diff) | |
download | rockbox-cf0e3d355c78d6f2f71b0276706ce5c002d3e0f3.tar.gz rockbox-cf0e3d355c78d6f2f71b0276706ce5c002d3e0f3.zip |
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
Diffstat (limited to 'firmware/drivers/ata.c')
-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 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) | |||
380 | { /* loop compiles to 9 assembler instructions */ | 380 | { /* loop compiles to 9 assembler instructions */ |
381 | /* takes 14 clock cycles (2 pipeline stalls, 1 wait) */ | 381 | /* takes 14 clock cycles (2 pipeline stalls, 1 wait) */ |
382 | tmp = ATA_DATA; | 382 | tmp = ATA_DATA; |
383 | #ifdef SWAP_WORDS | 383 | #if defined(SWAP_WORDS) || defined(ROCKBOX_LITTLE_ENDIAN) |
384 | *buf++ = tmp & 0xff; /* I assume big endian */ | 384 | *buf++ = tmp & 0xff; /* I assume big endian */ |
385 | *buf++ = tmp >> 8; /* and don't use the SWAB16 macro */ | 385 | *buf++ = tmp >> 8; /* and don't use the SWAB16 macro */ |
386 | #else | 386 | #else |
@@ -691,7 +691,7 @@ static void copy_write_sectors(const unsigned char* buf, int wordcount) | |||
691 | const unsigned char* bufend = buf + wordcount*2; | 691 | const unsigned char* bufend = buf + wordcount*2; |
692 | do | 692 | do |
693 | { | 693 | { |
694 | #ifdef SWAP_WORDS | 694 | #if defined(SWAP_WORDS) || defined(ROCKBOX_LITTLE_ENDIAN) |
695 | /* SH1: loop compiles to 9 assembler instructions */ | 695 | /* SH1: loop compiles to 9 assembler instructions */ |
696 | /* takes 13 clock cycles (2 pipeline stalls) */ | 696 | /* takes 13 clock cycles (2 pipeline stalls) */ |
697 | tmp = (unsigned short) *buf++; | 697 | tmp = (unsigned short) *buf++; |