Re: r3000 cache flush q

Simon Burge <[email protected]>
Newsgroups gmane.os.netbsd.ports.mips.devel
Message-ID <[email protected]>
David Holland wrote:

> r3k_pdcache_do_inv in cache_r3k_subr.S contains the following per
> cache line:
>
>         sb      zero, 0(a0)
>         sb      zero, 4(a0)
>         sb      zero, 8(a0)
>         sb      zero, 12(a0)
>         sb      zero, 16(a0)
>         sb      zero, 20(a0)
>         sb      zero, 24(a0)
>         addu    a0, 32
>
> that is, it touches each word except the last one.
>
> Can anyone explain this? One would think it would either need exactly
> one word in the cache line to be patted, or all of them, but not all
> but one. (The doc I have suggests that only one is necssary.)

At the end of the loop:

        addu    a0, 32
        bltu    a0, a1, 1b
        sb      zero, -4(a0)		<<<<

the last sb in the branch delay slot touches the last cache line.

Cheers,
Simon.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.