This manual page is for Mac OS X version 10.6.3

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • For more information about the manual page format, see the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Reference Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.



CACHE(3)                                BSD Library Functions Manual                                CACHE(3)

NAME
     sys_cache_control, sys_icache_invalidate, sys_dcache_flush -- cache control

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <libkern/OSCacheControl.h>

     int
     sys_cache_control(int function, void *start, size_t len);

     void
     sys_icache_invalidate(void *start, size_t len);

     void
     sys_dcache_flush(void *start, size_t len);

DESCRIPTION
     These functions operate on every cache line containing one of the len bytes of memory pointed to by
     start.  Normally the operations apply to every processor in the system, but the exact semantics of
     these operations is platform dependent.  They should be used with caution.

     sys_cache_control() performs the operation specified by function.  Refer to the header file for a list
     of currently supported functions.

     sys_icache_invalidate() prepares memory for execution, typically by invalidating the instruction cache
     for the indicated range.  This should be called after writing machine instructions to memory, and
     before executing them.  On IA32 processors this function is a NOP, because their instruction caches are
     coherent.

     sys_dcache_flush() writes modified data cache lines to main memory, and then invalidates all lines in
     the range being operated on.  It can be useful when dealing with cache incoherent devices or DMA.

RETURN VALUES
     sys_cache_control() returns zero on success, ENOTSUP if function is not valid.

SEE ALSO
     atomic(3), barrier(3)

HISTORY
     These functions first appeared in Mac OS 10.5 (Leopard).

Darwin                                       September 21, 2006                                       Darwin

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation with the feedback links below.
Bug reports
Report bugs in the functionality of the described tool or API through Bug Reporter.
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.

Did this document help you? Yes It's good, but... Not helpful...