This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

why there is no BCACHE_invall function?

I have found BCACHE_invL1pAll,BCACHE_wbAll and BCACHE_wbInvAll in the DSP/BIOS, but why there is no function BCACHE_invL1dAll ,BCACHE_invL2All?if I want to do global invalid the L1D and L2 cache without writeback,how can I do?

  • The reason why those APIs do not exists is because it is unsafe to Invalidate all of L1D and/or L2.  An example is the stack which will be cached in L1D or L2 would be invalidated and your program will go into the weeds.  For data, we recommend using block cache operations.

    Judah

  • Thanks for your anwser ,but the block cache operations is too slow, I have tested that to invalidate  1 M byte data use the BCACHE_inv API, it cost 1 millisecond ,the time is too long and can't be accept in my project ,is there some method to do ?

  • Well,  you can do an invalidate all operation but only if you know for sure that all the data is safe to invalidate.  You must know for sure that any stack data is not in the cache.   One way would be to strategically place stack memory in non cacheable area.  If you don't, you probably have to disable interrupts just to make sure an interrupt does happen.  You would have to make your own function that does this but it should be pretty easy to write.  Just checkout the BIOS versions and write to the Invalidate register instead of the writeback invalidate.

    Judah