ARM银行登记册 [英] ARM Banked register

查看:189
本文介绍了ARM银行登记册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ARM中,有一个银行注册的概念.在阅读有关 Banked 的内容的许多问题及其答案和各种其他资源时,这里的意思是.然后我得到这个定义: 寄存器银行是指在同一地址提供寄存器的多个副本.并非所有寄存器都可以一次看到.

In ARM there is a concept of Banked Register. While reading many questions and their answer and various other resources about what is Banked mean here. Then I got this definition: Register banking refers to providing multiple copies of a register at the same address. Not all registers can be seen at once.

但是我的询问是如何创建寄存器的多个副本.因为我们的核心中只有一个寄存器文件.如果存在另一种模式,则它将获得存储区寄存器的新副本,该副本将不包含任何数据,也不会访问其他模式寄存器的数据. 那么如何创建此寄存器副本?

But my query here is that How multiple copies of registers are created. Because we have single register file in our core. And if there is another mode then it will get the new copy of the banked register that will not contain any data and not going to access the data of another mode register. Then how this copy of register is created?

推荐答案

寄存器银行业务是指在同一地址提供多个寄存器副本.并非所有寄存器都可以一次看到.

Register banking refers to providing multiple copies of a register at the same address. Not all registers can be seen at once.

这是一些正确的方法.但是,该寄存器没有传统地址".大多数arm指令或二进制编码"已注册为源或目标参数.基本寄存器有16个,因此在二进制指令中每个寄存器需要4位.典型的指令需要12位(32位中的一位)来描述三个寄存器(两个源和一个目的地).指令中的这些位是上面定义中的地址".

This is some what correct. However, the register does not have a 'traditional address'. The majority of the arm instructions or 'binary encodings' have register as source or destination arguments. There are sixteen base register so four bits are needed for each register in a binary instruction. A typical instruction takes 12 bits (out of 32bits) to describe the three registers (two source and one destination). These bits in the instruction are the 'address' in the definition above.

但是我的询问是如何创建寄存器的多个副本.因为我们的核心中只有一个寄存器文件.如果存在另一种模式,则它将获得存储区寄存器的新副本,该副本将不包含任何数据,也不会访问其他模式寄存器的数据.那么如何创建此寄存器副本?

But my query here is that How multiple copies of registers are created. Because we have single register file in our core. And if there is another mode then it will get the new copy of the banked register that will not contain any data and not going to access the data of another mode register. Then how this copy of register is created?

它们不是动态创建"的.存储的寄存器是核心寄存器文件"的一部分,并且始终存在.问题在于,除非发生模式切换",否则典型指令无法访问某些存储区寄存器.这可能是从用户到IRQ模式,或者是从普通到具有Trustzone的安全世界.

They are not 'created' dynamically. The banked registers are part of the 'register file' of the core and always exist. The issue is that the typical instructions can not access some banked registers unless a 'mode switch' occurs. This maybe from user to IRQ mode or from normal to secure world with trustzone.

因此,以不同的模式运行相同的代码可能最终会访问不同的(存储)寄存器.这样,用户代码就不会影响IRQ堆栈,反之亦然.也许更重要的是,如果在IRQ的开始和结束时未进行仔细的上下文保存,则IRQ代码可能会破坏未存储的用户寄存器.

So running the same code in different modes may end up accessing different (banked) registers. In this way, user code never affects the IRQ stack and vice-versa. Perhaps more importantly, the IRQ code could corrupt non-banked user registers if careful context saving is not performed at the start and end of an IRQ.

请参阅:访问ARM上的银行寄存器,以获取有关如何处理的信息访问这些不同的寄存器.

See: Accessing banked registers on ARM for information on how you might access these different registers.

较新的ARMv7指令mrs r2,sp_svc打破了该存储寄存器规则,并允许在不切换模式的情况下直接访问存储寄存器.目的是允许上下文切换代码无需模式切换即可轻松访问存储区寄存器以进行保存和恢复.

The newer ARMv7 instruction mrs r2,sp_svc breaks this banked register rule and allows access to the banked registers directly without switching a mode. the intent is to allow context switching code to easily access the banked registers for saving and restoring without a mode switch.

传统指令ldm rN, {sp,lr}^允许保存用户堆栈指针和链接寄存器,而无需切换模式.同样,它具有特殊的编码(或根据您的定义寻址).

The traditional instruction ldm rN, {sp,lr}^ allows saving of user stack pointer and link register without switching modes. Again, this has a special encoding (or addressing as per your definition).

银行业务也是通过trustzone中的CP15系统寄存器完成的. TrustZone监视模式和存储的IFSR ... 可能对任何看过ARM银行业务"的人都在概念上与注册银行业务相同.

Banking is also done with CP15 system registers in trustzone. TrustZone monitor mode and banked IFSR... maybe interesting for anyone looking at that ARM 'banking' which is conceptually the same as the register banking.

这篇关于ARM银行登记册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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