Changeset 501043a in rtems for testsuites/smptests


Ignore:
Timestamp:
Sep 30, 2016, 12:38:04 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
2df4abc
Parents:
d097b546
git-author:
Sebastian Huber <sebastian.huber@…> (09/30/16 12:38:04)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/02/16 09:05:40)
Message:

score: Pass scheduler node to update priority op

This enables to call this scheduler operation for all scheduler nodes
available to a thread.

Update #2556.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/smptests/smpscheduler03/init.c

    rd097b546 r501043a  
    4141static test_context test_instance;
    4242
     43static Scheduler_SMP_Node *get_scheduler_node(Thread_Control *thread)
     44{
     45  return _Scheduler_SMP_Node_downcast(_Thread_Scheduler_get_home_node(thread));
     46}
     47
    4348static void apply_priority(
    4449  Thread_Control *thread,
     
    120125static void test_case_change_priority(
    121126  Thread_Control *executing,
    122   Scheduler_SMP_Node *node,
     127  Scheduler_SMP_Node *executing_node,
    123128  Scheduler_SMP_Node_state start_state,
    124129  Priority_Control prio,
     
    142147      break;
    143148  }
    144   rtems_test_assert(node->state == start_state);
     149  rtems_test_assert(executing_node->state == start_state);
    145150
    146151  change_priority(executing, prio, prepend_it);
    147   rtems_test_assert(node->state == new_state);
     152  rtems_test_assert(executing_node->state == new_state);
    148153
    149154  change_priority(executing, 1, true);
    150   rtems_test_assert(node->state == SCHEDULER_SMP_NODE_SCHEDULED);
     155  rtems_test_assert(executing_node->state == SCHEDULER_SMP_NODE_SCHEDULED);
    151156
    152157  _Thread_Dispatch_enable( cpu_self );
     
    167172  rtems_id task_id;
    168173  Thread_Control *executing;
    169   Scheduler_SMP_Node *node;
     174  Scheduler_SMP_Node *executing_node;
    170175  size_t i;
    171176  size_t j;
     
    174179  task_id = start_task(3);
    175180  executing = _Thread_Get_executing();
    176   node = _Scheduler_SMP_Thread_get_node(executing);
     181  executing_node = get_scheduler_node(executing);
    177182
    178183  for (i = 0; i < RTEMS_ARRAY_SIZE(states); ++i) {
     
    181186        test_case_change_priority(
    182187          executing,
    183           node,
     188          executing_node,
    184189          states[i],
    185190          priorities[j],
     
    197202static Thread_Control *update_priority_op(
    198203  Thread_Control *thread,
     204  Scheduler_SMP_Node *scheduler_node,
    199205  Priority_Control new_priority,
    200206  bool prepend_it
     
    213219  _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context );
    214220
    215   needs_help = (*scheduler->Operations.update_priority)( scheduler, thread);
     221  needs_help = (*scheduler->Operations.update_priority)(
     222    scheduler,
     223    thread,
     224    &scheduler_node->Base
     225  );
    216226
    217227  _Scheduler_Release_critical( scheduler, &scheduler_lock_context );
     
    249259  rtems_test_assert(executing_node->state == start_state);
    250260
    251   needs_help = update_priority_op(executing, prio, prepend_it);
     261  needs_help = update_priority_op(executing, executing_node, prio, prepend_it);
    252262  rtems_test_assert(executing_node->state == new_state);
    253263
     
    287297  task_id = start_task(3);
    288298  executing = _Thread_Get_executing();
    289   executing_node = _Scheduler_SMP_Thread_get_node(executing);
     299  executing_node = get_scheduler_node(executing);
    290300
    291301  other = get_thread_by_id(task_id);
     
    419429  task_id = start_task(2);
    420430  executing = _Thread_Get_executing();
    421   executing_node = _Scheduler_SMP_Thread_get_node(executing);
     431  executing_node = get_scheduler_node(executing);
    422432
    423433  other = get_thread_by_id(task_id);
     
    540550  task_id = start_task(3);
    541551  executing = _Thread_Get_executing();
    542   executing_node = _Scheduler_SMP_Thread_get_node(executing);
     552  executing_node = get_scheduler_node(executing);
    543553
    544554  other = get_thread_by_id(task_id);
Note: See TracChangeset for help on using the changeset viewer.