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.com/license/LICENSE. |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #ifdef HAVE_CONFIG_H |
---|
13 | #include "config.h" |
---|
14 | #endif |
---|
15 | |
---|
16 | #include <tmacros.h> |
---|
17 | #include "test_support.h" |
---|
18 | #include <rtems/cpuuse.h> |
---|
19 | |
---|
20 | volatile int killtime; |
---|
21 | |
---|
22 | rtems_task Test_task( |
---|
23 | rtems_task_argument argument |
---|
24 | ) |
---|
25 | { |
---|
26 | while (1) |
---|
27 | ; |
---|
28 | /* XXX something goes here */ |
---|
29 | } |
---|
30 | |
---|
31 | rtems_task Init( |
---|
32 | rtems_task_argument argument |
---|
33 | ) |
---|
34 | { |
---|
35 | int i; |
---|
36 | char ch; |
---|
37 | int cpu_num; |
---|
38 | rtems_id id; |
---|
39 | rtems_status_code status; |
---|
40 | |
---|
41 | locked_print_initialize(); |
---|
42 | locked_printf( "\n\n*** TEST SMP09 ***\n" ); |
---|
43 | |
---|
44 | for ( killtime=0; killtime<1000000; killtime++ ) |
---|
45 | ; |
---|
46 | |
---|
47 | for ( i=0; i<rtems_smp_get_number_of_processors() -1; i++ ) { |
---|
48 | ch = '1' + i; |
---|
49 | |
---|
50 | status = rtems_task_create( |
---|
51 | rtems_build_name( 'T', 'A', ch, ' ' ), |
---|
52 | 1, |
---|
53 | RTEMS_MINIMUM_STACK_SIZE, |
---|
54 | RTEMS_DEFAULT_MODES, |
---|
55 | RTEMS_DEFAULT_ATTRIBUTES, |
---|
56 | &id |
---|
57 | ); |
---|
58 | directive_failed( status, "task create" ); |
---|
59 | |
---|
60 | cpu_num = bsp_smp_processor_id(); |
---|
61 | locked_printf(" CPU %d start task TA%c\n", cpu_num, ch); |
---|
62 | |
---|
63 | status = rtems_task_start( id, Test_task, i+1 ); |
---|
64 | directive_failed( status, "task start" ); |
---|
65 | } |
---|
66 | |
---|
67 | locked_printf(" kill 10 clock ticks\n" ); |
---|
68 | while ( rtems_clock_get_ticks_since_boot() < 10 ) |
---|
69 | ; |
---|
70 | |
---|
71 | rtems_cpu_usage_report(); |
---|
72 | |
---|
73 | locked_printf( "*** END OF TEST SMP09 ***" ); |
---|
74 | rtems_test_exit(0); |
---|
75 | } |
---|
76 | |
---|
77 | /* configuration information */ |
---|
78 | |
---|
79 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
80 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
81 | |
---|
82 | #define CONFIGURE_SMP_APPLICATION |
---|
83 | #define CONFIGURE_SMP_MAXIMUM_PROCESSORS 4 |
---|
84 | |
---|
85 | #define CONFIGURE_MAXIMUM_TASKS \ |
---|
86 | (1 + CONFIGURE_SMP_MAXIMUM_PROCESSORS) |
---|
87 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
88 | |
---|
89 | #define CONFIGURE_INIT |
---|
90 | |
---|
91 | #include <rtems/confdefs.h> |
---|
92 | /* end of file */ |
---|