CACHEFLUSH(3) OpenBSD Programmer's Manual (MIPS64) CACHEFLUSH(3)NAME
cacheflush, _flush_cache - CPU cache synchronization functions
SYNOPSIS
#include <machine/sysarch.h>
int
cacheflush(void *addr, int nbytes, int cache);
int
_flush_cache(char *addr, int nbytes, int cache);
DESCRIPTIONcacheflush() allows a process to synchronize the contents of the
processor caches with main memory. Since MIPS processors have separate
instruction and data caches, this function allows for dynamically
generated code to run correctly.
cacheflush operates on a contiguous memory range in the current process
address space, starting at address addr and nbytes bytes long. The
caches to be synchronized are specified in the cache argument with one of
the following values:
ICACHE synchronize the instruction cache
DCACHE synchronize the data cache
BCACHE synchronize both the instruction and data caches
_flush_cache is an alias for the cacheflush function.
RETURN VALUES
Upon successful completion, cacheflush returns zero. Otherwise, a value
of -1 is returned and errno is set to indicate the error.
ERRORScacheflush will fail if:
[EFAULT] The address range specified by addr and nbytes is not part
of the process allocated address space.
[EINVAL] cache is not valid.
OpenBSD 4.9 September 26, 2010 OpenBSD 4.9