MadDog
Member
I'm trying to invalidate the cache lines for the memory area where the palette lives when I update its data with this code. The addess is 16 byte aligned. But the code locks up.
asm volatile
(
//Don't want to invalidate the entire cache, that would be bad.
//So we invalidate only the area that the palette is.
"mov r0,%0 \n"
"mov r1,#64 \n"//Have to do 64 cache lines. (palette size of == (256*4) / cache line size(16))
"invalidate_palette_cache: \n"
" mcr p15,0,r0,c7,c6,1 \n"
" add r0,r0,#16 \n"//Move to next cache line.
" subs r1,r1,#1 \n"//Remeber how many we done.
" bne invalidate_palette_cache \n"
:
:"r"(reg.cmd.cmd_buf->palette)
:"r0","r1"
);
asm volatile
(
//Don't want to invalidate the entire cache, that would be bad.
//So we invalidate only the area that the palette is.
"mov r0,%0 \n"
"mov r1,#64 \n"//Have to do 64 cache lines. (palette size of == (256*4) / cache line size(16))
"invalidate_palette_cache: \n"
" mcr p15,0,r0,c7,c6,1 \n"
" add r0,r0,#16 \n"//Move to next cache line.
" subs r1,r1,#1 \n"//Remeber how many we done.
" bne invalidate_palette_cache \n"
:
:"r"(reg.cmd.cmd_buf->palette)
:"r0","r1"
);