新聞中心

ARM MPCore -- (2)

作者: 時間:2016-11-10 來源:網(wǎng)絡 收藏
1. NOP

NOP不一定會占用CPU執(zhí)行時間,可能在執(zhí)行該指令前,CPU已將其從管道中移除。

本文引用地址:http://butianyuan.cn/article/201611/317204.htm

可以用NOP進行填充,使后續(xù)指令處于64bit邊界上。

2. SEV

向所有CPU Core發(fā)送事件信息。

3. WFE (Wait For Event)

如果未設置事件寄存器,則 WFE 會暫時中斷掛起執(zhí)行,直至發(fā)生任一以下事件后再恢復執(zhí)行:
(1)發(fā)生 IRQ 中斷,除非被 CPSR I 位屏蔽
(2)發(fā)生 FIQ 中斷,除非被 CPSR F 位屏蔽
(3)發(fā)生不精確的數(shù)據(jù)中止,除非被 CPSR A 位屏蔽
(4)出現(xiàn)調(diào)試進入請求(需啟用調(diào)試)
(5)另一個處理器利用 SEV 指令向事件發(fā)送信號
----------------------------
如果設置了事件寄存器,則 WFE 會清除該設置,然后立即返回。
如果實現(xiàn)了 WFE,則還必須實現(xiàn) SEV。

4. WFI (Wait For Interrupt)

WFI 會暫時將執(zhí)行中斷掛起,直至發(fā)生以下事件后再恢復執(zhí)行:
(1)發(fā)生 IRQ 中斷,不考慮 CPSR I 位
(2)發(fā)生 FIQ 中斷,不考慮 CPSR F 位
(3)發(fā)生不精確的數(shù)據(jù)中止,除非被 CPSR A 位屏蔽
(4)出現(xiàn)調(diào)試進入請求,無論是否啟用調(diào)試


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
...

Its 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



關(guān)鍵詞: ARMMPCor

評論


技術(shù)專區(qū)

關(guān)閉