[PATCH] rtems: Generate

2021-09-10 Thread Sebastian Huber
Remove the duplicated description which is an out dated copy and paste
from the Classic API Guide.  Instead, thoroughly document the individual
extensions.

Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
---
 cpukit/include/rtems/extension.h | 758 ---
 1 file changed, 583 insertions(+), 175 deletions(-)

diff --git a/cpukit/include/rtems/extension.h b/cpukit/include/rtems/extension.h
index 6f97ebe24c..ceb8eb9a1f 100644
--- a/cpukit/include/rtems/extension.h
+++ b/cpukit/include/rtems/extension.h
@@ -1,190 +1,311 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
 /**
  * @file
  *
  * @ingroup RTEMSImplClassicUserExt
  *
- * @brief User Extensions API.
+ * @brief This header file defines the User Extensions Manager API.
+ */
+
+/*
+ * Copyright (C) 2009, 2021 embedded brains GmbH 
(http://www.embedded-brains.de)
+ * Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  */
 
 /*
- *  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
+ * This file is part of the RTEMS quality process and was automatically
+ * generated.  If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual.  The manual is provided as a part of
+ * a release.  For development sources please refer to the online
+ * documentation at:
  *
- *  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.
+ * https://docs.rtems.org
  */
 
+/* Generated from spec:/rtems/userext/if/header */
+
 #ifndef _RTEMS_EXTENSION_H
 #define _RTEMS_EXTENSION_H
 
 #include 
 #include 
