Zephyr Project API  3.3.0
A Scalable Open Source RTOS
Cache Interface

Functions

static void sys_cache_data_enable (void)
 Enable the d-cache. More...
 
static void sys_cache_data_disable (void)
 Disable the d-cache. More...
 
static void sys_cache_instr_enable (void)
 Enable the i-cache. More...
 
static void sys_cache_instr_disable (void)
 Disable the i-cache. More...
 
static int sys_cache_data_flush_all (void)
 Flush the d-cache. More...
 
static int sys_cache_instr_flush_all (void)
 Flush the i-cache. More...
 
static int sys_cache_data_invd_all (void)
 Invalidate the d-cache. More...
 
static int sys_cache_instr_invd_all (void)
 Invalidate the i-cache. More...
 
static int sys_cache_data_flush_and_invd_all (void)
 Flush and Invalidate the d-cache. More...
 
static int sys_cache_instr_flush_and_invd_all (void)
 Flush and Invalidate the i-cache. More...
 
int sys_cache_data_flush_range (void *addr, size_t size)
 Flush an address range in the d-cache. More...
 
static int sys_cache_instr_flush_range (void *addr, size_t size)
 Flush an address range in the i-cache. More...
 
int sys_cache_data_invd_range (void *addr, size_t size)
 Invalidate an address range in the d-cache. More...
 
static int sys_cache_instr_invd_range (void *addr, size_t size)
 Invalidate an address range in the i-cache. More...
 
int sys_cache_data_flush_and_invd_range (void *addr, size_t size)
 Flush and Invalidate an address range in the d-cache. More...
 
static int sys_cache_instr_flush_and_invd_range (void *addr, size_t size)
 Flush and Invalidate an address range in the i-cache. More...
 
static size_t sys_cache_data_line_size_get (void)
 Get the the d-cache line size. More...
 
static size_t sys_cache_instr_line_size_get (void)
 Get the the i-cache line size. More...
 

Detailed Description

Function Documentation

◆ sys_cache_data_disable()

static void sys_cache_data_disable ( void  )
inlinestatic

#include <include/zephyr/cache.h>

Disable the d-cache.

Disable the data cache

◆ sys_cache_data_enable()

static void sys_cache_data_enable ( void  )
inlinestatic

#include <include/zephyr/cache.h>

Enable the d-cache.

Enable the data cache

◆ sys_cache_data_flush_all()

static int sys_cache_data_flush_all ( void  )
inlinestatic

#include <include/zephyr/cache.h>

Flush the d-cache.

Flush the whole data cache.

Return values
0If succeeded.
-ENOTSUPIf not supported.
-errnoNegative errno for other failures.

◆ sys_cache_data_flush_and_invd_all()

static int sys_cache_data_flush_and_invd_all ( void  )
inlinestatic

#include <include/zephyr/cache.h>

Flush and Invalidate the d-cache.

Flush and Invalidate the whole data cache.

Return values
0If succeeded.
-ENOTSUPIf not supported.
-errnoNegative errno for other failures.

◆ sys_cache_data_flush_and_invd_range()

int sys_cache_data_flush_and_invd_range ( void *  addr,
size_t  size 
)

#include <include/zephyr/cache.h>

Flush and Invalidate an address range in the d-cache.

Flush and Invalidate the specified address range of the data cache.

Parameters
addrStarting address to flush and invalidate.
sizeRange size.
Return values
0If succeeded.
-ENOTSUPIf not supported.
-errnoNegative errno for other failures.

◆ sys_cache_data_flush_range()

int sys_cache_data_flush_range ( void *  addr,
size_t  size 
)

#include <include/zephyr/cache.h>

Flush an address range in the d-cache.

Flush the specified address range of the data cache.

Parameters
addrStarting address to flush.
sizeRange size.
Return values
0If succeeded.
-ENOTSUPIf not supported.
-errnoNegative errno for other failures.

◆ sys_cache_data_invd_all()

static int sys_cache_data_invd_all ( void  )
inlinestatic

#include <include/zephyr/cache.h>

Invalidate the d-cache.

Invalidate the whole data cache.

Return values
0If succeeded.
-ENOTSUPIf not supported.
-errnoNegative errno for other failures.

◆ sys_cache_data_invd_range()

int sys_cache_data_invd_range ( void *  addr,
size_t  size 
)

