- Timestamp:
- 04/16/14 14:06:05 (10 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 10e613ba
- Parents:
- babb1a2c
- git-author:
- Sebastian Huber <sebastian.huber@…> (04/16/14 14:06:05)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (04/17/14 06:06:39)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/user/smp.t
rbabb1a2c rf830029 20 20 @item @code{rtems_scheduler_get_processor_set} - Get processor set of a scheduler 21 21 @item @code{rtems_task_get_scheduler} - Get scheduler of a task 22 @item @code{rtems_task_set_scheduler} - Set scheduler of a task 22 23 @item @code{rtems_task_get_affinity} - Get task processor affinity 23 24 @item @code{rtems_task_set_affinity} - Set task processor affinity … … 410 411 411 412 @c 413 @c rtems_task_set_scheduler 414 @c 415 @page 416 @subsection TASK_SET_SCHEDULER - Set scheduler of a task 417 418 @subheading CALLING SEQUENCE: 419 420 @ifset is-C 421 @example 422 rtems_status_code rtems_task_set_scheduler( 423 rtems_id id, 424 rtems_id scheduler_id 425 ); 426 @end example 427 @end ifset 428 429 @ifset is-Ada 430 @end ifset 431 432 @subheading DIRECTIVE STATUS CODES: 433 434 @code{@value{RPREFIX}SUCCESSFUL} - successful operation@* 435 @code{@value{RPREFIX}INVALID_ID} - invalid task or scheduler id@* 436 @code{@value{RPREFIX}INCORRECT_STATE} - the task is in the wrong state to 437 perform a scheduler change 438 439 @subheading DESCRIPTION: 440 441 Sets the scheduler of a task specified by @code{scheduler_id}. The scheduler 442 of a task is initialized to the scheduler of the task that created it. 443 444 @subheading NOTES: 445 446 None. 447 448 @subheading EXAMPLE: 449 450 @example 451 @group 452 #include <rtems.h> 453 #include <assert.h> 454 455 void task(rtems_task_argument arg); 456 457 void example(void) 458 @{ 459 rtems_status_code sc; 460 rtems_id task_id; 461 rtems_id scheduler_id; 462 rtems_name scheduler_name; 463 464 scheduler_name = rtems_build_name('W', 'O', 'R', 'K'); 465 466 sc = rtems_scheduler_ident(scheduler_name, &scheduler_id); 467 assert(sc == RTEMS_SUCCESSFUL); 468 469 sc = rtems_task_create( 470 rtems_build_name('T', 'A', 'S', 'K'), 471 1, 472 RTEMS_MINIMUM_STACK_SIZE, 473 RTEMS_DEFAULT_MODES, 474 RTEMS_DEFAULT_ATTRIBUTES, 475 &task_id 476 ); 477 assert(sc == RTEMS_SUCCESSFUL); 478 479 sc = rtems_task_set_scheduler(task_id, scheduler_id); 480 assert(sc == RTEMS_SUCCESSFUL); 481 482 sc = rtems_task_start(task_id, task, 0); 483 assert(sc == RTEMS_SUCCESSFUL); 484 @} 485 @end group 486 @end example 487 488 @c 412 489 @c rtems_task_get_affinity 413 490 @c
Note: See TracChangeset
for help on using the changeset viewer.