Changeset 8744498 in rtems


Ignore:
Timestamp:
Oct 27, 2017, 7:04:53 AM (18 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
0719fc6
Parents:
1d572eba
git-author:
Sebastian Huber <sebastian.huber@…> (10/27/17 07:04:53)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/28/17 11:10:47)
Message:

score: Fix _Scheduler_Set_affinity()

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/scheduleredfsmp.c

    r1d572eba r8744498  
    754754  Scheduler_Context *context;
    755755  Processor_mask     a;
    756   Processor_mask     b;
     756  uint32_t           count;
    757757  uint32_t           rqi;
    758758
    759759  context = _Scheduler_Get_context( scheduler );
    760760  _Processor_mask_And( &a, &context->Processors, affinity );
    761 
    762   if ( _Processor_mask_Count( &a ) == 0 ) {
     761  count = _Processor_mask_Count( &a );
     762
     763  if ( count == 0 ) {
    763764    return false;
    764765  }
    765766
    766   _Processor_mask_And( &b, &_SMP_Online_processors, affinity );
    767 
    768   if ( _Processor_mask_Count( &b ) == _SMP_Processor_count ) {
     767  if ( count == _SMP_Processor_count ) {
    769768    rqi = 0;
    770769  } else {
  • cpukit/score/src/schedulersetaffinity.c

    r1d572eba r8744498  
    3737  }
    3838
     39  /*
     40   * Reduce affinity set to the online processors to be in line with
     41   * _Thread_Initialize() which sets the default affinity to the set of online
     42   * processors.
     43   */
     44  _Processor_mask_And( &affinity, &_SMP_Online_processors, &affinity );
     45
    3946  scheduler = _Thread_Scheduler_get_home( the_thread );
    4047  _Scheduler_Acquire_critical( scheduler, &lock_context );
  • testsuites/sptests/spscheduler01/init.c

    r1d572eba r8744498  
    11/*
    2  * Copyright (c) 2014, 2016 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2014, 2017 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
     
    4444  rtems_status_code sc;
    4545  cpu_set_t cpusetone;
     46  cpu_set_t cpusetall;
    4647  cpu_set_t cpuset;
    4748  size_t big = 2 * CHAR_BIT * sizeof(cpu_set_t);
     
    5253  CPU_ZERO(&cpusetone);
    5354  CPU_SET(0, &cpusetone);
     55
     56  CPU_FILL(&cpusetall);
    5457
    5558  sc = rtems_task_create(
     
    100103  rtems_test_assert(CPU_EQUAL(&cpuset, &cpusetone));
    101104
     105  sc = rtems_task_set_affinity(RTEMS_SELF, sizeof(cpusetall), &cpusetall);
     106  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     107
     108  sc = rtems_task_get_affinity(task_id, sizeof(cpuset), &cpuset);
     109  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     110
     111  rtems_test_assert(CPU_EQUAL(&cpuset, &cpusetone));
     112
    102113  cpusetbigone = CPU_ALLOC(big);
    103114  rtems_test_assert(cpusetbigone != NULL);
Note: See TracChangeset for help on using the changeset viewer.