Warning, /testsuites/ada/tmtests/tm04/tmtest.ads is written in an unsupported language. File is not indexed.
0001 -- SPDX-License-Identifier: BSD-2-Clause
0002
0003 --
0004 -- TMTEST / SPECIFICATION
0005 --
0006 -- DESCRIPTION:
0007 --
0008 -- This package is the specification for Test 4 of the RTEMS
0009 -- Timing Test Suite.
0010 --
0011 -- DEPENDENCIES:
0012 --
0013 --
0014 --
0015 -- COPYRIGHT (c) 1989-2011.
0016 -- On-Line Applications Research Corporation (OAR).
0017 --
0018 -- Redistribution and use in source and binary forms, with or without
0019 -- modification, are permitted provided that the following conditions
0020 -- are met:
0021 -- 1. Redistributions of source code must retain the above copyright
0022 -- notice, this list of conditions and the following disclaimer.
0023 -- 2. Redistributions in binary form must reproduce the above copyright
0024 -- notice, this list of conditions and the following disclaimer in the
0025 -- documentation and/or other materials provided with the distribution.
0026 --
0027 -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0028 -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0029 -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0030 -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0031 -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0032 -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0033 -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0034 -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0035 -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0036 -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0037 -- POSSIBILITY OF SUCH DAMAGE.
0038 --
0039
0040 with TIME_TEST_SUPPORT;
0041 with RTEMS;
0042 with RTEMS.TASKS;
0043
0044 package TMTEST is
0045
0046 --
0047 -- This array contains the IDs of all RTEMS tasks created by this test.
0048 --
0049
0050 TASK_ID : array ( RTEMS.UNSIGNED32
0051 range 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID;
0052
0053 --
0054 -- This variable contains the id of the highest priority task
0055 -- in the system.
0056 --
0057
0058 HIGHEST_ID : RTEMS.ID;
0059
0060 --
0061 -- The following is the ID of the semaphore used for timing operations.
0062 --
0063
0064 SEMAPHORE_ID : RTEMS.ID;
0065
0066 --
0067 -- The following is used to perform the same operation
0068 -- on a group of tasks.
0069 --
0070
0071 TASK_COUNT : RTEMS.UNSIGNED32;
0072
0073 --
0074 -- The following variable is set to the execution time returned
0075 -- by the timer.
0076 --
0077
0078 END_TIME : RTEMS.UNSIGNED32;
0079
0080 --
0081 -- INIT
0082 --
0083 -- DESCRIPTION:
0084 --
0085 -- This RTEMS task initializes the application.
0086 --
0087
0088 procedure INIT (
0089 ARGUMENT : in RTEMS.TASKS.ARGUMENT
0090 );
0091 pragma Convention (C, INIT);
0092
0093 --
0094 -- TEST_INIT
0095 --
0096 -- DESCRIPTION:
0097 --
0098 -- This subprogram performs test initialization.
0099 --
0100
0101 procedure TEST_INIT;
0102
0103 --
0104 -- HIGHEST_TASK
0105 --
0106 -- DESCRIPTION:
0107 --
0108 -- This RTEMS task is created by one of the LOW_TASKS. The
0109 -- first time it executes, it performs a blocking SEMAPHORE_OBTAIN
0110 -- which transfers control of the processor to HIGH_TASK.
0111 -- The first time HIGHEST_TASK is restarted, it stops the
0112 -- timer and reports the execution time for a TASK_RESTART
0113 -- for a blocked task which preempts the caller. The second
0114 -- time HIGHEST_TASK is restarted, it stops the timer and reports
0115 -- the execution time for a TASK_RESTART for a ready task which
0116 -- has its original priority restored and preempts the caller.
0117 --
0118
0119 procedure HIGHEST_TASK (
0120 ARGUMENT : in RTEMS.TASKS.ARGUMENT
0121 );
0122 pragma Convention (C, HIGHEST_TASK);
0123
0124 --
0125 -- HIGH_TASK
0126 --
0127 -- DESCRIPTION:
0128 --
0129 -- This RTEMS task is created by one of the LOW_TASKS. This
0130 -- task restarts HIGHEST_TASK twice. HIGHEST_TASK is blocked the
0131 -- first time and preempts this task when restarted. HIGHEST_TASK
0132 -- is ready the second time but has lowered its priority. When
0133 -- restarted for the second time, HIGHEST_TASK will have its
0134 -- original priority restored and preempt this task.
0135 -- Once control of the processor is returned to this task after
0136 -- HIGHEST_TASK deletes itself, the following execution times
0137 -- are measured and reported.
0138 --
0139 -- + readying SEMAPHORE_RELEASE
0140 -- + TASK_CREATE
0141 -- + TASK_START
0142 -- + TASK_RESTART of a suspended task
0143 -- + TASK_DELETE of a suspended task
0144 -- + TASK_RESTART of a ready task
0145 -- + TASK_RESTART of a blocked task which does not cause a preempt
0146 -- + TASK_DELETE of a blocked task
0147 --
0148
0149 procedure HIGH_TASK (
0150 ARGUMENT : in RTEMS.TASKS.ARGUMENT
0151 );
0152 pragma Convention (C, HIGH_TASK);
0153
0154 --
0155 -- LOW_TASKS
0156 --
0157 -- DESCRIPTION:
0158 --
0159 -- The last of these RTEMS tasks to execute creates HIGH_TASK
0160 -- and HIGHEST_TASK. All of these tasks perform a blocking
0161 -- SEMAPHORE_OBTAIN.
0162 --
0163
0164 procedure LOW_TASKS (
0165 ARGUMENT : in RTEMS.TASKS.ARGUMENT
0166 );
0167 pragma Convention (C, LOW_TASKS);
0168
0169 --
0170 -- RESTART_TASK
0171 --
0172 -- DESCRIPTION:
0173 --
0174 -- This RTEMS task
0175 --
0176
0177 procedure RESTART_TASK (
0178 ARGUMENT : in RTEMS.TASKS.ARGUMENT
0179 );
0180 pragma Convention (C, RESTART_TASK);
0181
0182 end TMTEST;