PebbleOS
Loading...
Searching...
No Matches
Macros | Functions
cache.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

Macros

#define DCACHE_LINE_SIZE_MAX   32U
 Largest data cache line of the supported cores, in bytes.
 
#define DCACHE_ROUND_UP(size)   (((size) + DCACHE_LINE_SIZE_MAX - 1U) & ~(DCACHE_LINE_SIZE_MAX - 1U))
 size rounded up to whole DCACHE_LINE_SIZE_MAX lines.
 

Functions

void icache_enable (void)
 Enable the instruction cache, invalidating it first.
 
void icache_disable (void)
 Disable the instruction cache, invalidating it afterwards.
 
bool icache_is_enabled (void)
 Check whether the instruction cache is enabled.
 
uint32_t icache_line_size (void)
 Get the instruction cache line size.
 
void icache_invalidate_all (void)
 Invalidate the entire instruction cache.
 
void icache_invalidate (void *addr, size_t size)
 Invalidate the instruction cache for a range.
 
void dcache_enable (void)
 Enable the data cache, invalidating it first.
 
void dcache_disable (void)
 Disable the data cache, flushing and invalidating it first.
 
bool dcache_is_enabled (void)
 Check whether the data cache is enabled.
 
uint32_t dcache_line_size (void)
 Get the data cache line size.
 
void dcache_flush_all (void)
 Flush the entire data cache.
 
void dcache_invalidate_all (void)
 Invalidate the entire data cache.
 
void dcache_flush_invalidate_all (void)
 Flush, then invalidate the entire data cache.
 
void dcache_flush (const void *addr, size_t size)
 Flush the data cache for a range.
 
void dcache_invalidate (void *addr, size_t size)
 Invalidate the data cache for a range.
 
void dcache_flush_invalidate (const void *addr, size_t size)
 Flush, then invalidate the data cache for a range.
 
void icache_align (uintptr_t *addr, size_t *size)
 Widen a range to whole instruction cache lines.
 
void dcache_align (uintptr_t *addr, size_t *size)
 Widen a range to whole data cache lines.
 
uint32_t dcache_alignment_mask_minimum (uint32_t min)
 Get the alignment mask for a buffer shared with a peripheral.