#include <include/zephyr/cache.h>

Invalidate an address range in the d-cache.

Invalidate the specified address range of the data cache.

Parameters
addrStarting address to invalidate.
sizeRange size.
Return values
0If succeeded.
-ENOTSUPIf not supported.
-errnoNegative errno for other failures.

◆ sys_cache_data_line_size_get()

static size_t sys_cache_data_line_size_get ( void  )
inlinestatic

#include <include/zephyr/cache.h>

Get the the d-cache line size.

The API is provided to get the data cache line.

The cache line size is calculated (in order of priority):

  • At run-time when CONFIG_DCACHE_LINE_SIZE_DETECT is set.
  • At compile time using the value set in CONFIG_DCACHE_LINE_SIZE .
  • At compile time using the d-cache-line-size CPU0 property of the DT.
  • 0 otherwise
Return values
sizeSize of the d-cache line.
0If the d-cache is not enabled.

◆ sys_cache_instr_disable()

static void sys_cache_instr_disable ( void  )
inlinestatic

#include <include/zephyr/cache.h>

Disable the i-cache.

Disable the instruction cache

◆ sys_cache_instr_enable()

static void sys_cache_instr_enable ( void  )
inlinestatic

#include <include/zephyr/cache.h>

Enable the i-cache.

Enable the instruction cache

◆ sys_cache_instr_flush_all()

static int sys_cache_instr_flush_all ( void  )
inlinestatic

#include <include/zephyr/cache.h>

Flush the i-cache.

Flush the whole instruction cache.

Return values
0If succeeded.
-ENOTSUPIf not supported.
-errnoNegative errno for other failures.

◆ sys_cache_instr_flush_and_invd_all()

static int sys_cache_instr_flush_and_invd_all ( void  )
inlinestatic

#include <include/zephyr/cache.h>

Flush and Invalidate the i-cache.

Flush and Invalidate the whole instruction cache.

Return values
0If succeeded.
-ENOTSUPIf not supported.
-errnoNegative errno for other failures.

◆ sys_cache_instr_flush_and_invd_range()

static int sys_cache_instr_flush_and_invd_range ( void *  addr,
size_t  size 
)
inlinestatic

#include <include/zephyr/cache.h>

Flush and Invalidate an address range in the i-cache.

Flush and Invalidate the specified address range of the instruction cache.

Parameters
addrStarting address to flush and invalidate.
sizeRange size.
Return values
0If succeeded.
-ENOTSUPIf not supported.
-errnoNegative errno for other failures.

◆ sys_cache_instr_flush_range()

static int sys_cache_instr_flush_range ( void *  addr,
size_t  size 
)
inlinestatic

#include <include/zephyr/cache.h>

Flush an address range in the i-cache.

Flush the specified address range of the instruction cache.

Parameters
addrStarting address to flush.
sizeRange size.
Return values
0If succeeded.
-ENOTSUPIf not supported.
-errnoNegative errno for other failures.

◆ sys_cache_instr_invd_all()

static int sys_cache_instr_invd_all ( void  )
inlinestatic

#include <include/zephyr/cache.h>

Invalidate the i-cache.

Invalidate the whole instruction cache.

Return values
0If succeeded.
-ENOTSUPIf not supported.
-errnoNegative errno for other failures.

◆ sys_cache_instr_invd_range()

static int sys_cache_instr_invd_range ( void *  addr,
size_t  size 
)
inlinestatic

#include <include/zephyr/cache.h>

Invalidate an address range in the i-cache.

Invalidate the specified address range of the instruction cache.

Parameters
addrStarting address to invalidate.
sizeRange size.
Return values
0If succeeded.
-ENOTSUPIf not supported.
-errnoNegative errno for other failures.

◆ sys_cache_instr_line_size_get()

static size_t sys_cache_instr_line_size_get ( void  )
inlinestatic

#include <include/zephyr/cache.h>

Get the the i-cache line size.

The API is provided to get the instruction cache line.

The cache line size is calculated (in order of priority):

  • At run-time when CONFIG_ICACHE_LINE_SIZE_DETECT is set.
  • At compile time using the value set in CONFIG_ICACHE_LINE_SIZE .
  • At compile time using the i-cache-line-size CPU0 property of the DT.
  • 0 otherwise
Return values
sizeSize of the d-cache line.
0If the d-cache is not enabled.