Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VxWorks: how can I be sure that data is read from DDR and not from cache

Tags:

c

vxworks

example:

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

the question is what can assure that flushing. thanks.

like image 800
lkanab Avatar asked Jan 26 '26 07:01

lkanab


1 Answers

VxWorks provides cacheLib which enables you to perform certain cache operations, flushing as well. You'll have to check the reference manual for your Version of VxWorks. Anyway, from version 5.4:

STATUS cacheFlush
(
    CACHE_TYPE cache,   /* cache to flush */
    void *     address, /* virtual address */
    size_t     bytes    /* number of bytes to flush */
)

Source: VxWorks V 5.4 cacheLib

like image 105
Sebastian Dressler Avatar answered Jan 27 '26 21:01

Sebastian Dressler