Re: [PATCH v2] rtemstoolkit: Add unit testing for the python modules

2018-11-26 Thread Vijay Kumar Banerjee
On Mon, Nov 26, 2018, 1:27 PM Vijay Kumar Banerjee 
wrote:

> On Mon, Nov 26, 2018 at 06:28:33PM +1100, Chris Johns wrote:
> >
> > > On 26 Nov 2018, at 5:21 pm, Vijay Kumar Banerjee <
> vijaykumar9...@gmail.com> wrote:
> > > I'm getting the result Invalid while running hello.exe with rtems-test
> on leon3 (without coverage option)
> > > attaching the log.
> >
> > Can you please revert or not apply patch 1 and let me know what happens?
> I have a feeling the coverage Qemu may be the old or different settings.
> it works after reverting the first patch.
> >
> > Thanks
> > Chris
> >
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v2] rtemstoolkit: Add unit testing for the python modules

2018-11-26 Thread Chris Johns

> On 26 Nov 2018, at 6:57 pm, Vijay Kumar Banerjee  
> wrote:
> 
>> On Mon, Nov 26, 2018 at 06:28:33PM +1100, Chris Johns wrote:
>> 
>>> On 26 Nov 2018, at 5:21 pm, Vijay Kumar Banerjee  
>>> wrote:
>>> I'm getting the result Invalid while running hello.exe with rtems-test on 
>>> leon3 (without coverage option)
>>> attaching the log.
>> 
>> Can you please revert or not apply patch 1 and let me know what happens? I 
>> have a feeling the coverage Qemu may be the old or different settings. 
> it works after reverting the first patch.

Can you define ‘qemu_use_serial_console’ when coverage is enabled? Doing this 
will work with the coverage qemu. 

Chris

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

[PATCH] Remove rtems_cache_*_processor_set() functions

2018-11-26 Thread Sebastian Huber
The following rtems_cache_*_processor_set() cache manager API functions
are exotic, complex, very hard to use correctly, not used in the RTEMS
code base, and apparently unused by applications.

Close #3622.
---
 bsps/shared/cache/cacheimpl.h | 91 ---
 cpukit/include/rtems/rtems/cache.h| 79 --
 testsuites/smptests/smpcache01/init.c | 52 +++-
 3 files changed, 7 insertions(+), 215 deletions(-)

diff --git a/bsps/shared/cache/cacheimpl.h b/bsps/shared/cache/cacheimpl.h
index 7e9f863337..96dc3c0361 100644
--- a/bsps/shared/cache/cacheimpl.h
+++ b/bsps/shared/cache/cacheimpl.h
@@ -49,97 +49,6 @@
 #error "CPU_INSTRUCTION_CACHE_ALIGNMENT is greater than CPU_CACHE_LINE_BYTES"
 #endif
 
-#if defined(RTEMS_SMP)
-
-#include 
-
-typedef struct {
-  const void *addr;
-  size_t size;
-} smp_cache_area;
-
-#if defined(CPU_DATA_CACHE_ALIGNMENT)
-
-static void smp_cache_data_flush(void *arg)
-{
-  smp_cache_area *area = arg;
-
-  rtems_cache_flush_multiple_data_lines(area->addr, area->size);
-}
-
-static void smp_cache_data_inv(void *arg)
-{
-  smp_cache_area *area = arg;
-
-  rtems_cache_invalidate_multiple_data_lines(area->addr, area->size);
-}
-
-static void smp_cache_data_flush_all(void *arg)
-{
-  rtems_cache_flush_entire_data();
-}
-
-static void smp_cache_data_inv_all(void *arg)
-{
-  rtems_cache_invalidate_entire_data();
-}
-
-#endif /* defined(CPU_DATA_CACHE_ALIGNMENT) */
-
-void
-rtems_cache_flush_multiple_data_lines_processor_set(
-  const void *addr,
-  size_t size,
-  const size_t setsize,
-  const cpu_set_t *set
-)
-{
-#if defined(CPU_DATA_CACHE_ALIGNMENT)
-  smp_cache_area area = { addr, size };
-
-  _SMP_Multicast_action( setsize, set, smp_cache_data_flush, &area );
-#endif
-}
-
-void
-rtems_cache_invalidate_multiple_data_lines_processor_set(
-  const void *addr,
-  size_t size,
-  const size_t setsize,
-  const cpu_set_t *set
-)
-{
-#if defined(CPU_DATA_CACHE_ALIGNMENT)
-  smp_cache_area area = { addr, size };
-
-  _SMP_Multicast_action( setsize, set, smp_cache_data_inv, &area );
-#endif
-}
-
-void
-rtems_cache_flush_entire_data_processor_set(
-  const size_t setsize,
-  const cpu_set_t *set
-)
-{
-#if defined(CPU_DATA_CACHE_ALIGNMENT)
-  _SMP_Multicast_action( setsize, set, smp_cache_data_flush_all, NULL );
-#endif
-}
-
-void
-rtems_cache_invalidate_entire_data_processor_set(
-  const size_t setsize,
-  const cpu_set_t *set
-)
-{
-#if defined(CPU_DATA_CACHE_ALIGNMENT)
-  _SMP_Multicast_action( setsize, set, smp_cache_data_inv_all, NULL );
-#endif
-}
-
-#endif /* defined(RTEMS_SMP) */
-
 /*
  * THESE FUNCTIONS ONLY HAVE BODIES IF WE HAVE A DATA CACHE
  */
diff --git a/cpukit/include/rtems/rtems/cache.h 
b/cpukit/include/rtems/rtems/cache.h
index 16157b26e6..1e62c4270b 100644
--- a/cpukit/include/rtems/rtems/cache.h
+++ b/cpukit/include/rtems/rtems/cache.h
@@ -284,85 +284,6 @@ void rtems_cache_coherent_add_area(
   uintptr_t area_size
 );
 
-#if defined( RTEMS_SMP )
-
-/**
- * @brief Flushes multiple data cache lines for a set of processors
- *
- * Dirty cache lines covering the area are transferred to memory.
- * Depending on the cache implementation this may mark the lines as invalid.
- *
- * This operation should not be called from interrupt context.
- *
- * @param[in] addr The start address of the area to flush.
- * @param[in] size The size in bytes of the area to flush.
- * @param[in] setsize The size of the processor set.
- * @param[in] set The target processor set.
- */
-void rtems_cache_flush_multiple_data_lines_processor_set(
-  const void *addr,
-  size_t size,
-  const size_t setsize,
-  const cpu_set_t *set
-);
-
-/**
- * @brief Invalidates multiple data cache lines for a set of processors
- *
- * The cache lines covering the area are marked as invalid.  A later read
- * access in the area will load the data from memory.
- *
- * In case the area is not aligned on cache line boundaries, then this
- * operation may destroy unrelated data.
- *
- * This operation should not be called from interrupt context.
- *
- * @param[in] addr The start address of the area to invalidate.
- * @param[in] size The size in bytes of the area to invalidate.
- * @param[in] setsize The size of the processor set.
- * @param[in] set The target processor set.
- */
-void rtems_cache_invalidate_multiple_data_lines_processor_set(
-  const void *addr,
-  size_t size,
-  const size_t setsize,
-  const cpu_set_t *set
-);
-
-/**
- * @brief Flushes the entire data cache for a set of processors
- *
- * This operation should not be called from interrupt context.
- *
- * @see rtems_cache_flush_multiple_data_lines().
- *
- * @param[in] setsize The size of the processor set.
- * @param[in] set The target processor set.
- */
-void rtems_cache_flush_entire_data_processor_set(
-  const size_t setsize,
-  const cpu_set_t *set
-);
-
-/**
- * @brief Invalidates the entire cache for a set of processors
- *
- * This function is responsible for performing a 

[PATCH 2/7] score: Remove Objects_Information::is_string

2018-11-26 Thread Sebastian Huber
Use Objects_Information::name_length to store this information.

Update #3621.
---
 cpukit/include/rtems/score/objectimpl.h| 33 +---
 cpukit/posix/src/key.c |  3 +-
 cpukit/posix/src/mqueue.c  |  1 -
 cpukit/posix/src/psxsemaphore.c|  1 -
 cpukit/posix/src/ptimer.c  |  3 +-
 cpukit/posix/src/shm.c |  1 -
 cpukit/rtems/src/barrier.c |  3 +-
 cpukit/rtems/src/dpmem.c   |  3 +-
 cpukit/rtems/src/msg.c |  3 +-
 cpukit/rtems/src/part.c|  3 +-
 cpukit/rtems/src/ratemon.c |  3 +-
 cpukit/rtems/src/region.c  |  3 +-
 cpukit/rtems/src/rtemstimer.c  |  3 +-
 cpukit/rtems/src/sem.c |  3 +-
 cpukit/sapi/src/extension.c|  3 +-
 cpukit/score/src/objectgetnameasstring.c   |  2 +-
 cpukit/score/src/objectidtoname.c  |  2 +-
 cpukit/score/src/objectinitializeinformation.c |  4 +--
 cpukit/score/src/objectnamespaceremove.c   |  4 +--
 cpukit/score/src/objectnametoidstring.c|  2 +-
 cpukit/score/src/objectsetname.c   | 43 +-
 cpukit/score/src/thread.c  |  3 +-
 testsuites/psxtests/psxobj01/init.c|  1 -
 23 files changed, 62 insertions(+), 68 deletions(-)

diff --git a/cpukit/include/rtems/score/objectimpl.h 
b/cpukit/include/rtems/score/objectimpl.h
index 8934e24244..4141183176 100644
--- a/cpukit/include/rtems/score/objectimpl.h
+++ b/cpukit/include/rtems/score/objectimpl.h
@@ -132,14 +132,17 @@ typedef struct {
   Objects_Maximum   inactive;
   /** This is the number of objects in a block. */
   Objects_Maximum   allocation_size;
-  /** This is the maximum length of names. */
+  /**
+   * @brief This is the maximum length of names.
+   *
+   * A length of zero indicates that this object has a no string name
+   * (OBJECTS_NO_STRING_NAME).
+   */
   uint16_t  name_length;
   /** This field indicates the API of this object class. */
   uint8_t   the_api;
   /** This is the class of this object set. */
   uint8_t   the_class;
-  /** This is true if names are strings. */
-  bool  is_string;
   /** This is the true if unlimited objects in this class. */
   bool  auto_extend;
   /** This is the size in bytes of each object instance. */
@@ -225,14 +228,19 @@ void _Objects_Do_initialize_information(
   uint16_t the_class,
   uint32_t maximum,
   uint16_t size,
-  bool is_string,
-  uint32_t maximum_name_length
+  uint16_t maximum_name_length
 #if defined(RTEMS_MULTIPROCESSING)
   ,
   Objects_Thread_queue_Extract_callout extract
 #endif
 );
 
