- 论坛徽章:
- 0
|
用户修改代码段之后,需要Flush Dcache、Invalidate Icache。
VxWorks下可以通过cacheTextUpdate来实现,Linux+MIPS下可以通过系统调用_sys_sysmips完成同样的工作:
/* 通过宏_syscall4,定义了函数sysmips */
_syscall4(int, sysmips, int, cmd, long, arg1, int, arg2, int, arg3);
……..
#if ( VOS_HARDWARE_PLATFORM == VOS_MIPS )
/*
打补丁需要(1)Flush DCache;(2)Invalidate ICache. 这个系统调用同时完成两者。
当前Linux内核版本(2.6.14~2.6.27)中,该系统调用sysmips不是对外的;后续Linux可能对外提供cachectl,替换即可。
*/
sysmips(3/*FLUSH_CACHE*/, 0, 0, 0);
/* #define FLUSH_CACHE 3 */ /* writeback and invalidate caches */ /*inlude/asm/sysmips.h*/
#endif
……..
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/104271/showart_2105076.html |
|