VxWorks:我如何确保从DDR而不是从缓存读取数据

lka*_*nab 3 c vxworks

例:

int foo(void)
{
    static volatile int data;
    data = 0xaaa;
    /* something to assure cache flushing */
    if (data == 0xaaa)
        return 1;
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

问题是什么可以保证冲洗.谢谢.

Seb*_*ler 5

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 */
)
Run Code Online (Sandbox Code Playgroud)

来源:VxWorks V 5.4 cacheLib