[PATCH v2] score: Fix priority message queue insert

2015-04-22 Thread Sebastian Huber
Move the linear search into a critical section to avoid corruption due
to higher priority interrupts.  The interrupt disable time depends now
on the count of pending messages.

Close #2328.
---
 cpukit/score/include/rtems/score/coremsgimpl.h |  32 +---
 cpukit/score/src/coremsginsert.c   | 107 ++---
 2 files changed, 44 insertions(+), 95 deletions(-)

diff --git a/cpukit/score/include/rtems/score/coremsgimpl.h 
b/cpukit/score/include/rtems/score/coremsgimpl.h
index 52796ad..cedf276 100644
--- a/cpukit/score/include/rtems/score/coremsgimpl.h
+++ b/cpukit/score/include/rtems/score/coremsgimpl.h
@@ -443,7 +443,7 @@ RTEMS_INLINE_ROUTINE void 
_CORE_message_queue_Free_message_buffer (
  *   disabled if no API requires it.
  */
 RTEMS_INLINE_ROUTINE int _CORE_message_queue_Get_message_priority (
-  CORE_message_queue_Buffer_control *the_message
+  const CORE_message_queue_Buffer_control *the_message
 )
 {
   #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
@@ -494,36 +494,6 @@ RTEMS_INLINE_ROUTINE bool _CORE_message_queue_Is_priority(
 (the_attribute->discipline == CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY);
 }
 
-/**
- * This routine places the_message at the rear of the outstanding
- * messages on the_message_queue.
- */
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Append_unprotected (
-  CORE_message_queue_Control*the_message_queue,
-  CORE_message_queue_Buffer_control *the_message
-)
-{
-  _Chain_Append_unprotected(
-&the_message_queue->Pending_messages,
-&the_message->Node
-  );
-}
-
-/**
- * This routine places the_message at the front of the outstanding
- * messages on the_message_queue.
- */
-RTEMS_INLINE_ROUTINE void _CORE_message_queue_Prepend_unprotected (
-  CORE_message_queue_Control*the_message_queue,
-  CORE_message_queue_Buffer_control *the_message
-)
-{
-  _Chain_Prepend_unprotected(
-&the_message_queue->Pending_messages,
-&the_message->Node
-  );
-}
-
 #if defined(RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION)
   /**
* This function returns true if notification is enabled on this message
diff --git a/cpukit/score/src/coremsginsert.c b/cpukit/score/src/coremsginsert.c
index 2e42349..28407ba 100644
--- a/cpukit/score/src/coremsginsert.c
+++ b/cpukit/score/src/coremsginsert.c
@@ -18,12 +18,25 @@
 #include "config.h"
 #endif
 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
+#include 
+
+#if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
+static bool _CORE_message_queue_Order(
+  const Chain_Node *left,
+  const Chain_Node *right
+)
+{
+   const CORE_message_queue_Buffer_control *left_message;
+   const CORE_message_queue_Buffer_control *right_message;
+
+   left_message = (const CORE_message_queue_Buffer_control *) left;
+   right_message = (const CORE_message_queue_Buffer_control *) right;
+
+   return _CORE_message_queue_Get_message_priority( left_message ) <
+ _CORE_message_queue_Get_message_priority( right_message );
+}
+#endif
 
 void _CORE_message_queue_Insert_message(
   CORE_message_queue_Control*the_message_queue,
@@ -31,71 +44,37 @@ void _CORE_message_queue_Insert_message(
   CORE_message_queue_Submit_typessubmit_type
 )
 {
-  ISR_Level  level;
-  #if defined(RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION)
-boolnotify = false;
-#define SET_NOTIFY() \
-  do { \
-if ( the_message_queue->number_of_pending_messages == 0 ) \
-  notify = true; \
-  } while (0)
-  #else
-#define SET_NOTIFY()
-  #endif
+  Chain_Control *pending_messages;
+  ISR_Level  level;
+#if defined(RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION)
+  bool   notify;
+#endif
 
   _CORE_message_queue_Set_message_priority( the_message, submit_type );
+  pending_messages = &the_message_queue->Pending_messages;
 
-  #if !defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
-_ISR_Disable( level );
-  SET_NOTIFY();
-  the_message_queue->number_of_pending_messages++;
-  if ( submit_type == CORE_MESSAGE_QUEUE_SEND_REQUEST )
-_CORE_message_queue_Append_unprotected(the_message_queue, the_message);
-  else
-_CORE_message_queue_Prepend_unprotected(the_message_queue, 
the_message);
-_ISR_Enable( level );
-  #else
-if ( submit_type == CORE_MESSAGE_QUEUE_SEND_REQUEST ) {
-  _ISR_Disable( level );
-SET_NOTIFY();
-the_message_queue->number_of_pending_messages++;
-_CORE_message_queue_Append_unprotected(the_message_queue, the_message);
-  _ISR_Enable( level );
-} else if ( submit_type == CORE_MESSAGE_QUEUE_URGENT_REQUEST ) {
-  _ISR_Disable( level );
-SET_NOTIFY();
-the_message_queue->number_of_pending_messages++;
-_CORE_message_queue_Prepend_unprotected(the_message_queue, 
the_message);
-  _ISR_Enable( level );
-} else {
-  CORE_message_queue_Buffer_control *this_message;
-  Chain_Node*the_node;
-  Chain_Control *the_h

[PATCH] smptests/smpcache01: Enable interrupts before waiting for other CPUs

2015-04-22 Thread Daniel Cederman
Otherwise there is a risk that a CPU misses a cache manager message
from another CPU and the test hangs.
---
 testsuites/smptests/smpcache01/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testsuites/smptests/smpcache01/init.c 
b/testsuites/smptests/smpcache01/init.c
index 7ad2ef9..0127a6c 100644
--- a/testsuites/smptests/smpcache01/init.c
+++ b/testsuites/smptests/smpcache01/init.c
@@ -120,12 +120,12 @@ static void test_func_isrdisabled_test( size_t set_size, 
cpu_set_t *cpu_set,
 
   _SMP_Multicast_action( set_size, cpu_set, test_cache_message, &ctx );
 
+  _ISR_Enable_without_giant( isr_level );
+
   _SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() );
 
   rtems_test_assert( ctx.count[rtems_get_current_processor()] ==
   rtems_get_processor_count() );
-
-  _ISR_Enable_without_giant( isr_level );
 }
 
 static void test_func_giant_taken_test( size_t set_size, cpu_set_t *cpu_set,
-- 
2.2.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] smptests/smpcache01: Enable interrupts before waiting for other CPUs

2015-04-22 Thread Sebastian Huber

Thanks, committed.

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] [RSB] Add support for building Epiphany tools

2015-04-22 Thread Hesham ALMatary
On Tue, Apr 21, 2015 at 11:30 PM, Chris Johns  wrote:
> On 22/04/2015 2:33 am, Hesham ALMatary wrote:
>> This patch adds support for building Epiphany tools.
>
> Great to see this support being adding.
>
>> Currently some tools
>> are fetched from my repositories (until my pull requests get merged), and
>> other tools are fetched from Adapteva repositories. In the future, the
>> tools should be fetched from GNU upstreams when Adapteva folks push
>> their latest changes there.
>
> Have you posted your changes to Adapteva ? Would they accept them ?
Yes. They merged my changes about two months ago (that's why I fetch
binutils from their repo), but I submitted a bug fix two days ago
(pull request still pending), that's why I don't use their GCC and GDB
repos. When my latest changes get merged I'll refer to their repos.
>
>> ---
>>  rtems/config/4.11/rtems-epiphany.bset  | 43 
>> ++
>>  source-builder/config/binutils-2-1.cfg |  4 ++--
>>  source-builder/config/gcc-common-1.cfg |  5 ++--
>>  source-builder/config/gdb-7-1.cfg  |  4 ++--
>>  4 files changed, 50 insertions(+), 6 deletions(-)
>>  create mode 100644 rtems/config/4.11/rtems-epiphany.bset
>>
>> diff --git a/rtems/config/4.11/rtems-epiphany.bset 
>> b/rtems/config/4.11/rtems-epiphany.bset
>> new file mode 100644
>> index 000..429031f
>> --- /dev/null
>> +++ b/rtems/config/4.11/rtems-epiphany.bset
>> @@ -0,0 +1,43 @@
>> +#
>> +# Tools Set for RTEMS Epiphany 4.11 Stable
>> +#
>> +
>> +%define release 1
>> +
>> +%define rtems_arch epiphany
>> +
>> +#
>> +# Get GNU tools from external repositories.
>> +#
>> +%define binutils_external 1
>> +%define gcc_external 1
>> +%define gdb_external 1
>> +
>> +#
>> +# Expanded names of the GNU tools
>> +#
>> +%define binutils_expand_name 
>> epiphany-binutils-gdb-epiphany-binutils-2.23-software-cache
>> +%define gcc_expand_name epiphany-gcc-epiphany-gcc-4.9
>> +%define gdb_expand_name epiphany-binutils-gdb-epiphany-gdb-7.8
>> +
>
> Is this really 'binutils_source_name' or 'binutils_source_top' ?
This is name of the directory the result from expanding the zip file.
For example I am downloading a specific branch of a repo [1] the name
would be "repo_name+branch_name" (epiphany-gcc+epiphany-gcc-4.9).

[1] https://github.com/adapteva/epiphany-gcc/tree/epiphany-gcc-4.9
>
>> +#
>> +# Fetch GNU tools from external repos (temporarly).
>> +#
>> +%source set binutils 
>> https://github.com/adapteva/epiphany-binutils-gdb/archive/epiphany-binutils-2.23-software-cache.zip
>
> Is the expanded tree in the ZIP file not the same as the file name ?
>
No. The ZIP file is only the branch name, the the expanded directory
is "repo_name+branch_name". This is the main reason why I added this
tool_external define. The default cfg files (like gcc-common-1.cfg)
assume a pattern of the expanded directory (i.e, gcc-%{gcc_version}),
any other format wouldn't work. I came across the same issue when
trying to fetch GNU tools from OpenRISC repos. My solutions are: 1)
provide a separate config files for such an external tools that will
be redundant to handle only the different expansion name (I submitted
this version of the patch) and the other solution 2) is adding this
"external" features introduced in this patch.
>> +%source set gcc 
>> https://github.com/heshamelmatary/epiphany-gcc/archive/epiphany-gcc-4.9.zip
>> +%source set gdb 
>> https://github.com/heshamelmatary/epiphany-binutils-gdb/archive/epiphany-gdb-7.8.zip
>> +
>> +#
>> +# The RTEMS 4.11 base defines.
>> +#
>> +%include rtems-4.11-base.bset
>> +
>> +#
>> +# Tools configuration.
>> +#
>> +4.11/rtems-autotools
>> +devel/expat-2.1.0-1
>> +tools/rtems-binutils-2.23.1-1
>> +tools/rtems-gcc-4.9.1-newlib-git-1
>> +tools/rtems-gdb-7.8.1-1
>> +tools/rtems-tools-4.11-1
>> diff --git a/source-builder/config/binutils-2-1.cfg 
>> b/source-builder/config/binutils-2-1.cfg
>> index c74a2c7..d37674d 100644
>> --- a/source-builder/config/binutils-2-1.cfg
>> +++ b/source-builder/config/binutils-2-1.cfg
>> @@ -37,8 +37,8 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
>>  %prep
>>build_top=$(pwd)
>>
>> -  source_dir_binutils="binutils-%{binutils_version}"
>> -  %source setup binutils -q -n binutils-%{binutils_version}
>> +  
>> source_dir_binutils=%{?binutils_external:%{binutils_expand_name}}%{!?binutils_external:"binutils-%{binutils_version}"}
>> +  %source setup binutils -q -n 
>> %{?binutils_external:%{binutils_expand_name}}%{!?binutils_external:binutils-%{binutils_version}}
>
> Can this be simplified with something like:
>
> %binutils_sources=%{?binutils_source_name:%{binutils_source_name}}%{!?binutils_source_name:"binutils-%{binutils_version}"}
>
> source_dir_binutils=%{binutils_sources}
> %source setup binutils -q -n %{binutils_sources}
>
Sure, that's better.
> The same would go for the other tools.
>
> Chris
>
>
>>%patch setup binutils -p1
>>
>>cd ${build_top}
>> diff --git a/source-builder/config/gcc-common-1.cfg 
>> b/source-builder/config/g

Re: [rtems commit] score: Delete _CORE_RWLock_Timeout()

2015-04-22 Thread Joel Sherrill
Please add a comment to the group in Doxygen to see this commit for getting 
this back. If POSIX or another standard ever requires reevaluation of the lock 
and released threads on a timeout.

POSIX is very loose on the discipline of waiting threads and behavior on 
timeout. It leaves a lot of room for variation. I picked the way we are doing 
because it was simple and made sense to honor readers and writers in temporal 
order. 

This was a hole to add rwlock unique timeout behavior that could vary by API.

On April 22, 2015 7:23:20 AM CDT, Sebastian Huber  wrote:
>Module:rtems
>Branch:master
>Commit:b0686b473d8c07e5bbdc1932d7d9b71bfccdf92e
>Changeset:
>http://git.rtems.org/rtems/commit/?id=b0686b473d8c07e5bbdc1932d7d9b71bfccdf92e
>
>Author:Sebastian Huber 
>Date:  Wed Apr 22 13:57:18 2015 +0200
>
>score: Delete _CORE_RWLock_Timeout()
>
>This function was identical to _Thread_queue_Timeout().  This makes
>_Thread_queue_Enqueue_with_handler() obsolete.
>
>---
>
> cpukit/score/Makefile.am  |  2 +-
> cpukit/score/include/rtems/score/corerwlockimpl.h | 15 
> cpukit/score/include/rtems/score/threadqimpl.h| 22 ++-
> cpukit/score/src/corerwlockobtainread.c   |  5 +--
> cpukit/score/src/corerwlockobtainwrite.c  |  6 +--
>cpukit/score/src/corerwlocktimeout.c  | 45
>---
> cpukit/score/src/threadqenqueue.c | 11 +++---
> 7 files changed, 14 insertions(+), 92 deletions(-)
>
>diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
>index 0a6beb4..f8ad60d 100644
>--- a/cpukit/score/Makefile.am
>+++ b/cpukit/score/Makefile.am
>@@ -174,7 +174,7 @@ libscore_a_SOURCES += src/percpuasm.c
> ## CORE_RWLOCK_C_FILES
> if HAS_PTHREADS
> libscore_a_SOURCES += src/corerwlock.c src/corerwlockobtainread.c \
>-src/corerwlockobtainwrite.c src/corerwlockrelease.c
>src/corerwlocktimeout.c
>+src/corerwlockobtainwrite.c src/corerwlockrelease.c
> endif
> 
> ## CORE_SEMAPHORE_C_FILES
>diff --git a/cpukit/score/include/rtems/score/corerwlockimpl.h
>b/cpukit/score/include/rtems/score/corerwlockimpl.h
>index 66c3b1a..331510b 100644
>--- a/cpukit/score/include/rtems/score/corerwlockimpl.h
>+++ b/cpukit/score/include/rtems/score/corerwlockimpl.h
>@@ -168,21 +168,6 @@ CORE_RWLock_Status _CORE_RWLock_Release(
>   )
> 
> /**
>- *  @brief RWLock specific thread queue timeout.
>- *
>- *  This routine processes a thread which timeouts while waiting on
>- *  an RWLock's thread queue. It is called by the watchdog handler.
>- *
>- *  @param[in] id is the Id of thread to timeout
>- *  @param[in] ignored is an unused pointer to a caller defined area
>- */
>-
>-void _CORE_RWLock_Timeout(
>-  Objects_Id  id,
>-  void   *ignored
>-);
>-
>-/**
>  * This method is used to initialize core rwlock attributes.
>  *
>  * @param[in] the_attributes pointer to the attributes to initialize.
>diff --git a/cpukit/score/include/rtems/score/threadqimpl.h
>b/cpukit/score/include/rtems/score/threadqimpl.h
>index 2fa7974..57bdf05 100644
>--- a/cpukit/score/include/rtems/score/threadqimpl.h
>+++ b/cpukit/score/include/rtems/score/threadqimpl.h
>@@ -64,19 +64,6 @@ Thread_Control *_Thread_queue_Dequeue(
> );
> 
> /**
>- *  @brief Enqueues the currently executing thread on
>the_thread_queue.
>- *
>- *  This routine enqueues the currently executing thread on
>- *  the_thread_queue with an optional timeout.
>- */
>-#define _Thread_queue_Enqueue( _the_thread_queue, _the_thread,
>_timeout ) \
>-  _Thread_queue_Enqueue_with_handler( \
>-_the_thread_queue, \
>-_the_thread, \
>-_timeout, \
>-_Thread_queue_Timeout )
>-
>-/**
>  *  @brief Blocks a thread and places it on a thread.
>  *
> *  This routine blocks a thread, places it on a thread, and optionally
>@@ -89,11 +76,10 @@ Thread_Control *_Thread_queue_Dequeue(
>  *  - INTERRUPT LATENCY:
>  *+ single case
>  */
>-void _Thread_queue_Enqueue_with_handler(
>-  Thread_queue_Control *the_thread_queue,
>-  Thread_Control   *the_thread,
>-  Watchdog_Interval timeout,
>-  Thread_queue_Timeout_callout  handler
>+void _Thread_queue_Enqueue(
>+  Thread_queue_Control *the_thread_queue,
>+  Thread_Control   *the_thread,
>+  Watchdog_Interval timeout
> );
> 
> /**
>diff --git a/cpukit/score/src/corerwlockobtainread.c
>b/cpukit/score/src/corerwlockobtainread.c
>index c118e29..f3851b4 100644
>--- a/cpukit/score/src/corerwlockobtainread.c
>+++ b/cpukit/score/src/corerwlockobtainread.c
>@@ -84,11 +84,10 @@ void _CORE_RWLock_Obtain_for_reading(
> executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
> _ISR_Enable( level );
> 
>-_Thread_queue_Enqueue_with_handler(
>+_Thread_queue_Enqueue(
>&the_rwlock->Wait_queue,
>executing,
>-   timeout,
>-   _CORE_RWLock_Timeout
>+   timeout
> );
> 
> /* return to API level so it can dispatch and we block */
>diff --git a/cpukit/score/src/corerwlockobtainwrite.c
>

Re: [rtems commit] score: Delete _CORE_RWLock_Timeout()

2015-04-22 Thread Sebastian Huber
I am about to replace the complete thread queue implementation, so there 
is no way back using a previous commit. I currently try to remove all 
the dead or duplicated code to make things simpler so that the final 
replacement patch is as small as possible. There will be a means to do 
specific things during a timeout in the new implementation.


On 22/04/15 15:01, Joel Sherrill wrote:

Please add a comment to the group in Doxygen to see this commit for getting 
this back. If POSIX or another standard ever requires reevaluation of the lock 
and released threads on a timeout.

POSIX is very loose on the discipline of waiting threads and behavior on 
timeout. It leaves a lot of room for variation. I picked the way we are doing 
because it was simple and made sense to honor readers and writers in temporal 
order.

This was a hole to add rwlock unique timeout behavior that could vary by API.

On April 22, 2015 7:23:20 AM CDT, Sebastian Huber  wrote:

Module:rtems
Branch:master
Commit:b0686b473d8c07e5bbdc1932d7d9b71bfccdf92e
Changeset:
http://git.rtems.org/rtems/commit/?id=b0686b473d8c07e5bbdc1932d7d9b71bfccdf92e

Author:Sebastian Huber 
Date:  Wed Apr 22 13:57:18 2015 +0200

score: Delete _CORE_RWLock_Timeout()

This function was identical to _Thread_queue_Timeout().  This makes
_Thread_queue_Enqueue_with_handler() obsolete.

---

cpukit/score/Makefile.am  |  2 +-
cpukit/score/include/rtems/score/corerwlockimpl.h | 15 
cpukit/score/include/rtems/score/threadqimpl.h| 22 ++-
cpukit/score/src/corerwlockobtainread.c   |  5 +--
cpukit/score/src/corerwlockobtainwrite.c  |  6 +--
cpukit/score/src/corerwlocktimeout.c  | 45
---
cpukit/score/src/threadqenqueue.c | 11 +++---
7 files changed, 14 insertions(+), 92 deletions(-)

diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index 0a6beb4..f8ad60d 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -174,7 +174,7 @@ libscore_a_SOURCES += src/percpuasm.c
## CORE_RWLOCK_C_FILES
if HAS_PTHREADS
libscore_a_SOURCES += src/corerwlock.c src/corerwlockobtainread.c \
-src/corerwlockobtainwrite.c src/corerwlockrelease.c
src/corerwlocktimeout.c
+src/corerwlockobtainwrite.c src/corerwlockrelease.c
endif

## CORE_SEMAPHORE_C_FILES
diff --git a/cpukit/score/include/rtems/score/corerwlockimpl.h
b/cpukit/score/include/rtems/score/corerwlockimpl.h
index 66c3b1a..331510b 100644
--- a/cpukit/score/include/rtems/score/corerwlockimpl.h
+++ b/cpukit/score/include/rtems/score/corerwlockimpl.h
@@ -168,21 +168,6 @@ CORE_RWLock_Status _CORE_RWLock_Release(
   )

/**
- *  @brief RWLock specific thread queue timeout.
- *
- *  This routine processes a thread which timeouts while waiting on
- *  an RWLock's thread queue. It is called by the watchdog handler.
- *
- *  @param[in] id is the Id of thread to timeout
- *  @param[in] ignored is an unused pointer to a caller defined area
- */
-
-void _CORE_RWLock_Timeout(
-  Objects_Id  id,
-  void   *ignored
-);
-
-/**
  * This method is used to initialize core rwlock attributes.
  *
  * @param[in] the_attributes pointer to the attributes to initialize.
diff --git a/cpukit/score/include/rtems/score/threadqimpl.h
b/cpukit/score/include/rtems/score/threadqimpl.h
index 2fa7974..57bdf05 100644
--- a/cpukit/score/include/rtems/score/threadqimpl.h
+++ b/cpukit/score/include/rtems/score/threadqimpl.h
@@ -64,19 +64,6 @@ Thread_Control *_Thread_queue_Dequeue(
);

/**
- *  @brief Enqueues the currently executing thread on
the_thread_queue.
- *
- *  This routine enqueues the currently executing thread on
- *  the_thread_queue with an optional timeout.
- */
-#define _Thread_queue_Enqueue( _the_thread_queue, _the_thread,
_timeout ) \
-  _Thread_queue_Enqueue_with_handler( \
-_the_thread_queue, \
-_the_thread, \
-_timeout, \
-_Thread_queue_Timeout )
-
-/**
  *  @brief Blocks a thread and places it on a thread.
  *
*  This routine blocks a thread, places it on a thread, and optionally
@@ -89,11 +76,10 @@ Thread_Control *_Thread_queue_Dequeue(
  *  - INTERRUPT LATENCY:
  *+ single case
  */
-void _Thread_queue_Enqueue_with_handler(
-  Thread_queue_Control *the_thread_queue,
-  Thread_Control   *the_thread,
-  Watchdog_Interval timeout,
-  Thread_queue_Timeout_callout  handler
+void _Thread_queue_Enqueue(
+  Thread_queue_Control *the_thread_queue,
+  Thread_Control   *the_thread,
+  Watchdog_Interval timeout
);

/**
diff --git a/cpukit/score/src/corerwlockobtainread.c
b/cpukit/score/src/corerwlockobtainread.c
index c118e29..f3851b4 100644
--- a/cpukit/score/src/corerwlockobtainread.c
+++ b/cpukit/score/src/corerwlockobtainread.c
@@ -84,11 +84,10 @@ void _CORE_RWLock_Obtain_for_reading(
 executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL;
 _ISR_Enable( level );

-_Thread_queue_Enqueue_with_handler(
+_Thread_queue_Enqueue(
 

Re: [PATCH] score: Fix priority message queue insert

2015-04-22 Thread Gedare Bloom
Joel,

On Tue, Apr 21, 2015 at 12:13 PM, Joel Sherrill
 wrote:
>
>
> On 4/21/2015 2:24 AM, Sebastian Huber wrote:
>> Move the linear search into a critical section to avoid corruption due
>> to higher priority interrupts.  The interrupt disable time depends now
>> on the count of pending messages.
>>
>> Close #2328.
>> ---
>>  cpukit/score/include/rtems/score/coremsgimpl.h |  32 +--
>>  cpukit/score/src/coremsginsert.c   | 113 
>> +++--
>>  2 files changed, 50 insertions(+), 95 deletions(-)

>> +#if defined(RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION)
>> +  notify = the_message_queue->number_of_pending_messages == 0;
>> +#endif
> Add parentheses around expression to make it clear that is the intent.
Our coding conventions say to avoid unnecessary parens. If you'd like
to make some adjustment to the conventions please start a separate
thread.

Gedare
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 01/10] lm3s3749-testsuite.tcfg: Add cdtest

2015-04-22 Thread Joel Sherrill
---
 c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s3749-testsuite.tcfg| 1 +
 .../libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram-testsuite.tcfg   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s3749-testsuite.tcfg 
b/c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s3749-testsuite.tcfg
index b95bc2b..6b49cac 100644
--- a/c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s3749-testsuite.tcfg
+++ b/c/src/lib/libbsp/arm/lm3s69xx/make/custom/lm3s3749-testsuite.tcfg
@@ -5,6 +5,7 @@
 #
 
 capture
+cdtest
 iostream
 dl01
 dl02
diff --git 
a/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram-testsuite.tcfg 
b/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram-testsuite.tcfg
index 6cd559a..c4eaea6 100644
--- 
a/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram-testsuite.tcfg
+++ 
b/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram-testsuite.tcfg
@@ -18,6 +18,7 @@ jffs2_fstime
 mghttpd01
 pppd
 spstkalloc02
+sptls02
 tmfine01
 utf8proc01
 iostream
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 02/10] lpc1768_mbed_ahb_ram_eth-testsuite.tcfg: Add sptls02

2015-04-22 Thread Joel Sherrill
---
 .../arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg  | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg
 
b/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg
index 0dc4412..fb7a6d8 100644
--- 
a/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg
+++ 
b/c/src/lib/libbsp/arm/lpc176x/make/custom/lpc1768_mbed_ahb_ram_eth-testsuite.tcfg
@@ -29,6 +29,7 @@ sp48
 spregion_err01
 spstkalloc
 spstkalloc02
+sptls02
 tmfine01
 utf8proc01
 iostream
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 03/10] mcf5225x-testsuite.tcfg: Add iostream

2015-04-22 Thread Joel Sherrill
---
 c/src/lib/libbsp/m68k/mcf5225x/make/custom/mcf5225x-testsuite.tcfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/c/src/lib/libbsp/m68k/mcf5225x/make/custom/mcf5225x-testsuite.tcfg 
b/c/src/lib/libbsp/m68k/mcf5225x/make/custom/mcf5225x-testsuite.tcfg
index 313f073..9b822c8 100644
--- a/c/src/lib/libbsp/m68k/mcf5225x/make/custom/mcf5225x-testsuite.tcfg
+++ b/c/src/lib/libbsp/m68k/mcf5225x/make/custom/mcf5225x-testsuite.tcfg
@@ -7,6 +7,7 @@
 fileio
 flashdisk01
 fsdosfsname01
+iostream
 jffs2_fserror
 jffs2_fslink
 jffs2_fspatheval
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 04/10] mrm332-testsuite.tcfg: Add iostream and sptls02

2015-04-22 Thread Joel Sherrill
---
 c/src/lib/libbsp/m68k/mrm332/make/custom/mrm332-testsuite.tcfg | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/c/src/lib/libbsp/m68k/mrm332/make/custom/mrm332-testsuite.tcfg 
b/c/src/lib/libbsp/m68k/mrm332/make/custom/mrm332-testsuite.tcfg
index b4e40de..65804b7 100644
--- a/c/src/lib/libbsp/m68k/mrm332/make/custom/mrm332-testsuite.tcfg
+++ b/c/src/lib/libbsp/m68k/mrm332/make/custom/mrm332-testsuite.tcfg
@@ -5,5 +5,7 @@
 #
 
 fsdosfsname01
+iostream
 sptls01
+sptls02
 utf8proc01
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 05/10] ods68302-testsuite.tcfg: Add iosteam

2015-04-22 Thread Joel Sherrill
---
 c/src/lib/libbsp/m68k/ods68302/make/custom/ods68302-testsuite.tcfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/c/src/lib/libbsp/m68k/ods68302/make/custom/ods68302-testsuite.tcfg 
b/c/src/lib/libbsp/m68k/ods68302/make/custom/ods68302-testsuite.tcfg
index eb1c5e0..5bed603 100644
--- a/c/src/lib/libbsp/m68k/ods68302/make/custom/ods68302-testsuite.tcfg
+++ b/c/src/lib/libbsp/m68k/ods68302/make/custom/ods68302-testsuite.tcfg
@@ -6,4 +6,5 @@
 
 fileio
 fsdosfsname01
+iostream
 utf8proc01
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 06/10] mbx8xx/include/bsp.h: Add include of

2015-04-22 Thread Joel Sherrill
---
 c/src/lib/libbsp/powerpc/mbx8xx/include/bsp.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/c/src/lib/libbsp/powerpc/mbx8xx/include/bsp.h 
b/c/src/lib/libbsp/powerpc/mbx8xx/include/bsp.h
index c87350d..e726624 100644
--- a/c/src/lib/libbsp/powerpc/mbx8xx/include/bsp.h
+++ b/c/src/lib/libbsp/powerpc/mbx8xx/include/bsp.h
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 07/10] gensh1-testsuite.tcfg: Add iostream

2015-04-22 Thread Joel Sherrill
---
 c/src/lib/libbsp/sh/gensh1/make/custom/gensh1-testsuite.tcfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/c/src/lib/libbsp/sh/gensh1/make/custom/gensh1-testsuite.tcfg 
b/c/src/lib/libbsp/sh/gensh1/make/custom/gensh1-testsuite.tcfg
index 1752119..765c8e1 100644
--- a/c/src/lib/libbsp/sh/gensh1/make/custom/gensh1-testsuite.tcfg
+++ b/c/src/lib/libbsp/sh/gensh1/make/custom/gensh1-testsuite.tcfg
@@ -5,4 +5,5 @@
 #
 
 fsdosfsname01
+iostream
 utf8proc01
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 08/10] gensh2-testsuite.tcfg: Add iostream

2015-04-22 Thread Joel Sherrill
---
 c/src/lib/libbsp/sh/gensh2/make/custom/gensh2-testsuite.tcfg | 1 +
 1 file changed, 1 insertion(+)

diff --git a/c/src/lib/libbsp/sh/gensh2/make/custom/gensh2-testsuite.tcfg 
b/c/src/lib/libbsp/sh/gensh2/make/custom/gensh2-testsuite.tcfg
index 7e0652a..c54b420 100644
--- a/c/src/lib/libbsp/sh/gensh2/make/custom/gensh2-testsuite.tcfg
+++ b/c/src/lib/libbsp/sh/gensh2/make/custom/gensh2-testsuite.tcfg
@@ -5,4 +5,5 @@
 #
 
 fsdosfsname01
+iostream
 utf8proc01
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 09/10] simsh*.tcfg: Add iostream

2015-04-22 Thread Joel Sherrill
---
 c/src/lib/libbsp/sh/shsim/make/custom/simsh1-testsuite.tcfg  | 1 +
 c/src/lib/libbsp/sh/shsim/make/custom/simsh2-testsuite.tcfg  | 1 +
 c/src/lib/libbsp/sh/shsim/make/custom/simsh2e-testsuite.tcfg | 1 +
 c/src/lib/libbsp/sh/shsim/make/custom/simsh4-testsuite.tcfg  | 1 +
 4 files changed, 4 insertions(+)

diff --git a/c/src/lib/libbsp/sh/shsim/make/custom/simsh1-testsuite.tcfg 
b/c/src/lib/libbsp/sh/shsim/make/custom/simsh1-testsuite.tcfg
index 002aa00..b83b7ee 100644
--- a/c/src/lib/libbsp/sh/shsim/make/custom/simsh1-testsuite.tcfg
+++ b/c/src/lib/libbsp/sh/shsim/make/custom/simsh1-testsuite.tcfg
@@ -8,4 +8,5 @@ include: testdata/require-tick-isr.tcfg
 include: testdata/disable-intrcritical-tests.tcfg
 
 fsdosfsname01
+iostream
 utf8proc01
diff --git a/c/src/lib/libbsp/sh/shsim/make/custom/simsh2-testsuite.tcfg 
b/c/src/lib/libbsp/sh/shsim/make/custom/simsh2-testsuite.tcfg
index 8501527..443a7a2 100644
--- a/c/src/lib/libbsp/sh/shsim/make/custom/simsh2-testsuite.tcfg
+++ b/c/src/lib/libbsp/sh/shsim/make/custom/simsh2-testsuite.tcfg
@@ -8,4 +8,5 @@ include: testdata/require-tick-isr.tcfg
 include: testdata/disable-intrcritical-tests.tcfg
 
 fsdosfsname01
+iostream
 utf8proc01
diff --git a/c/src/lib/libbsp/sh/shsim/make/custom/simsh2e-testsuite.tcfg 
b/c/src/lib/libbsp/sh/shsim/make/custom/simsh2e-testsuite.tcfg
index 96384db..33a87ea 100644
--- a/c/src/lib/libbsp/sh/shsim/make/custom/simsh2e-testsuite.tcfg
+++ b/c/src/lib/libbsp/sh/shsim/make/custom/simsh2e-testsuite.tcfg
@@ -7,4 +7,5 @@ include: testdata/require-tick-isr.tcfg
 include: testdata/disable-intrcritical-tests.tcfg
 
 fsdosfsname01
+iostream
 utf8proc01
diff --git a/c/src/lib/libbsp/sh/shsim/make/custom/simsh4-testsuite.tcfg 
b/c/src/lib/libbsp/sh/shsim/make/custom/simsh4-testsuite.tcfg
index 356b7d0..0113702 100644
--- a/c/src/lib/libbsp/sh/shsim/make/custom/simsh4-testsuite.tcfg
+++ b/c/src/lib/libbsp/sh/shsim/make/custom/simsh4-testsuite.tcfg
@@ -7,4 +7,5 @@ include: testdata/require-tick-isr.tcfg
 include: testdata/disable-intrcritical-tests.tcfg
 
 fsdosfsname01
+iostream
 utf8proc01
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Make 4.11 Branch Next Monday?

2015-04-22 Thread Joel Sherrill
Hi

I want to branch early next week. That should give Chris time to get back
up to speed from his holiday and everyone else a chance to make final
testing and pushes. Please don't break anything.

I just posted a handful of patches that my build of all BSPs with networking
and TCP/IP enabled pointed out the need for. I still haven't reviewed my
test
run on all gdb and qemu simulator BSPs. That needs a review but watching
on and off as they ran, I didn't see any blockers. The issues I know of are:

Biggest issues:
+ xilinx BSP does not run on qemu for me. qemu doesn't build on Centos 6
and the one I built on a recent Fedora worked for every BSP except xilinx.
+ review of getting started docs
+ release procedure. We will just have to fight through this.

Let it slide issues:
+ nios2, or1k, and lm32 can't link C++ samples.
+ still no moxie tools

Any thoughts or comments?

-- 
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherr...@oarcorp.comOn-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available(256) 722-9985

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 10/10] sp13/system.h: Account for all message buffers

2015-04-22 Thread Joel Sherrill
There may be a way to reduce the memory requirements but it
will require time to ensure the math is right and it passes
on all targets. At the current time, it fails on 22 BSPs which
run on simulators.
---
 testsuites/sptests/sp13/system.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testsuites/sptests/sp13/system.h b/testsuites/sptests/sp13/system.h
index f879096..20ecc2f 100644
--- a/testsuites/sptests/sp13/system.h
+++ b/testsuites/sptests/sp13/system.h
@@ -90,10 +90,10 @@ TEST_EXTERN rtems_name Queue_name[ 4 ];  /* array of 
queue names */
  */
 #define CONFIGURE_MESSAGE_BUFFER_MEMORY \
/* Q1 */ CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( 100, MESSAGE_SIZE ) + \
-   /* Q2 */ /* CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( 10, MESSAGE_SIZE ) + */ \
+   /* Q2 */ CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( 10, MESSAGE_SIZE ) + \
/* Q3 */ CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( 100, MESSAGE_SIZE ) + \
/* Q1 */ CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( 100, 20 ) + \
-   /* Q1 */ /* CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( 2,  1030 ) */
+   /* Q1 */ CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( 2,  1030 )
 
 #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE)
 
-- 
1.9.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: Connecting a proprietary device to a filesystem

2015-04-22 Thread Spam Bucket

This is very helpful.

Thank you!


On 20-Apr-15 11:23 PM, Sebastian Huber wrote:

Hello Spam Bucket,

please have a look at:

https://docs.rtems.org/doxygen/cpukit/html/group__JFFS2.html

https://git.rtems.org/rtems/tree/testsuites/fstests/jffs2_support/fs_support.c




___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


RTEMS Fault Tolerance Project for SOCIS 2015

2015-04-22 Thread Saeed Ehteshamifar
Hi,

I'm interested to take part in development of RTEMS via fault tolerance

project. I've read the wiki page for the project, the page for open projects
, and the page for GSoC
 and GSoC getting started
. I've also skimmed RTEMS
4.5.0 evaluation report

.

I also have the experience of using RTEMS for 14 months as part of a
research team during 05.12 - 07.13.

My idea is to apply an extended tool based on CMU's Ballista
 to generate test cases for
injecting faults (RTEMS C programs). However I've 2 basic questions:
1. What is the scope of this SOCIS project? Should it include all the
scopes as written in the evaluation report (i.e. RTEMS Executive Core,
RTEMS Classic API, POSIX, Robustness, and Stress Testing)? Or it could be
narrowed down?
2. Of course source codes, documentation, and the tests output should be
included in the final result but what about an analysis on tests output?
should that be included as well?

Thanks in advance, for your time and attention.

Kind Regards,
SAeeD
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: RTEMS Fault Tolerance Project for SOCIS 2015

2015-04-22 Thread Gedare Bloom
On Wed, Apr 22, 2015 at 2:15 PM, Saeed Ehteshamifar
 wrote:
> Hi,
>
> I'm interested to take part in development of RTEMS via fault tolerance
> project. I've read the wiki page for the project, the page for open
> projects, and the page for GSoC and GSoC getting started. I've also skimmed
> RTEMS 4.5.0 evaluation report.
>
Make sure you complete the hello world requirements.

> I also have the experience of using RTEMS for 14 months as part of a
> research team during 05.12 - 07.13.
>
> My idea is to apply an extended tool based on CMU's Ballista to generate
> test cases for injecting faults (RTEMS C programs). However I've 2 basic
> questions:
> 1. What is the scope of this SOCIS project? Should it include all the scopes
> as written in the evaluation report (i.e. RTEMS Executive Core, RTEMS
> Classic API, POSIX, Robustness, and Stress Testing)? Or it could be narrowed
> down?
You should narrow it down to be feasible during the program duration (3 months?)

> 2. Of course source codes, documentation, and the tests output should be
> included in the final result but what about an analysis on tests output?
> should that be included as well?
>
Analysis or better yet tools for analysis would be useful.

> Thanks in advance, for your time and attention.
>
> Kind Regards,
> SAeeD
>
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] score: Delete Thread_queue_Control::state

2015-04-22 Thread Sebastian Huber

Use a parameter for _Thread_queue_Enqueue() instead to reduce memory
usage.
---
 cpukit/libfs/src/pipe/fifo.c   | 25 -
 cpukit/posix/src/condinit.c|  1 -
 cpukit/posix/src/condwaitsupp.c|  9 -
 cpukit/posix/src/psignal.c |  2 --
 cpukit/posix/src/pthread.c |  1 -
 cpukit/posix/src/pthreadjoin.c |  2 ++
 cpukit/posix/src/sigtimedwait.c|  7 ++-
 cpukit/rtems/src/regioncreate.c|  2 --
 cpukit/rtems/src/regiongetsegment.c|  2 ++
 cpukit/score/include/rtems/score/threadq.h |  4 
 cpukit/score/include/rtems/score/threadqimpl.h |  4 ++--
 cpukit/score/src/corebarrier.c |  2 --
 cpukit/score/src/corebarrierwait.c |  8 +++-
 cpukit/score/src/coremsg.c |  2 --
 cpukit/score/src/coremsgseize.c|  8 +++-
 cpukit/score/src/coremsgsubmit.c   |  2 ++
 cpukit/score/src/coremutex.c   |  1 -
 cpukit/score/src/coremutexseize.c  |  8 +++-
 cpukit/score/src/corerwlock.c  |  2 --
 cpukit/score/src/corerwlockobtainread.c|  2 ++
 cpukit/score/src/corerwlockobtainwrite.c   |  2 ++
 cpukit/score/src/coresem.c |  2 --
 cpukit/score/src/coresemseize.c|  7 ++-
 cpukit/score/src/threadq.c |  2 --
 cpukit/score/src/threadqenqueue.c  |  5 +++--
 25 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/cpukit/libfs/src/pipe/fifo.c b/cpukit/libfs/src/pipe/fifo.c
index 91d95dc..76550dd 100644
--- a/cpukit/libfs/src/pipe/fifo.c
+++ b/cpukit/libfs/src/pipe/fifo.c
@@ -61,27 +61,6 @@ static rtems_id pipe_semaphore = RTEMS_ID_NONE;
 #define PIPE_WAKEUPWRITERS(_pipe) \
   do {uint32_t n; rtems_barrier_release(_pipe->writeBarrier, &n); } while(0)
 
-
-#ifdef RTEMS_POSIX_API
-#include 
-#include 
-
-/* Set barriers to be interruptible by signals. */
-static void pipe_interruptible(pipe_control_t *pipe)
-{
-  Objects_Locations  location;
-  Barrier_Control   *the_barrier;
-
-  the_barrier = _Barrier_Get(pipe->readBarrier, &location);
-  the_barrier->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL;
-  _Objects_Put( &the_barrier->Object );
-
-  the_barrier = _Barrier_Get(pipe->writeBarrier, &location);
-  the_barrier->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL;
-  _Objects_Put( &the_barrier->Object );
-}
-#endif
-
 /*
  * Alloc pipe control structure, buffer, and resources.
  * Called with pipe_semaphore held.
@@ -122,10 +101,6 @@ static int pipe_alloc(
 RTEMS_NO_PRIORITY, &pipe->Semaphore) != RTEMS_SUCCESSFUL)
 goto err_sem;
 
-#ifdef RTEMS_POSIX_API
-  pipe_interruptible(pipe);
-#endif
-
   *pipep = pipe;
   if (c ++ == 'z')
 c = 'a';
diff --git a/cpukit/posix/src/condinit.c b/cpukit/posix/src/condinit.c
index 81575f2..c1c14b8 100644
--- a/cpukit/posix/src/condinit.c
+++ b/cpukit/posix/src/condinit.c
@@ -65,7 +65,6 @@ int pthread_cond_init(
   _Thread_queue_Initialize(
 &the_cond->Wait_queue,
 THREAD_QUEUE_DISCIPLINE_FIFO,
-STATES_WAITING_FOR_CONDITION_VARIABLE | STATES_INTERRUPTIBLE_BY_SIGNAL,
 ETIMEDOUT
   );
 
diff --git a/cpukit/posix/src/condwaitsupp.c b/cpukit/posix/src/condwaitsupp.c
index 2a0b57f..1abdc42 100644
--- a/cpukit/posix/src/condwaitsupp.c
+++ b/cpukit/posix/src/condwaitsupp.c
@@ -23,6 +23,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -79,7 +80,13 @@ int _POSIX_Condition_variables_Wait_support(
 executing->Wait.queue   = &the_cond->Wait_queue;
 executing->Wait.id  = *cond;
 
-_Thread_queue_Enqueue( &the_cond->Wait_queue, executing, timeout );
+_Thread_queue_Enqueue(
+  &the_cond->Wait_queue,
+  executing,
+  STATES_WAITING_FOR_CONDITION_VARIABLE
+| STATES_INTERRUPTIBLE_BY_SIGNAL,
+  timeout
+);
 
 _Objects_Put( &the_cond->Object );
 
diff --git a/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c
index 0e2a018..eec4d95 100644
--- a/cpukit/posix/src/psignal.c
+++ b/cpukit/posix/src/psignal.c
@@ -24,7 +24,6 @@
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -194,7 +193,6 @@ void _POSIX_signals_Manager_Initialization(void)
   _Thread_queue_Initialize(
 &_POSIX_signals_Wait_queue,
 THREAD_QUEUE_DISCIPLINE_FIFO,
-STATES_WAITING_FOR_SIGNAL | STATES_INTERRUPTIBLE_BY_SIGNAL,
 EAGAIN
   );
 
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index 6b1e555..4d28de5 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -238,7 +238,6 @@ static bool _POSIX_Threads_Create_extension(
   _Thread_queue_Initialize(
 &api->Join_List,
 THREAD_QUEUE_DISCIPLINE_FIFO,
-STATES_WAITING_FOR_JOIN_AT_EXIT | STATES_INTERRUPTIBLE_BY_SIGNAL,
 0
   );
 
diff --gi

Re: [PATCH] score: Fix priority message queue insert

2015-04-22 Thread Sebastian Huber

- Gedare Bloom  schrieb:
> Joel,
> 
> On Tue, Apr 21, 2015 at 12:13 PM, Joel Sherrill
>  wrote:
> >
> >
> > On 4/21/2015 2:24 AM, Sebastian Huber wrote:
> >> Move the linear search into a critical section to avoid corruption due
> >> to higher priority interrupts.  The interrupt disable time depends now
> >> on the count of pending messages.
> >>
> >> Close #2328.
> >> ---
> >>  cpukit/score/include/rtems/score/coremsgimpl.h |  32 +--
> >>  cpukit/score/src/coremsginsert.c   | 113 
> >> +++--
> >>  2 files changed, 50 insertions(+), 95 deletions(-)
> 
> >> +#if defined(RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION)
> >> +  notify = the_message_queue->number_of_pending_messages == 0;
> >> +#endif
> > Add parentheses around expression to make it clear that is the intent.
> Our coding conventions say to avoid unnecessary parens. If you'd like
> to make some adjustment to the conventions please start a separate
> thread.

Ok, I tried to figure out if a

x = ( y = 0 );

triggers a warning which I thought was the reason for Joel to suggest them. It 
doesn't. So these parentheses are quite useless.  The testsuite would catch an 
accidential:

  notify = the_message_queue->number_of_pending_messages = 0;


-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Make 4.11 Branch Next Monday?

2015-04-22 Thread Chris Johns
On 23/04/2015 12:23 am, Joel Sherrill wrote:
> Hi
> 
> I want to branch early next week. That should give Chris time to get back
> up to speed from his holiday and everyone else a chance to make final
> testing and pushes. Please don't break anything.
> 

I am back and up to speed. I am happy to branch this Friday (your time).
So this means master is frozen ?

Amar are you able to guide us as this is the first time with git ?

Sebastian are you ok with your clean up stuff ?

> I just posted a handful of patches that my build of all BSPs with networking
> and TCP/IP enabled pointed out the need for. I still haven't reviewed my
> test
> run on all gdb and qemu simulator BSPs. That needs a review but watching
> on and off as they ran, I didn't see any blockers. The issues I know of are:
> 
> Biggest issues:
> + xilinx BSP does not run on qemu for me. qemu doesn't build on Centos 6
> and the one I built on a recent Fedora worked for every BSP except xilinx.

I will try and take a look.

> + review of getting started docs
> + release procedure. We will just have to fight through this.

Yeap.

> 
> Let it slide issues:
> + nios2, or1k, and lm32 can't link C++ samples.
> + still no moxie tools

Ok.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] score: Fix priority message queue insert

2015-04-22 Thread Chris Johns
On 23/04/2015 5:51 am, Sebastian Huber wrote:
> 
> - Gedare Bloom  schrieb:
>> Joel,
>>
>> On Tue, Apr 21, 2015 at 12:13 PM, Joel Sherrill
>>  wrote:
>>>
>>>
>>> On 4/21/2015 2:24 AM, Sebastian Huber wrote:
 Move the linear search into a critical section to avoid corruption due
 to higher priority interrupts.  The interrupt disable time depends now
 on the count of pending messages.

 Close #2328.
 ---
  cpukit/score/include/rtems/score/coremsgimpl.h |  32 +--
  cpukit/score/src/coremsginsert.c   | 113 
 +++--
  2 files changed, 50 insertions(+), 95 deletions(-)
>>
 +#if defined(RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION)
 +  notify = the_message_queue->number_of_pending_messages == 0;
 +#endif
>>> Add parentheses around expression to make it clear that is the intent.
>> Our coding conventions say to avoid unnecessary parens. If you'd like
>> to make some adjustment to the conventions please start a separate
>> thread.
> 
> Ok, I tried to figure out if a
> 
> x = ( y = 0 );
> 
> triggers a warning which I thought was the reason for Joel to suggest them. 
> It doesn't. So these parentheses are quite useless.  

I see this warning from time to time. It might vary for some weird gcc
reason.

I feel this question of removing unneeded parens should be reviewed. If
someone adds them we should leave them when within reason, i.e. x =
y; is silly. All coding standards issues should be viewed as
'within reason'. Plus there is a whole grey area when it comes to macros
where in general more is better.

This reduction is against a number of other parts where we encourage
more for clarity such as extra white space, vertical space and on a more
specific example this one:

 const char* p = NULL;
 p = malloc(100);
 if (p == NULL)
  

The (p == NULL) is redundant as (!p) and (p) is also acceptable. I do
not mind we code for (p == NULL) or (p != NULL) and I will not argue
otherwise and likewise if someone wishes to explicitly add parens within
reason I also accept that as ok. I will always prefer explicit over
implicit. I have better things to do with my aging brain cells than play
precedent magic in my head. :)

> The testsuite would catch an accidential:
> 
>   notify = the_message_queue->number_of_pending_messages = 0;
> 

I agree with the need to add parens in the '==' case. I would not notice ...

 notify = the_message_queue->number_of_pending_messages = 0;

but ...

 notify = (the_message_queue->number_of_pending_messages = 0);

does not look correct to me and so I would wonder about the missing '='.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] [RPI BSP] mailbox

2015-04-22 Thread Alan Cudmore
Hi Qiao,
Functionally, this code looks good to me. It builds without warnings for the Pi 
and Pi2, and I was able to make the calls to init the frame buffer on the Pi 
B+. 

When you did the frame buffer test, what was your MMU table entry for the 
mailbox/framebuffer?

Thanks,
Alan


> On Apr 19, 2015, at 3:17 PM, QIAO YANG  wrote:
> 
> Here is a modified patch for mailbox.  If there's still anything against the 
> convention, please point it out and I'll correct it immediately. The mailbox 
> implementation might also be needed by other rpi bsp developpers.
> 
> --
> 
> diff --git a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am 
> b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
> index c6133df..70bc01d 100644
> --- a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
> +++ b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
> @@ -43,6 +43,7 @@ include_bsp_HEADERS += ../shared/include/arm-release-id.h
>  include_bsp_HEADERS += include/irq.h
>  include_bsp_HEADERS += include/mmu.h
>  include_bsp_HEADERS += include/usart.h
> +include_bsp_HEADERS += include/mailbox.h
>  include_bsp_HEADERS += include/raspberrypi.h
>  
>  include_libcpu_HEADERS = ../../../libcpu/arm/shared/include/cache_.h \
> @@ -123,6 +124,9 @@ libbsp_a_SOURCES += misc/timer.c
>  
>  # I2C
>  
> +# Mailbox
> +libbsp_a_SOURCES += misc/mailbox.c
> +
>  # Cache
>  libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
>  libbsp_a_SOURCES += ../../../libcpu/arm/shared/include/cache_.h
> diff --git a/c/src/lib/libbsp/arm/raspberrypi/include/mailbox.h 
> b/c/src/lib/libbsp/arm/raspberrypi/include/mailbox.h
> new file mode 100644
> index 000..fa6a0c2
> --- /dev/null
> +++ b/c/src/lib/libbsp/arm/raspberrypi/include/mailbox.h
> @@ -0,0 +1,33 @@
> +/**
> + * @file
> + *
> + * @ingroup raspberrypi
> + *
> + * @brief mailbox support.
> + */
> +
> +/*
> + * Copyright (c) 2015 Yang Qiao
> + *
> + *  The license and distribution terms for this file may be
> + *  found in the file LICENSE in this distribution or at
> + *
> + *  http://www.rtems.org/license/LICENSE
> + *
> + */
> +
> +#ifndef LIBBSP_ARM_RASPBERRYPI_MAILBOX_H
> +#define LIBBSP_ARM_RASPBERRYPI_MAILBOX_H
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif /* __cplusplus */
> +
> +extern unsigned int  raspberrypi_mailbox_read(unsigned int channel);
> +extern void raspberrypi_mailbox_write(unsigned int channel, unsigned int 
> data);
> +
> +#ifdef __cplusplus
> +}
> +#endif /* __cplusplus */
> +
> +#endif  /* LIBBSP_ARM_RASPBERRYPI_MAILBOX_H */
> diff --git a/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h 
> b/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h
> index c33e22a..3240404 100644
> --- a/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h
> +++ b/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h
> @@ -208,6 +208,55 @@
>  
>  /** @} */
>  
> + /**
> + * @name Mailbox Registers
> + *
> + * @{
> + */
> +
> +#define BCM2835_MBOX_BASE (RPI_PERIPHERAL_BASE+0xB880)
> +
> +#define BCM2835_MBOX_PEEK (BCM2835_MBOX_BASE+0x10)
> +#define BCM2835_MBOX_READ (BCM2835_MBOX_BASE+0x00)
> +#define BCM2835_MBOX_WRITE (BCM2835_MBOX_BASE+0x20)
> +#define BCM2835_MBOX_STATUS (BCM2835_MBOX_BASE+0x18)
> +#define BCM2835_MBOX_SENDER (BCM2835_MBOX_BASE+0x14)
> +#define BCM2835_MBOX_CONFIG (BCM2835_MBOX_BASE+0x1C)
> +
> +#define BCM2835_MBOX_SUCCESS (BCM2835_MBOX_BASE+0x8000)
> +#define BCM2835_MBOX_FULL (BCM2835_MBOX_BASE+0x8000)
> +#define BCM2835_MBOX_EMPTY (BCM2835_MBOX_BASE+0x4000)
> +
> +/**
> +* @name Mailbox Channels
> +*
> +* @{
> +*/
> +
> +/* Power Manager channel */
> +#define BCM2835_MBOX_CHANNEL_PM 0
> +/* Framebuffer channel */
> +#define BCM2835_MBOX_CHANNEL_FB 1
> + /* Virtual UART channel */
> +#define BCM2835_MBOX_CHANNEL_VUART  2
> + /* VCHIQ channel */
> +#define BCM2835_MBOX_CHANNEL_VCHIQ  3
> + /* LEDs channel */
> +#define BCM2835_MBOX_CHANNEL_LED4
> + /* Button channel */
> +#define BCM2835_MBOX_CHANNEL_BUTTON 5
> + /* Touch screen channel */
> +#define BCM2835_MBOX_CHANNEL_TOUCHS 6
> +/* Property tags (ARM <-> VC) channel */
> +#define BCM2835_MBOX_CHANNEL_PROP_AVC   8
> + /* Property tags (VC <-> ARM) channel */
> +#define BCM2835_MBOX_CHANNEL_PROP_VCA   9
> +
> +/** @} */
> +
> +
> +/** @} */
> +
>  
>  /** @} */
>  
> diff --git a/c/src/lib/libbsp/arm/raspberrypi/misc/mailbox.c 
> b/c/src/lib/libbsp/arm/raspberrypi/misc/mailbox.c
> new file mode 100644
> index 000..2a63a41
> --- /dev/null
> +++ b/c/src/lib/libbsp/arm/raspberrypi/misc/mailbox.c
> @@ -0,0 +1,44 @@
> +/**
> + * @file
> + *
> + * @ingroup raspberrypi
> + *
> + * @brief mailbox support.
> + */
> +
> +/*
> + * Copyright (c) 2015 Yang Qiao
> + *
> + *  The license and distribution terms for this file may be
> + *  found in the file LICENSE in this distribution or at
> + *
> + *  http://www.rtems.org/license/LICENSE
> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +
> +unsigned int raspberrypi_mailbox_read (unsigned int c

Re: [PATCH] [RPI BSP] mailbox

2015-04-22 Thread Joel Sherrill


On 4/19/2015 2:17 PM, QIAO YANG wrote:
> Here is a modified patch for mailbox.  If there's still anything
> against the convention, please point it out and I'll correct it
> immediately. The mailbox implementation might also be needed by other
> rpi bsp developpers.
>
My understanding is that the mailbox is used to determine the board
version and memory size.

What did you use the mailbox for to test it?
> --
>
> diff --git a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
> b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
> index c6133df..70bc01d 100644
> --- a/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
> +++ b/c/src/lib/libbsp/arm/raspberrypi/Makefile.am
> @@ -43,6 +43,7 @@ include_bsp_HEADERS +=
> ../shared/include/arm-release-id.h
>  include_bsp_HEADERS += include/irq.h
>  include_bsp_HEADERS += include/mmu.h
>  include_bsp_HEADERS += include/usart.h
> +include_bsp_HEADERS += include/mailbox.h
>  include_bsp_HEADERS += include/raspberrypi.h
>  
>  include_libcpu_HEADERS = ../../../libcpu/arm/shared/include/cache_.h \
> @@ -123,6 +124,9 @@ libbsp_a_SOURCES += misc/timer.c
>  
>  # I2C
>  
> +# Mailbox
> +libbsp_a_SOURCES += misc/mailbox.c
> +
>  # Cache
>  libbsp_a_SOURCES += ../../../libcpu/shared/src/cache_manager.c
>  libbsp_a_SOURCES += ../../../libcpu/arm/shared/include/cache_.h
> diff --git a/c/src/lib/libbsp/arm/raspberrypi/include/mailbox.h
> b/c/src/lib/libbsp/arm/raspberrypi/include/mailbox.h
> new file mode 100644
> index 000..fa6a0c2
> --- /dev/null
> +++ b/c/src/lib/libbsp/arm/raspberrypi/include/mailbox.h
> @@ -0,0 +1,33 @@
> +/**
> + * @file
> + *
> + * @ingroup raspberrypi
> + *
> + * @brief mailbox support.
> + */
> +
> +/*
> + * Copyright (c) 2015 Yang Qiao
> + *
> + *  The license and distribution terms for this file may be
> + *  found in the file LICENSE in this distribution or at
> + *
> + *  http://www.rtems.org/license/LICENSE
> + *
> + */
> +
> +#ifndef LIBBSP_ARM_RASPBERRYPI_MAILBOX_H
> +#define LIBBSP_ARM_RASPBERRYPI_MAILBOX_H
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif /* __cplusplus */
> +
> +extern unsigned int  raspberrypi_mailbox_read(unsigned int channel);
> +extern void raspberrypi_mailbox_write(unsigned int channel, unsigned
> int data);
> +
> +#ifdef __cplusplus
> +}
> +#endif /* __cplusplus */
> +
> +#endif  /* LIBBSP_ARM_RASPBERRYPI_MAILBOX_H */
> diff --git a/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h
> b/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h
> index c33e22a..3240404 100644
> --- a/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h
> +++ b/c/src/lib/libbsp/arm/raspberrypi/include/raspberrypi.h
> @@ -208,6 +208,55 @@
>  
>  /** @} */
>  
> + /**
> + * @name Mailbox Registers
> + *
> + * @{
> + */
> +
> +#define BCM2835_MBOX_BASE (RPI_PERIPHERAL_BASE+0xB880)
> +
> +#define BCM2835_MBOX_PEEK (BCM2835_MBOX_BASE+0x10)
> +#define BCM2835_MBOX_READ (BCM2835_MBOX_BASE+0x00)
> +#define BCM2835_MBOX_WRITE (BCM2835_MBOX_BASE+0x20)
> +#define BCM2835_MBOX_STATUS (BCM2835_MBOX_BASE+0x18)
> +#define BCM2835_MBOX_SENDER (BCM2835_MBOX_BASE+0x14)
> +#define BCM2835_MBOX_CONFIG (BCM2835_MBOX_BASE+0x1C)
> +
> +#define BCM2835_MBOX_SUCCESS (BCM2835_MBOX_BASE+0x8000)
> +#define BCM2835_MBOX_FULL (BCM2835_MBOX_BASE+0x8000)
> +#define BCM2835_MBOX_EMPTY (BCM2835_MBOX_BASE+0x4000)
> +
> +/**
> +* @name Mailbox Channels
> +*
> +* @{
> +*/
> +
> +/* Power Manager channel */
> +#define BCM2835_MBOX_CHANNEL_PM 0
> +/* Framebuffer channel */
> +#define BCM2835_MBOX_CHANNEL_FB 1
> + /* Virtual UART channel */
> +#define BCM2835_MBOX_CHANNEL_VUART  2
> + /* VCHIQ channel */
> +#define BCM2835_MBOX_CHANNEL_VCHIQ  3
> + /* LEDs channel */
> +#define BCM2835_MBOX_CHANNEL_LED4
> + /* Button channel */
> +#define BCM2835_MBOX_CHANNEL_BUTTON 5
> + /* Touch screen channel */
> +#define BCM2835_MBOX_CHANNEL_TOUCHS 6
> +/* Property tags (ARM <-> VC) channel */
> +#define BCM2835_MBOX_CHANNEL_PROP_AVC   8
> + /* Property tags (VC <-> ARM) channel */
> +#define BCM2835_MBOX_CHANNEL_PROP_VCA   9
> +
> +/** @} */
> +
> +
> +/** @} */
> +
>  
>  /** @} */
>  
> diff --git a/c/src/lib/libbsp/arm/raspberrypi/misc/mailbox.c
> b/c/src/lib/libbsp/arm/raspberrypi/misc/mailbox.c
> new file mode 100644
> index 000..2a63a41
> --- /dev/null
> +++ b/c/src/lib/libbsp/arm/raspberrypi/misc/mailbox.c
> @@ -0,0 +1,44 @@
> +/**
> + * @file
> + *
> + * @ingroup raspberrypi
> + *
> + * @brief mailbox support.
> + */
> +
> +/*
> + * Copyright (c) 2015 Yang Qiao
> + *
> + *  The license and distribution terms for this file may be
> + *  found in the file LICENSE in this distribution or at
> + *
> + *  http://www.rtems.org/license/LICENSE
> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +
> +unsigned int raspberrypi_mailbox_read (unsigned int channel)
> +{
> +  unsigned int data;
> +  unsigned int read_channel;
> +
> +  while ( 1 )
> +  {
> +while (BCM2835_REG (BCM2835_MBOX_STATUS ) & BCM2835_MBOX_EM