File indexing completed on 2025-05-11 08:24:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #ifdef HAVE_CONFIG_H
0038 #include "config.h"
0039 #endif
0040
0041 #include <inttypes.h>
0042 #include <stdio.h>
0043 #include <stdlib.h>
0044
0045 #include "system.h"
0046 #include "tmacros.h"
0047
0048 #include <rtems/score/objectimpl.h>
0049
0050 void test1()
0051 {
0052 Objects_Maximum objects_per_block;
0053 rtems_status_code result;
0054 uint32_t task_count = 0;
0055 Objects_Information *the_information;
0056
0057 char c1 = 'a';
0058 char c2 = 'a';
0059 char c3 = '0';
0060 char c4 = '0';
0061
0062 printf( "\n TEST1 : auto-extend disabled.\n" );
0063
0064
0065
0066
0067
0068
0069 the_information =
0070 _Objects_Information_table[OBJECTS_CLASSIC_API][OBJECTS_RTEMS_TASKS];
0071 objects_per_block = the_information->objects_per_block;
0072 the_information->objects_per_block = 0;
0073 the_information->allocate = _Objects_Allocate_static;
0074
0075 while (task_count < MAX_TASKS)
0076 {
0077 rtems_name name;
0078
0079 printf(" TEST1 : creating task '%c%c%c%c', ", c1, c2, c3, c4);
0080
0081 name = rtems_build_name(c1, c2, c3, c4);
0082
0083 result = rtems_task_create(name,
0084 10,
0085 RTEMS_MINIMUM_STACK_SIZE,
0086 RTEMS_DEFAULT_ATTRIBUTES,
0087 RTEMS_LOCAL,
0088 &task_id[task_count]);
0089
0090 if (status_code_bad(result))
0091 break;
0092
0093 printf("number = %3" PRIi32 ", id = %08" PRIxrtems_id ", starting, ", task_count, task_id[task_count]);
0094
0095 fflush(stdout);
0096 result = rtems_task_start(task_id[task_count],
0097 test_task,
0098 (rtems_task_argument) task_count);
0099
0100 if (status_code_bad(result))
0101 break;
0102
0103
0104
0105
0106
0107 NEXT_TASK_NAME(c1, c2, c3, c4);
0108
0109 task_count++;
0110 }
0111
0112 if (task_count >= MAX_TASKS)
0113 printf( "\nMAX_TASKS too small for work-space size, please make larger !!\n\n" );
0114
0115 if (task_count != (TASK_ALLOCATION_SIZE - 1)) {
0116 printf( " FAIL1 : the number of tasks does not equal the expected size -\n"
0117 " task created = %" PRIi32 ", required number = %i\n",
0118 task_count, TASK_ALLOCATION_SIZE);
0119 exit( 1 );
0120 }
0121
0122 destroy_all_tasks("TEST1");
0123
0124 the_information->objects_per_block = objects_per_block;
0125 the_information->allocate = _Thread_Allocate_unlimited;
0126
0127 printf( " TEST1 : completed\n" );
0128 }