Linux generic IRQ handling

本文档详细介绍了 Linux 中的通用中断请求 (IRQ) 处理机制,包括其设计原理、抽象层、关键数据结构及提供的公共和内部函数等。作者 Thomas Gleixner 和 Ingo Molnar 对该文档进行了维护,并提供了丰富的细节来帮助理解 Linux 中 IRQ 的工作流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Linux generic IRQ handling

Thomas Gleixner


      
     

Ingo Molnar


      
     

This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

For more details see the file COPYING in the source distribution of Linux.


Table of Contents

1. Introduction 2. Rationale 3. Known Bugs And Assumptions 4. Abstraction layers
Interrupt control flow Highlevel Driver API Highlevel IRQ flow handlers
Default flow implementations Default flow handler implementations Quirks and optimizations Delayed interrupt disable
Chiplevel hardware encapsulation
5. __do_IRQ entry point 6. Locking on SMP 7. Structures
struct irq_data — per irq and irq chip data passed down to chip functions struct irq_chip — hardware interrupt chip descriptor struct irq_chip_regs — register offsets for struct irq_gci struct irq_chip_type — Generic interrupt chip instance for a flow type struct irq_chip_generic — Generic irq chip data structure enum irq_gc_flags — Initialization flags for generic irq chips struct irqaction — per interrupt action descriptor struct irq_affinity_notify — context for notification of IRQ affinity changes
8. Public Functions Provided
synchronize_irq — wait for pending IRQ handlers (on other CPUs) irq_set_affinity_notifier — control notification of IRQ affinity changes disable_irq_nosync — disable an irq without waiting disable_irq — disable an irq and wait for completion enable_irq — enable handling of an irq irq_set_irq_wake — control irq power management wakeup setup_irq — setup an interrupt remove_irq — free an interrupt free_irq — free an interrupt allocated with request_irq request_threaded_irq — allocate an interrupt line request_any_context_irq — allocate an interrupt line irq_set_chip — set the irq chip for an irq irq_set_irq_type — set the irq trigger type for an irq irq_set_handler_data — set irq handler data for an irq irq_set_chip_data — set irq chip data for an irq handle_simple_irq — Simple and software-decoded IRQs. handle_level_irq — Level type irq handler
9. Internal Functions Provided
irq_reserve_irqs — mark irqs allocated irq_get_next_irq — get next allocated irq number dynamic_irq_cleanup — cleanup a dynamically allocated irq handle_bad_irq — handle spurious and unhandled irqs irq_set_msi_desc — set MSI descriptor data for an irq handle_fasteoi_irq — irq handler for transparent controllers handle_edge_irq — edge type IRQ handler handle_edge_eoi_irq — edge eoi type IRQ handler handle_percpu_irq — Per CPU local irq handler irq_cpu_online — Invoke all irq_cpu_online functions. irq_cpu_offline — Invoke all irq_cpu_offline functions.
10. Credits

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值