kernel interrupt

Interrupts, also known as asynchronous interrupts, are triggered by hardware. Exceptions, also known as synchronous interrupts, are triggered by software.
An interrupt service routine (interrupt handler) is a function that handles interrupt responses. It is a C function that follows a specific prototype declaration. It runs in an interrupt context, also known as an atomic context. Code running in this context cannot be blocked. The interrupt service routine must run very fast, its most basic job is to tell the hardware that the interrupt it issued has been received, but it usually does a lot of other work. For this reason, the general interrupt service routine is divided into two halves, one half is the data recovery processing function, called the upper half, it only executes those codes that can be executed quickly, such as confirming to the hardware that the interrupt number has been received, etc., and the other Work is delayed until the second half to perform.
A few things to note about code executing in interrupt context: Code in
interrupt context cannot go to sleep.
Mutex cannot be used, only spinlocks can be used, and only when necessary.
Interrupt handlers cannot directly exchange data with user space.
The interrupt handler should end as soon as possible.
Interrupt handlers do not need to be reentrant because the same interrupt handler cannot run on multiple processors simultaneously.
An interrupt handler may be interrupted by a higher priority interrupt handler. To avoid this, the kernel can be asked to mark the interrupt handler as a fast interrupt handler (disable all interrupts on the local CPU), but carefully consider the impact on the system before taking this action.

http://blog.csdn.net/fuyajun01/article/details/7422249
http://blog.csdn.net/skyflying2012/article/details/7850674

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326644254&siteId=291194637