목차
1.Interrupt ?
2.Driver에서 interrupt 확인
3.Shared interrupt
4.Implement a handler
5.Handler 처리
6.Interrupt-driven I/O
2.Driver에서 interrupt 확인
3.Shared interrupt
4.Implement a handler
5.Handler 처리
6.Interrupt-driven I/O
본문내용
* Interrupt
Flag
SA_INTERRUPT
세트–fast interrupt handler,클리어–slow interrupt handler
SA_SHIRQ
디바이스 사이에 인터럽트 공유
SA_SAMPLE_RANDOM
디바이스가 임의의 시점에 인터럽트 발생
* Kernel-assisted probing
int count = 0;
do {
unsigned long mask;
mask = probe_irq_on();
outb_p(0x10,short_base+2); /* enable reporting */
outb_p(0x00,short_base); /* clear the bit */
outb_p(0xFF,short_base); /* set the bit: interrupt! */
outb_p(0x00,short_base+2); /* disable reporting */
udelay(5); /* give it some time */
short_irq = probe_irq_off(mask);
if (short_irq == 0) { /* none of them? */
printk(KERN_INFO `short: no irq reported by probe
`);
short_irq = -1;
}
} while (short_irq < 0 && count++ < 5);
if (short_irq < 0)
printk(`short: probe failed %i times, giving up
`, count);
* Shared interrupt
여러 디바이스가 interrupt line 공유
여러 드라이버가 같은 irq 번호 사용
request_irq 함수로 irq 번호를 할당
Flag 필드 : SA_SHIRQ 지정
dev_id 필드 : 드라이버의 고유 식별값
(인터럽트를 받을 드라이버 구별)
...
Flag
SA_INTERRUPT
세트–fast interrupt handler,클리어–slow interrupt handler
SA_SHIRQ
디바이스 사이에 인터럽트 공유
SA_SAMPLE_RANDOM
디바이스가 임의의 시점에 인터럽트 발생
* Kernel-assisted probing
int count = 0;
do {
unsigned long mask;
mask = probe_irq_on();
outb_p(0x10,short_base+2); /* enable reporting */
outb_p(0x00,short_base); /* clear the bit */
outb_p(0xFF,short_base); /* set the bit: interrupt! */
outb_p(0x00,short_base+2); /* disable reporting */
udelay(5); /* give it some time */
short_irq = probe_irq_off(mask);
if (short_irq == 0) { /* none of them? */
printk(KERN_INFO `short: no irq reported by probe
`);
short_irq = -1;
}
} while (short_irq < 0 && count++ < 5);
if (short_irq < 0)
printk(`short: probe failed %i times, giving up
`, count);
* Shared interrupt
여러 디바이스가 interrupt line 공유
여러 드라이버가 같은 irq 번호 사용
request_irq 함수로 irq 번호를 할당
Flag 필드 : SA_SHIRQ 지정
dev_id 필드 : 드라이버의 고유 식별값
(인터럽트를 받을 드라이버 구별)
...
소개글