ARM 中的 WFE 指令处理 [英] WFE instruction handling in ARM

查看:43
本文介绍了ARM 中的 WFE 指令处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WFE 指令如何工作?我读到的是它使处理器等待 IRQ/FIQ/event/....

How does a WFE instruction work ? What I have read is that it makes processor wait for an IRQ /FIQ/event/....

但是当您收到 IRQ 时会发生什么,irq_fault_handler 向量是否在收到中断或 WFE 执行后的指令时执行?

But what happens when you get an IRQ, does the irq_fault_handler vector executes on getting an interrupt or instruction subsequent to the WFE is executed ?

推荐答案

WFE 在概念上等同于

WFE is conceptually equivalent to

while (!event_has_occurred) /*do nothing*/;

除了它关闭 CPU 而不是运行一个紧密的循环.

except that it turns the CPU off instead of running a tight loop.

一些可以中断的事情WFE,不仅包括中断,还包括来自另一个 CPU(在多核处理器中)的显式唤醒事件.

Several things that can interrupt a WFE, including not only an interrupt but also an explicit wake up event from another CPU (in a multicore processor).

如果在 WFE 期间发生中断,通常的事情就会发生.处理器切换到 IRQ 或 FIQ 模式,跳转到 IRQ 或 FIQ 处理程序,WFE 指令的地址(加上通常的偏移量 8)放在 lr 中.

If an interrupt happens during WFE, the usual things happens. The processor switches to IRQ or FIQ mode, jumps to the IRQ or FIQ handler, and the address of the WFE instruction (plus the usual offset of 8) is placed in lr.

如果 CPU 被显式唤醒事件唤醒,则继续执行 WFE 之后的下一条指令.

If the CPU was waken up by an explicit wake up event, the execution proceeds with the next instruction after the WFE.

将 WFE 视为一个非常长的 NOP,它仅在发生某些外部事件时才完成.

Think of WFE as a very long NOP which only completes when some external event happens.

这篇关于ARM 中的 WFE 指令处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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