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