Do s/SWAP_WORDS/ATA_SWAP_WORDS/ to prevent namespace clashes.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26111 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Maurus Cuelenaere 2010-05-17 15:15:38 +00:00
parent ceeb7576a9
commit 64f5033574
4 changed files with 41 additions and 41 deletions

View file

@ -280,7 +280,7 @@ STATICIRAM ICODE_ATTR void copy_read_sectors(unsigned char* buf, int wordcount)
do
{
tmp = ATA_DATA;
#if defined(SWAP_WORDS) || defined(ROCKBOX_LITTLE_ENDIAN)
#if defined(ATA_SWAP_WORDS) || defined(ROCKBOX_LITTLE_ENDIAN)
*buf++ = tmp & 0xff; /* I assume big endian */
*buf++ = tmp >> 8; /* and don't use the SWAB16 macro */
#else
@ -295,7 +295,7 @@ STATICIRAM ICODE_ATTR void copy_read_sectors(unsigned char* buf, int wordcount)
unsigned short* wbufend = wbuf + wordcount;
do
{
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
*wbuf = swap16(ATA_DATA);
#else
*wbuf = ATA_DATA;
@ -315,7 +315,7 @@ STATICIRAM ICODE_ATTR void copy_write_sectors(const unsigned char* buf,
const unsigned char* bufend = buf + wordcount*2;
do
{
#if defined(SWAP_WORDS) || defined(ROCKBOX_LITTLE_ENDIAN)
#if defined(ATA_SWAP_WORDS) || defined(ROCKBOX_LITTLE_ENDIAN)
tmp = (unsigned short) *buf++;
tmp |= (unsigned short) *buf++ << 8;
SET_16BITREG(ATA_DATA, tmp);
@ -332,7 +332,7 @@ STATICIRAM ICODE_ATTR void copy_write_sectors(const unsigned char* buf,
unsigned short* wbufend = wbuf + wordcount;
do
{
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SET_16BITREG(ATA_DATA, swap16(*wbuf));
#else
SET_16BITREG(ATA_DATA, *wbuf);
@ -1127,7 +1127,7 @@ static int identify(void)
for (i=0; i<SECTOR_SIZE/2; i++) {
/* the IDENTIFY words are already swapped, so we need to treat
this info differently that normal sector data */
#if defined(ROCKBOX_BIG_ENDIAN) && !defined(SWAP_WORDS)
#if defined(ROCKBOX_BIG_ENDIAN) && !defined(ATA_SWAP_WORDS)
identify_info[i] = swap16(ATA_DATA);
#else
identify_info[i] = ATA_DATA;

View file

@ -11,7 +11,7 @@
/* define this if you use an ATA controller */
#define CONFIG_STORAGE STORAGE_ATA
#define HAVE_LBA48
#define SWAP_WORDS
#define ATA_SWAP_WORDS
/* define this if you have recording possibility */
/* not implemented yet

View file

@ -56,14 +56,14 @@
* %d1 - shift count
* %d2-%d6 - read buffers
*
* #ifdef SWAP_WORDS
* #ifdef ATA_SWAP_WORDS
* %d7 - byte swap scrach
* %a3 - byte swap mask
* #endif
*/
copy_read_sectors:
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
lea.l (-32, %sp), %sp
movem.l %d2-%d7/%a2-%a3, (%sp)
movem.l (36, %sp), %a0-%a1
@ -86,7 +86,7 @@ copy_read_sectors:
moveq.l #24, %d1 /* preload shift count */
move.w (%a2), %d2 /* load initial word */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
move.b %d2, (%a0)+
lsr.l #8, %d2
#else
@ -96,7 +96,7 @@ copy_read_sectors:
#endif
btst.l #1, %d0 /* longword aligned? (testing old d0 value!) */
bne.b .r_end_u_w1 /* yes, skip leading word handling */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
move.w (%a2), %d3
lsl.l #8, %d2
move.b %d3, %d2
@ -123,7 +123,7 @@ copy_read_sectors:
swap %d3 /* move to upper 16 bit */
move.w (%a2), %d3 /* load second word */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d3
#endif
@ -144,7 +144,7 @@ copy_read_sectors:
swap %d3 /* move to upper 16 bit */
move.w (%a2), %d3 /* load 2nd word */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d3
#endif
@ -156,7 +156,7 @@ copy_read_sectors:
swap %d4 /* move to upper 16 bit */
move.w (%a2), %d4 /* load 4th word */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d4
#endif
@ -168,7 +168,7 @@ copy_read_sectors:
swap %d5 /* move to upper 16 bit */
move.w (%a2), %d5 /* load 6th word */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d5
#endif
@ -180,7 +180,7 @@ copy_read_sectors:
swap %d6 /* move to upper 16 bit */
move.w (%a2), %d6 /* load 8th word */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d6
#endif
@ -203,7 +203,7 @@ copy_read_sectors:
swap %d3 /* move to upper 16 bit */
move.w (%a2), %d3 /* load second word */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d3
#endif
@ -219,7 +219,7 @@ copy_read_sectors:
.r_end_u_l2:
blo.b .r_end_u_w2 /* one word left? */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
move.w (%a2), %d3
lsl.l #8, %d2
move.b %d3, %d2
@ -245,7 +245,7 @@ copy_read_sectors:
btst.l #1, %d0 /* longword aligned? */
beq.b .r_end_a_w1 /* yes, skip leading word handling */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
move.w (%a2), %d7 /* copy initial word after byte swap */
move.b %d7, (%a0)+
lsr.l #8, %d7
@ -265,7 +265,7 @@ copy_read_sectors:
swap %d1 /* move it to upper 16 bits */
move.w (%a2), %d1 /* load second word */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d1
#endif
@ -290,7 +290,7 @@ copy_read_sectors:
swap %d3 /* move it to upper 16 bits */
move.w (%a2), %d3 /* load 8th word */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d0
SWAP_BYTES %d1
SWAP_BYTES %d2
@ -311,7 +311,7 @@ copy_read_sectors:
swap %d1 /* move it to upper 16 bits */
move.w (%a2), %d1 /* read second word */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d1
#endif
@ -322,7 +322,7 @@ copy_read_sectors:
.r_end_a_l2:
blo.b .r_end_a_w2 /* one word left? */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
move.w (%a2), %d7 /* copy final word after byte swap */
move.b %d7, (%a0)+
lsr.l #8, %d7
@ -333,7 +333,7 @@ copy_read_sectors:
.r_end_a_w2:
.r_exit:
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
movem.l (%sp), %d2-%d7/%a2-%a3
lea.l (32, %sp), %sp
#else
@ -365,14 +365,14 @@ copy_read_sectors:
* %d1 - shift count
* %d2-%d6 - read buffers
*
* #ifdef SWAP_WORDS
* #ifdef ATA_SWAP_WORDS
* %d7 - swap scrach
* %a3 - swap mask
* #endif
*/
copy_write_sectors:
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
lea.l (-32, %sp), %sp
movem.l %d2-%d7/%a2-%a3, (%sp)
movem.l (36, %sp), %a0-%a1
@ -404,7 +404,7 @@ copy_write_sectors:
move.l %d2, %d3
lsr.l #8, %d3
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
move.l %d3, %d7 /* byte swap low word of %d3 */
lsr.l #8, %d7
lsl.l #8, %d3
@ -427,7 +427,7 @@ copy_write_sectors:
lsr.l #8, %d3
or.l %d3, %d2
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d2
#endif
@ -450,7 +450,7 @@ copy_write_sectors:
lsr.l #8, %d0
or.l %d0, %d2
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d2
#endif
@ -463,7 +463,7 @@ copy_write_sectors:
lsr.l #8, %d0
or.l %d0, %d3
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d3
#endif
@ -476,7 +476,7 @@ copy_write_sectors:
lsr.l #8, %d0
or.l %d0, %d4
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d4
#endif
@ -489,7 +489,7 @@ copy_write_sectors:
lsr.l #8, %d0
or.l %d0, %d5
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d5
#endif
@ -512,7 +512,7 @@ copy_write_sectors:
lsr.l #8, %d3
or.l %d3, %d2
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d2
#endif
@ -532,14 +532,14 @@ copy_write_sectors:
move.l %d2, %d3
lsr.l #8, %d3
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d3
#endif
move.w %d3, (%a2)
.w_end_u_w2:
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
move.l %d2, %d7
move.b (%a0)+, %d2
lsl.l #8, %d2
@ -558,7 +558,7 @@ copy_write_sectors:
btst.l #1, %d0
beq.b .w_end_a_w1
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
move.w (%a0)+, %d1 /* copy initial word bytes swaped */
move.l %d1, %d7
lsl.l #8, %d1
@ -579,7 +579,7 @@ copy_write_sectors:
.w_loop_a_l1:
move.l (%a0)+, %d1
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d1
#endif
@ -597,7 +597,7 @@ copy_write_sectors:
movem.l (%a0), %d0-%d3
lea.l (16, %a0), %a0
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d0
SWAP_BYTES %d1
SWAP_BYTES %d2
@ -630,7 +630,7 @@ copy_write_sectors:
.w_loop_a_l2:
move.l (%a0)+, %d1
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
SWAP_BYTES %d1
#endif
@ -644,7 +644,7 @@ copy_write_sectors:
.w_end_a_l2:
blo.b .w_end_a_w2 /* one word left? */
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
move.w (%a0)+, %d0 /* copy final word after byte swap */
move.l %d0, %d7
lsl.l #8, %d0
@ -658,7 +658,7 @@ copy_write_sectors:
.w_end_a_w2:
.w_exit:
#ifdef SWAP_WORDS
#ifdef ATA_SWAP_WORDS
movem.l (%sp), %d2-%d7/%a2-%a3
lea.l (32, %sp), %sp
#else

View file

@ -25,7 +25,7 @@
#define ATA_OPTIMIZED_READING
#define ATA_OPTIMIZED_WRITING
#define SWAP_WORDS
#define ATA_SWAP_WORDS
#define ATA_IOBASE 0x06100100
#define ATA_DATA (*((volatile unsigned short*)0x06104100))