将PC带入Xtensa(LX6)内核的另一个寄存器
我正在尝试将当前的PC值纳入为Xtensa(LX6)内核编写的装配程序。挖掘指令集文档后,我看不到如何实现这一目标。看来PC没有映射到16 AR中,我看不到它可以通过RSR指令甚至RER指令列出我可以访问的寄存器。
有建议吗?
I'm trying to get the current PC value into an assembly routine written for xtensa (lx6) cores. After digging into the instruction set doc, I cannot see really how to achieve this. It looks as if the PC is not mapped into the 16 AR, and I cannot see it listed into the registers I can access through the RSR instruction, or even the RER instruction.
Any advice ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下宏是一种可移植(Xtensa核心配置之间),用于加载标签的完整32位运行时地址
label
到寄存器ar
:no--转换
围绕呼叫的阻挡,以下标签可确保它们之间没有插入字面的池或跳跃蹦床。当宏与
ar
使用a0
以外,它将保留当前a0
值在临时寄存器 at 中。当ar
是a0
时, at 不使用 不使用,可能会省略。The following macro is a portable (between xtensa core configurations) way to load full 32-bit runtime address of the label
label
into the registerar
:The
no-transform
block around the call and the following label ensures that no literal pool or jump trampoline is inserted between them.When the macro is used with
ar
other thana0
it preserves the currenta0
value in the temporary registerat
. Whenar
isa0
the argumentat
is not used and may be omitted.这是一种做到这一点的方法:
Here is a way to do this :