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.
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