score: Delete _Chain_Prepend()

This function is not used in the score.

Update #2555.
This commit is contained in:
Sebastian Huber
2016-04-06 09:08:22 +02:00
parent 3570ec684f
commit 6406b693b6
4 changed files with 27 additions and 53 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ libsapi_a_SOURCES = src/extension.c src/extensioncreate.c \
src/chainappendnotify.c src/chaingetnotify.c src/chaingetwait.c \
src/chainprependnotify.c src/rbheap.c src/interrtext.c \
src/fatal2.c src/fatalsrctext.c
libsapi_a_SOURCES += src/chainsmp.c
libsapi_a_SOURCES += src/chainprotected.c
libsapi_a_SOURCES += src/cpucounterconverter.c
libsapi_a_SOURCES += src/delayticks.c
libsapi_a_SOURCES += src/delaynano.c
-10
View File
@@ -718,20 +718,10 @@ RTEMS_INLINE_ROUTINE void rtems_chain_append_unprotected(
* NOTE: It disables interrupts to ensure the atomicity of the
* prepend operation.
*/
#if defined( RTEMS_SMP )
void rtems_chain_prepend(
rtems_chain_control *the_chain,
rtems_chain_node *the_node
);
#else
RTEMS_INLINE_ROUTINE void rtems_chain_prepend(
rtems_chain_control *the_chain,
rtems_chain_node *the_node
)
{
_Chain_Prepend( the_chain, the_node );
}
#endif
/**
* @brief Prepend a node (unprotected).
@@ -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>
RTEMS_INTERRUPT_LOCK_DEFINE( static, chain_lock, "Chains" )
static void chain_acquire( rtems_interrupt_lock_context *lock_context )
{
rtems_interrupt_lock_acquire( &chain_lock, lock_context );
}
static void chain_release( rtems_interrupt_lock_context *lock_context )
{
rtems_interrupt_lock_release( &chain_lock, lock_context );
}
#if defined( RTEMS_SMP )
#include <rtems/score/smplock.h>
static SMP_lock_Control chain_lock = SMP_LOCK_INITIALIZER("chains");
static void chain_acquire( SMP_lock_Context *lock_context )
{
_SMP_lock_ISR_disable_and_acquire( &chain_lock, lock_context );
}
static void chain_release( SMP_lock_Context *lock_context )
{
_SMP_lock_Release_and_ISR_enable( &chain_lock, lock_context );
}
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 );
@@ -792,25 +792,6 @@ RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected(
_Chain_Insert_unprotected(_Chain_Head(the_chain), the_node);
}
/**
* @brief Prepend a node (protected).
*
* This routine prepends the_node onto the front of the_chain.
*
* @param[in] the_chain is the chain to be operated upon.
* @param[in] the_node is the node to be prepended.
*
* @note It disables interrupts to ensure the atomicity of the
* prepend operation.
*/
RTEMS_INLINE_ROUTINE void _Chain_Prepend(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert(_Chain_Head(the_chain), the_node);
}
/**
* @brief Append a node and check if the chain was empty before (unprotected).
*