> Section 6.2.3 of the SA-1110 manual describes the procedure for
> software-flushing the dcache, as follows:
> 
>       mov     r0, #0xe0000000
>       add     r1, r0, #8192
> 1:    ldr     r2, [r0], #32
>       teq     r1, r0
>       bne     1b
> 
>       mcr     p15, 0, r0, c7, c6, 0   @ invalidate D cache
>       mov     pc, lr

An interesting thing about this routine that is not precised
in the SA1110's manual is that the region 0xe0000000 needs to
be marked as cached (C=B=1). On second thought that sounds logical,
but it took me quite a bit of time to figure it out :-)

> I'm calling this from C, and as soon as I try to return from 
> the calling
> routine, I get a data abort. Examination of the stack frame 
> reveals that
> memory corruption has occurred.

Hypothesis: You entered the routine before turning the cache
on, then you think you flush the cache but you don't, the flush
routine returns fine because it's a stack-less return (forgive
my creation of words), then the caller tries to return with
a return value is suddenly cached and therefore not correct.

I know I'm not clear, it's friday evening..
Hope that helps anyway
Yves.



_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
Please visit the above address for information on this list.

Reply via email to