From 4adaed7328e39eac4fe1879cba61919e74965cc8 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 27 Jul 2021 11:08:54 +0200 Subject: 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. --- cpukit/include/rtems/score/percpu.h | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'cpukit/include/rtems/score/percpu.h') diff --git a/cpukit/include/rtems/score/percpu.h b/cpukit/include/rtems/score/percpu.h index 3242383b9d..e79596c244 100644 --- a/cpukit/include/rtems/score/percpu.h +++ b/cpukit/include/rtems/score/percpu.h @@ -553,7 +553,7 @@ typedef struct Per_CPU_Control { * * @see _Per_CPU_State_change(). */ - Per_CPU_State state; + Atomic_Uint state; /** * @brief FIFO list of jobs to be performed by this processor. @@ -775,6 +775,39 @@ RTEMS_INLINE_ROUTINE void _Per_CPU_Release_all( #if defined( RTEMS_SMP ) +/** + * @brief Gets the current processor state. + * + * @param cpu is the processor control. + * + * @return Returns the current state of the processor. + */ +static inline Per_CPU_State _Per_CPU_Get_state( const Per_CPU_Control *cpu ) +{ + return (Per_CPU_State) + _Atomic_Load_uint( &cpu->state, ATOMIC_ORDER_ACQUIRE ); +} + +/** + * @brief Sets the processor state of the current processor. + * + * @param cpu_self is the processor control of the processor executing this + * function. + * + * @param state is the new processor state. + */ +static inline void _Per_CPU_Set_state( + Per_CPU_Control *cpu_self, + Per_CPU_State state +) +{ + _Atomic_Store_uint( + &cpu_self->state, + (unsigned int) state, + ATOMIC_ORDER_RELEASE + ); +} + void _Per_CPU_State_change( Per_CPU_Control *cpu, Per_CPU_State new_state -- cgit v1.2.3