为什么内存区域被标记为非高速缓存? [英] Why would a region of memory be marked non-cached?

查看:231
本文介绍了为什么内存区域被标记为非高速缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在嵌入式应用程序中,我们有一个表格描述了目标板上有效的各种地址范围。该表用于设置MMU。

RAM地址范围标记为可​​缓存,但其他区域标记为不可缓存。为什么是这样?

In an embedded application, we have a table describing the various address ranges that are valid on out target board. This table is used to setup the MMU.
The RAM address range is marked as cacheable, but other regions are marked at not cacheable. Why is that?

推荐答案

如果同时由硬件和软件访问存储区域(EX:硬件配置寄存器或散点集合列表为DMA),该区域必须被定义为非缓存。对于实际的DMA,可以将内存缓冲区定义为缓存,在大多数情况下缓冲区缓存可用于允许应用程序级别快速访问该缓冲区。在将缓冲区传递到DMA或应用程序之前,驱动程序有责任清除/无效缓存。

If a memory region is accessed by both hardware and software simultaneously (EX: hardware configuration register or scatter gather list for DMA), this region must be defined as non-cached. For actual DMA, the memory buffer can be defined as cached, and in most cases it is advisable for the buffer to be cached to allow the application level speedy access to that buffer. It's the driver's responsibility to flush/invalidate cache before passing the buffer to DMA or the application.

这篇关于为什么内存区域被标记为非高速缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