diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-04 06:52:55 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-06 09:08:22 +0200 |
commit | 6406b693b612bc6cbb7e3d55ae48ba7c55716659 (patch) | |
tree | 9a9e25722be46841040da7edbd5bce5446edff7c /cpukit/sapi/src/chainprotected.c | |
parent | rtems: Avoid Giant lock for partitions (diff) | |
download | rtems-6406b693b612bc6cbb7e3d55ae48ba7c55716659.tar.bz2 |
score: Delete _Chain_Prepend()
This function is not used in the score.
Update #2555.
Diffstat (limited to '')
-rw-r--r-- | cpukit/sapi/src/chainprotected.c (renamed from cpukit/sapi/src/chainsmp.c) | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/cpukit/sapi/src/chainsmp.c b/cpukit/sapi/src/chainprotected.c index a3da213d8e..ce8bc5eb39 100644 --- a/cpukit/sapi/src/chainsmp.c +++ b/cpukit/sapi/src/chainprotected.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014 embedded brains GmbH. All rights reserved. + * Copyright (c) 2013, 2016 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Dornierstr. 4 @@ -17,26 +17,25 @@ #endif #include <rtems/chain.h> +#include <rtems/rtems/intr.h> -#if defined( RTEMS_SMP ) - -#include <rtems/score/smplock.h> - -static SMP_lock_Control chain_lock = SMP_LOCK_INITIALIZER("chains"); +RTEMS_INTERRUPT_LOCK_DEFINE( static, chain_lock, "Chains" ) -static void chain_acquire( SMP_lock_Context *lock_context ) +static void chain_acquire( rtems_interrupt_lock_context *lock_context ) { - _SMP_lock_ISR_disable_and_acquire( &chain_lock, lock_context ); + rtems_interrupt_lock_acquire( &chain_lock, lock_context ); } -static void chain_release( SMP_lock_Context *lock_context ) +static void chain_release( rtems_interrupt_lock_context *lock_context ) { - _SMP_lock_Release_and_ISR_enable( &chain_lock, lock_context ); + rtems_interrupt_lock_release( &chain_lock, lock_context ); } +#if defined( RTEMS_SMP ) + void rtems_chain_extract( rtems_chain_node *node ) { - SMP_lock_Context lock_context; + rtems_interrupt_lock_context lock_context; chain_acquire( &lock_context ); _Chain_Extract_unprotected( node ); @@ -46,7 +45,7 @@ void rtems_chain_extract( rtems_chain_node *node ) rtems_chain_node *rtems_chain_get( rtems_chain_control *chain ) { rtems_chain_node *node; - SMP_lock_Context lock_context; + rtems_interrupt_lock_context lock_context; chain_acquire( &lock_context ); node = _Chain_Get_unprotected( chain ); @@ -57,7 +56,7 @@ rtems_chain_node *rtems_chain_get( rtems_chain_control *chain ) void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *node ) { - SMP_lock_Context lock_context; + rtems_interrupt_lock_context lock_context; chain_acquire( &lock_context ); _Chain_Insert_unprotected( after_node, node ); @@ -69,32 +68,36 @@ void rtems_chain_append( rtems_chain_node *node ) { - SMP_lock_Context lock_context; + rtems_interrupt_lock_context lock_context; chain_acquire( &lock_context ); _Chain_Append_unprotected( chain, node ); chain_release( &lock_context ); } +#endif /* defined( RTEMS_SMP ) */ + void rtems_chain_prepend( rtems_chain_control *chain, rtems_chain_node *node ) { - SMP_lock_Context lock_context; + rtems_interrupt_lock_context lock_context; chain_acquire( &lock_context ); _Chain_Prepend_unprotected( chain, node ); chain_release( &lock_context ); } +#if defined( RTEMS_SMP ) + bool rtems_chain_append_with_empty_check( rtems_chain_control *chain, rtems_chain_node *node ) { bool was_empty; - SMP_lock_Context lock_context; + rtems_interrupt_lock_context lock_context; chain_acquire( &lock_context ); was_empty = _Chain_Append_with_empty_check_unprotected( chain, node ); @@ -109,7 +112,7 @@ bool rtems_chain_prepend_with_empty_check( ) { bool was_empty; - SMP_lock_Context lock_context; + rtems_interrupt_lock_context lock_context; chain_acquire( &lock_context ); was_empty = _Chain_Prepend_with_empty_check_unprotected( chain, node ); @@ -124,7 +127,7 @@ bool rtems_chain_get_with_empty_check( ) { bool is_empty_now; - SMP_lock_Context lock_context; + rtems_interrupt_lock_context lock_context; chain_acquire( &lock_context ); is_empty_now = _Chain_Get_with_empty_check_unprotected( chain, node ); |