假设有一个端口映射的I/O设备,它在IRQ线路上任意生成中断。设备的挂起中断可以通过对特定寄存器的单个outb调用来清除。
此外,假设下面的中断处理程序通过request_irq分配给相关的IRQ行
irqreturn_t handler(int irq, void *data)
{
/* clear pending IRQ on device */
outb(0, CLEAR_IRQ_REGISTER_ADDR);
/* device may generate another IRQ at this point,
* but
我正在Intel Atom处理器上编写一个LinuxV3.2内核模块(x86_64,2核)。我想禁用一个特定的IRQ号,但是在Linux上这样做有困难。
我是双引导MS-DOS,通过直接与8259 PIC芯片通信,我可以很容易地禁用英特尔语法x86程序集中的中断:
CLI ; disable all interrupts
MOV DX, 0x21 ; set 8259 ioport address
IN AL, DX ; store current interrupt mask in AL
AND AL, 0xDF ; m
我读了一些相关的文章:
(1)罗伯特·洛夫:
You cannot sleep in an interrupt handler because interrupts do not have a backing
process context, and thus there is nothing to reschedule back into. In other
words, interrupt handlers are not associated with a task, so there is nothing to
"put to sleep" and (more i
这是我的C程序(在Linux中)的相关部分:
while (input != ' '){
write(serial_port, msg, sizeof(msg));
//1. here I would like to wait at least 100 us with the Tx line high
//2. followed by at least 8us with the Tx line low
//3. and then repeat the message
input = mygetch();
}
如您所见,每次通过串口发送msg后,我希望将Tx行设置为10