Changeset 63e2ca1b in rtems for testsuites/smptests


Ignore:
Timestamp:
Oct 31, 2016, 8:13:35 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
86d3a2e
Parents:
2dd098a
git-author:
Sebastian Huber <sebastian.huber@…> (10/31/16 08:13:35)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/02/16 09:05:45)
Message:

score: Simplify yield and unblock scheduler ops

Update #2556.

File:
1 edited

Legend:

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

    r2dd098a r63e2ca1b  
    315315}
    316316
    317 static Thread_Control *yield_op(
     317static bool yield_op(
    318318  Thread_Control *thread,
    319319  Scheduler_SMP_Node *scheduler_node
     
    323323  ISR_lock_Context state_lock_context;
    324324  ISR_lock_Context scheduler_lock_context;
    325   Thread_Control *needs_help;
     325  bool needs_help;
    326326
    327327  _Thread_State_acquire( thread, &state_lock_context );
     
    349349)
    350350{
    351   Thread_Control *needs_help;
     351  bool needs_help;
    352352  Per_CPU_Control *cpu_self;
    353353
     
    396396  rtems_test_assert(executing_node->state == new_state);
    397397
    398   if (start_state != new_state) {
    399     switch (start_state) {
    400       case SCHEDULER_SMP_NODE_SCHEDULED:
    401         rtems_test_assert(needs_help == executing);
    402         break;
    403       case SCHEDULER_SMP_NODE_READY:
    404         rtems_test_assert(needs_help == other);
    405         break;
    406       default:
    407         rtems_test_assert(0);
    408         break;
    409     }
    410   } else {
    411     rtems_test_assert(needs_help == NULL);
     398  switch (new_state) {
     399    case SCHEDULER_SMP_NODE_SCHEDULED:
     400      rtems_test_assert(!needs_help);
     401      break;
     402    case SCHEDULER_SMP_NODE_READY:
     403      rtems_test_assert(needs_help);
     404      break;
     405    default:
     406      rtems_test_assert(0);
     407      break;
    412408  }
    413409
     
    474470}
    475471
    476 static Thread_Control *unblock_op(
     472static bool unblock_op(
    477473  Thread_Control *thread,
    478474  Scheduler_SMP_Node *scheduler_node
     
    482478  ISR_lock_Context state_lock_context;
    483479  ISR_lock_Context scheduler_lock_context;
    484   Thread_Control *needs_help;
     480  bool needs_help;
    485481
    486482  _Thread_State_acquire( thread, &state_lock_context );
     
    507503)
    508504{
    509   Thread_Control *needs_help;
     505  bool needs_help;
    510506  Per_CPU_Control *cpu_self;
    511507
     
    534530  switch (new_state) {
    535531    case SCHEDULER_SMP_NODE_SCHEDULED:
    536       rtems_test_assert(needs_help == other);
     532      rtems_test_assert(!needs_help);
    537533      break;
    538534    case SCHEDULER_SMP_NODE_READY:
    539       rtems_test_assert(needs_help == executing);
     535      rtems_test_assert(needs_help);
    540536      break;
    541537    default:
Note: See TracChangeset for help on using the changeset viewer.