- 论坛徽章:
- 0
|
本帖最后由 shiwenjia_xq 于 2010-04-05 17:03 编辑
我最近也遇到这样的问题,但是我的BIOS里并口是打开的呀,也是指向(378/IRQ7),在加载模块之前我把系统原先所注册的7号中断处理例程parport卸载了呀!可是我加载这个模块后系统就死掉了。用dmesg查看后发现内核的打印信息如下:
I-pipe: Domain My_Domain registered.
...........
ACK :255
ACK :255
......
.......
ACK :255
BUG:soft lockup -CPU#1 stuck for 11s! [insmod:3708]
Pid: 3708,comm:insmod Not tainted
我的程序代码如下:
#include <linux/version.h>
#include <linux/module.h>
#include <asm/io.h>
#include <linux/ipipe.h>
#include <linux/time.h>
#define BASEPORT 0x378
#define PAR_INT 7
static struct ipipe_domain this_domain;
int counter = 0;
void handler(unsigned irq)
{
printk(">>> PARALLEL PORT INT HANDLED: counter=%d\n", counter);
counter++;
ipipe_control_irq(PAR_INT,0,IPIPE_ENABLE_MASK);
ipipe_propagate_irq(PAR_INT);
}
void domain_entry (void)
{
int a,k;
printk("Domain %s has start!\n",ipipe_current_domain->name);
ipipe_virtualize_irq(ipipe_current_domain,PAR_INT,(ipipe_irq_handler_t)&handler,NULL,NULL,IPIPE_DYNAMIC_MASK);
printk("handler has registered!\n");
printk("Set interrupt mode of this irq\n") ;
//set port to interrupt mode; pins are output
outb_p(0x10, BASEPORT + 2);
ipipe_control_irq(PAR_INT,0,IPIPE_ENABLE_MASK);
k = 10;
while(k--)
{
outb_p(0x00,BASEPORT);
a = inb(BASEPORT);
printk("ACK : %d\n",a);
// udelay(5);
outb_p(0xff,BASEPORT);
a = inb(BASEPORT);
printk("ACK : %d\n",a);
}
for( ;; )
ipipe_suspend_domain();
}
static int __init mod_init (void)
{
struct ipipe_domain_attr attr;
ipipe_init_attr (&attr);
attr.name = "My_Domain";
attr.priority = IPIPE_ROOT_PRIO + 1;
attr.entry = &domain_entry;
return ipipe_register_domain(&this_domain,&attr);
}
static void __exit mod_exit (void)
{
ipipe_unregister_domain(&this_domain);
}
module_init(mod_init);
module_exit(mod_exit);
MODULE_LICENSE("GPL") ;
请大家帮帮忙,帮我分析一下问题出在哪? |
|