2007年7月15日 星期日

WinCE Interrupt (中斷)

關於中斷的相關名詞解釋: (參照書本及網路資源)
1.何謂IRQ:
IRQ即所謂的中斷請求(Interrupt Request) ,是指硬體裝置發給CPU的訊號,要求CPU暫時先放下目前正在處理的工作,將工作的優先權暫時先讓給此發送訊號的硬體裝置,如Touch panel, keyboard, audio的I/O處理... 等等相關硬體裝置,都是透過IRQ來對CPU發出中斷請求。

2.何謂ISR:
ISR即所謂的中斷服務常式(Interrupt Service Routine),指用來回應硬體裝置發出IRQ的軟體常式,屬於OAL層,主要的工作為判斷硬體發生中斷的原因,並回傳一特定的Interrupt ID(SYSINTR)給Kernel,Kernel則會喚醒IST對中斷做進ㄧ步的處理。

3.何謂Interrupt ID:
Interrupt ID即所謂邏輯中斷識別碼(Interrupt Identifier),每個都是獨一無二的值,代表著某個硬體裝置發出的邏輯中斷要求。藉由Interrupt ID,kernel可以表示是否該處理可以完成,或是需要IST (Interrupt Service Threads)進ㄧ步處理該中斷請求。

4.何謂IST:

•Created by a device driver
•IST is a thread that does most of the interrupt processing
•IST performs necessary I/O operations in the device to collect the data and process it
•IST must associate an event object with an interrupt identifier by InterruptInitialize
•IST can boost themselves to a higher priority by calling CeSetThreadPriority


interrupt step flow: