Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

cachectl(2)  —  RISC

Name

cachectl − mark pages cacheable or uncacheable

Syntax

#include <mips/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.

The op parameter is one of the following:

CACHEABLE Make the indicated pages cacheable. 

UNCACHEABLE Make the indicated pages uncacheable. 

The arguments CACHEABLE and UNCACHEABLE affect the address range indicated by the addr and nbytes parameters.  The addr must be page aligned, and nbytes must be a multiple of the page size. 

Changing a page from UNCACHEABLE state to CACHEABLE state causes both the instruction and data caches to be flushed. 

Return Values

The cachectl system call returns 0 on success. If errors are detected, the cachectl system call returns −1 with the error cause indicated in errno. 

Diagnostics

[EFAULT] Some or all of the address range addr to (addr+nbytes−1) are not accessible.

[EINVAL] The op parameter is not CACHEABLE or UNCACHEABLE. 

[EINVAL] The addr parameter is not page aligned, or the nbytes parameter is not a multiple of pagesize. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026