<!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-24)</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-24 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR 1673/cpukit
* sapi/src/chainappendnotify.c, sapi/src/chaingetnotify.c,
sapi/src/chaingetwait.c, sapi/src/chainprependnotify.c: New files.
* sapi/Makefile.am: Reflect changes above.
* sapi/include/rtems/chain.h: Declare
rtems_chain_append_with_notification(),
rtems_chain_prepend_with_notification(),
rtems_chain_get_with_notification(), and rtems_chain_get_with_wait().
* sapi/inline/rtems/chain.inl: Define
rtems_chain_append_with_empty_check(),
rtems_chain_prepend_with_empty_check(), and
rtems_chain_get_with_empty_check().
</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.2590&r2=text&tr2=1.2591&diff_format=h">M</a></td><td width='1%'>1.2591</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/sapi/Makefile.am.diff?r1=text&tr1=1.39&r2=text&tr2=1.40&diff_format=h">M</a></td><td width='1%'>1.40</td><td width='100%'>cpukit/sapi/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/sapi/include/rtems/chain.h.diff?r1=text&tr1=1.4&r2=text&tr2=1.5&diff_format=h">M</a></td><td width='1%'>1.5</td><td width='100%'>cpukit/sapi/include/rtems/chain.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/sapi/inline/rtems/chain.inl.diff?r1=text&tr1=1.9&r2=text&tr2=1.10&diff_format=h">M</a></td><td width='1%'>1.10</td><td width='100%'>cpukit/sapi/inline/rtems/chain.inl</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/sapi/src/chainappendnotify.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/sapi/src/chainappendnotify.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/sapi/src/chaingetnotify.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/sapi/src/chaingetnotify.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/sapi/src/chaingetwait.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/sapi/src/chaingetwait.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/sapi/src/chainprependnotify.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/sapi/src/chainprependnotify.c</font></td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2590 rtems/cpukit/ChangeLog:1.2591
--- rtems/cpukit/ChangeLog:1.2590 Tue Aug 24 08:06:23 2010
+++ rtems/cpukit/ChangeLog Tue Aug 24 09:29:54 2010
</font><font color='#997700'>@@ -1,3 +1,18 @@
</font><font color='#000088'>+2010-08-24 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ PR 1673/cpukit
+ * sapi/src/chainappendnotify.c, sapi/src/chaingetnotify.c,
+ sapi/src/chaingetwait.c, sapi/src/chainprependnotify.c: New files.
+ * sapi/Makefile.am: Reflect changes above.
+ * sapi/include/rtems/chain.h: Declare
+ rtems_chain_append_with_notification(),
+ rtems_chain_prepend_with_notification(),
+ rtems_chain_get_with_notification(), and rtems_chain_get_with_wait().
+ * sapi/inline/rtems/chain.inl: Define
+ rtems_chain_append_with_empty_check(),
+ rtems_chain_prepend_with_empty_check(), and
+ rtems_chain_get_with_empty_check().
+
</font> 2010-08-24 Ralf Corsépius <ralf.corsepius@rtems.org>
* libmisc/untar/untar.c: Return if open fails.
<font color='#006600'>diff -u rtems/cpukit/sapi/Makefile.am:1.39 rtems/cpukit/sapi/Makefile.am:1.40
--- rtems/cpukit/sapi/Makefile.am:1.39 Thu Jun 17 21:58:15 2010
+++ rtems/cpukit/sapi/Makefile.am Tue Aug 24 09:29:55 2010
</font><font color='#997700'>@@ -27,7 +27,9 @@
</font> src/exshutdown.c src/io.c src/ioclose.c src/iocontrol.c src/iodata.c \
src/ioinitialize.c src/ioopen.c src/ioread.c src/ioregisterdriver.c \
src/iounregisterdriver.c src/iowrite.c src/posixapi.c \
<font color='#880000'>- src/rtemsapi.c src/extensiondata.c src/getversionstring.c
</font><font color='#000088'>+ src/rtemsapi.c src/extensiondata.c src/getversionstring.c \
+ src/chainappendnotify.c src/chaingetnotify.c src/chaingetwait.c \
+ src/chainprependnotify.c
</font> libsapi_a_CPPFLAGS = $(AM_CPPFLAGS)
include $(srcdir)/preinstall.am
<font color='#006600'>diff -u rtems/cpukit/sapi/include/rtems/chain.h:1.4 rtems/cpukit/sapi/include/rtems/chain.h:1.5
--- rtems/cpukit/sapi/include/rtems/chain.h:1.4 Fri Aug 20 08:26:55 2010
+++ rtems/cpukit/sapi/include/rtems/chain.h Tue Aug 24 09:29:55 2010
</font><font color='#997700'>@@ -1,14 +1,14 @@
</font> /**
<font color='#880000'>- * @file rtems/chain.h
</font><font color='#000088'>+ * @file
</font> *
<font color='#880000'>- * This include file contains all the constants and structures associated
- * with the Chain API in RTEMS. The chain is a double linked list that
- * is part of the Super Core. This is the published interface to that
- * code.
</font><font color='#000088'>+ * @ingroup ClassicChains
</font> *
<font color='#000088'>+ * @brief Chain API.
</font> */
/*
<font color='#000088'>+ * Copyright (c) 2010 embedded brains GmbH.
+ *
</font> * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
<font color='#997700'>@@ -24,23 +24,24 @@
</font>
#include <rtems/system.h>
#include <rtems/score/chain.h>
<font color='#000088'>+#include <rtems/rtems/event.h>
</font>
#ifdef __cplusplus
extern "C" {
#endif
/**
<font color='#880000'>- * @typedef rtems_chain_node
</font><font color='#000088'>+ * @defgroup ClassicChains Chains
+ *
+ * @ingroup ClassicRTEMS
+ *
+ * @brief Chain API.
</font> *
<font color='#880000'>- * A node that can be manipulated in the chain.
</font><font color='#000088'>+ * @{
</font> */
<font color='#000088'>+
</font> typedef Chain_Node rtems_chain_node;
<font color='#880000'>-/**
- * @typedef rtems_chain_control
- *
- * The chain's control anchors the chain.
- */
</font> typedef Chain_Control rtems_chain_control;
/**
<font color='#997700'>@@ -55,8 +56,82 @@
</font> #define RTEMS_CHAIN_DEFINE_EMPTY(name) \
CHAIN_DEFINE_EMPTY(name)
<font color='#000088'>+/** @} */
+
</font> #include <rtems/chain.inl>
<font color='#000088'>+/**
+ * @addtogroup ClassicChains
+ *
+ * @{
+ */
+
+/**
+ * @brief Appends the @a node to the @a chain and sends the @a events to the
+ * @a task if the @a chain was empty before the append.
+ *
+ * @see rtems_chain_append_with_empty_check() and rtems_event_send().
+ *
+ * @retval RTEMS_SUCCESSFUL Successful operation.
+ * @retval RTEMS_INVALID_ID No such task.
+ */
+rtems_status_code rtems_chain_append_with_notification(
+ rtems_chain_control *chain,
+ rtems_chain_node *node,
+ rtems_id task,
+ rtems_event_set events
+);
+
+/**
+ * @brief Prepends the @a node to the @a chain and sends the @a events to the
+ * @a task if the @a chain was empty before the prepend.
+ *
+ * @see rtems_chain_prepend_with_empty_check() and rtems_event_send().
+ *
+ * @retval RTEMS_SUCCESSFUL Successful operation.
+ * @retval RTEMS_INVALID_ID No such task.
+ */
+rtems_status_code rtems_chain_prepend_with_notification(
+ rtems_chain_control *chain,
+ rtems_chain_node *node,
+ rtems_id task,
+ rtems_event_set events
+);
+
+/**
+ * @brief Gets the first @a node of the @a chain and sends the @a events to the
+ * @a task if the @a chain is empty after the get.
+ *
+ * @see rtems_chain_get_with_empty_check() and rtems_event_send().
+ *
+ * @retval RTEMS_SUCCESSFUL Successful operation.
+ * @retval RTEMS_INVALID_ID No such task.
+ */
+rtems_status_code rtems_chain_get_with_notification(
+ rtems_chain_control *chain,
+ rtems_id task,
+ rtems_event_set events,
+ rtems_chain_node **node
+);
+
+/**
+ * @brief Gets the first @a node of the @a chain and sends the @a events to the
+ * @a task if the @a chain is empty afterwards.
+ *
+ * @see rtems_chain_get() and rtems_event_receive().
+ *
+ * @retval RTEMS_SUCCESSFUL Successful operation.
+ * @retval RTEMS_TIMEOUT Timeout.
+ */
+rtems_status_code rtems_chain_get_with_wait(
+ rtems_chain_control *chain,
+ rtems_event_set events,
+ rtems_interval timeout,
+ rtems_chain_node **node
+);
+
+/** @} */
+
</font> #ifdef __cplusplus
}
#endif
<font color='#006600'>diff -u rtems/cpukit/sapi/inline/rtems/chain.inl:1.9 rtems/cpukit/sapi/inline/rtems/chain.inl:1.10
--- rtems/cpukit/sapi/inline/rtems/chain.inl:1.9 Mon Aug 9 02:38:51 2010
+++ rtems/cpukit/sapi/inline/rtems/chain.inl Tue Aug 24 09:29:55 2010
</font><font color='#997700'>@@ -1,22 +1,14 @@
</font> /**
<font color='#880000'>- * @file rtems/chain.inl
</font><font color='#000088'>+ * @file
</font> *
<font color='#880000'>- * This include file contains all the constants and structures associated
- * with the Chain API in RTEMS. The chain is a double linked list that
- * is part of the Super Core. This is the published interface to that
- * code.
- *
- * Iterate the node of a chain can be performed with the following code:
- *
- * rtems_chain_control* cc = &object->pending;
- * rtems_chain_node* cn = cc->first;
- * while (!rtems_chain_is_tail (cc, cn))
- * {
- * cn = cn->next;
- * }
</font><font color='#000088'>+ * @ingroup ClassicChains
+ *
+ * @brief Chain API.
</font> */
/*
<font color='#000088'>+ * Copyright (c) 2010 embedded brains GmbH.
+ *
</font> * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
<font color='#997700'>@@ -37,6 +29,12 @@
</font> #include <rtems/score/chain.inl>
/**
<font color='#000088'>+ * @addtogroup ClassicChains
+ *
+ * @{
+ */
+
+/**
</font> * @brief Initialize a Chain Header
*
* This routine initializes @a the_chain structure to manage the
<font color='#997700'>@@ -505,5 +503,59 @@
</font> _Chain_Prepend_unprotected( the_chain, the_node );
}
<font color='#000088'>+/**
+ * @brief Checks if the @a chain is empty and appends the @a node.
+ *
+ * Interrupts are disabled to ensure the atomicity of the operation.
+ *
+ * @retval true The chain was empty before the append.
+ * @retval false The chain contained at least one node before the append.
+ */
+RTEMS_INLINE_ROUTINE bool rtems_chain_append_with_empty_check(
+ rtems_chain_control *chain,
+ rtems_chain_node *node
+)
+{
+ return _Chain_Append_with_empty_check( chain, node );
+}
+
+/**
+ * @brief Checks if the @a chain is empty and prepends the @a node.
+ *
+ * Interrupts are disabled to ensure the atomicity of the operation.
+ *
+ * @retval true The chain was empty before the prepend.
+ * @retval false The chain contained at least one node before the prepend.
+ */
+RTEMS_INLINE_ROUTINE bool rtems_chain_prepend_with_empty_check(
+ rtems_chain_control *chain,
+ rtems_chain_node *node
+)
+{
+ return _Chain_Prepend_with_empty_check( chain, node );
+}
+
+/**
+ * @brief Tries to get the first @a node and check if the @a chain is empty
+ * afterwards.
+ *
+ * This function removes the first node from the @a chain and returns a pointer
+ * to that node in @a node. If the @a chain is empty, then @c NULL is returned.
+ *
+ * Interrupts are disabled to ensure the atomicity of the operation.
+ *
+ * @retval true The chain is empty after the node removal.
+ * @retval false The chain contained at least one node after the node removal.
+ */
+RTEMS_INLINE_ROUTINE bool rtems_chain_get_with_empty_check(
+ rtems_chain_control *chain,
+ rtems_chain_node **node
+)
+{
+ return _Chain_Get_with_empty_check( chain, node );
+}
+
+/** @} */
+
</font> #endif
/* end of include file */
<font color='#006600'>diff -u /dev/null rtems/cpukit/sapi/src/chainappendnotify.c:1.1
--- /dev/null Tue Aug 24 10:10:50 2010
+++ rtems/cpukit/sapi/src/chainappendnotify.c Tue Aug 24 09:29:55 2010
</font><font color='#997700'>@@ -0,0 +1,44 @@
</font><font color='#000088'>+/**
+ * @file
+ *
+ * @ingroup ClassicChains
+ *
+ * @brief rtems_chain_append_with_notification() 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/chain.h>
+
+rtems_status_code rtems_chain_append_with_notification(
+ rtems_chain_control *chain,
+ rtems_chain_node *node,
+ rtems_id task,
+ rtems_event_set events
+)
+{
+ rtems_status_code sc = RTEMS_SUCCESSFUL;
+ bool was_empty = rtems_chain_append_with_empty_check( chain, node );
+
+ if ( was_empty ) {
+ sc = rtems_event_send( task, events );
+ }
+
+ return sc;
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/sapi/src/chaingetnotify.c:1.1
--- /dev/null Tue Aug 24 10:10:50 2010
+++ rtems/cpukit/sapi/src/chaingetnotify.c Tue Aug 24 09:29:55 2010
</font><font color='#997700'>@@ -0,0 +1,44 @@
</font><font color='#000088'>+/**
+ * @file
+ *
+ * @ingroup ClassicChains
+ *
+ * @brief rtems_chain_get_with_notification() 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/chain.h>
+
+rtems_status_code rtems_chain_get_with_notification(
+ rtems_chain_control *chain,
+ rtems_id task,
+ rtems_event_set events,
+ rtems_chain_node **node
+)
+{
+ rtems_status_code sc = RTEMS_SUCCESSFUL;
+ bool is_empty = rtems_chain_get_with_empty_check( chain, node );
+
+ if ( is_empty ) {
+ sc = rtems_event_send( task, events );
+ }
+
+ return sc;
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/sapi/src/chaingetwait.c:1.1
--- /dev/null Tue Aug 24 10:10:50 2010
+++ rtems/cpukit/sapi/src/chaingetwait.c Tue Aug 24 09:29:55 2010
</font><font color='#997700'>@@ -0,0 +1,55 @@
</font><font color='#000088'>+/**
+ * @file
+ *
+ * @ingroup ClassicChains
+ *
+ * @brief rtems_chain_get_with_wait() 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/chain.h>
+
+rtems_status_code rtems_chain_get_with_wait(
+ rtems_chain_control *chain,
+ rtems_event_set events,
+ rtems_interval timeout,
+ rtems_chain_node **node_ptr
+)
+{
+ rtems_status_code sc = RTEMS_SUCCESSFUL;
+ rtems_chain_node *node = NULL;
+
+ while (
+ sc == RTEMS_SUCCESSFUL
+ && (node = rtems_chain_get( chain )) == NULL
+ ) {
+ rtems_event_set out;
+ sc = rtems_event_receive(
+ events,
+ RTEMS_EVENT_ALL | RTEMS_WAIT,
+ timeout,
+ &out
+ );
+ }
+
+ *node_ptr = node;
+
+ return sc;
+}
</font>
<font color='#006600'>diff -u /dev/null rtems/cpukit/sapi/src/chainprependnotify.c:1.1
--- /dev/null Tue Aug 24 10:10:51 2010
+++ rtems/cpukit/sapi/src/chainprependnotify.c Tue Aug 24 09:29:55 2010
</font><font color='#997700'>@@ -0,0 +1,44 @@
</font><font color='#000088'>+/**
+ * @file
+ *
+ * @ingroup ClassicChains
+ *
+ * @brief rtems_chain_prepend_with_notification() 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/chain.h>
+
+rtems_status_code rtems_chain_prepend_with_notification(
+ rtems_chain_control *chain,
+ rtems_chain_node *node,
+ rtems_id task,
+ rtems_event_set events
+)
+{
+ rtems_status_code sc = RTEMS_SUCCESSFUL;
+ bool was_empty = rtems_chain_prepend_with_empty_check( chain, node );
+
+ if (was_empty) {
+ sc = rtems_event_send( task, events );
+ }
+
+ return sc;
+}
</font></pre>
<p> </p>
<a name='cs2'></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-24 Sebastian Huber <sebastian.huber@embedded-brains.de>
* spchain/init.c, spchain/spchain.doc, spchain/spchain.scn: New test
cases.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/ChangeLog.diff?r1=text&tr1=1.416&r2=text&tr2=1.417&diff_format=h">M</a></td><td width='1%'>1.417</td><td width='100%'>testsuites/sptests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/spchain/init.c.diff?r1=text&tr1=1.3&r2=text&tr2=1.4&diff_format=h">M</a></td><td width='1%'>1.4</td><td width='100%'>testsuites/sptests/spchain/init.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/spchain/spchain.doc.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>testsuites/sptests/spchain/spchain.doc</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/sptests/spchain/spchain.scn.diff?r1=text&tr1=1.2&r2=text&tr2=1.3&diff_format=h">M</a></td><td width='1%'>1.3</td><td width='100%'>testsuites/sptests/spchain/spchain.scn</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/sptests/ChangeLog:1.416 rtems/testsuites/sptests/ChangeLog:1.417
--- rtems/testsuites/sptests/ChangeLog:1.416 Mon Aug 23 03:27:33 2010
+++ rtems/testsuites/sptests/ChangeLog Tue Aug 24 10:01:04 2010
</font><font color='#997700'>@@ -1,3 +1,8 @@
</font><font color='#000088'>+2010-08-24 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * spchain/init.c, spchain/spchain.doc, spchain/spchain.scn: New test
+ cases.
+
</font> 2010-08-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
* spfatal24/.cvsignore, spfatal24/Makefile.am,
<font color='#006600'>diff -u rtems/testsuites/sptests/spchain/init.c:1.3 rtems/testsuites/sptests/spchain/init.c:1.4
--- rtems/testsuites/sptests/spchain/init.c:1.3 Sun Nov 29 21:33:25 2009
+++ rtems/testsuites/sptests/spchain/init.c Tue Aug 24 10:01:04 2010
</font><font color='#997700'>@@ -12,11 +12,101 @@
</font> #include <tmacros.h>
#include <rtems/chain.h>
<font color='#000088'>+#define EVENT RTEMS_EVENT_13
+#define TIMEOUT 1
+
</font> typedef struct {
rtems_chain_node Node;
int id;
} test_node;
<font color='#000088'>+static void test_chain_get_with_wait(void)
+{
+ rtems_status_code sc = RTEMS_SUCCESSFUL;
+ rtems_chain_control chain;
+ rtems_chain_node *p = (rtems_chain_node *) 1;
+
+ puts( "INIT - Verify rtems_chain_get_with_wait" );
+ rtems_chain_initialize_empty( &chain );
+ sc = rtems_chain_get_with_wait( &chain, EVENT, TIMEOUT, &p );
+ rtems_test_assert( sc == RTEMS_TIMEOUT );
+ rtems_test_assert( p == NULL );
+}
+
+static void test_chain_with_notification(void)
+{
+ rtems_status_code sc = RTEMS_SUCCESSFUL;
+ rtems_chain_control chain;
+ rtems_chain_node a;
+ rtems_chain_node *p = (rtems_chain_node *) 1;
+ rtems_event_set out = 0;
+
+ puts( "INIT - Verify rtems_chain_append_with_notification" );
+ rtems_chain_initialize_empty( &chain );
+ sc = rtems_chain_append_with_notification( &chain, &a, rtems_task_self(), EVENT );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+ sc = rtems_chain_get_with_wait( &chain, EVENT, TIMEOUT, &p );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+ rtems_test_assert( p == &a );
+
+ puts( "INIT - Verify rtems_chain_prepend_with_notification" );
+ rtems_chain_initialize_empty( &chain );
+ sc = rtems_chain_prepend_with_notification( &chain, &a, rtems_task_self(), EVENT );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+ sc = rtems_chain_get_with_wait( &chain, EVENT, TIMEOUT, &p );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+ rtems_test_assert( p == &a );
+
+ puts( "INIT - Verify rtems_chain_get_with_notification" );
+ rtems_chain_initialize_empty( &chain );
+ rtems_chain_append( &chain, &a );
+ sc = rtems_chain_get_with_notification( &chain, rtems_task_self(), EVENT, &p );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+ rtems_test_assert( p == &a );
+ sc = rtems_event_receive(
+ EVENT,
+ RTEMS_EVENT_ALL | RTEMS_WAIT,
+ TIMEOUT,
+ &out
+ );
+ rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+ rtems_test_assert( out == EVENT );
+}
+
+static void test_chain_with_empty_check(void)
+{
+ rtems_chain_control chain;
+ rtems_chain_node a;
+ rtems_chain_node b;
+ rtems_chain_node *p;
+ bool empty;
+
+ puts( "INIT - Verify rtems_chain_append_with_empty_check" );
+ rtems_chain_initialize_empty( &chain );
+ empty = rtems_chain_append_with_empty_check( &chain, &a );
+ rtems_test_assert( empty );
+ empty = rtems_chain_append_with_empty_check( &chain, &a );
+ rtems_test_assert( !empty );
+
+ puts( "INIT - Verify rtems_chain_prepend_with_empty_check" );
+ rtems_chain_initialize_empty( &chain );
+ empty = rtems_chain_prepend_with_empty_check( &chain, &a );
+ rtems_test_assert( empty );
+ empty = rtems_chain_prepend_with_empty_check( &chain, &a );
+ rtems_test_assert( !empty );
+
+ puts( "INIT - Verify rtems_chain_get_with_empty_check" );
+ rtems_chain_initialize_empty( &chain );
+ rtems_chain_append( &chain, &a );
+ rtems_chain_append( &chain, &b );
+ empty = rtems_chain_get_with_empty_check( &chain, &p );
+ rtems_test_assert( !empty );
+ rtems_test_assert( p == &a );
+ empty = rtems_chain_get_with_empty_check( &chain, &p );
+ rtems_test_assert( empty );
+ rtems_test_assert( p == &b );
+}
+
</font> rtems_task Init(
rtems_task_argument ignored
)
<font color='#997700'>@@ -52,6 +142,10 @@
</font> }
}
<font color='#000088'>+ test_chain_with_empty_check();
+ test_chain_with_notification();
+ test_chain_get_with_wait();
+
</font> puts( "*** END OF RTEMS CHAIN API TEST ***" );
rtems_test_exit(0);
}
<font color='#997700'>@@ -59,7 +153,7 @@
</font> /* configuration information */
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
<font color='#880000'>-#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
</font><font color='#000088'>+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
</font>
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_MAXIMUM_TASKS 1
<font color='#006600'>diff -u rtems/testsuites/sptests/spchain/spchain.doc:1.1 rtems/testsuites/sptests/spchain/spchain.doc:1.2
--- rtems/testsuites/sptests/spchain/spchain.doc:1.1 Wed Jul 1 14:49:08 2009
+++ rtems/testsuites/sptests/spchain/spchain.doc Tue Aug 24 10:01:04 2010
</font><font color='#997700'>@@ -19,6 +19,13 @@
</font> rtems_chain_append
rtems_chain_insert
rtems_chain_is_tail
<font color='#000088'>+ rtems_chain_append_with_empty_check
+ rtems_chain_prepend_with_empty_check
+ rtems_chain_get_with_empty_check
+ rtems_chain_append_with_notification
+ rtems_chain_prepend_with_notification
+ rtems_chain_get_with_notification
+ rtems_chain_get_with_wait
</font>
concepts:
<font color='#006600'>diff -u rtems/testsuites/sptests/spchain/spchain.scn:1.2 rtems/testsuites/sptests/spchain/spchain.scn:1.3
--- rtems/testsuites/sptests/spchain/spchain.scn:1.2 Thu Jul 2 10:24:37 2009
+++ rtems/testsuites/sptests/spchain/spchain.scn Tue Aug 24 10:01:04 2010
</font><font color='#997700'>@@ -1,4 +1,11 @@
</font> *** TEST OF RTEMS CHAIN API ***
Init - Initialize chain empty
INIT - Verify rtems_chain_insert
<font color='#000088'>+INIT - Verify rtems_chain_append_with_empty_check
+INIT - Verify rtems_chain_prepend_with_empty_check
+INIT - Verify rtems_chain_get_with_empty_check
+INIT - Verify rtems_chain_append_with_notification
+INIT - Verify rtems_chain_prepend_with_notification
+INIT - Verify rtems_chain_get_with_notification
+INIT - Verify rtems_chain_get_with_wait
</font> *** END OF RTEMS CHAIN API TEST ***
</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>