/* Flush the SrcBuffer before the DMA transfer, in case the Data Cache
* is enabled
*/
Xil_DCacheFlushRange((u32)TxPacket, MAX_PKT_LEN);
//确保从CACHE里面写回到MM里
/* Invalidate the DestBuffer before receiving the data, in case the
* Data Cache is enabled
*/
Xil_DCacheInvalidateRange((u32)RxPacket, MAX_PKT_LEN);
//此CACHE区域的数据作废,再次读数的话,直接从MEMORY读取。
其实就是牵扯MEMORY和CACHE的更细问题:
将CACHE数据更新到MEMORY,用Xil_DCacheFlushRange。
将MEMORY的数据更新到CACHE(当然不是说立即更新,是在后续的访问中需要的时候更新),用Xil_DCacheInvalidateRange。
看到这些文字的,有什么不明白的可以在后面的评论里面问我。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)