Changeset 6a82f1a in rtems for testsuites/smptests


Ignore:
Timestamp:
Oct 10, 2016, 9:46:07 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
913864c
Parents:
351c14d
git-author:
Sebastian Huber <sebastian.huber@…> (10/10/16 09:46:07)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/02/16 09:05:43)
Message:

score: Yield support for new SMP helping protocol

Update #2556.

File:
1 edited

Legend:

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

    r351c14d r6a82f1a  
    314314}
    315315
     316static void yield(void)
     317{
     318  rtems_status_code sc;
     319
     320  sc = rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
     321  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     322}
     323
    316324static void set_prio(test_context *ctx, task_id id, rtems_task_priority prio)
    317325{
     
    857865
    858866  release(ctx);
     867}
     868
     869static void test_omip_yield(test_context *ctx)
     870{
     871  assert_cpu(0);
     872  obtain(ctx);
     873  assert_prio_by_scheduler(ctx, M, SCHED_A, 3);
     874  assert_prio_by_scheduler(ctx, M, SCHED_B, PRIO_NONE);
     875
     876  request(ctx, B_5_0, REQ_MTX_OBTAIN);
     877  assert_prio_by_scheduler(ctx, M, SCHED_A, 3);
     878  assert_prio_by_scheduler(ctx, M, SCHED_B, 5);
     879  check_generations(ctx, NONE, NONE);
     880
     881  clear_done(ctx);
     882  send_event(ctx, H_A, REQ_SET_DONE);
     883  yield();
     884  assert_cpu(1);
     885  wait_for_done(ctx);
     886
     887  clear_done(ctx);
     888  send_event(ctx, H_B, REQ_SET_DONE);
     889  set_prio(ctx, H_B, 5);
     890  yield();
     891  assert_cpu(1);
     892  rtems_test_assert(!is_done(ctx));
     893
     894  set_prio(ctx, H_B, 4);
     895  assert_cpu(0);
     896
     897  wait_for_done(ctx);
     898  set_prio(ctx, H_B, 6);
     899
     900  release(ctx);
     901  sync_with_helper(ctx);
     902  assert_prio_by_scheduler(ctx, M, SCHED_A, 3);
     903  assert_prio_by_scheduler(ctx, M, SCHED_B, PRIO_NONE);
     904  check_generations(ctx, B_5_0, NONE);
     905
     906  request(ctx, B_5_0, REQ_MTX_RELEASE);
     907  assert_prio_by_scheduler(ctx, B_5_0, SCHED_A, PRIO_NONE);
     908  assert_prio_by_scheduler(ctx, B_5_0, SCHED_B, 5);
     909  check_generations(ctx, B_5_0, NONE);
    859910}
    860911
     
    875926  test_omip_rescue(ctx);
    876927  test_omip_timeout(ctx);
     928  test_omip_yield(ctx);
    877929}
    878930
Note: See TracChangeset for help on using the changeset viewer.