Changeset d2633470 in rtems
- Timestamp:
- 07/13/99 18:04:13 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 56634c5
- Parents:
- 49a90508
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/itron3.0/eventflags.t
r49a90508 rd2633470 30 30 @subsection Event sets 31 31 32 An eventflag is used by a task (or ISR) to inform another task of the occurrence of a significant situation. Thirty-two eventflags are associated with each task. A collection of one or more eventflags is referred to as an event set. The application developer should remember the following key characteristics of event operations when utilizing the event manager: 32 An eventflag is used by a task (or ISR) to inform another task of the 33 occurrence of a significant situation. Thirty-two eventflags are 34 associated with each task. A collection of one or more eventflags is 35 referred to as an event set. The application developer should remember the 36 following key characteristics of event operations when utilizing the event 37 manager: 33 38 34 39 @itemize @bullet … … 123 128 @subsection T_RFLG Structure 124 129 125 The T_RFLG structire is used to define the characteristics of an eventflag and passed as an argument to the @code{ref_flg} service. The structure is defined as follows: 126 127 @example 128 * Reference Eventflags (ref_flg) Structure */ 130 The T_RFLG structire is used to define the characteristics of an eventflag 131 and passed as an argument to the @code{ref_flg} service. The structure is 132 defined as follows: 133 134 @example 135 /* Reference Eventflags (ref_flg) Structure */ 129 136 typedef struct t_rflg @{ 130 137 VP exinf; /* extended information */ … … 136 143 137 144 @table @b 138 @item BOOL_ID 139 140 indicates whether or not there is a task waiting for the eventflag in question. If there is no waiting task, wtsk is returned as FALSE = 0. If there is a waiting task, wtsk is returned as a value other than 0. 145 146 @item exinf 147 148 see @code{T_CFLG}. 149 150 @item wtsk 151 152 indicates whether or not there is a task waiting for the eventflag in 153 question. If there is no waiting task, wtsk is returned as FALSE = 0. 154 If there is a waiting task, wtsk is returned as a value other than 0. 155 156 @item flgptn 157 158 is the eventflag pattern. 141 159 142 160 @end table … … 146 164 @section System Calls 147 165 148 This section details the eventflags manager's services. 149 A subsection is dedicated to each of this manager's services 150 and describes the calling sequence, related constants, usage, 151 and status codes. 166 This section details the eventflags manager's services. A subsection is 167 dedicated to each of this manager's services and describes the calling 168 sequence, related constants, usage, and status codes. 152 169 153 170 … … 176 193 177 194 @code{E_OK} - Normal Completion 178 @code{E_NOMEM} - Insufficient memory (Memory for control block cannot be allocated) 195 196 @code{E_NOMEM} - Insufficient memory (Memory for control block cannot be 197 allocated) 198 179 199 @code{E_ID} - Invalid ID number (flgid was invalid or could not be used) 180 @code{E_RSATR} - Reserved attribute (flgatr was invalid or could not be used) 181 @code{E_OBJ} - Invalid object state (an eventflag of the same ID already exists) 182 @code{E_OACV} - Object access violation (A flgid less than -4 was specified from a user task. This is implementation dependent.) 200 201 @code{E_RSATR} - Reserved attribute (flgatr was invalid or could not be 202 used) 203 204 @code{E_OBJ} - Invalid object state (an eventflag of the same ID already 205 exists) 206 207 @code{E_OACV} - Object access violation (A flgid less than -4 was 208 specified from a user task. This is implementation dependent.) 209 183 210 @code{E_PAR} - Parameter error (pk_cflg is invalid) 184 @code{EN_OBJNO} - An object number which could not be accessed on the target node is specified. 185 @code{EN_CTXID} - Specified an object on another node when the system call was issued from a task in dispatch disabled state or from a task-independent portion 186 @code{EN_PAR}- A value outside the range supported by the target node and/or transmission packet format was specified as a parameter (a value outside supported range was specified for exinf, flgatr and/or iflgptn) 211 212 @code{EN_OBJNO} - An object number which could not be accessed on the 213 target node is specified. 214 215 @code{EN_CTXID} - Specified an object on another node when the system call 216 was issued from a task in dispatch disabled state or from a 217 task-independent portion 218 219 @code{EN_PAR}- A value outside the range supported by the target node 220 and/or transmission packet format was specified as a parameter (a value 221 outside supported range was specified for exinf, flgatr and/or iflgptn) 187 222 188 223 @subheading DESCRIPTION: 189 224 190 This system call creates the eventflag specified by @code{flgid}. Specifically, a control block for the eventflag to be created is allocated and the associated flag pattern is initialized using @code{iflgptn}. A single eventflag handles one word's worth of bits of the processor in question as a group. All operations are done in single word units. 191 192 User eventflags have positive ID numbers, while system eventflags have negative ID numbers. User tasks (tasks having positive task IDs) cannot access system eventflags. An @code{E_OACV} error will result if a user task issues a system call on a system eventflag, but error detection is implementation dependent. 193 194 Eventflags having ID numbers from -4 through 0 cannot be created. An @code{E_ID} error will result if a value in this range is specified for @code{flgid}. 195 196 The system attribute part of flgatr may be specified as follows. 197 @example 198 flgatr := (TA_WMUL || TA_WSGL) 199 @end example 200 @code{TA_WSGL} Waiting for multiple tasks is not allowed (Wait Single Task) 201 @code{TA_WMUL} Waiting for multiple tasks is allowed (Wait Multiple Tasks) 225 This system call creates the eventflag specified by @code{flgid}. 226 Specifically, a control block for the eventflag to be created is allocated 227 and the associated flag pattern is initialized using @code{iflgptn}. A 228 single eventflag handles one word's worth of bits of the processor in 229 question as a group. All operations are done in single word units. 230 231 User eventflags have positive ID numbers, while system eventflags have 232 negative ID numbers. User tasks (tasks having positive task IDs) cannot 233 access system eventflags. An @code{E_OACV} error will result if a user 234 task issues a system call on a system eventflag, but error detection is 235 implementation dependent. 236 237 Eventflags having ID numbers from -4 through 0 cannot be created. An 238 @code{E_ID} error will result if a value in this range is specified for 239 @code{flgid}. 240 241 The system attribute part of @code{flgatr} may be specified as @code{TA_WSGL} 242 (Wait Single Task) or @code{TA_WMUL} (Wait Multiple Tasks) 202 243 203 244 @subheading NOTES: 204 245 205 Multiprocessing is not supported. Thus none of the "@code{EN_}" status codes will be returned. 206 207 All memory is preallocated for @code{RTEMS ITRON} objects. Thus, no dynamic memory allocation is performed by @code{cre_flg} and the @code{E_NOMEM} error can not be returned. 246 Multiprocessing is not supported. Thus none of the "@code{EN_}" status 247 codes will be returned. 248 249 All memory is preallocated for @code{RTEMS ITRON} objects. Thus, no 250 dynamic memory allocation is performed by @code{cre_flg} and the 251 @code{E_NOMEM} error can not be returned. 208 252 209 253 @c … … 230 274 231 275 @code{E_OK} - Normal Completion 276 232 277 @code{E_ID} - Invalid ID number (flgid was invalid or could not be used) 233 @code{E_NOEXS} - Object does not exist (the eventflag specified by flgid does not exist) 234 @code{E_OACV} - Object access violation (A flgid less than -4 was specified from a user task. This is implementation dependent.) 235 @code{EN_OBJNO} - An object number which could not be accessed on the target node is specified. 236 @code{EN_CTXID} - Specified an object on another node when the system call was issued from a task in dispatch disabled state or from a task-independent portion 278 279 @code{E_NOEXS} - Object does not exist (the eventflag specified by flgid 280 does not exist) 281 282 @code{E_OACV} - Object access violation (A flgid less than -4 was 283 specified from a user task. This is implementation dependent.) 284 285 @code{EN_OBJNO} - An object number which could not be accessed on the 286 target node is specified. 287 288 @code{EN_CTXID} - Specified an object on another node when the system call 289 was issued from a task in dispatch disabled state or from a 290 task-independent portion 237 291 238 292 @subheading DESCRIPTION: … … 240 294 This system call deletes the eventflag specified by @code{flgid}. 241 295 242 Issuing this system call causes memory used for the control block of the associated eventflag to be released. After this system call is invoked, another eventflag having the same ID number can be created. 243 244 This system call will complete normally even if there are tasks waiting for the eventflag. In that case, an @code{E_DLT} error will be returned to each waiting task. 296 Issuing this system call causes memory used for the control block of the 297 associated eventflag to be released. After this system call is invoked, 298 another eventflag having the same ID number can be created. 299 300 This system call will complete normally even if there are tasks waiting 301 for the eventflag. In that case, an @code{E_DLT} error will be returned 302 to each waiting task. 245 303 246 304 @subheading NOTES: 247 305 248 Multiprocessing is not supported. Thus none of the "@code{EN_}" status codes will be returned. 249 250 When an eventflag being waited for by more than one tasks is deleted, the order of tasks on the ready queue after the WAIT state is cleared is implementation dependent in the case of tasks having the same priority. 306 Multiprocessing is not supported. Thus none of the "@code{EN_}" status 307 codes will be returned. 308 309 When an eventflag being waited for by more than one tasks is deleted, the 310 order of tasks on the ready queue after the WAIT state is cleared is 311 implementation dependent in the case of tasks having the same priority. 251 312 252 313 @c … … 274 335 275 336 @code{E_OK} - Normal Completion 337 276 338 @code{E_ID} - Invalid ID number (flgid was invalid or could not be used) 277 @code{E_NOEXS} - Object does not exist (the eventflag specified by flgid does not exist) 278 @code{E_OACV} - Object access violation (A flgid less than -4 was specified from a user task. This is implementation dependent.) 279 @code{EN_OBJNO} - An object number which could not be accessed on the target node is specified. 280 @code{EN_CTXID} - Specified an object on another node when the system call was issued from a task in dispatch disabled state or from a task-independent portion 281 @code{EN_PAR} - A value outside the range supported by the target node and/or transmission packet format was specified as a parameter (a value outside supported range was specified for setptn or clrptn) 339 340 @code{E_NOEXS} - Object does not exist (the eventflag specified by flgid 341 does not exist) 342 343 @code{E_OACV} - Object access violation (A flgid less than -4 was 344 specified from a user task. This is implementation dependent.) 345 346 @code{EN_OBJNO} - An object number which could not be accessed on the 347 target node is specified. 348 349 @code{EN_CTXID} - Specified an object on another node when the system call 350 was issued from a task in dispatch disabled state or from a 351 task-independent portion 352 353 @code{EN_PAR} - A value outside the range supported by the target node 354 and/or transmission packet format was specified as a parameter (a value 355 outside supported range was specified for setptn or clrptn) 282 356 283 357 @subheading DESCRIPTION: 284 358 285 The @code{set_flg} system call sets the bits specified by setptn of the one word eventflag specified by @code{flgid}. In other words, a logical sum is taken for the values of the eventflag specified by flgid with the value of @code{setptn}. 286 287 If the eventflag value is changed by @code{set_flg} and the new eventflag value satisfies the condition to release the WAIT state of the task which issued @code{wai_flg} on the eventflag, the WAIT state of that task will be released and the task will be put into RUN or READY state (or SUSPEND state if the task was in WAIT-SUSPEND). 288 289 Nothing will happen to the target eventflag if all bits of @code{setptn} are specified as 0 with @code{set_flg}. No error will result in either case. 290 291 Multiple tasks can wait for a single eventflag if that eventflags has the @code{TA_WMUL} attribute. This means that even eventflags can make queues for tasks to wait on. When such eventflags are used, a single @code{set_flg} call may result in the release of multiple waiting tasks. In this case, the order of tasks on the ready queue after the WAIT state is cleared is preserved for tasks having the same priority. 359 The @code{set_flg} system call sets the bits specified by @code{setptn} of the 360 one word eventflag specified by @code{flgid}. In other words, a logical 361 sum is taken for the values of the eventflag specified by flgid with the 362 value of @code{setptn}. 363 364 If the eventflag value is changed by @code{set_flg} and the new eventflag 365 value satisfies the condition to release the WAIT state of the task which 366 issued @code{wai_flg} on the eventflag, the WAIT state of that task will 367 be released and the task will be put into RUN or READY state (or SUSPEND 368 state if the task was in WAIT-SUSPEND). 369 370 Nothing will happen to the target eventflag if all bits of @code{setptn} 371 are specified as 0 with @code{set_flg}. No error will result in either 372 case. 373 374 Multiple tasks can wait for a single eventflag if that eventflags has the 375 @code{TA_WMUL} attribute. This means that even eventflags can make queues 376 for tasks to wait on. When such eventflags are used, a single 377 @code{set_flg} call may result in the release of multiple waiting tasks. 378 In this case, the order of tasks on the ready queue after the WAIT state 379 is cleared is preserved for tasks having the same priority. 292 380 293 381 @subheading NOTES: 294 382 295 Multiprocessing is not supported. Thus none of the "@code{EN_}" status codes will be returned. 383 Multiprocessing is not supported. Thus none of the "@code{EN_}" status 384 codes will be returned. 296 385 297 386 @c … … 323 412 @code{E_ID} - Invalid ID number (flgid was invalid or could not be used) 324 413 325 @code{E_NOEXS} - Object does not exist (the eventflag specified by flgid does not exist) 326 327 @code{E_OACV} - Object access violation (A flgid less than -4 was specified from a user task. This is implementation dependent.) 328 329 @code{EN_OBJNO} - An object number which could not be accessed on the target node is specified. 330 331 @code{EN_CTXID} - Specified an object on another node when the system call was issued from a task in dispatch disabled state or from a task-independent portion 332 333 @code{EN_PAR} - A value outside the range supported by the target node and/or transmission packet format was specified as a parameter (a value outside supported range was specified for setptn or clrptn) 414 @code{E_NOEXS} - Object does not exist (the eventflag specified by flgid 415 does not exist) 416 417 @code{E_OACV} - Object access violation (A flgid less than -4 was 418 specified from a user task. This is implementation dependent.) 419 420 @code{EN_OBJNO} - An object number which could not be accessed on the 421 target node is specified. 422 423 @code{EN_CTXID} - Specified an object on another node when the system call 424 was issued from a task in dispatch disabled state or from a 425 task-independent portion 426 427 @code{EN_PAR} - A value outside the range supported by the target node 428 and/or transmission packet format was specified as a parameter (a value 429 outside supported range was specified for setptn or clrptn) 334 430 335 431 @subheading DESCRIPTION: 336 432 337 The @code{clr_flg} system call clears the bits of the one word eventflag based on the corresponding zero bits of @code{clrptn}. In other words, a logical product is taken for the values of the eventflag specified by @code{flgid} with the value of @code{clrptn}. 338 339 Issuing @code{clr_flg} never results in wait conditions being released on a task waiting for the specified eventflag. In other words, dispatching never occurs with @code{clr_flg}. 340 341 Nothing will happen to the target eventflag if all bits of @code{clrptn} are specified as 1 with @code{clr_flg}. No error will result. 433 The @code{clr_flg} system call clears the bits of the one word eventflag 434 based on the corresponding zero bits of @code{clrptn}. In other words, a 435 logical product is taken for the values of the eventflag specified by 436 @code{flgid} with the value of @code{clrptn}. 437 438 Issuing @code{clr_flg} never results in wait conditions being released on 439 a task waiting for the specified eventflag. In other words, dispatching 440 never occurs with @code{clr_flg}. 441 442 Nothing will happen to the target eventflag if all bits of @code{clrptn} 443 are specified as 1 with @code{clr_flg}. No error will result. 342 444 343 445 @subheading NOTES: 344 446 345 Multiprocessing is not supported. Thus none of the "@code{EN_}" status codes will be returned. 346 347 @c 348 @c wai_flg 447 Multiprocessing is not supported. Thus none of the "@code{EN_}" status 448 codes will be returned. 449 450 @c 451 @c wai_flg 349 452 @c 350 453 … … 375 478 @code{E_ID} - Invalid ID number (flgid was invalid or could not be used) 376 479 377 @code{E_NOEXS} - Object does not exist (the eventflag specified by flgid does not exist) 378 379 @code{E_OACV} - Object access violation (A flgid less than -4 was specified from a user task. This is implementation dependent.) 380 381 @code{E_PAR} - Parameter error (waiptn = 0, wfmode invalid, or tmout is -2 or less) 382 383 @code{E_OBJ} - Invalid object state (multiple tasks waiting for an eventflag with the TA_WSGL attribute) 384 385 @code{E_DLT} - The object being waited for was deleted (the specified eventflag was deleted while waiting) 386 387 @code{E_RLWAI} - WAIT state was forcibly released (rel_wai was received while waiting) 480 @code{E_NOEXS} - Object does not exist (the eventflag specified by flgid 481 does not exist) 482 483 @code{E_OACV} - Object access violation (A flgid less than -4 was 484 specified from a user task. This is implementation dependent.) 485 486 @code{E_PAR} - Parameter error (waiptn = 0, wfmode invalid, or tmout is -2 487 or less) 488 489 @code{E_OBJ} - Invalid object state (multiple tasks waiting for an 490 eventflag with the TA_WSGL attribute) 491 492 @code{E_DLT} - The object being waited for was deleted (the specified 493 eventflag was deleted while waiting) 494 495 @code{E_RLWAI} - WAIT state was forcibly released (rel_wai was received 496 while waiting) 388 497 389 498 @code{E_TMOUT} - Polling failure or timeout exceeded 390 499 391 @code{E_CTX} - Context error (issued from task-independent portions or a task in dispatch disabled state) 392 393 @code{EN_OBJNO} - An object number which could not be accessed on the target node is specified. 394 395 @code{EN_PAR} - A value outside the range supported by the target node and/or transmission packet format was specified as a parameter (a value outside supported range was specified for waiptn and tmout) 396 397 @code{EN_RPAR} - A value outside the range supported by the requesting node and/or transmission packet format was specified as a parameter (a value exceeding the range for the requesting node was specified for flgptn) 500 @code{E_CTX} - Context error (issued from task-independent portions or a 501 task in dispatch disabled state) 502 503 @code{EN_OBJNO} - An object number which could not be accessed on the 504 target node is specified. 505 506 @code{EN_PAR} - A value outside the range supported by the target node 507 and/or transmission packet format was specified as a parameter (a value 508 outside supported range was specified for waiptn and tmout) 509 510 @code{EN_RPAR} - A value outside the range supported by the requesting 511 node and/or transmission packet format was specified as a parameter (a 512 value exceeding the range for the requesting node was specified for 513 flgptn) 398 514 399 515 @subheading DESCRIPTION: 400 516 401 The @code{wai_flg} system call waits for the eventflag specified by @code{flgid} to be set to satisfy the wait release condition specified by @code{wfmode}. 402 403 If the eventflag specified by @code{flgid} already satisfies the wait release conditions given by @code{wfmode}, the issuing task will continue execution without waiting. @code{wfmode} may be specified as follows. 404 405 @example 406 wfmode := (TWF_ANDW || TWF_ORW) | [TWF_CLR] 407 @end example 408 409 If @code{TWF_ORW} is specified, the issuing task will wait for any of the bits specified by @code{waiptn} to be set for the eventflag given by @code{flgid} (OR wait). If @code{TWF_ANDW} is specified, the issuing task will wait for all of the bits specified by @code{waiptn} to be set for the eventflag given by @code{flgid} (AND wait). 410 411 If the @code{TWF_CLR} specification is not present, the eventflag value will remain unchanged even after the wait conditions have been satisfied and the task has been released from the WAIT state. If @code{TWF_CLR} is specified, all bits of the eventflag will be cleared to 0 once the wait conditions of the waiting task have been satisfied. 412 413 The return parameter flgptn returns the value of the eventflag after the wait state of a task has been released due to this system call. If @code{TWF_CLR} was specified, the value before eventflag bits were cleared is returned. The value returned by @code{flgptn} fulfills the wait release conditions of this system call. 414 415 The @code{pol_flg} system call has the same function as @code{wai_flg} except for the waiting feature. @code{pol_flg} polls whether or not the task should wait if @code{wai_flg} is executed. The meanings of parameters to @code{pol_flg} are the same as for @code{wai_flg}. The specific operations by @code{pol_flg} are as follows. 517 The @code{wai_flg} system call waits for the eventflag specified by 518 @code{flgid} to be set to satisfy the wait release condition specified by 519 @code{wfmode}. 520 521 If the eventflag specified by @code{flgid} already satisfies the wait 522 release conditions given by @code{wfmode}, the issuing task will continue 523 execution without waiting. @code{wfmode} may be specified as follows. 524 525 @example 526 wfmode = TWF_ANDW (or TWF_ORW) | TWF_CLR(optional) 527 @end example 528 529 If @code{TWF_ORW} is specified, the issuing task will wait for any of the 530 bits specified by @code{waiptn} to be set for the eventflag given by 531 @code{flgid} (OR wait). If @code{TWF_ANDW} is specified, the issuing task 532 will wait for all of the bits specified by @code{waiptn} to be set for the 533 eventflag given by @code{flgid} (AND wait). 534 535 If the @code{TWF_CLR} specification is not present, the eventflag value 536 will remain unchanged even after the wait conditions have been satisfied 537 and the task has been released from the WAIT state. If @code{TWF_CLR} is 538 specified, all bits of the eventflag will be cleared to 0 once the wait 539 conditions of the waiting task have been satisfied. 540 541 The return parameter @code{flgptn} returns the value of the eventflag after the 542 wait state of a task has been released due to this system call. If 543 @code{TWF_CLR} was specified, the value before eventflag bits were cleared 544 is returned. The value returned by @code{flgptn} fulfills the wait 545 release conditions of this system call. 546 547 An @code{E_PAR} parameter error will result if @code{waiptn} is 0. 548 549 A task can not execute any of @code{wai_flg, twai_flg} or @code{pol_flg} 550 on an eventflag having the @code{TA_WSGL} attribute if another task is 551 already waiting for that eventflag. An @code{E_OBJ} error will be 552 returned to a task which executes @code{wai_flg} at a later time 553 regardless as to whether or not the task that executes @code{wai_flg} or 554 @code{twai_flg} later will be placed in a WAIT state (conditions for 555 releasing wait state be satisfied). An @code{E_OBJ} error will be 556 returned even to tasks which just execute @code{pol_flg}, again regardless 557 as to whether or not wait release conditions for that task were satisfied. 558 559 On the other hand, multiple tasks can wait at the same time for the same 560 eventflag if that eventflag has the @code{TA_WMUL} attribute. This means 561 that event flags can make queues for tasks to wait on. When such 562 eventflags are used, a single @code{set_flg} call may release multiple 563 waiting tasks. 564 565 The following processing takes place if a queue for allowing multiple 566 tasks to wait has been created for an eventflag with the @code{TA_WMUL} 567 attribute. 416 568 417 569 @itemize @bullet 418 570 419 @item If the target eventflag already satisfies the conditions for releasing wait given by @code{wfmode}, processing is the same as @code{wai_flg}: the eventflag is cleared if @code{TWF_CLR} is specified and the system call completes normally. 420 421 @item If the target eventflag does not yet satisfy the conditions for releasing wait given by wfmode, an @code{E_TMOUT} error is returned to indicate polling failed and the system call finishes. Unlike @code{wai_flg}, the issuing task does not wait in this case. The eventflag is not cleared in this case even if @code{TWF_CLR} has been specified. 571 @item The waiting order on the queue is FIFO. (However, depending on 572 @code{waiptn} and @code{wfmode}, task at the head of the queue will not 573 always be released from waiting.) 574 575 @item If a task specifying that the eventflag be cleared is on the queue, 576 the flag is cleared when that task is released from waiting. 577 578 @item Since any tasks behind a task which clears the eventflag (by 579 specifying @code{TWF_CLR}) will check the eventflag after it is cleared, 580 they will not be released from waiting. 422 581 423 582 @end itemize 424 583 425 The @code{twai_flg} system call has the same function as @code{wai_flg} with an additional timeout feature. A maximum wait time (timeout value) can be specified using the parameter tmout. When a timeout is specified, a timeout error, @code{E_TMOUT}, will result and the system call will finish if the period specified by @code{tmout} 426 elapses without conditions for releasing wait being satisfied. 427 428 Specifying @code{TMO_POL = 0} to @code{twai_flg} for tmout indicates that a timeout value of 0 be used, resulting in exactly the same processing as @code{pol_flg}. Specifying @code{TMO_FEVR = -1} to @code{twai_flg} for tmout indicates that an infinite timeout value be used, resulting in exactly the same processing as @code{wai_flg}. 429 430 An @code{E_PAR} parameter error will result if @code{waiptn} is 0. 431 432 A task can not execute any of @code{wai_flg, twai_flg} or @code{pol_flg} on an eventflag having the @code{TA_WSGL} attribute if another task is already waiting for that eventflag. An @code{E_OBJ} error will be returned to a task which executes @code{wai_flg} at a later time regardless as to whether or not the task that executes @code{wai_flg} or @code{twai_flg} later will be placed in a WAIT state (conditions for releasing wait state be satisfied). An @code{E_OBJ} error will be returned even to tasks which just execute @code{pol_flg}, again regardless as to whether or not wait release conditions for that task were satisfied. 433 434 On the other hand, multiple tasks can wait at the same time for the same eventflag if that eventflag has the @code{TA_WMUL} attribute. This means that event flags can make queues for tasks to wait on. When such eventflags are used, a single @code{set_flg} call may release multiple waiting tasks. 435 436 The following processing takes place if a queue for allowing multiple tasks to wait has been created for an eventflag with the @code{TA_WMUL} attribute. 437 438 @itemize @bullet 439 440 @item The waiting order on the queue is FIFO. (However, depending on @code{waiptn} and @code{wfmode}, task at the head of the queue will not always be released from waiting.) 441 442 @item If a task specifying that the eventflag be cleared is on the queue, the flag is cleared when that task is released from waiting. 443 444 @item Since any tasks behind a task which clears the eventflag (by specifying @code{TWF_CLR}) will check the eventflag after it is cleared, they will not be released from waiting. 445 446 @end itemize 447 448 If multiple tasks having the same priority are released from waiting simultaneously due to @code{set_flg}, the order of tasks on the ready queue after release will be the same as their original order on the eventflag queue. 584 If multiple tasks having the same priority are released from waiting 585 simultaneously due to @code{set_flg}, the order of tasks on the ready 586 queue after release will be the same as their original order on the 587 eventflag queue. 449 588 450 589 @subheading NOTES: 451 590 452 Multiprocessing is not supported. Thus none of the "@code{EN_}" status codes will be returned. 453 454 455 @code{Pol_flg} and @code{wai_flg} represent the same processing as specifying certain values (@code{TMO_POL} or @code{TMO_FEVR}) to @code{twai_flg} for tmout. As such, only @code{twai_flg} is implemented in the kernel; pol_flg and @code{wai_flg} should be implemented as macros which call @code{twai_flg}. 591 Multiprocessing is not supported. Thus none of the "@code{EN_}" status 592 codes will be returned. 593 456 594 457 595 @c … … 485 623 @code{E_ID} - Invalid ID number (flgid was invalid or could not be used) 486 624 487 @code{E_NOEXS} - Object does not exist (the eventflag specified by flgid does not exist) 488 489 @code{E_OACV} - Object access violation (A flgid less than -4 was specified from a user task. This is implementation dependent.) 490 491 @code{E_PAR} - Parameter error (waiptn = 0, wfmode invalid, or tmout is -2 or less) 492 493 @code{E_OBJ} - Invalid object state (multiple tasks waiting for an eventflag with the TA_WSGL attribute) 494 495 @code{E_DLT} - The object being waited for was deleted (the specified eventflag was deleted while waiting) 496 497 @code{E_RLWAI} - WAIT state was forcibly released (rel_wai was received while waiting) 625 @code{E_NOEXS} - Object does not exist (the eventflag specified by flgid 626 does not exist) 627 628 @code{E_OACV} - Object access violation (A flgid less than -4 was 629 specified from a user task. This is implementation dependent.) 630 631 @code{E_PAR} - Parameter error (waiptn = 0, wfmode invalid, or tmout is -2 632 or less) 633 634 @code{E_OBJ} - Invalid object state (multiple tasks waiting for an 635 eventflag with the TA_WSGL attribute) 636 637 @code{E_DLT} - The object being waited for was deleted (the specified 638 eventflag was deleted while waiting) 639 640 @code{E_RLWAI} - WAIT state was forcibly released (rel_wai was received 641 while waiting) 498 642 499 643 @code{E_TMOUT} - Polling failure or timeout exceeded 500 644 501 @code{E_CTX} - Context error (issued from task-independent portions or a task in dispatch disabled state) 502 503 @code{EN_OBJNO} - An object number which could not be accessed on the target node is specified. 504 505 @code{EN_PAR} - A value outside the range supported by the target node and/or transmission packet format was specified as a parameter (a value outside supported range was specified for waiptn and tmout) 506 507 @code{EN_RPAR} - A value outside the range supported by the requesting node and/or transmission packet format was specified as a parameter (a value exceeding the range for the requesting node was specified for flgptn) 645 @code{E_CTX} - Context error (issued from task-independent portions or a 646 task in dispatch disabled state) 647 648 @code{EN_OBJNO} - An object number which could not be accessed on the 649 target node is specified. 650 651 @code{EN_PAR} - A value outside the range supported by the target node 652 and/or transmission packet format was specified as a parameter (a value 653 outside supported range was specified for waiptn and tmout) 654 655 @code{EN_RPAR} - A value outside the range supported by the requesting 656 node and/or transmission packet format was specified as a parameter (a 657 value exceeding the range for the requesting node was specified for 658 flgptn) 508 659 509 660 @subheading DESCRIPTION: 510 661 511 The @code{wai_flg} system call waits for the eventflag specified by @code{flgid} to be set to satisfy the wait release condition specified by @code{wfmode}. 512 513 If the eventflag specified by @code{flgid} already satisfies the wait release conditions given by @code{wfmode}, the issuing task will continue execution without waiting. @code{wfmode} may be specified as follows. 514 515 @example 516 wfmode := (TWF_ANDW || TWF_ORW) | [TWF_CLR] 517 @end example 518 519 If @code{TWF_ORW} is specified, the issuing task will wait for any of the bits specified by @code{waiptn} to be set for the eventflag given by @code{flgid} (OR wait). If @code{TWF_ANDW} is specified, the issuing task will wait for all of the bits specified by @code{waiptn} to be set for the eventflag given by @code{flgid} (AND wait). 520 521 If the @code{TWF_CLR} specification is not present, the eventflag value will remain unchanged even after the wait conditions have been satisfied and the task has been released from the WAIT state. If @code{TWF_CLR} is specified, all bits of the eventflag will be cleared to 0 once the wait conditions of the waiting task have been satisfied. 522 523 The return parameter flgptn returns the value of the eventflag after the wait state of a task has been released due to this system call. If @code{TWF_CLR} was specified, the value before eventflag bits were cleared is returned. The value returned by @code{flgptn} fulfills the wait release conditions of this system call. 524 525 The @code{pol_flg} system call has the same function as @code{wai_flg} except for the waiting feature. @code{pol_flg} polls whether or not the task should wait if @code{wai_flg} is executed. The meanings of parameters to @code{pol_flg} are the same as for @code{wai_flg}. The specific operations by @code{pol_flg} are as follows. 662 The @code{pol_flg} system call has the same function as @code{wai_flg} 663 except for the waiting feature. @code{pol_flg} polls whether or not the 664 task should wait if @code{wai_flg} is executed. The meanings of 665 parameters to @code{pol_flg} are the same as for @code{wai_flg}. The 666 specific operations by @code{pol_flg} are as follows. 526 667 527 668 @itemize @bullet 528 669 529 @item If the target eventflag already satisfies the conditions for releasing wait given by @code{wfmode}, processing is the same as @code{wai_flg}: the eventflag is cleared if @code{TWF_CLR} is specified and the system call completes normally. 530 531 @item If the target eventflag does not yet satisfy the conditions for releasing wait given by wfmode, an @code{E_TMOUT} error is returned to indicate polling failed and the system call finishes. Unlike @code{wai_flg}, the issuing task does not wait in this case. The eventflag is not cleared in this case even if @code{TWF_CLR} has been specified. 532 533 @end itemize 534 535 The @code{twai_flg} system call has the same function as @code{wai_flg} with an additional timeout feature. A maximum wait time (timeout value) can be specified using the parameter tmout. When a timeout is specified, a timeout error, @code{E_TMOUT}, will result and the system call will finish if the period specified by tmout 536 elapses without conditions for releasing wait being satisfied. 537 538 Specifying @code{TMO_POL = 0} to @code{twai_flg} for tmout indicates that a timeout value of 0 be used, resulting in exactly the same processing as @code{pol_flg}. Specifying @code{TMO_FEVR = -1} to @code{twai_flg} for tmout indicates that an infinite timeout value be used, resulting in exactly the same processing as @code{wai_flg}. 539 540 An @code{E_PAR} parameter error will result if @code{waiptn} is 0. 541 542 A task can not execute any of @code{wai_flg, twai_flg} or @code{pol_flg} on an eventflag having the @code{TA_WSGL} attribute if another task is already waiting for that eventflag. An @code{E_OBJ} error will be returned to a task which executes @code{wai_flg} at a later time regardless as to whether or not the task that executes @code{wai_flg} or @code{twai_flg} later will be placed in a WAIT state (conditions for releasing wait state be satisfied). An @code{E_OBJ} error will be returned even to tasks which just execute @code{pol_flg}, again regardless as to whether or not wait release conditions for that task were satisfied. 543 544 On the other hand, multiple tasks can wait at the same time for the same eventflag if that eventflag has the @code{TA_WMUL} attribute. This means that event flags can make queues for tasks to wait on. When such eventflags are used, a single @code{set_flg} call may release multiple waiting tasks. 545 546 The following processing takes place if a queue for allowing multiple tasks to wait has been created for an eventflag with the @code{TA_WMUL} attribute. 547 548 @itemize @bullet 549 550 @item The waiting order on the queue is FIFO. (However, depending on @code{waiptn} and @code{wfmode}, task at the head of the queue will not always be released from waiting.) 551 552 @item If a task specifying that the eventflag be cleared is on the queue, the flag is cleared when that task is released from waiting. 553 554 @item Since any tasks behind a task which clears the eventflag (by specifying @code{TWF_CLR}) will check the eventflag after it is cleared, they will not be released from waiting. 555 556 @end itemize 557 558 If multiple tasks having the same priority are released from waiting simultaneously due to @code{set_flg}, the order of tasks on the ready queue after release will be the same as their original order on the eventflag queue. 670 @item If the target eventflag already satisfies the conditions for 671 releasing wait given by @code{wfmode}, processing is the same as 672 @code{wai_flg}: the eventflag is cleared if @code{TWF_CLR} is specified 673 and the system call completes normally. 674 675 @item If the target eventflag does not yet satisfy the conditions for 676 releasing wait given by @code{wfmode}, an @code{E_TMOUT} error is returned to 677 indicate polling failed and the system call finishes. Unlike 678 @code{wai_flg}, the issuing task does not wait in this case. The eventflag 679 is not cleared in this case even if @code{TWF_CLR} has been specified. 680 681 @end itemize 559 682 560 683 @subheading NOTES: 561 684 562 Multiprocessing is not supported. Thus none of the "@code{EN_}" status codes will be returned. 563 564 565 @code{Pol_flg} and @code{wai_flg} represent the same processing as specifying certain values (@code{TMO_POL} or @code{TMO_FEVR}) to @code{twai_flg} for tmout. As such, only @code{twai_flg} is implemented in the kernel; pol_flg and @code{wai_flg} should be implemented as macros which call @code{twai_flg}. 566 567 @c 568 @c twai_flg, 685 Multiprocessing is not supported. Thus none of the "@code{EN_}" status 686 codes will be returned. 687 688 689 @c 690 @c twai_flg 569 691 @c 570 692 … … 595 717 @code{E_ID} - Invalid ID number (flgid was invalid or could not be used) 596 718 597 @code{E_NOEXS} - Object does not exist (the eventflag specified by flgid does not exist) 598 599 @code{E_OACV} - Object access violation (A flgid less than -4 was specified from a user task. This is implementation dependent.) 600 601 @code{E_PAR} - Parameter error (waiptn = 0, wfmode invalid, or tmout is -2 or less) 602 603 @code{E_OBJ} - Invalid object state (multiple tasks waiting for an eventflag with the TA_WSGL attribute) 604 605 @code{E_DLT} - The object being waited for was deleted (the specified eventflag was deleted while waiting) 606 607 @code{E_RLWAI} - WAIT state was forcibly released (rel_wai was received while waiting) 719 @code{E_NOEXS} - Object does not exist (the eventflag specified by flgid 720 does not exist) 721 722 @code{E_OACV} - Object access violation (A flgid less than -4 was 723 specified from a user task. This is implementation dependent.) 724 725 @code{E_PAR} - Parameter error (waiptn = 0, wfmode invalid, or tmout is -2 726 or less) 727 728 @code{E_OBJ} - Invalid object state (multiple tasks waiting for an 729 eventflag with the TA_WSGL attribute) 730 731 @code{E_DLT} - The object being waited for was deleted (the specified 732 eventflag was deleted while waiting) 733 734 @code{E_RLWAI} - WAIT state was forcibly released (rel_wai was received 735 while waiting) 608 736 609 737 @code{E_TMOUT} - Polling failure or timeout exceeded 610 738 611 @code{E_CTX} - Context error (issued from task-independent portions or a task in dispatch disabled state) 612 613 @code{EN_OBJNO} - An object number which could not be accessed on the target node is specified. 614 615 @code{EN_PAR} - A value outside the range supported by the target node and/or transmission packet format was specified as a parameter (a value outside supported range was specified for waiptn and tmout) 616 617 @code{EN_RPAR} - A value outside the range supported by the requesting node and/or transmission packet format was specified as a parameter (a value exceeding the range for the requesting node was specified for flgptn) 739 @code{E_CTX} - Context error (issued from task-independent portions or a 740 task in dispatch disabled state) 741 742 @code{EN_OBJNO} - An object number which could not be accessed on the 743 target node is specified. 744 745 @code{EN_PAR} - A value outside the range supported by the target node 746 and/or transmission packet format was specified as a parameter (a value 747 outside supported range was specified for waiptn and tmout) 748 749 @code{EN_RPAR} - A value outside the range supported by the requesting 750 node and/or transmission packet format was specified as a parameter (a 751 value exceeding the range for the requesting node was specified for 752 flgptn) 618 753 619 754 @subheading DESCRIPTION: 620 755 621 The @code{wai_flg} system call waits for the eventflag specified by @code{flgid} to be set to satisfy the wait release condition specified by @code{wfmode}. 622 623 If the eventflag specified by @code{flgid} already satisfies the wait release conditions given by @code{wfmode}, the issuing task will continue execution without waiting. 624 625 626 @code{wfmode} may be specified as follows. 627 @example 628 wfmode := (TWF_ANDW || TWF_ORW) | [TWF_CLR] 629 @end example 630 If @code{TWF_ORW} is specified, the issuing task will wait for any of the bits specified by @code{waiptn} to be set for the eventflag given by @code{flgid} (OR wait). If @code{TWF_ANDW} is specified, the issuing task will wait for all of the bits specified by @code{waiptn} to be set for the eventflag given by @code{flgid} (AND wait). 631 632 If the @code{TWF_CLR} specification is not present, the eventflag value will remain unchanged even after the wait conditions have been satisfied and the task has been released from the WAIT state. If @code{TWF_CLR} is specified, all bits of the eventflag will be cleared to 0 once the wait conditions of the waiting task have been satisfied. 633 634 The return parameter flgptn returns the value of the eventflag after the wait state of a task has been released due to this system call. If @code{TWF_CLR} was specified, the value before eventflag bits were cleared is returned. The value returned by @code{flgptn} fulfills the wait release conditions of this system call. 635 636 The @code{pol_flg} system call has the same function as @code{wai_flg} except for the waiting feature. @code{pol_flg} polls whether or not the task should wait if @code{wai_flg} is executed. The meanings of parameters to @code{pol_flg} are the same as for @code{wai_flg}. The specific operations by @code{pol_flg} are as follows. 637 638 @itemize @bullet 639 640 @item If the target eventflag already satisfies the conditions for releasing wait given by @code{wfmode}, processing is the same as @code{wai_flg}: the eventflag is cleared if @code{TWF_CLR} is specified and the system call completes normally. 641 642 @item If the target eventflag does not yet satisfy the conditions for releasing wait given by wfmode, an @code{E_TMOUT} error is returned to indicate polling failed and the system call finishes. Unlike @code{wai_flg}, the issuing task does not wait in this case. The eventflag is not cleared in this case even if @code{TWF_CLR} has been specified. 643 644 @end itemize 645 646 The @code{twai_flg} system call has the same function as @code{wai_flg} with an additional timeout feature. A maximum wait time (timeout value) can be specified using the parameter tmout. When a timeout is specified, a timeout error, @code{E_TMOUT}, will result and the system call will finish if the period specified by tmout 647 elapses without conditions for releasing wait being satisfied. 648 649 Specifying @code{TMO_POL = 0} to @code{twai_flg} for tmout indicates that a timeout value of 0 be used, resulting in exactly the same processing as @code{pol_flg}. Specifying @code{TMO_FEVR = -1} to @code{twai_flg} for tmout indicates that an infinite timeout value be used, resulting in exactly the same processing as @code{wai_flg}. 650 651 An @code{E_PAR} parameter error will result if @code{waiptn} is 0. 652 653 A task can not execute any of @code{wai_flg, twai_flg} or @code{pol_flg} on an eventflag having the @code{TA_WSGL} attribute if another task is already waiting for that eventflag. An @code{E_OBJ} error will be returned to a task which executes @code{wai_flg} at a later time regardless as to whether or not the task that executes @code{wai_flg} or @code{twai_flg} later will be placed in a WAIT state (conditions for releasing wait state be satisfied). An @code{E_OBJ} error will be returned even to tasks which just execute @code{pol_flg}, again regardless as to whether or not wait release conditions for that task were satisfied. 654 655 On the other hand, multiple tasks can wait at the same time for the same eventflag if that eventflag has the @code{TA_WMUL} attribute. This means that event flags can make queues for tasks to wait on. When such eventflags are used, a single @code{set_flg} call may release multiple waiting tasks. 656 657 The following processing takes place if a queue for allowing multiple tasks to wait has been created for an eventflag with the @code{TA_WMUL} attribute. 658 659 @itemize @bullet 660 661 @item The waiting order on the queue is FIFO. (However, depending on @code{waiptn} and @code{wfmode}, task at the head of the queue will not always be released from waiting.) 662 663 @item If a task specifying that the eventflag be cleared is on the queue, the flag is cleared when that task is released from waiting. 664 665 @item Since any tasks behind a task which clears the eventflag (by specifying @code{TWF_CLR}) will check the eventflag after it is cleared, they will not be released from waiting. 666 667 @end itemize 668 669 If multiple tasks having the same priority are released from waiting simultaneously due to @code{set_flg}, the order of tasks on the ready queue after release will be the same as their original order on the eventflag queue. 756 The @code{twai_flg} system call has the same function as @code{wai_flg} 757 with an additional timeout feature. A maximum wait time (timeout value) 758 can be specified using the parameter @code{tmout}. When a timeout is specified, 759 a timeout error, @code{E_TMOUT}, will result and the system call will 760 finish if the period specified by @code{tmout} elapses without conditions for 761 releasing wait being satisfied. 762 763 Specifying @code{TMO_POL = 0} to @code{twai_flg} for @code{tmout} indicates that 764 a timeout value of 0 be used, resulting in exactly the same processing as 765 @code{pol_flg}. Specifying @code{TMO_FEVR = -1} to @code{twai_flg} for 766 @code{tmout} indicates that an infinite timeout value be used, resulting in 767 exactly the same processing as @code{wai_flg}. 670 768 671 769 @subheading NOTES: 672 770 673 Multiprocessing is not supported. Thus none of the "@code{EN_}" status codes will be returned. 674 675 676 @code{Pol_flg} and @code{wai_flg} represent the same processing as specifying certain values (@code{TMO_POL} or @code{TMO_FEVR}) to @code{twai_flg} for tmout. As such, only @code{twai_flg} is implemented in the kernel; pol_flg and @code{wai_flg} should be implemented as macros which call @code{twai_flg}. 771 Multiprocessing is not supported. Thus none of the "@code{EN_}" status 772 codes will be returned. 773 774 775 @code{Pol_flg} and @code{wai_flg} represent the same processing as 776 specifying certain values (@code{TMO_POL} or @code{TMO_FEVR}) to 777 @code{twai_flg} for tmout. As such, only @code{twai_flg} is implemented 778 in the kernel; @code{pol_flg} and @code{wai_flg} should be implemented as macros 779 which call @code{twai_flg}. 677 780 678 781 @c … … 689 792 ER ref_flg( 690 793 T_RFLG *pk_rflg, 691 ID flgid 692 ); 794 ID flgid ); 693 795 @end example 694 796 @end ifset … … 704 806 @code{E_ID} - Invalid ID number (flgid was invalid or could not be used) 705 807 706 @code{E_NOEXS} - Object does not exist (the eventflag specified by flgid does not exist) 707 708 @code{E_OACV} - Object access violation (A flgid less than -4 was specified from a user task. This is implementation dependent.) 709 710 @code{E_PAR} - Parameter error (the packet address for the return parameters could not be used) 711 712 @code{EN_OBJNO} - An object number which could not be accessed on the target node is specified. 713 714 @code{EN_CTXID} - Specified an object on another node when the system call was issued from a task in dispatch disabled state or from a task-independent portion 715 716 @code{EN_RPAR} - A value outside the range supported by the requesting node and/or transmission packet format was returned as a parameter (a value outside supported range was specified for exinf, wtsk and/or flgptn) 808 @code{E_NOEXS} - Object does not exist (the eventflag specified by flgid 809 does not exist) 810 811 @code{E_OACV} - Object access violation (A flgid less than -4 was 812 specified from a user task. This is implementation dependent.) 813 814 @code{E_PAR} - Parameter error (the packet address for the return 815 parameters could not be used) 816 817 @code{EN_OBJNO} - An object number which could not be accessed on the 818 target node is specified. 819 820 @code{EN_CTXID} - Specified an object on another node when the system call 821 was issued from a task in dispatch disabled state or from a 822 task-independent portion 823 824 @code{EN_RPAR} - A value outside the range supported by the requesting 825 node and/or transmission packet format was returned as a parameter (a 826 value outside supported range was specified for exinf, wtsk and/or flgptn) 717 827 718 828 @subheading DESCRIPTION: 719 829 720 This system call refers to the state of the eventflag specified by @code{flgid}, and returns its current flag pattern (@code{flgptn}), waiting task information (@code{wtsk}), and its extended information (@code{exinf}). 721 722 Depending on the implementation, @code{wtsk} may be returned as the ID (non-zero) of the task waiting for the eventflag. If there are multiple tasks waiting for the eventflag (only when attribute is @code{TA_WMUL}), 830 This system call refers to the state of the eventflag specified by 831 @code{flgid}, and returns its current flag pattern (@code{flgptn}), 832 waiting task information (@code{wtsk}), and its extended information 833 (@code{exinf}). 834 835 Depending on the implementation, @code{wtsk} may be returned as the ID 836 (non-zero) of the task waiting for the eventflag. If there are multiple 837 tasks waiting for the eventflag (only when attribute is @code{TA_WMUL}), 723 838 the ID of the task at the head of the queue is returned. 724 839 725 An @code{E_NOEXS} error will result if the eventflag specified to @code{ref_flg} does not exist. 840 An @code{E_NOEXS} error will result if the eventflag specified to 841 @code{ref_flg} does not exist. 726 842 727 843 @subheading NOTES: 728 844 729 Multiprocessing is not supported. Thus none of the "@code{EN_}" status codes will be returned. 730 731 Although both @code{ref_flg} and @code{pol_flg} can be used to find an eventflag's pattern (@code{flgptn}) without causing the issuing task to wait, @code{ref_flg} simply reads the eventflag's pattern (@code{flgptn}) while @code{pol_flg} functions is identical to @code{wai_flg} when wait release conditions are satisfied (it clears the eventflag if @code{TWF_CLR} is specified). 732 733 Depending on the implementation, additional information besides @code{wtsk} and @code{flgptn} (such as eventflag attributes, @code{flgatr}) may also be referred. 734 845 Multiprocessing is not supported. Thus none of the "@code{EN_}" status 846 codes will be returned. 847 848 Although both @code{ref_flg} and @code{pol_flg} can be used to find an 849 eventflag's pattern (@code{flgptn}) without causing the issuing task to 850 wait, @code{ref_flg} simply reads the eventflag's pattern (@code{flgptn}) 851 while @code{pol_flg} functions is identical to @code{wai_flg} when wait 852 release conditions are satisfied (it clears the eventflag if 853 @code{TWF_CLR} is specified). 854 855 Depending on the implementation, additional information besides 856 @code{wtsk} and @code{flgptn} (such as eventflag attributes, 857 @code{flgatr}) may also be referred. 858
Note: See TracChangeset
for help on using the changeset viewer.