Changeset ecabd384 in rtems


Ignore:
Timestamp:
Jul 11, 2017, 7:51:43 AM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
e7ee719f
Parents:
548d65a
git-author:
Sebastian Huber <sebastian.huber@…> (07/11/17 07:51:43)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/11/17 12:16:59)
Message:

rtems: Add rtems_scheduler_ident_by_processor_set

Update #3070.

Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/Makefile.am

    r548d65a recabd384  
    110110librtems_a_SOURCES += src/schedulerident.c
    111111librtems_a_SOURCES += src/scheduleridentbyprocessor.c
     112librtems_a_SOURCES += src/scheduleridentbyprocessorset.c
    112113librtems_a_SOURCES += src/schedulerremoveprocessor.c
    113114
  • cpukit/rtems/include/rtems/rtems/tasks.h

    r548d65a recabd384  
    578578
    579579/**
     580 * @brief Identifies a scheduler by a processor set.
     581 *
     582 * The scheduler is selected according to the highest numbered online processor
     583 * in the specified processor set.
     584 *
     585 * @param[in] cpusetsize Size of the specified processor set buffer in
     586 *   bytes.  This value must be positive.
     587 * @param[out] cpuset The processor set to identify the scheduler.
     588 * @param[out] id The scheduler identifier associated with the processor set.
     589 *
     590 * @retval RTEMS_SUCCESSFUL Successful operation.
     591 * @retval RTEMS_INVALID_ADDRESS The @a id parameter is @c NULL.
     592 * @retval RTEMS_INVALID_SIZE Invalid processor set size.
     593 * @retval RTEMS_INVALID_NAME The processor set contains no online processor.
     594 * @retval RTEMS_INCORRECT_STATE The processor set is valid, however, the
     595 *   highest numbered online processor in the specified processor set is not
     596 *   owned by a scheduler.
     597 */
     598rtems_status_code rtems_scheduler_ident_by_processor_set(
     599  size_t           cpusetsize,
     600  const cpu_set_t *cpuset,
     601  rtems_id        *id
     602);
     603
     604/**
    580605 * @brief Gets the set of processors owned by the specified scheduler instance.
    581606 *
  • testsuites/smptests/smpscheduler02/init.c

    r548d65a recabd384  
    135135
    136136  if (rtems_get_processor_count() > 1) {
     137    rtems_id scheduler_id;
    137138    rtems_id scheduler_b_id;
    138139    rtems_id task_id;
     140    cpu_set_t first_cpu;
    139141
    140142    sc = rtems_scheduler_ident(SCHED_B, &scheduler_b_id);
     
    153155
    154156    rtems_test_assert(rtems_get_current_processor() == 1);
     157
     158    CPU_ZERO(&first_cpu);
     159    CPU_SET(0, &first_cpu);
     160    sc = rtems_scheduler_ident_by_processor_set(
     161      sizeof(first_cpu),
     162      &first_cpu,
     163      &scheduler_id
     164    );
     165    rtems_test_assert(sc == RTEMS_INCORRECT_STATE);
    155166
    156167    sc = rtems_scheduler_add_processor(scheduler_a_id, 0);
  • testsuites/sptests/spscheduler01/init.c

    r548d65a recabd384  
    344344  rtems_name name = BLUE;
    345345  rtems_name invalid_name = RED;
     346  cpu_set_t s;
    346347
    347348  sc = rtems_scheduler_ident(name, NULL);
     
    365366  scheduler_id = 0;
    366367  sc = rtems_scheduler_ident_by_processor(0, &scheduler_id);
     368  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     369
     370  rtems_test_assert(scheduler_id == expected_id);
     371
     372  CPU_ZERO(&s);
     373  CPU_SET(1, &s);
     374  sc = rtems_scheduler_ident_by_processor_set(sizeof(s), &s, NULL);
     375  rtems_test_assert(sc == RTEMS_INVALID_ADDRESS);
     376
     377  sc = rtems_scheduler_ident_by_processor_set(1, &s, &scheduler_id);
     378  rtems_test_assert(sc == RTEMS_INVALID_SIZE);
     379
     380  sc = rtems_scheduler_ident_by_processor_set(sizeof(s), &s, &scheduler_id);
     381  rtems_test_assert(sc == RTEMS_INVALID_NAME);
     382
     383  CPU_SET(0, &s);
     384  scheduler_id = 0;
     385  sc = rtems_scheduler_ident_by_processor_set(sizeof(s), &s, &scheduler_id);
    367386  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    368387
Note: See TracChangeset for help on using the changeset viewer.