if (action_ret & IRQ_WAKE_THREAD) {//caq:如果返回结果包含需要唤醒中断处理线程/* * There is a thread woken. Check whether one of the * shared primary handlers returned IRQ_HANDLED. If * not we defer the spuriousdetectiont
__setup_irq是用于设置和注册中断的核心函数,它是request_threaded_irq等函数的内部实现。 1.1. irqaction handler和thread_fn是struct irqaction的两个重要成员,由程序员指定或在__setup_irq中自动设置, 在中断发生后的处理函数被调用。 /// include/linux/interrupt.h /** * struct irqaction - per interrup...
弄到中断线程中运行*/if(new->handler != irq_default_primary_handler &&new->thread_fn) {/*Allocate the secondary action*/new->secondary = kzalloc(sizeof(structirqaction), GFP_KERNEL);if(!new->secondary)return-ENOMEM;new->secondary->handler =irq_forced_secondary_handler;new->secondary->thread...
structkvm_irq_level irq_level; irq_level= (struct kvm_irq_level) { { .irq = irq, }, .level = level, }; if(ioctl(self->vm_fd, KVM_IRQ_LINE, &irq_level) < 0) die_perror("KVM_IRQ_LINE failed"); } 函数kvm__irq_line将irq number和管脚电平信息,这里是1,表示拉高电平了,封装到...
/* Get the interrupt number and add 16 to skip over SGIs */ *out_hwirq = intspec[1] + 16;---首先+16跳过SGI类型中断 /* For SPIs, we need to add 16 more to get the GIC irq ID number */ if (!intspec[0]) {---如果是SPI类型中断,还需要+16,跳过PPI类型中断。 ret = gic_ro...
handle_arch_irq是一个全局的函数指针,在中断初始化时(以GIC为例),会被设置指向gic_handle_irq 。 gic_handle_irq非常简单,首先获取gic对象,循环读取GIC的寄存器,获取中断号,然后调用__handle_domain_irq处理中断,直到gic没有中断挂起...
irq_handler_t handler, unsigned long flags, const char *name, void *dev) { return request_threaded_irq(irq, handler, NULL, flags, name, dev); } extern void disable_irq_nosync(unsigned int irq); extern void disable_irq(unsigned int irq); extern void enable_irq(unsigned int irq); etc...
irq:中断 一个设备对应一个 i2c_client,每检测到一个 I2C 设备就会给这个 I2C 设备分配一个i2c_client。 4. I2C适配器 经过上面的介绍,知道有I2C驱动和I2C设备,我们需要通过I2C驱动去和I2C设备通讯,这其中就需要一个I2C设配器,I2C设配器对应的就是SOC上的I2C控制器。 Linux 内核将 SOC 的 I2C 适配器(控制器...
%sys:系统(内核)进程消耗的CPU时间百分比 %iowait:IO等待所占用的CPU时间百分比 %irq:硬中断占用的CPU时间百分比 %soft:软中断占用的CPU时间百分比 %steal:虚拟机强制CPU等待的时间百分比 %guest:虚拟机占用CPU时间的百分比 %idle:CPU处于空闲状态的时间百分比(2)显示指定CPU信息的统计[...
detection and priority inheritance handling */ struct rt_mutex_waiter *pi_blocked_on; #endif #ifdef CONFIG_DEBUG_MUTEXES /* mutex deadlock detection */ struct mutex_waiter *blocked_on; #endif #ifdef CONFIG_TRACE_IRQFLAGS unsigned int irq_events; int hardirqs_enabled; unsigned long hardirq_...