免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1343 | 回复: 0
打印 上一主题 下一主题

《ARM嵌入式Linux设备驱动实例开发》按键设备驱动程序Oops错误 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-08-24 22:09 |只看该作者 |倒序浏览
  在开发板上实验,《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 : []    lr : []    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语句移到初始化函数里,就正确了。
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/93262/showart_2036062.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP