博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
中断函数中不能调用ioremap()!!!!!!!
阅读量:4058 次
发布时间:2019-05-25

本文共 1180 字,大约阅读时间需要 3 分钟。

  在开发板上实验,《ARM嵌入式Linux设备驱动实例开发》第二章按键的例子,每当按下键盘时,都会导致Oops错误。

retry start                                                                    
sleep                                                                          
into isr 18                                                                    
kernel BUG at mm/vmalloc.c:171!                                                
Unable to handle kernel NULL pointer dereference at virtual address 00000000   
pgd = c0004000                                                                 
[00000000] *pgd=00000000                                                       
Internal error: Oops: 817 [#1]                                                 
Modules linked in: button                                                      
CPU: 0    Not tainted  (2.6.22.1 #3)                                           
PC is at __bug+0x20/0x2c                                                       
LR is at 0xc030dafc                                                            
pc : [<c0031b54>]    lr : [<c030dafc>]    psr: 60000093                        
sp : c0303e18  ip : c030dafc  fp : c0303e24                                    
r10: e0000000  r9 : 41129200  r8 : 00000001                                    
r7 : 00000012  r6 : 00000001  r5 : 00056000  r4 : 00001000 
   错误原因:中断处理函数isr_button中,使用了ioremap。
   在网上找的一个帖子,老外的。
You're not allowed to call any type of blocking function from within
an interrupt handler.
ioremap is a potentially blocking function, so it cannot be called
from an interrupt handler.
Normally, you would do all of the memory mapping, memory allocation
stuff outside of the interrupt handler and the interrupt handler would
just copy stuff around.
Why do you think you need it from within the interrupt handler?
Perhaps you could describe what you're trying to do, and I can suggest
a "traditional" method of dealing with that situation.
  把中断函数里的ioremap语句移到初始化函数里,就正确了。

转载地址:http://ynzji.baihongyu.com/

你可能感兴趣的文章
java学习(3)类的四大特性1
查看>>
java学习(4)类的四大特性2之继承
查看>>
java学习(5)类的四大特性2之继承(方法重载)
查看>>
java学习(6)类的四大特性2之继承(方法覆盖)
查看>>
java学习(7)类的四大特性2之继承(抽象类)
查看>>
java学习(8)类的四大特性2之继承(接口)
查看>>
java学习(9)类的四大特性2之继承(final)
查看>>
java学习(10)数组
查看>>
java学习(11)位与进制
查看>>
java学习(12)集合(1)
查看>>
java学习(13)集合(2)
查看>>
java学习(14)集合(3)
查看>>
java学习(15)泛型
查看>>
java学习(16)异常处理
查看>>
java学习(17)图形用户界面(1)
查看>>
java学习(18)图形用户界面(2)
查看>>
java学习(19)图形用户界面(3)
查看>>
java学习(20)图形用户界面(4)
查看>>
java学习(21)事件处理机制(1)
查看>>
java学习(22)线程(1)
查看>>