nios 使用地址中31bit来表示访问是否bypass cache
如果bit 31=0 表示不bypass cache,即使用cache里的数据
如果bit 31=1表示bypass cache,即直接使用mem中的数据
如alt_remap_uncached.c
- #ifdef NIOS2_MMU_PRESENT
-
/* Convert KERNEL region address to IO region address */
-
#define BYPASS_DCACHE_MASK (0x1 << 29)
-
#else
-
/* Set bit 31 of address to bypass D-cache */
-
#define BYPASS_DCACHE_MASK (0x1 << 31)
-
#endif
-
-
/*
-
* Convert a pointer to a block of cached memory, into a block of
-
* uncached memory.
-
*/
-
-
volatile void* alt_remap_uncached (void* ptr, alt_u32 len)
-
{
-
alt_dcache_flush (ptr, len);
-
return (volatile void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK);
-
}
阅读(2768) | 评论(0) | 转发(0) |