irq_desc_t 構造体の status フィールドについて
#define IRQ_INPROGRESS 1 /* IRQ handler active - do not enter! */ #define IRQ_DISABLED 2 /* IRQ disabled - do not enter! */ #define IRQ_PENDING 4 /* IRQ pending - replay on enable */ #define IRQ_REPLAY 8 /* IRQ has been replayed but not acked yet */ #define IRQ_AUTODETECT 16 /* IRQ is being autodetected */ #define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ #define IRQ_LEVEL 64 /* IRQ level triggered */ #define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */ #define IRQ_PER_CPU 256 /* IRQ is per CPU */
詳解 Linux カーネルによると
- IRQ_INPROGRESS
- IRQ に対応した割り込みハンドラを実行している状態
- IRQ_DISALBED
- デバイスドライバが IRQ ラインを明示的に禁止している状態
- IRQ_PENDING
- ライン上に IRQ が発生しており、応答 (ACK) は PIC に返されているが、カーネルがまだ割り込みハンドラを実行していない状態。
- IRQ_REPLAY
- IRQ ラインは禁止されているが、以前発生した IRQ に対する応答 (ACK) をまだ PIC に返していない状態
- IRQ_AUTODETECT
- ハードウェア検出処理のため、カーネルが IRQ ラインを使用している状態
- IRQ_WAITING
- ハードウェアデバイス検出処理のため、カーネルが IRQ ラインを使用しており、対象のデバイスが割り込みを発生させる前の状態
詳解 Linux カーネルより引用
とある。わしが持っているのは 2.2 ベースなナニ (初版第一刷とある) なんで若干足んない。で、The Linux Kernel's Interrupt Controller API を見つけてきた。以下に引用。
IRQ_INPROGRESS | Interrupt is currently being handled. |
IRQ_DISABLED | Interrupt source is disabled. |
IRQ_PENDING | Interrupt needs handling. |
IRQ_REPLAY | Interrupt has been replayed but not acknowledged yet. This is a hack to deal with buggy interrupt controllers that drop requests in SMP settings. |
IRQ_AUTODETECT | Interrupt source is being probed. |
IRQ_WAITING | Probing.waiting for interrupt. |
IRQ_LEVEL | Interrupt source is level-triggered. |
IRQ_MASKED | Interrupt source is masked.and should not be active. |
IRQ_PER_CPU | Interrupt has been assingned to a particular CPU. Only used in SMP environments. |
The Linux Kernel's Interrupt Controller APIより引用
英訳しないといかん。とりあえず __do_IRQ()#kernel/irq/handle.c をざっくりナニな準備はできてるんで明日。
__do_IRQ() に出てこない定数もあるけど、出どころを調べるよりはざくざく追いかけた方がたぶん早いだろうな。