Changeset 548d65a in rtems


Ignore:
Timestamp:
Jul 11, 2017, 5:24:39 AM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
ecabd384
Parents:
c29eb085
git-author:
Sebastian Huber <sebastian.huber@…> (07/11/17 05:24:39)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/11/17 12:16:58)
Message:

rtems: Add rtems_scheduler_ident_by_processor()

Update #3069.

Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/Makefile.am

    rc29eb085 r548d65a  
    109109librtems_a_SOURCES += src/schedulergetprocessorset.c
    110110librtems_a_SOURCES += src/schedulerident.c
     111librtems_a_SOURCES += src/scheduleridentbyprocessor.c
    111112librtems_a_SOURCES += src/schedulerremoveprocessor.c
    112113
  • cpukit/rtems/include/rtems/rtems/tasks.h

    rc29eb085 r548d65a  
    561561
    562562/**
     563 * @brief Identifies a scheduler by a processor index.
     564 *
     565 * @param[in] cpu_index The processor index.
     566 * @param[out] id The scheduler identifier associated with the processor index.
     567 *
     568 * @retval RTEMS_SUCCESSFUL Successful operation.
     569 * @retval RTEMS_INVALID_ADDRESS The @a id parameter is @c NULL.
     570 * @retval RTEMS_INVALID_NAME Invalid processor index.
     571 * @retval RTEMS_INCORRECT_STATE The processor index is valid, however, this
     572 *   processor is not owned by a scheduler.
     573 */
     574rtems_status_code rtems_scheduler_ident_by_processor(
     575  uint32_t  cpu_index,
     576  rtems_id *id
     577);
     578
     579/**
    563580 * @brief Gets the set of processors owned by the specified scheduler instance.
    564581 *
  • testsuites/smptests/smpfatal04/init.c

    rc29eb085 r548d65a  
    4646      && code == SMP_FATAL_BOOT_PROCESSOR_NOT_ASSIGNED_TO_SCHEDULER
    4747  ) {
     48    rtems_status_code sc;
     49    rtems_id id;
     50
     51    sc = rtems_scheduler_ident_by_processor(0, &id);
     52    assert(sc == RTEMS_INCORRECT_STATE);
     53
    4854    TEST_END();
    4955  }
  • testsuites/sptests/spscheduler01/init.c

    rc29eb085 r548d65a  
    356356
    357357  rtems_test_assert(scheduler_id == expected_id);
     358
     359  sc = rtems_scheduler_ident_by_processor(1, NULL);
     360  rtems_test_assert(sc == RTEMS_INVALID_ADDRESS);
     361
     362  sc = rtems_scheduler_ident_by_processor(1, &scheduler_id);
     363  rtems_test_assert(sc == RTEMS_INVALID_NAME);
     364
     365  scheduler_id = 0;
     366  sc = rtems_scheduler_ident_by_processor(0, &scheduler_id);
     367  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     368
     369  rtems_test_assert(scheduler_id == expected_id);
    358370}
    359371
Note: See TracChangeset for help on using the changeset viewer.