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

📄 interru4.htm

📁 ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片机顶盒软件的开发平台,2.0.5版本,国内找不到的.在国外论坛上花了N天才找到!
💻 HTM
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Quadralay WebWorks Publisher Professional Edition 6.0.5">
<meta name="TEMPLATEBASE" content="book_html">
<meta name="LASTUPDATED" content="08/22/03 10:13:25">
<title>9.3 Restrictions on interrupt handlers</title>

<STYLE TYPE="text/css">
<!--
	span.Signal { text-transform: uppercase; font-family: Verdana }
-->
</STYLE>

</head>

<body link="#3366CC" vlink="#9999CC" text="#000000" alink="#0000CC" bgcolor="#FFFFFF"
background="images/backgrnd.gif">

<p><img src="images/stlogo.gif" width="106" height="83" align="left"
alt="logo here!"> </p>

<table width="331" border="0" align="right" cellpadding="0" cellspacing="0">
  <tr>
    <td><a href="c2isetto.htm"><img src="images/navtoc.gif" width="84" height="23"
    border="0" alt="TOC"> </a></td>
    <td><a href="interru3.htm"><img src="images/navprev.gif" width="80" height="23"
    border="0" alt="PREV"> </a></td>
    <td><a href="interru5.htm"><img src="images/navnext.gif" width="83" height="23"
    border="0" alt="NEXT"> </a></td>
    <td><a href="c2isetix.htm"><img src="images/navidx.gif" width="84" height="23"
    border="0" alt="INDEX"> </a></td>
  </tr>
</table>

<p><br clear="all">
</p>

<hr align="left">

<blockquote>
<h2>
  <a name="1205843"> </a><font color="#003366"  face="Verdana, Arial, Helvetica, sans-serif">9.3 	 Restrictions on interrupt handlers</font>
</h2><hr>


<p>
  <a name="1205224"> </a><font size=2  face="Verdana, Arial, Helvetica, sans-serif">There are various restrictions that must be placed on interrupt handlers to ensure that they interact correctly with the rest of the process model implemented in the ST20-C2. Unlike priority pre-emption, when an interrupt is taken the interrupted process is still not available for execution if the interrupting process deschedules or halts. Instead, the interrupted process is moved into the interrupt save area and is only restarted by the <strong>iret</strong> instruction. This imposes various restrictions onto the handler code.</font>
</p>


<p>
  <a name="1204562"> </a><font size=2  face="Verdana, Arial, Helvetica, sans-serif">Since interrupt handlers are intended to be pieces of code which rapidly respond to some external condition then the restrictions placed on them are not excessive. Interrupt handlers should be designed to rapidly field any data being passed to them and then, if necessary, pass data requiring further processing down to a lower priority process.</font>
</p>


<p>
  <a name="1204563"> </a><font size=2  face="Verdana, Arial, Helvetica, sans-serif">The following restrictions apply to interrupt handlers.</font>
</p>

<ul>
<p>  <font size=2  face="Verdana, Arial, Helvetica, sans-serif"><li ><a name="1204564"> </a>They must not deschedule.</font></p>
  <dl>
    <dt> <a name="1204565"> </a><font size=2  face="Verdana, Arial, Helvetica, sans-serif">Descheduling would leave the interrupted process inactive and inaccessible until they were rescheduled. If system behavior became dependent on that process (for example, via waiting for a semaphore claimed by the process to be released) then the system could deadlock.</font>
  </dl>
<p>  <font size=2  face="Verdana, Arial, Helvetica, sans-serif"><li ><a name="1204566"> </a>They must not execute communication instructions.</font></p>
  <dl>
    <dt> <a name="1204567"> </a><font size=2  face="Verdana, Arial, Helvetica, sans-serif">This follows from the previous restriction and is strengthened by the fact that the handler may attempt to communicate with the process that it has just interrupted. In this case, the handler and the process deadlock as the process cannot proceed to receive the communication until the handler terminates and vice versa.</font>
  </dl>
<p>  <font size=2  face="Verdana, Arial, Helvetica, sans-serif"><li ><a name="1204568"> </a>They must not perform a 2-D block move instruction.</font></p>
  <dl>
    <dt> <a name="1204569"> </a><font size=2  face="Verdana, Arial, Helvetica, sans-serif">This is because the 2-D block move state is not saved on entry to the handler so the handler could corrupt the state of a block move that it interrupts. The handler can perform a 2-D block move if it uses <strong>stshadow</strong> and <strong>ldshadow</strong> instructions to save and restore the existing 2-D block move state.</font>
  </dl>
<p>  <font size=2  face="Verdana, Arial, Helvetica, sans-serif"><li ><a name="1204570"> </a>They must not cause program traps. </font></p>
  <dl>
    <dt> <a name="1204571"> </a><font size=2  face="Verdana, Arial, Helvetica, sans-serif">This is because an interrupt handler cannot depend on the state of the trap enables flags. In particular, it could be interrupting a trap handler run from another process.</font>
  </dl>
</ul>

<p>
  <a name="1204572"> </a><font size=2  face="Verdana, Arial, Helvetica, sans-serif">There are some "work arounds" to these restrictions. An interrupt handler may:</font>
</p>

<ol type="1">
<p>  <font size=2  face="Verdana, Arial, Helvetica, sans-serif"><li  value="1"><a name="1204573"> </a>schedule a process which can do anything that it isn't allowed to do, for example, it can schedule a process to communicate on its behalf, however, there is no guarantee on when this process executes,</font></p>
<p>  <font size=2  face="Verdana, Arial, Helvetica, sans-serif"><li  value="2"><a name="1204574"> </a>synchronize with other processes via a semaphore using the <strong>signal</strong> instruction, it still cannot use <strong>wait</strong> as this can deschedule.</font></p>
</ol>
</blockquote>

<hr>



<table width="331" border="0" align="left" cellpadding="0" cellspacing="0">
  <tr>
    <td><a href="c2isetto.htm"><img src="images/navtoc.gif" width="84" height="23"
    border="0" alt="TOC"> </a></td>
    <td><a href="interru3.htm"><img src="images/navprev.gif" width="80" height="23"
    border="0" alt="PREV"> </a></td>
    <td><a href="interru5.htm"><img src="images/navnext.gif" width="83" height="23"
    border="0" alt="NEXT"> </a></td>
    <td><a href="c2isetix.htm"><img src="images/navidx.gif" width="84" height="23"
    border="0" alt="INDEX"> </a></td>
  </tr>
</table>
<font size=1 face="Verdana, Arial, Helvetica, sans-serif">&nbsp; &copy; 1997, 2001, 2002, 2003 STMicroelectronics. All Rights Reserved.<br>
&nbsp; ADCS 7301761C</font>
</body>
</html>

⌨️ 快捷键说明

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