02.07.2013 Views

kernel 里面的中断代码分析

kernel 里面的中断代码分析

kernel 里面的中断代码分析

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

#if defined(CONFIG_IRQ_PER_CPU)<br />

#endif<br />

}<br />

/* All handlers must agree on per-cpuness */<br />

if ((old->flags & IRQF_PERCPU) !=<br />

(new->flags & IRQF_PERCPU))<br />

goto mismatch;<br />

/* add new interrupt at end of irq queue */<br />

do {<br />

p = &old->next;<br />

old = *p;<br />

} while (old);<br />

shared = 1;<br />

//-----------------------------------------------------------------------------------------------------------------------<br />

*p = new;<br />

#if defined(CONFIG_IRQ_PER_CPU)<br />

#endif<br />

if (new->flags & IRQF_PERCPU)<br />

desc->status |= IRQ_PER_CPU;<br />

//这边还得设置 chip 级别的设置,看来我们在 porting <strong>kernel</strong> 的时候,可能还要加<br />

这些函数<br />

if (!shared) {<br />

irq_chip_set_defaults(desc->chip);<br />

/* Setup the type (level, edge polarity) if configured: */<br />

if (new->flags & IRQF_TRIGGER_MASK) {<br />

if (desc->chip && desc->chip->set_type)<br />

else<br />

desc->chip->set_type(irq,<br />

/*<br />

new->flags & IRQF_TRIGGER_MASK);<br />

* IRQF_TRIGGER_* but the PIC does not support<br />

* multiple flow-types?<br />

*/<br />

printk(KERN_WARNING "No IRQF_TRIGGER set_type "<br />

"function for IRQ %d (%s)\n", irq,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!