summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-06-14 14:00:38 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-17 13:09:49 +0200
commit39e51758c86754cef5ba4521c0c36578521f73d0 (patch)
treea87255c5c0592b876106da50b939dedd471b7d5a /cpukit/score/src
parentsmp: Delete RTEMS_BSP_SMP_CONTEXT_SWITCH_NECESSARY (diff)
downloadrtems-39e51758c86754cef5ba4521c0c36578521f73d0.tar.bz2
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.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/smp.c30
-rw-r--r--cpukit/score/src/threaddispatchdisablelevel.c6
2 files changed, 18 insertions, 18 deletions
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
index fce927541b..8e06d04068 100644
--- a/cpukit/score/src/smp.c
+++ b/cpukit/score/src/smp.c
@@ -30,7 +30,7 @@
void rtems_smp_secondary_cpu_initialize( void )
{
- int self = bsp_smp_processor_id();
+ uint32_t self = _SMP_Get_current_processor();
Per_CPU_Control *per_cpu = &_Per_CPU_Information[ self ];
Thread_Control *heir;
@@ -67,7 +67,7 @@ void rtems_smp_secondary_cpu_initialize( void )
void rtems_smp_process_interrupt( void )
{
- int self = bsp_smp_processor_id();
+ uint32_t self = _SMP_Get_current_processor();
Per_CPU_Control *per_cpu = &_Per_CPU_Information[ self ];
@@ -107,7 +107,7 @@ void rtems_smp_process_interrupt( void )
}
}
-void _SMP_Send_message( int cpu, uint32_t message )
+void _SMP_Send_message( uint32_t cpu, uint32_t message )
{
Per_CPU_Control *per_cpu = &_Per_CPU_Information[ cpu ];
ISR_Level level;
@@ -126,9 +126,9 @@ void _SMP_Send_message( int cpu, uint32_t message )
void _SMP_Broadcast_message( uint32_t message )
{
- int self = bsp_smp_processor_id();
- int ncpus = _SMP_Get_processor_count();
- int cpu;
+ uint32_t self = _SMP_Get_current_processor();
+ uint32_t ncpus = _SMP_Get_processor_count();
+ uint32_t cpu;
for ( cpu = 0 ; cpu < ncpus ; ++cpu ) {
if ( cpu != self ) {
@@ -146,9 +146,9 @@ void _SMP_Broadcast_message( uint32_t message )
void _SMP_Request_other_cores_to_perform_first_context_switch( void )
{
- int self = bsp_smp_processor_id();
- int ncpus = _SMP_Get_processor_count();
- int cpu;
+ uint32_t self = _SMP_Get_current_processor();
+ uint32_t ncpus = _SMP_Get_processor_count();
+ uint32_t cpu;
for ( cpu = 0 ; cpu < ncpus ; ++cpu ) {
Per_CPU_Control *per_cpu = &_Per_CPU_Information[ cpu ];
@@ -165,9 +165,9 @@ void _SMP_Request_other_cores_to_perform_first_context_switch( void )
void _SMP_Request_other_cores_to_dispatch( void )
{
if ( _System_state_Is_up( _System_state_Get() ) ) {
- int self = bsp_smp_processor_id();
- int ncpus = _SMP_Get_processor_count();
- int cpu;
+ uint32_t self = _SMP_Get_current_processor();
+ uint32_t ncpus = _SMP_Get_processor_count();
+ uint32_t cpu;
for ( cpu = 0 ; cpu < ncpus ; ++cpu ) {
const Per_CPU_Control *per_cpu = &_Per_CPU_Information[ cpu ];
@@ -185,9 +185,9 @@ void _SMP_Request_other_cores_to_dispatch( void )
void _SMP_Request_other_cores_to_shutdown( void )
{
- int self = bsp_smp_processor_id();
- int ncpus = _SMP_Get_processor_count();
- int cpu;
+ uint32_t self = _SMP_Get_current_processor();
+ uint32_t ncpus = _SMP_Get_processor_count();
+ uint32_t cpu;
_SMP_Broadcast_message( RTEMS_BSP_SMP_SHUTDOWN );
diff --git a/cpukit/score/src/threaddispatchdisablelevel.c b/cpukit/score/src/threaddispatchdisablelevel.c
index 1f84bfe65c..d5f3ff601b 100644
--- a/cpukit/score/src/threaddispatchdisablelevel.c
+++ b/cpukit/score/src/threaddispatchdisablelevel.c
@@ -26,7 +26,7 @@
#include <rtems/score/sysstate.h>
#include <rtems/score/threaddispatch.h>
-#define NO_OWNER_CPU (-1)
+#define NO_OWNER_CPU 0xffffffffU
void _Thread_Dispatch_initialization( void )
{
@@ -48,8 +48,8 @@ uint32_t _Thread_Dispatch_increment_disable_level( void )
{
Thread_Dispatch_disable_level_lock_control *level_lock =
&_Thread_Dispatch_disable_level_lock;
- int self_cpu;
ISR_Level isr_level;
+ uint32_t self_cpu;
uint32_t disable_level;
_ISR_Disable_on_this_core( isr_level );
@@ -58,7 +58,7 @@ uint32_t _Thread_Dispatch_increment_disable_level( void )
* We must obtain the processor ID after interrupts are disabled since a
* non-optimizing compiler may store the value on the stack and read it back.
*/
- self_cpu = bsp_smp_processor_id();
+ self_cpu = _SMP_Get_current_processor();
if ( level_lock->owner_cpu != self_cpu ) {
_SMP_lock_Acquire( &level_lock->lock );