score: _Thread_Dispatch_increment_disable_level()

Avoid _Thread_Dispatch_increment_disable_level() and
_Thread_Dispatch_decrement_disable_level() and thus the Giant
lock.

This is a preparation to remove the Giant lock.

Update #2555.
This commit is contained in:
Sebastian Huber
2016-05-17 15:57:48 +02:00
parent dab902d5b2
commit d2bacb6c38
7 changed files with 24 additions and 12 deletions

View File

@@ -133,7 +133,7 @@ void __ISR_Handler( uint32_t vector)
_ISR_Disable( level );
_Thread_Dispatch_increment_disable_level();
_Thread_Dispatch_disable();
#if (CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
if ( _ISR_Nest_level == 0 )
@@ -155,7 +155,7 @@ void __ISR_Handler( uint32_t vector)
_ISR_Disable( level );
_Thread_Dispatch_decrement_disable_level();
_Thread_Dispatch_unnest( _Per_CPU_Get() );
_ISR_Nest_level--;

View File

@@ -134,7 +134,7 @@ void __ISR_Handler( uint32_t vector)
_ISR_Disable( level );
_Thread_Dispatch_increment_disable_level();
_Thread_Dispatch_disable();
#if (CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
if ( _ISR_Nest_level == 0 )
@@ -156,7 +156,7 @@ void __ISR_Handler( uint32_t vector)
_ISR_Disable( level );
_Thread_Dispatch_decrement_disable_level();
_Thread_Dispatch_unnest( _Per_CPU_Get() );
_ISR_Nest_level--;

View File

@@ -58,7 +58,7 @@ void __ISR_Handler( uint32_t vector)
_ISR_Disable( level );
_Thread_Dispatch_increment_disable_level();
_Thread_Dispatch_disable();
#if (CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
if ( _ISR_Nest_level == 0 )
@@ -80,7 +80,7 @@ void __ISR_Handler( uint32_t vector)
_ISR_Disable( level );
_Thread_Dispatch_decrement_disable_level();
_Thread_Dispatch_enable( _Per_CPU_Get() );
_ISR_Nest_level--;

View File

@@ -35,7 +35,7 @@ void __ISR_Handler( uint32_t vector)
_ISR_Disable( level );
_Thread_Dispatch_increment_disable_level();
_Thread_Dispatch_disable();
#if (CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
if ( _ISR_Nest_level == 0 )
@@ -57,7 +57,7 @@ void __ISR_Handler( uint32_t vector)
_ISR_Disable( level );
_Thread_Dispatch_decrement_disable_level();
_Thread_Dispatch_unnest( _Per_CPU_Get() );
_ISR_Nest_level--;

View File

@@ -42,7 +42,7 @@ void __ISR_Handler(uint32_t vector, CPU_Interrupt_frame *ifr)
/* Interrupts are disabled upon entry to this Handler */
_Thread_Dispatch_increment_disable_level();
_Thread_Dispatch_disable();
#if( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE)
if ( _ISR_Nest_level == 0 ) {
@@ -69,7 +69,7 @@ void __ISR_Handler(uint32_t vector, CPU_Interrupt_frame *ifr)
stack_ptr = _old_stack_ptr;
#endif
_Thread_Dispatch_decrement_disable_level();
_Thread_Dispatch_unnest( _Per_CPU_Get() );
_CPU_ISR_Enable( level );

View File

@@ -108,14 +108,14 @@ void __ISR_Handler(void)
_ISR_Nest_level++;
_Thread_Dispatch_increment_disable_level();
_Thread_Dispatch_disable();
__IIC_Handler();
/* Make sure that interrupts are disabled again */
_CPU_ISR_Disable( level );
_Thread_Dispatch_decrement_disable_level();
_Thread_Dispatch_unnest( _Per_CPU_Get() );
_ISR_Nest_level--;

View File

@@ -340,6 +340,18 @@ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_enable( Per_CPU_Control *cpu_self )
}
}
/**
* @brief Unnests thread dispatching.
*
* This function does not release the Giant lock.
*
* @param[in] cpu_self The current processor.
*/
RTEMS_INLINE_ROUTINE void _Thread_Dispatch_unnest( Per_CPU_Control *cpu_self )
{
--cpu_self->thread_dispatch_disable_level;
}
/**
* @brief Disables thread dispatching and acquires the Giant lock.
*/