RTEMS 6.1-rc4
Loading...
Searching...
No Matches
Functions
cacheimpl.h File Reference

This header file contains the implementation of the Cache Manager. More...

#include <rtems.h>
#include <sys/param.h>

Go to the source code of this file.

Functions

void rtems_cache_flush_multiple_data_lines (const void *d_addr, size_t n_bytes)
 Flushes the data cache lines covering the memory area.
 
void rtems_cache_invalidate_multiple_data_lines (const void *d_addr, size_t n_bytes)
 Invalidates the data cache lines covering the memory area.
 
void rtems_cache_flush_entire_data (void)
 Flushes the entire data cache.
 
void rtems_cache_invalidate_entire_data (void)
 Invalidates the entire data cache.
 
size_t rtems_cache_get_data_line_size (void)
 Gets the data cache line size in bytes.
 
size_t rtems_cache_get_data_cache_size (uint32_t level)
 Gets the data cache size in bytes for the cache level.
 
void rtems_cache_freeze_data (void)
 Freezes the data caches.
 
void rtems_cache_unfreeze_data (void)
 Unfreezes the data cache.
 
void rtems_cache_enable_data (void)
 Enables the data cache.
 
void rtems_cache_disable_data (void)
 Disables the data cache.
 
void rtems_cache_invalidate_multiple_instruction_lines (const void *i_addr, size_t n_bytes)
 Invalidates the instruction cache lines covering the memory area.
 
void rtems_cache_invalidate_entire_instruction (void)
 Invalidates the entire instruction cache.
 
size_t rtems_cache_get_instruction_line_size (void)
 Gets the instruction cache line size in bytes.
 
size_t rtems_cache_get_instruction_cache_size (uint32_t level)
 Gets the instruction cache size in bytes for the cache level.
 
void rtems_cache_freeze_instruction (void)
 Freezes the instruction caches.
 
void rtems_cache_unfreeze_instruction (void)
 Unfreezes the instruction cache.
 
void rtems_cache_enable_instruction (void)
 Enables the instruction cache.
 
void rtems_cache_disable_instruction (void)
 Disables the instruction cache.
 
size_t rtems_cache_get_maximal_line_size (void)
 Gets the maximal cache line size in bytes of all caches (data, instruction, or unified).
 
void rtems_cache_instruction_sync_after_code_change (const void *code_addr, size_t n_bytes)
 Ensures necessary synchronization required after code changes.
 

Detailed Description

This header file contains the implementation of the Cache Manager.

The functions in this file implement the API to the Cache Manager. This file is intended to be included in a cache implemention source file provided by the architecture or BSP, e.g.

In this file a couple of defines and inline functions may be provided and afterwards this file is included, e.g.

#define CPU_DATA_CACHE_ALIGNMENT XYZ
...
#include "../../../bsps/shared/cache/cacheimpl.h"

The cache implementation source file shall define

#define CPU_DATA_CACHE_ALIGNMENT <POSITIVE INTEGER>

to enable the data cache support.

The cache implementation source file shall define

#define CPU_INSTRUCTION_CACHE_ALIGNMENT <POSITIVE INTEGER>

to enable the instruction cache support.

The cache implementation source file shall define

#define CPU_CACHE_SUPPORT_PROVIDES_RANGE_FUNCTIONS

if it provides cache maintenance functions which operate on multiple lines. Otherwise a generic loop with single line operations will be used. It is strongly recommended to provide the implementation in terms of static inline functions for performance reasons.

The cache implementation source file shall define

#define CPU_CACHE_SUPPORT_PROVIDES_CACHE_SIZE_FUNCTIONS

if it provides functions to get the data and instruction cache sizes by level.

The cache implementation source file shall define

#define CPU_CACHE_SUPPORT_PROVIDES_INSTRUCTION_SYNC_FUNCTION

if special instructions must be used to synchronize the instruction caches after a code change.

The cache implementation source file shall define

#define CPU_CACHE_SUPPORT_PROVIDES_DISABLE_DATA

if an external implementation of rtems_cache_disable_data() is provided, e.g. as an implementation in assembly code.

The cache implementation source file shall define

#define CPU_CACHE_NO_INSTRUCTION_CACHE_SNOOPING

if the hardware provides no instruction cache snooping and the instruction cache invalidation needs software support.

The functions below are implemented with inline routines found in the cache implementation source file for each architecture or BSP. In the event that not support for a specific function for a cache is provided, the API routine does nothing (but does exist).

Function Documentation

◆ rtems_cache_freeze_data()

void rtems_cache_freeze_data ( void  )

Freezes the data caches.

Constraints

The following constraints apply to this directive:

  • The directive may be called from within any runtime context.
  • The directive will not cause the calling task to be preempted.

◆ rtems_cache_freeze_instruction()

void rtems_cache_freeze_instruction ( void  )

Freezes the instruction caches.

Constraints

The following constraints apply to this directive:

  • The directive may be called from within any runtime context.
  • The directive will not cause the calling task to be preempted.

◆ rtems_cache_unfreeze_data()

void rtems_cache_unfreeze_data ( void  )

Unfreezes the data cache.

Constraints

The following constraints apply to this directive:

  • The directive may be called from within any runtime context.
  • The directive will not cause the calling task to be preempted.

◆ rtems_cache_unfreeze_instruction()

void rtems_cache_unfreeze_instruction ( void  )

Unfreezes the instruction cache.

Constraints

The following constraints apply to this directive:

  • The directive may be called from within any runtime context.
  • The directive will not cause the calling task to be preempted.