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