函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\irq\manage.c Create Date:2022-07-27 11:09:52
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:注册中断

函数原型:static int __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)

返回类型:int

参数:

类型参数名称
unsigned intirq
struct irq_desc *desc>request_mutex Provides serialization against a concurrent free_irq()
struct irqaction *new
1276  thread_mask等于0
1277  shared等于0
1279  如果非>request_mutex Provides serialization against a concurrent free_irq()则返回:负EINVAL
1282  如果中断控制器信息恒等于无中断控制器实例则返回:负ENOSYS
1284  如果非判断模块是否处于活动状态则返回:负ENODEV
1287  中断号等于irq
1293  如果非中断动作标志按位与IRQF_TRIGGER_MASK的值则中断动作标志或等于irqd_get_trigger_type( & irq_data)
1300  nested等于线程是嵌套中断类型
1301  如果nested
1302  如果非线程中断处理器
1303  ret等于负EINVAL
1304  转到:out_mput
1311  中断处理函数等于嵌套线程中断的主处理程序
1312  否则
1313  如果中断可以线程化
1314  ret等于中断线程化
1315  如果ret则转到:out_mput
1325  如果线程中断处理器且非nested
1326  ret等于setup_irq_thread(new, irq, false)
1327  如果ret则转到:out_mput
1329  如果secondary
1330  ret等于setup_irq_thread(secondary, irq, true)
1331  如果ret则转到:out_thread
1345  如果芯片专用标志按位与IRQCHIP_ONESHOT_SAFE中断动作标志与等于IRQF_ONESHOT的反
1355  mutex_lock( & request_mutex)
1362  总线上锁
1365  如果非中断服务例程链表
1366  ret等于取中断处理程序
1367  如果ret
1368  打印错误信息("Failed to request resources for %s (irq %d) on irqchip %s\n", 设备名, irq, 中断名)
1370  转到:out_bus_unlock
1380  raw_spin_lock_irqsave( & 自旋锁, flags)
1381  old_ptr等于中断服务例程链表
1382  old等于old_ptr
1383  如果old
1394  如果istate按位与IRQS_NMI
1395  打印错误信息("Invalid attempt to share NMI for %s (irq %d) on irqchip %s.\n", 设备名, irq, 中断名)
1397  ret等于负EINVAL
1398  转到:out_unlock
1405  如果irqd_trigger_type_was_set( & irq_data)则
1407  否则
1412  如果非中断动作标志按位与中断动作标志按位与These flags used only by the kernel as part of the* irq handling routines的值或oldtype不等于中断动作标志按位与IRQF_TRIGGER_MASK的值或中断动作标志按位异或中断动作标志的值按位与IRQF_ONESHOT则转到:mismatch
1418  如果中断动作标志按位与IRQF_PERCPU的值不等于中断动作标志按位与IRQF_PERCPU的值则转到:mismatch
1423  循环
1431  old等于old_ptr
1432 old循环
1433  shared等于1
1441  如果中断动作标志按位与IRQF_ONESHOT
1446  如果thread_mask恒等于0UL的反则
1447  ret等于负EBUSY
1448  转到:out_unlock
1470  线程跟踪屏蔽等于1UL左移在字中找到第一个为零的位
1472  否则如果中断处理函数恒等于线程中断的默认主中断处理程序且非芯片专用标志按位与IRQCHIP_ONESHOT_SAFE的值则
1489  打印错误信息("Threaded irq requested with handler=NULL and !ONESHOT for irq %d\n", irq)
1491  ret等于负EINVAL
1492  转到:out_unlock
1495  如果非shared
1496  init_waitqueue_head( & 等待所有线程完成)
1499  如果中断动作标志按位与IRQF_TRIGGER_MASK
1503  如果ret则转到:out_unlock
1518  ret等于irq_activate(>request_mutex Provides serialization against a concurrent free_irq())
1519  如果ret则转到:out_unlock
1523  istate与等于IRQS_AUTODETECT按位或IRQS_SPURIOUS_DISABLED按位或IRQS_ONESHOT按位或IRQS_WAITING的值的反
1524  清除中断标志
1526  如果中断动作标志按位与IRQF_PERCPU
1531  如果中断动作标志按位与IRQF_ONESHOTistate或等于IRQS_ONESHOT
1535  如果中断动作标志按位与IRQF_NOBALANCING
1540  如果中断能够被设置
1542  否则
1551  嵌套级数等于1
1554  否则如果中断动作标志按位与IRQF_TRIGGER_MASK
1555  nmsk等于中断动作标志按位与IRQF_TRIGGER_MASK
1556  omsk等于irqd_get_trigger_type( & irq_data)
1558  如果nmsk不等于omsk打印警告信息("irq %d uses trigger mode %u; requested %u\n", irq, omsk, nmsk)
1564  old_ptr等于new
1566  安装实例
1569  发生的中断次数等于0
1570  无法处理中断次数等于0
1576  如果sharedistate按位与IRQS_SPURIOUS_DISABLED
1577  istate与等于IRQS_SPURIOUS_DISABLED的反
1578  嵌套深度为1时使能中断
1581  raw_spin_unlock_irqrestore( & 自旋锁, flags)
1582  慢总线解锁
1583  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1585  irq_setup_timings(>request_mutex Provides serialization against a concurrent free_irq(), new)
1591  如果中断线程唤醒中断线程
1593  如果secondary唤醒中断线程
1596  在系统文件中注册中断进程
1597  入口埠 = NULL
1598  在系统文件中注册新建中断进程
1599  返回:0
1601  mismatch :
1602  如果非中断动作标志按位与IRQF_PROBE_SHARED的值则
1603  打印错误信息("Flags mismatch irq %d. %08x (%s) vs. %08x (%s)\n", irq, 中断动作标志, 设备名, 中断动作标志, 设备名)
1609  ret等于负EBUSY
1611  out_unlock :
1612  raw_spin_unlock_irqrestore( & 自旋锁, flags)
1614  如果非中断服务例程链表irq_release_resources(>request_mutex Provides serialization against a concurrent free_irq())
1616  out_bus_unlock :
1617  慢总线解锁
1618  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1620  out_thread :
1621  如果中断线程
1622  t等于中断线程
1624  中断线程 = NULL
1625  结束线程的运行
1626  put_task_struct(t)
1628  如果secondary中断线程
1629  t等于中断线程
1631  中断线程 = NULL
1632  结束线程的运行
1633  put_task_struct(t)
1635  out_mput :
1636  module_put(owner)
1637  返回:ret
调用者
名称描述
setup_irq注册中断
request_threaded_irq注册中断线程
request_nmiquest_nmi - allocate an interrupt line for NMI delivery*@irq: Interrupt line to allocate*@handler: Function to be called when the IRQ occurs
setup_percpu_irqsetup_percpu_irq - setup a per-cpu interrupt*@irq: Interrupt line to setup*@act: irqaction for the interrupt* Used to statically setup per-cpu interrupts in the early boot process.
__request_percpu_irq__request_percpu_irq - allocate a percpu interrupt line*@irq: Interrupt line to allocate*@handler: Function to be called when the IRQ occurs
request_percpu_nmiquest_percpu_nmi - allocate a percpu interrupt line for NMI delivery*@irq: Interrupt line to allocate*@handler: Function to be called when the IRQ occurs