source: rtems/testsuites/smptests/smp09/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.1 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#include <rtems/cpuuse.h>
17
18const char rtems_test_name[] = "SMP 9";
19
20volatile int killtime;
21
22rtems_task Init(
23  rtems_task_argument argument
24);
25
26rtems_task Test_task(
27  rtems_task_argument argument
28);
29
30rtems_task Test_task(
31  rtems_task_argument argument
32)
33{
34  while (1)
35    ;
36  /* XXX something goes here */
37}
38
39rtems_task Init(
40  rtems_task_argument argument
41)
42{
43  uint32_t           i;
44  char               ch;
45  uint32_t           cpu_num;
46  rtems_id           id;
47  rtems_status_code  status;
48
49  TEST_BEGIN();
50
51  locked_print_initialize();
52
53  for ( killtime=0; killtime<1000000; killtime++ )
54    ;
55 
56  for ( i=0; i<rtems_get_processor_count() -1; i++ ) {
57    ch = '1' + i;
58
59    status = rtems_task_create(
60      rtems_build_name( 'T', 'A', ch, ' ' ),
61      1,
62      RTEMS_MINIMUM_STACK_SIZE,
63      RTEMS_DEFAULT_MODES,
64      RTEMS_DEFAULT_ATTRIBUTES,
65      &id
66    );
67    directive_failed( status, "task create" );
68
69    cpu_num = rtems_get_current_processor();
70    locked_printf(" CPU %" PRIu32 " start task TA%c\n", cpu_num, ch);
71
72    status = rtems_task_start( id, Test_task, i+1 );
73    directive_failed( status, "task start" );
74  }
75
76  locked_printf(" kill 10 clock ticks\n" );
77  while ( rtems_clock_get_ticks_since_boot() < 10 )
78    ;
79
80  rtems_cpu_usage_report();
81
82  TEST_END();
83  rtems_test_exit(0);
84}
85
86/* configuration information */
87
88#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
89#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
90
91#define CONFIGURE_MAXIMUM_PROCESSORS   4
92
93#define CONFIGURE_MAXIMUM_TASKS            \
94    (1 + CONFIGURE_MAXIMUM_PROCESSORS)
95#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
96
97#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
98
99#define CONFIGURE_MAXIMUM_SEMAPHORES 1
100
101#define CONFIGURE_INIT
102
103#include <rtems/confdefs.h>
104/* end of file */
Note: See TracBrowser for help on using the repository browser.