Deep analysis of interrupt processing process

Source: Internet
Author: User

1. Interrupt Concept

While the CPU is working, the process needs to interact with the peripherals, including "polling mode" and "Interrupt mode".

A, polling method: The CPU constantly query the status of the device. CPU utilization is low and is not suitable for multi-tasking systems.

B, Interrupt mode: The CPU tells the hardware to start a work, then went to do something else, when the hardware finished the work, send a signal to the CPU, tell the CPU it has completed the work.

2. Interrupt life cycle

Interrupt signal Generation (interrupt source)---> Interrupt signal Filtering (Interrupt Controller)---> Interrupt signal processing (CPU)

3. Interrupt Source

In the life cycle of an outage, the role of the interrupt source is responsible for generating the interrupt signal.

A, s3c2440 supports 60 interrupt sources.

, including some sub-interrupt sources, etc.

B, s3c6410

Supports 64 interrupt sources

Wait a minute

4. Interrupt filtering

2440 Filter Chart

Here the choice of serial port 0 sub-interrupt send tx0 as an example: when the tx0 sends the data, it will produce an interruption to SUBSRCPND, the SUBSRCPND register each bit corresponds to a sub-interrupt, corresponding interrupt generation, the corresponding position one. Through the Submask to filter, it is also each bit corresponding to a sub-interrupt, when the corresponding position one, then block the interrupt of the bit, if there is no shield, it will be srcpnd corresponding to the one, but also through the Mask register filter, each of its bits corresponds to an interrupt source (not the sub-interrupt source) The corresponding bit of the register is masked out. If there is no shield, it can be given to the processor to handle, but when the hand, there is a priority judgment; Because multiple interrupts can occur at the same time, each interrupt has a different priority, and the optimal interrupt is given to the processor for processing. Mode is used to set whether the interrupt is fast or normal;

When the signal is given to the CPU and processed by the CPU, there are two ways to interrupt the CPU: non-vector mode (2440), vector mode (6410/210).

For non-vector mode of 2440

Interrupt the program's total entry (the only entry)--Save the environment--judge the interrupt source by calling the interrupt handler that corresponds to the interrupt source--to restore the environment.

For interrupt handling of 6410/210

When the interrupt is generated, the CPU jumps directly to the user-set interrupt handler-Save the environment--and the device's interrupt handling--restores the environment.

Deep analysis of interrupt processing process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.