I am new to Linux Kernel. I was reading about the Linux Kernel from "Linux Kernel Development , Robert Love 3rd Edition, chapter 7 Interrupts and Interrupts Handler". For registering a interrupt handler , Linux uses request_irq() function as :
int request_irq(
unsigned int irq ,
irq_handler_t handler,
unsigned long flags ,
const char *name,
void *dev)
Since i am a new guy for Linux Kernel , so i have some doubts regarding interrupts in Linux :
Q1 -> Are interrupt lines are software or hardware ?
Q2 -> "irq" , first argument passed to request_irq() , is it interrupt line number or interrupt number ?
Q3 -> If interrupt line is hardware then , is it the criteria to limit the number of different interrupts an OS can support , if it is not then how we limit the number of different interrupts an OS can support ?
One more help , when i was reading , i got struck at these lines :
"Note that request_irq() can sleep and therefore can not be called from interrupt context or other situations where code can not block . It is common mistake to call request_irq() when it is unsafe to sleep.This partly because of why request_irq() can block : It is indeed clear. (Page number : 117)"
I am unable to get the meaning of these lines , why request_irq() is not safe and how ? And i am also not able to understand what exactly the interrupt context means ?
For any kind of help , i will be grateful to you!
thank you!