fix atomic dma setting

Michael Panzlaff 2021-06-15 23:11:21 +02:00
parent 0ab4cab877
commit 8a227b0e91
1 changed files with 6 additions and 3 deletions

@ -108,9 +108,12 @@ We can fix this very easily by using the `STMIA` instruction for DMA register wr
- dmaRegs[1] = (vu32)(dest); \ - dmaRegs[1] = (vu32)(dest); \
- dmaRegs[2] = (vu32)(control); \ - dmaRegs[2] = (vu32)(control); \
- dmaRegs[2]; \ - dmaRegs[2]; \
+ register u32 r_src asm("r0") = (u32)src; \ + u32 eval_src = (u32)(src); \
+ register u32 r_dst asm("r1") = (u32)dest; \ + u32 eval_dst = (u32)(dest); \
+ register u32 r_ctl asm("r2") = (u32)control; \ + 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"); \ + asm volatile("stmia %0!, {%1, %2, %3}" : "+l" (dmaRegs) : "l" (r_src), "l" (r_dst), "l" (r_ctl) : "memory"); \
} }
``` ```