Documentation/sh/register-banks.txt

Chinese translated version of Documentation/sh/register-banks.txt


If you have any comment or update to the content, please contact the
original document maintainer directly.  However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help.  Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.


Chinese maintainer:朱伟婧  <313997199@qq.com>
---------------------------------------------------------------------
Documentation/sh/register-banks.txt的中文翻译


如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。


中文版维护者: 朱伟婧  <313997199@qq.com>
中文版翻译者: 朱伟婧  <313997199@qq.com>
中文版校译者: 朱伟婧  <313997199@qq.com>


以下为正文

 Notes on register bank usage in the kernel
 ==========================================
在内核中注册存取使用说明
Introduction
------------
介绍

The SH-3 and SH-4 CPU families traditionally include a single partial register
bank (selected by SR.RB, only r0 ... r7 are banked), whereas other families
may have more full-featured banking or simply no such capabilities at all.

SH-3和sh-4 CPU传统上包括一个单一的部分寄存器存取(选择sr.rb,只有R0…R7是库存),
而其它可能更多的是全功能存取或根本没有这样的能力。
SR.RB banking
-------------

In the case of this type of banking, banked registers are mapped directly to
r0 ... r7 if SR.RB is set to the bank we are interested in, otherwise ldc/stc
can still be used to reference the banked registers (as r0_bank ... r7_bank)
when in the context of another bank. The developer must keep the SR.RB value
in mind when writing code that utilizes these banked registers, for obvious
reasons. Userspace is also not able to poke at the bank1 values, so these can
be used rather effectively as scratch registers by the kernel.

在这类存取为例,寄存器直接映射到r0 ... r7 如果SR.RB 将存取,
否则在另一个存取的背景下LDC / STC仍然可以用来参考寄存器(如r0_bank…r7_bank)。
开发人员在利用这些寄存器编写代码的时候必须保持SR.RB的价值。
用户也不能找bank1值,所以可以使用来自内核的有效的临时寄存器。

Presently the kernel uses several of these registers.

 - r0_bank, r1_bank (referenced as k0 and k1, used for scratch
   registers when doing exception handling).
 - r2_bank (used to track the EXPEVT/INTEVT code)
  - Used by do_IRQ() and friends for doing irq mapping based off
    of the interrupt exception vector jump table offset
 - r6_bank (global interrupt mask)
  - The SR.IMASK interrupt handler makes use of this to set the
    interrupt priority level (used by local_irq_enable())
 - r7_bank (current)

目前最主要的是使用这些寄存器。
r0_bank,r1_bank(引用为K0、K1,用于临时寄存器进行异常处理时)
r2_bank(用于跟踪 EXPEVT/INTEVT代码)
  用do_irq()和IRQ映射基于中断异常向量跳转表的偏移量
r6_bank(全局中断屏蔽)
  SR.IMASK中断处理程序使用这个设置中断优先级(用local_irq_enable())
r7_bank

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值