有谁知道如何启用 ARM FIQ?

发布于 2024-07-26 08:30:27 字数 24 浏览 3 评论 0原文

有谁知道如何启用 ARM FIQ?

Does anyone know how to enable ARM FIQ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

邮友 2024-08-02 08:30:27

除了在管理模式下启用或禁用 IRQ/FIQ 之外,您无需在 ARM 上进行任何特殊设置即可使用它,除非系统(运行 ARM 芯片的系统)已在硬件中禁用它(根据您的评论,情况并非如此,因为您看到 FIQ 输入引脚驱动正确)。

对于那些不知道缩写词的人来说,FIQ 只是列表中的最后一个中断向量,这意味着它不像其他中断那样仅限于分支指令。 这意味着它的执行速度比其他 IRQ 处理程序更快。

普通 IRQ 仅限于分支指令,因为它们必须确保其代码适合单个字。 FIQ,因为它不会覆盖任何其他 IRQ 向量,所以可以直接运行代码,无需分支指令(因此“快速”)。

FIQ 输入线只是外部元件将 ARM 芯片踢入 FIQ 模式并开始执行正确异常的一种方式。 除了 CPSR 之外,ARM 本身没有任何东西可以阻止这种情况的发生。

要在管理模式下启用 FIQ:

MRS r1, cpsr         ; get the cpsr.
BIC r1, r1, #0x40    ; enable FIQ (ORR to disable).
MSR cpsr_c, r1       ; copy it back, control field bit update.

对于普通 IRQ 可以执行类似的操作,但使用 #0x80 而不是 #0x40。

Other than enabling or disabling the IRQ/FIQ while you're in supervisor mode, there's no special setup you should have to do on the ARM to use it, unless the system (that the ARM chip is running in) has disabled it in hardware (based on your comment, this is not the case since you're seeing the FIQ input pin driven correctly).

For those unaware of the acronyms, FIQ is simply the last interrupt vector in the list which means it's not limited to a branch instruction as the other interrupts are. That means it can execute faster than the other IRQ handlers.

Normal IRQs are limited to a branch instruction since they have to ensure their code fits into a single word. FIQ, because it won't overwrite any other IRQ vectors, can just run the code directly without a branch instruction (hence the "fast").

The FIQ input line is just a way for external elements to kick the ARM chip into FIQ mode and start executing the correct exception. There's nothing on the ARM itself which prevents that from happening except the CPSR.

To enable FIQ in supervisor mode:

MRS r1, cpsr         ; get the cpsr.
BIC r1, r1, #0x40    ; enable FIQ (ORR to disable).
MSR cpsr_c, r1       ; copy it back, control field bit update.

A similar thing can be done for normal IRQs, but using #0x80 instead of #0x40.

牵你的手,一向走下去 2024-08-02 08:30:27

芯片制造商可以使用 trustzone 扩展向您关闭 FIQ。

Trustzone 创建一个安全的世界和一个正常的世界。 安全世界有自己的监管者、用户和内存空间。 这个想法是为了路由安全操作,这样它们就不会离开芯片,并且即使扫描总线上的引脚也无法被追踪。 我认为在 OMAP 中它用于一些加密操作。

重置时,核心以安全模式启动。 它设置安全监视器(安全和非安全世界之间的网关),此时可以将 FIQ 设置为路由到监视器。 我认为可能是设置了 SCR.FIQ 位,然后所有 FIQ 都会忽略 CPSR.F 的值并进入监视模式。 查看 ARM ARM,但如果我没记错的话,如果发生这种情况,您将无法从不安全的操作系统代码中得知。 然后监视器将重置正常世界寄存器并执行异常返回,并将 PC 设置为重置异常向量。

内核将进入监视模式中断,执行其操作并返回。

抱歉,我无法在评论中回答你,我没有足够的声誉,你总是可以解决这个问题;),但我希望你看到这个

The FIQ can be closed off to you by the chip manufacturer using trustzone extensions.

Trustzone creates a Secure world and a normal world. The secure world has its own supervisor, user and memory space. The idea is for secure operations to be routed so they never leave the chip and cannot be traced even if you scan the pins on the bus. I think in OMAP it is used for some cryptography operations.

On Reset the core starts in secure mode. It sets up the secure monitor (gateway between secure and non-secure world) and at this time FIQ can be setup to be routed to the monitor. I think it is the SCR.FIQ bit that may be set and then all FIQs ignore the value of CPSR.F and go to monitor mode. Check out the ARM ARM but if I remember correctly if this is happening there is no way for you to know from nonsecure OS code. Then the monitor will reset the Normal world registers and doing an exception return with PC set to the reset exception vector.

The core will take an interrupt to monitor mode, do its thing and return.

Sorry I can't answer you in the comments, I don't have enough reputation, you could always fix that ;), but I hope you see this

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文