#define CACHE_R5900_SIZE_I 16384
#define CACHE_R5900_SIZE_D 8192
#define CACHE_R5900_LSIZE_I 64
#define CACHE_R5900_LSIZE_D 64
#define CACHEOP_R5900_IINV_I 0x07
#define CACHEOP_R5900_HINV_I 0x0b
#define CACHEOP_R5900_IWBINV_D 0x14
#define CACHEOP_R5900_ILTG_D 0x10
#define CACHEOP_R5900_ISTG_D 0x12
#define CACHEOP_R5900_IINV_D 0x16
#define CACHEOP_R5900_HINV_D 0x1a
#define CACHEOP_R5900_HWBINV_D 0x18
#define CACHEOP_R5900_ILDT_D 0x11
#define CACHEOP_R5900_ISDT_D 0x13
#define CACHEOP_R5900_HWB_D 0x1c
#if !defined(_LOCORE)
#define cache_op_r5900_line_64(va, op) \
do { \
__asm volatile( \
".set noreorder \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
"cache %1, 0(%0) \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
".set reorder" \
: \
: "r" (va), "i" (op) \
: "memory"); \
} while (0)
#define cache_r5900_op_4lines_64(va, op) \
do { \
__asm volatile( \
".set noreorder \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
"cache %1, 0(%0) \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
"cache %1, 64(%0) \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
"cache %1, 128(%0) \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
"cache %1, 192(%0) \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
".set reorder" \
: \
: "r" (va), "i" (op) \
: "memory"); \
} while (0)
#define cache_r5900_op_4lines_64_2way(va, op) \
do { \
__asm volatile( \
".set noreorder \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
"cache %1, 0(%0) \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
"cache %1, 1(%0) \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
"cache %1, 64(%0) \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
"cache %1, 65(%0) \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
"cache %1, 128(%0) \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
"cache %1, 129(%0) \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
"cache %1, 192(%0) \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
"cache %1, 193(%0) \n\t" \
"sync.l \n\t" \
"sync.p \n\t" \
".set reorder" \
: \
: "r" (va), "i" (op) \
: "memory"); \
} while (0)
void r5900_icache_sync_all_64(void);
void r5900_icache_sync_range_64(register_t, vsize_t);
void r5900_icache_sync_range_index_64(vaddr_t, vsize_t);
void r5900_pdcache_wbinv_all_64(void);
void r5900_pdcache_wbinv_range_64(register_t, vsize_t);
void r5900_pdcache_wbinv_range_index_64(vaddr_t, vsize_t);
void r5900_pdcache_inv_range_64(register_t, vsize_t);
void r5900_pdcache_wb_range_64(register_t, vsize_t);
#endif