summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-07-27 11:08:54 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-07-28 19:07:37 +0200
commit4adaed7328e39eac4fe1879cba61919e74965cc8 (patch)
tree6289a5896a12a38381921063622daaa1196d40de /cpukit/score/src
parentlibcsupport: Consistent rtems_putc() output (diff)
downloadrtems-4adaed7328e39eac4fe1879cba61919e74965cc8.tar.bz2
score: Remove processor event broadcast/receive
Remove _CPU_SMP_Processor_event_broadcast() and _CPU_SMP_Processor_event_receive(). These functions are hard to use since they are subject to the lost wake up problem.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/percpu.c20
-rw-r--r--cpukit/score/src/percpustatewait.c14
-rw-r--r--cpukit/score/src/smpmulticastaction.c4
3 files changed, 17 insertions, 21 deletions
diff --git a/cpukit/score/src/percpu.c b/cpukit/score/src/percpu.c
index e254f306eb..7fbc1c8637 100644
--- a/cpukit/score/src/percpu.c
+++ b/cpukit/score/src/percpu.c
@@ -55,7 +55,9 @@ static void _Per_CPU_State_busy_wait(
Per_CPU_State new_state
)
{
- Per_CPU_State state = cpu->state;
+ Per_CPU_State state;
+
+ state = _Per_CPU_Get_state( cpu );
switch ( new_state ) {
case PER_CPU_STATE_REQUEST_START_MULTITASKING:
@@ -64,8 +66,7 @@ static void _Per_CPU_State_busy_wait(
&& state != PER_CPU_STATE_SHUTDOWN
) {
_Per_CPU_Perform_jobs( cpu );
- _CPU_SMP_Processor_event_receive();
- state = cpu->state;
+ state = _Per_CPU_Get_state( cpu );
}
break;
case PER_CPU_STATE_UP:
@@ -74,8 +75,7 @@ static void _Per_CPU_State_busy_wait(
&& state != PER_CPU_STATE_SHUTDOWN
) {
_Per_CPU_Perform_jobs( cpu );
- _CPU_SMP_Processor_event_receive();
- state = cpu->state;
+ state = _Per_CPU_Get_state( cpu );
}
break;
default:
@@ -143,8 +143,8 @@ void _Per_CPU_State_change(
_Per_CPU_State_acquire( &lock_context );
- next_state = _Per_CPU_State_get_next( cpu->state, new_state );
- cpu->state = next_state;
+ next_state = _Per_CPU_State_get_next( _Per_CPU_Get_state( cpu ), new_state );
+ _Per_CPU_Set_state( cpu, next_state );
if ( next_state == PER_CPU_STATE_SHUTDOWN ) {
uint32_t cpu_max = rtems_configuration_get_maximum_processors();
@@ -154,7 +154,7 @@ void _Per_CPU_State_change(
Per_CPU_Control *cpu_other = _Per_CPU_Get_by_index( cpu_index );
if ( cpu_other != cpu ) {
- switch ( cpu_other->state ) {
+ switch ( _Per_CPU_Get_state( cpu_other ) ) {
case PER_CPU_STATE_UP:
_SMP_Send_message( cpu_index, SMP_MESSAGE_SHUTDOWN );
break;
@@ -163,13 +163,11 @@ void _Per_CPU_State_change(
break;
}
- cpu_other->state = PER_CPU_STATE_SHUTDOWN;
+ _Per_CPU_Set_state( cpu_other, PER_CPU_STATE_SHUTDOWN );
}
}
}
- _CPU_SMP_Processor_event_broadcast();
-
_Per_CPU_State_release( &lock_context );
if (
diff --git a/cpukit/score/src/percpustatewait.c b/cpukit/score/src/percpustatewait.c
index 9d9f590df5..7186626897 100644
--- a/cpukit/score/src/percpustatewait.c
+++ b/cpukit/score/src/percpustatewait.c
@@ -33,8 +33,11 @@ bool _Per_CPU_State_wait_for_non_initial_state(
uint32_t timeout_in_ns
)
{
- const Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index );
- Per_CPU_State state = cpu->state;
+ const Per_CPU_Control *cpu;
+ Per_CPU_State state;
+
+ cpu = _Per_CPU_Get_by_index( cpu_index );
+ state = _Per_CPU_Get_state( cpu );
if ( timeout_in_ns > 0 ) {
rtems_counter_ticks ticks =
@@ -45,19 +48,16 @@ bool _Per_CPU_State_wait_for_non_initial_state(
while ( ticks > delta && state == PER_CPU_STATE_INITIAL ) {
rtems_counter_ticks b;
- _CPU_SMP_Processor_event_receive();
- state = cpu->state;
+ state = _Per_CPU_Get_state( cpu );
ticks -= delta;
-
b = rtems_counter_read();
delta = rtems_counter_difference( b, a );
a = b;
}
} else {
while ( state == PER_CPU_STATE_INITIAL ) {
- _CPU_SMP_Processor_event_receive();
- state = cpu->state;
+ state = _Per_CPU_Get_state( cpu );
}
}
diff --git a/cpukit/score/src/smpmulticastaction.c b/cpukit/score/src/smpmulticastaction.c
index 55c495a2cf..5d65ef14ca 100644
--- a/cpukit/score/src/smpmulticastaction.c
+++ b/cpukit/score/src/smpmulticastaction.c
@@ -122,12 +122,10 @@ void _Per_CPU_Wait_for_job(
_Atomic_Load_ulong( &job->done, ATOMIC_ORDER_ACQUIRE )
!= PER_CPU_JOB_DONE
) {
- switch ( cpu->state ) {
+ switch ( _Per_CPU_Get_state( cpu ) ) {
case PER_CPU_STATE_INITIAL:
case PER_CPU_STATE_READY_TO_START_MULTITASKING:
case PER_CPU_STATE_REQUEST_START_MULTITASKING:
- _CPU_SMP_Processor_event_broadcast();
- /* Fall through */
case PER_CPU_STATE_UP:
/*
* Calling this function with the current processor is intentional.