ARM_sync_icache(2)

NAME
arm_sync_icache - synchronize the data and instruction caches

LIBRARY
libc

SYNOPSIS
#include <machine/sysarch.h>
int
arm_sync_icache(u_int addr, int len);

DESCRIPTION
The arm_sync_icache system call synchronizes the contents of any data and instructions caches with the contents of main memory for the given range. Use this after loading executable code or modifying existing code in memory, before attempting to execute that code.

The addr and len arguments do not need to be aligned to any particular boundary, but cache operations will affect entire cache lines, even those which are only partially overlapped by the given range.

This takes one or more of the following actions, depending on the requirements of the hardware:

•   Write dirty data cache lines within the range back to main memory.

•   Invalidate existing instruction cache contents for the range.

•   Invalidate branch prediction caches for the range.

On hardware which supports multiple synchronization points for cache operations, the caches are maintained to the point of unification, making the data in the range coherent amongst all cores.

RETURN VALUES
The arm_sync_icache system call always returns 0.

ERRORS
If a call refers to memory which the calling process does not have rights to access, or if the len argument is negative, a SIGSEGV signal is delivered to the calling thread.

AUTHORS
This man page was written by Ian Lepore.