From 828049cb47d974fcc816a5bd8868fdaf670201a3 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 8 Mar 2018 08:48:28 +0100 Subject: sptests/sp19: Fix test output methods Do not use fprintf() in non-fp tasks. --- testsuites/sptests/sp19/init.c | 10 +++++++++- testsuites/sptests/sp19/system.h | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/testsuites/sptests/sp19/init.c b/testsuites/sptests/sp19/init.c index ee499fad6b..ef52f98444 100644 --- a/testsuites/sptests/sp19/init.c +++ b/testsuites/sptests/sp19/init.c @@ -28,13 +28,21 @@ const char rtems_test_name[] = "SP 19"; +void thread_switch_extension( Thread_Control *executing, Thread_Control *heir ) +{ + if ( heir->is_fp ) { + rtems_print_printer_fprintf_putc( &rtems_test_printer ); + } else { + rtems_print_printer_printk( &rtems_test_printer ); + } +} + rtems_task Init( rtems_task_argument argument ) { rtems_status_code status; - rtems_print_printer_fprintf_putc(&rtems_test_printer); TEST_BEGIN(); Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); diff --git a/testsuites/sptests/sp19/system.h b/testsuites/sptests/sp19/system.h index f6e39c36b9..59ae0104f0 100644 --- a/testsuites/sptests/sp19/system.h +++ b/testsuites/sptests/sp19/system.h @@ -40,7 +40,11 @@ rtems_task Task_1( #define CONFIGURE_MAXIMUM_TASKS 7 -#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION +void thread_switch_extension( Thread_Control *, Thread_Control * ); + +#define CONFIGURE_INITIAL_EXTENSIONS \ + { .thread_switch = thread_switch_extension }, \ + RTEMS_TEST_INITIAL_EXTENSION #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -- cgit v1.2.3