Re: [PATCH] covoar: Fix errors building on FreeBSD and clang

2021-07-14 Thread Alex White
On Tue, Jul 6, 2021 at 7:55 PM Chris Johns  wrote:
>
> On 3/7/21 5:56 am, Alex White wrote:
> > On Wed, Jun 30, 2021 at 11:40 PM  wrote:
> >>
> >> From: Chris Johns 
> >>
> >> - The member variable `path_` cannot be a reference and initialised to
> >>   a const char* type input. To do so would require there is a temporary 
> >> with
> >>   an unspecified life time.
> >> ---
> >>  tester/covoar/AddressToLineMapper.h | 2 +-
> >>  tester/covoar/Target_aarch64.h  | 2 +-
> >>  2 files changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/tester/covoar/AddressToLineMapper.h
> > b/tester/covoar/AddressToLineMapper.h
> >> index 88bf475..c78aef7 100644
> >> --- a/tester/covoar/AddressToLineMapper.h
> >> +++ b/tester/covoar/AddressToLineMapper.h
> >> @@ -84,7 +84,7 @@ namespace Coverage {
> >>   *  An iterator pointing to the location in the set that contains the
> >>   *  source file path of the address.
> >>   */
> >> -const std::string& path_;
> >> +const std::string path_;
> >
> > Ryan alerted me about this issue a couple weeks back. This patch would fix 
> > the
> > problem, but it would lead to a second copy of every file path string being
> > stored in memory. This would also take away the usefulness of the set of 
> > file
> > path strings maintained by the AddressLineRange class.
> >
> > Instead, I propose we change the empty SourceLine constructor to take a 
> > `const
> > std::string&`. This would allow the addition of something like this to the 
> > top
> > of AddressToLineMapper::getSource():
> > const std::string unknown = "unknown";
> > const SourceLine default_sourceline = SourceLine(unknown);
> >
> > That should eliminate the issue and preserve the memory conservation 
> > efforts of
> > the original design.
>
> Yes it would but for some reason, that I cannot put my finger on, it seems 
> like
> a breach of boundaries between classes.
>
> How much data are we talking about? Are you able to see the memory foot print
> with the strings being contained vs what you have now?

Sorry for the late reply.

What I have now yields a peak memory usage for covoar when run on all ARM tests 
of 219 MB.
Changing `SourceLine::path_` to plain `std::string` results in an increase to 
523 MB.

So it is a significant increase.

>
> If the figures show the strings need to be shared to avoid a memory blow out
> would a std::shared_ptr be something to look at where all
> references are a shared pointer? A shared pointer means any changes do not 
> flow
> from one class to other.

I don't think that `std::shared_ptr` would help here. Wouldn't that handle the 
case of an unknown path the same way as a raw pointer solution? Wouldn't we 
still have to check the return value of `SourceLine::path()` to make sure that 
it is not null?
The only other way I see to make it work would be to store some "unknown" 
string object and hand pointers to it to all `SourceLine` objects with unknown 
paths. But that seems mostly equivalent to what I propose in my original reply 
to this patch.

Now that I think about it, maybe making `SourceLine::_path` into an 
`std::string*` and doing a `nullptr` check in the `SourceLine::path()` would be 
most elegant?
That way we don't have to do any `nullptr` checks outside of the `SourceLine` 
implementation. We could just have `SourceLine::path()` return a plain old 
`std::string` and do something like this:

if (_path == nullptr) {
return "unknown";
else {
return *_path;
}

Alex

>
> Chris
> ___
> 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: [PATCH rtems-docs] user: Update ZynqMP network configuration

2021-07-14 Thread Chris Johns
OK

On 15/7/21 5:56 am, Kinsey Moore wrote:
> Network configuration is now automatic and requires no user
> configuration.
> ---
>  user/bsps/aarch64/xilinx-zynqmp.rst | 11 +++
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/user/bsps/aarch64/xilinx-zynqmp.rst 
> b/user/bsps/aarch64/xilinx-zynqmp.rst
> index 71b6842..90270db 100644
> --- a/user/bsps/aarch64/xilinx-zynqmp.rst
> +++ b/user/bsps/aarch64/xilinx-zynqmp.rst
> @@ -59,14 +59,9 @@ Network Configuration
>  -
>  
>  When used with LibBSD, these BSP variants support networking via the four
> -Cadence GEM instances present on all ZynqMP hardware variants. These are 
> enabled
> -using config.inc in LibBSD by setting any of the following constants to 1:
> -NET_CFG_ZYNQMP_USE_CGEM0 = 1
> -NET_CFG_ZYNQMP_USE_CGEM1 = 1
> -NET_CFG_ZYNQMP_USE_CGEM2 = 1
> -NET_CFG_ZYNQMP_USE_CGEM3 = 1
> -
> -Most ZynqMP dev boards use CGEM3. None of the interfaces are enabled by 
> default.
> +Cadence GEM instances present on all ZynqMP hardware variants. All interfaces
> +are enabled by default, but only interfaces with operational MII busses will 
> be
> +recognized and usable in RTEMS. Most ZynqMP dev boards use CGEM3.
>  
>  Running Executables on QEMU
>  ---
> 
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH rtems-docs] user: Update ZynqMP network configuration

2021-07-14 Thread Kinsey Moore
Network configuration is now automatic and requires no user
configuration.
---
 user/bsps/aarch64/xilinx-zynqmp.rst | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/user/bsps/aarch64/xilinx-zynqmp.rst 
b/user/bsps/aarch64/xilinx-zynqmp.rst
index 71b6842..90270db 100644
--- a/user/bsps/aarch64/xilinx-zynqmp.rst
+++ b/user/bsps/aarch64/xilinx-zynqmp.rst
@@ -59,14 +59,9 @@ Network Configuration
 -
 
 When used with LibBSD, these BSP variants support networking via the four
-Cadence GEM instances present on all ZynqMP hardware variants. These are 
enabled
-using config.inc in LibBSD by setting any of the following constants to 1:
-NET_CFG_ZYNQMP_USE_CGEM0 = 1
-NET_CFG_ZYNQMP_USE_CGEM1 = 1
-NET_CFG_ZYNQMP_USE_CGEM2 = 1
-NET_CFG_ZYNQMP_USE_CGEM3 = 1
-
-Most ZynqMP dev boards use CGEM3. None of the interfaces are enabled by 
default.
+Cadence GEM instances present on all ZynqMP hardware variants. All interfaces
+are enabled by default, but only interfaces with operational MII busses will be
+recognized and usable in RTEMS. Most ZynqMP dev boards use CGEM3.
 
 Running Executables on QEMU
 ---
-- 
2.20.1

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


Re: [PATCH v2] bsps/irq: Implement new directives for GICv2/3

2021-07-14 Thread Kinsey Moore

Looks good, minor nits below.

On 7/14/2021 06:54, Sebastian Huber wrote:

Update #3269.
---
  bsps/include/dev/irq/arm-gic-irq.h |   3 +
  bsps/shared/dev/irq/arm-gicv2.c|  83 +++
  bsps/shared/dev/irq/arm-gicv3.c| 125 +
  3 files changed, 180 insertions(+), 31 deletions(-)

diff --git a/bsps/include/dev/irq/arm-gic-irq.h 
b/bsps/include/dev/irq/arm-gic-irq.h
index 68e0247fd8..398fd8bceb 100644
--- a/bsps/include/dev/irq/arm-gic-irq.h
+++ b/bsps/include/dev/irq/arm-gic-irq.h
@@ -46,6 +46,9 @@ extern "C" {
  #define ARM_GIC_IRQ_SGI_13 13
  #define ARM_GIC_IRQ_SGI_14 14
  #define ARM_GIC_IRQ_SGI_15 15
+#define ARM_GIC_IRQ_SGI_LAST 15
+
+#define ARM_GIC_IRQ_PPI_LAST 31
  
  #define ARM_GIC_DIST ((volatile gic_dist *) BSP_ARM_GIC_DIST_BASE)
  
diff --git a/bsps/shared/dev/irq/arm-gicv2.c b/bsps/shared/dev/irq/arm-gicv2.c

index a1ba5e9112..83422218da 100644
--- a/bsps/shared/dev/irq/arm-gicv2.c
+++ b/bsps/shared/dev/irq/arm-gicv2.c
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2013, 2019 embedded brains GmbH.  All rights reserved.
+ * Copyright (c) 2013, 2021 embedded brains GmbH.  All rights reserved.
   *
   *  embedded brains GmbH
   *  Dornierstr. 4
@@ -69,6 +69,28 @@ rtems_status_code bsp_interrupt_get_attributes(
rtems_interrupt_attributes *attributes
  )
  {
+  attributes->is_maskable = true;
+  attributes->maybe_enable = true;
+  attributes->maybe_disable = true;
+
+  if ( vector <= ARM_GIC_IRQ_SGI_LAST ) {

can_cause = true is in both branches and should be pulled out.

+attributes->can_cause = true;
+attributes->can_cause_on = true;
+attributes->cleared_by_acknowledge = true;
+attributes->trigger_signal = RTEMS_INTERRUPT_NO_SIGNAL;
+  } else {
+attributes->can_disable = true;
+attributes->can_cause = true;
+attributes->can_clear = true;
+attributes->trigger_signal = RTEMS_INTERRUPT_UNSPECIFIED_SIGNAL;
+
+if ( vector > ARM_GIC_IRQ_PPI_LAST ) {
+  /* SPI */
+  attributes->can_get_affinity = true;
+  attributes->can_set_affinity = true;
+}
+  }
+
return RTEMS_SUCCESSFUL;
  }
  
@@ -77,16 +99,25 @@ rtems_status_code bsp_interrupt_is_pending(

bool   *pending
  )
  {
-  bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
-  bsp_interrupt_assert(pending != NULL);
-  *pending = false;
-  return RTEMS_UNSATISFIED;
+  volatile gic_dist *dist = ARM_GIC_DIST;
+
+  *pending = gic_id_is_pending(dist, vector);
+  return RTEMS_SUCCESSFUL;
  }
  
  rtems_status_code bsp_interrupt_cause(rtems_vector_number vector)

  {
bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
-  return RTEMS_UNSATISFIED;
+
+  if (vector <= ARM_GIC_IRQ_SGI_LAST) {
+arm_gic_trigger_sgi(vector, 1U << _SMP_Get_current_processor());
+  } else {
+volatile gic_dist *dist = ARM_GIC_DIST;
+
+gic_id_set_pending(dist, vector);
+  }
+
+  return RTEMS_SUCCESSFUL;
  }
  
  #if defined(RTEMS_SMP)

@@ -95,15 +126,27 @@ rtems_status_code bsp_interrupt_cause_on(
uint32_tcpu_index
  )
  {
-  bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
-  return RTEMS_UNSATISFIED;
+  if (vector >= 16) {
+return RTEMS_UNSATISFIED;
+  }
+
+  arm_gic_trigger_sgi(vector, 1U << cpu_index);
+  return RTEMS_SUCCESSFUL;
  }
  #endif
  
  rtems_status_code bsp_interrupt_clear(rtems_vector_number vector)

  {
+  volatile gic_dist *dist = ARM_GIC_DIST;
+
bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
-  return RTEMS_UNSATISFIED;
+
+  if (vector <= ARM_GIC_IRQ_SGI_LAST) {
+return RTEMS_UNSATISFIED;
+  }
+
+  gic_id_clear_pending(dist, vector);
+  return RTEMS_SUCCESSFUL;
  }
  
  rtems_status_code bsp_interrupt_vector_is_enabled(

@@ -111,10 +154,13 @@ rtems_status_code bsp_interrupt_vector_is_enabled(
bool   *enabled
  )
  {
+  volatile gic_dist *dist = ARM_GIC_DIST;
+
bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
bsp_interrupt_assert(enabled != NULL);
-  *enabled = false;
-  return RTEMS_UNSATISFIED;
+
+  *enabled = gic_id_is_enabled(dist, vector);
+  return RTEMS_SUCCESSFUL;
  }
  
  rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)

@@ -207,8 +253,8 @@ BSP_START_TEXT_SECTION void 
arm_gic_irq_initialize_secondary_cpu(void)
dist->icdigr[0] = 0x;
  #endif
  
-  /* Initialize Peripheral Private Interrupts (PPIs) */

-  for (id = 0; id < 32; ++id) {
+  /* Initialize priority of SGIs and PPIs */
+  for (id = 0; id <= ARM_GIC_IRQ_PPI_LAST; ++id) {
  gic_id_set_priority(dist, id, PRIORITY_DEFAULT);
}
  
@@ -300,6 +346,10 @@ rtems_status_code bsp_interrupt_set_affinity(

volatile gic_dist *dist = ARM_GIC_DIST;
uint8_t targets = (uint8_t) _Processor_mask_To_uint32_t(affinity, 0);
  
+  if ( vector <= ARM_GIC_IRQ_PPI_LAST ) {

+return RTEMS_UNSATISFIED;
+  }
+
gic_id_set_targets(dist, vector, targets);
return RTEMS_SUCCESSFUL;
  }
@@ -310,8 +360,13 @@ rtems_status_code 

Re: [PATCH rtems-libbsd 0/4] Beagle BSP: USB Template Driver for CDC Ethernet

2021-07-14 Thread Ahamed Husni
Hi,

Ping :)

On Tue, Jul 6, 2021 at 10:30 PM Husni Faiz  wrote:

> This set of patches import the drivers from freebsd and
> configures it for the beagle bsp.
>
> Github Branch for the commits
> https://github.com/drac98/rtems-libbsd/commits/usb-cdce
>
> Husni Faiz (4):
>   usb_template:Import CDC Ethernet
>   usb_template: Configure template driver only for CDC Ethernet
>   nexus-devices: Include CDC Ethernet for Beagle
>   libbsd.py: add usb template files
>
>  buildset/default.ini  |1 +
>  buildset/minimal.ini  |3 +-
>  freebsd/sys/dev/usb/template/usb_template.c   | 1493 +
>  freebsd/sys/dev/usb/template/usb_template.h   |  130 ++
>  .../sys/dev/usb/template/usb_template_cdce.c  |  355 
>  freebsd/sys/dev/usb/usb_device.c  |4 +-
>  libbsd.py |   25 +
>  rtemsbsd/include/bsp/nexus-devices.h  |5 +
>  .../include/machine/rtems-bsd-nexus-bus.h |   17 +
>  9 files changed, 2030 insertions(+), 3 deletions(-)
>  create mode 100644 freebsd/sys/dev/usb/template/usb_template.c
>  create mode 100644 freebsd/sys/dev/usb/template/usb_template.h
>  create mode 100644 freebsd/sys/dev/usb/template/usb_template_cdce.c
>
> --
> 2.25.1
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

FW: Flight Software Workshop, February 2022

2021-07-14 Thread Jeff Mayes
FYI.


From: Flight Software Workshop 
Sent: Tuesday, July 13, 2021 1:15 PM
To: Jeff Mayes 
Subject: Flight Software Workshop, February 2022

Save the Date!





[https://files.constantcontact.com/5adddbe6301/8f06287d-7a38-40f0-8dc2-c4adc01b7242.png]





Dear Flight Software Workshop Community,

The Johns Hopkins University Applied Physics Laboratory is hosting the 15th 
Workshop on Spacecraft Flight Software (FSW-2022) from Monday, February 7th to 
Thursday, February 10th, 2022.

We were elated to have so many engineers, enthusiasts, and students from all 
around the world attend last year. You as a community brought an overwhelming 
flood of enthusiasm and passion that made our exchange of knowledge flourish 
and the Workshop so successful. While we desire to gather in person again, we 
have decided to stay all-virtual and FREE for one more year.



The Flight Software Workshop is a presentation-only (i.e. no papers) conference 
that draws top engineers from leading aerospace organizations from around the 
world to present on current and next generation flight architectures, software 
development and verification techniques, challenges, and solutions.

We will be sending out further information about the Workshop cycle, (such as 
abstract submission windows and opening of registration) in a future update. If 
this email was forwarded to you, make sure to sign up for our mailing 
list
 to receive all future communications.

In the meantime, mark your calendars and please consider presenting!

Thanks, and we’re looking forward to another great, virtual Flight Software 
Workshop.



Brandon Haber, JHU/APL
Flight Software Workshop Organizing Committee
http://flightsoftware.org
i...@flightsoftware.org





Many thanks to the institutions that help make the Workshop possible.

NASA Jet Propulsion Laboratory
NASA Goddard Space Flight Center
The Aerospace Corporation
Southwest Research Institute




Workshop 
Website
Contact Us!
Join This Mailing 
List

Flight Software Workshop | 11101 Johns Hopkins Road, Embedded Flight Software 
Group, Space Department, Laurel, MD 20723
Unsubscribe 
jeff.ma...@oarcorp.com
Update 
Profile
 | Constant Contact Data 
Notice
Sent by i...@flightsoftware.org powered by
[Trusted Email from Constant Contact - Try it FREE 
today.]
Try email marketing for free 
today!

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

Re: [PATCH rtems-docs v1 2/2] user/bsps/aarch64: Minor formatting fix

2021-07-14 Thread Joel Sherrill
This looks ok to me.

--joel

On Wed, Jul 14, 2021 at 10:35 AM Stephen Clark
 wrote:
>
> Fixed formatting error in user/bsps/aarch64/a53.rst
> and user/bsps/aarch64/xilinx-zynqmp.rst.
> ---
>  user/bsps/aarch64/a53.rst   | 8 +---
>  user/bsps/aarch64/xilinx-zynqmp.rst | 8 +---
>  2 files changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/user/bsps/aarch64/a53.rst b/user/bsps/aarch64/a53.rst
> index 52e1509..9d8e1ce 100644
> --- a/user/bsps/aarch64/a53.rst
> +++ b/user/bsps/aarch64/a53.rst
> @@ -29,7 +29,9 @@ The console driver supports the default Qemu emulated ARM 
> PL011 PrimeCell UART.
>  Running Executables
>  ---
>
> -Executables generated by these BSPs can be run using the following command::
> +Executables generated by these BSPs can be run using the following command:
>
> -qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio \
> - -machine virt,gic-version=3 -cpu cortex-a53 -m 4096 -kernel example.exe
> +.. code-block:: shell
> +
> +  qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio \
> +   -machine virt,gic-version=3 -cpu cortex-a53 -m 4096 -kernel example.exe
> diff --git a/user/bsps/aarch64/xilinx-zynqmp.rst 
> b/user/bsps/aarch64/xilinx-zynqmp.rst
> index 30ae8a3..85c70e0 100644
> --- a/user/bsps/aarch64/xilinx-zynqmp.rst
> +++ b/user/bsps/aarch64/xilinx-zynqmp.rst
> @@ -85,7 +85,9 @@ Most ZynqMP dev boards use CGEM3. None of the interfaces 
> are enabled by default.
>  Running Executables on QEMU
>  ---
>
> -Executables generated by these BSPs can be run using the following command::
> +Executables generated by these BSPs can be run using the following command:
>
> -qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio \
> - -machine xlnx-zcu102 -m 4096 -kernel example.exe
> +.. code-block:: shell
> +
> +  qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio \
> +   -machine xlnx-zcu102 -m 4096 -kernel example.exe
> --
> 2.27.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 rtems-docs v1 2/2] user/bsps/aarch64: Minor formatting fix

2021-07-14 Thread Stephen Clark
Fixed formatting error in user/bsps/aarch64/a53.rst
and user/bsps/aarch64/xilinx-zynqmp.rst.
---
 user/bsps/aarch64/a53.rst   | 8 +---
 user/bsps/aarch64/xilinx-zynqmp.rst | 8 +---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/user/bsps/aarch64/a53.rst b/user/bsps/aarch64/a53.rst
index 52e1509..9d8e1ce 100644
--- a/user/bsps/aarch64/a53.rst
+++ b/user/bsps/aarch64/a53.rst
@@ -29,7 +29,9 @@ The console driver supports the default Qemu emulated ARM 
PL011 PrimeCell UART.
 Running Executables
 ---
 
-Executables generated by these BSPs can be run using the following command::
+Executables generated by these BSPs can be run using the following command:
 
-qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio \
- -machine virt,gic-version=3 -cpu cortex-a53 -m 4096 -kernel example.exe
+.. code-block:: shell
+
+  qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio \
+   -machine virt,gic-version=3 -cpu cortex-a53 -m 4096 -kernel example.exe
diff --git a/user/bsps/aarch64/xilinx-zynqmp.rst 
b/user/bsps/aarch64/xilinx-zynqmp.rst
index 30ae8a3..85c70e0 100644
--- a/user/bsps/aarch64/xilinx-zynqmp.rst
+++ b/user/bsps/aarch64/xilinx-zynqmp.rst
@@ -85,7 +85,9 @@ Most ZynqMP dev boards use CGEM3. None of the interfaces are 
enabled by default.
 Running Executables on QEMU
 ---
 
-Executables generated by these BSPs can be run using the following command::
+Executables generated by these BSPs can be run using the following command:
 
-qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio \
- -machine xlnx-zcu102 -m 4096 -kernel example.exe
+.. code-block:: shell
+
+  qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio \
+   -machine xlnx-zcu102 -m 4096 -kernel example.exe
-- 
2.27.0

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


[PATCH rtems-docs v1 1/2] xilinx-zynqmp.rst: Documented SDIO driver

2021-07-14 Thread Stephen Clark
Added documentation for SDIO driver.
---
 user/bsps/aarch64/xilinx-zynqmp.rst | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/user/bsps/aarch64/xilinx-zynqmp.rst 
b/user/bsps/aarch64/xilinx-zynqmp.rst
index 71b6842..30ae8a3 100644
--- a/user/bsps/aarch64/xilinx-zynqmp.rst
+++ b/user/bsps/aarch64/xilinx-zynqmp.rst
@@ -55,6 +55,20 @@ Console Driver
 The console driver supports the default Qemu emulated ARM PL011 PrimeCell UART
 as well as the physical ARM PL011 PrimeCell UART in the ZynqMP hardware.
 
+SDHCI Driver
+
+
+The ZynqMP bsp has an SDHCI driver which allows reading to and writing from SD 
+cards. These can be tested in qemu using the "-sd" option. For example:
+
+.. code-block:: shell
+  
+  qemu-system-aarch64 -no-reboot -nographic -serial mon:stdio \
+   -machine xlnx-zcu102 -m 4096 -kernel media01.exe -sd example.img
+
+The SD card image should have an MSDOS partition table with a single partition
+containing a FAT file system.
+
 Network Configuration
 -
 
-- 
2.27.0

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


[PATCH v1 4/6] ReportsHtml.h: Fix formatting

2021-07-14 Thread Ryan Long
---
 tester/covoar/ReportsHtml.h | 88 +
 1 file changed, 32 insertions(+), 56 deletions(-)

diff --git a/tester/covoar/ReportsHtml.h b/tester/covoar/ReportsHtml.h
index 21ca8bd..a7ed0af 100644
--- a/tester/covoar/ReportsHtml.h
+++ b/tester/covoar/ReportsHtml.h
@@ -33,9 +33,7 @@ class ReportsHtml: public ReportsBase {
 *
 *  @param[in] fileName identifies the file name.
 */
-   void WriteIndex(
- const std::string& fileName
-   ) override;
+   void WriteIndex( const std::string& fileName ) override;
 
/*!
 *  This method produces a report that contains information about each
@@ -43,9 +41,7 @@ class ReportsHtml: public ReportsBase {
 *
 *  @param[in] fileName identifies the branch report file name
 */
-   void WriteBranchReport(
- const std::string& fileName
-   );
+   void WriteBranchReport( const std::string& fileName );
 
/*!
 *  This method produces a report that contains information about each
@@ -53,9 +49,7 @@ class ReportsHtml: public ReportsBase {
 *
 *  @param[in] fileName identifies the coverage report file name
 */
-   void WriteCoverageReport(
- const std::string& fileName
-   );
+   void WriteCoverageReport( const std::string& fileName );
 
/*!
 *  This method produces a summary report that lists each uncovered
@@ -63,9 +57,7 @@ class ReportsHtml: public ReportsBase {
 *
 *  @param[in] fileName identifies the size report file name
 */
-   void WriteSizeReport(
- const std::string& fileName
-   );
+   void WriteSizeReport( const std::string& fileName );
 
   protected:
 
@@ -115,35 +107,25 @@ class ReportsHtml: public ReportsBase {
 );
 
 /* Inherit documentation from base class. */
-virtual void CloseAnnotatedFile(
-  std::ofstream& aFile
-);
+virtual void CloseAnnotatedFile( std::ofstream& aFile );
 
 /* Inherit documentation from base class. */
 virtual void CloseBranchFile(
   std::ofstream& aFile,
-  bool   hasBranches
+  bool   hasBranches
 );
 
 /* Inherit documentation from base class. */
-virtual void CloseCoverageFile(
-  std::ofstream& aFile
-);
+virtual void CloseCoverageFile( std::ofstream& aFile );
 
 /* Inherit documentation from base class. */
-void CloseNoRangeFile(
-  std::ofstream& aFile
-);
+void CloseNoRangeFile( std::ofstream& aFile );
 
 /* Inherit documentation from base class. */
-virtual void CloseSizeFile(
-  std::ofstream& aFile
-);
+virtual void CloseSizeFile( std::ofstream& aFile );
 
 /* Inherit documentation from base class. */
-virtual void CloseSymbolSummaryFile(
-  std::ofstream& aFile
-);
+virtual void CloseSymbolSummaryFile( std::ofstream& aFile );
 
 /* Inherit documentation from base class. */
 virtual void PutAnnotatedLine(
@@ -154,27 +136,21 @@ class ReportsHtml: public ReportsBase {
 );
 
 /* Inherit documentation from base class. */
- virtual void AnnotatedStart(
-   std::ofstream& aFile
-);
+ virtual void AnnotatedStart( std::ofstream& aFile );
 
 /* Inherit documentation from base class. */
- virtual void AnnotatedEnd(
-   std::ofstream& aFile
-);
+ virtual void AnnotatedEnd( std::ofstream& aFile );
 
 /* Inherit documentation from base class. */
-virtual bool PutNoBranchInfo(
-  std::ofstream& report
-);
+virtual bool PutNoBranchInfo( std::ofstream& report );
 
 /* Inherit documentation from base class. */
 virtual bool PutBranchEntry(
-  std::ofstream&   report,
-  unsigned int number,
-  const std::string&   symbolName,
-  const SymbolInformation& symbolInfo,
-  const CoverageRanges::coverageRange_t&   range
+  std::ofstream& report,
+  unsigned int   number,
+  const std::string& symbolName,
+  const SymbolInformation&   symbolInfo,
+  const CoverageRanges::coverageRange_t& range
 );
 
 /* Inherit documentation from base class. */
@@ -187,33 +163,33 @@ class ReportsHtml: public ReportsBase {
 
 /* Inherit documentation from base class. */
 virtual bool PutCoverageLine(
-  std::ofstream&  report,
-  unsigned intnumber,
-  const std::string&  symbolName,
-  const SymbolInformation&symbolInfo,
-  const CoverageRanges::coverageRange_t&  range
+  std::ofstream& report,
+  unsigned int   number,
+  const std::string& symbolName,
+  const SymbolInformation&   symbolInfo,
+  const 

[PATCH v1 5/6] ReportsText.cc: Fix formatting

2021-07-14 Thread Ryan Long
---
 tester/covoar/ReportsText.cc | 103 +++
 1 file changed, 54 insertions(+), 49 deletions(-)

diff --git a/tester/covoar/ReportsText.cc b/tester/covoar/ReportsText.cc
index 35ad786..146fc35 100644
--- a/tester/covoar/ReportsText.cc
+++ b/tester/covoar/ReportsText.cc
@@ -23,17 +23,13 @@ ReportsText::~ReportsText()
 {
 }
 
-void ReportsText::AnnotatedStart(
-  std::ofstream& aFile
-)
+void ReportsText::AnnotatedStart( std::ofstream& aFile )
 {
   aFile << ""
 << "===" << std::endl;
 }
 
-void ReportsText::AnnotatedEnd(
-  std::ofstream& aFile
-)
+void ReportsText::AnnotatedEnd( std::ofstream& aFile )
 {
 }
 
@@ -47,25 +43,27 @@ void ReportsText::PutAnnotatedLine(
   aFile << line << std::endl;
 }
 
-bool ReportsText::PutNoBranchInfo(
-  std::ofstream& report
-)
+bool ReportsText::PutNoBranchInfo( std::ofstream& report )
 {
-  if ( BranchInfoAvailable &&
-SymbolsToAnalyze->getNumberBranchesFound(symbolSetName_m) != 0 )
+  if (
+BranchInfoAvailable &&
+SymbolsToAnalyze->getNumberBranchesFound( symbolSetName_m ) != 0
+  ) {
 report << "All branch paths taken." << std::endl;
-  else
+  } else {
 report << "No branch information found." << std::endl;
+  }
+
   return true;
 }
 
 
 bool ReportsText::PutBranchEntry(
-  std::ofstream&   report,
-  unsigned int number,
-  const std::string&   symbolName,
-  const SymbolInformation& symbolInfo,
-  const CoverageRanges::coverageRange_t&   range
+  std::ofstream& report,
+  unsigned int   number,
+  const std::string& symbolName,
+  const SymbolInformation&   symbolInfo,
+  const CoverageRanges::coverageRange_t& range
 )
 {
   const Coverage::Explanation* explanation;
@@ -79,14 +77,19 @@ bool ReportsText::PutBranchEntry(
  << "Size in Bytes : " << range.highAddress - range.lowAddress + 1
  << std::dec << std::endl;
 
-  if (range.reason ==
-Coverage::CoverageRanges::UNCOVERED_REASON_BRANCH_ALWAYS_TAKEN)
+  if (
+range.reason ==
+Coverage::CoverageRanges::UNCOVERED_REASON_BRANCH_ALWAYS_TAKEN
+  ) {
 report << "Reason: ALWAYS TAKEN"
<< std::endl << std::endl;
-  else if (range.reason ==
-Coverage::CoverageRanges::UNCOVERED_REASON_BRANCH_NEVER_TAKEN)
-  report << "Reason: NEVER TAKEN"
- << std::endl << std::endl;
+  } else if (
+range.reason ==
+Coverage::CoverageRanges::UNCOVERED_REASON_BRANCH_NEVER_TAKEN
+  ) {
+report << "Reason: NEVER TAKEN"
+   << std::endl << std::endl;
+  }
 
   // See if an explanation is available
   explanation = AllExplanations->lookupExplanation( range.lowSourceLine );
@@ -100,9 +103,7 @@ bool ReportsText::PutBranchEntry(
<< std::endl << std::endl
<< "Explanation:" << std::endl;
 
-for ( unsigned int i=0;
-  i < explanation->explanation.size();
-  i++) {
+for ( unsigned int i=0; i < explanation->explanation.size(); i++ ) {
   report << explanation->explanation[i] << std::endl;
 }
   }
@@ -115,7 +116,7 @@ bool ReportsText::PutBranchEntry(
 void ReportsText::putCoverageNoRange(
   std::ofstream& report,
   std::ofstream& noRangeFile,
-  unsigned int  number,
+  unsigned int   number,
   const std::string& symbol
 )
 {
@@ -135,14 +136,14 @@ void ReportsText::putCoverageNoRange(
 }
 
 bool ReportsText::PutCoverageLine(
-  std::ofstream&  report,
-  unsigned intnumber,
-  const std::string&  symbolName,
-  const SymbolInformation&symbolInfo,
-  const CoverageRanges::coverageRange_t&  range
+  std::ofstream& report,
+  unsigned int   number,
+  const std::string& symbolName,
+  const SymbolInformation&   symbolInfo,
+  const CoverageRanges::coverageRange_t& range
 )
 {
-  const Coverage::Explanation*   explanation;
+  const Coverage::Explanation* explanation;
 
   report << "" << std::endl
  << "Index: " << range.id << std::endl
@@ -175,14 +176,15 @@ bool ReportsText::PutCoverageLine(
   }
 
   report << "" << std::endl;
+
   return true;
 }
 
 bool  ReportsText::PutSizeLine(
-  std::ofstream&  report,
-  unsigned intnumber,
-  const std::string&  symbolName,
-  const CoverageRanges::coverageRange_t&  range
+  std::ofstream& report,
+  unsigned int   number,
+  const 

[PATCH v1 6/6] ReportsText.h: Fix formatting

2021-07-14 Thread Ryan Long
---
 tester/covoar/ReportsText.h | 60 ++---
 1 file changed, 24 insertions(+), 36 deletions(-)

diff --git a/tester/covoar/ReportsText.h b/tester/covoar/ReportsText.h
index 3e33be9..9ad80ef 100644
--- a/tester/covoar/ReportsText.h
+++ b/tester/covoar/ReportsText.h
@@ -30,9 +30,7 @@ class ReportsText: public ReportsBase {
*
*  @param[in] fileName identifies the branch report file name
*/
-  void WriteBranchReport(
-const std::string& fileName
-  );
+  void WriteBranchReport( const std::string& fileName );
 
   /*!
*  This method produces a report that contains information about each
@@ -40,9 +38,7 @@ class ReportsText: public ReportsBase {
*
*  @param[in] fileName identifies the coverage report file name
*/
-  void WriteCoverageReport(
-const std::string& fileName
-  );
+  void WriteCoverageReport( const std::string& fileName );
 
   /*!
*  This method produces a summary report that lists each uncovered
@@ -50,9 +46,7 @@ class ReportsText: public ReportsBase {
*
*  @param[in] fileName identifies the size report file name
*/
-  void WriteSizeReport(
-const std::string& fileName
-  );
+  void WriteSizeReport( const std::string& fileName );
 
   protected:
 
@@ -65,27 +59,21 @@ class ReportsText: public ReportsBase {
 );
 
/* Inherit documentation from base class. */
- virtual void AnnotatedStart(
-   std::ofstream& aFile
-);
+ virtual void AnnotatedStart( std::ofstream& aFile );
 
 /* Inherit documentation from base class. */
- virtual void AnnotatedEnd(
-   std::ofstream& aFile
-);
+ virtual void AnnotatedEnd( std::ofstream& aFile );
 
/* Inherit documentation from base class. */
-virtual bool PutNoBranchInfo(
-  std::ofstream& report
-);
+virtual bool PutNoBranchInfo( std::ofstream& report );
 
/* Inherit documentation from base class. */
 virtual bool PutBranchEntry(
-  std::ofstream&   report,
-  unsigned int number,
-  const std::string&   symbolName,
-  const SymbolInformation& symbolInfo,
-  const CoverageRanges::coverageRange_t&   range
+  std::ofstream& report,
+  unsigned int   number,
+  const std::string& symbolName,
+  const SymbolInformation&   symbolInfo,
+  const CoverageRanges::coverageRange_t& range
 );
 
/* Inherit documentation from base class. */
@@ -98,27 +86,27 @@ class ReportsText: public ReportsBase {
 
/* Inherit documentation from base class. */
 virtual bool PutCoverageLine(
-  std::ofstream&  report,
-  unsigned intnumber,
-  const std::string&  symbolName,
-  const SymbolInformation&symbolInfo,
-  const CoverageRanges::coverageRange_t&  range
+  std::ofstream& report,
+  unsigned int   number,
+  const std::string& symbolName,
+  const SymbolInformation&   symbolInfo,
+  const CoverageRanges::coverageRange_t& range
 );
 
/* Inherit documentation from base class. */
 virtual bool PutSizeLine(
-  std::ofstream&  report,
-  unsigned intnumber,
-  const std::string&  symbolName,
-  const CoverageRanges::coverageRange_t&  range
+  std::ofstream& report,
+  unsigned int   number,
+  const std::string& symbolName,
+  const CoverageRanges::coverageRange_t& range
 );
 
/* Inherit documentation from base class. */
 virtual bool PutSymbolSummaryLine(
-  std::ofstream&  report,
-  unsigned intnumber,
-  const std::string&  symbolName,
-  const SymbolInformation&symbolInfo
+  std::ofstream&   report,
+  unsigned int number,
+  const std::string&   symbolName,
+  const SymbolInformation& symbolInfo
 );
 };
 
-- 
1.8.3.1

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


[PATCH v1 2/6] ReportsBase.h: Fix formatting

2021-07-14 Thread Ryan Long
---
 tester/covoar/ReportsBase.h | 105 +++-
 1 file changed, 36 insertions(+), 69 deletions(-)

diff --git a/tester/covoar/ReportsBase.h b/tester/covoar/ReportsBase.h
index ed381fb..41add8e 100644
--- a/tester/covoar/ReportsBase.h
+++ b/tester/covoar/ReportsBase.h
@@ -34,9 +34,7 @@ class ReportsBase {
  *
  *  @param[in] fileName identifies the report file name
  */
-virtual void WriteIndex(
-  const std::string& fileName
-);
+virtual void WriteIndex( const std::string& fileName );
 
 /*!
  *  This method produces an annotated assembly listing report containing
@@ -44,9 +42,7 @@ class ReportsBase {
  *
  *  @param[in] fileName identifies the annotated report file name
  */
-void WriteAnnotatedReport(
-  const std::string& fileName
-);
+void WriteAnnotatedReport( const std::string& fileName );
 
 /*!
  *  This method produces a report that contains information about each
@@ -54,9 +50,7 @@ class ReportsBase {
  *
  *  @param[in] fileName identifies the branch report file name
  */
-void WriteBranchReport(
-  const std::string& fileName
-);
+void WriteBranchReport( const std::string& fileName );
 
 /*!
  *  This method produces a report that contains information about each
@@ -64,9 +58,7 @@ class ReportsBase {
  *
  *  @param[in] fileName identifies the coverage report file name
  */
-void WriteCoverageReport(
-  const std::string& fileName
-);
+void WriteCoverageReport( const std::string& fileName );
 
 /*!
  *  This method produces a summary report that lists each uncovered
@@ -74,9 +66,7 @@ class ReportsBase {
  *
  *  @param[in] fileName identifies the report file name
  */
-void WriteSizeReport(
-  const std::string& fileName
-);
+void WriteSizeReport( const std::string& fileName );
 
 /*!
  *  This method produces a summary report that lists information on
@@ -84,9 +74,7 @@ class ReportsBase {
  *
  *  @param[in] fileName identifies the report file name
  */
-void WriteSymbolSummaryReport(
-  const std::string& fileName
-);
+void WriteSymbolSummaryReport( const std::string& fileName );
 
 /*!
  *  This method produces a sumary report for the overall test run.
@@ -224,9 +212,7 @@ class ReportsBase {
  *
  *  @param[in] aFile identifies the file to close
  */
-static void CloseFile(
-  std::ofstream& aFile
-);
+static void CloseFile( std::ofstream& aFile );
 
 /*!
  *  This method puts any necessary footer information into
@@ -234,9 +220,7 @@ class ReportsBase {
  *
  *  @param[in] aFile identifies the file to close
  */
-virtual void CloseAnnotatedFile(
-  std::ofstream& aFile
-);
+virtual void CloseAnnotatedFile( std::ofstream& aFile );
 
 /*!
  *  This method puts any necessary footer information into
@@ -245,10 +229,7 @@ class ReportsBase {
  *  @param[in] aFile identifies the file to close
  *  @param[in] hasBranches indicates if there are branches to report
  */
-virtual void CloseBranchFile(
-  std::ofstream& aFile,
-  bool   hasBranches
-);
+virtual void CloseBranchFile( std::ofstream& aFile, bool hasBranches );
 
 /*!
  *  This method puts any necessary footer information into
@@ -256,9 +237,7 @@ class ReportsBase {
  *
  *  @param[in] aFile identifies the file to close
  */
-virtual void CloseCoverageFile(
-  std::ofstream& aFile
-);
+virtual void CloseCoverageFile( std::ofstream& aFile );
 
 /*!
  *  This method puts any necessary footer information into
@@ -266,9 +245,7 @@ class ReportsBase {
  *
  *  @param[in] aFile identifies the file to close
  */
-void  CloseNoRangeFile(
-  std::ofstream& aFile
-);
+void  CloseNoRangeFile( std::ofstream& aFile );
 
 /*!
  *  This method puts any necessary footer information into
@@ -276,9 +253,7 @@ class ReportsBase {
  *
  *  @param[in] aFile identifies the file to close
  */
-virtual void CloseSizeFile(
-  std::ofstream& aFile
-);
+virtual void CloseSizeFile( std::ofstream& aFile );
 
 /*!
  *  This method puts any necessary footer information into
@@ -286,9 +261,7 @@ class ReportsBase {
  *
  *  @param[in] aFile identifies the file to close
  */
-virtual void CloseSymbolSummaryFile(
-  std::ofstream& aFile
-);
+virtual void CloseSymbolSummaryFile( std::ofstream& aFile );
 
 /*!
  *  This method puts any necessary a line of annotated
@@ -312,9 +285,7 @@ class ReportsBase {
  *
  *  @param[in] aFile identifies the report file name
  */
- virtual void AnnotatedStart(
-  std::ofstream& aFile
-)=0;
+ virtual void AnnotatedStart( std::ofstream& aFile )=0;
 
 /*!
  *  This method puts any necessary footer information in

[PATCH v1 1/6] ReportsBase.cc: Fix formatting

2021-07-14 Thread Ryan Long
---
 tester/covoar/ReportsBase.cc | 305 ++-
 1 file changed, 156 insertions(+), 149 deletions(-)

diff --git a/tester/covoar/ReportsBase.cc b/tester/covoar/ReportsBase.cc
index cc3810b..cd65c53 100644
--- a/tester/covoar/ReportsBase.cc
+++ b/tester/covoar/ReportsBase.cc
@@ -24,8 +24,8 @@
 namespace Coverage {
 
 ReportsBase::ReportsBase( time_t timestamp, const std::string& symbolSetName ):
-  reportExtension_m(""),
-  symbolSetName_m(symbolSetName),
+  reportExtension_m( "" ),
+  symbolSetName_m( symbolSetName ),
   timestamp_m( timestamp )
 {
 }
@@ -40,8 +40,8 @@ void ReportsBase::OpenFile(
   std::ofstream& aFile
 )
 {
-  int  sc;
-  std::string  file;
+  int sc;
+  std::string file;
 
   std::string symbolSetOutputDirectory;
   rld::path::path_join(
@@ -54,9 +54,9 @@ void ReportsBase::OpenFile(
 #ifdef _WIN32
   sc = _mkdir( symbolSetOutputDirectory );
 #else
-  sc = mkdir( symbolSetOutputDirectory.c_str(),0755 );
+  sc = mkdir( symbolSetOutputDirectory.c_str(), 0755 );
 #endif
-  if ( (sc == -1) && (errno != EEXIST) ) {
+  if ( ( sc == -1 ) && ( errno != EEXIST ) ) {
 throw rld::error(
   "Unable to create output directory",
   "ReportsBase::OpenFile"
@@ -65,7 +65,7 @@ void ReportsBase::OpenFile(
   }
 
   file = symbolSetOutputDirectory;
-  rld::path::path_join(file, fileName, file);
+  rld::path::path_join( file, fileName, file );
 
   // Open the file.
   aFile.open( file );
@@ -74,9 +74,7 @@ void ReportsBase::OpenFile(
   }
 }
 
-void ReportsBase::WriteIndex(
-  const std::string& fileName
-)
+void ReportsBase::WriteIndex( const std::string& fileName )
 {
 }
 
@@ -130,64 +128,49 @@ void ReportsBase::OpenSymbolSummaryFile(
   OpenFile(fileName, symbolSetName_m, aFile);
 }
 
-void ReportsBase::CloseFile(
-  std::ofstream& aFile
-)
+void ReportsBase::CloseFile( std::ofstream& aFile )
 {
   aFile.close();
 }
 
-void ReportsBase::CloseAnnotatedFile(
-  std::ofstream& aFile
-)
+void ReportsBase::CloseAnnotatedFile( std::ofstream& aFile )
 {
   CloseFile( aFile );
 }
 
-void ReportsBase::CloseBranchFile(
-  std::ofstream& aFile,
-  bool   hasBranches
-)
+void ReportsBase::CloseBranchFile( std::ofstream& aFile, bool hasBranches )
 {
   CloseFile( aFile );
 }
 
-void  ReportsBase::CloseCoverageFile(
-  std::ofstream& aFile
-)
+void  ReportsBase::CloseCoverageFile( std::ofstream& aFile )
 {
   CloseFile( aFile );
 }
 
-void  ReportsBase::CloseNoRangeFile(
-  std::ofstream& aFile
-)
+void  ReportsBase::CloseNoRangeFile( std::ofstream& aFile )
 {
   CloseFile( aFile );
 }
 
-void  ReportsBase::CloseSizeFile(
-  std::ofstream& aFile
-)
+void  ReportsBase::CloseSizeFile( std::ofstream& aFile )
 {
   CloseFile( aFile );
 }
 
-void  ReportsBase::CloseSymbolSummaryFile(
-  std::ofstream& aFile
-)
+void  ReportsBase::CloseSymbolSummaryFile( std::ofstream& aFile )
 {
   CloseFile( aFile );
 }
 
-std::string expand_tabs(const std::string& in) {
+std::string expand_tabs( const std::string& in ) {
   std::string expanded = "";
   int i = 0;
 
-  for (char c : in) {
-if (c == '\t') {
-  int num_tabs = 4 - (i % 4);
-  expanded.append(num_tabs, ' ');
+  for ( char c : in ) {
+if ( c == '\t' ) {
+  int num_tabs = 4 - ( i % 4 );
+  expanded.append( num_tabs, ' ' );
   i += num_tabs;
 } else {
   expanded += c;
@@ -201,9 +184,8 @@ std::string expand_tabs(const std::string& in) {
 /*
  *  Write annotated report
  */
-void ReportsBase::WriteAnnotatedReport(
-  const std::string& fileName
-) {
+void ReportsBase::WriteAnnotatedReport( const std::string& fileName )
+{
   std::ofstream  aFile;
   Coverage::CoverageRanges*  theBranches;
   Coverage::CoverageRanges*  theRanges;
@@ -211,8 +193,8 @@ void ReportsBase::WriteAnnotatedReport(
   uint32_t   bAddress = 0;
   AnnotatedLineState_t   state;
 
-  OpenAnnotatedFile(fileName, aFile);
-  if (!aFile.is_open()) {
+  OpenAnnotatedFile( fileName, aFile );
+  if ( !aFile.is_open() ) {
 throw rld::error(
   "Unable to open " + fileName,
   "ReportsBase::WriteAnnotatedReport"
@@ -221,48 +203,60 @@ void ReportsBase::WriteAnnotatedReport(
   }
 
   // Process uncovered branches for each symbol.
-  const std::vector& symbols = 
SymbolsToAnalyze->getSymbolsForSet(symbolSetName_m);
+  const std::vector& symbols =
+SymbolsToAnalyze->getSymbolsForSet( symbolSetName_m );
 
-  for (const auto& symbol : symbols) {
-const SymbolInformation& info = SymbolsToAnalyze->allSymbols().at(symbol);
+  for ( const auto& symbol : symbols ) {
+const SymbolInformation& info =
+  SymbolsToAnalyze->allSymbols().at( symbol );
 
 // If uncoveredRanges and uncoveredBranches don't exist, then the
 // symbol was never referenced by any executable.  Just skip it.
-if ((info.uncoveredRanges == NULL) &&
-(info.uncoveredBranches == NULL))
+if (
+  ( info.uncoveredRanges == NULL ) &&
+  ( info.uncoveredBranches == 

[PATCH rtems-docs v1] readme: Minor clarifications and fixes

2021-07-14 Thread Stephen Clark
Added some instructions for setting up CentOS 8.
Fixed some minor typographical errors.
Updated a dead link.
Reworded some sentences for clarity
---
 README.txt | 58 ++
 1 file changed, 32 insertions(+), 26 deletions(-)

diff --git a/README.txt b/README.txt
index 03f57ed..53549f2 100644
--- a/README.txt
+++ b/README.txt
@@ -1,16 +1,17 @@
 RTEMS Project Documentation
 ===
 
-The documents are written in ReST and built using Sphinx. The build system will
-check the version of Sphinx and ensure you have a suitable version
-available. If your host does not provide a packaged version use PIP to fetch a
+The documents are written in ReST and built using Sphinx. The waf build system
+will check the version of Sphinx and ensure you have a suitable version
+available. If your host does not provide a packaged version, use PIP to fetch a
 recent version. The Sphinx website provides details on doing this.
 
-ReST is the Re-Structured-Text format. It is a simple markup language that 
allows
-us to create quality documentaion. It is flexible and powerful however does not
-attempt to train it to create a specific format. You need to test any new way
-of presenting something on all output formats. What may look great in one
-format may not translate with the same clarity to another output format.
+ReST is the Re-Structured-Text format. It is a simple markup language that 
+allows us to create quality documentation which can easily be converted to 
+multiple different formats. This flexibility is convenient, but you still need
+to test any new way of presenting something on all output formats. What may 
look
+great in one format may not translate with the same clarity to another output
+format.
 
 The RTEMS Documentation output formats are:
 
@@ -26,7 +27,7 @@ Images can be created from source using PlantUML and Ditaa.
 
 A Sphinx checksheet is:
 
- http://docs.sphinxdocs.com/en/latest/cheatsheet.html#rst-cheat-sheet
+ https://sphinx-tutorial.readthedocs.io/cheatsheet/#rst-cheat-sheet
 
 Production Quality Hosts
 
@@ -45,7 +46,7 @@ NOTE: RedHat Enterprise Linux (RHEL) and Fedora should be the 
same as CentOS.
 Images
 --
 
-All images should be placed int he 'images' directory and referenced from the
+All images should be placed in the 'images' directory and referenced from the
 ReST with a relative path. This lets us shared and control images.
 
 We prefer being able to build images from source. This is not always possible
@@ -85,7 +86,7 @@ The home page contain the language options. The PlantUML 
online demo server
 supports Ditaa so use that resource as an online tool. The Ditaa image source
 extension is '.ditaa'.
 
-You do not need PlantUML or Ditaa install to build our documentation. The
+You do not need PlantUML or Ditaa installed to build our documentation. The
 online resources can be used. Save the source and the generated PNG file in the
 same directory under 'images'.
 
@@ -94,12 +95,12 @@ Host Setup
 
 HTML builds directly with Sphinx, PDF requires a full Latex (texlive) install,
 and building a Single HTML page requires the 'inliner' tool. The
-sphinxcontrib-bibtex extension is mandatory. PlantUML requres the Node.js
+sphinxcontrib-bibtex extension is mandatory. PlantUML requires the Node.js
 package called 'node-plantuml' which installs the 'puml' command and Ditaa 
needs
 the 'ditaa' command and package. Ditaa images are built using the 'puml'
 command.
 
-Please add your host as you set it up.
+Please add your host to this section as you set it up.
 
 The best results are produced with Python3 and a virtual environment`. It can
 create a specific python environment using `pip`.
@@ -107,7 +108,7 @@ create a specific python environment using `pip`.
 Virtual Environment
 ~~~
 
-Create a directory to house the virtual environment, create the envrionment
+Create a directory to house the virtual environment, create the environment
 and the activate it. This example assumes Python3 and the `venv` module:
 
   $ mkdir sphinx
@@ -120,7 +121,7 @@ Alternatively you can use the `virtualenv` command:
   $ virtualenv sphinx
   $ . ./sphinx/bin/activate
 
-The prompt will now change. You can install Sphinx with:
+Either way, the prompt will now change. You can install Sphinx with:
 
   $ pip install sphinx
   $ pip install sphinxcontrib-bibtex
@@ -207,8 +208,8 @@ Ditaa:
 
   # pkg install ditaa
 
-CentOS 7
-
+CentOS 7 & 8
+
 
 PDF Quality: production
 
@@ -221,6 +222,8 @@ software. As root,
   # yum install centos-release-scl
   # yum install rh-python36
 
+On CentOS 8, this is unnecessary as Python 3.x is the default.
+
 Then you can create your own virtual Python environment
 for use with the Sphinx toolchain.
 
@@ -263,7 +266,8 @@ PDF:
 Single HTML:
 
 NOTE: npm appears to be part of the EPEL repository for RHEL and CentOS.
-You may have to add that repository to your 

[PATCH] spcoverage: Remove test program

2021-07-14 Thread Sebastian Huber
This program contained an optional test case.  It was enabled by the
RTEMS_COVERAGE define.  The functions under test are not implemented by RTEMS.
---
 spec/build/testsuites/sptests/grp.yml|  2 -
 spec/build/testsuites/sptests/spcoverage.yml | 19 
 testsuites/sptests/Makefile.am   |  9 
 testsuites/sptests/configure.ac  |  1 -
 testsuites/sptests/spcoverage/init.c | 50 
 testsuites/sptests/spcoverage/spcoverage.doc | 22 -
 testsuites/sptests/spcoverage/spcoverage.scn |  3 --
 7 files changed, 106 deletions(-)
 delete mode 100644 spec/build/testsuites/sptests/spcoverage.yml
 delete mode 100644 testsuites/sptests/spcoverage/init.c
 delete mode 100644 testsuites/sptests/spcoverage/spcoverage.doc
 delete mode 100644 testsuites/sptests/spcoverage/spcoverage.scn

diff --git a/spec/build/testsuites/sptests/grp.yml 
b/spec/build/testsuites/sptests/grp.yml
index ac2f6626cd..7e7618789c 100644
--- a/spec/build/testsuites/sptests/grp.yml
+++ b/spec/build/testsuites/sptests/grp.yml
@@ -188,8 +188,6 @@ links:
   uid: spconsole01
 - role: build-dependency
   uid: spcontext01
-- role: build-dependency
-  uid: spcoverage
 - role: build-dependency
   uid: spcpucounter01
 - role: build-dependency
diff --git a/spec/build/testsuites/sptests/spcoverage.yml 
b/spec/build/testsuites/sptests/spcoverage.yml
deleted file mode 100644
index 74705a976e..00
--- a/spec/build/testsuites/sptests/spcoverage.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
-build-type: test-program
-cflags: []
-copyrights:
-- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
-cppflags: []
-cxxflags: []
-enabled-by: true
-features: c cprogram
-includes: []
-ldflags: []
-links: []
-source:
-- testsuites/sptests/spcoverage/init.c
-stlib: []
-target: testsuites/sptests/spcoverage.exe
-type: build
-use-after: []
-use-before: []
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 8a9d968925..07d7ee04e9 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -753,15 +753,6 @@ spcontext01_CPPFLAGS = $(AM_CPPFLAGS) 
$(TEST_FLAGS_spcontext01) \
$(support_includes)
 endif
 
-if TEST_spcoverage
-sp_tests += spcoverage
-sp_screens += spcoverage/spcoverage.scn
-sp_docs += spcoverage/spcoverage.doc
-spcoverage_SOURCES = spcoverage/init.c
-spcoverage_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spcoverage) \
-   $(support_includes) -I$(top_srcdir)/include
-endif
-
 if TEST_spcpucounter01
 sp_tests += spcpucounter01
 sp_screens += spcpucounter01/spcpucounter01.scn
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index 4ca55e6a36..36d4519da3 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -121,7 +121,6 @@ RTEMS_TEST_CHECK([spconfig01])
 RTEMS_TEST_CHECK([spconfig02])
 RTEMS_TEST_CHECK([spconsole01])
 RTEMS_TEST_CHECK([spcontext01])
-RTEMS_TEST_CHECK([spcoverage])
 RTEMS_TEST_CHECK([spcpucounter01])
 RTEMS_TEST_CHECK([spcpuset01])
 RTEMS_TEST_CHECK([spcxx01])
diff --git a/testsuites/sptests/spcoverage/init.c 
b/testsuites/sptests/spcoverage/init.c
deleted file mode 100644
index 7c8e509d74..00
--- a/testsuites/sptests/spcoverage/init.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *  COPYRIGHT (c) 1989-2012.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "tmacros.h"
-
-const char rtems_test_name[] = "SPCOVERAGE";
-
-/* forward declarations to avoid warnings */
-rtems_task Init(rtems_task_argument argument);
-
-rtems_task Init(
-  rtems_task_argument ignored
-)
-{
-  TEST_BEGIN();
-
-  puts( "Init - If coverage enabled, call coverage marker methods" );
-  #if defined(RTEMS_COVERAGE)
-start_coverage();
-end_coverage();
-  #endif
-
-  TEST_END();
-  rtems_test_exit(0);
-}
-
-/* configuration information */
-
-#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
-#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS 1
-#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-
-#define CONFIGURE_INIT
-#include 
-
-/* global variables */
diff --git a/testsuites/sptests/spcoverage/spcoverage.doc 
b/testsuites/sptests/spcoverage/spcoverage.doc
deleted file mode 100644
index 55b605179f..00
--- a/testsuites/sptests/spcoverage/spcoverage.doc
+++ /dev/null
@@ -1,22 +0,0 @@
-#  COPYRIGHT (c) 1989-2009.
-#  On-Line Applications Research Corporation (OAR).
-#
-#  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.
-#
-
-This file describes the directives 

Re: How defines RTEMS_COVERAGE?

2021-07-14 Thread Joel Sherrill
On Wed, Jul 14, 2021, 7:27 AM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> On 14/07/2021 14:25, Joel Sherrill wrote:
> >
> >
> > On Wed, Jul 14, 2021, 7:15 AM Sebastian Huber
> >  > > wrote:
> >
> > Hello,
> >
> > I had a bit of time to work on the gcov support for RTEMS:
> >
> > https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575122.html
> > 
> >
> > I tried to add an RTEMS_COVERAGE build option to enable gcov. Then I
> > noticed that such a define is already used in RTEMS:
> >
> > testsuites/sptests/spcoverage/init.c:  #if defined(RTEMS_COVERAGE)
> >
> > Who provides this define?
> >
> >
> > I have no idea what this does. The covoar reports require no special
> > defines. The most you might do is use -Os to make the analysis easier
> > since the code is easier to follow when optimising for size.
> >
> > What does that test even do?
>
> rtems_task Init(
>rtems_task_argument ignored
> )
> {
>TEST_BEGIN();
>
>puts( "Init - If coverage enabled, call coverage marker methods" );
>#if defined(RTEMS_COVERAGE)
>  start_coverage();
>  end_coverage();
>#endif
>
>TEST_END();
>rtems_test_exit(0);
> }
>
>  From looking at the git log, the start_coverage() and end_coverage()
> were never defined in RTEMS. I guess we can remove this test program.
>

I've honestly got no idea. Removing it seems right.

--joel



> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.hu...@embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: How defines RTEMS_COVERAGE?

2021-07-14 Thread Sebastian Huber

On 14/07/2021 14:25, Joel Sherrill wrote:



On Wed, Jul 14, 2021, 7:15 AM Sebastian Huber 
> wrote:


Hello,

I had a bit of time to work on the gcov support for RTEMS:

https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575122.html


I tried to add an RTEMS_COVERAGE build option to enable gcov. Then I
noticed that such a define is already used in RTEMS:

testsuites/sptests/spcoverage/init.c:  #if defined(RTEMS_COVERAGE)

Who provides this define?


I have no idea what this does. The covoar reports require no special 
defines. The most you might do is use -Os to make the analysis easier 
since the code is easier to follow when optimising for size.


What does that test even do?


rtems_task Init(
  rtems_task_argument ignored
)
{
  TEST_BEGIN();

  puts( "Init - If coverage enabled, call coverage marker methods" );
  #if defined(RTEMS_COVERAGE)
start_coverage();
end_coverage();
  #endif

  TEST_END();
  rtems_test_exit(0);
}

From looking at the git log, the start_coverage() and end_coverage() 
were never defined in RTEMS. I guess we can remove this test program.


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: How defines RTEMS_COVERAGE?

2021-07-14 Thread Joel Sherrill
On Wed, Jul 14, 2021, 7:15 AM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> Hello,
>
> I had a bit of time to work on the gcov support for RTEMS:
>
> https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575122.html
>
> I tried to add an RTEMS_COVERAGE build option to enable gcov. Then I
> noticed that such a define is already used in RTEMS:
>
> testsuites/sptests/spcoverage/init.c:  #if defined(RTEMS_COVERAGE)
>
> Who provides this define?
>

I have no idea what this does. The covoar reports require no special
defines. The most you might do is use -Os to make the analysis easier since
the code is easier to follow when optimising for size.

What does that test even do?

--joel

>
> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.hu...@embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
> ___
> 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

How defines RTEMS_COVERAGE?

2021-07-14 Thread Sebastian Huber

Hello,

I had a bit of time to work on the gcov support for RTEMS:

https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575122.html

I tried to add an RTEMS_COVERAGE build option to enable gcov. Then I 
noticed that such a define is already used in RTEMS:


testsuites/sptests/spcoverage/init.c:  #if defined(RTEMS_COVERAGE)

Who provides this define?

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH v2] rtems: Add rtems_interrupt_get_attributes()

2021-07-14 Thread Sebastian Huber
Add a directive to query the attributes of an interrupt vector.   This
be used for generic tests and system diagnostics.

Update #3269.
---
 cpukit/include/rtems/irq-extension.h | 216 +++
 1 file changed, 216 insertions(+)

diff --git a/cpukit/include/rtems/irq-extension.h 
b/cpukit/include/rtems/irq-extension.h
index 5f24fb502e..af54002902 100644
--- a/cpukit/include/rtems/irq-extension.h
+++ b/cpukit/include/rtems/irq-extension.h
@@ -419,6 +419,222 @@ rtems_status_code rtems_interrupt_set_affinity(
   const cpu_set_t*affinity
 );
 
+/* Generated from spec:/rtems/intr/if/signal-variant */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This enumeration provides interrupt trigger signal variants.
+ */
+typedef enum {
+  /**
+   * @brief This interrupt signal variant indicates that the interrupt trigger
+   *   signal is unspecified.
+   */
+  RTEMS_INTERRUPT_UNSPECIFIED_SIGNAL,
+
+  /**
+   * @brief This interrupt signal variant indicates that the interrupt cannot 
be
+   *   triggered by a signal.
+   */
+  RTEMS_INTERRUPT_NO_SIGNAL,
+
+  /**
+   * @brief This interrupt signal variant indicates that the interrupt is
+   *   triggered by a low level signal.
+   */
+  RTEMS_INTERRUPT_SIGNAL_LEVEL_LOW,
+
+  /**
+   * @brief This interrupt signal variant indicates that the interrupt is
+   *   triggered by a high level signal.
+   */
+  RTEMS_INTERRUPT_SIGNAL_LEVEL_HIGH,
+
+  /**
+   * @brief This interrupt signal variant indicates that the interrupt is
+   *   triggered by a falling edge signal.
+   */
+  RTEMS_INTERRUPT_SIGNAL_EDGE_FALLING,
+
+  /**
+   * @brief This interrupt signal variant indicates that the interrupt is
+   *   triggered by a raising edge signal.
+   */
+  RTEMS_INTERRUPT_SIGNAL_EDGE_RAISING
+} rtems_interrupt_signal_variant;
+
+/* Generated from spec:/rtems/intr/if/attributes */
+
+/**
+ * @ingroup RTEMSAPIClassicIntr
+ *
+ * @brief This structure provides the attributes of an interrupt vector.
+ *
+ * The rtems_interrupt_get_attributes() directive may be used to obtain the
+ * attributes of an interrupt vector.
+ */
+typedef struct {
+  /**
+   * @brief This member is true, if the interrupt vector is maskable by
+   *   rtems_interrupt_local_disable(), otherwise it is false.
+   *
+   * Interrupt vectors which are not maskable by 
rtems_interrupt_local_disable()
+   * should be used with care since they cannot use most operating system
+   * services.
+   */
+  bool is_maskable;
+
+  /**
+   * @brief This member is true, if the interrupt vector is always enabled,
+   *   otherwise it is false.
+   *
+   * For an always enabled interrupt vector it follows that it can be enabled 
and
+   * that it cannot be disabled.
+   */
+  bool always_enabled;
+
+  /**
+   * @brief This member is true, if the interrupt vector can be enabled by
+   *   rtems_interrupt_vector_enable(), otherwise it is false.
+   *
+   * When an interrupt vector can be enabled, this means that the enabled state
+   * can always be changed from disabled to enabled.  For an interrupt vector
+   * which can be enabled it follows that it may be enabled.
+   */
+  bool can_enable;
+
+  /**
+   * @brief This member is true, if the interrupt vector may be enabled by
+   *   rtems_interrupt_vector_enable(), otherwise it is false.
+   *
+   * When an interrupt vector may be enabled, this means that the enabled state
+   * may be changed from disabled to enabled.  The requested enabled state 
change
+   * should be checked by rtems_interrupt_vector_is_enabled().  Some interrupt
+   * vectors may be optionally avaialable and cannot be enabled on a particular
+   * target.
+   */
+  bool maybe_enable;
+
+  /**
+   * @brief This member is true, if the interrupt vector can be disabled by
+   *   rtems_interrupt_vector_disable(), otherwise it is false.
+   *
+   * When an interrupt vector can be disabled, this means that the enabled 
state
+   * can be changed from enabled to disabled.  For an interrupt vector which 
can
+   * be disabled it follows that it may be disabled.
+   */
+  bool can_disable;
+
+  /**
+   * @brief This member is true, if the interrupt vector may be disabled by
+   *   rtems_interrupt_vector_disable(), otherwise it is false.
+   *
+   * When an interrupt vector may be disabled, this means that the enabled 
state
+   * may be changed from enabled to disabled.  The requested enabled state 
change
+   * should be checked by rtems_interrupt_vector_is_enabled().  Some interrupt
+   * vectors may be always enabled and cannot be disabled on a particular 
target.
+   */
+  bool maybe_disable;
+
+  /**
+   * @brief This member is true, if the interrupt vector can be caused by
+   *   rtems_interrupt_cause(), otherwise it is false.
+   */
+  bool can_cause;
+
+  /**
+   * @brief This member is true, if the interrupt vector can be caused on a
+   *   processor by rtems_interrupt_cause_on(), otherwise it is false.
+   */
+  bool can_cause_on;
+
+  /**
+   * @brief This member is true, 

[PATCH v2] bsps/irq: Implement new directives for GICv2/3

2021-07-14 Thread Sebastian Huber
Update #3269.
---
 bsps/include/dev/irq/arm-gic-irq.h |   3 +
 bsps/shared/dev/irq/arm-gicv2.c|  83 +++
 bsps/shared/dev/irq/arm-gicv3.c| 125 +
 3 files changed, 180 insertions(+), 31 deletions(-)

diff --git a/bsps/include/dev/irq/arm-gic-irq.h 
b/bsps/include/dev/irq/arm-gic-irq.h
index 68e0247fd8..398fd8bceb 100644
--- a/bsps/include/dev/irq/arm-gic-irq.h
+++ b/bsps/include/dev/irq/arm-gic-irq.h
@@ -46,6 +46,9 @@ extern "C" {
 #define ARM_GIC_IRQ_SGI_13 13
 #define ARM_GIC_IRQ_SGI_14 14
 #define ARM_GIC_IRQ_SGI_15 15
+#define ARM_GIC_IRQ_SGI_LAST 15
+
+#define ARM_GIC_IRQ_PPI_LAST 31
 
 #define ARM_GIC_DIST ((volatile gic_dist *) BSP_ARM_GIC_DIST_BASE)
 
diff --git a/bsps/shared/dev/irq/arm-gicv2.c b/bsps/shared/dev/irq/arm-gicv2.c
index a1ba5e9112..83422218da 100644
--- a/bsps/shared/dev/irq/arm-gicv2.c
+++ b/bsps/shared/dev/irq/arm-gicv2.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2019 embedded brains GmbH.  All rights reserved.
+ * Copyright (c) 2013, 2021 embedded brains GmbH.  All rights reserved.
  *
  *  embedded brains GmbH
  *  Dornierstr. 4
@@ -69,6 +69,28 @@ rtems_status_code bsp_interrupt_get_attributes(
   rtems_interrupt_attributes *attributes
 )
 {
+  attributes->is_maskable = true;
+  attributes->maybe_enable = true;
+  attributes->maybe_disable = true;
+
+  if ( vector <= ARM_GIC_IRQ_SGI_LAST ) {
+attributes->can_cause = true;
+attributes->can_cause_on = true;
+attributes->cleared_by_acknowledge = true;
+attributes->trigger_signal = RTEMS_INTERRUPT_NO_SIGNAL;
+  } else {
+attributes->can_disable = true;
+attributes->can_cause = true;
+attributes->can_clear = true;
+attributes->trigger_signal = RTEMS_INTERRUPT_UNSPECIFIED_SIGNAL;
+
+if ( vector > ARM_GIC_IRQ_PPI_LAST ) {
+  /* SPI */
+  attributes->can_get_affinity = true;
+  attributes->can_set_affinity = true;
+}
+  }
+
   return RTEMS_SUCCESSFUL;
 }
 
@@ -77,16 +99,25 @@ rtems_status_code bsp_interrupt_is_pending(
   bool   *pending
 )
 {
-  bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
-  bsp_interrupt_assert(pending != NULL);
-  *pending = false;
-  return RTEMS_UNSATISFIED;
+  volatile gic_dist *dist = ARM_GIC_DIST;
+
+  *pending = gic_id_is_pending(dist, vector);
+  return RTEMS_SUCCESSFUL;
 }
 
 rtems_status_code bsp_interrupt_cause(rtems_vector_number vector)
 {
   bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
-  return RTEMS_UNSATISFIED;
+
+  if (vector <= ARM_GIC_IRQ_SGI_LAST) {
+arm_gic_trigger_sgi(vector, 1U << _SMP_Get_current_processor());
+  } else {
+volatile gic_dist *dist = ARM_GIC_DIST;
+
+gic_id_set_pending(dist, vector);
+  }
+
+  return RTEMS_SUCCESSFUL;
 }
 
 #if defined(RTEMS_SMP)
@@ -95,15 +126,27 @@ rtems_status_code bsp_interrupt_cause_on(
   uint32_tcpu_index
 )
 {
-  bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
-  return RTEMS_UNSATISFIED;
+  if (vector >= 16) {
+return RTEMS_UNSATISFIED;
+  }
+
+  arm_gic_trigger_sgi(vector, 1U << cpu_index);
+  return RTEMS_SUCCESSFUL;
 }
 #endif
 
 rtems_status_code bsp_interrupt_clear(rtems_vector_number vector)
 {
+  volatile gic_dist *dist = ARM_GIC_DIST;
+
   bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
-  return RTEMS_UNSATISFIED;
+
+  if (vector <= ARM_GIC_IRQ_SGI_LAST) {
+return RTEMS_UNSATISFIED;
+  }
+
+  gic_id_clear_pending(dist, vector);
+  return RTEMS_SUCCESSFUL;
 }
 
 rtems_status_code bsp_interrupt_vector_is_enabled(
@@ -111,10 +154,13 @@ rtems_status_code bsp_interrupt_vector_is_enabled(
   bool   *enabled
 )
 {
+  volatile gic_dist *dist = ARM_GIC_DIST;
+
   bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
   bsp_interrupt_assert(enabled != NULL);
-  *enabled = false;
-  return RTEMS_UNSATISFIED;
+
+  *enabled = gic_id_is_enabled(dist, vector);
+  return RTEMS_SUCCESSFUL;
 }
 
 rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
@@ -207,8 +253,8 @@ BSP_START_TEXT_SECTION void 
arm_gic_irq_initialize_secondary_cpu(void)
   dist->icdigr[0] = 0x;
 #endif
 
-  /* Initialize Peripheral Private Interrupts (PPIs) */
-  for (id = 0; id < 32; ++id) {
+  /* Initialize priority of SGIs and PPIs */
+  for (id = 0; id <= ARM_GIC_IRQ_PPI_LAST; ++id) {
 gic_id_set_priority(dist, id, PRIORITY_DEFAULT);
   }
 
@@ -300,6 +346,10 @@ rtems_status_code bsp_interrupt_set_affinity(
   volatile gic_dist *dist = ARM_GIC_DIST;
   uint8_t targets = (uint8_t) _Processor_mask_To_uint32_t(affinity, 0);
 
+  if ( vector <= ARM_GIC_IRQ_PPI_LAST ) {
+return RTEMS_UNSATISFIED;
+  }
+
   gic_id_set_targets(dist, vector, targets);
   return RTEMS_SUCCESSFUL;
 }
@@ -310,8 +360,13 @@ rtems_status_code bsp_interrupt_get_affinity(
 )
 {
   volatile gic_dist *dist = ARM_GIC_DIST;
-  uint8_t targets = gic_id_get_targets(dist, vector);
+  uint8_t targets;
+
+  if ( vector <= ARM_GIC_IRQ_PPI_LAST ) {
+return 

[PATCH v3 2/2] build: Fix the motorola_powerpc default baudrate

2021-07-14 Thread chrisj
From: Chris Johns 

---
 spec/build/bsps/optconsolebaud.yml | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/spec/build/bsps/optconsolebaud.yml 
b/spec/build/bsps/optconsolebaud.yml
index 2658abbff8..4b0869beca 100644
--- a/spec/build/bsps/optconsolebaud.yml
+++ b/spec/build/bsps/optconsolebaud.yml
@@ -6,7 +6,10 @@ build-type: option
 copyrights:
 - Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
 default: 115200
-default-by-family: []
+default-by-family:
+- value: 9600
+  families:
+  - powerpc/motorola_powerpc
 default-by-variant:
 - value: 9600
   variants:
@@ -14,7 +17,6 @@ default-by-variant:
   - powerpc/hsc_cm01
   - powerpc/beatnik
   - powerpc/haleakala
-  - powerpc/motorola_powerpc
   - powerpc/mvme3100
   - powerpc/mvme5500
 - value: 19200
-- 
2.24.1

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


Re: [PATCH v2] build: Use BSP family for options

2021-07-14 Thread Sebastian Huber

On 14/07/2021 10:44, Chris Johns wrote:

Can I add `default-by-family: []` before `default-by-variant` in the spec files?


Yes, the attributes should alphabetically sorted.

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v2] build: Use BSP family for options

2021-07-14 Thread Chris Johns
On 14/7/21 5:01 pm, Sebastian Huber wrote:
> On 14/07/2021 08:51, chr...@rtems.org wrote:
>> @@ -695,12 +692,18 @@ class OptionItem(Item):
>>   return True
>>   return False
>>   -    def default_value(self, variant):
>> +    def default_value(self, variant, family):
>>   value = self.data["default"]
>>   for default in self.data["default-by-variant"]:
>>   if OptionItem._is_variant(default["variants"], variant):
>>   value = default["value"]
>>   break
>> +    if 'default-by-family' in self.data:
>> +    for default in self.data["default-by-family"]:
>> +    if 'families' in default:
>> +    if OptionItem._is_variant(default["families"], family):
>> +    value = default["value"]
>> +    break
> 
> During the discussion of the build items, we agreed that all attributes should
> be explicit in the items. So, a "default-by-family: []" should be added to all
> BSP items.

Can I add `default-by-family: []` before `default-by-variant` in the spec files?

It is easier to batch edit.

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

Re: [PATCH v2] build: Use BSP family for options

2021-07-14 Thread Chris Johns
On 14/7/21 5:24 pm, Sebastian Huber wrote:
> On 14/07/2021 09:21, Chris Johns wrote:
>> Is there a nice way to catch any missing fields and report them? The waf 
>> conf is
>> not present and I am not sure if we catch any standard python exception and
>> report them by waf?
> 
> The current approach is to check the user input (e.g. config.ini) and report
> configuration errors. For errors in the build specification which is supposed 
> to
> be maintained by experts you get exceptions.

I prefer a soft landing. It helps bring those who are learning to be experts
become experts.

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


Re: [PATCH v2] build: Use BSP family for options

2021-07-14 Thread Sebastian Huber

On 14/07/2021 09:21, Chris Johns wrote:

Is there a nice way to catch any missing fields and report them? The waf conf is
not present and I am not sure if we catch any standard python exception and
report them by waf?


The current approach is to check the user input (e.g. config.ini) and 
report configuration errors. For errors in the build specification which 
is supposed to be maintained by experts you get exceptions.


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH v2] build: Use BSP family for options

2021-07-14 Thread Chris Johns
On 14/7/21 5:01 pm, Sebastian Huber wrote:
> On 14/07/2021 08:51, chr...@rtems.org wrote:
>> @@ -695,12 +692,18 @@ class OptionItem(Item):
>>   return True
>>   return False
>>   -    def default_value(self, variant):
>> +    def default_value(self, variant, family):
>>   value = self.data["default"]
>>   for default in self.data["default-by-variant"]:
>>   if OptionItem._is_variant(default["variants"], variant):
>>   value = default["value"]
>>   break
>> +    if 'default-by-family' in self.data:
>> +    for default in self.data["default-by-family"]:
>> +    if 'families' in default:
>> +    if OptionItem._is_variant(default["families"], family):
>> +    value = default["value"]
>> +    break
> 
> During the discussion of the build items, we agreed that all attributes should
> be explicit in the items. So, a "default-by-family: []" should be added to all
> BSP items.

OK I will generate a v3 patch.

Is there a nice way to catch any missing fields and report them? The waf conf is
not present and I am not sure if we catch any standard python exception and
report them by waf?

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

Re: [PATCH v2] build: Use BSP family for options

2021-07-14 Thread Sebastian Huber

On 14/07/2021 08:51, chr...@rtems.org wrote:

@@ -695,12 +692,18 @@ class OptionItem(Item):
  return True
  return False
  
-def default_value(self, variant):

+def default_value(self, variant, family):
  value = self.data["default"]
  for default in self.data["default-by-variant"]:
  if OptionItem._is_variant(default["variants"], variant):
  value = default["value"]
  break
+if 'default-by-family' in self.data:
+for default in self.data["default-by-family"]:
+if 'families' in default:
+if OptionItem._is_variant(default["families"], family):
+value = default["value"]
+break


During the discussion of the build items, we agreed that all attributes 
should be explicit in the items. So, a "default-by-family: []" should be 
added to all BSP items.


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH v2] build: Use BSP family for options

2021-07-14 Thread chrisj
From: Chris Johns 

- Optionally add support for 'default-by-family' to allow
  option to be set by a family and so all related BSPs

Close #4468
---
 wscript | 36 +++-
 1 file changed, 23 insertions(+), 13 deletions(-)

diff --git a/wscript b/wscript
index 6626fafb74..61253b4a0b 100755
--- a/wscript
+++ b/wscript
@@ -592,9 +592,6 @@ class BSPItem(Item):
 arch_bsps = bsps.setdefault(data["arch"].strip(), {})
 arch_bsps[data["bsp"].strip()] = self
 
-def prepare_configure(self, conf, cic):
-conf.env.BSP_FAMILY = self.data["family"]
-
 def prepare_build(self, bld, bic):
 return BuildItemContext(
 bic.includes + bld.env.BSP_INCLUDES.split(), [], [], []
@@ -695,12 +692,18 @@ class OptionItem(Item):
 return True
 return False
 
-def default_value(self, variant):
+def default_value(self, variant, family):
 value = self.data["default"]
 for default in self.data["default-by-variant"]:
 if OptionItem._is_variant(default["variants"], variant):
 value = default["value"]
 break
+if 'default-by-family' in self.data:
+for default in self.data["default-by-family"]:
+if 'families' in default:
+if OptionItem._is_variant(default["families"], family):
+value = default["value"]
+break
 if value is None:
 return value
 if isinstance(value, list):
@@ -709,8 +712,8 @@ class OptionItem(Item):
 return value
 return self.data["format"].format(value)
 
-def do_defaults(self, variant):
-value = self.default_value(variant)
+def do_defaults(self, variant, family):
+value = self.default_value(variant, family)
 if value is None:
 return
 description = self.data["description"]
@@ -917,7 +920,7 @@ class OptionItem(Item):
 value = cic.cp.getboolean(conf.variant, name)
 cic.add_option(name)
 except configparser.NoOptionError:
-value = self.default_value(conf.env.ARCH_BSP)
+value = self.default_value(conf.env.ARCH_BSP, conf.env.ARCH_FAMILY)
 except ValueError as ve:
 conf.fatal(
 "Invalid value for configuration option {}: {}".format(name, 
ve)
@@ -933,7 +936,7 @@ class OptionItem(Item):
 value = cic.cp.get(conf.variant, name)
 cic.add_option(name)
 except configparser.NoOptionError:
-value = self.default_value(conf.env.ARCH_BSP)
+value = self.default_value(conf.env.ARCH_BSP, conf.env.ARCH_FAMILY)
 if value is None:
 return value
 try:
@@ -952,7 +955,7 @@ class OptionItem(Item):
 cic.add_option(name)
 value = no_unicode(value)
 except configparser.NoOptionError:
-value = self.default_value(conf.env.ARCH_BSP)
+value = self.default_value(conf.env.ARCH_BSP, conf.env.ARCH_FAMILY)
 return value
 
 def _script(self, conf, cic, value, arg):
@@ -1365,12 +1368,23 @@ def configure_variant(conf, cp, bsp_map, path_list, 
top_group, variant):
 conf.setenv(variant)
 arch, bsp_name = variant.split("/")
 bsp_base = bsp_map.get(bsp_name, bsp_name)
+
+try:
+bsp_item = bsps[arch][bsp_base]
+except KeyError:
+conf.fatal("No such base BSP: '{}'".format(variant))
+
+family = bsp_item.data['family']
+
 arch_bsp = arch + "/" + bsp_base
+arch_family = arch + "/" + family
 
 conf.env["ARCH"] = arch
 conf.env["ARCH_BSP"] = arch_bsp
+conf.env["ARCH_FAMILY"] = arch_family
 conf.env["BSP_BASE"] = bsp_base
 conf.env["BSP_NAME"] = bsp_name
+conf.env["BSP_FAMILY"] = family
 conf.env["DEST_OS"] = "rtems"
 
 # For the enabled-by evaluation we have to use the base BSP defined by the
@@ -1385,10 +1399,6 @@ def configure_variant(conf, cp, bsp_map, path_list, 
top_group, variant):
 
 items[conf.env.TOPGROUP].configure(conf, cic)
 
-try:
-bsp_item = bsps[arch][bsp_base]
-except KeyError:
-conf.fatal("No such base BSP: '{}'".format(variant))
 bsp_item.configure(conf, cic)
 
 options = set([o[0].upper() for o in cp.items(variant)])
-- 
2.24.1

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


Re: [PATCH] build: Use BSP family for options

2021-07-14 Thread Chris Johns



On 14/7/21 4:20 pm, Sebastian Huber wrote:
> Close #4468.
> ---
>  wscript | 51 ---
>  1 file changed, 28 insertions(+), 23 deletions(-)
> 
> diff --git a/wscript b/wscript
> index 6626fafb74..357e8918df 100755
> --- a/wscript
> +++ b/wscript
> @@ -203,11 +203,11 @@ class Item(object):
>  def get_enabled_by(self):
>  return self.data["enabled-by"]
>  
> -def defaults(self, enable, variant):
> +def defaults(self, enable, variant, family):
>  if _is_enabled(enable, self.get_enabled_by()):
>  for p in self.links():
> -p.defaults(enable, variant)
> -self.do_defaults(variant)
> +p.defaults(enable, variant, family)
> +self.do_defaults(variant, family)
>  
>  def configure(self, conf, cic):
>  if _is_enabled(conf.env.ENABLE, self.get_enabled_by()):
> @@ -223,7 +223,7 @@ class Item(object):
>  p.build(bld, bic)
>  self.do_build(bld, bic)
>  
> -def do_defaults(self, variant):
> +def do_defaults(self, variant, family):
>  return
>  
>  def prepare_configure(self, conf, cic):
> @@ -592,9 +592,6 @@ class BSPItem(Item):
>  arch_bsps = bsps.setdefault(data["arch"].strip(), {})
>  arch_bsps[data["bsp"].strip()] = self
>  
> -def prepare_configure(self, conf, cic):
> -conf.env.BSP_FAMILY = self.data["family"]
> -
>  def prepare_build(self, bld, bic):
>  return BuildItemContext(
>  bic.includes + bld.env.BSP_INCLUDES.split(), [], [], []
> @@ -689,16 +686,18 @@ class OptionItem(Item):
>  super(OptionItem, self).__init__(uid, data)
>  
>  @staticmethod
> -def _is_variant(variants, variant):
> +def _is_variant(variants, variant, family):
>  for pattern in variants:
>  if re.match(pattern + "$", variant):
>  return True
> +if re.match(pattern + "$", family):
> +return True
>  return False
>  
> -def default_value(self, variant):
> +def default_value(self, variant, family):
>  value = self.data["default"]
>  for default in self.data["default-by-variant"]:
> -if OptionItem._is_variant(default["variants"], variant):
> +if OptionItem._is_variant(default["variants"], variant, family):

I would prefer we keep the families and the variants separate. It is cleaner.

I have basically the same patch but optional handling `default-by-family`. :)

I have discussed this on the ticket.

Chris

>  value = default["value"]
>  break
>  if value is None:
> @@ -709,8 +708,8 @@ class OptionItem(Item):
>  return value
>  return self.data["format"].format(value)
>  
> -def do_defaults(self, variant):
> -value = self.default_value(variant)
> +def do_defaults(self, variant, family):
> +value = self.default_value(variant, family)
>  if value is None:
>  return
>  description = self.data["description"]
> @@ -917,7 +916,7 @@ class OptionItem(Item):
>  value = cic.cp.getboolean(conf.variant, name)
>  cic.add_option(name)
>  except configparser.NoOptionError:
> -value = self.default_value(conf.env.ARCH_BSP)
> +value = self.default_value(conf.env.ARCH_BSP, 
> conf.env.ARCH_FAMILY)
>  except ValueError as ve:
>  conf.fatal(
>  "Invalid value for configuration option {}: {}".format(name, 
> ve)
> @@ -933,7 +932,7 @@ class OptionItem(Item):
>  value = cic.cp.get(conf.variant, name)
>  cic.add_option(name)
>  except configparser.NoOptionError:
> -value = self.default_value(conf.env.ARCH_BSP)
> +value = self.default_value(conf.env.ARCH_BSP, 
> conf.env.ARCH_FAMILY)
>  if value is None:
>  return value
>  try:
> @@ -952,7 +951,7 @@ class OptionItem(Item):
>  cic.add_option(name)
>  value = no_unicode(value)
>  except configparser.NoOptionError:
> -value = self.default_value(conf.env.ARCH_BSP)
> +value = self.default_value(conf.env.ARCH_BSP, 
> conf.env.ARCH_FAMILY)
>  return value
>  
>  def _script(self, conf, cic, value, arg):
> @@ -1365,11 +1364,20 @@ def configure_variant(conf, cp, bsp_map, path_list, 
> top_group, variant):
>  conf.setenv(variant)
>  arch, bsp_name = variant.split("/")
>  bsp_base = bsp_map.get(bsp_name, bsp_name)
> -arch_bsp = arch + "/" + bsp_base
>  
> +try:
> +bsp_item = bsps[arch][bsp_base]
> +except KeyError:
> +conf.fatal("No such base BSP: '{}'".format(variant))
> +
> +bsp_family = self.data["family"]
> +arch_bsp = arch + "/" + bsp_base
> +arch_family = arch + "/" + bsp_family
>  conf.env["ARCH"] = arch
>  

[PATCH] build: Use BSP family for options

2021-07-14 Thread Sebastian Huber
Close #4468.
---
 wscript | 51 ---
 1 file changed, 28 insertions(+), 23 deletions(-)

diff --git a/wscript b/wscript
index 6626fafb74..357e8918df 100755
--- a/wscript
+++ b/wscript
@@ -203,11 +203,11 @@ class Item(object):
 def get_enabled_by(self):
 return self.data["enabled-by"]
 
-def defaults(self, enable, variant):
+def defaults(self, enable, variant, family):
 if _is_enabled(enable, self.get_enabled_by()):
 for p in self.links():
-p.defaults(enable, variant)
-self.do_defaults(variant)
+p.defaults(enable, variant, family)
+self.do_defaults(variant, family)
 
 def configure(self, conf, cic):
 if _is_enabled(conf.env.ENABLE, self.get_enabled_by()):
@@ -223,7 +223,7 @@ class Item(object):
 p.build(bld, bic)
 self.do_build(bld, bic)
 
-def do_defaults(self, variant):
+def do_defaults(self, variant, family):
 return
 
 def prepare_configure(self, conf, cic):
@@ -592,9 +592,6 @@ class BSPItem(Item):
 arch_bsps = bsps.setdefault(data["arch"].strip(), {})
 arch_bsps[data["bsp"].strip()] = self
 
-def prepare_configure(self, conf, cic):
-conf.env.BSP_FAMILY = self.data["family"]
-
 def prepare_build(self, bld, bic):
 return BuildItemContext(
 bic.includes + bld.env.BSP_INCLUDES.split(), [], [], []
@@ -689,16 +686,18 @@ class OptionItem(Item):
 super(OptionItem, self).__init__(uid, data)
 
 @staticmethod
-def _is_variant(variants, variant):
+def _is_variant(variants, variant, family):
 for pattern in variants:
 if re.match(pattern + "$", variant):
 return True
+if re.match(pattern + "$", family):
+return True
 return False
 
-def default_value(self, variant):
+def default_value(self, variant, family):
 value = self.data["default"]
 for default in self.data["default-by-variant"]:
-if OptionItem._is_variant(default["variants"], variant):
+if OptionItem._is_variant(default["variants"], variant, family):
 value = default["value"]
 break
 if value is None:
@@ -709,8 +708,8 @@ class OptionItem(Item):
 return value
 return self.data["format"].format(value)
 
-def do_defaults(self, variant):
-value = self.default_value(variant)
+def do_defaults(self, variant, family):
+value = self.default_value(variant, family)
 if value is None:
 return
 description = self.data["description"]
@@ -917,7 +916,7 @@ class OptionItem(Item):
 value = cic.cp.getboolean(conf.variant, name)
 cic.add_option(name)
 except configparser.NoOptionError:
-value = self.default_value(conf.env.ARCH_BSP)
+value = self.default_value(conf.env.ARCH_BSP, conf.env.ARCH_FAMILY)
 except ValueError as ve:
 conf.fatal(
 "Invalid value for configuration option {}: {}".format(name, 
ve)
@@ -933,7 +932,7 @@ class OptionItem(Item):
 value = cic.cp.get(conf.variant, name)
 cic.add_option(name)
 except configparser.NoOptionError:
-value = self.default_value(conf.env.ARCH_BSP)
+value = self.default_value(conf.env.ARCH_BSP, conf.env.ARCH_FAMILY)
 if value is None:
 return value
 try:
@@ -952,7 +951,7 @@ class OptionItem(Item):
 cic.add_option(name)
 value = no_unicode(value)
 except configparser.NoOptionError:
-value = self.default_value(conf.env.ARCH_BSP)
+value = self.default_value(conf.env.ARCH_BSP, conf.env.ARCH_FAMILY)
 return value
 
 def _script(self, conf, cic, value, arg):
@@ -1365,11 +1364,20 @@ def configure_variant(conf, cp, bsp_map, path_list, 
top_group, variant):
 conf.setenv(variant)
 arch, bsp_name = variant.split("/")
 bsp_base = bsp_map.get(bsp_name, bsp_name)
-arch_bsp = arch + "/" + bsp_base
 
+try:
+bsp_item = bsps[arch][bsp_base]
+except KeyError:
+conf.fatal("No such base BSP: '{}'".format(variant))
+
+bsp_family = self.data["family"]
+arch_bsp = arch + "/" + bsp_base
+arch_family = arch + "/" + bsp_family
 conf.env["ARCH"] = arch
 conf.env["ARCH_BSP"] = arch_bsp
+conf.env["ARCH_FAMILY"] = arch_family
 conf.env["BSP_BASE"] = bsp_base
+conf.env["BSP_FAMILY"] = bsp_family
 conf.env["BSP_NAME"] = bsp_name
 conf.env["DEST_OS"] = "rtems"
 
@@ -1384,11 +1392,6 @@ def configure_variant(conf, cp, bsp_map, path_list, 
top_group, variant):
 cic = ConfigItemContext(cp, path_list)
 
 items[conf.env.TOPGROUP].configure(conf, cic)
-
-try:
-bsp_item = bsps[arch][bsp_base]
-except KeyError:
-