[問題] 中斷服務程式

看板C_and_CPP (C/C++)作者 (魏斯通)時間11年前 (2015/02/02 22:30), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/1
開發平台(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): 希望有強者能幫忙 感謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.235.192.164 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1422887419.A.C47.html

02/04 22:22, , 1F
Q_Q
02/04 22:22, 1F

02/06 00:38, , 2F
如果是 share irq, 只能在 fops->open 裡呼叫
02/06 00:38, 2F

02/06 00:38, , 3F
request_irq()
02/06 00:38, 3F
文章代碼(AID): #1Kpudxn7 (C_and_CPP)
文章代碼(AID): #1Kpudxn7 (C_and_CPP)