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 | #include <tmacros.h> |
---|
13 | #include "test_support.h" |
---|
14 | |
---|
15 | rtems_task Test_task( |
---|
16 | rtems_task_argument argument |
---|
17 | ) |
---|
18 | { |
---|
19 | locked_printf( "Shut down from CPU %d\n", bsp_smp_processor_id() ); |
---|
20 | locked_printf( "*** END OF TEST SMP05 ***\n" ); |
---|
21 | rtems_test_exit(0); |
---|
22 | } |
---|
23 | |
---|
24 | rtems_task Init( |
---|
25 | rtems_task_argument argument |
---|
26 | ) |
---|
27 | { |
---|
28 | int i; |
---|
29 | char ch; |
---|
30 | int cpu_num; |
---|
31 | rtems_id id; |
---|
32 | rtems_status_code status; |
---|
33 | |
---|
34 | locked_print_initialize(); |
---|
35 | locked_printf( "\n\n*** TEST SMP05 ***\n" ); |
---|
36 | |
---|
37 | for ( i=0; i<rtems_smp_get_number_of_processors() ; i++ ) { |
---|
38 | ch = '1' + i; |
---|
39 | |
---|
40 | status = rtems_task_create( |
---|
41 | rtems_build_name( 'T', 'A', ch, ' ' ), |
---|
42 | 1, |
---|
43 | RTEMS_MINIMUM_STACK_SIZE, |
---|
44 | RTEMS_DEFAULT_MODES, |
---|
45 | RTEMS_DEFAULT_ATTRIBUTES, |
---|
46 | &id |
---|
47 | ); |
---|
48 | directive_failed( status, "task create" ); |
---|
49 | |
---|
50 | cpu_num = bsp_smp_processor_id(); |
---|
51 | locked_printf(" CPU %d start task TA%c\n", cpu_num, ch); |
---|
52 | |
---|
53 | status = rtems_task_start( id, Test_task, i+1 ); |
---|
54 | directive_failed( status, "task start" ); |
---|
55 | } |
---|
56 | |
---|
57 | while (1) |
---|
58 | ; |
---|
59 | } |
---|
60 | |
---|
61 | /* configuration information */ |
---|
62 | |
---|
63 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
64 | #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER |
---|
65 | |
---|
66 | #define CONFIGURE_SMP_APPLICATION |
---|
67 | #define CONFIGURE_SMP_MAXIMUM_PROCESSORS 2 |
---|
68 | |
---|
69 | #define CONFIGURE_MAXIMUM_TASKS \ |
---|
70 | (1 + CONFIGURE_SMP_MAXIMUM_PROCESSORS) |
---|
71 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
72 | |
---|
73 | #define CONFIGURE_INIT |
---|
74 | |
---|
75 | #include <rtems/confdefs.h> |
---|
76 | /* end of file */ |
---|