1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dave Chapman 2006-01-18 14:04:30 +00:00
parent 4d83cb35f0
commit cf0e3d355c

View file

@ -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++;