为什么u-boot的可以把全局数据的地址到R9寄存器? [英] Why u-boot can put global data's address into r9 register?

查看:890
本文介绍了为什么u-boot的可以把全局数据的地址到R9寄存器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我通过U-Boot的源$ C ​​$ C一看,我发现,它通过R9这样注册

When i look through u-boot source code, i found that it pass global data through r9 register like this

register volatile gd_t *gd asm ("r9")

所以,我很好奇,怎样的u-boot确保进一步codeS不会使用R9寄存器和腐败的全局数据。是否有一个选项来告诉编译器不使用特定的寄存器?

So, i'm curious, how does u-boot ensure further codes won't use r9 register and corrupt the global data. Is there an options to tell compiler not to use specific register?

推荐答案

从的过程调用标准ARM体系结构

寄存器R9的作用是平台特定的。虚拟平台可以指定任何角色到该寄存器且必须证明这种用法。例如,它可能在一个位置无关的数据模型指定为静态的碱(SB),或者它可以指定为与线程本地存储的环境线程寄存器(TR)。该寄存器的使用可能需要保持的数值在所有通话持续。一个虚拟的平台,已经不需要这样一个特殊的寄存器可以指定R9作为附加被调用方保存变量寄存器,V6。

The role of register r9 is platform specific. A virtual platform may assign any role to this register and must document this usage. For example, it may designate it as the static base (SB) in a position-independent data model, or it may designate it as the thread register (TR) in an environment with thread-local storage. The usage of this register may require that the value held is persistent across all calls. A virtual platform that has no need for such a special register may designate r9 as an additional callee-saved variable register, v6.

GCC没有一个ABI轮廓预留 R9 为平台使用的这样的方式的u-boot这是否是-ffixed-R9选项

这篇关于为什么u-boot的可以把全局数据的地址到R9寄存器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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