+/**
+ * @brief Constant for the object information string name length to indicate
+ * that this object class has no string names.
+ */
+#define OBJECTS_NO_STRING_NAME 0
+
 /**
  *  @brief Initialize object Information
  *
@@ -261,7 +269,6 @@ void _Objects_Do_initialize_information(
 the_class, \
 maximum, \
 size, \
-is_string, \
 maximum_name_length, \
 extract \
   ) \
@@ -271,7 +278,6 @@ void _Objects_Do_initialize_information(
   the_class, \
   maximum, \
   size, \
-  is_string, \
   maximum_name_length, \
   extract \
 )
@@ -282,7 +288,6 @@ void _Objects_Do_initialize_information(
 the_class, \
 maximum, \
 size, \
-is_string, \
 maximum_name_length, \
 extract \
   ) \
@@ -292,7 +297,6 @@ void _Objects_Do_initialize_information(
   the_class, \
   maximum, \
   size, \
-  is_string, \
   maximum_name_length \
 )
 #endif
@@ -735,6 +739,13 @@ Objects_Maximum _Objects_Active_count(
   const Objects_Information *information
 );
 
+RTEMS_INLINE_ROUTINE bool _Objects_Has_string_name(
+  const Objects_Information *information
+)
+{
+  return information->name_length > 0;
+}
+
 RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Extend_size(
   const Objects_Information *information
 )
@@ -919,7 +930,7 @@ RTEMS_INLINE_ROUTINE void _Objects_Open_u32(
   uint32_t   name
 )
 {
-  _Assert( !information->is_string );
+  _Assert( !_Objects_Has_string_name( information ) );
   the_object->name.name_u32 = name;
 
   _Objects_Set_local_object(
@@ -943,7 +954,7 @@ RTEMS_INLINE_ROUTINE void _Objects_Open_string(
   const char*name
 )
 {
-  _Assert( information->is_string );
+  _Assert( _Objects_Has_string_name( information ) );
   the_object->name.name_p = name;
 
   _Objects_Set_local_object(
diff --git a/cpukit/posix/src/key.c b/cpukit/posix/src/key.c
index 71c202926e..a39e8d6479 100644
--- a/cpukit/posix/src/key.c
+++ b/cpukit/posix/src/key.c
@@ -142,8 +142,7 @@ static void _POSIX_Keys_Manager_initialization(void)
 /* 

[PATCH 6/7] score: Remove Objects_Information::maximum

2018-11-26 Thread Sebastian Huber
This information is already present in Objects_Information::maximum_id.
Add and use _Objects_Get_maximum_index().

Update #3621.
---
 cpukit/include/rtems/score/objectimpl.h| 18 +--
 cpukit/posix/src/killinfo.c|  2 +-
 cpukit/rtems/src/rtemsobjectgetclassinfo.c |  2 +-
 cpukit/score/src/objectactivecount.c   | 11 ++--
 cpukit/score/src/objectextendinformation.c | 20 +++
 cpukit/score/src/objectgetinfo.c   |  2 +-
 cpukit/score/src/objectgetnext.c   | 22 
 cpukit/score/src/objectinitializeinformation.c | 17 ++
 cpukit/score/src/objectnametoid.c  |  6 ++-
 cpukit/score/src/objectnametoidstring.c| 11 ++--
 cpukit/score/src/objectshrinkinformation.c |  2 +-
 cpukit/score/src/threaditerate.c   |  9 ++--
 testsuites/sptests/spsysinit01/init.c  | 72 ++
 13 files changed, 105 insertions(+), 89 deletions(-)

diff --git a/cpukit/include/rtems/score/objectimpl.h 
b/cpukit/include/rtems/score/objectimpl.h
index a516e21c65..cf670b9c98 100644
--- a/cpukit/include/rtems/score/objectimpl.h
+++ b/cpukit/include/rtems/score/objectimpl.h
@@ -124,8 +124,6 @@ typedef struct {
   Objects_Idmaximum_id;
   /** This points to the table of local objects. */
   Objects_Control **local_table;
-  /** This is the maximum number of objects in this class. */
-  Objects_Maximum   maximum;
   /** This is the number of objects on the Inactive list. */
   Objects_Maximum   inactive;
   /** This is the number of objects in a block. */
@@ -850,6 +848,20 @@ RTEMS_INLINE_ROUTINE Objects_Id _Objects_Get_minimum_id( 
Objects_Id id )
   return id;
 }
 
+/**
+ * Returns the maximum index of the specified object class.
+ *
+ * @param[in] information The object information.
+ *
+ * @return The maximum index of the specified object class.
+ */
+RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Get_maximum_index(
+  const Objects_Information *information
+)
+{
+  return _Objects_Get_index( information->maximum_id );
+}
+
 /**
  * This function sets the pointer to the local_table object
  * referenced by the index.
@@ -876,7 +888,7 @@ RTEMS_INLINE_ROUTINE void _Objects_Set_local_object(
*  occur in normal situations.
*/
   _Assert( index >= OBJECTS_INDEX_MINIMUM );
-  _Assert( index <= information->maximum );
+  _Assert( index <= _Objects_Get_maximum_index( information ) );
 
   information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object;
 }
