summaryrefslogtreecommitdiffstats
path: root/testsuites/ada/sptests/sp01/sp01.adb
blob: 34dd39e8caba82950556e8768d47b51bf72da2e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
--
--  MAIN / BODY
--
--  DESCRIPTION:
--
--  This is the entry point for Test SP01 of the Single Processor Test Suite.
--
--  DEPENDENCIES: 
--
--  
--
--  COPYRIGHT (c) 1989-2011.
--  On-Line Applications Research Corporation (OAR).
--
--  The license and distribution terms for this file may in
--  the file LICENSE in this distribution or at
--  http://www.rtems.org/license/LICENSE.
--

with RTEMS;
with RTEMS.TASKS;
with SPTEST;
with TEST_SUPPORT;
with TEXT_IO;
with System.OS_Interface;

procedure SP01 is
  INIT_ID : RTEMS.ID;
  STATUS  : RTEMS.STATUS_CODES;
  obj_clockid_t : System.OS_Interface.clockid_t;
  pragma Warnings (Off, obj_clockid_t);
  obj_pid_t : System.OS_Interface.pid_t;
  pragma Warnings (Off, obj_pid_t);
  obj_pthread_attr_t : System.OS_Interface.pthread_attr_t;
  pragma Warnings (Off, obj_pthread_attr_t);
  obj_pthread_condattr_t : System.OS_Interface.pthread_condattr_t;
  pragma Warnings (Off, obj_pthread_condattr_t);
  obj_pthread_cond_t : System.OS_Interface.pthread_cond_t;
  pragma Warnings (Off, obj_pthread_cond_t);
  obj_pthread_key_t : System.OS_Interface.pthread_key_t;
  pragma Warnings (Off, obj_pthread_key_t);
  obj_pthread_mutexattr_t : System.OS_Interface.pthread_mutexattr_t;
  pragma Warnings (Off, obj_pthread_mutexattr_t);
  obj_pthread_mutex_t : System.OS_Interface.pthread_mutex_t;
  pragma Warnings (Off, obj_pthread_mutex_t);
  obj_pthread_rwlockattr_t : System.OS_Interface.pthread_rwlockattr_t;
  pragma Warnings (Off, obj_pthread_rwlockattr_t);
  obj_pthread_rwlock_t : System.OS_Interface.pthread_rwlock_t;
  pragma Warnings (Off, obj_pthread_rwlock_t);
  obj_pthread_t : System.OS_Interface.pthread_t;
  pragma Warnings (Off, obj_pthread_t);
  obj_rtems_id : System.OS_Interface.rtems_id;
  pragma Warnings (Off, obj_rtems_id);
  obj_sigset_t : System.OS_Interface.sigset_t;
  pragma Warnings (Off, obj_sigset_t);
  obj_stack_t : System.OS_Interface.stack_t;
  pragma Warnings (Off, obj_stack_t);
  obj_struct_sched_param : System.OS_Interface.struct_sched_param;
  pragma Warnings (Off, obj_struct_sched_param);
  obj_struct_sigaction : System.OS_Interface.struct_sigaction;
  pragma Warnings (Off, obj_struct_sigaction);
  obj_timespec : System.OS_Interface.timespec;
  pragma Warnings (Off, obj_timespec);
begin

   TEXT_IO.NEW_LINE( 2 );
   TEST_SUPPORT.ADA_TEST_BEGIN;

   TEST_SUPPORT.Check_Type(
      0,
      obj_clockid_t'Size,
      obj_clockid_t'Alignment
   );
   TEST_SUPPORT.Check_Type(
      1,
      obj_pid_t'Size,
      obj_pid_t'Alignment
   );
   TEST_SUPPORT.Check_Type(
      2,
      obj_pthread_attr_t'Size,
      obj_pthread_attr_t'Alignment
   );
   TEST_SUPPORT.Check_Type(
      3,
      obj_pthread_condattr_t'Size,
      obj_pthread_condattr_t'Alignment
   );
   TEST_SUPPORT.Check_Type(
      4,
      obj_pthread_cond_t'Size,
      obj_pthread_cond_t'Alignment
   );
   TEST_SUPPORT.Check_Type(
      5,
      obj_pthread_key_t'Size,
      obj_pthread_key_t'Alignment
   );
   TEST_SUPPORT.Check_Type(
      6,
      obj_pthread_mutexattr_t'Size,
      obj_pthread_mutexattr_t'Alignment
   );
   TEST_SUPPORT.Check_Type(
      7,
      obj_pthread_mutex_t'Size,
      obj_pthread_mutex_t'Alignment
   );
   TEST_SUPPORT.Check_Type(
      8,
      obj_pthread_rwlockattr_t'Size,
      obj_pthread_rwlockattr_t'Alignment
   );
   TEST_SUPPORT.Check_Type(
      9,
      obj_pthread_rwlock_t'Size,
      obj_pthread_rwlock_t'Alignment
   );
   TEST_SUPPORT.Check_Type(
      10,
      obj_pthread_t'Size,
      obj_pthread_t'Alignment
   );
   TEST_SUPPORT.Check_Type(
      11,
      obj_rtems_id'Size,
      obj_rtems_id'Alignment
   );
   TEST_SUPPORT.Check_Type(
      12,
      obj_sigset_t'Size,
      obj_sigset_t'Alignment
   );
   TEST_SUPPORT.Check_Type(
      13,
      obj_stack_t'Size,
      obj_stack_t'Alignment
   );
   TEST_SUPPORT.Check_Type(
      14,
      obj_struct_sched_param'Size,
      obj_struct_sched_param'Alignment
   );
   TEST_SUPPORT.Check_Type(
      15,
      obj_struct_sigaction'Size,
      obj_struct_sigaction'Alignment
   );
   TEST_SUPPORT.Check_Type(
      16,
      obj_timespec'Size,
      obj_timespec'Alignment
   );

   RTEMS.TASKS.CREATE(
      RTEMS.BUILD_NAME(  'I', 'N', 'I', 'T' ),
      1,
      RTEMS.MINIMUM_STACK_SIZE,
      RTEMS.NO_PREEMPT,
      RTEMS.DEFAULT_ATTRIBUTES,
      INIT_ID,
      STATUS
   );
   TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );


   RTEMS.TASKS.START(
      INIT_ID,
      SPTEST.INIT'ACCESS,
      0,
      STATUS
   );
   TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );

   loop
      delay 120.0;
   end loop;

end SP01;