source: rtems/testsuites/samples/unlimited/system.h @ e53aae2

4.11
Last change on this file since e53aae2 was e53aae2, checked in by Gedare Bloom <gedare@…>, on Mar 26, 2012 at 8:42:38 PM

confdefs: Add declaration for unlimited objects.

Adds to confdefs a way to specify rtems_resource_unlimited for classic and
posix objects using a new macro CONFIGURE_OBJECTS_UNLIMITED.
Use CONFIGURE_OBJECTS_ALLOCATION_SIZE to declare the allocation size for
extending the set of objects at runtime. Updates the unlimited sample
to demonstrate how to use the new macros. Also adds new documentation in
the C User's Manual regarding configuring with unlimited objects.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/*  system.h
2 *
3 *  This include file contains information that is included in every
4 *  function in the test set.
5 *
6 *  COPYRIGHT (c) 1989-2008.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may in
10 *  the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#include <rtems.h>
17
18/* functions */
19
20rtems_task Init(
21  rtems_task_argument argument
22);
23
24rtems_task test_task(
25  rtems_task_argument my_number
26);
27
28void
29destory_all_tasks(
30  const char *who
31);
32
33bool status_code_bad(
34  rtems_status_code status_code
35);
36
37extern void test1(void);
38extern void test2(void);
39extern void test3(void);
40
41/* configuration information */
42
43#include <bsp.h> /* for device driver prototypes */
44
45/* NOTICE: the clock driver is explicitly disabled */
46#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
47#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
48
49#define CONFIGURE_UNIFIED_WORK_AREAS
50#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
51
52#define TASK_ALLOCATION_SIZE     (5)
53#define CONFIGURE_UNLIMITED_OBJECTS
54#define CONFIGURE_UNLIMITED_ALLOCATION_SIZE TASK_ALLOCATION_SIZE
55#define CONFIGURE_INIT_TASK_STACK_SIZE (8 * 1024)
56
57
58#include <rtems/confdefs.h>
59
60/*
61 * Keep track of the task id's created, use a large array.
62 */
63
64#define MAX_TASKS         (1000)
65#define TASK_INDEX_OFFSET (1)
66
67extern rtems_id task_id[MAX_TASKS];
68
69/*
70 * Increment the task name.
71 */
72
73#define NEXT_TASK_NAME(c1, c2, c3, c4)  \
74                 if (c4 == '9') {       \
75                   if (c3 == '9') {     \
76                     if (c2 == 'z') {   \
77                       if (c1 == 'z') { \
78                         printf("not enough task letters for names !!!\n"); \
79                         exit( 1 );     \
80                       } else           \
81                         c1++;          \
82                       c2 = 'a';        \
83                     } else             \
84                      c2++;             \
85                     c3 = '0';          \
86                   } else               \
87                     c3++;              \
88                   c4 = '0';            \
89                 }                      \
90                 else                   \
91                   c4++                 \
92
93
94/* end of include file */
Note: See TracBrowser for help on using the repository browser.