From 39e51758c86754cef5ba4521c0c36578521f73d0 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Jun 2013 14:00:38 +0200 Subject: smp: Add and use _CPU_SMP_Get_current_processor() Add and use _SMP_Get_current_processor() and rtems_smp_get_current_processor(). Delete bsp_smp_interrupt_cpu(). Change type of current processor index from int to uint32_t to match _SMP_Processor_count type. --- testsuites/smptests/smp01/init.c | 10 ++++++---- testsuites/smptests/smp01/tasks.c | 8 +++++--- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'testsuites/smptests/smp01') diff --git a/testsuites/smptests/smp01/init.c b/testsuites/smptests/smp01/init.c index b47f1b4f50..3e12726efc 100644 --- a/testsuites/smptests/smp01/init.c +++ b/testsuites/smptests/smp01/init.c @@ -14,6 +14,8 @@ #define CONFIGURE_INIT #include "system.h" +#include + void Loop() { volatile int i; @@ -24,14 +26,14 @@ rtems_task Init( rtems_task_argument argument ) { - int i; + uint32_t i; char ch; - int cpu_self; + uint32_t cpu_self; rtems_id id; rtems_status_code status; bool allDone; - cpu_self = bsp_smp_processor_id(); + cpu_self = rtems_smp_get_current_processor(); /* XXX - Delay a bit to allow debug messages from * startup to print. This may need to go away when @@ -63,7 +65,7 @@ rtems_task Init( ); directive_failed( status, "task create" ); - locked_printf(" CPU %d start task TA%c\n", cpu_self, ch); + locked_printf(" CPU %" PRIu32 " start task TA%c\n", cpu_self, ch); status = rtems_task_start( id, Test_task, i+1 ); directive_failed( status, "task start" ); diff --git a/testsuites/smptests/smp01/tasks.c b/testsuites/smptests/smp01/tasks.c index 1b3b5fb5ef..4eb81f1c98 100644 --- a/testsuites/smptests/smp01/tasks.c +++ b/testsuites/smptests/smp01/tasks.c @@ -13,11 +13,13 @@ #include "system.h" +#include + rtems_task Test_task( rtems_task_argument task_index ) { - int cpu_num; + uint32_t cpu_num; char name[5]; char *p; @@ -26,11 +28,11 @@ rtems_task Test_task( rtems_test_assert( p != NULL ); /* Get the CPU Number */ - cpu_num = bsp_smp_processor_id(); + cpu_num = rtems_smp_get_current_processor(); /* Print that the task is up and running. */ Loop(); - locked_printf(" CPU %d running Task %s\n", cpu_num, name); + locked_printf(" CPU %" PRIu32 " running Task %s\n", cpu_num, name); /* Set the flag that the task is up and running */ TaskRan[cpu_num] = true; -- cgit v1.2.3