Skip to content

Commit

Permalink
Changes to impl and spsimplesched01
Browse files Browse the repository at this point in the history
  • Loading branch information
Richi Dubey committed Jun 18, 2020
1 parent 46c2387 commit d63645f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cpukit/include/rtems/score/schedulersimpleimpl.h
Expand Up @@ -129,7 +129,7 @@ RTEMS_INLINE_ROUTINE void _Scheduler_simple_Schedule_body(
{
Scheduler_simple_Context *context =
_Scheduler_simple_Get_context( scheduler );
Thread_Control *heir = (Thread_Control *) _Chain_First( &context->Ready );
Thread_Control *heir = (Thread_Control *) _Chain_Last( &context->Ready );

( void ) the_thread;

Expand Down
22 changes: 12 additions & 10 deletions testsuites/sptests/spsimplesched01/init.c
Expand Up @@ -38,20 +38,22 @@ rtems_task Test_task(
directive_failed( status, "task ident" );

task_index = task_number( tid );
for ( ; ; ) {
//for ( ; ; ) {
status = rtems_clock_get_tod( &time );
directive_failed( status, "clock get tod" );
if ( time.second >= 35 ) {
TEST_END();
rtems_test_exit( 0 );
}
//if ( time.second >= 35 ) {

//}
put_name( Task_name[ task_index ], FALSE );
print_time( " - rtems_clock_get_tod - ", &time, "\n" );
status = rtems_task_wake_after(
task_index * 5 * rtems_clock_get_ticks_per_second()
);
directive_failed( status, "wake after" );
}

TEST_END();
rtems_test_exit( 0 );
//status = rtems_task_wake_after(
//task_index * 5 * rtems_clock_get_ticks_per_second()
//);
//directive_failed( status, "wake after" );
//}
}

rtems_task Init(
Expand Down

1 comment on commit d63645f

@richidubey
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test spsimplesched/init.c is the same(my changed version) before changing cpukit/include/rtems/score/schedulersimpleimpl.h and after changing cpukit/include/rtems/score/schedulersimpleimpl.h.

The result of running the spsimplesched01.exe on leon3 processor on sis is:

Before changing the schedulersimpleimpl.h:
./sparc-rtems5-sis -leon3 ~/quick-start/build/leon3/sparc-rtems5/c/leon3/testsuites/sptests/spsimplesched01.exe

SIS - SPARC/RISCV instruction simulator 2.21, copyright Jiri Gaisler 2019
Bug-reports to jiri@gaisler.se

LEON3 emulation enabled, 1 cpus online, delta 50 clocks

Loaded /home/richi/quick-start/build/leon3/sparc-rtems5/c/leon3/testsuites/sptests/spsimplesched01.exe, entry 0x40000000
sis> run

*** BEGIN OF TEST SPSIMPLESCHED 1 ***
*** TEST VERSION: 5.0.0.850681960cbfff234e7c5145237d3c44ebd0bff1-modified
*** TEST STATE: EXPECTED_PASS
*** TEST BUILD: RTEMS_NETWORKING RTEMS_POSIX_API
*** TEST TOOLS: 7.5.0 20191114 (RTEMS 5, RSB 5 (0b7e87143b76), Newlib fbaa096)
TA1 - rtems_clock_get_tod - 09:00:00 12/31/1988

*** END OF TEST SPSIMPLESCHED 1 ***

cpu 0 in error mode (tt = 0x80)
134741 4000c5e0: 91d02000 ta 0x0


After changing the schedulersimpleimpl.h
./sparc-rtems5-sis -leon3 ~/quick-start/build/leon3/sparc-rtems5/c/leon3/testsuites/sptests/spsimplesched01.exe

SIS - SPARC/RISCV instruction simulator 2.21, copyright Jiri Gaisler 2019
Bug-reports to jiri@gaisler.se

LEON3 emulation enabled, 1 cpus online, delta 50 clocks

Loaded /home/richi/quick-start/build/leon3/sparc-rtems5/c/leon3/testsuites/sptests/spsimplesched01.exe, entry 0x40000000
sis> run

*** BEGIN OF TEST SPSIMPLESCHED 1 ***
*** TEST VERSION: 5.0.0.850681960cbfff234e7c5145237d3c44ebd0bff1-modified
*** TEST STATE: EXPECTED_PASS
*** TEST BUILD: RTEMS_NETWORKING RTEMS_POSIX_API
*** TEST TOOLS: 7.5.0 20191114 (RTEMS 5, RSB 5 (0b7e87143b76), Newlib fbaa096)
Interrupt!
Stopped at time 82157073000 (1643141.460 ms)

(Screenshot at: https://i.imgur.com/XttPBNi.png and https://i.imgur.com/hHZKg4v.png - after interrupting ).

Because the scheduler picks up last item from the ready queue, the task picked is an idle task(the lowest priority task) and so we do not see anything on the console and I have to press Ctrl+C to exit the program. This happens because simple scheduler has only one queue for all tasks.

Please sign in to comment.