ARM - 域访问控制寄存器 [英] ARM - Domain Access Control Register

查看:442
本文介绍了ARM - 域访问控制寄存器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在想,为什么我们总是要禁用位于协处理器寄存器CP15 C3在域访问控制寄存器所有域。这通常是在启动code。通过做一些类似下面,使用的 MCR 指令。

I wonder, why do we always have to disable all domains in Domain Access Control Register located in coprocessor register cp15 c3. This is usually done in startup code by something like below, using MCR instruction.

MVN   r1, #0
MCR   p15, 0, r1, c3, c0, 0

为什么我们都是零加载到C3禁用所有的

推荐答案

您肯定不会在域访问控制寄存器来禁用域。事实上,它甚至没有可能的,因为域的访问始终检查,如果MMU被启用。你真正通过加载值做DACR是域名设置访问权限。 您发布的页面一个链接到DACS确切地描述意位。一般来说:

You certainly do not have to disable domains in Domain Access Control Register. Actually, it is not even possible since domain access is always checked if MMU is enabled. What you really do by loading values to DACR is setting access permissions for domains. The page you posted a link to describes exactly meaning of bits in DACS. In general:


  • 00 - 在所有
  • 进不去
  • 01 - 访问的TLB项检查agains值

  • 11 - 访问始终允许

  • 00 - no access at all
  • 01 - access checked agains values in TLB entry
  • 11 - access always permitted

这意味着书面方式向0xFFFFFFFF的轮流DACR内存保护关。这正是您发布的code一样。通知指令 MVN ,它比 MOV 不同的东西。 MVN<路>中<室> 是不移动指令,它写的补充<室> <道及GT; 。后 R1 MVN R1,#0 的值等于0xFFFFFFFF的。

That means writting 0xFFFFFFFF to DACR turns memory protection off. That is exactly what the code you posted does. Notice instruction mvn, it is something different than mov. mvn <Rd>, <Rm> is "Move NOT" instruction, it writes complement of <Rm> to <Rd>. After mvn r1, #0 value of r1 equals 0xFFFFFFFF.

启动code你遇到可能并不需要内存保护或暂时只有关闭之稍后启用它。然而,没有任何一种规则,你应该总是能够完全访问所有的域。

The startup code you came across probably does not need memory protection or switches it off temporarily only to enable it later. Nevertheless, it is not any kind of rule that you should always enable full access to all domains.

这篇关于ARM - 域访问控制寄存器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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