⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interrupts.html

📁 ADI 公司blackfin系列的用户使用文挡。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head>  <title></title>  <link rel="stylesheet" media="screen" type="text/css" href="./style.css" />  <link rel="stylesheet" media="screen" type="text/css" href="./design.css" />  <link rel="stylesheet" media="print" type="text/css" href="./print.css" />  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><div class="toc"><div class="tocheader toctoggle" id="toc__header">Table of Contents</div><div id="toc__inside"><ul class="toc"><li class="clear"><ul class="toc"><li class="level2"><div class="li"><span class="li"><a href="#generic_interrupts_overview" class="toc">Generic Interrupts Overview</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#interrupts_on_blackfin_systems" class="toc">Interrupts on Blackfin Systems</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#blackfin_interrupts_overview" class="toc">Blackfin Interrupts Overview</a></span></div><ul class="toc"><li class="level3"><div class="li"><span class="li"><a href="#interrupt_discovery" class="toc">Interrupt Discovery</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#blackfin_interrupt_set_up" class="toc">Blackfin Interrupt Set up</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#blackfin_interrupt_service" class="toc">Blackfin Interrupt Service</a></span></div></li></ul></li><li class="level2"><div class="li"><span class="li"><a href="#blackfin_system_timer" class="toc">Blackfin System Timer</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#linux_interrupt_overview" class="toc">Linux Interrupt Overview</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#linux_interrupt_servicing" class="toc">Linux Interrupt Servicing</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#linux_interrupt_actions" class="toc">Linux Interrupt Actions</a></span></div><ul class="toc"><li class="level3"><div class="li"><span class="li"><a href="#resetting_the_source" class="toc">Resetting the Source</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#pending_a_bottom_half" class="toc">Pending a Bottom Half</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#wake_up_a_sleeping_task" class="toc">Wake up a Sleeping Task</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#run_a_tasklet" class="toc">Run a Tasklet</a></span></div></li></ul></li></ul></li></ul></div></div><h2><a name="generic_interrupts_overview" id="generic_interrupts_overview">Generic Interrupts Overview</a></h2><div class="level2"><p> An interrupt handler is associated with an interrupt &ldquo;number&rdquo; by the request_irq function. This is a normal &ldquo;C&rdquo; function. The function has the following parameters </p><ul><li class="level1"><div class="li"> irqnum: Interrupt number to allocate</div></li><li class="level1"><div class="li"> handler: Function to be called when the IRQ occurs</div></li><li class="level1"><div class="li"> irqflags: Interrupt type flags</div></li><li class="level1"><div class="li"> devname: An ascii name for the claiming device</div></li><li class="level1"><div class="li"> dev_id: A cookie passed back to the handler function</div></li></ul><p>This call allocates interrupt resources and enables the interrupt line and IRQ handling. From the point this call is made your handler function may be invoked. Since your handler function must clear any interrupt the board raises, you must take care both to initialize your hardware and to set up the interrupt handler in the right order.</p><p>The Dev_id structure must (normally) be globally unique. Normally the address of the device data structure is used as the cookie. Since the handler receives this value it makes sense to use it. If your interrupt is shared you must pass a non NULL dev_id as this is required when freeing the interrupt.</p><p>The irqflags are normally defined as follows: </p><ul><li class="level1"><div class="li"> SA_SHIRQ Interrupt is shared</div></li><li class="level1"><div class="li"> SA_INTERRUPT Disable local interrupts while processing</div></li><li class="level1"><div class="li"> SA_SAMPLE_RANDOM The interrupt can be used for entropy</div></li></ul><p>Some variation occurs with different target systems. With 2.6 The interrupt handler must return a 1 if the interrupt is handled. There is a special irqreturn_t defined in linux-2.6.x/include/linux/interrupt.h</p><p> To mix old-style and new-style irqs the handler returns.                 </p><pre class="code">                                                                       * IRQ_NONE means we didn't handle it.                                  * IRQ_HANDLED means that we did have a valid interrupt and handled it. * IRQ_RETVAL(x) selects on the two depending on x being non-zero (for handled)   </pre><p> A typical interrupt service routine</p><pre class="code c">     <span class="kw4">static</span> irqreturn_t                                                   xxx_timer_interrupt<span class="br0">&#40;</span><span class="kw4">int</span> irq, <span class="kw4">void</span> *dev_id, <span class="kw4">struct</span> pt_regs *regs<span class="br0">&#41;</span>     <span class="br0">&#123;</span>                                                                           timer_tick<span class="br0">&#40;</span>regs<span class="br0">&#41;</span>;                                                    <span class="kw1">return</span> IRQ_HANDLED;                                           <span class="br0">&#125;</span></pre></div><!-- SECTION [1-2496] --><h2><a name="interrupts_on_blackfin_systems" id="interrupts_on_blackfin_systems">Interrupts on Blackfin Systems</a></h2><div class="level2"><p> The Blackfin Interrupts work as follows.</p><ul><li class="level1"><div class="li"> Each interrupt is assigned to a level ( 0 - 15 )</div></li><li class="level1"><div class="li"> A number of fixed interrupts are assigned to preset levels</div></li><li class="level1"><div class="li"> System interrupts are vectored to a General interrupt level</div></li><li class="level1"><div class="li"> The System Interface Controllers are examined to determine the interrupt source</div></li><li class="level1"><div class="li"> The cpu starts executing from the vector address and arrives at the general linux interrupt handler with a defined interrupt number</div></li></ul></div><!-- SECTION [2497-2981] --><h2><a name="blackfin_interrupts_overview" id="blackfin_interrupts_overview">Blackfin Interrupts Overview</a></h2><div class="level2"><p> The Blackfin has a two stage interrupt handler.</p><p>The Core Event Controller (CEC) provides 7 fixed events and 9 General Purpose Interrupts. The System Interrupt Controller (SIC) allows the user to map 28 System components to specific General Interrupts.</p><p>Both the CEC and the SIC are maskable and can be used to monitor and manage the system interrupts.</p><p>For reference here are the Interrupts mapped by the CEC </p><table class="inline">	<tr>		<th>Priority</th><th class="leftalign">Event Class         </th><th>EVT Entry</th>	</tr>	<tr>		<td class="leftalign">0       </td><td class="leftalign">Emulation/Test      </td><td class="leftalign">EMU      </td>	</tr>	<tr>		<td class="leftalign">1       </td><td class="leftalign">Reset               </td><td class="leftalign">RST      </td>	</tr>	<tr>		<td class="leftalign">2       </td><td class="leftalign">Non Maskable        </td><td class="leftalign">NMI      </td>	</tr>	<tr>		<td class="leftalign">3       </td><td class="leftalign">Exceptions          </td><td class="leftalign">EVX      </td>	</tr>	<tr>		<td class="leftalign">4       </td><td class="leftalign">Global Enable       </td><td class="rightalign">         </td>	</tr>	<tr>		<td class="leftalign">5       </td><td class="leftalign">Hardware Error      </td><td class="leftalign">IVHW     </td>	</tr>	<tr>		<td class="leftalign">6       </td><td class="leftalign">Core Timer          </td><td class="leftalign">IVTMR    </td>	</tr>	<tr>		<td class="leftalign">7       </td><td>General Interrupt 7 </td><td class="leftalign">IVG7     </td>	</tr>	<tr>		<td class="leftalign">8       </td><td>General Interrupt 8 </td><td class="leftalign">IVG8     </td>	</tr>	<tr>		<td class="leftalign">9       </td><td>General Interrupt 9 </td><td class="leftalign">IVG9     </td>	</tr>	<tr>		<td class="leftalign">10      </td><td>General Interrupt 10</td><td class="leftalign">IVG10    </td>	</tr>	<tr>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -