diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2003-04-12 23:02:58 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2003-04-12 23:02:58 +0000 |
commit | b5401749cb413a644d7d787e804506b71e7898e1 (patch) | |
tree | 91383dddd188064b0dd3daef856d7a2f218c4fa6 /firmware/drivers/ata.c | |
parent | 1326f666a67da4bc09727ef4b7b55d392df233da (diff) | |
download | rockbox-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/drivers/ata.c')
-rw-r--r-- | firmware/drivers/ata.c | 7 |
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, | |||
376 | poweroff = false; | 376 | poweroff = false; |
377 | } | 377 | } |
378 | 378 | ||
379 | for (j=0; j<SECTOR_SIZE/2; j++) | 379 | for (j=0; j<SECTOR_SIZE/2; j++) { |
380 | ATA_DATA = SWAB16(((unsigned short*)buf)[j]); | 380 | ATA_DATA = (unsigned short) |
381 | (((unsigned char *)buf)[j*2+1] << 8) | | ||
382 | ((unsigned char *)buf)[j*2]; | ||
383 | } | ||
381 | 384 | ||
382 | #ifdef USE_INTERRUPT | 385 | #ifdef USE_INTERRUPT |
383 | /* reading the status register clears the interrupt */ | 386 | /* reading the status register clears the interrupt */ |