-#include 
+#include 
+#include 
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+/* Generated from spec:/rtems/userext/if/group */
+
 /**
  * @defgroup RTEMSAPIClassicUserExt User Extensions Manager
  *
  * @ingroup RTEMSAPIClassic
  *
  * @brief The User Extensions Manager allows the application developer to
- * augment the executive by allowing them to supply extension routines which
- * are invoked at critical system events.
- *
- * @section RTEMSAPIClassicUserExtSets Extension Sets
- *
- * An @ref User_extensions_Table "extension set" is defined as a set of
- * routines which are invoked at each of the critical system events at which
- * user extension routines are invoked.  Together a set of these routines
- * typically perform a specific functionality such as performance monitoring or
- * debugger support.
- *
- * RTEMS allows the user to have multiple extension sets active at the same
- * time. First, a single static extension set may be defined as the
- * application's User Extension Table which is included as part of the
- * Configuration Table. This extension set is active for the entire life of the
- * system and may not be deleted. This extension set is especially important
- * because it is the only way the application can provided a fatal error
- * extension which is invoked if RTEMS fails during the
- * rtems_initialize_data_structures() directive. The static extension set is
- * optional and may be configured as @c NULL if no static extension set is
- * required.
- *
- * Second, the user can install dynamic extensions using the
- * rtems_extension_create() directive. These extensions are RTEMS objects 

[PATCH] c-user: Add "Cache Manager" chapter

2021-09-10 Thread Sebastian Huber
The Cache Manager directives are available via .  Document most
of them in the Classic API Guide.

Not documented are the following directive since the API is not yet
stable:

* rtems_cache_coherent_allocate()
* rtems_cache_coherent_free()
* rtems_cache_coherent_add_area()

Not documented are the following directive since the directives are not
implemented on maintained platforms:

* rtems_cache_freeze_data()
* rtems_cache_freeze_instruction()
* rtems_cache_unfreeze_data()
* rtems_cache_unfreeze_instruction()

Close #4513.
---
Here is the updated document for review:

https://ftp.rtems.org/pub/rtems/people/sebh/c-user.pdf

 c-user/cache/directives.rst   | 665 ++
 c-user/cache/index.rst|  15 +
 c-user/cache/introduction.rst | 101 ++
 c-user/index.rst  |   1 +
 4 files changed, 782 insertions(+)
 create mode 100644 c-user/cache/directives.rst
 create mode 100644 c-user/cache/index.rst
 create mode 100644 c-user/cache/introduction.rst

diff --git a/c-user/cache/directives.rst b/c-user/cache/directives.rst
new file mode 100644
index 000..98349db
--- /dev/null
+++ b/c-user/cache/directives.rst
@@ -0,0 +1,665 @@
+.. SPDX-License-Identifier: CC-BY-SA-4.0
+
+.. Copyright (C) 2016 Pavel Pisa
+.. Copyright (C) 2014, 2021 embedded brains GmbH 
(http://www.embedded-brains.de)
+.. Copyright (C) 2000, 2008 On-Line Applications Research Corporation (OAR)
+
+.. This file is part of the RTEMS quality process and was automatically
+.. generated.  If you find something that needs to be fixed or
+.. worded better please post a report or patch to an RTEMS mailing list
+.. or raise a bug report:
+..
+.. https://www.rtems.org/bugs.html
+..
+.. For information on updating and regenerating please refer to the How-To
+.. section in the Software Requirements Engineering chapter of the
+.. RTEMS Software Engineering manual.  The manual is provided as a part of
+.. a release.  For development sources please refer to the online
+.. documentation at:
+..
+.. https://docs.rtems.org
+
+.. _CacheManagerDirectives:
+
+Directives
+==
+
+This section details the directives of the Cache Manager. A subsection is
+dedicated to each of this manager's directives and lists the calling sequence,
+parameters, description, return values, and notes of the directive.
+
+.. Generated from spec:/rtems/cache/if/flush-multiple-data-lines
+
+.. raw:: latex
+
+\clearpage
+
+.. index:: rtems_cache_flush_multiple_data_lines()
+
+.. _InterfaceRtemsCacheFlushMultipleDataLines:
+
+rtems_cache_flush_multiple_data_lines()
+---
+
+Flushes the data cache lines covering the memory area.
+
+.. rubric:: CALLING SEQUENCE:
+
+.. code-block:: c
+
+void rtems_cache_flush_multiple_data_lines( const void *begin, size_t size 
);
+
+.. rubric:: PARAMETERS:
+
+``begin``
+This parameter is the begin address of the memory area to flush.
+
+``size``
+This parameter is the size in bytes of the memory area to flush.
+
+.. rubric:: DESCRIPTION:
+
+Dirty data cache lines covering the area are transfered to memory.  Depending
+on the cache implementation this may mark the lines as invalid.
+
+.. rubric:: CONSTRAINTS:
+
+The following constraints apply to this directive:
+
+* The directive may be called from within any runtime context.
+
+* The directive will not cause the calling task to be preempted.
+
+.. Generated from spec:/rtems/cache/if/invalidate-multiple-data-lines
+
+.. raw:: latex
+
+\clearpage
+
+.. index:: rtems_cache_invalidate_multiple_data_lines()
+
+.. _InterfaceRtemsCacheInvalidateMultipleDataLines:
+
+rtems_cache_invalidate_multiple_data_lines()
+
+
+Invalidates the data cache lines covering the memory area.
+
+.. rubric:: CALLING SEQUENCE:
+
+.. code-block:: c
+
+void rtems_cache_invalidate_multiple_data_lines(
+  const void *begin,
+  size_t  size
+);
+
+.. rubric:: PARAMETERS:
+
+``begin``
+This parameter is the begin address of the memory area to invalidate.
+
+``size``
+This parameter is the size in bytes of the memory area to invalidate.
+
+.. rubric:: DESCRIPTION:
+
+The cache lines covering the area are marked as invalid.  A later read access
+in the area will load the data from memory.
+
+.. rubric:: NOTES:
+
+In case the area is not aligned on cache line boundaries, then this operation
+may destroy unrelated data.
+
+On some systems, the cache lines may be flushed before they are invalidated.
+
+.. rubric:: CONSTRAINTS:
+
+The following constraints apply to this directive:
+
+* The directive may be called from within any runtime context.
+
+* The directive will not cause the calling task to be preempted.
+
+.. Generated from spec:/rtems/cache/if/invalidate-multiple-instruction-lines
+
+.. raw:: latex
+
+\clearpage
+
+.. index:: rtems_cache_invalidate_multiple_instruction_lines()
+
+.. _InterfaceRtemsCacheInvalidateMultipleInstructionLines:
+
+rtems_cache_invalidat

Re: [PATCH] rtems: Generate

2021-09-10 Thread Chris Johns
Nice set of changes. My comments are below 

On 10/9/21 6:11 pm, Sebastian Huber wrote:
> Remove the duplicated description which is an out dated copy and paste
> from the Classic API Guide.  Instead, thoroughly document the individual
> extensions.
> 
> Change license to BSD-2-Clause according to file histories and
> documentation re-licensing agreement.
> 
> Update #3899.
> Update #3993.
> ---
>  cpukit/include/rtems/extension.h | 758 ---
>  1 file changed, 583 insertions(+), 175 deletions(-)
> 
> diff --git a/cpukit/include/rtems/extension.h 
> b/cpukit/include/rtems/extension.h
> index 6f97ebe24c..ceb8eb9a1f 100644
> --- a/cpukit/include/rtems/extension.h
> +++ b/cpukit/include/rtems/extension.h
> @@ -1,190 +1,311 @@
> +/* SPDX-License-Identifier: BSD-2-Clause */
> +
>  /**
>   * @file
>   *
>   * @ingroup RTEMSImplClassicUserExt
>   *
> - * @brief User Extensions API.
> + * @brief This header file defines the User Extensions Manager API.
> + */
> +
> +/*
> + * Copyright (C) 2009, 2021 embedded brains GmbH 
> (http://www.embedded-brains.de)
> + * Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR)
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaimer in the
> + *documentation and/or other materials provided with the distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 
> IS"
> + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
> + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
> + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
> + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
> + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
> + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
> + * POSSIBILITY OF SUCH DAMAGE.
>   */
>  
>  /*
> - *  COPYRIGHT (c) 1989-2008.
> - *  On-Line Applications Research Corporation (OAR).
> + * This file is part of the RTEMS quality process and was automatically
> + * generated.  If you find something that needs to be fixed or
> + * worded better please post a report or patch to an RTEMS mailing list
> + * or raise a bug report:
> + *
> + * https://www.rtems.org/bugs.html
> + *
> + * For information on updating and regenerating please refer to the How-To
> + * section in the Software Requirements Engineering chapter of the
> + * RTEMS Software Engineering manual.  The manual is provided as a part of
> + * a release.  For development sources please refer to the online
> + * documentation at:
>   *
> - *  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.
> + * https://docs.rtems.org
>   */
>  
> +/* Generated from spec:/rtems/userext/if/header */
> +
>  #ifndef _RTEMS_EXTENSION_H
>  #define _RTEMS_EXTENSION_H
>  
>  #include 
>  #include 
> -#include 
> +#include 
> +#include 
>  
>  #ifdef __cplusplus
>  extern "C" {
>  #endif
>  
> +/* Generated from spec:/rtems/userext/if/group */
> +
>  /**
>   * @defgroup RTEMSAPIClassicUserExt User Extensions Manager
>   *
>   * @ingroup RTEMSAPIClassic
>   *
>   * @brief The User Extensions Manager allows the application developer to
> - * augment the executive by allowing them to supply extension routines which
> - * are invoked at critical system events.
> - *
> - * @section RTEMSAPIClassicUserExtSets Extension Sets
> - *
> - * An @ref User_extensions_Table "extension set" is defined as a set of
> - * routines which are invoked at each of the critical system events at which
> - * user extension routines are invoked.  Together a set of these routines
> - * typically perform a specific functionality such as performance monitoring 
> or
> - * debugger support.
> - *
> - * RTEMS allows the user to have multiple extension sets active at the same
> - * time. First, a single static extension set may be defined as the
> - * application's User Extension Table which is included as part of the
> - * Configuration Table. This extension set is active for the entire life of 
> the
> - * system and may not be deleted. This extension set is especially important
> - * because it is the only way the application can provided a fatal error
> - * extension which is i

Re: [PATCH] rtems: Generate

2021-09-10 Thread Sebastian Huber

Hello Chris,

thanks for the review.

On 10/09/2021 10:55, Chris Johns wrote:

Nice set of changes. My comments are below 

On 10/9/21 6:11 pm, Sebastian Huber wrote:

Remove the duplicated description which is an out dated copy and paste
from the Classic API Guide.  Instead, thoroughly document the individual
extensions.

Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
---
  cpukit/include/rtems/extension.h | 758 ---
  1 file changed, 583 insertions(+), 175 deletions(-)

diff --git a/cpukit/include/rtems/extension.h b/cpukit/include/rtems/extension.h
index 6f97ebe24c..ceb8eb9a1f 100644
--- a/cpukit/include/rtems/extension.h
+++ b/cpukit/include/rtems/extension.h

[...]

-typedef Internal_errors_Source rtems_fatal_source;
+/**
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief Deletes the extension set.
+ *
+ * @param id is the extension set identifier.
+ *
+ * This directive deletes the extension set specified by ``id``.
+ *
+ * @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
+ *
+ * @retval ::RTEMS_INVALID_ID There was no extension set associated with the
+ *   identifier specified by ``id``.
+ *
+ * @par Notes
+ * The ESCB for the deleted extension set is reclaimed by RTEMS.


ESCB? Can the definition to be local to here rather than needing to reach for
the mouse, a browser, working internet link, a built doxygen  :)


In the manuals you have a link to a glossary entry. This feature is not 
yet implemented for the Doxygen output.





+ *
+ * @par Constraints
+ * @parblock
+ * The following constraints apply to this directive:
+ *
+ * * The directive may be called from within device driver initialization
+ *   context.


Seem a little to ""specread"" .. maybe .. "during device driver initialization"?


This phrase is already used in a lot of directives. If we would like to 
change this, then this should be done in a separate patch set:


https://git.rtems.org/rtems-central/tree/spec/constraint/directive-ctx-devinit.yml




+ *
+ * * The directive may be called from within task context.


Specread ?? ... "within task context" ... "within a task's context" ?


Same as above:

https://git.rtems.org/rtems-central/tree/spec/constraint/directive-ctx-task.yml




+ * * The directive may obtain and release the object allocator mutex.  This may
+ *   cause the calling task to be preempted.


Block or preempted? I assume the task may be preempted before making the call?


The obtain will block the task, if the mutex is already owned by another 
task:


https://git.rtems.org/rtems-central/tree/spec/constraint/object-allocator.yml

This phrase should be improved in a separate patch set.



Do we assume task and thread and inter-changeable?


Yes, task is used mainly for Classic API tasks, and threads for tasks in 
general.





+ * * The calling task does not have to be the task that created the object.
+ *   Any local task that knows the object identifier can delete the object.
+ * @endparblock
+ */
+rtems_status_code rtems_extension_delete( rtems_id id );
+
+/* Generated from spec:/rtems/userext/if/fatal */
+
+/**
+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief Fatal extensions are invoked when the system should terminate.


Should? Is it too late by the time the call is being made?


Yes, should, the fatal extension can prevent a system termination. An 
example is the POSIX task exitted extension.





+ *
+ * @param source is the system termination source.  The source indicates the
+ *   component which caused the system termination request, see
+ *   ::rtems_fatal_source.  The system termination code may provide additional
+ *   information related to the system termination request.
+ *
+ * @param always_set_to_false is a value equal to false.
+ *
+ * @param code is the system termination code.  This value must be interpreted
+ *   with respect to the source.
+ *
+ * @par Notes
+ * @parblock
+ * The fatal extensions are invoked in extension forward order.


What does forward order mean?


This is in the glossary:

https://docs.rtems.org/branches/master/c-user/glossary.html#term-extension-forward-order




+ *
+ * The fatal extension should be extremely careful with respect to the RTEMS
+ * directives it calls.  Depending on the system termination source, the system
+ * may be in an undefined and corrupt state.


Where is the list defined that is means "undefined and corrupt"?


You have to look at the system termination source documentation to 
figure this out.





+ *
+ * It is recommended to register fatal extensions through initial extension
+ * sets, see #CONFIGURE_INITIAL_EXTENSIONS.
+ * @endparblock
+ */
+typedef User_extensions_fatal_extension rtems_fatal_extension;
+
+/* Generated from spec:/rtems/userext/if/fatal-code */
  
+/**

+ * @ingroup RTEMSAPIClassicUserExt
+ *
+ * @brief This integer type represents system termination codes.
+ *
+ * This integer type is

Re: Subject: [PATCH] improve the format error reporting on i386

2021-09-10 Thread zack leung
Where are the duplicates been trying to fix the commit messages?

 Thanks zack
Il gio 9 set 2021, 22:30 Gedare Bloom  ha scritto:

> Hi Zack,
>
> It looks like something got a little messed up with your commit
> message. Please see if you can fix it to remove the duplication(s).
>
> On Thu, Sep 9, 2021 at 6:00 PM zack leung 
> wrote:
> >
> > score/i386: improve the format of exception reporting
> >
> > Updates #4203."Updates #4203."
> > ---
> > cpukit/score/cpu/i386/cpu.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/cpukit/score/cpu/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c
> > index 77b7a7161c..06af57418d 100644
> > --- a/cpukit/score/cpu/i386/cpu.c
> > +++ b/cpukit/score/cpu/i386/cpu.c
> > @@ -215,7 +215,7 @@ void _CPU_Exception_frame_print (const
> CPU_Exception_frame *ctx)
> > {
> > unsigned int faultAddr = 0;
> > printk("--\n");
> > - printk("Exception %" PRIu32 " caught at PC %" PRIx32 " by thread %"
> PRId32 "\n",
> > + printk("Exception %" PRIu32 " caught at PC %" PRIx32 " by thread %"
> PRIx32 "\n",
> > ctx->idtIndex,
> > ctx->eip,
> > _Thread_Executing->Object.id);
> > --
> > 2.33.0
> > ___
> > 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


Re: Subject: [PATCH] improve the format error reporting on i386

2021-09-10 Thread Gedare Bloom
Hi Zack,

Use git-rebase --interactive option, and reword the commit message.
The email comes through with an additional subject line, I'm not sure
if that is intended. You don't need to repeat the first line of the
commit message. It seems like the commit message you have used is:
---
improve the format error reporting on i386
score/i386: improve the format of exception reporting

Updates #4203."Updates #4203."
---
You should modify that commit message, and regenerate the patch/email.

-Gedare

On Fri, Sep 10, 2021 at 7:07 AM zack leung  wrote:
>
> Where are the duplicates been trying to fix the commit messages?
>
>  Thanks zack
> Il gio 9 set 2021, 22:30 Gedare Bloom  ha scritto:
>>
>> Hi Zack,
>>
>> It looks like something got a little messed up with your commit
>> message. Please see if you can fix it to remove the duplication(s).
>>
>> On Thu, Sep 9, 2021 at 6:00 PM zack leung  wrote:
>> >
>> > score/i386: improve the format of exception reporting
>> >
>> > Updates #4203."Updates #4203."
>> > ---
>> > cpukit/score/cpu/i386/cpu.c | 2 +-
>> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/cpukit/score/cpu/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c
>> > index 77b7a7161c..06af57418d 100644
>> > --- a/cpukit/score/cpu/i386/cpu.c
>> > +++ b/cpukit/score/cpu/i386/cpu.c
>> > @@ -215,7 +215,7 @@ void _CPU_Exception_frame_print (const 
>> > CPU_Exception_frame *ctx)
>> > {
>> > unsigned int faultAddr = 0;
>> > printk("--\n");
>> > - printk("Exception %" PRIu32 " caught at PC %" PRIx32 " by thread %" 
>> > PRId32 "\n",
>> > + printk("Exception %" PRIu32 " caught at PC %" PRIx32 " by thread %" 
>> > PRIx32 "\n",
>> > ctx->idtIndex,
>> > ctx->eip,
>> > _Thread_Executing->Object.id);
>> > --
>> > 2.33.0
>> > ___
>> > 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] eng: Add register block specification types

2021-09-10 Thread Sebastian Huber
A register block may be used to specify the memory-mapped interface to
the hardware.  Register blocks consist of register block members.
Register block members are either instances of registers or instances of
other register blocks.  Registers consists of bit fields.

Update #3715.
---
For examples see:

https://git.rtems.org/rtems-central/tree/spec/dev/grlib/if

 eng/req/items.rst | 334 ++
 1 file changed, 334 insertions(+)

diff --git a/eng/req/items.rst b/eng/req/items.rst
index 1489f19..be6ab5f 100644
--- a/eng/req/items.rst
+++ b/eng/req/items.rst
@@ -103,6 +103,8 @@ The specification item types have the following hierarchy:
 
 * :ref:`SpecTypeInterfaceVariableItemType`
 
+* :ref:`SpecTypeRegisterBlockItemType`
+
   * :ref:`SpecTypeRequirementItemType`
 
 * :ref:`SpecTypeFunctionalRequirementItemType`
@@ -1143,6 +1145,8 @@ This type is refined by the following types:
 
 * :ref:`SpecTypeInterfaceVariableItemType`
 
+* :ref:`SpecTypeRegisterBlockItemType`
+
 .. _SpecTypeApplicationConfigurationGroupItemType:
 
 Application Configuration Group Item Type
@@ -1614,6 +1618,67 @@ name
 notes
 The attribute value shall be an :ref:`SpecTypeInterfaceNotes`.
 
+.. _SpecTypeRegisterBlockItemType:
+
+Register Block Item Type
+
+
+This type refines the :ref:`SpecTypeInterfaceItemType` through the
+``interface-type`` attribute if the value is ``register-block``. This set of
+attributes specifies a register block.  A register block may be used to specify
+the memory-mapped interface to the hardware.  Register blocks consist of
+register block members specified by the ``definition`` attribute.  Register
+block members are either instances of registers specified by the ``registers``
+attribute or instances of other register blocks specified by links with the
+:ref:`SpecTypeRegisterBlockIncludeRole`.  Registers consists of bit fields (see
+:ref:`SpecTypeRegisterBitsDefinition`. All explicit attributes shall be
+specified. The explicit attributes for this type are:
+
+brief
+The attribute value shall be an :ref:`SpecTypeInterfaceBriefDescription`.
+
+definition
+The attribute value shall be a list. Each list element shall be a
+:ref:`SpecTypeRegisterBlockMemberDefinitionDirective`.
+
+description
+The attribute value shall be an :ref:`SpecTypeInterfaceDescription`.
+
+identifier
+The attribute value shall be an :ref:`SpecTypeInterfaceGroupIdentifier`.
+
+name
+The attribute value shall be a string. It shall be the name of the register
+block.
+
+notes
+The attribute value shall be an :ref:`SpecTypeInterfaceNotes`.
+
+register-block-group
+The attribute value shall be a string. It shall be the name of the
+interface group defined for the register block.  For the group identifier
+see the ``identifier`` attribute.
+
+register-block-size
+The attribute value shall be an integer number. It shall be the size in
+bytes of the register block.
+
+register-block-type
+The attribute value shall be a :ref:`SpecTypeRegisterBlockType`.
+
+register-prefix
+The attribute value shall be an optional string. If the value is present,
+then it will be used to prefix register bit field names, otherwise the
+value of the ``name`` attribute will be used.
+
+registers
+The attribute value shall be a list. Each list element shall be a
+:ref:`SpecTypeRegisterDefinition`.
+
+In addition to the explicit attributes, generic attributes may be specified.
+Each generic attribute key shall be a :ref:`SpecTypeName`. The attribute value
+may have any type.
+
 .. _SpecTypeRequirementItemType:
 
 Requirement Item Type
@@ -3733,6 +3798,12 @@ This type is used by the following types:
 
 * :ref:`SpecTypeInterfaceVariableItemType`
 
+* :ref:`SpecTypeRegisterBitsDefinition`
+
+* :ref:`SpecTypeRegisterBlockItemType`
+
+* :ref:`SpecTypeRegisterDefinition`
+
 .. _SpecTypeInterfaceCompoundDefinitionKind:
 
 Interface Compound Definition Kind
@@ -3992,6 +4063,12 @@ This type is used by the following types:
 
 * :ref:`SpecTypeInterfaceVariableItemType`
 
+* :ref:`SpecTypeRegisterBitsDefinition`
+
+* :ref:`SpecTypeRegisterBlockItemType`
+
+* :ref:`SpecTypeRegisterDefinition`
+
 .. _SpecTypeInterfaceEnabledByExpression:
 
 Interface Enabled-By Expression
@@ -4041,6 +4118,10 @@ This type is used by the following types:
 
 * :ref:`SpecTypeInterfaceFunctionDefinitionVariant`
 
+* :ref:`SpecTypeRegisterBitsDefinitionVariant`
+
+* :ref:`SpecTypeRegisterBlockMemberDefinitionVariant`
+
 .. _SpecTypeInterfaceEnumDefinitionKind:
 
 Interface Enum Definition Kind
@@ -4182,6 +4263,8 @@ This type is used by the following types:
 
 * :ref:`SpecTypeInterfaceGroupItemType`
 
+* :ref:`SpecTypeRegisterBlockItemType`
+
 .. _SpecTypeInterfaceGroupMembershipLinkRole:
 
 Interface Group Membership Link Role
@@ -4248,6 +4331,8 @@ This type is used by the following types:
 
 * :ref:`SpecTypeInterfaceVariableItemType`
 
+* :ref:`SpecTyp

Re: Subject: [PATCH] improve the format error reporting on i386

2021-09-10 Thread Joel Sherrill
I have chatted with Zack a fair amount about this series of patches. I
wanted to get on the mailing list to make sure some things got done as
intended.

hex numbers (%x) should be preceded by 0x. The format string would be like 0x%x

Many hex numbers (e.g. task IDs, registers, etc)  should be printed in
hex with leading zeros. This would be like 0x%08x or 0x%08 PRIx I
think.

Exception numbers should be printed along with a short string
explanation. For the x86, I think (emphasis that someone should check
a real manual) that this page includes a table with numbers and fault
names: https://en.wikipedia.org/wiki/Interrupt_descriptor_table

Some of the exception handler output will be bespoke to the
architecture but the part about the task Id, RTEMS version, etc should
be identical across all architectures and possibly should be a helper
method to ensure this.

Zack. Did your hit those points?

--joel

On Fri, Sep 10, 2021 at 9:20 AM Gedare Bloom  wrote:
>
> Hi Zack,
>
> Use git-rebase --interactive option, and reword the commit message.
> The email comes through with an additional subject line, I'm not sure
> if that is intended. You don't need to repeat the first line of the
> commit message. It seems like the commit message you have used is:
> ---
> improve the format error reporting on i386
> score/i386: improve the format of exception reporting
>
> Updates #4203."Updates #4203."
> ---
> You should modify that commit message, and regenerate the patch/email.
>
> -Gedare
>
> On Fri, Sep 10, 2021 at 7:07 AM zack leung  wrote:
> >
> > Where are the duplicates been trying to fix the commit messages?
> >
> >  Thanks zack
> > Il gio 9 set 2021, 22:30 Gedare Bloom  ha scritto:
> >>
> >> Hi Zack,
> >>
> >> It looks like something got a little messed up with your commit
> >> message. Please see if you can fix it to remove the duplication(s).
> >>
> >> On Thu, Sep 9, 2021 at 6:00 PM zack leung  wrote:
> >> >
> >> > score/i386: improve the format of exception reporting
> >> >
> >> > Updates #4203."Updates #4203."
> >> > ---
> >> > cpukit/score/cpu/i386/cpu.c | 2 +-
> >> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >> >
> >> > diff --git a/cpukit/score/cpu/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c
> >> > index 77b7a7161c..06af57418d 100644
> >> > --- a/cpukit/score/cpu/i386/cpu.c
> >> > +++ b/cpukit/score/cpu/i386/cpu.c
> >> > @@ -215,7 +215,7 @@ void _CPU_Exception_frame_print (const 
> >> > CPU_Exception_frame *ctx)
> >> > {
> >> > unsigned int faultAddr = 0;
> >> > printk("--\n");
> >> > - printk("Exception %" PRIu32 " caught at PC %" PRIx32 " by thread %" 
> >> > PRId32 "\n",
> >> > + printk("Exception %" PRIu32 " caught at PC %" PRIx32 " by thread %" 
> >> > PRIx32 "\n",
> >> > ctx->idtIndex,
> >> > ctx->eip,
> >> > _Thread_Executing->Object.id);
> >> > --
> >> > 2.33.0
> >> > ___
> >> > 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
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH rtems-tools v2 01/10] CoverageWriter: Convert to C++

2021-09-10 Thread Ryan Long
---
 tester/covoar/CoverageWriterBase.h|  4 +++-
 tester/covoar/CoverageWriterRTEMS.cc  | 26 +--
 tester/covoar/CoverageWriterRTEMS.h   |  4 +++-
 tester/covoar/CoverageWriterSkyeye.cc | 39 +++
 tester/covoar/CoverageWriterSkyeye.h  |  4 +++-
 tester/covoar/CoverageWriterTSIM.cc   | 23 ++---
 tester/covoar/CoverageWriterTSIM.h|  4 +++-
 7 files changed, 59 insertions(+), 45 deletions(-)

diff --git a/tester/covoar/CoverageWriterBase.h 
b/tester/covoar/CoverageWriterBase.h
index e43a45b..fca501a 100644
--- a/tester/covoar/CoverageWriterBase.h
+++ b/tester/covoar/CoverageWriterBase.h
@@ -9,6 +9,8 @@
 
 #include 
 
+#include 
+
 #include "CoverageMapBase.h"
 
 namespace Coverage {
@@ -46,7 +48,7 @@ namespace Coverage {
  *  @return Returns TRUE if the method succeeded and FALSE if it failed.
  */
 virtual void writeFile(
-  const char* const file,
+  const std::string& file,
   CoverageMapBase*  coverage,
   uint32_t  lowAddress,
   uint32_t  highAddress
diff --git a/tester/covoar/CoverageWriterRTEMS.cc 
b/tester/covoar/CoverageWriterRTEMS.cc
index 48e8fd1..fc8a241 100644
--- a/tester/covoar/CoverageWriterRTEMS.cc
+++ b/tester/covoar/CoverageWriterRTEMS.cc
@@ -10,6 +10,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -28,23 +29,23 @@ namespace Coverage {
   }
 
   void CoverageWriterRTEMS::writeFile(
-const char* const file,
+const std::string& file,
 CoverageMapBase*  coverage,
 uint32_t  lowAddress,
 uint32_t  highAddress
   )
   {
-FILE*   coverageFile;
+std::ofstream   coverageFile;
 uint32_ta;
-int status;
 uint8_t cover;
 rtems_coverage_map_header_t header;
+std::ofstream::pos_type bytes_before;
 
 /*
  *  read the file and update the coverage map passed in
  */
-coverageFile = ::fopen( file, "w" );
-if ( !coverageFile ) {
+coverageFile.open( file );
+if ( !coverageFile.is_open() ) {
   std::ostringstream what;
   what << "Unable to open " << file;
   throw rld::error( what, "CoverageWriterRTEMS::writeFile" );
@@ -58,9 +59,10 @@ namespace Coverage {
 header.end   = highAddress;
 strcpy( header.desc, "RTEMS Coverage Data" );
 
-status = ::fwrite(&header, 1, sizeof(header), coverageFile);
-if (status != sizeof(header)) {
-  ::fclose( coverageFile );
+bytes_before = coverageFile.tellp();
+
+coverageFile.write( (char *) &header, sizeof( header ) );
+if ( coverageFile.tellp() - bytes_before != sizeof( header ) ) {
   std::ostringstream what;
   what << "Unable to write header to " << file;
   throw rld::error( what, "CoverageWriterRTEMS::writeFile" );
@@ -68,8 +70,11 @@ namespace Coverage {
 
 for ( a=lowAddress ; a < highAddress ; a++ ) {
   cover  = ((coverage->wasExecuted( a )) ? 0x01 : 0);
-  status = fwrite(&cover, 1, sizeof(cover), coverageFile);
-  if (status != sizeof(cover)) {
+
+  bytes_before = coverageFile.tellp();
+
+  coverageFile.write( (char *) &cover, sizeof( cover ) );
+  if ( coverageFile.tellp() - bytes_before != sizeof( cover ) ) {
 std::cerr << "CoverageWriterRTEMS::writeFile - write to "
   << file
   << " at address 0x%"
@@ -81,6 +86,5 @@ namespace Coverage {
   }
 }
 
-::fclose( coverageFile );
   }
 }
diff --git a/tester/covoar/CoverageWriterRTEMS.h 
b/tester/covoar/CoverageWriterRTEMS.h
index b66d2fa..c760936 100644
--- a/tester/covoar/CoverageWriterRTEMS.h
+++ b/tester/covoar/CoverageWriterRTEMS.h
@@ -7,6 +7,8 @@
 #ifndef __COVERAGE_WRITER_RTEMS_H__
 #define __COVERAGE_WRITER_RTEMS_H__
 
+#include 
+
 #include "CoverageMapBase.h"
 #include "CoverageWriterBase.h"
 
@@ -33,7 +35,7 @@ namespace Coverage {
 
 /* Inherit documentation from base class. */
 void writeFile(
-  const char* const file,
+  const std::string& file,
   CoverageMapBase*  coverage,
   uint32_t  lowAddress,
   uint32_t  highAddress
diff --git a/tester/covoar/CoverageWriterSkyeye.cc 
b/tester/covoar/CoverageWriterSkyeye.cc
index 7f78644..fcc7052 100644
--- a/tester/covoar/CoverageWriterSkyeye.cc
+++ b/tester/covoar/CoverageWriterSkyeye.cc
@@ -12,6 +12,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -30,23 +31,23 @@ namespace Coverage {
   }
 
   void CoverageWriterSkyeye::writeFile(
-const char* const file,
-CoverageMapBase*  coverage,
-uint32_t  lowAddress,
-uint32_t  highAddress
+const std::string&  file,
+CoverageMapBase*coverage,
+uint32_tlowAddress,
+uint32_thighAddress
   )
   {
-uint32_t  a;
-uint8_t   cover;
-FILE* coverageFile;
-prof_header_t header;
-int  

[PATCH rtems-tools v2 00/10] Convert and reformat pt. 2

2021-09-10 Thread Ryan Long
Hi,

For these patches I

- Changed the data type of bytes_before so that it builds with clang
- Replaced instances of "\n" with std::endl
- Changed .c_str() argument to just a string

Thanks,
Ryan

Ryan Long (10):
  CoverageWriter: Convert to C++
  covoar.cc: Convert to C++
  CoverageWriterBase.h: Fix formatting
  covoar.cc: Fix formatting
  CoverageWriterRTEMS.cc: Fix formatting
  CoverageWriterRTEMS.h: Fix formatting
  CoverageWriterSkyeye.cc: Fix formatting
  CoverageWriterSkyeye.h: Fix formatting
  CoverageWriterTSIM.cc: Fix formatting
  CoverageWriterTSIM.h: Fix formatting

 tester/covoar/CoverageWriterBase.h|  10 +-
 tester/covoar/CoverageWriterRTEMS.cc  |  46 ++---
 tester/covoar/CoverageWriterRTEMS.h   |  10 +-
 tester/covoar/CoverageWriterSkyeye.cc |  49 ++---
 tester/covoar/CoverageWriterSkyeye.h  |  10 +-
 tester/covoar/CoverageWriterTSIM.cc   |  45 +++--
 tester/covoar/CoverageWriterTSIM.h|  10 +-
 tester/covoar/covoar.cc   | 334 ++
 8 files changed, 279 insertions(+), 235 deletions(-)

-- 
1.8.3.1

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


[PATCH rtems-tools v2 02/10] covoar.cc: Convert to C++

2021-09-10 Thread Ryan Long
Got rid of C-strings, changed FILE pointer to ifstream.
---
 tester/covoar/covoar.cc | 50 +++--
 1 file changed, 23 insertions(+), 27 deletions(-)

diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc
index f9d4814..710294b 100644
--- a/tester/covoar/covoar.cc
+++ b/tester/covoar/covoar.cc
@@ -45,11 +45,11 @@ typedef std::list CoverageNames;
 typedef std::list Executables;
 typedef std::string option_error;
 
-bool FileIsReadable( const char *f1 )
+bool FileIsReadable( const std::string& f1 )
 {
   struct STAT buf1;
 
-  if (STAT( f1, &buf1 ) == -1)
+  if (STAT( f1.c_str(), &buf1 ) == -1)
 return false;
 
   if (buf1.st_size == 0)
@@ -177,17 +177,14 @@ int covoar(
   std::string   coverageExtension = "cov";
   Coverage::CoverageFormats_t   coverageFormat = 
Coverage::COVERAGE_FORMAT_QEMU;
   Coverage::CoverageReaderBase* coverageReader = NULL;
-  char* executable = NULL;
-  const char*   explanations = NULL;
-  const char*   gcnosFileName = NULL;
-  char  gcnoFileName[FILE_NAME_LENGTH];
-  char  gcdaFileName[FILE_NAME_LENGTH];
-  char  gcovBashCommand[256];
+  std::string   explanations;
+  std::string   gcnosFileName;
+  std::string   gcnoFileName;
   std::string   target;
-  const char*   format = "QEMU";
-  FILE* gcnosFile = NULL;
+  std::string   format = "QEMU";
+  std::ifstream gcnosFile;
   Gcov::GcovData*   gcovFile;
-  const char*   singleExecutable = NULL;
+  std::string   singleExecutable;
   rld::process::tempfileobjdumpFile( ".dmp" );
   rld::process::tempfileerr( ".err" );
   rld::process::tempfilesyms( ".syms" );
@@ -203,7 +200,6 @@ int covoar(
   std::string   outputDirectory = ".";
   Coverage::DesiredSymbols  symbolsToAnalyze;
   bool  branchInfoAvailable = false;
-  //Target::TargetBase*   targetInfo;
 
   //
   // Process command line options.
@@ -243,7 +239,7 @@ int covoar(
   /*
* Has path to explanations.txt been specified.
*/
-  if ( !explanations )
+  if ( explanations.empty() )
 throw option_error( "explanations -E" );
 
   /*
@@ -272,7 +268,7 @@ int covoar(
   }
 
   if (verbose) {
-if (singleExecutable) {
+if (!singleExecutable.empty()) {
   std::cerr << "Processing a single executable and multiple coverage files"
 << std::endl;
 } else {
@@ -287,7 +283,7 @@ int covoar(
 for (const auto& cname : coverageFileNames) {
   std::cerr << "Coverage file " << cname
 << " for executable: " << (*eitr)->getFileName() << std::endl;
-  if (!singleExecutable)
+  if (singleExecutable.empty())
 eitr++;
 }
   }
@@ -309,7 +305,7 @@ int covoar(
 
   // If a single executable was specified, process the remaining
   // arguments as coverage file names.
-  if (singleExecutable) {
+  if (!singleExecutable.empty()) {
 
 // Ensure that the executable is readable.
 if (!FileIsReadable( singleExecutable )) {
@@ -332,14 +328,14 @@ int covoar(
   if (!coverageFileNames.empty()) {
 if ( !dynamicLibrary.empty() ) {
   executableInfo = new Coverage::ExecutableInfo(
-singleExecutable,
+singleExecutable.c_str(),
 dynamicLibrary,
 verbose,
 symbolsToAnalyze
   );
 } else {
   executableInfo = new Coverage::ExecutableInfo(
-singleExecutable,
+singleExecutable.c_str(),
 "",
 verbose,
 symbolsToAnalyze
@@ -393,8 +389,8 @@ int covoar(
   << " symbols" << std::endl;
 
   // Create explanations.
-  if ( explanations )
-allExplanations.load( explanations );
+  if ( !explanations.empty() )
+allExplanations.load( explanations.c_str() );
 
   // Create coverage map reader.
   coverageFormat = Coverage::CoverageFormatToEnum(format);
@@ -441,7 +437,7 @@ int covoar(
 // DEBUG Print ExecutableInfo content
 //exe->dumpExecutableInfo();
 
-if (!singleExecutable) {
+if (singleExecutable.empty()) {
   eitr++;
 }
   }
@@ -455,18 +451,18 @@ int covoar(
   //
   // Generate Gcov reports
   //
-  if (gcnosFileName) {
+  if (!gcnosFileName.empty()) {
 if (verbose)
   std::cerr << "Generating Gcov reports..." << std::endl;
 
-gcnosFile = fopen ( gcnosFileName , "r" );
+gcnosFile.open( gcnosFileName );
 
 if ( !gcnosFile )
   std::cerr << "Unable to open " << gcnosFileName << std::endl;
 else {
-  while ( fscanf( gcnosFile, "%s", inputBuffer ) != EOF) {
+  while ( gcnosFile >> inputBuffer ) {
 gcovFile = new Gcov::GcovData( symbolsToAnalyze );
-  

[PATCH rtems-tools v2 03/10] CoverageWriterBase.h: Fix formatting

2021-09-10 Thread Ryan Long
---
 tester/covoar/CoverageWriterBase.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tester/covoar/CoverageWriterBase.h 
b/tester/covoar/CoverageWriterBase.h
index fca501a..ee8c148 100644
--- a/tester/covoar/CoverageWriterBase.h
+++ b/tester/covoar/CoverageWriterBase.h
@@ -49,9 +49,9 @@ namespace Coverage {
  */
 virtual void writeFile(
   const std::string& file,
-  CoverageMapBase*  coverage,
-  uint32_t  lowAddress,
-  uint32_t  highAddress
+  CoverageMapBase*   coverage,
+  uint32_t   lowAddress,
+  uint32_t   highAddress
 ) = 0;
   };
 
-- 
1.8.3.1

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


[PATCH rtems-tools v2 04/10] covoar.cc: Fix formatting

2021-09-10 Thread Ryan Long
---
 tester/covoar/covoar.cc | 300 +++-
 1 file changed, 167 insertions(+), 133 deletions(-)

diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc
index 710294b..ec126d6 100644
--- a/tester/covoar/covoar.cc
+++ b/tester/covoar/covoar.cc
@@ -35,25 +35,27 @@
 #define STAT stat
 #endif
 
-#if defined(_WIN32) || defined(__CYGWIN__)
-  #define kill(p,s) raise(s)
+#if defined( _WIN32 ) || defined( __CYGWIN__ )
+  #define kill( p,s ) raise( s )
 #endif
 
 #define MAX_LINE_LENGTH 512
 
-typedef std::list CoverageNames;
+typedef std::list   CoverageNames;
 typedef std::list Executables;
-typedef std::string option_error;
+typedef std::string  OptionError;
 
 bool FileIsReadable( const std::string& f1 )
 {
   struct STAT buf1;
 
-  if (STAT( f1.c_str(), &buf1 ) == -1)
+  if ( STAT( f1.c_str(), &buf1 ) == -1 ) {
 return false;
+  }
 
-  if (buf1.st_size == 0)
+  if ( buf1.st_size == 0 ) {
 return false;
+  }
 
   // XXX check permission ??
   return true;
@@ -63,75 +65,92 @@ bool FileIsReadable( const std::string& f1 )
  * Create a build path from the executable paths. Also extract the build prefix
  * and BSP names.
  */
-static void createBuildPath(Executables& executablesToAnalyze,
-std::string& buildPath,
-std::string& buildPrefix,
-std::string& buildBSP)
+static void createBuildPath(
+  Executables& executablesToAnalyze,
+  std::string& buildPath,
+  std::string& buildPrefix,
+  std::string& buildBSP
+)
 {
-  for (const auto& exe : executablesToAnalyze) {
+  for ( const auto& exe : executablesToAnalyze ) {
 rld::strings eparts;
-rld::split(eparts, rld::path::path_abs(exe->getFileName()), 
RLD_PATH_SEPARATOR);
+rld::split(
+  eparts,
+  rld::path::path_abs( exe->getFileName() ),
+  RLD_PATH_SEPARATOR
+);
 std::string fail; // empty means all is OK else an error string
-for (rld::path::paths::reverse_iterator pri = eparts.rbegin();
- pri != eparts.rend();
- ++pri) {
-  if (*pri == "testsuites") {
+for (
+  rld::path::paths::reverse_iterator pri = eparts.rbegin();
+  pri != eparts.rend();
+  ++pri
+) {
+  if ( *pri == "testsuites" ) {
 ++pri;
-if (pri == eparts.rend()) {
+if ( pri == eparts.rend() ) {
   fail = "invalid executable path, no BSP";
   break;
 }
-if (buildBSP.empty()) {
+
+if ( buildBSP.empty() ) {
   buildBSP = *pri;
 } else {
-  if (buildBSP != *pri) {
+  if ( buildBSP != *pri ) {
 fail = "executable BSP does not match: " + buildBSP;
 break;
   }
 }
+
 ++pri;
-if (pri == eparts.rend() || *pri != "c") {
+if ( pri == eparts.rend() || *pri != "c" ) {
   fail = "invalid executable path, no 'c'";
   break;
 }
+
 ++pri;
-if (pri == eparts.rend()) {
+if ( pri == eparts.rend() ) {
   fail = "invalid executable path, no arch prefix";
   break;
 }
-if (buildPrefix.empty()) {
+
+if ( buildPrefix.empty() ) {
   buildPrefix = *pri;
 } else {
-  if (buildPrefix != *pri) {
+  if ( buildPrefix != *pri ) {
 fail = "executable build prefix does not match: " + buildPrefix;
 break;
   }
 }
+
 ++pri;
-if (pri == eparts.rend()) {
+if ( pri == eparts.rend() ) {
   fail = "invalid executable path, no build top";
   break;
 }
+
 //
 // The remaining parts of the path is the build path. Iterator over 
them
 // and collect into a new paths variable to join to make a path.
 //
 rld::path::paths bparts;
-for (; pri != eparts.rend(); ++pri)
+for ( ; pri != eparts.rend(); ++pri )
   bparts.insert(bparts.begin(), *pri);
+
 std::string thisBuildPath;
-rld::path::path_join(thisBuildPath, bparts, thisBuildPath);
-if (buildPath.empty()) {
+rld::path::path_join( thisBuildPath, bparts, thisBuildPath );
+if ( buildPath.empty() ) {
   buildPath = thisBuildPath;
 } else {
-  if (buildPath != thisBuildPath) {
+  if ( buildPath != thisBuildPath ) {
 fail = "executable build path does not match: " + buildPath;
   }
 }
+
 break;
   }
 }
-if (!fail.empty()) {
+
+if ( !fail.empty() ) {
   throw rld::error( fail, "createBuildPath" );
 }
   }
@@ -140,10 +159,10 @@ static void createBuildPath(Executables& 
executablesToAnalyze,
 /*
  *  Print program usage message
  */
-void usage(const std::string& progname)
+void usage( const std::string& progname )
 {
-  std::cerr <<"Usage: " << progname
-<<" [-v] -T TARGET -f FORMAT [-E EXP

[PATCH rtems-tools v2 05/10] CoverageWriterRTEMS.cc: Fix formatting

2021-09-10 Thread Ryan Long
---
 tester/covoar/CoverageWriterRTEMS.cc | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tester/covoar/CoverageWriterRTEMS.cc 
b/tester/covoar/CoverageWriterRTEMS.cc
index fc8a241..a451999 100644
--- a/tester/covoar/CoverageWriterRTEMS.cc
+++ b/tester/covoar/CoverageWriterRTEMS.cc
@@ -30,9 +30,9 @@ namespace Coverage {
 
   void CoverageWriterRTEMS::writeFile(
 const std::string& file,
-CoverageMapBase*  coverage,
-uint32_t  lowAddress,
-uint32_t  highAddress
+CoverageMapBase*   coverage,
+uint32_t   lowAddress,
+uint32_t   highAddress
   )
   {
 std::ofstream   coverageFile;
@@ -52,9 +52,9 @@ namespace Coverage {
 }
 
 /* clear out the header and fill it in */
-memset( &header, 0, sizeof(header) );
+memset( &header, 0, sizeof( header ) );
 header.ver   = 0x1;
-header.header_length = sizeof(header);
+header.header_length = sizeof( header );
 header.start = lowAddress;
 header.end   = highAddress;
 strcpy( header.desc, "RTEMS Coverage Data" );
@@ -68,8 +68,8 @@ namespace Coverage {
   throw rld::error( what, "CoverageWriterRTEMS::writeFile" );
 }
 
-for ( a=lowAddress ; a < highAddress ; a++ ) {
-  cover  = ((coverage->wasExecuted( a )) ? 0x01 : 0);
+for ( a = lowAddress; a < highAddress; a++ ) {
+  cover  = ( ( coverage->wasExecuted( a ) ) ? 0x01 : 0 );
 
   bytes_before = coverageFile.tellp();
 
@@ -78,9 +78,9 @@ namespace Coverage {
 std::cerr << "CoverageWriterRTEMS::writeFile - write to "
   << file
   << " at address 0x%"
-  << std::hex << std::setfill('0')
-  << std::setw(8) << a
-  << std::setfill(' ') << std::dec
+  << std::hex << std::setfill( '0' )
+  << std::setw( 8 ) << a
+  << std::setfill( ' ' ) << std::dec
   << " failed"
   << std::endl;
   }
-- 
1.8.3.1

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


[PATCH rtems-tools v2 06/10] CoverageWriterRTEMS.h: Fix formatting

2021-09-10 Thread Ryan Long
---
 tester/covoar/CoverageWriterRTEMS.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tester/covoar/CoverageWriterRTEMS.h 
b/tester/covoar/CoverageWriterRTEMS.h
index c760936..9110303 100644
--- a/tester/covoar/CoverageWriterRTEMS.h
+++ b/tester/covoar/CoverageWriterRTEMS.h
@@ -36,9 +36,9 @@ namespace Coverage {
 /* Inherit documentation from base class. */
 void writeFile(
   const std::string& file,
-  CoverageMapBase*  coverage,
-  uint32_t  lowAddress,
-  uint32_t  highAddress
+  CoverageMapBase*   coverage,
+  uint32_t   lowAddress,
+  uint32_t   highAddress
 );
   };
 
-- 
1.8.3.1

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


[PATCH rtems-tools v2 07/10] CoverageWriterSkyeye.cc: Fix formatting

2021-09-10 Thread Ryan Long
---
 tester/covoar/CoverageWriterSkyeye.cc | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tester/covoar/CoverageWriterSkyeye.cc 
b/tester/covoar/CoverageWriterSkyeye.cc
index fcc7052..f7c71c4 100644
--- a/tester/covoar/CoverageWriterSkyeye.cc
+++ b/tester/covoar/CoverageWriterSkyeye.cc
@@ -54,9 +54,9 @@ namespace Coverage {
 }
 
 /* clear out the header and fill it in */
-memset( &header, 0, sizeof(header) );
+memset( &header, 0, sizeof( header ) );
 header.ver   = 0x1;
-header.header_length = sizeof(header);
+header.header_length = sizeof( header );
 header.prof_start= lowAddress;
 header.prof_end  = highAddress;
 strcpy( header.desc, "Skyeye Coverage Data" );
@@ -81,9 +81,9 @@ namespace Coverage {
 std::ostringstream what;
 what << "write to " << file
  << " at address 0x"
- << std::hex << std::setfill('0')
- << std::setw(8) << a
- << std::setfill(' ') << std::dec
+ << std::hex << std::setfill( '0' )
+ << std::setw( 8 ) << a
+ << std::setfill( ' ' ) << std::dec
  << "failed";
 throw rld::error( what, "CoverageWriterSkyeye::writeFile" );
   }
-- 
1.8.3.1

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


[PATCH rtems-tools v2 08/10] CoverageWriterSkyeye.h: Fix formatting

2021-09-10 Thread Ryan Long
---
 tester/covoar/CoverageWriterSkyeye.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tester/covoar/CoverageWriterSkyeye.h 
b/tester/covoar/CoverageWriterSkyeye.h
index 8f11959..5ef6432 100644
--- a/tester/covoar/CoverageWriterSkyeye.h
+++ b/tester/covoar/CoverageWriterSkyeye.h
@@ -36,9 +36,9 @@ namespace Coverage {
 /* Inherit documentation from base class. */
 void writeFile(
   const std::string& file,
-  CoverageMapBase*  coverage,
-  uint32_t  lowAddress,
-  uint32_t  highAddress
+  CoverageMapBase*   coverage,
+  uint32_t   lowAddress,
+  uint32_t   highAddress
 );
   };
 
-- 
1.8.3.1

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


[PATCH rtems-tools v2 09/10] CoverageWriterTSIM.cc: Fix formatting

2021-09-10 Thread Ryan Long
---
 tester/covoar/CoverageWriterTSIM.cc | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/tester/covoar/CoverageWriterTSIM.cc 
b/tester/covoar/CoverageWriterTSIM.cc
index 9ec12e4..ed9da96 100644
--- a/tester/covoar/CoverageWriterTSIM.cc
+++ b/tester/covoar/CoverageWriterTSIM.cc
@@ -29,15 +29,15 @@ namespace Coverage {
 
   void CoverageWriterTSIM::writeFile(
 const std::string& file,
-CoverageMapBase*  coverage,
-uint32_t  lowAddress,
-uint32_t  highAddress
+CoverageMapBase*   coverage,
+uint32_t   lowAddress,
+uint32_t   highAddress
   )
   {
-uint32_t a;
-int  cover;
+uint32_t  a;
+int   cover;
 std::ofstream coverageFile;
-int  i;
+int   i;
 
 /*
  *  read the file and update the coverage map passed in
@@ -54,23 +54,23 @@ namespace Coverage {
   if ( coverageFile.fail() ) {
 break;
   }
+
   for ( i = 0; i < 0x80; i += 4 ) {
-cover = ((coverage->wasExecuted( a + i )) ? 1 : 0);
+cover = ( ( coverage->wasExecuted( a + i ) ) ? 1 : 0 );
 coverageFile << cover << " ";
 
 if ( coverageFile.fail() ) {
   std::ostringstream what;
   what << "write to " << file
<< " at address 0x"
-   << std::hex << std::setfill('0')
-   << std::setw(8) << a
-   << std::setfill(' ') << std::dec
+   << std::hex << std::setfill( '0' )
+   << std::setw( 8 ) << a
+   << std::setfill( ' ' ) << std::dec
<< "failed";
   throw rld::error( what, "CoverageWriterTSIM::writeFile" );
 }
   }
   coverageFile << std::endl;
 }
-
   }
 }
-- 
1.8.3.1

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


[PATCH rtems-tools v2 10/10] CoverageWriterTSIM.h: Fix formatting

2021-09-10 Thread Ryan Long
---
 tester/covoar/CoverageWriterTSIM.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tester/covoar/CoverageWriterTSIM.h 
b/tester/covoar/CoverageWriterTSIM.h
index 5ae57f8..9325a6a 100644
--- a/tester/covoar/CoverageWriterTSIM.h
+++ b/tester/covoar/CoverageWriterTSIM.h
@@ -36,9 +36,9 @@ namespace Coverage {
 /* Inherit documentation from base class. */
 void writeFile(
   const std::string& file,
-  CoverageMapBase*  coverage,
-  uint32_t  lowAddress,
-  uint32_t  highAddress
+  CoverageMapBase*   coverage,
+  uint32_t   lowAddress,
+  uint32_t   highAddress
 );
   };
 
-- 
1.8.3.1

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


Re: [PATCH rtems-tools v2 00/10] Convert and reformat pt. 2

2021-09-10 Thread Chris Johns
Ok to push.

Thanks

On 11/9/21 4:03 am, Ryan Long wrote:
> Hi,
> 
> For these patches I
> 
> - Changed the data type of bytes_before so that it builds with clang
> - Replaced instances of "\n" with std::endl
> - Changed .c_str() argument to just a string
> 
> Thanks,
> Ryan
> 
> Ryan Long (10):
>   CoverageWriter: Convert to C++
>   covoar.cc: Convert to C++
>   CoverageWriterBase.h: Fix formatting
>   covoar.cc: Fix formatting
>   CoverageWriterRTEMS.cc: Fix formatting
>   CoverageWriterRTEMS.h: Fix formatting
>   CoverageWriterSkyeye.cc: Fix formatting
>   CoverageWriterSkyeye.h: Fix formatting
>   CoverageWriterTSIM.cc: Fix formatting
>   CoverageWriterTSIM.h: Fix formatting
> 
>  tester/covoar/CoverageWriterBase.h|  10 +-
>  tester/covoar/CoverageWriterRTEMS.cc  |  46 ++---
>  tester/covoar/CoverageWriterRTEMS.h   |  10 +-
>  tester/covoar/CoverageWriterSkyeye.cc |  49 ++---
>  tester/covoar/CoverageWriterSkyeye.h  |  10 +-
>  tester/covoar/CoverageWriterTSIM.cc   |  45 +++--
>  tester/covoar/CoverageWriterTSIM.h|  10 +-
>  tester/covoar/covoar.cc   | 334 
> ++
>  8 files changed, 279 insertions(+), 235 deletions(-)
> 
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel