[問題] 中斷服務程式

作者: westron (魏斯通)   2015-02-02 22:30:16
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Linux
kernel version 2.6
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
NO
問題(Question):
如何啟動 interrupt
餵入的資料(Input):
static irqreturn_t interrupt_fn(int irq, void* dev_id)
{
printk("Hello\n");
}
QQ = request_irq(unsigned int irq, interrupt_fn, IRQF_SHARD, \
"Apple", interrupt_fn);
irq = 0b (mouse interrupt 的位置)
QQ = 0
預期的正確結果(Expected Output):
當觸發中斷時
可以在 kernel下使用 dmesg 看到 Hello
錯誤結果(Wrong Output):
當中斷產生
使用dmesg 看不到 Hello
程式碼(Code):(請善用置底文網頁, 記得排版)
如上
補充說明(Supplement):
希望有強者能幫忙
感謝
作者: kingofsdtw (不能閒下來!!)   2015-02-04 22:22:00
Q_Q
作者: lf5471 (lf)   2015-02-06 00:38:00
如果是 share irq, 只能在 fops->open 裡呼叫request_irq()

Links booklink

Contact Us: admin [ a t ] ucptt.com