NVIDIA Interview Question
Though Jammulak's effort is appreciable, his explanation has some flaws. Even function can exercise enabling/disabling interrupts depending on the situation. Yes, it is true that ISRs have to re-enable interrupts. However, it's not essentially while we are returning; it could be just after copying contents from register to the kernel stack. The main difference between a function call and an ISR is that for a function call, the context doesn't change where as for an ISR it does.
ISR:
Asynchronous event that can occur any time during the execution of the program
Saves the PC, Flags and registers on the stack and disables all the interrupts and loads the address of the ISR
ISR cannot have arguments that can be passed to it
Cannot return values
Enables the interrupts
Generally small as they are taking the time of some other process
Some of ISR have have their own stack
Fucntion:
Occurs when ever there is a function call
Saves the PC and registers on the stack
Can have arguments
Can return values
No restriction on the size and duration of execution
function calls are done in the program
- raven November 05, 2009ISR are the special function that are excuted on particular interrupts..
it mit be s/w or h/w.
u can call function as F()
but isr cannot be involed like that its based on the signal(s/w / h/w)