ARM MPCore -- (2)

1. NOP

    NOP不一定会占用CPU执行时间,可能在执行该指令前,CPU已将其从管道中移除。

    可以用NOP进行填充,使后续指令处于64bit边界上。

2. SEV

    向所有CPU Core发送事件信息。

 

3. WFE (Wait For Event)

    如果未设置事件寄存器,则 WFE 会暂时中断挂起执行,直至发生任一以下事件后再恢复执行:
    (1)发生 IRQ 中断,除非被 CPSR I 位屏蔽
    (2)发生 FIQ 中断,除非被 CPSR F 位屏蔽
    (3)发生不精确的数据中止,除非被 CPSR A 位屏蔽
    (4)出现调试进入请求(需启用调试)
    (5)另一个处理器利用 SEV 指令向事件发送信号
    ----------------------------
    如果设置了事件寄存器,则 WFE 会清除该设置,然后立即返回
    如果实现了 WFE,则还必须实现 SEV。

 

4. WFI (Wait For Interrupt)

    WFI 会暂时将执行中断挂起,直至发生以下事件后再恢复执行:
    (1)发生 IRQ 中断,不考虑 CPSR I 位
    (2)发生 FIQ 中断,不考虑 CPSR F 位
    (3)发生不精确的数据中止,除非被 CPSR A 位屏蔽
    (4)出现调试进入请求,无论是否启用调试


5. SEV/WFE用处

  SEV/WFE are not intended for synchronisation - but for power management. Because of the way WFE is defined, there is no guarantee that the CPU1 will only awake when CPU0 executes SEV. It could wake at time for any number of reasons. Usually examples show SEV/WFE as a form of simple power management in a spin-lock. Something like:

lock_spin_lock (assume addr in r0)
LDREX r1, [r0]
CMP r1, #UNLOCKED
WFENE ; If not unlocked go to sleep
BNE lock_spin_lock ; on waking, re-check the spin-lock
...

It's the spin-lcok that provides the synchronisation, not the WFE. The WFE just is a way of saving power while you wait for the resource to become free

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值