From 8a227b0e91fbe11baa8cd91a7e9c3fec0fe6b273 Mon Sep 17 00:00:00 2001 From: Michael Panzlaff Date: Tue, 15 Jun 2021 23:11:21 +0200 Subject: [PATCH] fix atomic dma setting --- Implementing-ipatix's-High-Quality-Audio-Mixer.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Implementing-ipatix's-High-Quality-Audio-Mixer.md b/Implementing-ipatix's-High-Quality-Audio-Mixer.md index 8dc35cc..4d710ca 100644 --- a/Implementing-ipatix's-High-Quality-Audio-Mixer.md +++ b/Implementing-ipatix's-High-Quality-Audio-Mixer.md @@ -108,9 +108,12 @@ We can fix this very easily by using the `STMIA` instruction for DMA register wr - dmaRegs[1] = (vu32)(dest); \ - dmaRegs[2] = (vu32)(control); \ - dmaRegs[2]; \ -+ register u32 r_src asm("r0") = (u32)src; \ -+ register u32 r_dst asm("r1") = (u32)dest; \ -+ register u32 r_ctl asm("r2") = (u32)control; \ ++ u32 eval_src = (u32)(src); \ ++ u32 eval_dst = (u32)(dest); \ ++ u32 eval_ctl = (u32)(control); \ ++ register u32 r_src asm("r0") = eval_src; \ ++ register u32 r_dst asm("r1") = eval_dst; \ ++ register u32 r_ctl asm("r2") = eval_ctl; \ + asm volatile("stmia %0!, {%1, %2, %3}" : "+l" (dmaRegs) : "l" (r_src), "l" (r_dst), "l" (r_ctl) : "memory"); \ } ```