summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2003-04-12 23:02:58 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2003-04-12 23:02:58 +0000
commitb5401749cb413a644d7d787e804506b71e7898e1 (patch)
tree91383dddd188064b0dd3daef856d7a2f218c4fa6 /firmware
parent1326f666a67da4bc09727ef4b7b55d392df233da (diff)
downloadrockbox-b5401749cb413a644d7d787e804506b71e7898e1.tar.gz
rockbox-b5401749cb413a644d7d787e804506b71e7898e1.zip
ata_write_sectors() didn't handle odd buffer addresses
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3544 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/ata.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 69e40c8a7d..92332b580e 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -376,8 +376,11 @@ int ata_write_sectors(unsigned long start,
poweroff = false;
}
- for (j=0; j<SECTOR_SIZE/2; j++)
- ATA_DATA = SWAB16(((unsigned short*)buf)[j]);
+ for (j=0; j<SECTOR_SIZE/2; j++) {
+ ATA_DATA = (unsigned short)
+ (((unsigned char *)buf)[j*2+1] << 8) |
+ ((unsigned char *)buf)[j*2];
+ }
#ifdef USE_INTERRUPT
/* reading the status register clears the interrupt */