hushup的ChinaUnix博客
hushup
全部博文(108)
2016年(2)
2015年(44)
2014年(62)
Garfield
GFree_Wi
guo44319
瀚海书香
luozhiyo
WuYaalan
tekkaman
xiebaoyo
wangcong
venkin
wangda
zhangwen
bug_仔
luciento
AK47520
11937341
ihuangli
我是小小
分类:
2014-05-17 09:47:53
原文地址:Linux 中断学习笔记(二) 作者:chenjifeng
27 struct irq_desc; 28 typedef void fastcall (*irq_flow_handler_t)(unsigned int irq, 29 struct irq_desc *desc); 153struct irq_desc { 154 irq_flow_handler_t handle_irq; /*指向一个函数,下面会用到*/ 155 struct irq_chip *chip; /* 下面会介绍这个结构体*/ 156 struct msi_desc *msi_desc; 157 void *handler_data; 158 void *chip_data; 159 struct irqaction *action; /* IRQ action lis下面会介绍 */ 160 unsigned int status; /* IRQ status */ 161 162 unsigned int depth; /* nested irq disables */ 163 unsigned int wake_depth; /* nested wake enables */ 164 unsigned int irq_count; /* For detecting broken IRQs */ 165 unsigned int irqs_unhandled; 166 unsigned long last_unhandled;/*Aging timer for unhandled count*/ 167 spinlock_t lock; 168#ifdef CONFIG_SMP 169 cpumask_t affinity; 170 unsigned int cpu; 171#endif 172#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) 173 cpumask_t pending_mask; 174#endif 175#ifdef CONFIG_PROC_FS 176 struct proc_dir_entry *dir; 177#endif 178 const char *name; 179} ____cacheline_internodealigned_in_smp; 180 extern struct irq_desc irq_desc[NR_IRQS]; typedef struct irq_desc irq_desc_t;
struct irqaction { 61 irq_handler_t handler; 62 unsigned long flags; 63 cpumask_t mask; 64 const char *name; 65 void *dev_id; 66 struct irqaction *next;//指向下一个本结构 67 int irq; 68 struct proc_dir_entry *dir; 69};
#define hw_interrupt_type irq_chip typedef struct irq_chip hw_irq_controller; 99struct irq_chip { 100 const char *name; 101 unsigned int (*startup)(unsigned int irq); 102 void (*shutdown)(unsigned int irq); 103 void (*enable)(unsigned int irq); 104 void (*disable)(unsigned int irq); 105 106 void (*ack)(unsigned int irq); 107 void (*mask)(unsigned int irq); 108 void (*mask_ack)(unsigned int irq); 109 void (*unmask)(unsigned int irq); 110 void (*eoi)(unsigned int irq); 111 112 void (*end)(unsigned int irq); 113 void (*set_affinity)(unsigned int irq, cpumask_t dest); 114 int (*retrigger)(unsigned int irq); 115 int (*set_type)(unsigned int irq, unsigned int flow_type); 116 int (*set_wake)(unsigned int irq, unsigned int on); 117 118 /* Currently used only by UML, might disappear one day.*/ 119#ifdef CONFIG_IRQ_RELEASE_METHOD 120 void (*release)(unsigned int irq, void *dev_id); 121#endif 122 /* 123 * For compatibility, ->typename is copied into ->name. 124 * Will disappear. 125 */ 126 const char *typename; 127};
上一篇:Linux 中断学习笔记(一)
下一篇:Linux 中断学习笔记(三)
登录 注册