中断函数中不能调用ioremap()!!!!!!!
2012-12-26 16:11
204 查看
在开发板上实验,《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语句移到初始化函数里,就正确了。
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语句移到初始化函数里,就正确了。
相关文章推荐
- nRF51822 的GPIOTE的中断处理函数中不能直接调用softdevice的功能,需要用app_scheduler
- SYD8801 UART使用说明【uart轮发数据代码实现】【 uart中断发数据代码实现】【RFSleep函数对串口的影响】【中断中调用串口打印函数有可能会造成死机】
- 为什么C++静态成员函数不能访问非静态成员变量、不能调用非静态成员函数?(面试常考)
- static成员函数不能调用non-static成员函数
- 不理解为什么调用一级指针作函数参数时候,就不能把myp1 = NULL,
- 中断处理程序、中断上下文中处理延时及一些函数的调用规则(调IIC中断驱动有感)
- [转]为什么在DllMain里不能调用LoadLibrary和FreeLibrary函数?
- 第四周程序三---为什么后面的函数不能调用????????
- INIT_DELAYED_WORK 定时器中断函数的调用
- 中断中处理延时及一些函数的调用规则(中断调i2c驱动有感)--中断中的延迟delay与printk函数的冲突
- 中断处理程序、中断上下文中处理延时及一些函数的调用规则
- 一种 Visual Studio 不能单步调试(函数调用)问题
- 函数赋值给变量后,自身不能再调用
- 线程对象不能多次调用start函数开辟线程
- 在UC脚本中不能调用AS3.0中定义的函数的方法
- 中断处理程序、中断上下文中处理延时及一些函数的调用规则(调IIC中断驱动有感)
- 进程切换&&中断&&异常&系统调用execve()函数
- 调试程序时在不中断程序的情况下输出函数调用信息(Mac OS,Linux & Windows)
- 写一个dup2功能同样的函数,不能调用 fcntl 函数,而且要有出错处理
- 绝不能在构造函数与析构函数中调用virtual 函数