From 0475cca9a015a7b43209270ca6e40aebf177639a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 13 May 2016 10:16:32 +0200 Subject: score: Add _Thread_Dispatch_disable_with_CPU() Update #2555. Update #2626. --- cpukit/score/include/rtems/score/threaddispatch.h | 28 +++++++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'cpukit/score/include/rtems/score/threaddispatch.h') diff --git a/cpukit/score/include/rtems/score/threaddispatch.h b/cpukit/score/include/rtems/score/threaddispatch.h index 4ef5538f7e..bf846e3497 100644 --- a/cpukit/score/include/rtems/score/threaddispatch.h +++ b/cpukit/score/include/rtems/score/threaddispatch.h @@ -238,23 +238,23 @@ void _Thread_Do_dispatch( Per_CPU_Control *cpu_self, ISR_Level level ); /** * @brief Disables thread dispatching inside a critical section (interrupts - * disabled). + * disabled) with the current processor. * * This function does not acquire the Giant lock. * + * @param[in] cpu_self The current processor. * @param[in] lock_context The lock context of the corresponding * _ISR_lock_ISR_disable() that started the critical section. * * @return The current processor. */ -RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Dispatch_disable_critical( +RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Dispatch_disable_with_CPU( + Per_CPU_Control *cpu_self, const ISR_lock_Context *lock_context ) { - Per_CPU_Control *cpu_self; - uint32_t disable_level; + uint32_t disable_level; - cpu_self = _Per_CPU_Get(); disable_level = cpu_self->thread_dispatch_disable_level; _Profiling_Thread_dispatch_disable_critical( cpu_self, @@ -266,6 +266,24 @@ RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Dispatch_disable_critical( return cpu_self; } +/** + * @brief Disables thread dispatching inside a critical section (interrupts + * disabled). + * + * This function does not acquire the Giant lock. + * + * @param[in] lock_context The lock context of the corresponding + * _ISR_lock_ISR_disable() that started the critical section. + * + * @return The current processor. + */ +RTEMS_INLINE_ROUTINE Per_CPU_Control *_Thread_Dispatch_disable_critical( + const ISR_lock_Context *lock_context +) +{ + return _Thread_Dispatch_disable_with_CPU( _Per_CPU_Get(), lock_context ); +} + /** * @brief Disables thread dispatching. * -- cgit v1.2.3