Something went wrong. Try again.
Cider Isn't Darwin Emulation, Really
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455.Dd September 21, 2006.Dt CACHE 3.Os Darwin.Sh NAME.Nm sys_cache_control ,.Nm sys_icache_invalidate ,.Nm sys_dcache_flush.Nd cache control.Sh LIBRARY.Lb libc.Sh SYNOPSIS.In libkern/OSCacheControl.h.Ft int.Fn sys_cache_control "int function" "void *start" "size_t len".Ft void.Fn sys_icache_invalidate "void *start" "size_t len".Ft void.Fn sys_dcache_flush "void *start" "size_t len".Sh DESCRIPTION.PpThese functions operate on every cache line containing one of the .Fa lenbytes of memory pointed to by.Fa start .Normally the operations apply to everyprocessor in the system, but the exact semantics of theseoperations is platform dependent. They should be used with caution..Pp.Fn sys_cache_controlperforms the operation specified by.Fa function .Refer to the header file for a list of currently supported functions..Pp.Fn sys_icache_invalidateprepares memory for execution, typically by invalidating the instructioncache for the indicated range. This should be calledafter writing machine instructions to memory, and beforeexecuting them. On IA32 processors this function is a NOP, becausetheir instruction caches are coherent..Pp.Fn sys_dcache_flushwrites 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 incoherentdevices or DMA..Sh RETURN VALUES.Fn sys_cache_controlreturns zero on success, ENOTSUP if.Fa functionis not valid..Sh SEE ALSO.Xr atomic 3 ,.Xr barrier 3.Sh HISTORYThese functions first appeared in Mac OS 10.5 (Leopard).