Changeset 03c9f24 in rtems


Ignore:
Timestamp:
Apr 5, 2019, 6:03:12 AM (14 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
f9219db
Parents:
3c50c328
git-author:
Sebastian Huber <sebastian.huber@…> (04/05/19 06:03:12)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/09/19 06:06:46)
Message:

rtems: Add rtems_scheduler_get_processor()

Add rtems_scheduler_get_processor() as a replacement for
rtems_get_current_processor(). The rtems_get_current_processor() is a
bit orphaned. Adopt it by the Scheduler Manager. This is in line with
the glibc sched_getcpu() function.

Deprecate rtems_get_current_processor().

Update #3731.

Files:
40 edited

Legend:

Unmodified
Added
Removed
  • bsps/powerpc/qoriq/start/bsprestart.c

    r3c50c328 r03c9f24  
    7070  _SMP_barrier_Wait(&restart_barrier, &bs, _SMP_Processor_count);
    7171
    72   cpu_self_index = rtems_get_current_processor();
     72  cpu_self_index = rtems_scheduler_get_processor();
    7373  thread_index = cpu_self_index % QORIQ_THREAD_COUNT;
    7474
  • bsps/sparc/leon3/start/bspclean.c

    r3c50c328 r03c9f24  
    4949       */
    5050      uint32_t max_wait = 1234567;
    51       uint32_t self_cpu = rtems_get_current_processor();
     51      uint32_t self_cpu = rtems_scheduler_get_processor();
    5252      uint32_t cpu_count = rtems_get_processor_count();
    5353      uint32_t halt_mask = 0;
  • cpukit/include/rtems/rtems/smp.h

    r3c50c328 r03c9f24  
    5050uint32_t rtems_get_processor_count(void);
    5151
    52 /**
    53  * @brief Returns the index of the current processor.
    54  *
    55  * On uni-processor configurations a value of zero will be returned.
    56  *
    57  * On SMP configurations an architecture specific method is used to obtain the
    58  * index of the current processor in the system.  The set of processor indices
    59  * is the range of integers starting with zero up to the processor count minus
    60  * one.
    61  *
    62  * Outside of sections with disabled thread dispatching the current processor
    63  * index may change after every instruction since the thread may migrate from
    64  * one processor to another.  Sections with disabled interrupts are sections
    65  * with thread dispatching disabled.
    66  *
    67  * @return The index of the current processor.
    68  */
    69 uint32_t rtems_get_current_processor(void);
    70 
    7152/** @} */
    7253
  • cpukit/include/rtems/rtems/tasks.h

    r3c50c328 r03c9f24  
    585585
    586586/**
     587 * @brief Returns the index of the current processor.
     588 *
     589 * In uniprocessor configurations, a value of zero will be returned.
     590 *
     591 * In SMP configurations, an architecture specific method is used to obtain the
     592 * index of the current processor in the system.  The set of processor indices
     593 * is the range of integers starting with zero up to the processor count minus
     594 * one.
     595 *
     596 * Outside of sections with disabled thread dispatching the current processor
     597 * index may change after every instruction since the thread may migrate from
     598 * one processor to another.  Sections with disabled interrupts are sections
     599 * with thread dispatching disabled.
     600 *
     601 * @return The index of the current processor.
     602 */
     603uint32_t rtems_scheduler_get_processor( void );
     604
     605/**
     606 * @brief Returns the index of the current processor.
     607 *
     608 * @return The index of the current processor.
     609 *
     610 * @deprecated
     611 *
     612 * Use rtems_scheduler_get_processor() instead.
     613 */
     614RTEMS_DEPRECATED RTEMS_INLINE_ROUTINE uint32_t
     615rtems_get_current_processor( void )
     616{
     617  return rtems_scheduler_get_processor();
     618}
     619
     620/**
    587621 * @brief Gets the set of processors owned by the specified scheduler instance.
    588622 *
  • cpukit/libmisc/capture/capture.c

    r3c50c328 r03c9f24  
    357357{
    358358  rtems_capture_per_cpu_data* cpu;
    359   cpu = capture_per_cpu_get (rtems_get_current_processor ());
     359  cpu = capture_per_cpu_get (rtems_scheduler_get_processor ());
    360360  rtems_interrupt_lock_interrupt_disable (&context->lock_context);
    361361  context->lock = &cpu->lock;
     
    380380  size += sizeof (rtems_capture_record);
    381381
    382   cpu = capture_per_cpu_get (rtems_get_current_processor ());
     382  cpu = capture_per_cpu_get (rtems_scheduler_get_processor ());
    383383
    384384  rtems_capture_record_lock (context);
  • cpukit/libtest/t-test-rtems-measure.c

    r3c50c328 r03c9f24  
    116116        chunk_size = ctx->chunk_size;
    117117        cache_line_size = ctx->cache_line_size;
    118         token = (unsigned int)rtems_get_current_processor();
     118        token = (unsigned int)rtems_scheduler_get_processor();
    119119
    120120        token = dirty_data_cache(chunk, chunk_size, cache_line_size, token);
  • cpukit/libtest/testparallel.c

    r3c50c328 r03c9f24  
    7575      rtems_interrupt_local_disable(level);
    7676      _SMP_barrier_Wait(&ctx->barrier, &bs, ctx->worker_count);
    77       worker_index = rtems_get_current_processor();
     77      worker_index = rtems_scheduler_get_processor();
    7878      rtems_interrupt_local_enable(level);
    7979
  • cpukit/rtems/src/getcurrentprocessor.c

    r3c50c328 r03c9f24  
    1717#endif
    1818
    19 #include <rtems/rtems/smp.h>
     19#include <rtems/rtems/tasks.h>
    2020#include <rtems/score/smp.h>
    2121
    22 uint32_t rtems_get_current_processor(void)
     22uint32_t rtems_scheduler_get_processor(void)
    2323{
    2424  return _SMP_Get_current_processor();
  • testsuites/smptests/smp01/init.c

    r3c50c328 r03c9f24  
    3636  bool               allDone;
    3737
    38   cpu_self = rtems_get_current_processor();
     38  cpu_self = rtems_scheduler_get_processor();
    3939
    4040  /* XXX - Delay a bit to allow debug messages from
  • testsuites/smptests/smp01/tasks.c

    r3c50c328 r03c9f24  
    2929
    3030   /* Get the CPU Number */
    31   cpu_num = rtems_get_current_processor();
     31  cpu_num = rtems_scheduler_get_processor();
    3232
    3333  /* Print that the task is up and running. */
  • testsuites/smptests/smp02/init.c

    r3c50c328 r03c9f24  
    7474    );
    7575
    76     cpu_num = rtems_get_current_processor();
     76    cpu_num = rtems_scheduler_get_processor();
    7777    locked_printf(" CPU %" PRIu32 " start task TA%c\n", cpu_num, ch);
    7878    status = rtems_task_start( id, Test_task, i+1 );
  • testsuites/smptests/smp02/tasks.c

    r3c50c328 r03c9f24  
    3535  rtems_status_code sc;
    3636
    37   cpu_num = rtems_get_current_processor();
     37  cpu_num = rtems_scheduler_get_processor();
    3838
    3939  do {
  • testsuites/smptests/smp03/init.c

    r3c50c328 r03c9f24  
    3838  uint32_t cpu_num;
    3939
    40   cpu_num = rtems_get_current_processor();
     40  cpu_num = rtems_scheduler_get_processor();
    4141
    4242  locked_printf("  CPU %" PRIu32 " running task %s\n", cpu_num, task_name );
  • testsuites/smptests/smp05/init.c

    r3c50c328 r03c9f24  
    3636)
    3737{
    38   locked_printf( "Shut down from CPU %" PRIu32 "\n", rtems_get_current_processor() );
     38  locked_printf( "Shut down from CPU %" PRIu32 "\n", rtems_scheduler_get_processor() );
    3939  success();
    4040}
     
    7070    directive_failed( status, "task create" );
    7171
    72     cpu_num = rtems_get_current_processor();
     72    cpu_num = rtems_scheduler_get_processor();
    7373    locked_printf(" CPU %" PRIu32 " start task TA%c\n", cpu_num, ch);
    7474
  • testsuites/smptests/smp07/init.c

    r3c50c328 r03c9f24  
    4949
    5050   /* Get the CPU Number */
    51   cpu_num = rtems_get_current_processor();
     51  cpu_num = rtems_scheduler_get_processor();
    5252
    5353  /* Print that the task is up and running. */
     
    131131  directive_failed( status, "task create" );
    132132
    133   cpu_num = rtems_get_current_processor();
     133  cpu_num = rtems_scheduler_get_processor();
    134134  locked_printf(" CPU %d start task TA1\n", cpu_num );
    135135  status = rtems_task_start( id, Test_task, 1 );
  • testsuites/smptests/smp08/init.c

    r3c50c328 r03c9f24  
    2424  uint32_t cpu_num;
    2525
    26   cpu_num = rtems_get_current_processor();
     26  cpu_num = rtems_scheduler_get_processor();
    2727
    2828  /* Print the cpu number and task name */
  • testsuites/smptests/smp09/init.c

    r3c50c328 r03c9f24  
    6767    directive_failed( status, "task create" );
    6868
    69     cpu_num = rtems_get_current_processor();
     69    cpu_num = rtems_scheduler_get_processor();
    7070    locked_printf(" CPU %" PRIu32 " start task TA%c\n", cpu_num, ch);
    7171
  • testsuites/smptests/smpatomic01/init.c

    r3c50c328 r03c9f24  
    488488   * by the system topology.
    489489   */
    490   cpu_self_index = rtems_get_current_processor();
     490  cpu_self_index = rtems_scheduler_get_processor();
    491491
    492492  /* Store release and load acquire test case */
     
    639639   * by the system topology.
    640640   */
    641   cpu_self_index = rtems_get_current_processor();
     641  cpu_self_index = rtems_scheduler_get_processor();
    642642
    643643  if (cpu_self_index == 0) {
     
    701701   * by the system topology.
    702702   */
    703   cpu_self_index = rtems_get_current_processor();
     703  cpu_self_index = rtems_scheduler_get_processor();
    704704
    705705  if (cpu_self_index % 2 == 0) {
  • testsuites/smptests/smpcache01/init.c

    r3c50c328 r03c9f24  
    4848  rtems_test_assert(arg == &ctx);
    4949
    50   ctx.count[rtems_get_current_processor()]++;
     50  ctx.count[rtems_scheduler_get_processor()]++;
    5151}
    5252
     
    6969)
    7070{
    71   uint32_t self = rtems_get_current_processor();
     71  uint32_t self = rtems_scheduler_get_processor();
    7272
    7373  ctx.do_longjmp[self] = true;
     
    8888static void broadcast_test_init( void )
    8989{
    90   ctx.count[rtems_get_current_processor()] = 0;
     90  ctx.count[rtems_scheduler_get_processor()] = 0;
    9191}
    9292
     
    102102{
    103103  rtems_test_assert(
    104     ctx.count[rtems_get_current_processor()] == rtems_get_processor_count()
     104    ctx.count[rtems_scheduler_get_processor()] == rtems_get_processor_count()
    105105  );
    106106}
     
    170170static void cmlog(  const char* str )
    171171{
    172   if ( rtems_get_current_processor() == 0 )
     172  if ( rtems_scheduler_get_processor() == 0 )
    173173    printf( "%s", str );
    174174}
     
    257257)
    258258{
    259   uint32_t self = rtems_get_current_processor();
     259  uint32_t self = rtems_scheduler_get_processor();
    260260
    261261  if (source == RTEMS_FATAL_SOURCE_EXCEPTION && ctx.do_longjmp[self]) {
  • testsuites/smptests/smpcapture01/init.c

    r3c50c328 r03c9f24  
    7777    if (sc == RTEMS_SUCCESSFUL) {
    7878      task_data[arg].ran = true;
    79       task_data[arg].actual_cpu = rtems_get_current_processor();
     79      task_data[arg].actual_cpu = rtems_scheduler_get_processor();
    8080      rtems_semaphore_release(task_sem);
    8181      test_delay(1);
     
    9090  /* Set Init task data */
    9191  task_data[0].ran = true;
    92   task_data[0].actual_cpu = rtems_get_current_processor();
     92  task_data[0].actual_cpu = rtems_scheduler_get_processor();
    9393
    9494  rtems_semaphore_release(task_sem);
  • testsuites/smptests/smpclock01/init.c

    r3c50c328 r03c9f24  
    6565  rtems_id timer_id;
    6666
    67   rtems_test_assert(rtems_get_current_processor() == 1);
     67  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    6868
    6969  sc = rtems_timer_create(SCHEDULER_B, &timer_id);
     
    9797  uint64_t ticks;
    9898
    99   rtems_test_assert(rtems_get_current_processor() == 0);
     99  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    100100
    101101  rtems_test_spin_until_next_tick();
  • testsuites/smptests/smpfatal01/init.c

    r3c50c328 r03c9f24  
    4949
    5050  if (source == RTEMS_FATAL_SOURCE_SMP) {
    51     uint32_t self = rtems_get_current_processor();
     51    uint32_t self = rtems_scheduler_get_processor();
    5252
    5353    assert(!always_set_to_false);
     
    7777)
    7878{
    79   uint32_t self = rtems_get_current_processor();
     79  uint32_t self = rtems_scheduler_get_processor();
    8080  uint32_t cpu_count = rtems_get_processor_count();
    8181  uint32_t cpu;
  • testsuites/smptests/smpfatal02/init.c

    r3c50c328 r03c9f24  
    4747{
    4848  SMP_barrier_State barrier_state = SMP_BARRIER_STATE_INITIALIZER;
    49   uint32_t self = rtems_get_current_processor();
     49  uint32_t self = rtems_scheduler_get_processor();
    5050
    5151  assert(!always_set_to_false);
     
    8181)
    8282{
    83   uint32_t self = rtems_get_current_processor();
     83  uint32_t self = rtems_scheduler_get_processor();
    8484  uint32_t cpu_count = rtems_get_processor_count();
    8585  uint32_t cpu;
  • testsuites/smptests/smpipi01/init.c

    r3c50c328 r03c9f24  
    8080{
    8181  uint32_t cpu_count = rtems_get_processor_count();
    82   uint32_t cpu_index_self = rtems_get_current_processor();
     82  uint32_t cpu_index_self = rtems_scheduler_get_processor();
    8383  uint32_t cpu_index;
    8484  SMP_barrier_State *bs = &ctx->main_barrier_state;
     
    133133{
    134134  uint32_t cpu_count = rtems_get_processor_count();
    135   uint32_t cpu_index_self = rtems_get_current_processor();
     135  uint32_t cpu_index_self = rtems_scheduler_get_processor();
    136136  uint32_t cpu_index;
    137137
  • testsuites/smptests/smpmigration01/init.c

    r3c50c328 r03c9f24  
    7373
    7474  while (true) {
    75     uint32_t current_cpu = rtems_get_current_processor();
     75    uint32_t current_cpu = rtems_scheduler_get_processor();
    7676
    7777    ++counters->cycles_per_cpu[current_cpu].counter;
  • testsuites/smptests/smpmigration02/init.c

    r3c50c328 r03c9f24  
    5858  rtems_task_priority prio = migration_task_prio(task_index);
    5959  uint32_t cpu_count = rtems_get_processor_count();
    60   uint32_t cpu_index = rtems_get_current_processor();
     60  uint32_t cpu_index = rtems_scheduler_get_processor();
    6161
    6262  while (true) {
     
    7474    ++ctx->counters[task_index].value;
    7575
    76     rtems_test_assert(cpu_index == rtems_get_current_processor());
     76    rtems_test_assert(cpu_index == rtems_scheduler_get_processor());
    7777  }
    7878}
  • testsuites/smptests/smpmrsp01/init.c

    r3c50c328 r03c9f24  
    155155    Scheduler_SMP_Node *node = _Scheduler_SMP_Thread_get_node(heir);
    156156
    157     e->cpu_index = rtems_get_current_processor();
     157    e->cpu_index = rtems_scheduler_get_processor();
    158158    e->executing = executing;
    159159    e->heir = heir;
     
    506506  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    507507
    508   rtems_test_assert(rtems_get_current_processor() == 1);
    509 
    510   while (rtems_get_current_processor() != 0) {
     508  rtems_test_assert(rtems_scheduler_get_processor() == 1);
     509
     510  while (rtems_scheduler_get_processor() != 0) {
    511511    /* Wait */
    512512  }
     
    655655  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    656656
    657   rtems_test_assert(rtems_get_current_processor() == 1);
     657  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    658658
    659659  /* Obtain done (I) */
     
    664664  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    665665
    666   rtems_test_assert(rtems_get_current_processor() == 1);
     666  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    667667
    668668  /*
     
    676676  assert_prio(RTEMS_SELF, 1);
    677677
    678   rtems_test_assert(rtems_get_current_processor() == 1);
     678  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    679679
    680680  sc = rtems_semaphore_release(ctx->mrsp_ids[2]);
     
    687687  barrier(ctx, &barrier_state);
    688688
    689   rtems_test_assert(rtems_get_current_processor() == 1);
     689  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    690690
    691691  /* Prepare barrier for worker */
     
    696696  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    697697
    698   rtems_test_assert(rtems_get_current_processor() == 0);
     698  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    699699
    700700  print_switch_events(ctx);
     
    11071107  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    11081108
    1109   rtems_test_assert(rtems_get_current_processor() == 0);
     1109  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    11101110
    11111111  /* Use node of the active rival */
     
    11171117  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    11181118
    1119   rtems_test_assert(rtems_get_current_processor() == 1);
     1119  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    11201120
    11211121  sc = rtems_task_suspend(ctx->worker_ids[0]);
     
    11531153  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    11541154
    1155   rtems_test_assert(rtems_get_current_processor() == 0);
     1155  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    11561156
    11571157  assert_prio(RTEMS_SELF, 4);
     
    14101410  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    14111411
    1412   rtems_test_assert(rtems_get_current_processor() == 0);
     1412  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    14131413  rtems_test_assert(!run);
    14141414
    14151415  change_prio(run_task_id, 1);
    14161416
    1417   rtems_test_assert(rtems_get_current_processor() == 1);
     1417  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    14181418
    14191419  while (!run) {
     
    14241424  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    14251425
    1426   rtems_test_assert(rtems_get_current_processor() == 1);
     1426  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    14271427
    14281428  change_prio(run_task_id, 4);
    14291429
    1430   rtems_test_assert(rtems_get_current_processor() == 1);
     1430  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    14311431
    14321432  /*
     
    14371437  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    14381438
    1439   rtems_test_assert(rtems_get_current_processor() == 1);
     1439  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    14401440
    14411441  change_prio(RTEMS_SELF, 1);
     
    14451445  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    14461446
    1447   rtems_test_assert(rtems_get_current_processor() == 0);
     1447  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    14481448
    14491449  assert_prio(RTEMS_SELF, 3);
     
    14951495      rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    14961496
    1497       ++ctx->counters[index].cpu[rtems_get_current_processor()];
     1497      ++ctx->counters[index].cpu[rtems_scheduler_get_processor()];
    14981498    } else {
    14991499      uint32_t n = (v >> 17) % (i + 1);
     
    15181518        }
    15191519
    1520         ++ctx->counters[index].cpu[rtems_get_current_processor()];
     1520        ++ctx->counters[index].cpu[rtems_scheduler_get_processor()];
    15211521
    15221522        v = simple_random(v);
     
    15301530        rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    15311531
    1532         ++ctx->counters[index].cpu[rtems_get_current_processor()];
     1532        ++ctx->counters[index].cpu[rtems_scheduler_get_processor()];
    15331533      }
    15341534    }
     
    15571557    rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    15581558
    1559     ++ctx->migration_counters[rtems_get_current_processor()];
     1559    ++ctx->migration_counters[rtems_scheduler_get_processor()];
    15601560
    15611561    v = simple_random(v);
  • testsuites/smptests/smpmutex01/init.c

    r3c50c328 r03c9f24  
    8585static void assert_cpu(uint32_t expected_cpu)
    8686{
    87   rtems_test_assert(rtems_get_current_processor() == expected_cpu);
     87  rtems_test_assert(rtems_scheduler_get_processor() == expected_cpu);
    8888}
    8989
     
    227227  clear_done(ctx);
    228228
    229   if (rtems_get_current_processor() == 0) {
     229  if (rtems_scheduler_get_processor() == 0) {
    230230    id = H_B;
    231231  } else {
  • testsuites/smptests/smppsxmutex01/init.c

    r3c50c328 r03c9f24  
    5151  ctx = arg;
    5252
    53   rtems_test_assert(rtems_get_current_processor() == 0);
     53  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    5454
    5555  sc = rtems_scheduler_ident(SCHED_B, &scheduler_b_id);
     
    6262  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    6363
    64   rtems_test_assert(rtems_get_current_processor() == 1);
     64  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    6565
    6666  eno = pthread_mutex_init(&ctx->mtx_b, &ctx->mtx_attr);
     
    9898  cpu_count = rtems_get_processor_count();
    9999
    100   rtems_test_assert(rtems_get_current_processor() == 0);
     100  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    101101
    102102  eno = pthread_mutexattr_init(&ctx->mtx_attr);
  • testsuites/smptests/smppsxsignal01/init.c

    r3c50c328 r03c9f24  
    8383{
    8484  rtems_test_assert(
    85     ctx->consumer_processor == rtems_get_current_processor()
     85    ctx->consumer_processor == rtems_scheduler_get_processor()
    8686  );
    8787}
     
    9090{
    9191  rtems_test_assert(
    92     ctx->producer_processor == rtems_get_current_processor()
     92    ctx->producer_processor == rtems_scheduler_get_processor()
    9393  );
    9494}
     
    9898  test_context *ctx = arg;
    9999
    100   ctx->producer_processor = rtems_get_current_processor();
     100  ctx->producer_processor = rtems_scheduler_get_processor();
    101101
    102102  rtems_test_assert(ctx->consumer_processor != ctx->producer_processor);
     
    121121
    122122  ctx->consumer = pthread_self();
    123   ctx->consumer_processor = rtems_get_current_processor();
     123  ctx->consumer_processor = rtems_scheduler_get_processor();
    124124
    125125  memset(&new_action, 0, sizeof(new_action));
  • testsuites/smptests/smpschedaffinity01/init.c

    r3c50c328 r03c9f24  
    6767  cpu_set_t cpuset;
    6868
    69   cpu = rtems_get_current_processor();
     69  cpu = rtems_scheduler_get_processor();
    7070
    7171  rtems_task_get_affinity( rtems_task_self(), sizeof(cpuset), &cpuset );
  • testsuites/smptests/smpschedaffinity02/init.c

    r3c50c328 r03c9f24  
    100100  test_delay(20);
    101101
    102   cpu = rtems_get_current_processor();
     102  cpu = rtems_scheduler_get_processor();
    103103  printf( "Init: expected=%d actual=%d\n", expect, cpu);
    104104  rtems_test_assert( expect == cpu );
     
    113113    sc = rtems_semaphore_obtain (task_sem, RTEMS_NO_WAIT, 0);
    114114    if (sc == RTEMS_SUCCESSFUL) {
    115       task_data.actual_cpu = rtems_get_current_processor();
     115      task_data.actual_cpu = rtems_scheduler_get_processor();
    116116      task_data.ran = true;
    117117      test_delay(25);
  • testsuites/smptests/smpschedaffinity03/init.c

    r3c50c328 r03c9f24  
    6565
    6666    /* Check the cpu the Init task is running on */
    67     cpu = rtems_get_current_processor();
     67    cpu = rtems_scheduler_get_processor();
    6868    printf("On cpu %d\n", cpu);
    6969    rtems_test_assert(cpu == i);
  • testsuites/smptests/smpschedaffinity04/init.c

    r3c50c328 r03c9f24  
    6161    if (sc == RTEMS_SUCCESSFUL) {
    6262      task_data.ran = true;
    63       task_data.actual_cpu = rtems_get_current_processor();
     63      task_data.actual_cpu = rtems_scheduler_get_processor();
    6464      rtems_semaphore_release(task_sem);
    6565    }
     
    116116   */
    117117  printf("Verify Init task is on cpu %" PRIu32 "\n",cpu_count-1);
    118   cpu = rtems_get_current_processor();
     118  cpu = rtems_scheduler_get_processor();
    119119  rtems_test_assert(cpu == (cpu_count-1));
    120120
  • testsuites/smptests/smpschedaffinity05/init.c

    r3c50c328 r03c9f24  
    7878    if (sc == RTEMS_SUCCESSFUL) {
    7979      task_data[arg].ran = true;
    80       task_data[arg].actual_cpu = rtems_get_current_processor();
     80      task_data[arg].actual_cpu = rtems_scheduler_get_processor();
    8181      rtems_semaphore_release(task_sem);
    8282    }
     
    9393  /* Set Init task data */
    9494  task_data[0].ran = true;
    95   task_data[0].actual_cpu = rtems_get_current_processor();
     95  task_data[0].actual_cpu = rtems_scheduler_get_processor();
    9696
    9797  /* Verify all tasks */
  • testsuites/smptests/smpscheduler02/init.c

    r3c50c328 r03c9f24  
    4747  (void) arg;
    4848
    49   rtems_test_assert(rtems_get_current_processor() == 1);
     49  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    5050  rtems_test_assert(sched_get_priority_min(SCHED_RR) == 1);
    5151  rtems_test_assert(sched_get_priority_max(SCHED_RR) == INT_MAX - 1);
     
    7878  (void) arg;
    7979
    80   rtems_test_assert(rtems_get_current_processor() == 0);
     80  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    8181
    8282  sc = rtems_semaphore_create(
     
    150150    rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    151151
    152     rtems_test_assert(rtems_get_current_processor() == 0);
     152    rtems_test_assert(rtems_scheduler_get_processor() == 0);
    153153
    154154    sc = rtems_scheduler_remove_processor(scheduler_a_id, 0);
    155155    rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    156156
    157     rtems_test_assert(rtems_get_current_processor() == 1);
     157    rtems_test_assert(rtems_scheduler_get_processor() == 1);
    158158
    159159    CPU_ZERO(&first_cpu);
     
    169169    rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    170170
    171     rtems_test_assert(rtems_get_current_processor() == 1);
     171    rtems_test_assert(rtems_scheduler_get_processor() == 1);
    172172
    173173    sc = rtems_task_create(
     
    191191    rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    192192
    193     rtems_test_assert(rtems_get_current_processor() == 0);
     193    rtems_test_assert(rtems_scheduler_get_processor() == 0);
    194194
    195195    sc = rtems_event_transient_send(task_id);
     
    223223  uint32_t cpu_count;
    224224
    225   rtems_test_assert(rtems_get_current_processor() == 0);
     225  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    226226
    227227  cpu_count = rtems_get_processor_count();
  • testsuites/smptests/smpscheduler04/init.c

    r3c50c328 r03c9f24  
    4848  test_context *ctx = (test_context *) arg;
    4949  uint32_t cpu_count = rtems_get_processor_count();
    50   uint32_t cpu_index = rtems_get_current_processor();
     50  uint32_t cpu_index = rtems_scheduler_get_processor();
    5151
    5252  while (true) {
     
    6666
    6767    rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    68     rtems_test_assert(cpu_index == rtems_get_current_processor());
     68    rtems_test_assert(cpu_index == rtems_scheduler_get_processor());
    6969    ++ctx->migration_counter;
    7070  }
     
    7575  test_context *ctx = (test_context *) arg;
    7676  uint32_t cpu_count = rtems_get_processor_count();
    77   uint32_t cpu_index = rtems_get_current_processor();
     77  uint32_t cpu_index = rtems_scheduler_get_processor();
    7878
    7979  while (true) {
  • testsuites/smptests/smpsignal01/init.c

    r3c50c328 r03c9f24  
    9191{
    9292  rtems_test_assert(
    93     ctx->consumer_processor == rtems_get_current_processor()
     93    ctx->consumer_processor == rtems_scheduler_get_processor()
    9494  );
    9595}
     
    9898{
    9999  rtems_test_assert(
    100     ctx->producer_processor == rtems_get_current_processor()
     100    ctx->producer_processor == rtems_scheduler_get_processor()
    101101  );
    102102}
     
    106106  test_context *ctx = (test_context *) arg;
    107107
    108   ctx->producer_processor = rtems_get_current_processor();
     108  ctx->producer_processor = rtems_scheduler_get_processor();
    109109
    110110  rtems_test_assert(ctx->consumer_processor != ctx->producer_processor);
     
    221221
    222222  ctx->consumer = rtems_task_self();
    223   ctx->consumer_processor = rtems_get_current_processor();
     223  ctx->consumer_processor = rtems_scheduler_get_processor();
    224224
    225225  test_isr_level(ctx);
  • testsuites/smptests/smpthreadpin01/init.c

    r3c50c328 r03c9f24  
    287287  set_prio(ctx->busy, PRIO_IDLE);
    288288  set_prio(RTEMS_SELF, PRIO_MIDDLE);
    289   rtems_test_assert(rtems_get_current_processor() == 1);
     289  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    290290
    291291  cpu_self = _Thread_Dispatch_disable();
     
    293293  _Thread_Pin(executing);
    294294
    295   rtems_test_assert(rtems_get_current_processor() == 1);
     295  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    296296
    297297  _Thread_Unpin(executing, cpu_self);
    298298  _Thread_Dispatch_enable(cpu_self);
    299299
    300   rtems_test_assert(rtems_get_current_processor() == 1);
     300  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    301301}
    302302
     
    310310  set_prio(ctx->event, PRIO_LOW);
    311311  set_affinity(ctx->event, 1);
    312   rtems_test_assert(rtems_get_current_processor() == 1);
     312  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    313313
    314314  pin(blocked);
    315   rtems_test_assert(rtems_get_current_processor() == 1);
     315  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    316316
    317317  send_events(ctx->event, EVENT_WAKEUP_MASTER);
    318   rtems_test_assert(rtems_get_current_processor() == 1);
     318  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    319319  wait_for_events();
    320   rtems_test_assert(rtems_get_current_processor() == 1);
     320  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    321321
    322322  set_prio(ctx->busy, PRIO_HIGH);
    323323  set_affinity(ctx->busy, 0);
    324324  unpin(blocked);
    325   rtems_test_assert(rtems_get_current_processor() == 1);
     325  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    326326}
    327327
     
    339339  set_affinity(ctx->event, 0);
    340340  set_affinity(ctx->busy, 0);
    341   rtems_test_assert(rtems_get_current_processor() == 1);
     341  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    342342
    343343  pin(blocked);
    344   rtems_test_assert(rtems_get_current_processor() == 1);
     344  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    345345
    346346  ctx->flag = false;
     
    352352
    353353  while (!ctx->flag) {
    354     rtems_test_assert(rtems_get_current_processor() == 1);
     354    rtems_test_assert(rtems_scheduler_get_processor() == 1);
    355355  }
    356356
    357357  set_affinity(ctx->busy, 0);
    358358  unpin(blocked);
    359   rtems_test_assert(rtems_get_current_processor() == 1);
     359  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    360360}
    361361
     
    377377  set_prio(ctx->busy, PRIO_IDLE);
    378378  set_prio(RTEMS_SELF, PRIO_MIDDLE);
    379   rtems_test_assert(rtems_get_current_processor() == 0);
     379  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    380380
    381381  pin(blocked);
    382   rtems_test_assert(rtems_get_current_processor() == 0);
     382  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    383383
    384384  sc = rtems_task_set_scheduler(RTEMS_SELF, ctx->sched_b, 1);
     
    386386
    387387  rtems_mutex_lock(&ctx->mtx);
    388   rtems_test_assert(rtems_get_current_processor() == 0);
     388  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    389389
    390390  set_affinity(ctx->event, 1);
     
    399399  /* Now the event task can help us */
    400400  rtems_test_assert(ctx->mtx._Queue._heads != NULL);
    401   rtems_test_assert(rtems_get_current_processor() == 0);
     401  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    402402
    403403  set_affinity(ctx->event_2, 0);
     
    410410  );
    411411  set_prio(ctx->event_2, PRIO_VERY_HIGH);
    412   rtems_test_assert(rtems_get_current_processor() == 0);
     412  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    413413
    414414  rtems_mutex_unlock(&ctx->mtx);
    415   rtems_test_assert(rtems_get_current_processor() == 0);
     415  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    416416
    417417  send_events(ctx->event, EVENT_WAKEUP_MASTER | EVENT_MTX_UNLOCK);
    418418  wait_for_events();
    419   rtems_test_assert(rtems_get_current_processor() == 0);
     419  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    420420
    421421  unpin(blocked);
    422   rtems_test_assert(rtems_get_current_processor() == 0);
     422  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    423423}
    424424
     
    438438  set_prio(ctx->busy, PRIO_IDLE);
    439439  set_prio(RTEMS_SELF, PRIO_MIDDLE);
    440   rtems_test_assert(rtems_get_current_processor() == 0);
     440  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    441441
    442442  rtems_mutex_lock(&ctx->mtx);
    443   rtems_test_assert(rtems_get_current_processor() == 0);
     443  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    444444
    445445  set_affinity(ctx->event, 1);
     
    453453  /* Now the event task can help us */
    454454  rtems_test_assert(ctx->mtx._Queue._heads != NULL);
    455   rtems_test_assert(rtems_get_current_processor() == 0);
     455  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    456456
    457457  /* Request help */
    458458  set_affinity(ctx->busy, 0);
    459459  set_prio(ctx->busy, PRIO_HIGH);
    460   rtems_test_assert(rtems_get_current_processor() == 1);
     460  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    461461
    462462  /* Pin while using foreign scheduler */
    463463  pin(blocked);
    464   rtems_test_assert(rtems_get_current_processor() == 1);
     464  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    465465
    466466  set_affinity(ctx->event_2, 1);
     
    471471  );
    472472  set_prio(ctx->event_2, PRIO_VERY_HIGH);
    473   rtems_test_assert(rtems_get_current_processor() == 1);
     473  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    474474
    475475  unpin(blocked);
    476   rtems_test_assert(rtems_get_current_processor() == 0);
     476  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    477477
    478478  set_prio(ctx->busy, PRIO_IDLE);
    479479  rtems_mutex_unlock(&ctx->mtx);
    480   rtems_test_assert(rtems_get_current_processor() == 0);
     480  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    481481
    482482  send_events(ctx->event, EVENT_WAKEUP_MASTER | EVENT_MTX_UNLOCK);
    483483  wait_for_events();
    484   rtems_test_assert(rtems_get_current_processor() == 0);
     484  rtems_test_assert(rtems_scheduler_get_processor() == 0);
    485485}
    486486
     
    515515  set_affinity(ctx->busy, 0);
    516516  set_prio(ctx->busy, PRIO_IDLE);
    517   rtems_test_assert(rtems_get_current_processor() == 1);
     517  rtems_test_assert(rtems_scheduler_get_processor() == 1);
    518518
    519519  sc = rtems_task_create(
  • testsuites/tmtests/tmcontext01/init.c

    r3c50c328 r03c9f24  
    117117  size_t n = data_size;
    118118  size_t clsz = cache_line_size;
    119   int j = (int) rtems_get_current_processor();
     119  int j = (int) rtems_scheduler_get_processor();
    120120
    121121  while (true) {
Note: See TracChangeset for help on using the changeset viewer.