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