set_cache.h
来自「ADI blackfin DSP的基于device friver的jpeg压缩算」· C头文件 代码 · 共 48 行
H
48 行
#ifndef SET_CACHE_H
#define SET_CACHE_H
#include <services/services.h> // system services include
// data cache utilities
// L1 Data Memory Control Register
inline void disable_data_cache(void)
{
*pDMEM_CONTROL &= ~0xA; //disable CPLB's, DMC in reserved mode
ssync();
}
inline void enable_data_cache(void)
{
*pDMEM_CONTROL |= 0xA; //enable CPLB's, Data Bank A is lower 16K byte SRAM, upper 16K byte cache, Data Bank B is SRAM
ssync();
}
// instruction cache utilities
// L1 Instruction Memory Control Register
inline void disable_instruction_cache(void)
{
*pIMEM_CONTROL &= ~0x4; // disable CPLB's, All cacheways locked
ssync();
}
inline void enable_instruction_cache(void)
{
*pIMEM_CONTROL |= 0x4; // enable CPLB's, Upper 16K byte of L1 instruction memory configured as cache
ssync();
}
#ifdef __cplusplus
extern "C" {
#endif
// Function declarations
void configure_data_cache_cplbs(int dcplb_table[16][2]);
void configure_instruction_cache_cplbs(int icplb_table[16][2]);
#ifdef __cplusplus
}
#endif
#endif //
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?