diff options
Diffstat (limited to 'testsuites/tmtests/tm27')
-rw-r--r-- | testsuites/tmtests/tm27/system.h | 26 | ||||
-rw-r--r-- | testsuites/tmtests/tm27/task1.c | 125 | ||||
-rw-r--r-- | testsuites/tmtests/tm27/tm27.doc | 25 |
3 files changed, 115 insertions, 61 deletions
diff --git a/testsuites/tmtests/tm27/system.h b/testsuites/tmtests/tm27/system.h index 7136afe9c1..4a2723bcd4 100644 --- a/testsuites/tmtests/tm27/system.h +++ b/testsuites/tmtests/tm27/system.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* system.h * * This include file is used by all tests in the Time Suite. @@ -5,9 +7,26 @@ * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ @@ -29,7 +48,6 @@ rtems_id Task_id[ OPERATION_COUNT+1 ]; /* array of task ids */ #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_MAXIMUM_TASKS 3 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm27/task1.c b/testsuites/tmtests/tm27/task1.c index c0f8bd1088..7f2ce6663c 100644 --- a/testsuites/tmtests/tm27/task1.c +++ b/testsuites/tmtests/tm27/task1.c @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * COPYRIGHT (c) 1989-2013. * On-Line Applications Research Corporation (OAR). * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ /* @@ -43,10 +62,6 @@ volatile uint32_t Interrupt_return_time, Interrupt_return_nested_time; uint32_t Interrupt_nest; uint32_t timer_overhead; -rtems_isr Isr_handler( - rtems_vector_number vector -); - static void set_thread_executing( Thread_Control *thread ) { _Per_CPU_Get_snapshot()->executing = thread; @@ -107,6 +122,55 @@ rtems_task Init( rtems_task_exit(); } +/* The Isr_handler() and Isr_handler_inner() routines are structured + * so that there will be as little entry overhead as possible included + * in the interrupt entry time. + */ + +static void Isr_handler_inner( void ) +{ + + /*enable_tracing();*/ + Clear_tm27_intr(); + switch ( Interrupt_nest ) { + case 0: + Interrupt_enter_time = end_time; + break; + case 1: + Interrupt_enter_time = end_time; + Interrupt_nest = 2; + Interrupt_occurred = 0; + Lower_tm27_intr(); + benchmark_timer_initialize(); + Cause_tm27_intr(); + /* goes to a nested copy of Isr_handler */ +#if (MUST_WAIT_FOR_INTERRUPT == 1) + while ( Interrupt_occurred == 0 ); +#endif + Interrupt_return_nested_time = benchmark_timer_read(); + break; + case 2: + Interrupt_enter_nested_time = end_time; + break; + } + + benchmark_timer_initialize(); +} + +#ifdef TM27_USE_VECTOR_HANDLER +static rtems_isr Isr_handler( rtems_vector_number arg ) +#else +static void Isr_handler( void *arg ) +#endif +{ + (void) arg; + + end_time = benchmark_timer_read(); + + Interrupt_occurred = 1; + Isr_handler_inner(); +} + rtems_task Task_1( rtems_task_argument argument ) @@ -283,50 +347,3 @@ rtems_task Task_2( _Thread_Dispatch(); } - -/* The Isr_handler() and Isr_handler_inner() routines are structured - * so that there will be as little entry overhead as possible included - * in the interrupt entry time. - */ - -void Isr_handler_inner( void ); - -rtems_isr Isr_handler( - rtems_vector_number vector -) -{ - end_time = benchmark_timer_read(); - - Interrupt_occurred = 1; - Isr_handler_inner(); -} - -void Isr_handler_inner( void ) -{ - - /*enable_tracing();*/ - Clear_tm27_intr(); - switch ( Interrupt_nest ) { - case 0: - Interrupt_enter_time = end_time; - break; - case 1: - Interrupt_enter_time = end_time; - Interrupt_nest = 2; - Interrupt_occurred = 0; - Lower_tm27_intr(); - benchmark_timer_initialize(); - Cause_tm27_intr(); - /* goes to a nested copy of Isr_handler */ -#if (MUST_WAIT_FOR_INTERRUPT == 1) - while ( Interrupt_occurred == 0 ); -#endif - Interrupt_return_nested_time = benchmark_timer_read(); - break; - case 2: - Interrupt_enter_nested_time = end_time; - break; - } - - benchmark_timer_initialize(); -} diff --git a/testsuites/tmtests/tm27/tm27.doc b/testsuites/tmtests/tm27/tm27.doc index 981286480f..f56c0e1f4e 100644 --- a/testsuites/tmtests/tm27/tm27.doc +++ b/testsuites/tmtests/tm27/tm27.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # COPYRIGHT (c) 1989-1999. # On-Line Applications Research Corporation (OAR). # -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.rtems.org/license/LICENSE. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. # |