Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/c/cache_inval.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/c/cache_inval.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/c/cache_inval.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/c/cache_inval.html on line 8

CACHE_INVAL()

Invalidate cache lines associated with a data buffer

Synopsis:

#include <sys/cache.h>

CACHE_INVAL(struct cache_ctrl *cinfo, 
            void *vaddr, 
            uint64_t paddr, 
            size_t len);

Arguments:

cinfo
A pointer the the structure that was initially passed to cache_init().
vaddr
The virtual address of the buffer; this is a pointer to the data in the driver's virtual address space.
paddr
The physical address of the buffer: this is typically in the same address space that the external device will use to reference the data. The physical address is obtained by calling mem_offset64(). Since this function is fairly costly, drivers typically allocate a pool of data buffers at initialization (e.g. by calling mmap() with the MAP_PHYS and MAP_ANON flags), and pre determine the physical addresses of the data.
len
The number of bytes in the buffer, for which the associated cache lines should be invalidated.

Library:

libcache

Use the -l cache option to qcc to link against this library.

Description:

This macro is used to invalidate any cache lines associated with a data buffer. This routine ensures that any subsequent modifications that are made to the data by an external device will be not be corrupted by the CPU writing back cached data to the memory, and ensures that once the data has been modified, the CPU will fetch the updated data from memory, instead of retrieving stale data from the cache.


Note: This function was added in QNX Momentics 6.3.0 SP2.

Environment variables:

The following environment variables, if they exist, affect the behavior of this function:

CACHE_NOP
Instructs the library that the CACHE_FLUSH() and CACHE_INVAL() macros should have no effect.
CACHE_MSYNC
Instructs the library that the CACHE_FLUSH() and CACHE_INVAL() macros should use the msync() C library call to perform cache synchronization.

Classification:

QNX Neutrino

Safety:
Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes

Caveats:

CACHE_INVAL() is implemented as a macro.

See also:

cache_fini(), CACHE_FLUSH(), cache_init()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/c/cache_inval.html on line 175

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/c/cache_inval.html on line 175