diff --git a/cpukit/posix/src/killinfo.c b/cpukit/posix/src/killinfo.c
index cabd91c700..0031b7bdd8 100644
--- a/cpukit/posix/src/killinfo.c
+++ b/cpukit/posix/src/killinfo.c
@@ -207,7 +207,7 @@ int _POSIX_signals_Send(
 if ( !the_info )
   continue;
 
-maximum = the_info->maximum;
+maximum = _Objects_Get_maximum_index( the_info );
 object_table = the_info->local_table;
 
 for ( index = 0 ; index < maximum ; ++index ) {
diff --git a/cpukit/rtems/src/rtemsobjectgetclassinfo.c 
b/cpukit/rtems/src/rtemsobjectgetclassinfo.c
index 3ebe3535f5..a2b07e36ea 100644
--- a/cpukit/rtems/src/rtemsobjectgetclassinfo.c
+++ b/cpukit/rtems/src/rtemsobjectgetclassinfo.c
@@ -47,7 +47,7 @@ rtems_status_code rtems_object_get_class_information(
   info->minimum_id  = _Objects_Get_minimum_id( obj_info->maximum_id );
   info->maximum_id  = obj_info->maximum_id;
   info->auto_extend = obj_info->auto_extend;
-  info->maximum = obj_info->maximum;
+  info->maximum = _Objects_Get_maximum_index( obj_info );
 
   for ( unallocated=0, i=1 ; i <= info->maximum ; i++ )
 if ( !obj_info->local_table[i] )
diff --git a/cpukit/score/src/objectactivecount.c 
b/cpukit/score/src/objectactivecount.c
index 376820158a..d29ce0736d 100644
--- a/cpukit/score/src/objectactivecount.c
+++ b/cpukit/score/src/objectactivecount.c
@@ -24,13 +24,14 @@ Objects_Maximum _Objects_Active_count(
   const Objects_Information *information
 )
 {
-  size_t inactive;
-  size_t maximum;
+  Objects_Maximum inactive;
+  Objects_Maximum maximum;
 
   _Assert( _Objects_Allocator_is_owner() );
 
-  inactive = _Chain_Node_count_unprotected( &information->Inactive );
-  maximum  = information->maximum;
+  inactive = (Objects_Maximum)
+_Chain_Node_count_unprotected( &information->Inactive );
+  maximum  = _Objects_Get_maximum_index( information );
 
-  return (Objects_Maximum) ( maximum - inactive );
+  return maximum - inactive;
 }
diff --git a/cpukit/score/src/objectextendinformation.c 
b/cpukit/score/src/objectextendinformation.c
index a8346ce937..57ce6737ec 100644
--- a/cpukit/score/src/objectextendinformation.c
+++ b/cpukit/score/src/objectextendinformation.c
@@ -49,7 +49,8 @@ void _Objects_Extend_information(
   uint32_t  index_base;
   uint32_t  index_end;
   uint32_t  index;
-  uint32_t  maximum;
+  Objects_Maximum   old_maximum;
+  uint32_t  new_maximum;
   size_tobject_block_size;
   Objects_Control  *new_object_bloc

[PATCH 3/7] score: Rename Objects_Information::size

2018-11-26 Thread Sebastian Huber
Rename Objects_Information::size to Objects_Information::object_size.
Change its type from size_t to uint16_t and move it to reduce the size
of Objects_Information.

Update #3621.
---
 cpukit/include/rtems/score/objectimpl.h| 16 
 cpukit/score/src/objectallocate.c  |  2 +-
 cpukit/score/src/objectextendinformation.c |  4 ++--
 cpukit/score/src/objectinitializeinformation.c |  4 ++--
 cpukit/score/src/threadinitialize.c|  2 +-
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/cpukit/include/rtems/score/objectimpl.h 
b/cpukit/include/rtems/score/objectimpl.h
index 4141183176..3a64573f6b 100644
--- a/cpukit/include/rtems/score/objectimpl.h
+++ b/cpukit/include/rtems/score/objectimpl.h
@@ -132,6 +132,8 @@ typedef struct {
   Objects_Maximum   inactive;
   /** This is the number of objects in a block. */
   Objects_Maximum   allocation_size;
+  /** This is the size in bytes of each object instance. */
+  uint16_t  object_size;
   /**
* @brief This is the maximum length of names.
*
@@ -145,8 +147,6 @@ typedef struct {
   uint8_t   the_class;
   /** This is the true if unlimited objects in this class. */
   bool  auto_extend;
-  /** This is the size in bytes of each object instance. */
-  size_tsize;
   /** This is the chain of inactive control blocks. */
   Chain_Control Inactive;
   /** This is the number of inactive objects per block. */
@@ -227,7 +227,7 @@ void _Objects_Do_initialize_information(
   Objects_APIs the_api,
   uint16_t the_class,
   uint32_t maximum,
-  uint16_t size,
+  uint16_t object_size,
   uint16_t maximum_name_length
 #if defined(RTEMS_MULTIPROCESSING)
   ,
@@ -258,7 +258,7 @@ void _Objects_Do_initialize_information(
  * by this information block.  It is specific to @a the_api.
  *  @param[in] maximum is the maximum number of instances of this object
  * class which may be concurrently active.
- *  @param[in] size is the size of the data structure for this class.
+ *  @param[in] object_size is the size of the data structure for this class.
  *  @param[in] is_string is true if this object uses string style names.
  *  @param[in] maximum_name_length is the maximum length of object names.
  */
@@ -268,7 +268,7 @@ void _Objects_Do_initialize_information(
 the_api, \
 the_class, \
 maximum, \
-size, \
+object_size, \
 maximum_name_length, \
 extract \
   ) \
@@ -277,7 +277,7 @@ void _Objects_Do_initialize_information(
   the_api, \
   the_class, \
   maximum, \
-  size, \
+  object_size, \
   maximum_name_length, \
   extract \
 )
@@ -287,7 +287,7 @@ void _Objects_Do_initialize_information(
 the_api, \
 the_class, \
 maximum, \
-size, \
+object_size, \
 maximum_name_length, \
 extract \
   ) \
@@ -296,7 +296,7 @@ void _Objects_Do_initialize_information(
   the_api, \
   the_class, \
   maximum, \
-  size, \
+  object_size, \
   maximum_name_length \
 )
 #endif
diff --git a/cpukit/score/src/objectallocate.c 
b/cpukit/score/src/objectallocate.c
index e09c74c70c..97ced4bdf5 100644
--- a/cpukit/score/src/objectallocate.c
+++ b/cpukit/score/src/objectallocate.c
@@ -47,7 +47,7 @@ Objects_Control *_Objects_Allocate_unprotected(
*  should be all zeroed out because it is in the BSS.  So let's
*  check that code for this manager is even present.
*/
-  if ( information->size == 0 )
+  if ( information->object_size == 0 )
 return NULL;
 
   /*
diff --git a/cpukit/score/src/objectextendinformation.c 
b/cpukit/score/src/objectextendinformation.c
index d2ee7fdf8b..3fc9cdd464 100644
--- a/cpukit/score/src/objectextendinformation.c
+++ b/cpukit/score/src/objectextendinformation.c
@@ -100,7 +100,7 @@ void _Objects_Extend_information(
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
-  object_block_size = information->allocation_size * information->size;
+  object_block_size = information->allocation_size * information->object_size;
   if ( information->auto_extend ) {
 new_object_block = _Workspace_Allocate( object_block_size );
 if ( !new_object_block )
@@ -261,6 +261,6 @@ void _Objects_Extend_information(
 _Chain_Initialize_node( &the_object->Node );
 _Chain_Append_unprotected( &information->Inactive, &the_object->Node );
 
-the_object = _Addresses_Add_offset( the_object, information->size );
+the_object = _Addresses_Add_offset( the_object, information->object_size );
   }
 }
diff --git a/cpukit/score/src/objectinitializeinformation.c 
b/cpukit/score/src/objectinitializeinformation.c
index 2105c325d3..90f50d544c 100644
--- a/cpukit/score/src/objectinitializeinformation.c
+++ b/cpukit/score/src/objectinitializeinformation.c
@@ -29,7 +29,7 @@ 

[PATCH 1/7] score: Remove dead code

2018-11-26 Thread Sebastian Huber
Update #3621.
---
 cpukit/score/src/objectallocate.c | 16 
 1 file changed, 16 deletions(-)

diff --git a/cpukit/score/src/objectallocate.c 
b/cpukit/score/src/objectallocate.c
index 146b5d5976..e09c74c70c 100644
--- a/cpukit/score/src/objectallocate.c
+++ b/cpukit/score/src/objectallocate.c
@@ -23,12 +23,6 @@
 #include 
 #include 
 
-/* #define RTEMS_DEBUG_OBJECT_ALLOCATION */
-
-#if defined(RTEMS_DEBUG_OBJECT_ALLOCATION)
-#include 
-#endif
-
 static Objects_Control *_Objects_Get_inactive(
   Objects_Information *information
 )
@@ -85,16 +79,6 @@ Objects_Control *_Objects_Allocate_unprotected(
 }
   }
 
-#if defined(RTEMS_DEBUG_OBJECT_ALLOCATION)
-  if ( !the_object ) {
-printk(
-  "OBJECT ALLOCATION FAILURE! API/Class %d/%d\n",
-  information->the_api,
-  information->the_class
-);
-  }
-#endif
-
   return the_object;
 }
 
-- 
2.16.4

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


[PATCH 5/7] score: Optimize object lookup

2018-11-26 Thread Sebastian Huber
Use the maximum ID for the ID to object translation.  Using the maximum
ID gets rid of an additional load from the object information in
_Objects_Get().  In addition, object lookups fail for every ID in case
the object information is cleared to zero.  This makes it a bit more
robust during system startup (see new tests in spconfig02).

The local table no longer needs a NULL pointer entry at array index
zero.  Adjust all the object iteration loops accordingly.

Remove Objects_Information::minimum_id since it contains only redundant
information.  Add _Objects_Get_minimum_id() to get the minimum ID.

Update #3621.
---
 cpukit/include/rtems/score/objectimpl.h|  26 ++-
 cpukit/posix/src/killinfo.c|   2 +-
 cpukit/rtems/src/ratemonreportstatistics.c |  10 +-
 cpukit/rtems/src/ratemonresetall.c |  12 +-
 cpukit/rtems/src/rtemsobjectgetclassinfo.c |   2 +-
 cpukit/score/src/objectallocate.c  |   9 +-
 cpukit/score/src/objectextendinformation.c |  20 +--
 cpukit/score/src/objectfree.c  |   3 +-
 cpukit/score/src/objectgetlocal.c  |  24 ++-
 cpukit/score/src/objectgetnext.c   |   2 +-
 cpukit/score/src/objectgetnoprotection.c   |  19 +-
 cpukit/score/src/objectinitializeinformation.c |  17 +-
 cpukit/score/src/objectnametoid.c  |   4 +-
 cpukit/score/src/objectnametoidstring.c|   2 +-
 cpukit/score/src/objectshrinkinformation.c |  10 +-
 cpukit/score/src/threaditerate.c   |   2 +-
 testsuites/sptests/spconfig02/init.c   | 238 ++---
 17 files changed, 303 insertions(+), 99 deletions(-)

diff --git a/cpukit/include/rtems/score/objectimpl.h 
b/cpukit/include/rtems/score/objectimpl.h
index c3597c33ff..a516e21c65 100644
--- a/cpukit/include/rtems/score/objectimpl.h
+++ b/cpukit/include/rtems/score/objectimpl.h
@@ -120,8 +120,6 @@ typedef void ( *Objects_Thread_queue_Extract_callout )(
  *  manage each class of objects.
  */
 typedef struct {
-  /** This is the minimum valid id of this object class. */
-  Objects_Idminimum_id;
   /** This is the maximum valid id of this object class. */
   Objects_Idmaximum_id;
   /** This points to the table of local objects. */
@@ -191,6 +189,11 @@ extern uint16_t _Objects_Maximum_nodes;
 #define _Objects_Maximum_nodes 1
 #endif
 
+/**
+ * This is the minimum object ID index associated with an object.
+ */
+#define OBJECTS_INDEX_MINIMUM 1U
+
 /**
  *  The following is the list of information blocks per API for each object
  *  class.  From the ID, we can go to one of these information blocks,
@@ -831,6 +834,22 @@ RTEMS_INLINE_ROUTINE bool _Objects_Are_ids_equal(
   return ( left == right );
 }
 
+/**
+ * Returns the identifier with the minimum index for the specified identifier.
+ *
+ * The specified identifier must have valid API, class and node fields.
+ *
+ * @param[in] id The identifier to be processed.
+ *
+ * @return The corresponding ID with the minimum index.
+ */
+RTEMS_INLINE_ROUTINE Objects_Id _Objects_Get_minimum_id( Objects_Id id )
+{
+  id &= ~OBJECTS_INDEX_MASK;
+  id += (Objects_Id) OBJECTS_INDEX_MINIMUM << OBJECTS_INDEX_START_BIT;
+  return id;
+}
+
 /**
  * This function sets the pointer to the local_table object
  * referenced by the index.
@@ -856,9 +875,10 @@ RTEMS_INLINE_ROUTINE void _Objects_Set_local_object(
*  where the Id is known to be good.  Therefore, this should NOT
*  occur in normal situations.
*/
+  _Assert( index >= OBJECTS_INDEX_MINIMUM );
   _Assert( index <= information->maximum );
 
-  information->local_table[ index ] = the_object;
+  information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object;
 }
 
 /**
diff --git a/cpukit/posix/src/killinfo.c b/cpukit/posix/src/killinfo.c
index 6f45b29ec6..cabd91c700 100644
--- a/cpukit/posix/src/killinfo.c
+++ b/cpukit/posix/src/killinfo.c
@@ -210,7 +210,7 @@ int _POSIX_signals_Send(
 maximum = the_info->maximum;
 object_table = the_info->local_table;
 
-for ( index = 1 ; index <= maximum ; index++ ) {
+for ( index = 0 ; index < maximum ; ++index ) {
   the_thread = (Thread_Control *) object_table[ index ];
 
   if ( !the_thread )
diff --git a/cpukit/rtems/src/ratemonreportstatistics.c 
b/cpukit/rtems/src/ratemonreportstatistics.c
index 1f7542f8df..cf04a787e3 100644
--- a/cpukit/rtems/src/ratemonreportstatistics.c
+++ b/cpukit/rtems/src/ratemonreportstatistics.c
@@ -35,6 +35,7 @@ void rtems_rate_monotonic_report_statistics_with_plugin(
 )
 {
   rtems_status_code  status;
+  rtems_id   maximum_id;
   rtems_id   id;
   rtems_rate_monotonic_period_statistics the_stats;
   rtems_rate_monotonic_period_status the_status;
@@ -67,9 +68,12 @@ ididididid  c mm X
* Cycle through all possible ids and try to report on each one.  If it
* is a period that is inactive, we just get an error back.  No

[PATCH 4/7] score: Rename Objects_Information::allocation_size

2018-11-26 Thread Sebastian Huber
Rename Objects_Information::allocation_size in
Objects_Information::objects_per_block.  Adjust integer types in
_Objects_Shrink_information() and _Objects_Free().

Update #3621.
---
 cpukit/include/rtems/score/objectimpl.h|  4 +--
 cpukit/score/src/objectallocate.c  |  2 +-
 cpukit/score/src/objectextendinformation.c | 15 +--
 cpukit/score/src/objectfree.c  | 24 ++
 cpukit/score/src/objectinitializeinformation.c |  2 +-
 cpukit/score/src/objectshrinkinformation.c | 35 +++---
 6 files changed, 47 insertions(+), 35 deletions(-)

diff --git a/cpukit/include/rtems/score/objectimpl.h 
b/cpukit/include/rtems/score/objectimpl.h
index 3a64573f6b..c3597c33ff 100644
--- a/cpukit/include/rtems/score/objectimpl.h
+++ b/cpukit/include/rtems/score/objectimpl.h
@@ -131,7 +131,7 @@ typedef struct {
   /** This is the number of objects on the Inactive list. */
   Objects_Maximum   inactive;
   /** This is the number of objects in a block. */
-  Objects_Maximum   allocation_size;
+  Objects_Maximum   objects_per_block;
   /** This is the size in bytes of each object instance. */
   uint16_t  object_size;
   /**
@@ -750,7 +750,7 @@ RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Extend_size(
   const Objects_Information *information
 )
 {
-  return information->auto_extend ? information->allocation_size : 0;
+  return information->auto_extend ? information->objects_per_block : 0;
 }
 
 /**
diff --git a/cpukit/score/src/objectallocate.c 
b/cpukit/score/src/objectallocate.c
index 97ced4bdf5..81e322757c 100644
--- a/cpukit/score/src/objectallocate.c
+++ b/cpukit/score/src/objectallocate.c
@@ -72,7 +72,7 @@ Objects_Control *_Objects_Allocate_unprotected(
 
   block = (uint32_t) _Objects_Get_index( the_object->id ) -
   _Objects_Get_index( information->minimum_id );
-  block /= information->allocation_size;
+  block /= information->objects_per_block;
 
   information->inactive_per_block[ block ]--;
   information->inactive--;
diff --git a/cpukit/score/src/objectextendinformation.c 
b/cpukit/score/src/objectextendinformation.c
index 3fc9cdd464..b8e72f93b6 100644
--- a/cpukit/score/src/objectextendinformation.c
+++ b/cpukit/score/src/objectextendinformation.c
@@ -73,19 +73,19 @@ void _Objects_Extend_information(
   if ( information->object_blocks == NULL )
 block_count = 0;
   else {
-block_count = information->maximum / information->allocation_size;
+block_count = information->maximum / information->objects_per_block;
 
 for ( ; block < block_count; block++ ) {
   if ( information->object_blocks[ block ] == NULL ) {
 do_extend = false;
 break;
   } else
-index_base += information->allocation_size;
+index_base += information->objects_per_block;
 }
   }
-  index_end = index_base + information->allocation_size;
+  index_end = index_base + information->objects_per_block;
 
-  maximum = (uint32_t) information->maximum + information->allocation_size;
+  maximum = (uint32_t) information->maximum + information->objects_per_block;
 
   /*
*  We need to limit the number of objects to the maximum number
@@ -100,7 +100,8 @@ void _Objects_Extend_information(
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
-  object_block_size = information->allocation_size * information->object_size;
+  object_block_size = information->objects_per_block
+* information->object_size;
   if ( information->auto_extend ) {
 new_object_block = _Workspace_Allocate( object_block_size );
 if ( !new_object_block )
@@ -243,8 +244,8 @@ void _Objects_Extend_information(
*  Assign the new object block to the object block table.
*/
   information->object_blocks[ block ] = new_object_block;
-  information->inactive_per_block[ block ] = information->allocation_size;
-  information->inactive += information->allocation_size;
+  information->inactive_per_block[ block ] = information->objects_per_block;
+  information->inactive += information->objects_per_block;
 
   /*
*  Append to inactive chain.
diff --git a/cpukit/score/src/objectfree.c b/cpukit/score/src/objectfree.c
index 30ea1e36e5..3e7c8e409c 100644
--- a/cpukit/score/src/objectfree.c
+++ b/cpukit/score/src/objectfree.c
@@ -27,28 +27,32 @@ void _Objects_Free(
   Objects_Control *the_object
 )
 {
-  uint32_tallocation_size = information->allocation_size;
-
   _Assert( _Objects_Allocator_is_owner() );
 
   _Chain_Append_unprotected( &information->Inactive, &the_object->Node );
 
   if ( information->auto_extend ) {
-uint32_tblock;
+Objects_Maximum objects_per_block;
+Objects_Maximum block;
+Objects_Maximum inactive;
+
+objects_per_block = information->objects_per_block;
+block = _Objects_Get_index( the_object->id );
+block -= _Objects_Get_index( information->minimum_i

[PATCH 7/7] score: Remove Objects_Information::the_api

2018-11-26 Thread Sebastian Huber
Remove Objects_Information::the_class.  This information is already
contained in Objects_Information::maximum_id.

Update #3621.
---
 cpukit/include/rtems/score/objectimpl.h|  4 
 cpukit/score/src/objectextendinformation.c | 18 ++
 cpukit/score/src/objectinitializeinformation.c |  8 ++--
 3 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/cpukit/include/rtems/score/objectimpl.h 
b/cpukit/include/rtems/score/objectimpl.h
index cf670b9c98..e32533c8f3 100644
--- a/cpukit/include/rtems/score/objectimpl.h
+++ b/cpukit/include/rtems/score/objectimpl.h
@@ -137,10 +137,6 @@ typedef struct {
* (OBJECTS_NO_STRING_NAME).
*/
   uint16_t  name_length;
-  /** This field indicates the API of this object class. */
-  uint8_t   the_api;
-  /** This is the class of this object set. */
-  uint8_t   the_class;
   /** This is the true if unlimited objects in this class. */
   bool  auto_extend;
   /** This is the chain of inactive control blocks. */
diff --git a/cpukit/score/src/objectextendinformation.c 
b/cpukit/score/src/objectextendinformation.c
index 57ce6737ec..4e55bbc636 100644
--- a/cpukit/score/src/objectextendinformation.c
+++ b/cpukit/score/src/objectextendinformation.c
@@ -54,12 +54,14 @@ void _Objects_Extend_information(
   size_tobject_block_size;
   Objects_Control  *new_object_block;
   bool  do_extend;
+  Objects_Idapi_class_and_node;
 
   _Assert(
 _Objects_Allocator_is_owner()
   || !_System_state_Is_up( _System_state_Get() )
   );
 
+  api_class_and_node = information->maximum_id & ~OBJECTS_INDEX_MASK;
   old_maximum = _Objects_Get_maximum_index( information );
 
   /*
@@ -218,12 +220,8 @@ void _Objects_Extend_information(
 information->object_blocks = object_blocks;
 information->inactive_per_block = inactive_per_block;
 information->local_table = local_table;
-information->maximum_id = _Objects_Build_id(
-  information->the_api,
-  information->the_class,
-  _Objects_Local_node,
-  new_maximum
-);
+information->maximum_id = api_class_and_node
+  | (new_maximum << OBJECTS_INDEX_START_BIT);
 
 _ISR_lock_ISR_enable( &lock_context );
 
@@ -244,12 +242,8 @@ void _Objects_Extend_information(
*/
   the_object = new_object_block;
   for ( index = index_base ; index < index_end ; ++index ) {
-the_object->id = _Objects_Build_id(
-  information->the_api,
-  information->the_class,
-  _Objects_Local_node,
-  index + OBJECTS_INDEX_MINIMUM
-);
+the_object->id = api_class_and_node
+  | ( ( index + OBJECTS_INDEX_MINIMUM ) << OBJECTS_INDEX_START_BIT );
 
 _Chain_Initialize_node( &the_object->Node );
 _Chain_Append_unprotected( &information->Inactive, &the_object->Node );
diff --git a/cpukit/score/src/objectinitializeinformation.c 
b/cpukit/score/src/objectinitializeinformation.c
index c1327aece8..d51d5cfca6 100644
--- a/cpukit/score/src/objectinitializeinformation.c
+++ b/cpukit/score/src/objectinitializeinformation.c
@@ -39,8 +39,12 @@ void _Objects_Do_initialize_information(
 {
   Objects_Maximum maximum_per_allocation;
 
-  information->the_api = the_api;
-  information->the_class   = the_class;
+  information->maximum_id = _Objects_Build_id(
+the_api,
+the_class,
+_Objects_Local_node,
+0
+  );
   information->object_size = object_size;
 
   /*
-- 
2.16.4

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


Re: [PATCH v3] Add LICENSE.BSD-2-Clause

2018-11-26 Thread Sebastian Huber

On 23/11/2018 07:55, Sebastian Huber wrote:

Copied from:

https://spdx.org/licenses/BSD-2-Clause.html

The formatting is suitable for C/C++ source comments.

Update #3053.
---
  LICENSE.BSD-2-Clause | 39 +++
  1 file changed, 39 insertions(+)
  create mode 100644 LICENSE.BSD-2-Clause

diff --git a/LICENSE.BSD-2-Clause b/LICENSE.BSD-2-Clause
new file mode 100644
index 00..d19f31e646
--- /dev/null
+++ b/LICENSE.BSD-2-Clause
@@ -0,0 +1,39 @@
+https://spdx.org/licenses/BSD-2-Clause.html
+
+This license file serves as a template for the license header in files.
+
+You are the copyright holder.  Copy to comment below the top of the file in


There is a typo here. It should be "Copy the comment".

Apart from this typo, is this template all right? Chris, Gedare, Joel?

--
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

[PATCH] bsps/sparc: Add and use

2018-11-26 Thread Sebastian Huber
Reduce copy and paste.
---
 bsps/sparc/headers.am   |  1 +
 bsps/sparc/include/grlib-impl.h | 70 +
 bsps/sparc/shared/1553/gr1553bc.c   | 35 +--
 bsps/sparc/shared/1553/gr1553bm.c   | 36 +--
 bsps/sparc/shared/1553/gr1553rt.c   | 13 +-
 bsps/sparc/shared/amba/ahbstat.c| 24 --
 bsps/sparc/shared/can/grcan.c   | 26 +--
 bsps/sparc/shared/can/occan.c   | 12 +
 bsps/sparc/shared/net/greth.c   | 10 +
 bsps/sparc/shared/pci/gr_701.c  | 11 +
 bsps/sparc/shared/pci/gr_cpci_gr740.c   | 11 +
 bsps/sparc/shared/pci/gr_leon4_n2x.c| 11 +
 bsps/sparc/shared/pci/gr_rasta_adcdac.c | 11 +
 bsps/sparc/shared/pci/gr_rasta_io.c | 11 +
 bsps/sparc/shared/pci/gr_rasta_spw_router.c | 11 +
 bsps/sparc/shared/pci/gr_rasta_tmtc.c   | 11 +
 bsps/sparc/shared/pci/gr_tmtc_1553.c| 11 +
 bsps/sparc/shared/pci/grpci2.c  | 32 +
 bsps/sparc/shared/pci/grpci2dma.c   | 34 +-
 bsps/sparc/shared/spw/grspw_pkt.c   | 35 +--
 bsps/sparc/shared/spw/grspw_router.c| 53 +-
 bsps/sparc/shared/spw/spwtdp.c  | 33 +-
 bsps/sparc/shared/tmtc/grtc.c   | 15 +--
 bsps/sparc/shared/tmtc/grtm.c   | 10 +
 24 files changed, 105 insertions(+), 422 deletions(-)
 create mode 100644 bsps/sparc/include/grlib-impl.h

diff --git a/bsps/sparc/headers.am b/bsps/sparc/headers.am
index 4c6efb86ce..e09251613d 100644
--- a/bsps/sparc/headers.am
+++ b/bsps/sparc/headers.am
@@ -3,6 +3,7 @@
 include_HEADERS =
 include_HEADERS += ../../../../../bsps/sparc/include/ambapp.h
 include_HEADERS += ../../../../../bsps/sparc/include/ambapp_ids.h
+include_HEADERS += ../../../../../bsps/sparc/include/grlib-impl.h
 include_HEADERS += ../../../../../bsps/sparc/include/grlib.h
 
 include_bspdir = $(includedir)/bsp
diff --git a/bsps/sparc/include/grlib-impl.h b/bsps/sparc/include/grlib-impl.h
new file mode 100644
index 00..0bdf21ea9e
--- /dev/null
+++ b/bsps/sparc/include/grlib-impl.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2017 Cobham Gaisler AB
+ *
+ * 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 GRLIB_IMPL_H
+#define GRLIB_IMPL_H
+
+#include 
+
+/*
+ * Use interrupt lock primitives compatible with SMP defined in RTEMS 4.11.99
+ * and higher.
+ */
+#if (((__RTEMS_MAJOR__ << 16) | (__RTEMS_MINOR__ << 8) | __RTEMS_REVISION__) 
>= 0x040b63)
+
+#include 
+
+/* map via rtems_interrupt_lock_* API: */
+#define SPIN_DECLARE(lock) RTEMS_INTERRUPT_LOCK_MEMBER(lock)
+#define SPIN_INIT(lock, name) rtems_interrupt_lock_initialize(lock, name)
+#define SPIN_LOCK(lock, level) rtems_interrupt_lock_acquire_isr(lock, &level)
+#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_lock_acquire(lock, &level)
+#define SPIN_UNLOCK(lock, level) rtems_interrupt_lock_release_isr(lock, &level)
+#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_lock_release(lock, &level)
+#define SPIN_IRQFLAGS(k) rtems_interrupt_lock_context k
+#define SPIN_ISR_IRQFLAGS(k) SPIN_IRQFLAGS(k)
+#define SPIN_FREE(lock) rtems_interrupt_lock_destroy(lock)
+
+/* turn on/off local CPU's interrupt to ensure HW timing - not SMP safe. */
+#define IRQ_LOCAL_DECLARE(_level) rtems_interrupt_level _level
+#define IRQ_LOCAL_DISABLE(_level) rtems_interrupt_local_disable(_level)
+#define IRQ_LOCAL_ENABLE(_level) rtems_interrupt_local_enable(_level)
+
+#else
+
+#ifdef RTEMS_SMP
+#error SMP mode not compatible with these interrupt lock primitives
+#endif
+
+/* maintain single-core compatibility with older versions of RTEMS: */
+#define SPIN_DECLARE(name)
+#define SPIN_INIT(lock, name)
+#define SPIN_LOCK(lock, level)
+#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_disable(level)
+#define SPIN_UNLOCK(lock, level)
+#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_enable(level)
+#define SPIN_IRQFLAGS(k) rtems_interrupt_level k
+#define SPIN_ISR_IRQFLAGS(k)
+#define SPIN_FREE(lock)
+
+/* turn on/off local CPU's interrupt to ensure HW timing - not SMP safe. */
+#define IRQ_LOCAL_DECLARE(_level) rtems_interrupt_level _level
+#define IRQ_LOCAL_DISABLE(_level) rtems_interrupt_disable(_level)
+#define IRQ_LOCAL_ENABLE(_level) rtems_interrupt_enable(_level)
+
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRLIB_IMPL_H */
diff --git a/bsps/sparc/shared/1553/gr1553bc.c 
b/bsps/sparc/shared/1553/gr1553bc.c
index 3b967d0f37..a7dd890cbf 100644
--- a/bsps/sparc/shared/1553/gr1553bc.c
+++ b/bsps/sparc/shared/1553/gr1553bc.c
@@ -17,40 +17,7 @@
 #include 
 #include 
 
-/* Use interrupt lock privmitives compatible with SMP defined in
- * RTEMS 4.11.99 and higher.
- */
-#if (((__RTEMS_

Re: [PATCH] bsps/sparc: Add and use

2018-11-26 Thread Daniel Hellstrom

Hi Sebastian,

Thanks for this! I haven't tried it out but it looks good to me.

Regards,
Daniel


On 2018-11-26 15:46, Sebastian Huber wrote:

Reduce copy and paste.
---
  bsps/sparc/headers.am   |  1 +
  bsps/sparc/include/grlib-impl.h | 70 +
  bsps/sparc/shared/1553/gr1553bc.c   | 35 +--
  bsps/sparc/shared/1553/gr1553bm.c   | 36 +--
  bsps/sparc/shared/1553/gr1553rt.c   | 13 +-
  bsps/sparc/shared/amba/ahbstat.c| 24 --
  bsps/sparc/shared/can/grcan.c   | 26 +--
  bsps/sparc/shared/can/occan.c   | 12 +
  bsps/sparc/shared/net/greth.c   | 10 +
  bsps/sparc/shared/pci/gr_701.c  | 11 +
  bsps/sparc/shared/pci/gr_cpci_gr740.c   | 11 +
  bsps/sparc/shared/pci/gr_leon4_n2x.c| 11 +
  bsps/sparc/shared/pci/gr_rasta_adcdac.c | 11 +
  bsps/sparc/shared/pci/gr_rasta_io.c | 11 +
  bsps/sparc/shared/pci/gr_rasta_spw_router.c | 11 +
  bsps/sparc/shared/pci/gr_rasta_tmtc.c   | 11 +
  bsps/sparc/shared/pci/gr_tmtc_1553.c| 11 +
  bsps/sparc/shared/pci/grpci2.c  | 32 +
  bsps/sparc/shared/pci/grpci2dma.c   | 34 +-
  bsps/sparc/shared/spw/grspw_pkt.c   | 35 +--
  bsps/sparc/shared/spw/grspw_router.c| 53 +-
  bsps/sparc/shared/spw/spwtdp.c  | 33 +-
  bsps/sparc/shared/tmtc/grtc.c   | 15 +--
  bsps/sparc/shared/tmtc/grtm.c   | 10 +
  24 files changed, 105 insertions(+), 422 deletions(-)
  create mode 100644 bsps/sparc/include/grlib-impl.h

diff --git a/bsps/sparc/headers.am b/bsps/sparc/headers.am
index 4c6efb86ce..e09251613d 100644
--- a/bsps/sparc/headers.am
+++ b/bsps/sparc/headers.am
@@ -3,6 +3,7 @@
  include_HEADERS =
  include_HEADERS += ../../../../../bsps/sparc/include/ambapp.h
  include_HEADERS += ../../../../../bsps/sparc/include/ambapp_ids.h
+include_HEADERS += ../../../../../bsps/sparc/include/grlib-impl.h
  include_HEADERS += ../../../../../bsps/sparc/include/grlib.h
  
  include_bspdir = $(includedir)/bsp

diff --git a/bsps/sparc/include/grlib-impl.h b/bsps/sparc/include/grlib-impl.h
new file mode 100644
index 00..0bdf21ea9e
--- /dev/null
+++ b/bsps/sparc/include/grlib-impl.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2017 Cobham Gaisler AB
+ *
+ * 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 GRLIB_IMPL_H
+#define GRLIB_IMPL_H
+
+#include 
+
+/*
+ * Use interrupt lock primitives compatible with SMP defined in RTEMS 4.11.99
+ * and higher.
+ */
+#if (((__RTEMS_MAJOR__ << 16) | (__RTEMS_MINOR__ << 8) | __RTEMS_REVISION__) 
>= 0x040b63)
+
+#include 
+
+/* map via rtems_interrupt_lock_* API: */
+#define SPIN_DECLARE(lock) RTEMS_INTERRUPT_LOCK_MEMBER(lock)
+#define SPIN_INIT(lock, name) rtems_interrupt_lock_initialize(lock, name)
+#define SPIN_LOCK(lock, level) rtems_interrupt_lock_acquire_isr(lock, &level)
+#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_lock_acquire(lock, &level)
+#define SPIN_UNLOCK(lock, level) rtems_interrupt_lock_release_isr(lock, &level)
+#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_lock_release(lock, &level)
+#define SPIN_IRQFLAGS(k) rtems_interrupt_lock_context k
+#define SPIN_ISR_IRQFLAGS(k) SPIN_IRQFLAGS(k)
+#define SPIN_FREE(lock) rtems_interrupt_lock_destroy(lock)
+
+/* turn on/off local CPU's interrupt to ensure HW timing - not SMP safe. */
+#define IRQ_LOCAL_DECLARE(_level) rtems_interrupt_level _level
+#define IRQ_LOCAL_DISABLE(_level) rtems_interrupt_local_disable(_level)
+#define IRQ_LOCAL_ENABLE(_level) rtems_interrupt_local_enable(_level)
+
+#else
+
+#ifdef RTEMS_SMP
+#error SMP mode not compatible with these interrupt lock primitives
+#endif
+
+/* maintain single-core compatibility with older versions of RTEMS: */
+#define SPIN_DECLARE(name)
+#define SPIN_INIT(lock, name)
+#define SPIN_LOCK(lock, level)
+#define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_disable(level)
+#define SPIN_UNLOCK(lock, level)
+#define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_enable(level)
+#define SPIN_IRQFLAGS(k) rtems_interrupt_level k
+#define SPIN_ISR_IRQFLAGS(k)
+#define SPIN_FREE(lock)
+
+/* turn on/off local CPU's interrupt to ensure HW timing - not SMP safe. */
+#define IRQ_LOCAL_DECLARE(_level) rtems_interrupt_level _level
+#define IRQ_LOCAL_DISABLE(_level) rtems_interrupt_disable(_level)
+#define IRQ_LOCAL_ENABLE(_level) rtems_interrupt_enable(_level)
+
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRLIB_IMPL_H */
diff --git a/bsps/sparc/shared/1553/gr1553bc.c 
b/bsps/sparc/shared/1553/gr1553bc.c
index 3b967d0f37..a7dd890cbf 100644
--- a/bsps/sparc/shared/1553/gr1553bc.c
+++ b/bsps/sparc/share

Re: [PATCH v2] rtemstoolkit: Add unit testing for the python modules

2018-11-26 Thread Vijay Kumar Banerjee
On Mon, 26 Nov 2018 at 16:27, Chris Johns  wrote:

>
> > On 26 Nov 2018, at 6:57 pm, Vijay Kumar Banerjee <
> vijaykumar9...@gmail.com> wrote:
> >
> >> On Mon, Nov 26, 2018 at 06:28:33PM +1100, Chris Johns wrote:
> >>
> >>> On 26 Nov 2018, at 5:21 pm, Vijay Kumar Banerjee <
> vijaykumar9...@gmail.com> wrote:
> >>> I'm getting the result Invalid while running hello.exe with rtems-test
> on leon3 (without coverage option)
> >>> attaching the log.
> >>
> >> Can you please revert or not apply patch 1 and let me know what
> happens? I have a feeling the coverage Qemu may be the old or different
> settings.
> > it works after reverting the first patch.
>
> Can you define ‘qemu_use_serial_console’ when coverage is enabled? Doing
> this will work with the coverage qemu.
>
> . how to do that ?

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

Re: BSP for Microchip ATSAMA5D27-SOM1-EK1

2018-11-26 Thread dufault
It will be some work to update.  I believe what’s in the existing port is from 
this:
atmel-software-package-samv7:  Legacy software package for samv7, same70 and 
sams70 product families.
while the newest software that supports the ATSAMA5 is here, with a different 
directory layout.
atmel-software-package: Atmel Software Package

> On Nov 25, 2018, at 14:45 , Christian Mauderer  wrote:
> 
> Hello Peter,
> 
> Thomas mentioned already the bug that has been reported to Microchip.
> Please note that I had two more problems with the BSP on another
> customers board:
> 
> - The core clock couldn't be set to the maximum frequency from the data
> sheet. Both possible configurations for that frequency didn't work. The
> first one would have set the PLL to the same frequency as the CPU core
> clock. With that the system was not stable. The other setting (a divider
> of two after the PLL) seemed to work better but that forced me to set
> the PLL to a higher frequency than the data sheet specified. I ended up
> with the lower frequency.
> 
> - The external SDRAM seemed to introduce some jitter into the core PLL
> too (not only in the USB PLL which was the reason for the USB bug). With
> higher frequency configurations the system sometimes had an odd
> behaviour: A comparison went wrong when it should go well. Again that
> lead to a slightly lower frequency that seemed stable. So the board now
> runs on only about two thirds of the maximum frequency specified by
> Microchip.
> 
> If you still want to use the ATSAM chip: Microchip managed to get a
> better community around the libraries that are used in the BSP for that
> chip. There is a newer version of them somewhere on github. If there is
> funding for it, I would suggest to update the ones that are integrated
> in the ATSAM BSP by the newer ones. They contain quite some bug fixes.
> But it will need some work to do that.
> 
> With kind regards
> 
> Christian Mauderer
> 
> Am 25.11.18 um 19:42 schrieb dufa...@hda.com:
>> Thank you for the advice.  I will not need USB, but will need SDRAM and
>> don’t need poor support.  Microchip? You tried to push RTEMS for this
>> platform tied to space applications, are you monitoring this?  The
>> platform looks like just what I need but not if you’re not supporting it.
>> 
>>> On Nov 25, 2018, at 13:23 , Thomas Dörfler
>>> >> > wrote:
>>> 
>>> Peter,
>>> 
>>> just to make you aware: we designed a board with the ATSAMV7 chip and
>>> hit some nasty and at least one really ugly bug: operating the USB
>>> interface concurrently with external SDRAM does not work. Half a year
>>> after reporting this bug, Microchip confirmed it, but did not plan any
>>> fix for it. BTW: The conbination (USB+SDRAM) was also available on
>>> Microchip's evaluation board, but obviously was not tested together at
>>> Microchips labs...
>>> 
>>> So: I recommend you to tripple check, whether the ATSAMA5 meets all of
>>> your expectations.
>>> 
>>> 
>>> Kind regards,
>>> 
>>> Thomas.
>>> 
>>> - Ursprüngliche Mail -
>>> Von: "Peter Dufault" mailto:dufa...@hda.com>>
>>> An: "Development" mailto:devel@rtems.org>>
>>> Gesendet: Sonntag, 25. November 2018 18:38:19
>>> Betreff: BSP for Microchip ATSAMA5D27-SOM1-EK1
>>> 
>>> I need to evaluate this for a multi-chip application.
>>> 
>>> This part is a result of Microchip’s take-over of ATMEL.  I’m
>>> double-checking that to create a BSP based on this I should start with
>>> the existing ATSAMV7 BSP, I think the peripherals (e.g. network chip
>>> and so on) are the same as the existing ATSAMV7 port.
>>> 
>>> Peter
>>> -
>>> Peter Dufault
>>> HD Associates, Inc.  Software and System Engineering
>>> 
>>> This email is delivered through the public internet using protocols
>>> subject to interception and tampering.
>>> 
>>> ___
>>> devel mailing list
>>> devel@rtems.org 
>>> http://lists.rtems.org/mailman/listinfo/devel
>>> -- 
>>> -- 
>>> 
>>> embedded brains GmbH
>>> Thomas Doerfler
>>> Dornierstr. 4
>>> D-82178 Puchheim
>>> Germany
>>> email: thomas.doerf...@embedded-brains.de
>>> Phone: +49-89-18 94 741-12
>>> Fax:   +49-89-18 94 741-09
>>> PGP: Public key available on request.
>>> 
>>> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>> 
>> Peter
>> -
>> Peter Dufault
>> HD Associates, Inc.  Software and System Engineering
>> 
>> This email is delivered through the public internet using protocols
>> subject to interception and tampering.
>> 
>> 
>> ___
>> devel mailing list
>> devel@rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>> 
> 

Peter
-
Peter Dufault
HD Associates, Inc.  Software and System Engineering

This email is delivered through the public internet using protocols subject to 
interception and tampering.

Re: BSP for Microchip ATSAMA5D27-SOM1-EK1

2018-11-26 Thread Christian Mauderer
Hello Peter,

yes, that sounds about right. I'm not entirely sure about the name of
the file we used as a base back then. I would have to take a look at the
exact version at work.

I think the new software should be based on the "legacy" one so I would
expect that the interface is at least similar. But yes, it will be some
work to use the updated libraries. Especially because there are some
RTEMS-patches in the legacy libraries to work around some bugs.

Best regards

Christian

Am 26.11.18 um 18:37 schrieb dufa...@hda.com:
> It will be some work to update.  I believe what’s in the existing port
> is from this:
> atmel-software-package-samv7:  Legacy software package for samv7, same70
> and sams70 product families.
> while the newest software that supports the ATSAMA5 is here, with a
> different directory layout.
> atmel-software-package: Atmel Software Package
> 
>> On Nov 25, 2018, at 14:45 , Christian Mauderer > > wrote:
>>
>> Hello Peter,
>>
>> Thomas mentioned already the bug that has been reported to Microchip.
>> Please note that I had two more problems with the BSP on another
>> customers board:
>>
>> - The core clock couldn't be set to the maximum frequency from the data
>> sheet. Both possible configurations for that frequency didn't work. The
>> first one would have set the PLL to the same frequency as the CPU core
>> clock. With that the system was not stable. The other setting (a divider
>> of two after the PLL) seemed to work better but that forced me to set
>> the PLL to a higher frequency than the data sheet specified. I ended up
>> with the lower frequency.
>>
>> - The external SDRAM seemed to introduce some jitter into the core PLL
>> too (not only in the USB PLL which was the reason for the USB bug). With
>> higher frequency configurations the system sometimes had an odd
>> behaviour: A comparison went wrong when it should go well. Again that
>> lead to a slightly lower frequency that seemed stable. So the board now
>> runs on only about two thirds of the maximum frequency specified by
>> Microchip.
>>
>> If you still want to use the ATSAM chip: Microchip managed to get a
>> better community around the libraries that are used in the BSP for that
>> chip. There is a newer version of them somewhere on github. If there is
>> funding for it, I would suggest to update the ones that are integrated
>> in the ATSAM BSP by the newer ones. They contain quite some bug fixes.
>> But it will need some work to do that.
>>
>> With kind regards
>>
>> Christian Mauderer
>>
>> Am 25.11.18 um 19:42 schrieb dufa...@hda.com :
>>> Thank you for the advice.  I will not need USB, but will need SDRAM and
>>> don’t need poor support.  Microchip? You tried to push RTEMS for this
>>> platform tied to space applications, are you monitoring this?  The
>>> platform looks like just what I need but not if you’re not supporting it.
>>>
 On Nov 25, 2018, at 13:23 , Thomas Dörfler
 >>> 
 > wrote:

 Peter,

 just to make you aware: we designed a board with the ATSAMV7 chip and
 hit some nasty and at least one really ugly bug: operating the USB
 interface concurrently with external SDRAM does not work. Half a year
 after reporting this bug, Microchip confirmed it, but did not plan any
 fix for it. BTW: The conbination (USB+SDRAM) was also available on
 Microchip's evaluation board, but obviously was not tested together at
 Microchips labs...

 So: I recommend you to tripple check, whether the ATSAMA5 meets all of
 your expectations.


 Kind regards,

 Thomas.

 - Ursprüngliche Mail -
 Von: "Peter Dufault" mailto:dufa...@hda.com>
 >
 An: "Development" mailto:devel@rtems.org>
 >
 Gesendet: Sonntag, 25. November 2018 18:38:19
 Betreff: BSP for Microchip ATSAMA5D27-SOM1-EK1

 I need to evaluate this for a multi-chip application.

 This part is a result of Microchip’s take-over of ATMEL.  I’m
 double-checking that to create a BSP based on this I should start with
 the existing ATSAMV7 BSP, I think the peripherals (e.g. network chip
 and so on) are the same as the existing ATSAMV7 port.

 Peter
 -
 Peter Dufault
 HD Associates, Inc.  Software and System Engineering

 This email is delivered through the public internet using protocols
 subject to interception and tampering.

 ___
 devel mailing list
 devel@rtems.org  
 http://lists.rtems.org/mailman/listinfo/devel
 -- 
 -- 
 
 embedded brains GmbH
 Thomas Doerfler
 Dornierstr. 4
 D-82178 Puchheim
 Germany
 email

Re: BSP for Microchip ATSAMA5D27-SOM1-EK1

2018-11-26 Thread Joel Sherrill
On Mon, Nov 26, 2018, 1:10 PM Christian Mauderer  Hello Peter,
>
> yes, that sounds about right. I'm not entirely sure about the name of
> the file we used as a base back then. I would have to take a look at the
> exact version at work.
>
> I think the new software should be based on the "legacy" one so I would
> expect that the interface is at least similar. But yes, it will be some
> work to use the updated libraries. Especially because there are some
> RTEMS-patches in the legacy libraries to work around some bugs.
>

Was the original software committed unmodified? If so, then the changes to
fix bugs should be easy to find via git.

>
> Best regards
>
> Christian
>
> Am 26.11.18 um 18:37 schrieb dufa...@hda.com:
> > It will be some work to update.  I believe what’s in the existing port
> > is from this:
> > atmel-software-package-samv7:  Legacy software package for samv7, same70
> > and sams70 product families.
> > while the newest software that supports the ATSAMA5 is here, with a
> > different directory layout.
> > atmel-software-package: Atmel Software Package
> >
> >> On Nov 25, 2018, at 14:45 , Christian Mauderer  >> > wrote:
> >>
> >> Hello Peter,
> >>
> >> Thomas mentioned already the bug that has been reported to Microchip.
> >> Please note that I had two more problems with the BSP on another
> >> customers board:
> >>
> >> - The core clock couldn't be set to the maximum frequency from the data
> >> sheet. Both possible configurations for that frequency didn't work. The
> >> first one would have set the PLL to the same frequency as the CPU core
> >> clock. With that the system was not stable. The other setting (a divider
> >> of two after the PLL) seemed to work better but that forced me to set
> >> the PLL to a higher frequency than the data sheet specified. I ended up
> >> with the lower frequency.
> >>
> >> - The external SDRAM seemed to introduce some jitter into the core PLL
> >> too (not only in the USB PLL which was the reason for the USB bug). With
> >> higher frequency configurations the system sometimes had an odd
> >> behaviour: A comparison went wrong when it should go well. Again that
> >> lead to a slightly lower frequency that seemed stable. So the board now
> >> runs on only about two thirds of the maximum frequency specified by
> >> Microchip.
> >>
> >> If you still want to use the ATSAM chip: Microchip managed to get a
> >> better community around the libraries that are used in the BSP for that
> >> chip. There is a newer version of them somewhere on github. If there is
> >> funding for it, I would suggest to update the ones that are integrated
> >> in the ATSAM BSP by the newer ones. They contain quite some bug fixes.
> >> But it will need some work to do that.
> >>
> >> With kind regards
> >>
> >> Christian Mauderer
> >>
> >> Am 25.11.18 um 19:42 schrieb dufa...@hda.com :
> >>> Thank you for the advice.  I will not need USB, but will need SDRAM and
> >>> don’t need poor support.  Microchip? You tried to push RTEMS for this
> >>> platform tied to space applications, are you monitoring this?  The
> >>> platform looks like just what I need but not if you’re not supporting
> it.
> >>>
>  On Nov 25, 2018, at 13:23 , Thomas Dörfler
>    
>  > wrote:
> 
>  Peter,
> 
>  just to make you aware: we designed a board with the ATSAMV7 chip and
>  hit some nasty and at least one really ugly bug: operating the USB
>  interface concurrently with external SDRAM does not work. Half a year
>  after reporting this bug, Microchip confirmed it, but did not plan any
>  fix for it. BTW: The conbination (USB+SDRAM) was also available on
>  Microchip's evaluation board, but obviously was not tested together at
>  Microchips labs...
> 
>  So: I recommend you to tripple check, whether the ATSAMA5 meets all of
>  your expectations.
> 
> 
>  Kind regards,
> 
>  Thomas.
> 
>  - Ursprüngliche Mail -
>  Von: "Peter Dufault" mailto:dufa...@hda.com>
>  >
>  An: "Development" mailto:devel@rtems.org>
>  >
>  Gesendet: Sonntag, 25. November 2018 18:38:19
>  Betreff: BSP for Microchip ATSAMA5D27-SOM1-EK1
> 
>  I need to evaluate this for a multi-chip application.
> 
>  This part is a result of Microchip’s take-over of ATMEL.  I’m
>  double-checking that to create a BSP based on this I should start with
>  the existing ATSAMV7 BSP, I think the peripherals (e.g. network chip
>  and so on) are the same as the existing ATSAMV7 port.
> 
>  Peter
>  -
>  Peter Dufault
>  HD Associates, Inc.  Software and System Engineering
> 
>  This email is delivered through the public internet using protocols
>  subject to interception and tamperin

Re: BSP for Microchip ATSAMA5D27-SOM1-EK1

2018-11-26 Thread Christian Mauderer
Am 26.11.18 um 20:22 schrieb Joel Sherrill:
> 
> 
> On Mon, Nov 26, 2018, 1:10 PM Christian Mauderer   wrote:
> 
> Hello Peter,
> 
> yes, that sounds about right. I'm not entirely sure about the name of
> the file we used as a base back then. I would have to take a look at the
> exact version at work.
> 
> I think the new software should be based on the "legacy" one so I would
> expect that the interface is at least similar. But yes, it will be some
> work to use the updated libraries. Especially because there are some
> RTEMS-patches in the legacy libraries to work around some bugs.
> 
> 
> Was the original software committed unmodified? If so, then the changes
> to fix bugs should be easy to find via git.
> 

I haven't added the original files. That was most likely Alexander
Krutwig. But I assume that Sebastian had an eye on it that the original
files were unchanged in the first commit. If not, we still have the
original version that we used on some network folder and we could
provide it if necessary.

Git might have some problems with the file moves during the BSP
reorganization. But it should be able to handle that with some option (I
think --follow).

> 
> Best regards
> 
> Christian
> 
> Am 26.11.18 um 18:37 schrieb dufa...@hda.com :
> > It will be some work to update.  I believe what’s in the existing port
> > is from this:
> > atmel-software-package-samv7:  Legacy software package for samv7,
> same70
> > and sams70 product families.
> > while the newest software that supports the ATSAMA5 is here, with a
> > different directory layout.
> > atmel-software-package: Atmel Software Package
> >
> >> On Nov 25, 2018, at 14:45 , Christian Mauderer
> mailto:l...@c-mauderer.de>
> >> >> wrote:
> >>
> >> Hello Peter,
> >>
> >> Thomas mentioned already the bug that has been reported to Microchip.
> >> Please note that I had two more problems with the BSP on another
> >> customers board:
> >>
> >> - The core clock couldn't be set to the maximum frequency from
> the data
> >> sheet. Both possible configurations for that frequency didn't
> work. The
> >> first one would have set the PLL to the same frequency as the CPU
> core
> >> clock. With that the system was not stable. The other setting (a
> divider
> >> of two after the PLL) seemed to work better but that forced me to set
> >> the PLL to a higher frequency than the data sheet specified. I
> ended up
> >> with the lower frequency.
> >>
> >> - The external SDRAM seemed to introduce some jitter into the
> core PLL
> >> too (not only in the USB PLL which was the reason for the USB
> bug). With
> >> higher frequency configurations the system sometimes had an odd
> >> behaviour: A comparison went wrong when it should go well. Again that
> >> lead to a slightly lower frequency that seemed stable. So the
> board now
> >> runs on only about two thirds of the maximum frequency specified by
> >> Microchip.
> >>
> >> If you still want to use the ATSAM chip: Microchip managed to get a
> >> better community around the libraries that are used in the BSP
> for that
> >> chip. There is a newer version of them somewhere on github. If
> there is
> >> funding for it, I would suggest to update the ones that are
> integrated
> >> in the ATSAM BSP by the newer ones. They contain quite some bug
> fixes.
> >> But it will need some work to do that.
> >>
> >> With kind regards
> >>
> >> Christian Mauderer
> >>
> >> Am 25.11.18 um 19:42 schrieb dufa...@hda.com
>   >:
> >>> Thank you for the advice.  I will not need USB, but will need
> SDRAM and
> >>> don’t need poor support.  Microchip? You tried to push RTEMS for
> this
> >>> platform tied to space applications, are you monitoring this?  The
> >>> platform looks like just what I need but not if you’re not
> supporting it.
> >>>
>  On Nov 25, 2018, at 13:23 , Thomas Dörfler
>   
>   >
>   >> wrote:
> 
>  Peter,
> 
>  just to make you aware: we designed a board with the ATSAMV7
> chip and
>  hit some nasty and at least one really ugly bug: operating the USB
>  interface concurrently with external SDRAM does not work. Half
> a year
>  after reporting this bug, Microchip confirmed it, but did not
> plan any
>  fix for 

Re: [rtems-docs]Ticket #2562 solved , Release version guidelines added (GCI 2018)

2018-11-26 Thread Shashvat Jain
please push the change
thank you
Regards

--Shashvat

On Wed, Nov 21, 2018 at 11:10 PM Shashvat Jain 
wrote:

> Hello ,
> this is the updated patch with proper title and discription
> A new paragraph has been added In the quick start for assisting new users
> to build the correct and updated version. Command outputs to the example
> have also been trimmed and added .
> If everything looks good please commit it ,or inform me about the change
> to be made .
>
> Thank you
> Regards
>
> --Shashvat
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: Spike Fails to Build on CentOS 7 (Possible RSB Issue)

2018-11-26 Thread Joel Sherrill
On Tue, Nov 20, 2018 at 4:40 PM Chris Johns  wrote:

>
>
> On 21/11/2018 03:43, Joel Sherrill wrote:
> >
> >
> > On Fri, Nov 16, 2018 at 6:57 PM Chris Johns  > > wrote:
> >
> > On 17/11/18 1:45 am, Joel Sherrill wrote:
> > > Hi
> > >
> > > Hesham was nice enough to bump the Spike version in the RSB so
> others have a
> > > chance of using it to test RISC-V executables. Unfortunately, it
> now doesn't
> > > build for me. I am not sure if this is a
> > >
> > > ../source-builder/sb-set-builder --log=l-spike.txt
> > > --prefix=/home/joel/rtems-work/tools/5 devel/spike
> > > RTEMS Source Builder - Set Builder, 5 (69e07b57d5ab)
> > > Build Set: devel/spike
> > > config: devel/spike-1.1.0.cfg
> > > package: spike-1.1.0-x86_64-linux-gnu-1
> > > building: spike-1.1.0-x86_64-linux-gnu-1
> > > sizes: spike-1.1.0-x86_64-linux-gnu-1: 85.470MB (installed:
> 12.497MB)
> > > cleaning: spike-1.1.0-x86_64-linux-gnu-1
> > > reporting: devel/spike-1.1.0.cfg ->
> spike-1.1.0-x86_64-linux-gnu-1.txt
> > > reporting: devel/spike-1.1.0.cfg ->
> spike-1.1.0-x86_64-linux-gnu-1.xml
> > > installing: spike-1.1.0-x86_64-linux-gnu-1 ->
> /home/joel/rtems-work/tools/5
> > > error: copying tree (3):
> > >
> >
>  
> /data/home/joel/rtems-work/rtems-source-builder/bare/build/tmp/spike-1.1.0-x86_64-linux-gnu-1-joel/home/joel/rtems-work/tools/5/lib/pkgconfig/riscv-dummy_rocc.pc
> > > ->
> /home/joel/rtems-work/tools/5/lib/pkgconfig/riscv-dummy_rocc.pc: [Errno 13]
> > > Permission denied:
> > > u'/home/joel/rtems-work/tools/5/lib/pkgconfig/riscv-dummy_rocc.pc'
> >
> > What are the perms of the dest file?
> >
> >
> > $ ls -ial /home/joel/rtems-work/tools/5/lib/pkgconfig
> > total 28
> >  11005191 drwxr-xr-x. 2 joel joel  146 Nov 19 17:52 .
> > 822003261 drwxr-xr-x. 4 joel joel 4096 Nov 19 17:52 ..
> >  11005192 -rw-r--r--. 1 joel joel  306 Nov  9 21:18 expat.pc
> >  11046201 -r--r--r--. 1 joel joel  358 Nov  9 16:54 riscv-dummy_rocc.pc
> >  11004685 -r--r--r--. 1 joel joel  341 Nov 19 17:52 riscv-fesvr.pc
> >  11046200 -r--r--r--. 1 joel joel  324 Nov  9 16:54 riscv-riscv.pc
> >  11043504 -r--r--r--. 1 joel joel  349 Nov  9 16:54 riscv-softfloat.pc
> >  11043505 -r--r--r--. 1 joel joel  392 Nov  9 16:54 riscv-spike_main.pc
> >
> > Could this be something else? Another weird Python 2/3 thing?
> >
>
> What are the source file perms?
>

This is everything. Not sure where this goes wrong.

[joel@rtbf64c build]$ find . -name "riscv-*.pc" | xargs -e ls -l
-rw-r--r-- 1 joel users 341 Nov 26 15:26
./spike-1.1.0-x86_64-linux-gnu-1/riscv-fesvr-8d108a0a647901550d95925549337c2c3aec9ac8/riscv-fesvr.pc
-rw-r--r-- 1 joel users 358 Nov 26 15:26
./spike-1.1.0-x86_64-linux-gnu-1/riscv-isa-sim-01252686902fa30665fbecfc1476d169ad1333d1/riscv-dummy_rocc.pc
-rw-r--r-- 1 joel users 324 Nov 26 15:26
./spike-1.1.0-x86_64-linux-gnu-1/riscv-isa-sim-01252686902fa30665fbecfc1476d169ad1333d1/riscv-riscv.pc
-rw-r--r-- 1 joel users 349 Nov 26 15:26
./spike-1.1.0-x86_64-linux-gnu-1/riscv-isa-sim-01252686902fa30665fbecfc1476d169ad1333d1/riscv-softfloat.pc
-rw-r--r-- 1 joel users 392 Nov 26 15:26
./spike-1.1.0-x86_64-linux-gnu-1/riscv-isa-sim-01252686902fa30665fbecfc1476d169ad1333d1/riscv-spike_main.pc
-rw-r--r-- 1 joel users 325 Nov 26 15:26
./spike-1.1.0-x86_64-linux-gnu-1/riscv-isa-sim-01252686902fa30665fbecfc1476d169ad1333d1/riscv-spike.pc
-r--r--r-- 1 joel users 358 Nov 26 15:24
./tmp/sb-joel/devel/spike/home/joel/rtems-work/tools/5/lib/pkgconfig/riscv-dummy_rocc.pc
-r--r--r-- 1 joel users 324 Nov 26 15:24
./tmp/sb-joel/devel/spike/home/joel/rtems-work/tools/5/lib/pkgconfig/riscv-riscv.pc
-r--r--r-- 1 joel users 349 Nov 26 15:24
./tmp/sb-joel/devel/spike/home/joel/rtems-work/tools/5/lib/pkgconfig/riscv-softfloat.pc
-r--r--r-- 1 joel users 392 Nov 26 15:24
./tmp/sb-joel/devel/spike/home/joel/rtems-work/tools/5/lib/pkgconfig/riscv-spike_main.pc
-r--r--r-- 1 joel users 358 Nov 26 15:27
./tmp/spike-1.1.0-x86_64-linux-gnu-1-joel/home/joel/rtems-work/tools/5/lib/pkgconfig/riscv-dummy_rocc.pc
-r--r--r-- 1 joel users 324 Nov 26 15:27
./tmp/spike-1.1.0-x86_64-linux-gnu-1-joel/home/joel/rtems-work/tools/5/lib/pkgconfig/riscv-riscv.pc
-r--r--r-- 1 joel users 349 Nov 26 15:27
./tmp/spike-1.1.0-x86_64-linux-gnu-1-joel/home/joel/rtems-work/tools/5/lib/pkgconfig/riscv-softfloat.pc
-r--r--r-- 1 joel users 392 Nov 26 15:27
./tmp/spike-1.1.0-x86_64-linux-gnu-1-joel/home/joel/rtems-work/tools/5/lib/pkgconfig/riscv-spike_main.pc




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

Re: [PATCH 3/7] score: Rename Objects_Information::size

2018-11-26 Thread Chris Johns
On 27/11/2018 00:12, Sebastian Huber wrote:
> Rename Objects_Information::size to Objects_Information::object_size.
> Change its type from size_t to uint16_t and move it to reduce the size
> of Objects_Information.
> 
> Update #3621.

I have updated the ticket with some questions.

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


m68k/av5282:Add per-section compilation and linking support

2018-11-26 Thread Shashvat Jain
Hello,
I just enabled the per-function and per-data element section support for
the av5282 bsp in m68k architecture .
The patch for the change has been attached

Thank you
Regards

--Shashvat


0001-m68k-av5282-Add-per-section-compilation-and-linking-.patch
Description: Binary data
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v3] Add LICENSE.BSD-2-Clause

2018-11-26 Thread Chris Johns
On 27/11/2018 00:21, Sebastian Huber wrote:
> On 23/11/2018 07:55, Sebastian Huber wrote:
>> Copied from:
>>
>> https://spdx.org/licenses/BSD-2-Clause.html
>>
>> The formatting is suitable for C/C++ source comments.
>>
>> Update #3053.
>> ---
>>   LICENSE.BSD-2-Clause | 39 +++
>>   1 file changed, 39 insertions(+)
>>   create mode 100644 LICENSE.BSD-2-Clause
>>
>> diff --git a/LICENSE.BSD-2-Clause b/LICENSE.BSD-2-Clause
>> new file mode 100644
>> index 00..d19f31e646
>> --- /dev/null
>> +++ b/LICENSE.BSD-2-Clause
>> @@ -0,0 +1,39 @@
>> +https://spdx.org/licenses/BSD-2-Clause.html
>> +
>> +This license file serves as a template for the license header in files.
>> +
>> +You are the copyright holder.  Copy to comment below the top of the file in
> 
> There is a typo here. It should be "Copy the comment".

Nice catch.

> Apart from this typo, is this template all right? Chris, Gedare, Joel?

I am OK.

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

Re: [PATCH v2] rtemstoolkit: Add unit testing for the python modules

2018-11-26 Thread Chris Johns
On 27/11/2018 04:28, Vijay Kumar Banerjee wrote:
> On Mon, 26 Nov 2018 at 16:27, Chris Johns  > wrote:
> > On 26 Nov 2018, at 6:57 pm, Vijay Kumar Banerjee 
>  > wrote:
> >
> >> On Mon, Nov 26, 2018 at 06:28:33PM +1100, Chris Johns wrote:
> >>
> >>> On 26 Nov 2018, at 5:21 pm, Vijay Kumar Banerjee
> mailto:vijaykumar9...@gmail.com>> wrote:
> >>> I'm getting the result Invalid while running hello.exe with rtems-test
> on leon3 (without coverage option)
> >>> attaching the log.
> >>
> >> Can you please revert or not apply patch 1 and let me know what 
> happens?
> I have a feeling the coverage Qemu may be the old or different settings.
> > it works after reverting the first patch.
> 
> Can you define ‘qemu_use_serial_console’ when coverage is enabled? Doing
> this will work with the coverage qemu.
> 
> . how to do that ?  
> 

I would:

1. Define 'coverage' in tester/rt/coverage.py in 'macros_'. See macrocs.py for
the call https://git.rtems.org/rtems-tools/tree/rtemstoolkit/macros.py#n442.

2. In https://git.rtems.org/rtems-tools/tree/tester/rtems/testing/qemu.cfg#n61
move this logic up to line 51 and use something like:

 #
 # Coverage, some builds of qemu support coverage.
 #
 %ifdef coverage
  %define qemu_use_serial_console
  %ifn %{defined bsp_qemu_cov_opts}
   %define bsp_qemu_cov_opts %{nil}
  %endif
 %endif

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

Re: [PATCH] Coverage : install covoar in tester/bin

2018-11-26 Thread Chris Johns
Pushed.

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


Re: [PATCH 3/7] score: Rename Objects_Information::size

2018-11-26 Thread Sebastian Huber



On 27/11/2018 01:53, Chris Johns wrote:

On 27/11/2018 00:12, Sebastian Huber wrote:

Rename Objects_Information::size to Objects_Information::object_size.
Change its type from size_t to uint16_t and move it to reduce the size
of Objects_Information.

Update #3621.

I have updated the ticket with some questions.


This patch set is a preparation to make the static initialization 
simpler, but it is still useful on its own.


--
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 3/7] score: Rename Objects_Information::size

2018-11-26 Thread Chris Johns
On 27/11/18 4:57 pm, Sebastian Huber wrote:
> On 27/11/2018 01:53, Chris Johns wrote:
>> On 27/11/2018 00:12, Sebastian Huber wrote:
>>> Rename Objects_Information::size to Objects_Information::object_size.
>>> Change its type from size_t to uint16_t and move it to reduce the size
>>> of Objects_Information.
>>>
>>> Update #3621.
>> I have updated the ticket with some questions.
> 
> This patch set is a preparation to make the static initialization simpler, but
> it is still useful on its own.
> 

Sure, I just wanted to know what effect the changes have.

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


[PATCH] bsps/sparc: Add grlib_malloc(), grlib_calloc()

2018-11-26 Thread Sebastian Huber
This avoids a dependency to errno in device driver code.
---
 bsps/sparc/include/bsp/gr1553rt.h   |  2 +-
 bsps/sparc/include/grlib_impl.h | 27 +++
 bsps/sparc/shared/1553/b1553brm.c   | 11 ++-
 bsps/sparc/shared/1553/b1553rt.c|  9 +
 bsps/sparc/shared/1553/gr1553b.c| 10 ++
 bsps/sparc/shared/1553/gr1553bc.c   | 23 +++
 bsps/sparc/shared/1553/gr1553bm.c   |  5 ++---
 bsps/sparc/shared/1553/gr1553rt.c   | 21 +++--
 bsps/sparc/shared/amba/ambapp.c |  4 +++-
 bsps/sparc/shared/analog/gradcdac.c |  5 +++--
 bsps/sparc/shared/ascs/grascs.c |  6 --
 bsps/sparc/shared/btimer/gptimer.c  |  5 +++--
 bsps/sparc/shared/can/canmux.c  |  4 +++-
 bsps/sparc/shared/can/grcan.c   |  7 +++
 bsps/sparc/shared/can/occan.c   | 13 -
 bsps/sparc/shared/can/satcan.c  |  8 +---
 bsps/sparc/shared/drvmgr/ambapp_bus_grlib.c |  4 +++-
 bsps/sparc/shared/gpio/gpiolib.c|  5 +++--
 bsps/sparc/shared/gpio/grgpio.c |  4 ++--
 bsps/sparc/shared/i2c/i2cmst.c  |  5 +++--
 bsps/sparc/shared/iommu/griommu.c   |  4 +++-
 bsps/sparc/shared/irq/genirq.c  | 15 ---
 bsps/sparc/shared/mem/mctrl.c   |  5 +++--
 bsps/sparc/shared/net/greth.c   | 18 --
 bsps/sparc/shared/pci/gr_701.c  |  3 +--
 bsps/sparc/shared/pci/gr_rasta_adcdac.c |  3 +--
 bsps/sparc/shared/pci/gr_rasta_io.c |  3 +--
 bsps/sparc/shared/pci/gr_tmtc_1553.c|  3 +--
 bsps/sparc/shared/pci/grpci2dma.c   |  9 +++--
 bsps/sparc/shared/pwm/grpwm.c   |  7 ---
 bsps/sparc/shared/slink/grslink.c   | 12 +++-
 bsps/sparc/shared/spi/spictrl.c |  5 +++--
 bsps/sparc/shared/spw/grspw.c   | 15 +--
 bsps/sparc/shared/spw/grspw_pkt.c   | 11 ---
 bsps/sparc/shared/time/grctm.c  |  5 +++--
 bsps/sparc/shared/time/spwcuc.c |  7 ---
 bsps/sparc/shared/tmtc/grtc.c   |  5 ++---
 bsps/sparc/shared/tmtc/grtm.c   |  8 +++-
 38 files changed, 176 insertions(+), 140 deletions(-)

diff --git a/bsps/sparc/include/bsp/gr1553rt.h 
b/bsps/sparc/include/bsp/gr1553rt.h
index 55237b5dfd..5d52e84c11 100644
--- a/bsps/sparc/include/bsp/gr1553rt.h
+++ b/bsps/sparc/include/bsp/gr1553rt.h
@@ -74,7 +74,7 @@ struct gr1553rt_list {
/* !!Must be last in data structure!! 
 * !!Array must at least be of length bd_cnt!!
 */
-   unsigned short bds[1];  /* Array of BDIDs, -1 unused/end */
+   unsigned short bds[0];  /* Array of BDIDs */
 };
 
 /* GR1553B-RT Driver configuration options used when calling gr1553rt_config().
diff --git a/bsps/sparc/include/grlib_impl.h b/bsps/sparc/include/grlib_impl.h
index 2760c68626..755f635911 100644
--- a/bsps/sparc/include/grlib_impl.h
+++ b/bsps/sparc/include/grlib_impl.h
@@ -10,6 +10,7 @@
 #define GRLIB_IMPL_H
 
 #include 
+#include 
 
 /*
  * Use interrupt lock primitives compatible with SMP defined in RTEMS 4.11.99
@@ -63,6 +64,32 @@
 extern "C" {
 #endif
 
+#if (((__RTEMS_MAJOR__ << 16) | (__RTEMS_MINOR__ << 8) | __RTEMS_REVISION__) 
>= 0x05)
+
+RTEMS_INLINE_ROUTINE void *grlib_malloc(size_t size)
+{
+ return rtems_malloc(size);
+}
+
+RTEMS_INLINE_ROUTINE void *grlib_calloc(size_t nelem, size_t elsize)
+{
+ return rtems_calloc(nelem, elsize);
+}
+
+#else
+
+RTEMS_INLINE_ROUTINE void *grlib_malloc(size_t size)
+{
+ return malloc(size);
+}
+
+RTEMS_INLINE_ROUTINE void *grlib_calloc(size_t nelem, size_t elsize)
+{
+ return calloc(nelem, elsize);
+}
+
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/bsps/sparc/shared/1553/b1553brm.c 
b/bsps/sparc/shared/1553/b1553brm.c
index 8a5efaf9df..216397b334 100644
--- a/bsps/sparc/shared/1553/b1553brm.c
+++ b/bsps/sparc/shared/1553/b1553brm.c
@@ -31,6 +31,8 @@
 #include 
 #include 
 
+#include 
+
 /* Uncomment for debug output */
 /*#define DEBUG 1
 #define FUNCDEBUG 1*/
@@ -309,10 +311,9 @@ int b1553brm_init2(struct drvmgr_dev *dev)
brm_priv *priv;
 
DBG("B1553BRM[%d] on bus %s\n", dev->minor_drv, dev->parent->dev->name);
-   priv = dev->priv = malloc(sizeof(brm_priv));
+   priv = dev->priv = grlib_calloc(1, sizeof(*priv));
if ( !priv )
return DRVMGR_NOMEM;
-   memset(priv, 0, sizeof(*priv));
priv->dev = dev;
 
/* This core will not find other cores, so we wait for init2() */
@@ -472,7 +473,7 @@ int b1553brm_device_init(brm_priv *pDev)
/* Use dynamically allocated memory + 128k for
 * alignment
 */
-   mem = (unsigned int)malloc(size + 128 * 1024);
+   mem = (unsigned