Freeing init memory: 140K
---------mount all------------
**************************************************
* MakeArm ARM *
* Kernel Vevsion:Linux-2.6.34 *
* Author:MakeArm-2010 *
* Date: 2010/07/19 *
**************************************************
Please press Enter to activate this console.
Processing /etc/profile... Done
[root@MakeArm=W]#insmod buttonk.ko
button create ok led init ok
[root@MakeArm=W]#./appbutton
request_irq = 06
IRQ = 57,c03eff24
IRQ = 57,c03eff24
IRQ = 55,c03eff24
IRQ = 55,c03eff24
IRQ = 52,c03eff24
IRQ = 52,c03eff24
IRQ = 59,c03eff24
IRQ = 59,c03eff24
IRQ = 58,c03eff24
IRQ = 58,c03eff24
IRQ = 63,c03eff24
IRQ = 63,c03eff24
IRQ = 58,c03eff24
IRQ = 58,c03eff24
IRQ = 58,c03eff24
IRQ = 58,c03eff24
^C------------[ cut here ]------------
WARNING: at kernel/irq/manage.c:890 __free_irq+0x80/0x15c()
Trying to free already-free IRQ 0
Modules linked in: buttonk
[<c0030628>] (unwind_backtrace+0x0/0xec) from [<c003dccc>] (warn_slowpath_common+0x44/0x5c)
[<c003dccc>] (warn_slowpath_common+0x44/0x5c) from [<c003dd1c>] (warn_slowpath_fmt+0x24/0x30)
[<c003dd1c>] (warn_slowpath_fmt+0x24/0x30) from [<c0064da4>] (__free_irq+0x80/0x15c)
[<c0064da4>] (__free_irq+0x80/0x15c) from [<c0064ebc>] (free_irq+0x3c/0x60)
[<c0064ebc>] (free_irq+0x3c/0x60) from [<bf000020>] (button_release+0x20/0x34 [buttonk])
[<bf000020>] (button_release+0x20/0x34 [buttonk]) from [<c0091f2c>] (__fput+0x100/0x1bc)
[<c0091f2c>] (__fput+0x100/0x1bc) from [<c008eff4>] (filp_close+0x74/0x80)
[<c008eff4>] (filp_close+0x74/0x80) from [<c003f8c8>] (put_files_struct+0x80/0xd0)
[<c003f8c8>] (put_files_struct+0x80/0xd0) from [<c0040de4>] (do_exit+0x180/0x590)
[<c0040de4>] (do_exit+0x180/0x590) from [<c004127c>] (do_group_exit+0x88/0xbc)
[<c004127c>] (do_group_exit+0x88/0xbc) from [<c004ae58>] (get_signal_to_deliver+0x2ec/0x324)
[<c004ae58>] (get_signal_to_deliver+0x2ec/0x324) from [<c002df60>] (do_notify_resume+0x70/0x604)
[<c002df60>] (do_notify_resume+0x70/0x604) from [<c002beac>] (work_pending+0x1c/0x20)
---[ end trace 4c35ab69e19697cc ]---
------------[ cut here ]------------
WARNING: at kernel/irq/manage.c:890 __free_irq+0x80/0x15c()
Trying to free already-free IRQ 0
Modules linked in: buttonk
[<c0030628>] (unwind_backtrace+0x0/0xec) from [<c003dccc>] (warn_slowpath_common+0x44/0x5c)
[<c003dccc>] (warn_slowpath_common+0x44/0x5c) from [<c003dd1c>] (warn_slowpath_fmt+0x24/0x30)
[<c003dd1c>] (warn_slowpath_fmt+0x24/0x30) from [<c0064da4>] (__free_irq+0x80/0x15c)
[<c0064da4>] (__free_irq+0x80/0x15c) from [<c0064ebc>] (free_irq+0x3c/0x60)
[<c0064ebc>] (free_irq+0x3c/0x60) from [<bf000020>] (button_release+0x20/0x34 [buttonk])
[<bf000020>] (button_release+0x20/0x34 [buttonk]) from [<c0091f2c>] (__fput+0x100/0x1bc)
[<c0091f2c>] (__fput+0x100/0x1bc) from [<c008eff4>] (filp_close+0x74/0x80)
[<c008eff4>] (filp_close+0x74/0x80) from [<c003f8c8>] (put_files_struct+0x80/0xd0)
[<c003f8c8>] (put_files_struct+0x80/0xd0) from [<c0040de4>] (do_exit+0x180/0x590)
[<c0040de4>] (do_exit+0x180/0x590) from [<c004127c>] (do_group_exit+0x88/0xbc)
[<c004127c>] (do_group_exit+0x88/0xbc) from [<c004ae58>] (get_signal_to_deliver+0x2ec/0x324)
[<c004ae58>] (get_signal_to_deliver+0x2ec/0x324) from [<c002df60>] (do_notify_resume+0x70/0x604)
[<c002df60>] (do_notify_resume+0x70/0x604) from [<c002beac>] (work_pending+0x1c/0x20)
---[ end trace 4c35ab69e19697cd ]---
------------[ cut here ]------------
程序如下:
static struct button_irq button_key[] = {
{IRQ_EINT19,IRQ_TYPE_EDGE_BOTH,"KEY1"},
{IRQ_EINT15,IRQ_TYPE_EDGE_BOTH,"KEY2"},
{IRQ_EINT14,IRQ_TYPE_EDGE_BOTH,"KEY3"},
{IRQ_EINT13,IRQ_TYPE_EDGE_BOTH,"KEY4"},
{IRQ_EINT11,IRQ_TYPE_EDGE_BOTH,"KEY5"},
{IRQ_EINT8 ,IRQ_TYPE_EDGE_BOTH,"KEY6"},
};
static volatile int irq_date[] = {0,0,0,0,0,0};
注册中断
for(i = 0;sizeof(button_key)/sizeof(button_key[0]);i++)
{
ret = request_irq(button_key[i].irq,key_irq_handler,button_kek[i].flagirq,button_key[i].name,(void *)&irq_date[i]);
}
释放中断
for(i = 0;sizeof(button_key)/sizeof(button_key[0]);i++)
{
free_irq(button_key[i].irq,(void *)&irq_date[i]);
} |