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 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664
|
<!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: Event flag group services.</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 Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data 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> <u>S</u>earch for </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>Event flag group services.<br>
<small>
[<a class="el" href="group__native.html">Native Xenomai API.</a>]</small>
</h1>
<p>
<div class="dynheader">
Collaboration diagram for Event flag group services.:</div>
<div class="dynsection">
<center><table><tr><td><img src="group__event.png" border="0" alt="" usemap="#group____event_map">
<map name="group____event_map">
<area shape="rect" href="group__native.html" title="Native Xenomai API." alt="" coords="5,5,157,32"></map></td></tr></table></center>
</div>
<hr><a name="_details"></a><h2>Detailed Description</h2>
An event flag group is a synchronization object represented by a long-word structure; every available bit in such word can be used to map a user-defined event flag. When a flag is set, the associated event is said to have occurred. Xenomai tasks and interrupt handlers can use event flags to signal the occurrence of events to other tasks; those tasks can either wait for the events to occur in a conjunctive manner (all awaited events must have occurred to wake up), or in a disjunctive way (at least one of the awaited events must have occurred to wake up).
<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 </td><td class="memItemRight" valign="bottom"><a class="el" href="ksrc_2skins_2native_2event_8c.html">event.c</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">This file is part of the Xenomai project. <br></td></tr>
<p>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#g8b0fbb2b816c62081afe86bf897c503c">rt_event_create</a> (RT_EVENT *event, const char *name, unsigned long ivalue, int mode)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an event group. <a href="#g8b0fbb2b816c62081afe86bf897c503c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#gbccfea1cd018493ef5a28c6fe8e90d7c">rt_event_delete</a> (RT_EVENT *event)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Delete an event group. <a href="#gbccfea1cd018493ef5a28c6fe8e90d7c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#gfda4c544f2429005c4b15de3a7ffc902">rt_event_signal</a> (RT_EVENT *event, unsigned long mask)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Post an event group. <a href="#gfda4c544f2429005c4b15de3a7ffc902"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#g6e9f775275661d9258f8b1eb02fe4681">rt_event_wait</a> (RT_EVENT *event, unsigned long mask, unsigned long *mask_r, int mode, RTIME timeout)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Pend on an event group. <a href="#g6e9f775275661d9258f8b1eb02fe4681"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#g81e2c7a3346b2364a153a24be291b204">rt_event_wait_until</a> (RT_EVENT *event, unsigned long mask, unsigned long *mask_r, int mode, RTIME timeout)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Pend on an event group (with absolute timeout date). <a href="#g81e2c7a3346b2364a153a24be291b204"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#g448889bcfd01ed892d97a0b00fdaf553">rt_event_clear</a> (RT_EVENT *event, unsigned long mask, unsigned long *mask_r)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Clear an event group. <a href="#g448889bcfd01ed892d97a0b00fdaf553"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#gbecddf3846622df42bf95f94871f8e62">rt_event_inquire</a> (RT_EVENT *event, RT_EVENT_INFO *info)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Inquire about an event group. <a href="#gbecddf3846622df42bf95f94871f8e62"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#g535edab31526338258479100f3e6997c">rt_event_bind</a> (RT_EVENT *event, const char *name, RTIME timeout)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Bind to an event flag group. <a href="#g535edab31526338258479100f3e6997c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event.html#ge985bb0e671e2a5e07b575fd793fde22">rt_event_unbind</a> (RT_EVENT *event)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Unbind from an event flag group. <a href="#ge985bb0e671e2a5e07b575fd793fde22"></a><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g535edab31526338258479100f3e6997c"></a><!-- doxytag: member="event.h::rt_event_bind" ref="g535edab31526338258479100f3e6997c" args="(RT_EVENT *event, const char *name, RTIME timeout)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int rt_event_bind </td>
<td>(</td>
<td class="paramtype">RT_EVENT * </td>
<td class="paramname"> <em>event</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">RTIME </td>
<td class="paramname"> <em>timeout</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Bind to an event flag group.
<p>
This user-space only service retrieves the uniform descriptor of a given Xenomai event flag group identified by its symbolic name. If the event flag group does not exist on entry, this service blocks the caller until a event flag group of the given name is created.<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>name</em> </td><td>A valid NULL-terminated name which identifies the event flag group to bind to.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>event</em> </td><td>The address of an event flag group descriptor retrieved by the operation. Contents of this memory is undefined upon failure.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>timeout</em> </td><td>The number of clock ticks to wait for the registration to occur (see note). Passing TM_INFINITE causes the caller to block indefinitely until the object is registered. Passing TM_NONBLOCK causes the service to return immediately without waiting if the object is not registered on entry.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 is returned upon success. Otherwise:</dd></dl>
<ul>
<li>-EFAULT is returned if <em>event</em> or <em>name</em> is referencing invalid memory.</li></ul>
<p>
<ul>
<li>-EINTR is returned if <a class="el" href="group__task.html#g770281eeca009c0a08a7c4a9fd849ac1" title="Unblock a real-time task.">rt_task_unblock()</a> has been called for the waiting task before the retrieval has completed.</li></ul>
<p>
<ul>
<li>-EWOULDBLOCK is returned if <em>timeout</em> is equal to TM_NONBLOCK and the searched object is not registered on entry.</li></ul>
<p>
<ul>
<li>-ETIMEDOUT is returned if the object cannot be retrieved within the specified amount of time.</li></ul>
<p>
<ul>
<li>-EPERM is returned if this service should block, but was called from a context which cannot sleep (e.g. interrupt, non-realtime context).</li></ul>
<p>
Environments:<p>
This service can be called from:<p>
<ul>
<li>User-space task (switches to primary mode)</li></ul>
<p>
Rescheduling: always unless the request is immediately satisfied or <em>timeout</em> specifies a non-blocking operation.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The <em>timeout</em> value will be interpreted as jiffies if the native skin is bound to a periodic time base (see CONFIG_XENO_OPT_NATIVE_PERIOD), or nanoseconds otherwise. </dd></dl>
</div>
</div><p>
<a class="anchor" name="g448889bcfd01ed892d97a0b00fdaf553"></a><!-- doxytag: member="event.c::rt_event_clear" ref="g448889bcfd01ed892d97a0b00fdaf553" args="(RT_EVENT *event, unsigned long mask, unsigned long *mask_r)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int rt_event_clear </td>
<td>(</td>
<td class="paramtype">RT_EVENT * </td>
<td class="paramname"> <em>event</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long </td>
<td class="paramname"> <em>mask</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long * </td>
<td class="paramname"> <em>mask_r</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Clear an event group.
<p>
Clears a set of flags from an event mask.<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>event</em> </td><td>The descriptor address of the affected event.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>mask</em> </td><td>The set of events to be cleared.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>mask_r</em> </td><td>If non-NULL, <em>mask_r</em> is the address of a memory location which will be written upon success with the previous value of the event group before the flags are cleared.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 is returned upon success. Otherwise:</dd></dl>
<ul>
<li>-EINVAL is returned if <em>event</em> is not an event group descriptor.</li></ul>
<p>
<ul>
<li>-EIDRM is returned if <em>event</em> is a deleted event group descriptor.</li></ul>
<p>
Environments:<p>
This service can be called from:<p>
<ul>
<li>Kernel module initialization/cleanup code</li><li>Interrupt service routine</li><li>Kernel-based task</li><li>User-space task</li></ul>
<p>
Rescheduling: never.
</div>
</div><p>
<a class="anchor" name="g8b0fbb2b816c62081afe86bf897c503c"></a><!-- doxytag: member="event.c::rt_event_create" ref="g8b0fbb2b816c62081afe86bf897c503c" args="(RT_EVENT *event, const char *name, unsigned long ivalue, int mode)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int rt_event_create </td>
<td>(</td>
<td class="paramtype">RT_EVENT * </td>
<td class="paramname"> <em>event</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long </td>
<td class="paramname"> <em>ivalue</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>mode</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Create an event group.
<p>
Event groups provide for task synchronization by allowing a set of flags (or "events") to be waited for and posted atomically. An event group contains a mask of received events; any set of bits from the event mask can be pended or posted in a single operation.<p>
Tasks can wait for a conjunctive (AND) or disjunctive (OR) set of events to occur. A task pending on an event group in conjunctive mode is woken up as soon as all awaited events are set in the event mask. A task pending on an event group in disjunctive mode is woken up as soon as any awaited event is set in the event mask.<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>event</em> </td><td>The address of an event group descriptor Xenomai will use to store the event-related data. This descriptor must always be valid while the group is active therefore it must be allocated in permanent memory.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>name</em> </td><td>An ASCII string standing for the symbolic name of the group. When non-NULL and non-empty, this string is copied to a safe place into the descriptor, and passed to the registry package if enabled for indexing the created event group.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>ivalue</em> </td><td>The initial value of the group's event mask.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>mode</em> </td><td>The event group creation mode. The following flags can be OR'ed into this bitmask, each of them affecting the new group:</td></tr>
</table>
</dl>
<ul>
<li>EV_FIFO makes tasks pend in FIFO order on the event group.</li></ul>
<p>
<ul>
<li>EV_PRIO makes tasks pend in priority order on the event group.</li></ul>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 is returned upon success. Otherwise:</dd></dl>
<ul>
<li>-EEXIST is returned if the <em>name</em> is already in use by some registered object.</li></ul>
<p>
<ul>
<li>-EPERM is returned if this service was called from an asynchronous context.</li></ul>
<p>
<ul>
<li>-ENOMEM is returned if the system fails to get enough dynamic memory from the global real-time heap in order to register the event group.</li></ul>
<p>
Environments:<p>
This service can be called from:<p>
<ul>
<li>Kernel module initialization/cleanup code</li><li>Kernel-based task</li><li>User-space task</li></ul>
<p>
Rescheduling: possible.
<p>References <a class="el" href="src_2skins_2native_2event_8c-source.html#l00038">rt_event_delete()</a>, <a class="el" href="nucleus_2registry_8c-source.html#l00573">xnregistry_enter()</a>, and <a class="el" href="synch_8c-source.html#l00102">xnsynch_init()</a>.</p>
</div>
</div><p>
<a class="anchor" name="gbccfea1cd018493ef5a28c6fe8e90d7c"></a><!-- doxytag: member="event.c::rt_event_delete" ref="gbccfea1cd018493ef5a28c6fe8e90d7c" args="(RT_EVENT *event)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int rt_event_delete </td>
<td>(</td>
<td class="paramtype">RT_EVENT * </td>
<td class="paramname"> <em>event</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Delete an event group.
<p>
Destroy an event group and release all the tasks currently pending on it. An event group exists in the system since <a class="el" href="group__event.html#g8b0fbb2b816c62081afe86bf897c503c" title="Create an event group.">rt_event_create()</a> has been called to create it, so this service must be called in order to destroy it afterwards.<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>event</em> </td><td>The descriptor address of the affected event group.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 is returned upon success. Otherwise:</dd></dl>
<ul>
<li>-EINVAL is returned if <em>event</em> is not a event group descriptor.</li></ul>
<p>
<ul>
<li>-EIDRM is returned if <em>event</em> is a deleted event group descriptor.</li></ul>
<p>
<ul>
<li>-EPERM is returned if this service was called from an asynchronous context.</li></ul>
<p>
Environments:<p>
This service can be called from:<p>
<ul>
<li>Kernel module initialization/cleanup code</li><li>Kernel-based task</li><li>User-space task</li></ul>
<p>
Rescheduling: possible.
<p>References <a class="el" href="pod_8h-source.html#l00251">xnpod_schedule()</a>, and <a class="el" href="nucleus_2registry_8c-source.html#l00809">xnregistry_remove()</a>.</p>
<p>Referenced by <a class="el" href="ksrc_2skins_2native_2event_8c-source.html#l00177">rt_event_create()</a>.</p>
</div>
</div><p>
<a class="anchor" name="gbecddf3846622df42bf95f94871f8e62"></a><!-- doxytag: member="event.c::rt_event_inquire" ref="gbecddf3846622df42bf95f94871f8e62" args="(RT_EVENT *event, RT_EVENT_INFO *info)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int rt_event_inquire </td>
<td>(</td>
<td class="paramtype">RT_EVENT * </td>
<td class="paramname"> <em>event</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">RT_EVENT_INFO * </td>
<td class="paramname"> <em>info</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Inquire about an event group.
<p>
Return various information about the status of a specified event group.<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>event</em> </td><td>The descriptor address of the inquired event group.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>info</em> </td><td>The address of a structure the event group information will be written to.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 is returned and status information is written to the structure pointed at by <em>info</em> upon success. Otherwise:</dd></dl>
<ul>
<li>-EINVAL is returned if <em>event</em> is not a event group descriptor.</li></ul>
<p>
<ul>
<li>-EIDRM is returned if <em>event</em> is a deleted event group descriptor.</li></ul>
<p>
Environments:<p>
This service can be called from:<p>
<ul>
<li>Kernel module initialization/cleanup code</li><li>Interrupt service routine</li><li>Kernel-based task</li><li>User-space task</li></ul>
<p>
Rescheduling: never.
</div>
</div><p>
<a class="anchor" name="gfda4c544f2429005c4b15de3a7ffc902"></a><!-- doxytag: member="event.c::rt_event_signal" ref="gfda4c544f2429005c4b15de3a7ffc902" args="(RT_EVENT *event, unsigned long mask)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int rt_event_signal </td>
<td>(</td>
<td class="paramtype">RT_EVENT * </td>
<td class="paramname"> <em>event</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long </td>
<td class="paramname"> <em>mask</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Post an event group.
<p>
Post a set of bits to the event mask. All tasks having their wait request fulfilled by the posted events are resumed.<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>event</em> </td><td>The descriptor address of the affected event.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>mask</em> </td><td>The set of events to be posted.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 is returned upon success. Otherwise:</dd></dl>
<ul>
<li>-EINVAL is returned if <em>event</em> is not an event group descriptor.</li></ul>
<p>
<ul>
<li>-EIDRM is returned if <em>event</em> is a deleted event group descriptor.</li></ul>
<p>
Environments:<p>
This service can be called from:<p>
<ul>
<li>Kernel module initialization/cleanup code</li><li>Interrupt service routine</li><li>Kernel-based task</li><li>User-space task</li></ul>
<p>
Rescheduling: possible.
<p>References <a class="el" href="pod_8h-source.html#l00251">xnpod_schedule()</a>, and <a class="el" href="synch_8c-source.html#l00309">xnsynch_wakeup_this_sleeper()</a>.</p>
</div>
</div><p>
<a class="anchor" name="ge985bb0e671e2a5e07b575fd793fde22"></a><!-- doxytag: member="event.h::rt_event_unbind" ref="ge985bb0e671e2a5e07b575fd793fde22" args="(RT_EVENT *event)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int rt_event_unbind </td>
<td>(</td>
<td class="paramtype">RT_EVENT * </td>
<td class="paramname"> <em>event</em> </td>
<td> ) </td>
<td><code> [inline, static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Unbind from an event flag group.
<p>
This user-space only service unbinds the calling task from the event flag group object previously retrieved by a call to <a class="el" href="group__event.html#g535edab31526338258479100f3e6997c" title="Bind to an event flag group.">rt_event_bind()</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>event</em> </td><td>The address of an event flag group descriptor to unbind from.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 is always returned.</dd></dl>
This service can be called from:<p>
<ul>
<li>User-space task.</li></ul>
<p>
Rescheduling: never.
</div>
</div><p>
<a class="anchor" name="g6e9f775275661d9258f8b1eb02fe4681"></a><!-- doxytag: member="event.c::rt_event_wait" ref="g6e9f775275661d9258f8b1eb02fe4681" args="(RT_EVENT *event, unsigned long mask, unsigned long *mask_r, int mode, RTIME timeout)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int rt_event_wait </td>
<td>(</td>
<td class="paramtype">RT_EVENT * </td>
<td class="paramname"> <em>event</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long </td>
<td class="paramname"> <em>mask</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long * </td>
<td class="paramname"> <em>mask_r</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>mode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">RTIME </td>
<td class="paramname"> <em>timeout</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Pend on an event group.
<p>
Waits for one or more events on the specified event group, either in conjunctive or disjunctive mode.<p>
If the specified set of bits is not set, the calling task is blocked. The task is not resumed until the request is fulfilled. The event bits are NOT cleared from the event group when a request is satisfied; <a class="el" href="group__event.html#g6e9f775275661d9258f8b1eb02fe4681" title="Pend on an event group.">rt_event_wait()</a> will return immediately with success for the same event mask until <a class="el" href="group__event.html#g448889bcfd01ed892d97a0b00fdaf553" title="Clear an event group.">rt_event_clear()</a> is called to clear those bits.<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>event</em> </td><td>The descriptor address of the affected event group.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>mask</em> </td><td>The set of bits to wait for. Passing zero causes this service to return immediately with a success value; the current value of the event mask is also copied to <em>mask_r</em>.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>mask_r</em> </td><td>The value of the event mask at the time the task was readied.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>mode</em> </td><td>The pend mode. The following flags can be OR'ed into this bitmask, each of them affecting the operation:</td></tr>
</table>
</dl>
<ul>
<li>EV_ANY makes the task pend in disjunctive mode (i.e. OR); this means that the request is fulfilled when at least one bit set into <em>mask</em> is set in the current event mask.</li></ul>
<p>
<ul>
<li>EV_ALL makes the task pend in conjunctive mode (i.e. AND); this means that the request is fulfilled when at all bits set into <em>mask</em> are set in the current event mask.</li></ul>
<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>timeout</em> </td><td>The number of clock ticks to wait for fulfilling the request (see note). Passing TM_INFINITE causes the caller to block indefinitely until the request is fulfilled. Passing TM_NONBLOCK causes the service to return immediately without waiting if the request cannot be satisfied immediately.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 is returned upon success. Otherwise:</dd></dl>
<ul>
<li>-EINVAL is returned if <em>event</em> is not a event group descriptor.</li></ul>
<p>
<ul>
<li>-EIDRM is returned if <em>event</em> is a deleted event group descriptor, including if the deletion occurred while the caller was sleeping on it before the request has been satisfied.</li></ul>
<p>
<ul>
<li>-EWOULDBLOCK is returned if <em>timeout</em> is equal to TM_NONBLOCK and the current event mask value does not satisfy the request.</li></ul>
<p>
<ul>
<li>-EINTR is returned if <a class="el" href="group__task.html#g770281eeca009c0a08a7c4a9fd849ac1" title="Unblock a real-time task.">rt_task_unblock()</a> has been called for the waiting task before the request has been satisfied.</li></ul>
<p>
<ul>
<li>-ETIMEDOUT is returned if the request has not been satisfied within the specified amount of time.</li></ul>
<p>
<ul>
<li>-EPERM is returned if this service should block, but was called from a context which cannot sleep (e.g. interrupt, non-realtime context).</li></ul>
<p>
Environments:<p>
This service can be called from:<p>
<ul>
<li>Kernel module initialization/cleanup code or Interrupt service routine only if <em>timeout</em> is equal to TM_NONBLOCK.</li><li>Kernel-based task</li><li>User-space task (switches to primary mode)</li></ul>
<p>
Rescheduling: always unless the request is immediately satisfied or <em>timeout</em> specifies a non-blocking operation.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The <em>timeout</em> value will be interpreted as jiffies if the native skin is bound to a periodic time base (see CONFIG_XENO_OPT_NATIVE_PERIOD), or nanoseconds otherwise. </dd></dl>
</div>
</div><p>
<a class="anchor" name="g81e2c7a3346b2364a153a24be291b204"></a><!-- doxytag: member="event.c::rt_event_wait_until" ref="g81e2c7a3346b2364a153a24be291b204" args="(RT_EVENT *event, unsigned long mask, unsigned long *mask_r, int mode, RTIME timeout)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int rt_event_wait_until </td>
<td>(</td>
<td class="paramtype">RT_EVENT * </td>
<td class="paramname"> <em>event</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long </td>
<td class="paramname"> <em>mask</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long * </td>
<td class="paramname"> <em>mask_r</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>mode</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">RTIME </td>
<td class="paramname"> <em>timeout</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Pend on an event group (with absolute timeout date).
<p>
Waits for one or more events on the specified event group, either in conjunctive or disjunctive mode.<p>
If the specified set of bits is not set, the calling task is blocked. The task is not resumed until the request is fulfilled. The event bits are NOT cleared from the event group when a request is satisfied; <a class="el" href="group__event.html#g6e9f775275661d9258f8b1eb02fe4681" title="Pend on an event group.">rt_event_wait()</a> will return immediately with success for the same event mask until <a class="el" href="group__event.html#g448889bcfd01ed892d97a0b00fdaf553" title="Clear an event group.">rt_event_clear()</a> is called to clear those bits.<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>event</em> </td><td>The descriptor address of the affected event group.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>mask</em> </td><td>The set of bits to wait for. Passing zero causes this service to return immediately with a success value; the current value of the event mask is also copied to <em>mask_r</em>.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>mask_r</em> </td><td>The value of the event mask at the time the task was readied.</td></tr>
<tr><td valign="top"></td><td valign="top"><em>mode</em> </td><td>The pend mode. The following flags can be OR'ed into this bitmask, each of them affecting the operation:</td></tr>
</table>
</dl>
<ul>
<li>EV_ANY makes the task pend in disjunctive mode (i.e. OR); this means that the request is fulfilled when at least one bit set into <em>mask</em> is set in the current event mask.</li></ul>
<p>
<ul>
<li>EV_ALL makes the task pend in conjunctive mode (i.e. AND); this means that the request is fulfilled when at all bits set into <em>mask</em> are set in the current event mask.</li></ul>
<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>timeout</em> </td><td>The absolute date specifying a time limit to wait for fulfilling the request (see note). Passing TM_INFINITE causes the caller to block indefinitely until the request is fulfilled. Passing TM_NONBLOCK causes the service to return immediately without waiting if the request cannot be satisfied immediately.</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 is returned upon success. Otherwise:</dd></dl>
<ul>
<li>-EINVAL is returned if <em>event</em> is not a event group descriptor.</li></ul>
<p>
<ul>
<li>-EIDRM is returned if <em>event</em> is a deleted event group descriptor, including if the deletion occurred while the caller was sleeping on it before the request has been satisfied.</li></ul>
<p>
<ul>
<li>-EWOULDBLOCK is returned if <em>timeout</em> is equal to TM_NONBLOCK and the current event mask value does not satisfy the request.</li></ul>
<p>
<ul>
<li>-EINTR is returned if <a class="el" href="group__task.html#g770281eeca009c0a08a7c4a9fd849ac1" title="Unblock a real-time task.">rt_task_unblock()</a> has been called for the waiting task before the request has been satisfied.</li></ul>
<p>
<ul>
<li>-ETIMEDOUT is returned if the absolute <em>timeout</em> date is reached before the request is satisfied.</li></ul>
<p>
<ul>
<li>-EPERM is returned if this service should block, but was called from a context which cannot sleep (e.g. interrupt, non-realtime context).</li></ul>
<p>
Environments:<p>
This service can be called from:<p>
<ul>
<li>Kernel module initialization/cleanup code or Interrupt service routine only if <em>timeout</em> is equal to TM_NONBLOCK.</li><li>Kernel-based task</li><li>User-space task (switches to primary mode)</li></ul>
<p>
Rescheduling: always unless the request is immediately satisfied or <em>timeout</em> specifies a non-blocking operation.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The <em>timeout</em> value will be interpreted as jiffies if the native skin is bound to a periodic time base (see CONFIG_XENO_OPT_NATIVE_PERIOD), or nanoseconds otherwise. </dd></dl>
</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Aug 2 12:48:38 2010 for Xenomai API by
<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>
|