CACHECTL(2) RISC/os Reference Manual CACHECTL(2)
NAME
cachectl - mark pages cacheable or uncacheable
SYNOPSIS
For -systype sysv and -systype bsd43:
#include <sys/cachectl.h>
cachectl(addr, nbytes, op)
char *addr;
int nbytes, op;
DESCRIPTION
The cachectl system call allows a process to make ranges of
its address space cacheable or uncacheable. Initially, a
process's entire address space is cacheable.
op may be one of:
CACHEABLE Make the indicated pages cacheable
UNCACHEABLE
Make the indicated pages uncacheable
The CACHEABLE and UNCACHEABLE op's affect the address range
indicated by addr and nbytes. addr must be page aligned and
nbytes must be a multiple of the page size.
Changing a page from UNCACHEABLE state to CACHEABLE state
will cause both the instruction and data caches to be
flushed if necessary to avoid stale cache information.
RETURN VALUE
cachectl returns 0 when no errors are detected. If errors
are detected, cachectl returns -1 with the error cause indi-
cated in errno.
ERRORS
[EINVAL] op parameter is not one of CACHEABLE or UNCACHE-
ABLE.
[EINVAL] addr is not page aligned, or nbytes is not multiple
of pagesize.
[EFAULT] Some or all of the address range addr to
(addr+nbytes-1) is not accessable.
SEE ALSO
getpagesize(2).
NOTE
When these routines are used in a program which is compiled
Printed 1/15/91 Page 1
CACHECTL(2) RISC/os Reference Manual CACHECTL(2)
in -systype sysv, they are not resolved by libc.a. See
intro(3-SysV) for more information.
Page 2 Printed 1/15/91