<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2010-08-23)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>sh</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2010-08-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR 1673/cpukit
* score/src/chainappendempty.c, score/src/chaingetempty.c,
score/src/chainprependempty.c: New files.
* score/Makefile.am: Reflect changes above.
* score/include/rtems/score/chain.h: Declare
_Chain_Append_with_empty_check(), _Chain_Prepend_with_empty_check(),
and _Chain_Get_with_empty_check().
* score/inline/rtems/score/chain.inl: Define
_Chain_Append_with_empty_check_unprotected(),
_Chain_Prepend_with_empty_check_unprotected(), and
_Chain_Get_with_empty_check_unprotected().
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2578&r2=text&tr2=1.2579&diff_format=h">M</a></td><td width='1%'>1.2579</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/Makefile.am.diff?r1=text&tr1=1.87&r2=text&tr2=1.88&diff_format=h">M</a></td><td width='1%'>1.88</td><td width='100%'>cpukit/score/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/include/rtems/score/chain.h.diff?r1=text&tr1=1.24&r2=text&tr2=1.25&diff_format=h">M</a></td><td width='1%'>1.25</td><td width='100%'>cpukit/score/include/rtems/score/chain.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/inline/rtems/score/chain.inl.diff?r1=text&tr1=1.21&r2=text&tr2=1.22&diff_format=h">M</a></td><td width='1%'>1.22</td><td width='100%'>cpukit/score/inline/rtems/score/chain.inl</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/chainappendempty.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/src/chainappendempty.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/chaingetempty.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/src/chaingetempty.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/chainprependempty.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">cpukit/score/src/chainprependempty.c</font></td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2578 rtems/cpukit/ChangeLog:1.2579
--- rtems/cpukit/ChangeLog:1.2578 Mon Aug 23 02:59:38 2010
+++ rtems/cpukit/ChangeLog Mon Aug 23 11:10:53 2010
</font><font color='#997700'>@@ -1,5 +1,19 @@
</font> 2010-08-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
<font color='#000088'>+ PR 1673/cpukit
+ * score/src/chainappendempty.c, score/src/chaingetempty.c,
+ score/src/chainprependempty.c: New files.
+ * score/Makefile.am: Reflect changes above.
+ * score/include/rtems/score/chain.h: Declare
+ _Chain_Append_with_empty_check(), _Chain_Prepend_with_empty_check(),
+ and _Chain_Get_with_empty_check().
+ * score/inline/rtems/score/chain.inl: Define
+ _Chain_Append_with_empty_check_unprotected(),
+ _Chain_Prepend_with_empty_check_unprotected(), and
+ _Chain_Get_with_empty_check_unprotected().
+
+2010-08-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
</font> PR 1671/cpukit
* libcsupport/include/rtems/gxx_wrappers.h: New file.
* libcsupport/Makefile.am, libcsupport/preinstall.am: Reflect change
<font color='#006600'>diff -u rtems/cpukit/score/Makefile.am:1.87 rtems/cpukit/score/Makefile.am:1.88
--- rtems/cpukit/score/Makefile.am:1.87 Thu Jul 29 12:52:09 2010
+++ rtems/cpukit/score/Makefile.am Mon Aug 23 11:10:53 2010
</font><font color='#997700'>@@ -200,6 +200,7 @@
</font> ## STD_C_FILES
libscore_a_SOURCES += src/apiext.c src/chain.c src/chainappend.c \
src/chainextract.c src/chainget.c src/chaininsert.c \
<font color='#000088'>+ src/chainappendempty.c src/chainprependempty.c src/chaingetempty.c \
</font> src/interr.c src/isr.c src/wkspace.c
EXTRA_DIST = src/Unlimited.txt
<font color='#006600'>diff -u rtems/cpukit/score/include/rtems/score/chain.h:1.24 rtems/cpukit/score/include/rtems/score/chain.h:1.25
--- rtems/cpukit/score/include/rtems/score/chain.h:1.24 Mon Nov 30 07:20:29 2009
+++ rtems/cpukit/score/include/rtems/score/chain.h Mon Aug 23 11:10:53 2010
</font><font color='#997700'>@@ -1,11 +1,14 @@
</font> /**
<font color='#880000'>- * @file rtems/score/chain.h
</font><font color='#000088'>+ * @file
</font> *
<font color='#880000'>- * This include file contains all the constants and structures associated
- * with the Doubly-Linked Chain Handler.
</font><font color='#000088'>+ * @ingroup ScoreChain
+ *
+ * @brief Chain Handler API.
</font> */
/*
<font color='#000088'>+ * Copyright (c) 2010 embedded brains GmbH.
+ *
</font> * COPYRIGHT (c) 1989-2006.
* On-Line Applications Research Corporation (OAR).
*
<font color='#997700'>@@ -22,6 +25,8 @@
</font> /**
* @defgroup ScoreChain Chain Handler
*
<font color='#000088'>+ * @ingroup Score
+ *
</font> * The Chain Handler is used to manage sets of entities. This handler
* provides two data structures. The Chain Node data structure is included
* as the first part of every data structure that will be placed on
<font color='#997700'>@@ -185,6 +190,66 @@
</font> Chain_Node *the_node
);
<font color='#000088'>+/**
+ * @brief Append a node and check if the chain was empty before.
+ *
+ * This routine appends the_node onto the end of the_chain.
+ *
+ * @param[in] the_chain is the chain to be operated upon.
+ * @param[in] the_node is the node to be appended.
+ *
+ * @note It disables interrupts to ensure the atomicity of the append
+ * operation.
+ *
+ * @retval true The chain was empty before.
+ * @retval false The chain contained at least one node before.
+ */
+bool _Chain_Append_with_empty_check(
+ Chain_Control *the_chain,
+ Chain_Node *the_node
+);
+
+/**
+ * @brief Prepend a node and check if the chain was empty before.
+ *
+ * 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 append
+ * operation.
+ *
+ * @retval true The chain was empty before.
+ * @retval false The chain contained at least one node before.
+ */
+bool _Chain_Prepend_with_empty_check(
+ Chain_Control *the_chain,
+ Chain_Node *the_node
+);
+
+/**
+ * @brief Get the first node and check if the chain is empty afterwards.
+ *
+ * This function removes the first node from the_chain and returns
+ * a pointer to that node in @a the_node. If the_chain is empty, then NULL is
+ * returned.
+ *
+ * @param[in] the_chain is the chain to attempt to get the first node from.
+ * @param[out] the_node is the first node on the chain or NULL if the chain is
+ * empty.
+ *
+ * @note It disables interrupts to ensure the atomicity of the append
+ * operation.
+ *
+ * @retval true The chain is empty now.
+ * @retval false The chain contains at least one node now.
+ */
+bool _Chain_Get_with_empty_check(
+ Chain_Control *the_chain,
+ Chain_Node **the_node
+);
+
</font> #ifndef __RTEMS_APPLICATION__
#include <rtems/score/chain.inl>
#endif
<font color='#006600'>diff -u rtems/cpukit/score/inline/rtems/score/chain.inl:1.21 rtems/cpukit/score/inline/rtems/score/chain.inl:1.22
--- rtems/cpukit/score/inline/rtems/score/chain.inl:1.21 Thu Oct 8 02:07:36 2009
+++ rtems/cpukit/score/inline/rtems/score/chain.inl Mon Aug 23 11:10:53 2010
</font><font color='#997700'>@@ -1,15 +1,14 @@
</font> /**
<font color='#880000'>- * @file rtems/score/chain.inl
</font><font color='#000088'>+ * @file
</font> *
<font color='#880000'>- * This include file contains the bodies of the routines which are
- * associated with doubly linked chains and inlined.
</font><font color='#000088'>+ * @ingroup ScoreChain
</font> *
<font color='#880000'>- * @note The routines in this file are ordered from simple
- * to complex. No other Chain Handler routine is referenced
- * unless it has already been defined.
</font><font color='#000088'>+ * @brief Chain Handler API.
</font> */
/*
<font color='#000088'>+ * Copyright (c) 2010 embedded brains GmbH.
+ *
</font> * COPYRIGHT (c) 1989-2006.
* On-Line Applications Research Corporation (OAR).
*
<font color='#997700'>@@ -481,6 +480,99 @@
</font> _Chain_Insert(_Chain_Head(the_chain), the_node);
}
<font color='#000088'>+/**
+ * @brief Append a node and check if the chain was empty before (unprotected).
+ *
+ * This routine appends the_node onto the end of the_chain.
+ *
+ * @param[in] the_chain is the chain to be operated upon.
+ * @param[in] the_node is the node to be appended.
+ *
+ * @note It does NOT disable interrupts to ensure the atomicity of the
+ * append operation.
+ *
+ * @retval true The chain was empty before.
+ * @retval false The chain contained at least one node before.
+ */
+RTEMS_INLINE_ROUTINE bool _Chain_Append_with_empty_check_unprotected(
+ Chain_Control *the_chain,
+ Chain_Node *the_node
+)
+{
+ bool was_empty = _Chain_Is_empty( the_chain );
+
+ _Chain_Append_unprotected( the_chain, the_node );
+
+ return was_empty;
+}
+
+/**
+ * @brief Prepend a node and check if the chain was empty before (unprotected).
+ *
+ * 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 does NOT disable interrupts to ensure the atomicity of the
+ * prepend operation.
+ *
+ * @retval true The chain was empty before.
+ * @retval false The chain contained at least one node before.
+ */
+RTEMS_INLINE_ROUTINE bool _Chain_Prepend_with_empty_check_unprotected(
+ Chain_Control *the_chain,
+ Chain_Node *the_node
+)
+{
+ bool was_empty = _Chain_Is_empty( the_chain );
+
+ _Chain_Prepend_unprotected( the_chain, the_node );
+
+ return was_empty;
+}
+
+/**
+ * @brief Get the first node and check if the chain is empty afterwards
+ * (unprotected).
+ *
+ * This function removes the first node from the_chain and returns
+ * a pointer to that node in @a the_node. If the_chain is empty, then NULL is
+ * returned.
+ *
+ * @param[in] the_chain is the chain to attempt to get the first node from.
+ * @param[out] the_node is the first node on the chain or NULL if the chain is
+ * empty.
+ *
+ * @note It does NOT disable interrupts to ensure the atomicity of the
+ * get operation.
+ *
+ * @retval true The chain is empty now.
+ * @retval false The chain contains at least one node now.
+ */
+RTEMS_INLINE_ROUTINE bool _Chain_Get_with_empty_check_unprotected(
+ Chain_Control *the_chain,
+ Chain_Node **the_node
+)
+{
+ bool is_empty_now = true;
+ Chain_Node *first = the_chain->first;
+
+ if ( first != _Chain_Tail( the_chain ) ) {
+ Chain_Node *new_first = first->next;
+
+ the_chain->first = new_first;
+ new_first->previous = _Chain_Head( the_chain );
+
+ *the_node = first;
+
+ is_empty_now = new_first == _Chain_Tail( the_chain );
+ } else
+ *the_node = NULL;
+
+ return is_empty_now;
+}
+
</font> /**@}*/
#endif
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/src/chainappendempty.c:1.1
--- /dev/null Mon Aug 23 12:10:15 2010
+++ rtems/cpukit/score/src/chainappendempty.c Mon Aug 23 11:10:53 2010
</font><font color='#997700'>@@ -0,0 +1,44 @@
</font><font color='#000088'>+/**
+ * @file
+ *
+ * @ingroup ScoreChain
+ *
+ * @brief _Chain_Append_with_empty_check() implementation.
+ */
+
+/*
+ * Copyright (c) 2010 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/chain.h>
+#include <rtems/score/isr.h>
+
+bool _Chain_Append_with_empty_check(
+ Chain_Control *chain,
+ Chain_Node *node
+)
+{
+ ISR_Level level;
+ bool was_empty;
+
+ _ISR_Disable( level );
+ was_empty = _Chain_Append_with_empty_check_unprotected( chain, node );
+ _ISR_Enable( level );
+
+ return was_empty;
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/src/chaingetempty.c:1.1
--- /dev/null Mon Aug 23 12:10:15 2010
+++ rtems/cpukit/score/src/chaingetempty.c Mon Aug 23 11:10:53 2010
</font><font color='#997700'>@@ -0,0 +1,44 @@
</font><font color='#000088'>+/**
+ * @file
+ *
+ * @ingroup ScoreChain
+ *
+ * @brief _Chain_Get_with_empty_check() implementation.
+ */
+
+/*
+ * Copyright (c) 2010 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/chain.h>
+#include <rtems/score/isr.h>
+
+bool _Chain_Get_with_empty_check(
+ Chain_Control *chain,
+ Chain_Node **node
+)
+{
+ ISR_Level level;
+ bool is_empty_now;
+
+ _ISR_Disable( level );
+ is_empty_now = _Chain_Get_with_empty_check_unprotected( chain, node );
+ _ISR_Enable( level );
+
+ return is_empty_now;
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/score/src/chainprependempty.c:1.1
--- /dev/null Mon Aug 23 12:10:15 2010
+++ rtems/cpukit/score/src/chainprependempty.c Mon Aug 23 11:10:53 2010
</font><font color='#997700'>@@ -0,0 +1,44 @@
</font><font color='#000088'>+/**
+ * @file
+ *
+ * @ingroup ScoreChain
+ *
+ * @brief _Chain_Prepend_with_empty_check() implementation.
+ */
+
+/*
+ * Copyright (c) 2010 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/chain.h>
+#include <rtems/score/isr.h>
+
+bool _Chain_Prepend_with_empty_check(
+ Chain_Control *chain,
+ Chain_Node *node
+)
+{
+ ISR_Level level;
+ bool was_empty;
+
+ _ISR_Disable( level );
+ was_empty = _Chain_Prepend_with_empty_check_unprotected( chain, node );
+ _ISR_Enable( level );
+
+ return was_empty;
+}
</font></pre>
<p> </p>
<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>