Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
cache.h File Reference
#include <cache.h>

Go to the source code of this file.

Functions

void cache_data_enable (void)
 Enable d-cache. More...
 
void cache_data_disable (void)
 Disable d-cache. More...
 
void cache_instr_enable (void)
 Enable i-cache. More...
 
void cache_instr_disable (void)
 Disable i-cache. More...
 
int cache_data_all (int op)
 Write-back / Invalidate / Write-back + Invalidate all d-cache. More...
 
int cache_data_range (void *addr, size_t size, int op)
 Write-back / Invalidate / Write-back + Invalidate d-cache lines. More...
 
int cache_instr_all (int op)
 Write-back / Invalidate / Write-back + Invalidate all i-cache. More...
 
int cache_instr_range (void *addr, size_t size, int op)
 Write-back / Invalidate / Write-back + Invalidate i-cache lines. More...
 

Function Documentation

◆ cache_data_all()

int cache_data_all ( int  op)

Write-back / Invalidate / Write-back + Invalidate all d-cache.

Write-back, Invalidate or Write-back + Invalidate the whole d-cache.

Parameters
opOperation to perform (one of the K_CACHE_* operations)
Return values
0On success
-ENOTSUPIf the operation is not supported

◆ cache_data_disable()

void cache_data_disable ( void  )

Disable d-cache.

Disable the d-cache.

Returns
N/A

◆ cache_data_enable()

void cache_data_enable ( void  )

Enable d-cache.

Enable the d-cache.

Returns
N/A

◆ cache_data_range()

int cache_data_range ( void addr,
size_t  size,
int  op 
)

Write-back / Invalidate / Write-back + Invalidate d-cache lines.

No alignment is required for either addr or size, but since arch_dcache_range() iterates on the d-cache lines, a d-cache line alignment for both is optimal.

The d-cache line size is specified either via the CONFIG_DCACHE_LINE_SIZE kconfig option or it is detected at runtime.

Parameters
addrThe pointer to start the multi-line operation
sizeThe number of bytes that are to be acted on
opOperation to perform (one of the K_CACHE_* operations)
Return values
0On success
-ENOTSUPIf the operation is not supported

◆ cache_instr_all()

int cache_instr_all ( int  op)

Write-back / Invalidate / Write-back + Invalidate all i-cache.

Write-back, Invalidate or Write-back + Invalidate the whole i-cache.

Parameters
opOperation to perform (one of the K_CACHE_* operations)
Return values
0On success
-ENOTSUPIf the operation is not supported

◆ cache_instr_disable()

void cache_instr_disable ( void  )

Disable i-cache.

Disable the i-cache.

Returns
N/A

◆ cache_instr_enable()

void cache_instr_enable ( void  )

Enable i-cache.

Enable the i-cache.

Returns
N/A

◆ cache_instr_range()

int cache_instr_range ( void addr,
size_t  size,
int  op 
)

Write-back / Invalidate / Write-back + Invalidate i-cache lines.

No alignment is required for either addr or size, but since arch_icache_range() iterates on the i-cache lines, an i-cache line alignment for both is optimal.

The i-cache line size is specified either via the CONFIG_ICACHE_LINE_SIZE kconfig option or it is detected at runtime.

Parameters
addrThe pointer to start the multi-line operation
sizeThe number of bytes that are to be acted on
opOperation to perform (one of the K_CACHE_* operations)
Return values
0On success
-ENOTSUPIf the operation is not supported