source: rtems/testsuites/psxtests/psxconfig01/init.c @ d507c037

4.11
Last change on this file since d507c037 was d507c037, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 3, 2014 at 5:55:43 PM

Disable per task variables when SMP is enabled

Per task variables are inherently unsafe in SMP systems. This
patch disables them from the build and adds warnings in the
appropriate documentation and configuration sections.

  • Property mode set to 100644
File size: 15.3 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup psxtests
5 *
6 * @brief Test that the workspace size estimate is correct.
7 */
8
9/*
10 * Copyright (c) 2014. On-Line Applications Research Corporation (OAR).
11 * Copyright (c) 2011-2012 embedded brains GmbH.  All rights reserved.
12 *
13 *  embedded brains GmbH
14 *  Obere Lagerstr. 30
15 *  82178 Puchheim
16 *  Germany
17 *  <rtems@embedded-brains.de>
18 *
19 * The license and distribution terms for this file may be
20 * found in the file LICENSE in this distribution or at
21 * http://www.rtems.org/license/LICENSE.
22 */
23
24#ifdef HAVE_CONFIG_H
25  #include "config.h"
26#endif
27
28#include <rtems/test.h>
29#include <tmacros.h>
30
31#include <sys/stat.h>
32#include <fcntl.h>
33#include <inttypes.h>
34#include <mqueue.h>
35#include <pthread.h>
36#include <semaphore.h>
37#include <signal.h>
38#include <stdio.h>
39#include <time.h>
40#include <limits.h>
41
42#include <rtems/libcsupport.h>
43
44const char rtems_test_name[] = "PSXCONFIG 1";
45
46#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 5
47
48#define CONFIGURE_MAXIMUM_BARRIERS 2
49#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 7
50#define CONFIGURE_MAXIMUM_PARTITIONS 37
51#define CONFIGURE_MAXIMUM_PERIODS 41
52#define CONFIGURE_MAXIMUM_REGIONS 43
53#define CONFIGURE_MAXIMUM_SEMAPHORES 47
54#define CONFIGURE_MAXIMUM_TASKS 11
55#if !defined(RTEMS_SMP)
56  #define CONFIGURE_MAXIMUM_TASK_VARIABLES 13
57#endif
58#define CONFIGURE_MAXIMUM_TIMERS 59
59#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 17
60
61#define CONFIGURE_MAXIMUM_POSIX_BARRIERS 31
62#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 29
63#define CONFIGURE_MAXIMUM_POSIX_KEYS 23
64#define POSIX_MQ_COUNT 5
65#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 19
66#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 7
67#define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 31
68#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 41
69#define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 17
70#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
71
72#define CONFIGURE_MAXIMUM_POSIX_THREADS 3
73#define CONFIGURE_MAXIMUM_POSIX_TIMERS 47
74
75#ifndef CONFIGURE_MAXIMUM_TASKS
76  #define CONFIGURE_MAXIMUM_TASKS 1
77#endif
78
79#ifdef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
80  #define MQ_0_COUNT 2
81  #define MQ_1_COUNT 3
82  #define MQ_2_COUNT 5
83  #define MQ_3_COUNT 7
84  #define MQ_4_COUNT 11
85  #define MQ_5_COUNT 13
86  #define MQ_6_COUNT 17
87
88  #define MQ_0_SIZE 101
89  #define MQ_1_SIZE 103
90  #define MQ_2_SIZE 107
91  #define MQ_3_SIZE 109
92  #define MQ_4_SIZE 113
93  #define MQ_5_SIZE 127
94  #define MQ_6_SIZE 131
95
96  #define MQ_BUFFER_MEMORY \
97    (CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_0_COUNT, MQ_0_SIZE) \
98      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_1_COUNT, MQ_1_SIZE) \
99      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_2_COUNT, MQ_2_SIZE) \
100      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_3_COUNT, MQ_3_SIZE) \
101      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_4_COUNT, MQ_4_SIZE) \
102      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_5_COUNT, MQ_5_SIZE) \
103      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MQ_6_COUNT, MQ_6_SIZE))
104
105  static const uint8_t mq_counts [CONFIGURE_MAXIMUM_MESSAGE_QUEUES] = {
106    MQ_0_COUNT,
107    MQ_1_COUNT,
108    MQ_2_COUNT,
109    MQ_3_COUNT,
110    MQ_4_COUNT,
111    MQ_5_COUNT,
112    MQ_6_COUNT
113  };
114
115  static const uint8_t mq_sizes [CONFIGURE_MAXIMUM_MESSAGE_QUEUES] = {
116    MQ_0_SIZE,
117    MQ_1_SIZE,
118    MQ_2_SIZE,
119    MQ_3_SIZE,
120    MQ_4_SIZE,
121    MQ_5_SIZE,
122    MQ_6_SIZE
123  };
124#else
125  #define MQ_BUFFER_MEMORY 0
126#endif
127
128#ifdef POSIX_MQ_COUNT
129  #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS POSIX_MQ_COUNT
130  #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES POSIX_MQ_COUNT
131
132  #define POSIX_MQ_0_COUNT 2
133  #define POSIX_MQ_1_COUNT 3
134  #define POSIX_MQ_2_COUNT 5
135  #define POSIX_MQ_3_COUNT 7
136  #define POSIX_MQ_4_COUNT 11
137
138  #define POSIX_MQ_0_SIZE 137
139  #define POSIX_MQ_1_SIZE 139
140  #define POSIX_MQ_2_SIZE 149
141  #define POSIX_MQ_3_SIZE 151
142  #define POSIX_MQ_4_SIZE 157
143
144  #define POSIX_MQ_BUFFER_MEMORY \
145    (CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(POSIX_MQ_0_COUNT, POSIX_MQ_0_SIZE) \
146      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(POSIX_MQ_1_COUNT, POSIX_MQ_1_SIZE) \
147      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(POSIX_MQ_2_COUNT, POSIX_MQ_2_SIZE) \
148      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(POSIX_MQ_3_COUNT, POSIX_MQ_3_SIZE) \
149      + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(POSIX_MQ_4_COUNT, POSIX_MQ_4_SIZE))
150
151  static const uint8_t posix_mq_counts [POSIX_MQ_COUNT] = {
152    POSIX_MQ_0_COUNT,
153    POSIX_MQ_1_COUNT,
154    POSIX_MQ_2_COUNT,
155    POSIX_MQ_3_COUNT,
156    POSIX_MQ_4_COUNT
157  };
158
159  static const uint8_t posix_mq_sizes [POSIX_MQ_COUNT] = {
160    POSIX_MQ_0_SIZE,
161    POSIX_MQ_1_SIZE,
162    POSIX_MQ_2_SIZE,
163    POSIX_MQ_3_SIZE,
164    POSIX_MQ_4_SIZE
165  };
166#else
167  #define POSIX_MQ_BUFFER_MEMORY 0
168#endif
169
170#define CONFIGURE_MESSAGE_BUFFER_MEMORY \
171  (MQ_BUFFER_MEMORY + POSIX_MQ_BUFFER_MEMORY)
172
173#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
174#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
175
176#define CONFIGURE_MAXIMUM_DRIVERS 2
177
178#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
179
180#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
181
182#define CONFIGURE_INIT
183
184static rtems_task Init(rtems_task_argument argument);
185
186#include <rtems/confdefs.h>
187
188typedef struct {
189  uint64_t data [16];
190} area;
191
192#ifdef CONFIGURE_MAXIMUM_PARTITIONS
193  static area partition_areas [CONFIGURE_MAXIMUM_PARTITIONS];
194#endif
195
196#ifdef CONFIGURE_MAXIMUM_REGIONS
197  static area region_areas [CONFIGURE_MAXIMUM_REGIONS];
198#endif
199
200static char posix_name [NAME_MAX];
201
202#if !defined(RTEMS_SMP)
203  static void *task_var;
204#endif
205
206static char *get_posix_name(char a, char b, char c, int i)
207{
208  posix_name [NAME_MAX - 5] = a;
209  posix_name [NAME_MAX - 4] = b;
210  posix_name [NAME_MAX - 3] = c;
211  posix_name [NAME_MAX - 2] = 'A' + i;
212
213  return posix_name;
214}
215
216#if !defined(RTEMS_SMP)
217static void task_var_dtor(void *var __attribute__((unused)))
218{
219  /* Do nothing */
220}
221#endif
222
223static void *posix_thread(void *arg __attribute__((unused)))
224{
225  rtems_test_assert(0);
226}
227
228static void posix_key_dtor(void *key __attribute__((unused)))
229{
230  /* Do nothing */
231}
232
233static void print_info(void)
234{
235  Heap_Information_block info;
236  bool ok = rtems_workspace_get_information(&info);
237  rtems_test_assert(ok);
238
239  printf(
240    "used blocks = %" PRIu32 ", "
241    "largest used block = %" PRIu32 ", "
242    "used space = %" PRIu32 "\n"
243    "free blocks = %" PRIu32 ", "
244    "largest free block = %" PRIu32 ", "
245    "free space = %" PRIu32 "\n",
246    info.Used.number,
247    info.Used.largest,
248    info.Used.total,
249    info.Free.number,
250    info.Free.largest,
251    info.Free.total
252  );
253}
254
255static rtems_task Init(rtems_task_argument argument)
256{
257  rtems_status_code sc = RTEMS_SUCCESSFUL;
258  int eno = 0;
259  int rv = 0;
260  rtems_id id = RTEMS_ID_NONE;
261  rtems_name name = rtems_build_name('C', 'O', 'N', 'F');
262  rtems_extensions_table table;
263  rtems_resource_snapshot snapshot;
264  int i = 0;
265
266  TEST_BEGIN();
267
268  memset(posix_name, 'P', sizeof(posix_name) - 1);
269
270  print_info();
271
272  rtems_resource_snapshot_take(&snapshot);
273  rtems_test_assert(rtems_resource_snapshot_equal(&snapshot, &snapshot));
274  rtems_test_assert(rtems_resource_snapshot_check(&snapshot));
275
276#ifdef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
277  for (i = 3; i < CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS; ++i) {
278    int oflag = O_WRONLY | O_CREAT | O_TRUNC;
279    mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
280    char path [] = { 'F', 'I', 'L', 'E', 'A' + i, '\0' };
281    int fd = open(path, oflag, mode);
282    rtems_test_assert(fd == i);
283  }
284  rtems_resource_snapshot_take(&snapshot);
285  rtems_test_assert(
286    snapshot.open_files == CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
287  );
288#endif
289
290#ifdef CONFIGURE_MAXIMUM_USER_EXTENSIONS
291  memset(&table, 0, sizeof(table));
292  for (i = 0; i < CONFIGURE_MAXIMUM_USER_EXTENSIONS; ++i) {
293    sc = rtems_extension_create(name, &table, &id);
294    directive_failed(sc, "rtems_extension_create");
295  }
296  rtems_resource_snapshot_take(&snapshot);
297  rtems_test_assert(
298    snapshot.rtems_api.active_extensions == CONFIGURE_MAXIMUM_USER_EXTENSIONS
299  );
300#endif
301
302#ifdef CONFIGURE_MAXIMUM_BARRIERS
303  for (i = 0; i < CONFIGURE_MAXIMUM_BARRIERS; ++i) {
304    sc = rtems_barrier_create(name, RTEMS_DEFAULT_ATTRIBUTES, 1, &id);
305    directive_failed(sc, "rtems_barrier_create");
306  }
307  rtems_resource_snapshot_take(&snapshot);
308  rtems_test_assert(
309    snapshot.rtems_api.active_barriers == CONFIGURE_MAXIMUM_BARRIERS
310  );
311#endif
312
313#ifdef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
314  for (i = 0; i < CONFIGURE_MAXIMUM_MESSAGE_QUEUES; ++i) {
315    sc = rtems_message_queue_create(
316      name,
317      mq_counts [i],
318      mq_sizes [i],
319      RTEMS_DEFAULT_ATTRIBUTES,
320      &id
321    );
322    directive_failed(sc, "rtems_message_queue_create");
323  }
324  rtems_resource_snapshot_take(&snapshot);
325  rtems_test_assert(
326    snapshot.rtems_api.active_message_queues
327      == CONFIGURE_MAXIMUM_MESSAGE_QUEUES
328  );
329#endif
330
331#ifdef CONFIGURE_MAXIMUM_PARTITIONS
332  for (i = 0; i < CONFIGURE_MAXIMUM_PARTITIONS; ++i) {
333    sc = rtems_partition_create(
334      name,
335      partition_areas + i,
336      sizeof(partition_areas [0]),
337      sizeof(partition_areas [0]),
338      RTEMS_DEFAULT_ATTRIBUTES,
339      &id
340    );
341    directive_failed(sc, "rtems_partition_create");
342  }
343  rtems_resource_snapshot_take(&snapshot);
344  rtems_test_assert(
345    snapshot.rtems_api.active_partitions == CONFIGURE_MAXIMUM_PARTITIONS
346  );
347#endif
348
349#ifdef CONFIGURE_MAXIMUM_PERIODS
350  for (i = 0; i < CONFIGURE_MAXIMUM_PERIODS; ++i) {
351    sc = rtems_rate_monotonic_create(name, &id);
352    directive_failed(sc, "rtems_rate_monotonic_create");
353  }
354  rtems_resource_snapshot_take(&snapshot);
355  rtems_test_assert(
356    snapshot.rtems_api.active_periods == CONFIGURE_MAXIMUM_PERIODS
357  );
358#endif
359
360#ifdef CONFIGURE_MAXIMUM_REGIONS
361  for (i = 0; i < CONFIGURE_MAXIMUM_REGIONS; ++i) {
362    sc = rtems_region_create(
363      name,
364      region_areas + i,
365      sizeof(region_areas [0]),
366      1,
367      RTEMS_DEFAULT_ATTRIBUTES,
368      &id
369    );
370    directive_failed(sc, "rtems_region_create");
371  }
372  rtems_resource_snapshot_take(&snapshot);
373  rtems_test_assert(
374    snapshot.rtems_api.active_regions == CONFIGURE_MAXIMUM_REGIONS
375  );
376#endif
377
378#ifdef CONFIGURE_MAXIMUM_SEMAPHORES
379  for (i = 0; i < CONFIGURE_MAXIMUM_SEMAPHORES; ++i) {
380    sc = rtems_semaphore_create(
381      name,
382      0,
383      RTEMS_DEFAULT_ATTRIBUTES,
384      0,
385      &id
386    );
387    directive_failed(sc, "rtems_semaphore_create");
388  }
389  rtems_resource_snapshot_take(&snapshot);
390  rtems_test_assert(
391    snapshot.rtems_api.active_semaphores >= CONFIGURE_MAXIMUM_SEMAPHORES
392  );
393#endif
394
395#ifdef CONFIGURE_MAXIMUM_TASKS
396  for (i = 1; i < CONFIGURE_MAXIMUM_TASKS; ++i) {
397    sc = rtems_task_create(
398      name,
399      RTEMS_MINIMUM_PRIORITY,
400      RTEMS_MINIMUM_STACK_SIZE,
401      RTEMS_DEFAULT_MODES,
402      RTEMS_LOCAL | RTEMS_FLOATING_POINT,
403      &id
404    );
405    directive_failed(sc, "rtems_task_create");
406  }
407  rtems_resource_snapshot_take(&snapshot);
408  rtems_test_assert(
409    snapshot.rtems_api.active_tasks == CONFIGURE_MAXIMUM_TASKS
410  );
411#endif
412
413#if !defined(RTEMS_SMP)
414#ifdef CONFIGURE_MAXIMUM_TASK_VARIABLES
415  for (i = 0; i < CONFIGURE_MAXIMUM_TASK_VARIABLES; ++i) {
416    sc = rtems_task_variable_add(RTEMS_SELF, &task_var, task_var_dtor);
417    directive_failed(sc, "rtems_task_variable_add");
418  }
419#endif
420#endif
421
422#ifdef CONFIGURE_MAXIMUM_TIMERS
423  for (i = 0; i < CONFIGURE_MAXIMUM_TIMERS; ++i) {
424    sc = rtems_timer_create(name, &id);
425    directive_failed(sc, "rtems_timer_create");
426  }
427  rtems_resource_snapshot_take(&snapshot);
428  rtems_test_assert(
429    snapshot.rtems_api.active_timers == CONFIGURE_MAXIMUM_TIMERS
430  );
431#endif
432
433#ifdef CONFIGURE_MAXIMUM_POSIX_BARRIERS
434  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_BARRIERS; ++i) {
435    pthread_barrier_t barrier;
436    eno = pthread_barrier_init(&barrier, NULL, 1);
437    rtems_test_assert(eno == 0);
438  }
439  rtems_resource_snapshot_take(&snapshot);
440  rtems_test_assert(
441    snapshot.posix_api.active_barriers == CONFIGURE_MAXIMUM_POSIX_BARRIERS
442  );
443#endif
444
445#ifdef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
446  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES; ++i) {
447    pthread_cond_t cond;
448    eno = pthread_cond_init(&cond, NULL);
449    rtems_test_assert(eno == 0);
450  }
451  rtems_resource_snapshot_take(&snapshot);
452  rtems_test_assert(
453    snapshot.posix_api.active_condition_variables
454      == CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
455  );
456#endif
457
458#ifdef CONFIGURE_MAXIMUM_POSIX_KEYS
459  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_KEYS; ++i) {
460    pthread_key_t key;
461    eno = pthread_key_create(&key, posix_key_dtor);
462    rtems_test_assert(eno == 0);
463  }
464  rtems_resource_snapshot_take(&snapshot);
465  rtems_test_assert(
466    snapshot.posix_api.active_keys == CONFIGURE_POSIX_KEYS
467  );
468#endif
469
470#ifdef POSIX_MQ_COUNT
471  for (i = 0; i < POSIX_MQ_COUNT; ++i) {
472    int oflag = O_RDWR | O_CREAT | O_EXCL;
473    mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
474    struct mq_attr attr = {
475      .mq_maxmsg = posix_mq_counts [i],
476      .mq_msgsize = posix_mq_sizes [i]
477    };
478    char *path = get_posix_name('M', 'S', 'Q', i);
479    mqd_t mq = mq_open(path, oflag, mode, &attr);
480    rtems_test_assert(mq >= 0);
481  }
482  rtems_resource_snapshot_take(&snapshot);
483  rtems_test_assert(
484    snapshot.posix_api.active_message_queue_descriptors
485      == CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS
486  );
487  rtems_test_assert(
488    snapshot.posix_api.active_message_queues
489      == CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
490  );
491#endif
492
493#ifdef CONFIGURE_MAXIMUM_POSIX_MUTEXES
494  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_MUTEXES; ++i) {
495    pthread_mutex_t mutex;
496    eno = pthread_mutex_init(&mutex, NULL);
497    rtems_test_assert(eno == 0);
498  }
499  rtems_resource_snapshot_take(&snapshot);
500  rtems_test_assert(
501    snapshot.posix_api.active_mutexes == CONFIGURE_MAXIMUM_POSIX_MUTEXES
502  );
503#endif
504
505#ifdef CONFIGURE_MAXIMUM_POSIX_RWLOCKS
506  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_RWLOCKS; ++i) {
507    pthread_rwlock_t rwlock;
508    eno = pthread_rwlock_init(&rwlock, NULL);
509    rtems_test_assert(eno == 0);
510  }
511  rtems_resource_snapshot_take(&snapshot);
512  rtems_test_assert(
513    snapshot.posix_api.active_rwlocks == CONFIGURE_MAXIMUM_POSIX_RWLOCKS
514  );
515#endif
516
517#ifdef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
518  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_SEMAPHORES; ++i) {
519    int oflag = O_RDWR | O_CREAT | O_EXCL;
520    mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
521    unsigned int value = 0;
522    char *path = get_posix_name('S', 'E', 'M', i);
523    sem_t *sem = sem_open(path, oflag, mode, value);
524    rtems_test_assert(sem != SEM_FAILED);
525  }
526  rtems_resource_snapshot_take(&snapshot);
527  rtems_test_assert(
528    snapshot.posix_api.active_semaphores == CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
529  );
530#endif
531
532#ifdef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS
533  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_SPINLOCKS; ++i) {
534    pthread_spinlock_t spinlock;
535    eno = pthread_spin_init(&spinlock, 0);
536    rtems_test_assert(eno == 0);
537  }
538  rtems_resource_snapshot_take(&snapshot);
539  rtems_test_assert(
540    snapshot.posix_api.active_spinlocks == CONFIGURE_MAXIMUM_POSIX_SPINLOCKS
541  );
542#endif
543
544#ifdef CONFIGURE_MAXIMUM_POSIX_THREADS
545  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_THREADS; ++i) {
546    pthread_t thread;
547    eno = pthread_create(&thread, NULL, posix_thread, NULL);
548    rtems_test_assert(eno == 0);
549  }
550  rtems_resource_snapshot_take(&snapshot);
551  rtems_test_assert(
552    snapshot.posix_api.active_threads == CONFIGURE_MAXIMUM_POSIX_THREADS
553  );
554#endif
555
556#ifdef CONFIGURE_MAXIMUM_POSIX_TIMERS
557  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_TIMERS; ++i) {
558    timer_t timer_id;
559    rv = timer_create(CLOCK_REALTIME, NULL, &timer_id);
560    rtems_test_assert(rv == 0);
561  }
562  rtems_resource_snapshot_take(&snapshot);
563  rtems_test_assert(
564    snapshot.posix_api.active_timers == CONFIGURE_MAXIMUM_POSIX_TIMERS
565  );
566#endif
567
568  printf("object creation done\n");
569  print_info();
570
571  TEST_END();
572
573  rtems_test_exit(0);
574}
Note: See TracBrowser for help on using the repository browser.