i.MX31: Make DMA ISR call loop a bit more efficient.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27192 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2010-06-30 07:08:10 +00:00
parent d2ed594246
commit 90a2671833

View file

@ -53,19 +53,13 @@ static void __attribute__((interrupt("IRQ"))) SDMA_HANDLER(void)
SDMA_INTR = pending; /* Ack all ints */ SDMA_INTR = pending; /* Ack all ints */
pending &= sdma_enabled_ints; /* Only dispatch ints with callback */ pending &= sdma_enabled_ints; /* Only dispatch ints with callback */
while (1) while (pending)
{ {
unsigned int channel; unsigned int bit = pending & -pending; /* Isolate bottom bit */
pending &= ~bit; /* Clear it */
if (pending == 0) /* Call callback (required if using an interrupt). bit number = channel */
break; /* No bits set */ ccb_array[31 - __builtin_clz(bit)].channel_desc->callback();
channel = find_first_set_bit(pending);
pending &= ~(1ul << channel);
/* Call callback (required if using an interrupt) */
ccb_array[channel].channel_desc->callback();
} }
} }