Back to home page

LXR

 
 

    


Warning, /testsuites/ada/sptests/sp01/sp01.adb is written in an unsupported language. File is not indexed.

0001 -- SPDX-License-Identifier: BSD-2-Clause
0002 
0003 --
0004 --  MAIN / BODY
0005 --
0006 --  DESCRIPTION:
0007 --
0008 --  This is the entry point for Test SP01 of the Single Processor Test Suite.
0009 --
0010 --  DEPENDENCIES: 
0011 --
0012 --  
0013 --
0014 --  COPYRIGHT (c) 1989-2011.
0015 --  On-Line Applications Research Corporation (OAR).
0016 --
0017 --  Redistribution and use in source and binary forms, with or without
0018 --  modification, are permitted provided that the following conditions
0019 --  are met:
0020 --  1. Redistributions of source code must retain the above copyright
0021 --     notice, this list of conditions and the following disclaimer.
0022 --  2. Redistributions in binary form must reproduce the above copyright
0023 --     notice, this list of conditions and the following disclaimer in the
0024 --     documentation and/or other materials provided with the distribution.
0025 --
0026 --  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0027 --  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0028 --  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0029 --  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0030 --  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0031 --  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0032 --  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0033 --  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0034 --  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0035 --  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0036 --  POSSIBILITY OF SUCH DAMAGE.
0037 --
0038 
0039 with RTEMS;
0040 with RTEMS.TASKS;
0041 with SPTEST;
0042 with TEST_SUPPORT;
0043 with TEXT_IO;
0044 with System.OS_Interface;
0045 
0046 procedure SP01 is
0047   INIT_ID : RTEMS.ID;
0048   STATUS  : RTEMS.STATUS_CODES;
0049   obj_clockid_t : System.OS_Interface.clockid_t;
0050   pragma Warnings (Off, obj_clockid_t);
0051   obj_pid_t : System.OS_Interface.pid_t;
0052   pragma Warnings (Off, obj_pid_t);
0053   obj_pthread_attr_t : System.OS_Interface.pthread_attr_t;
0054   pragma Warnings (Off, obj_pthread_attr_t);
0055   obj_pthread_condattr_t : System.OS_Interface.pthread_condattr_t;
0056   pragma Warnings (Off, obj_pthread_condattr_t);
0057   obj_pthread_cond_t : System.OS_Interface.pthread_cond_t;
0058   pragma Warnings (Off, obj_pthread_cond_t);
0059   obj_pthread_key_t : System.OS_Interface.pthread_key_t;
0060   pragma Warnings (Off, obj_pthread_key_t);
0061   obj_pthread_mutexattr_t : System.OS_Interface.pthread_mutexattr_t;
0062   pragma Warnings (Off, obj_pthread_mutexattr_t);
0063   obj_pthread_mutex_t : System.OS_Interface.pthread_mutex_t;
0064   pragma Warnings (Off, obj_pthread_mutex_t);
0065   obj_pthread_rwlockattr_t : System.OS_Interface.pthread_rwlockattr_t;
0066   pragma Warnings (Off, obj_pthread_rwlockattr_t);
0067   obj_pthread_rwlock_t : System.OS_Interface.pthread_rwlock_t;
0068   pragma Warnings (Off, obj_pthread_rwlock_t);
0069   obj_pthread_t : System.OS_Interface.pthread_t;
0070   pragma Warnings (Off, obj_pthread_t);
0071   obj_rtems_id : System.OS_Interface.rtems_id;
0072   pragma Warnings (Off, obj_rtems_id);
0073   obj_sigset_t : System.OS_Interface.sigset_t;
0074   pragma Warnings (Off, obj_sigset_t);
0075   obj_stack_t : System.OS_Interface.stack_t;
0076   pragma Warnings (Off, obj_stack_t);
0077   obj_struct_sched_param : System.OS_Interface.struct_sched_param;
0078   pragma Warnings (Off, obj_struct_sched_param);
0079   obj_struct_sigaction : System.OS_Interface.struct_sigaction;
0080   pragma Warnings (Off, obj_struct_sigaction);
0081   obj_timespec : System.OS_Interface.timespec;
0082   pragma Warnings (Off, obj_timespec);
0083 begin
0084 
0085    TEXT_IO.NEW_LINE( 2 );
0086    TEST_SUPPORT.ADA_TEST_BEGIN;
0087 
0088    TEST_SUPPORT.Check_Type(
0089       0,
0090       obj_clockid_t'Size,
0091       obj_clockid_t'Alignment
0092    );
0093    TEST_SUPPORT.Check_Type(
0094       1,
0095       obj_pid_t'Size,
0096       obj_pid_t'Alignment
0097    );
0098    TEST_SUPPORT.Check_Type(
0099       2,
0100       obj_pthread_attr_t'Size,
0101       obj_pthread_attr_t'Alignment
0102    );
0103    TEST_SUPPORT.Check_Type(
0104       3,
0105       obj_pthread_condattr_t'Size,
0106       obj_pthread_condattr_t'Alignment
0107    );
0108    TEST_SUPPORT.Check_Type(
0109       4,
0110       obj_pthread_cond_t'Size,
0111       obj_pthread_cond_t'Alignment
0112    );
0113    TEST_SUPPORT.Check_Type(
0114       5,
0115       obj_pthread_key_t'Size,
0116       obj_pthread_key_t'Alignment
0117    );
0118    TEST_SUPPORT.Check_Type(
0119       6,
0120       obj_pthread_mutexattr_t'Size,
0121       obj_pthread_mutexattr_t'Alignment
0122    );
0123    TEST_SUPPORT.Check_Type(
0124       7,
0125       obj_pthread_mutex_t'Size,
0126       obj_pthread_mutex_t'Alignment
0127    );
0128    TEST_SUPPORT.Check_Type(
0129       8,
0130       obj_pthread_rwlockattr_t'Size,
0131       obj_pthread_rwlockattr_t'Alignment
0132    );
0133    TEST_SUPPORT.Check_Type(
0134       9,
0135       obj_pthread_rwlock_t'Size,
0136       obj_pthread_rwlock_t'Alignment
0137    );
0138    TEST_SUPPORT.Check_Type(
0139       10,
0140       obj_pthread_t'Size,
0141       obj_pthread_t'Alignment
0142    );
0143    TEST_SUPPORT.Check_Type(
0144       11,
0145       obj_rtems_id'Size,
0146       obj_rtems_id'Alignment
0147    );
0148    TEST_SUPPORT.Check_Type(
0149       12,
0150       obj_sigset_t'Size,
0151       obj_sigset_t'Alignment
0152    );
0153    TEST_SUPPORT.Check_Type(
0154       13,
0155       obj_stack_t'Size,
0156       obj_stack_t'Alignment
0157    );
0158    TEST_SUPPORT.Check_Type(
0159       14,
0160       obj_struct_sched_param'Size,
0161       obj_struct_sched_param'Alignment
0162    );
0163    TEST_SUPPORT.Check_Type(
0164       15,
0165       obj_struct_sigaction'Size,
0166       obj_struct_sigaction'Alignment
0167    );
0168    TEST_SUPPORT.Check_Type(
0169       16,
0170       obj_timespec'Size,
0171       obj_timespec'Alignment
0172    );
0173 
0174    RTEMS.TASKS.CREATE(
0175       RTEMS.BUILD_NAME(  'I', 'N', 'I', 'T' ),
0176       1,
0177       RTEMS.MINIMUM_STACK_SIZE,
0178       RTEMS.NO_PREEMPT,
0179       RTEMS.DEFAULT_ATTRIBUTES,
0180       INIT_ID,
0181       STATUS
0182    );
0183    TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
0184 
0185 
0186    RTEMS.TASKS.START(
0187       INIT_ID,
0188       SPTEST.INIT'ACCESS,
0189       0,
0190       STATUS
0191    );
0192    TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
0193 
0194    loop
0195       delay 120.0;
0196    end loop;
0197 
0198 end SP01;
0199