KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
cache.h File Reference

Cache management functionality. More...

#include <kos/cdefs.h>
#include <arch/cache.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define CACHE_L1_ICACHE_SIZE    ARCH_CACHE_L1_ICACHE_SIZE
 Level 1 instruction cache size.
 
#define CACHE_L1_ICACHE_ASSOC    ARCH_CACHE_L1_ICACHE_ASSOC
 Level 1 instruction cache associativity.
 
#define CACHE_L1_ICACHE_LINESIZE    ARCH_CACHE_L1_ICACHE_LINESIZE
 L1 instruction cache line size.
 
#define CACHE_L1_DCACHE_SIZE    ARCH_CACHE_L1_DCACHE_SIZE
 Level 1 data cache size.
 
#define CACHE_L1_DCACHE_ASSOC    ARCH_CACHE_L1_DCACHE_ASSOC
 Level 1 data cache associativity.
 
#define CACHE_L1_DCACHE_LINESIZE    ARCH_CACHE_L1_DCACHE_LINESIZE
 L1 data cache line size.
 
#define CACHE_L2_CACHE_SIZE    ARCH_CACHE_L2_CACHE_SIZE
 Level 2 cache size.
 
#define CACHE_L2_CACHE_ASSOC    ARCH_CACHE_L2_CACHE_ASSOC
 Level 2 cache associativity.
 
#define CACHE_L2_CACHE_LINESIZE    ARCH_CACHE_L2_CACHE_LINESIZE
 Level 2 cache line size.
 

Functions

static void icache_inval_range (uintptr_t start, size_t count)
 Invalidate the instruction cache.
 
static void icache_sync_range (uintptr_t start, size_t count)
 Synchronize the instruction cache.
 
static void dcache_inval_range (uintptr_t start, size_t count)
 Invalidate the data/operand cache.
 
static void dcache_wback_range (uintptr_t start, size_t count)
 Perform a write-back on the data/operand cache.
 
static void dcache_wback_all (void)
 Perform a write-back on the the whole data/operand cache.
 
static void dcache_purge_range (uintptr_t start, size_t count)
 Purge the data/operand cache.
 
static void dcache_purge_all (void)
 Purge all the data/operand cache.
 
static void dcache_pref_line (const void *src)
 Prefetch one block to the data/operand cache.
 
static void dcache_alloc_line (void *src)
 Allocate one cache line of the data/operand cache.
 
static void dcache_zero_alloc_line (void *src)
 Zero-allocate one cache line of the data/operand cache.
 
static void dcache_alloc_line_with_value (void *src, uintptr_t value)
 Allocate one cache line of the data/operand cache with a value.
 
static void dcache_inval_line (void *src)
 Invalidate one cache line of the data/operand cache.
 
static void dcache_purge_line (void *src)
 Purge one cache line of the data/operand cache.
 
static void dcache_wback_line (void *src)
 Write-back one cache line of the data/operand cache.
 

Detailed Description

Cache management functionality.

This file contains definitions for functions that manage the caches, including functions to flush, invalidate, purge, prefetch and allocate individual cache lines or address ranges.

Author
Megan Potter
Ruslan Rostovtsev
Andy Barajas
Falco Girgis