diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2010-06-30 07:08:10 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2010-06-30 07:08:10 +0000 |
commit | 90a26718330f58a884d3ddb603e3e1c3cb333958 (patch) | |
tree | c51945ced8a57f3a6f121f2fefe32fd3f15a46bc | |
parent | d2ed594246d2840ee09445483a03bb4b5baaff4b (diff) | |
download | rockbox-90a26718330f58a884d3ddb603e3e1c3cb333958.tar.gz rockbox-90a26718330f58a884d3ddb603e3e1c3cb333958.zip |
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
-rw-r--r-- | firmware/target/arm/imx31/sdma-imx31.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/firmware/target/arm/imx31/sdma-imx31.c b/firmware/target/arm/imx31/sdma-imx31.c index 39f4e29554..68aa0aa35f 100644 --- a/firmware/target/arm/imx31/sdma-imx31.c +++ b/firmware/target/arm/imx31/sdma-imx31.c | |||
@@ -53,19 +53,13 @@ static void __attribute__((interrupt("IRQ"))) SDMA_HANDLER(void) | |||
53 | SDMA_INTR = pending; /* Ack all ints */ | 53 | SDMA_INTR = pending; /* Ack all ints */ |
54 | pending &= sdma_enabled_ints; /* Only dispatch ints with callback */ | 54 | pending &= sdma_enabled_ints; /* Only dispatch ints with callback */ |
55 | 55 | ||
56 | while (1) | 56 | while (pending) |
57 | { | 57 | { |
58 | unsigned int channel; | 58 | unsigned int bit = pending & -pending; /* Isolate bottom bit */ |
59 | pending &= ~bit; /* Clear it */ | ||
59 | 60 | ||
60 | if (pending == 0) | 61 | /* Call callback (required if using an interrupt). bit number = channel */ |
61 | break; /* No bits set */ | 62 | ccb_array[31 - __builtin_clz(bit)].channel_desc->callback(); |
62 | |||
63 | channel = find_first_set_bit(pending); | ||
64 | |||
65 | pending &= ~(1ul << channel); | ||
66 | |||
67 | /* Call callback (required if using an interrupt) */ | ||
68 | ccb_array[channel].channel_desc->callback(); | ||
69 | } | 63 | } |
70 | } | 64 | } |
71 | 65 | ||