Android CPU寄存器名称? [英] Android CPU register names?

查看:157
本文介绍了Android CPU寄存器名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码段摘自Samsung Tab S上的Android崩溃报告:

This code fragment is extracted from an Android crash report on a Samsung Tab S:

Build fingerprint: 'samsung/chagallwifixx/chagallwifi:5.0.2/LRX22G/T800XXU1BOCC:user/release-keys'
Revision: '7'
ABI: 'arm'
    r0 a0d840bc  r1 a0dcb880  r2 00000001  r3 a0d840bc
    r4 a0dc3c4c  r5 00000000  r6 a066d200  r7 00000000
    r8 32d68f40  r9 a0c359a8  sl 00000014  fp bef3ba84
    ip a0dc3fb8  sp bef3ba10  lr a0c35a0c  pc a0c34bc8  cpsr 400d0010

r0r9是通用寄存器,sp(r13)是堆栈指针,而pc(r15)是程序计数器(指令指针).参考维基百科的"ARM体系结构"页面寄存器"部分(很多之一>浏览的页面),我发现lr(r14)是链接寄存器,而cpsr是当前程序状态寄存器".

r0 through r9 are pretty clearly general purpose registers, sp (r13) is the stack pointer, and pc (r15) is the program counter (instruction pointer). Referring to the Wikipedia's ARM Architecture page Registers section (one of many pages I looked through), I find that lr (r14) is the link register, and cpsr is the "Current Program Status Register."

我想知道sl(r10),fp(r11)和ip(r12)是什么.我希望ip不是 指令指针",因为该功能由pc(r15)完成.

I would like to know what sl (r10), fp (r11) and ip (r12) are. I expect ip is not the "instruction pointer" because that function is done by pc (r15).

我没有找到参考文件来说明这些名称吗?

Is there a reference document I haven't found that illustrates these names?

推荐答案

当前 ARM EABI过程调用标准概述了r12-r15的标准特殊"名称:

The current ARM EABI procedure call standard outlines the standard 'special' names for r12-r15:

  • PC(r15):程序计数器
  • LR(r14):链接寄存器
  • SP(r13):堆栈指针
  • IP(r12):程序内暂存器 *
  • PC (r15): Program counter
  • LR (r14): Link register
  • SP (r13): Stack pointer
  • IP (r12): Intra-procedure scratch register*

GNU工具还仍然支持已弃用的旧版APCS 中的名称作为标识符对于给定的寄存器号,即使它们不再具有任何含义:

The GNU tools also still support names from the deprecated legacy APCS as identifiers for the given register numbers, even though they no longer necessarily have any meaning:

    FP(r11):帧指针-对于ARM代码可能仍然适用; Thumb代码倾向于将实际的帧指针保留在r7中,并且当然可以完全不使用帧指针来编译该代码,在这种情况下,"fp"只是另一个被调用者保存的通用寄存器.
  • SL(r10):堆栈限制-我实际上不知道那个的历史,但是在大多数现代代码中,r10并不比r4-r8特殊.
  • FP (r11): Frame pointer - may still be true for ARM code; Thumb code tends to keep actual frame pointers in r7, and of course the code may be compiled without frame pointers at all, in which cases "fp" is just another callee-saved general register.
  • SL (r10): Stack limit - I don't actually know the history of that one, but in most modern code r10 is no more special than r4-r8.

请注意,r9不一定是通用寄存器-EABI将其保留用于特定平台.在linux-gnueabi下没有什么特别的,但是其他平台可能会将它用于特殊目的,例如TLS或全局对象表指针,因此它也可以通过SB(静态基数)或TR(线程寄存器)使用.

Note that r9 is not necessarily a general-purpose register - the EABI reserves it for platform-specific purposes. Under linux-gnueabi it's nothing special, but other platforms may use it for special purposes like a TLS or global object table pointer, so it may also go by SB (static base) or TR (thread register).

*背后的故事是,相对于PC的分支指令的范围有限-如果链接器发现呼叫目标的距离超过32MB,则它可能会产生胶合板(某些额外的指令位于呼叫站点)作为分支目标,它计算实际地址并执行绝对分支,为此可能需要临时寄存器.

这篇关于Android CPU寄存器名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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