source: rtems/testsuites/smptests/smp05/init.c @ af43554

5
Last change on this file since af43554 was af43554, checked in by Sebastian Huber <sebastian.huber@…>, on 10/26/17 at 11:59:11

tests: Remove TEST_INIT

The TEST_EXTERN is a used only by the system.h style tests and they use
CONFIGURE_INIT appropriately.

Update #3170.
Update #3199.

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2011.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <tmacros.h>
15#include "test_support.h"
16
17const char rtems_test_name[] = "SMP 5";
18
19rtems_task Init(
20  rtems_task_argument argument
21);
22
23rtems_task Test_task(
24  rtems_task_argument argument
25);
26
27
28static void success(void)
29{
30  rtems_test_end();
31  rtems_test_exit( 0 );
32}
33
34rtems_task Test_task(
35  rtems_task_argument argument
36)
37{
38  locked_printf( "Shut down from CPU %" PRIu32 "\n", rtems_get_current_processor() );
39  success();
40}
41
42rtems_task Init(
43  rtems_task_argument argument
44)
45{
46  uint32_t           i;
47  char               ch;
48  uint32_t           cpu_num;
49  rtems_id           id;
50  rtems_status_code  status;
51
52  locked_print_initialize();
53  rtems_test_begin();
54
55  if ( rtems_get_processor_count() == 1 ) {
56    success();
57  }
58
59  for ( i=0; i<rtems_get_processor_count() ; i++ ) {
60    ch = '1' + i;
61
62    status = rtems_task_create(
63      rtems_build_name( 'T', 'A', ch, ' ' ),
64      1,
65      RTEMS_MINIMUM_STACK_SIZE,
66      RTEMS_DEFAULT_MODES,
67      RTEMS_DEFAULT_ATTRIBUTES,
68      &id
69    );
70    directive_failed( status, "task create" );
71
72    cpu_num = rtems_get_current_processor();
73    locked_printf(" CPU %" PRIu32 " start task TA%c\n", cpu_num, ch);
74
75    status = rtems_task_start( id, Test_task, i+1 );
76    directive_failed( status, "task start" );
77  }
78
79  while (1)
80    ;
81}
82
83/* configuration information */
84
85#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
86#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
87
88#define CONFIGURE_MAXIMUM_PROCESSORS   2
89
90#define CONFIGURE_MAXIMUM_TASKS            \
91    (1 + CONFIGURE_MAXIMUM_PROCESSORS)
92#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
93
94#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
95
96#define CONFIGURE_MAXIMUM_SEMAPHORES 1
97
98#define CONFIGURE_INIT
99
100#include <rtems/confdefs.h>
101/* end of file */
Note: See TracBrowser for help on using the repository browser.