File: group__intr.html

package info (click to toggle)
xenomai 2.5.4-3squeeze1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 36,140 kB
  • ctags: 35,509
  • sloc: ansic: 109,084; sh: 11,745; makefile: 2,205; xml: 1,356; asm: 613; php: 316; perl: 155
file content (426 lines) | stat: -rw-r--r-- 24,691 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Xenomai API: Interrupt management.</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    <li>
      <form action="search.php" method="get">
        <table cellspacing="0" cellpadding="0" border="0">
          <tr>
            <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
            <td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
          </tr>
        </table>
      </form>
    </li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Interrupt management.<br>
<small>
[<a class="el" href="group__nucleus.html">Xenomai nucleus.</a>]</small>
</h1>
<p>
<div class="dynheader">
Collaboration diagram for Interrupt management.:</div>
<div class="dynsection">
<center><table><tr><td><img src="group__intr.png" border="0" alt="" usemap="#group____intr_map">
<map name="group____intr_map">
<area shape="rect" href="group__nucleus.html" title="Xenomai nucleus." alt="" coords="5,5,141,32"></map></td></tr></table></center>
</div>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Interrupt management. 
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Files</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">file &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ksrc_2nucleus_2intr_8c.html">intr.c</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Interrupt management. <br></td></tr>

<p>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__intr.html#g6017e33c5871d313b4de053d938dd95b">xnintr_init</a> (xnintr_t *intr, const char *name, unsigned irq, xnisr_t isr, xniack_t iack, xnflags_t flags)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize an interrupt object.  <a href="#g6017e33c5871d313b4de053d938dd95b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__intr.html#gc50dd884fca5ccb3502a218f9ffae520">xnintr_destroy</a> (xnintr_t *intr)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroy an interrupt object.  <a href="#gc50dd884fca5ccb3502a218f9ffae520"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__intr.html#g52a4435332aa1dbdc18edb58231c83f0">xnintr_attach</a> (xnintr_t *intr, void *cookie)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Attach an interrupt object.  <a href="#g52a4435332aa1dbdc18edb58231c83f0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__intr.html#g83769b98f398774590e57ad8664925aa">xnintr_detach</a> (xnintr_t *intr)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Detach an interrupt object.  <a href="#g83769b98f398774590e57ad8664925aa"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__intr.html#g083e000abd434e4d0fca8f6b6bbd49de">xnintr_enable</a> (xnintr_t *intr)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enable an interrupt object.  <a href="#g083e000abd434e4d0fca8f6b6bbd49de"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__intr.html#g05570451a808b44216140e00b0eae713">xnintr_disable</a> (xnintr_t *intr)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Disable an interrupt object.  <a href="#g05570451a808b44216140e00b0eae713"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">xnarch_cpumask_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__intr.html#g88097f97513b7049db61a335713a6b4a">xnintr_affinity</a> (xnintr_t *intr, xnarch_cpumask_t cpumask)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set interrupt's processor affinity.  <a href="#g88097f97513b7049db61a335713a6b4a"></a><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g88097f97513b7049db61a335713a6b4a"></a><!-- doxytag: member="intr.c::xnintr_affinity" ref="g88097f97513b7049db61a335713a6b4a" args="(xnintr_t *intr, xnarch_cpumask_t cpumask)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">xnarch_cpumask_t xnintr_affinity           </td>
          <td>(</td>
          <td class="paramtype">xnintr_t *&nbsp;</td>
          <td class="paramname"> <em>intr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">xnarch_cpumask_t&nbsp;</td>
          <td class="paramname"> <em>cpumask</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set interrupt's processor affinity. 
<p>
Causes the IRQ associated with the interrupt object <em>intr</em> to be received only on processors which bits are set in <em>cpumask</em>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>intr</em>&nbsp;</td><td>The descriptor address of the interrupt object which affinity is to be changed.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cpumask</em>&nbsp;</td><td>The new processor affinity of the interrupt object.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the previous cpumask on success, or an empty mask on failure.</dd></dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Depending on architectures, setting more than one bit in <em>cpumask</em> could be meaningless. </dd></dl>

</div>
</div><p>
<a class="anchor" name="g52a4435332aa1dbdc18edb58231c83f0"></a><!-- doxytag: member="intr.c::xnintr_attach" ref="g52a4435332aa1dbdc18edb58231c83f0" args="(xnintr_t *intr, void *cookie)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int xnintr_attach           </td>
          <td>(</td>
          <td class="paramtype">xnintr_t *&nbsp;</td>
          <td class="paramname"> <em>intr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>cookie</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Attach an interrupt object. 
<p>
Attach an interrupt object previously initialized by <a class="el" href="group__intr.html#g6017e33c5871d313b4de053d938dd95b" title="Initialize an interrupt object.">xnintr_init()</a>. After this operation is completed, all IRQs received from the corresponding interrupt channel are directed to the object's ISR.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>intr</em>&nbsp;</td><td>The descriptor address of the interrupt object to attach.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cookie</em>&nbsp;</td><td>A user-defined opaque value which is stored into the interrupt object descriptor for further retrieval by the ISR/ISR handlers.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 is returned on success. Otherwise:</dd></dl>
<ul>
<li>-EINVAL is returned if a low-level error occurred while attaching the interrupt.</li></ul>
<p>
<ul>
<li>-EBUSY is returned if the interrupt object was already attached.</li></ul>
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The caller <b>must not</b> hold nklock when invoking this service, this would cause deadlocks.</dd></dl>
Environments:<p>
This service can be called from:<p>
<ul>
<li>Kernel module initialization/cleanup code</li><li>Kernel-based task</li></ul>
<p>
Rescheduling: never.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Attaching an interrupt resets the tracked number of receipts to zero. </dd></dl>

<p>Referenced by <a class="el" href="ksrc_2skins_2posix_2intr_8c-source.html#l00102">pthread_intr_attach_np()</a>, <a class="el" href="ksrc_2skins_2native_2intr_8c-source.html#l00250">rt_intr_create()</a>, and <a class="el" href="drvlib_8c-source.html#l01625">rtdm_irq_request()</a>.</p>

</div>
</div><p>
<a class="anchor" name="gc50dd884fca5ccb3502a218f9ffae520"></a><!-- doxytag: member="intr.c::xnintr_destroy" ref="gc50dd884fca5ccb3502a218f9ffae520" args="(xnintr_t *intr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int xnintr_destroy           </td>
          <td>(</td>
          <td class="paramtype">xnintr_t *&nbsp;</td>
          <td class="paramname"> <em>intr</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destroy an interrupt object. 
<p>
Destroys an interrupt object previously initialized by <a class="el" href="group__intr.html#g6017e33c5871d313b4de053d938dd95b" title="Initialize an interrupt object.">xnintr_init()</a>. The interrupt object is automatically detached by a call to <a class="el" href="group__intr.html#g83769b98f398774590e57ad8664925aa" title="Detach an interrupt object.">xnintr_detach()</a>. No more IRQs will be dispatched by this object after this service has returned.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>intr</em>&nbsp;</td><td>The descriptor address of the interrupt object to destroy.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 is returned on success. Otherwise, -EINVAL is returned if an error occurred while detaching the interrupt (see <a class="el" href="group__intr.html#g83769b98f398774590e57ad8664925aa" title="Detach an interrupt object.">xnintr_detach()</a>).</dd></dl>
Environments:<p>
This service can be called from:<p>
<ul>
<li>Kernel module initialization/cleanup code</li><li>Kernel-based task</li></ul>
<p>
Rescheduling: never. 
<p>References <a class="el" href="ksrc_2nucleus_2intr_8c-source.html#l00776">xnintr_detach()</a>.</p>

<p>Referenced by <a class="el" href="ksrc_2skins_2native_2intr_8c-source.html#l00334">rt_intr_delete()</a>.</p>

</div>
</div><p>
<a class="anchor" name="g83769b98f398774590e57ad8664925aa"></a><!-- doxytag: member="intr.c::xnintr_detach" ref="g83769b98f398774590e57ad8664925aa" args="(xnintr_t *intr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int xnintr_detach           </td>
          <td>(</td>
          <td class="paramtype">xnintr_t *&nbsp;</td>
          <td class="paramname"> <em>intr</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Detach an interrupt object. 
<p>
Detach an interrupt object previously attached by <a class="el" href="group__intr.html#g52a4435332aa1dbdc18edb58231c83f0" title="Attach an interrupt object.">xnintr_attach()</a>. After this operation is completed, no more IRQs are directed to the object's ISR, but the interrupt object itself remains valid. A detached interrupt object can be attached again by a subsequent call to <a class="el" href="group__intr.html#g52a4435332aa1dbdc18edb58231c83f0" title="Attach an interrupt object.">xnintr_attach()</a>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>intr</em>&nbsp;</td><td>The descriptor address of the interrupt object to detach.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 is returned on success. Otherwise:</dd></dl>
<ul>
<li>-EINVAL is returned if a low-level error occurred while detaching the interrupt, or if the interrupt object was not attached. In both cases, no action is performed.</li></ul>
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The caller <b>must not</b> hold nklock when invoking this service, this would cause deadlocks.</dd></dl>
Environments:<p>
This service can be called from:<p>
<ul>
<li>Kernel module initialization/cleanup code</li><li>Kernel-based task</li></ul>
<p>
Rescheduling: never. 
<p>Referenced by <a class="el" href="drvlib_8c-source.html#l01625">rtdm_irq_request()</a>, and <a class="el" href="ksrc_2nucleus_2intr_8c-source.html#l00660">xnintr_destroy()</a>.</p>

</div>
</div><p>
<a class="anchor" name="g05570451a808b44216140e00b0eae713"></a><!-- doxytag: member="intr.c::xnintr_disable" ref="g05570451a808b44216140e00b0eae713" args="(xnintr_t *intr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int xnintr_disable           </td>
          <td>(</td>
          <td class="paramtype">xnintr_t *&nbsp;</td>
          <td class="paramname"> <em>intr</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Disable an interrupt object. 
<p>
Disables the hardware interrupt line associated with an interrupt object. This operation invalidates further interrupt requests from the given source until the IRQ line is re-enabled anew.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>intr</em>&nbsp;</td><td>The descriptor address of the interrupt object to disable.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 is returned on success. Otherwise, -EINVAL is returned if a low-level error occurred while disabling the interrupt.</dd></dl>
Environments:<p>
This service can be called from:<p>
<ul>
<li>Kernel module initialization/cleanup code</li><li>Kernel-based task</li></ul>
<p>
Rescheduling: never. 
<p>Referenced by <a class="el" href="ksrc_2skins_2posix_2intr_8c-source.html#l00226">pthread_intr_control_np()</a>, and <a class="el" href="ksrc_2skins_2native_2intr_8c-source.html#l00461">rt_intr_disable()</a>.</p>

</div>
</div><p>
<a class="anchor" name="g083e000abd434e4d0fca8f6b6bbd49de"></a><!-- doxytag: member="intr.c::xnintr_enable" ref="g083e000abd434e4d0fca8f6b6bbd49de" args="(xnintr_t *intr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int xnintr_enable           </td>
          <td>(</td>
          <td class="paramtype">xnintr_t *&nbsp;</td>
          <td class="paramname"> <em>intr</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Enable an interrupt object. 
<p>
Enables the hardware interrupt line associated with an interrupt object. Over real-time control layers which mask and acknowledge IRQs, this operation is necessary to revalidate the interrupt channel so that more interrupts can be notified.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>intr</em>&nbsp;</td><td>The descriptor address of the interrupt object to enable.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 is returned on success. Otherwise, -EINVAL is returned if a low-level error occurred while enabling the interrupt.</dd></dl>
Environments:<p>
This service can be called from:<p>
<ul>
<li>Kernel module initialization/cleanup code</li><li>Kernel-based task</li></ul>
<p>
Rescheduling: never. 
<p>Referenced by <a class="el" href="ksrc_2skins_2posix_2intr_8c-source.html#l00226">pthread_intr_control_np()</a>, <a class="el" href="ksrc_2skins_2native_2intr_8c-source.html#l00407">rt_intr_enable()</a>, and <a class="el" href="drvlib_8c-source.html#l01625">rtdm_irq_request()</a>.</p>

</div>
</div><p>
<a class="anchor" name="g6017e33c5871d313b4de053d938dd95b"></a><!-- doxytag: member="intr.c::xnintr_init" ref="g6017e33c5871d313b4de053d938dd95b" args="(xnintr_t *intr, const char *name, unsigned irq, xnisr_t isr, xniack_t iack, xnflags_t flags)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int xnintr_init           </td>
          <td>(</td>
          <td class="paramtype">xnintr_t *&nbsp;</td>
          <td class="paramname"> <em>intr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&nbsp;</td>
          <td class="paramname"> <em>irq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">xnisr_t&nbsp;</td>
          <td class="paramname"> <em>isr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">xniack_t&nbsp;</td>
          <td class="paramname"> <em>iack</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">xnflags_t&nbsp;</td>
          <td class="paramname"> <em>flags</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Initialize an interrupt object. 
<p>
Associates an interrupt object with an IRQ line.<p>
When an interrupt occurs on the given <em>irq</em> line, the ISR is fired in order to deal with the hardware event. The interrupt service code may call any non-suspensive service from the nucleus.<p>
Upon receipt of an IRQ, the ISR is immediately called on behalf of the interrupted stack context, the rescheduling procedure is locked, and the interrupt source is masked at hardware level. The status value returned by the ISR is then checked for the following values:<p>
<ul>
<li>XN_ISR_HANDLED indicates that the interrupt request has been fulfilled by the ISR.</li></ul>
<p>
<ul>
<li>XN_ISR_NONE indicates the opposite to XN_ISR_HANDLED. The ISR must always return this value when it determines that the interrupt request has not been issued by the dedicated hardware device.</li></ul>
<p>
In addition, one of the following bits may be set by the ISR :<p>
NOTE: use these bits with care and only when you do understand their effect on the system. The ISR is not encouraged to use these bits in case it shares the IRQ line with other ISRs in the real-time domain.<p>
<ul>
<li>XN_ISR_NOENABLE causes the nucleus to ask the real-time control layer _not_ to re-enable the IRQ line (read the following section). xnarch_end_irq() must be called to re-enable the IRQ line later.</li></ul>
<p>
<ul>
<li>XN_ISR_PROPAGATE tells the nucleus to require the real-time control layer to forward the IRQ. For instance, this would cause the Adeos control layer to propagate the interrupt down the interrupt pipeline to other Adeos domains, such as Linux. This is the regular way to share interrupts between the nucleus and the host system. In effect, XN_ISR_PROPAGATE implies XN_ISR_NOENABLE since it would make no sense to re-enable the interrupt channel before the next domain down the pipeline has had a chance to process the propagated interrupt.</li></ul>
<p>
The nucleus re-enables the IRQ line by default. Over some real-time control layers which mask and acknowledge IRQs, this operation is necessary to revalidate the interrupt channel so that more interrupts can be notified.<p>
A count of interrupt receipts is tracked into the interrupt descriptor, and reset to zero each time the interrupt object is attached. Since this count could wrap around, it should be used as an indication of interrupt activity only.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>intr</em>&nbsp;</td><td>The address of a interrupt object descriptor the nucleus will use to store the object-specific data. This descriptor must always be valid while the object is active therefore it must be allocated in permanent memory.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>An ASCII string standing for the symbolic name of the interrupt object or NULL ("&lt;unknown&gt;" will be applied then).</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>irq</em>&nbsp;</td><td>The hardware interrupt channel associated with the interrupt object. This value is architecture-dependent. An interrupt object must then be attached to the hardware interrupt vector using the <a class="el" href="group__intr.html#g52a4435332aa1dbdc18edb58231c83f0" title="Attach an interrupt object.">xnintr_attach()</a> service for the associated IRQs to be directed to this object.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>isr</em>&nbsp;</td><td>The address of a valid low-level interrupt service routine if this parameter is non-zero. This handler will be called each time the corresponding IRQ is delivered on behalf of an interrupt context. When called, the ISR is passed the descriptor address of the interrupt object.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>iack</em>&nbsp;</td><td>The address of an optional interrupt acknowledge routine, aimed at replacing the default one. Only very specific situations actually require to override the default setting for this parameter, like having to acknowledge non-standard PIC hardware. <em>iack</em> should return a non-zero value to indicate that the interrupt has been properly acknowledged. If <em>iack</em> is NULL, the default routine will be used instead.</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>flags</em>&nbsp;</td><td>A set of creation flags affecting the operation. The valid flags are:</td></tr>
  </table>
</dl>
<ul>
<li>XN_ISR_SHARED enables IRQ-sharing with other interrupt objects.</li></ul>
<p>
<ul>
<li>XN_ISR_EDGE is an additional flag need to be set together with XN_ISR_SHARED to enable IRQ-sharing of edge-triggered interrupts.</li></ul>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>No error condition being defined, 0 is always returned.</dd></dl>
Environments:<p>
This service can be called from:<p>
<ul>
<li>Kernel module initialization/cleanup code</li><li>Kernel-based task</li></ul>
<p>
Rescheduling: never. 
<p>Referenced by <a class="el" href="ksrc_2skins_2posix_2intr_8c-source.html#l00102">pthread_intr_attach_np()</a>, <a class="el" href="ksrc_2skins_2native_2intr_8c-source.html#l00250">rt_intr_create()</a>, <a class="el" href="drvlib_8c-source.html#l01625">rtdm_irq_request()</a>, and <a class="el" href="pod_8c-source.html#l02669">xnpod_enable_timesource()</a>.</p>

</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Aug 2 12:48:37 2010 for Xenomai API by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>