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

Cache management functionality. More...

#include <kos/cache.h>
#include <kos/cdefs.h>
#include <kos/regfield.h>
#include <stdalign.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define ARCH_CACHE_L1_ICACHE_SIZE   (8 * 1024)
 
#define ARCH_CACHE_L1_ICACHE_ASSOC   1
 
#define ARCH_CACHE_L1_ICACHE_LINESIZE   32
 
#define ARCH_CACHE_L1_DCACHE_SIZE   (16 * 1024)
 
#define ARCH_CACHE_L1_DCACHE_ASSOC   1
 
#define ARCH_CACHE_L1_DCACHE_LINESIZE   32
 
#define ARCH_CACHE_L2_CACHE_SIZE   0
 
#define ARCH_CACHE_L2_CACHE_ASSOC   0
 
#define ARCH_CACHE_L2_CACHE_LINESIZE   0
 

Functions

void arch_icache_inval_range (uintptr_t start, size_t count)
 
void arch_icache_sync_range (uintptr_t start, size_t count)
 
static __always_inline void dcache_wback_sq (void *src)
 
static void arch_dcache_pref_line (const void *src)
 
static void arch_dcache_alloc_line_with_value (void *src, uintptr_t value)
 
static void arch_dcache_alloc_line (void *src)
 
static void arch_dcache_zero_alloc_line (void *src)
 
static void arch_dcache_inval_line (void *src)
 
static void arch_dcache_purge_line (void *src)
 
static void arch_dcache_wback_line (void *src)
 
static void arch_dcache_inval_range (uintptr_t start, size_t count)
 
static void arch_dcache_wback_all (void)
 
static void arch_dcache_wback_range (uintptr_t start, size_t count)
 
static void arch_dcache_purge_all (void)
 
static void arch_dcache_purge_range (uintptr_t start, size_t count)
 

Detailed Description

Cache management functionality.

This file contains definitions for functions that manage the cache in the Dreamcast, including functions to flush, invalidate, purge, prefetch and allocate the caches.

Author
Megan Potter
Ruslan Rostovtsev
Andy Barajas
Falco Girgis

Macro Definition Documentation

◆ ARCH_CACHE_L1_DCACHE_ASSOC

#define ARCH_CACHE_L1_DCACHE_ASSOC   1

◆ ARCH_CACHE_L1_DCACHE_LINESIZE

#define ARCH_CACHE_L1_DCACHE_LINESIZE   32

◆ ARCH_CACHE_L1_DCACHE_SIZE

#define ARCH_CACHE_L1_DCACHE_SIZE   (16 * 1024)

Referenced by arch_dcache_purge_all().

◆ ARCH_CACHE_L1_ICACHE_ASSOC

#define ARCH_CACHE_L1_ICACHE_ASSOC   1

◆ ARCH_CACHE_L1_ICACHE_LINESIZE

#define ARCH_CACHE_L1_ICACHE_LINESIZE   32

◆ ARCH_CACHE_L1_ICACHE_SIZE

#define ARCH_CACHE_L1_ICACHE_SIZE   (8 * 1024)

◆ ARCH_CACHE_L2_CACHE_ASSOC

#define ARCH_CACHE_L2_CACHE_ASSOC   0

◆ ARCH_CACHE_L2_CACHE_LINESIZE

#define ARCH_CACHE_L2_CACHE_LINESIZE   0

◆ ARCH_CACHE_L2_CACHE_SIZE

#define ARCH_CACHE_L2_CACHE_SIZE   0

Function Documentation

◆ arch_dcache_alloc_line()

static void arch_dcache_alloc_line ( void * src)
inlinestatic

◆ arch_dcache_alloc_line_with_value()

static void arch_dcache_alloc_line_with_value ( void * src,
uintptr_t value )
inlinestatic

◆ arch_dcache_inval_line()

static void arch_dcache_inval_line ( void * src)
inlinestatic

◆ arch_dcache_inval_range()

static void arch_dcache_inval_range ( uintptr_t start,
size_t count )
inlinestatic

References arch_dcache_inval_line(), end, and start().

Referenced by dcache_inval_range().

◆ arch_dcache_pref_line()

static void arch_dcache_pref_line ( const void * src)
inlinestatic

Referenced by dcache_pref_line().

◆ arch_dcache_purge_all()

static void arch_dcache_purge_all ( void )
inlinestatic

◆ arch_dcache_purge_line()

static void arch_dcache_purge_line ( void * src)
inlinestatic

◆ arch_dcache_purge_range()

static void arch_dcache_purge_range ( uintptr_t start,
size_t count )
inlinestatic

◆ arch_dcache_wback_all()

static void arch_dcache_wback_all ( void )
inlinestatic

References BIT.

Referenced by arch_dcache_wback_range(), and dcache_wback_all().

◆ arch_dcache_wback_line()

static void arch_dcache_wback_line ( void * src)
inlinestatic

◆ arch_dcache_wback_range()

static void arch_dcache_wback_range ( uintptr_t start,
size_t count )
inlinestatic

◆ arch_dcache_zero_alloc_line()

static void arch_dcache_zero_alloc_line ( void * src)
inlinestatic

◆ arch_icache_inval_range()

void arch_icache_inval_range ( uintptr_t start,
size_t count )

Referenced by icache_inval_range().

◆ arch_icache_sync_range()

void arch_icache_sync_range ( uintptr_t start,
size_t count )

Referenced by icache_sync_range().

◆ dcache_wback_sq()

static __always_inline void dcache_wback_sq ( void * src)
static