例子:
int foo(void)
{
static volatile int data;
data = 0xaaa;
/* something to assure cache flushing */
if (data == 0xaaa)
return 1;
return 0;
}
问题是什么可以保证冲洗。谢谢。
最佳答案
VxWorks 提供了 cacheLib 使您能够执行某些缓存操作,以及刷新。您必须查看您的 VxWorks 版本的引用手册。无论如何,从 5.4 版开始:
STATUS cacheFlush
(
CACHE_TYPE cache, /* cache to flush */
void * address, /* virtual address */
size_t bytes /* number of bytes to flush */
)
关于c - VxWorks:如何确定数据是从 DDR 而不是缓存中读取的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8518892/