核心是 cpsie i 和 cpsid i 这两个指令。 cps全称change processor state,即改变PRIMASK这个寄存器值 ie: interrupt enable. 中断使能,即PRIMASK.PM设置为0 id: interrupt disable. 中断关闭,即PRIMASK.PM设置为1 __enable_irq()函数调用cpsie i指令。 __disable_irq()函数除调用cpsid i 指令,同时返回了PRIMASK...
struct task_struct *tsk = __this_cpu_read(ksoftirqd); if (tsk && tsk->state != TASK_RUNNING) wake_up_process(tsk); } 以收包软中断为例, IRQ handler 并不执行 NAPI,只是触发它,在里面会执行到 raise NET_RX_SOFTIRQ;真正的执行在 softirq,里面会调用网卡的 poll() 方法收包。IRQ handler 中...
structtask_struct*tsk= __this_cpu_read(ksoftirqd); if(tsk && tsk->state != TASK_RUNNING) wake_up_process(tsk); } 以收包软中断为例, IRQ handler 并不执行 NAPI,只是触发它,在里面会执行到 raise NET_RX_SOFTIRQ;真正的执行在 softirq,里面会调用网卡的 poll() 方法收包。IRQ handler 中会调用...
nest_lock=nest_lock@entry=0x0 <fixed_percpu_data>, ip=18446744071580260235) at evl-v5.15.y/kernel/locking/lockdep.c:5677 \#100xffffffff81a9ecc5 in __raw_spin_lock_irqsave (lock=0xffffffff825474c0 <rcu_state>) at evl-v5.15.y/include/linux/spinlock_api_smp.h:110 \#11_raw_spin_lo...
if (tsk && tsk->state != TASK_RUNNING) wake_up_process(tsk); } 以收包软中断为例, IRQ handler 并不执行 NAPI,只是触发它,在里面会执行到 raise NET_RX_SOFTIRQ;真正的执行在 softirq,里面会调用网卡的 poll() 方法收包。IRQ handler 中会调用 napi_schedule(),然后启动 NAPI poll()。
(nr);// 唤醒 ksoftirqd 线程(但执行不在这里,在 ksoftirqd 线程中)local_irq_restore(flags);// 打开 IRQ}if(!in_interrupt()) wakeup_softirqd();staticvoidwakeup_softirqd(void){structtask_struct*tsk= __this_cpu_read(ksoftirqd);if(tsk && tsk->state != TASK_RUNNING) wake_up_process(tsk);...
The function flexcan_irq_state() checks the controller for CAN state changes and pushes a skb with the new state and a timestamp into the rx-offload framework. This patch optimizes the function by only reading the timestamp, if a state change is detected. Signed-off-by: Marc Kleine-...
irq_state_clr_disabled(desc); #正常情况下回调用chip来使能irq if (desc->irq_data.chip->irq_enable) desc->irq_data.chip->irq_enable(&desc->irq_data); else desc->irq_data.chip->irq_unmask(&desc->irq_data); irq_state_clr_masked(desc); ...
irq_state_clr_masked(desc); } 中断控制器回调函数 /*中断控制器*/staticstructirq_chip bcm2708_irqchip ={ .name="GPIO", .irq_enable= bcm2708_gpio_irq_unmask,//使能该irq,通常是直接调用irq_unmask().irq_disable = bcm2708_gpio_irq_mask,//禁止该irq,通常是直接调用irq_mask.irq_unmask = bc...
cps全称change processor state,即改变PRIMASK这个寄存器值 ie: interrupt enable. 中断使能,即PRIMASK.PM设置为0 id: interrupt disable. 中断关闭,即PRIMASK.PM设置为1 __enable_irq()函数调用cpsie i指令。 __disable_irq()函数除调用cpsid i 指令,同时返回了PRIMASK的值,即如果返回值为 0,则表示中断在调用该...