Make SH-specific code properly #ifdef'ed. We should consider doing these

slightly nicer with function calls or something.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5746 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2005-02-02 21:50:24 +00:00
parent db32fb131e
commit 003c0d2dae

View file

@ -242,9 +242,9 @@ static int shutup(void)
{ {
return 0; return 0;
} }
#if CONFIG_CPU == SH7034
CHCR3 &= ~0x0001; /* disable the DMA (and therefore the interrupt also) */ CHCR3 &= ~0x0001; /* disable the DMA (and therefore the interrupt also) */
#endif
/* search next frame boundary and continue up to there */ /* search next frame boundary and continue up to there */
pos = search = mp3_get_pos(); pos = search = mp3_get_pos();
end = queue[queue_read].buf + queue[queue_read].len; end = queue[queue_read].buf + queue[queue_read].len;
@ -275,8 +275,10 @@ static int shutup(void)
queue_write = (queue_read + 1) & QUEUE_MASK; /* will be empty after next callback */ queue_write = (queue_read + 1) & QUEUE_MASK; /* will be empty after next callback */
queue[queue_read].len = sent; /* current one ends after this */ queue[queue_read].len = sent; /* current one ends after this */
#if CONFIG_CPU == SH7034
DTCR3 = sent; /* let the DMA finish this frame */ DTCR3 = sent; /* let the DMA finish this frame */
CHCR3 |= 0x0001; /* re-enable DMA */ CHCR3 |= 0x0001; /* re-enable DMA */
#endif
return 0; return 0;
} }
} }
@ -299,10 +301,10 @@ static int queue_clip(unsigned char* buf, int size, bool enqueue)
if (!size) if (!size)
return 0; /* safety check */ return 0; /* safety check */
#if CONFIG_CPU == SH7034
/* disable the DMA temporarily, to be safe of race condition */ /* disable the DMA temporarily, to be safe of race condition */
CHCR3 &= ~0x0001; CHCR3 &= ~0x0001;
#endif
queue_level = QUEUE_LEVEL; /* check old level */ queue_level = QUEUE_LEVEL; /* check old level */
if (queue_level < QUEUE_SIZE - 1) /* space left? */ if (queue_level < QUEUE_SIZE - 1) /* space left? */
@ -324,7 +326,9 @@ static int queue_clip(unsigned char* buf, int size, bool enqueue)
} }
else else
{ {
#if CONFIG_CPU == SH7034
CHCR3 |= 0x0001; /* re-enable DMA */ CHCR3 |= 0x0001; /* re-enable DMA */
#endif
} }
return 0; return 0;