cache invalidate in user space - Embedded

This is a discussion on cache invalidate in user space - Embedded ; Does anybody know how can I invalidate content of the cache in user space = user process/thread? Thanks....

+ Reply to Thread
Results 1 to 7 of 7

Thread: cache invalidate in user space

  1. cache invalidate in user space

    Does anybody know how can I invalidate content of the cache in user
    space = user process/thread? Thanks.


  2. Re: cache invalidate in user space

    martinfnp@yahoo.com wrote:

    > Does anybody know how can I invalidate content of the cache in user
    > space = user process/thread? Thanks.


    1) What architecture
    2) Why (maybe there are better solutions)

    JB

  3. Re: cache invalidate in user space

    PowerPC. Just D-cache. What I'm doing right now is that I fill dummy
    buffer - which makes content of the D-cache filled by that dummy
    buffer. But for future it slows down execution.


  4. Re: cache invalidate in user space

    In article <1142438245.727975.267520@v46g2000cwv.googlegroups. com>,
    martinfnp@yahoo.com writes:
    > Does anybody know how can I invalidate content of the cache in user
    > space = user process/thread? Thanks.


    Which architecture/processor?


    Rob

  5. Re: cache invalidate in user space

    martinfnp@yahoo.com wrote:
    > PowerPC. Just D-cache. What I'm doing right now is that I fill dummy
    > buffer - which makes content of the D-cache filled by that dummy
    > buffer. But for future it slows down execution.


    But why are you doing it ? It's hard to think of a good reason.

  6. Re: cache invalidate in user space

    martinfnp@yahoo.com wrote:

    > PowerPC. Just D-cache. What I'm doing right now is that I fill dummy
    > buffer - which makes content of the D-cache filled by that dummy
    > buffer. But for future it slows down execution.


    Hmmm. Why it slows down execution? The PowerPC has separate I cache. Or do
    you work with a large amount of data? So the next steps are slowed down due
    to flushing old d cache content?

    With the PowerPC architecture you have a bunch of cache control instructions
    also in userspace. See the architecture manual and search for instructions
    like "dcbz" (very powerfull to zero out memory areas), "dcbf" to flush
    specific address spaces (that is what you need) and "dcbt" to preload data
    before using. With "dcbt" and "dcbf" in a loop you can handle a huge amount
    of data in a very efficient way (flush n, touch n+2, modify n+1, loop with
    n=n+1).

    See the GNU libc string and memory functions in the PowerPC part how to use
    these assembler instructions from "C" code...

    Hope it helps.
    Juergen



  7. Re: cache invalidate in user space


    martinfnp@yahoo.com 작성:

    > Does anybody know how can I invalidate content of the cache in user
    > space = user process/thread? Thanks.


    AFAIK it's almost impossible. I think you'd better write a small device
    driver and use it to do the necessary job.


+ Reply to Thread