如何使 PowerPC PQ-III e500 上特定内存范围的 L1 数据缓存失效?
一个特殊的内存块将由 DMA 任务定期更新。当另一个Task频繁尝试在该块中查找数据时,就会出现关于L1数据缓存奇偶校验的MCE(Machine Check Exception)。 我可以完全或仅在 DMA 更新后使该内存块的 L1 数据缓存无效吗?
libogc 中有一个有趣的 API,例如:
void DCInvalidateRange(void *startaddress,u32 len);
.globl DCInvalidateRange
DCInvalidateRange:
cmplwi r4, 0 # zero or negative size?
blelr
clrlwi. r5, r3, 27 # check for lower bits set in address
beq 1f
addi r4, r4, 0x20
1:
addi r4, r4, 0x1f
srwi r4, r4, 5
mtctr r4
2:
dcbi r0, r3
addi r3, r3, 0x20
bdnz 2b
blr
I am notimit with ASM也不熟悉PowerPC上的ASM。人们会推荐有关此操作的链接或描述吗?
A special memory block would be periodically updated by DMA task. When another Task tried to look up data in this block frequently, there is MCE (Machine Check Exception) about L1 data cache parity check.
Can I invalidate the L1 Data Cache for this memory block totally or only after DMA update?
There is an interesting API in libogc like:
void DCInvalidateRange(void *startaddress,u32 len);
.globl DCInvalidateRange
DCInvalidateRange:
cmplwi r4, 0 # zero or negative size?
blelr
clrlwi. r5, r3, 27 # check for lower bits set in address
beq 1f
addi r4, r4, 0x20
1:
addi r4, r4, 0x1f
srwi r4, r4, 5
mtctr r4
2:
dcbi r0, r3
addi r3, r3, 0x20
bdnz 2b
blr
I am not familiar with ASM neither ASM on PowerPC. Would people recommend links or descriptions on this operation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是最好的资源,PowerPC 编程环境手册
有具体问题吗你有关于缓存的事吗?
使用 DMA,您的选择是监听或缓存刷新。要出现此错误,您可能启用了窥探。因此,问题很可能是 L1 缓存中有未初始化的数据。
还有第二个资源,E500 核心参考手册,我使用它目前无法下载,但应该很好地描述了如何初始化缓存。我一直使用E-600书。
Here is the best resource, the PowerPC Programming Environments Manual
Are there specific questions you have about the cache?
Working with DMA, your choices are snooping or cache flushing. To get this error, you probably have snooping enabled. So the problem is likely that you have data in L1 cache that is uninitialized.
There's a second resource, the E500 Core Reference Manual, which I couldn't download at the moment but which should give a good description of how to init the cache. I use the E-600 book all the time.