[PATCH 0/3] Fixed ability to enable console polling for certain BSPs

Joel Sherrill joel at rtems.org
Tue Mar 26 18:11:34 UTC 2019


On Tue, Mar 26, 2019 at 11:55 AM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> ----- Am 26. Mrz 2019 um 16:17 schrieb joel joel at rtems.org:
>
> > On Tue, Mar 26, 2019 at 9:36 AM Sebastian Huber <
> > sebastian.huber at embedded-brains.de> wrote:
> >
> >> On 26/03/2019 14:56, Lou Woods wrote:
> >> > From: Lou Woods <Lou.Woods at OARCorp.com>
> >> >
> >> > I discovered that I was not able to turn off interrupt-based console
> >> mode on the
> >> > Xilinx Zynq BSP under Qemu via the configure command.  The fix simply
> >> exchanges
> >> > #ifdef XXX_CONSOLE_USE_INTERRUPTS for
> >> > #if XXX_CONSOLE_USE_INTERRUPTS for the BSP specific console code.
> >>
> >> You can disable it via the configure command line, just use
> >>
> >> XXX_CONSOLE_USE_INTERRUPTS=
> >>
> >> I have never seen setting it to nothing ever documented anywhere in
> > the RTEMS pantheon of material. All examples I have ever seen set
> > these to a value
> >
> >
> >> These feature defines are not uniformly used, some use #if other use
> >> #ifdef.
> >>
> >
> > Changing these ifdef CONSOLE_USE to #if ensures they work if the value
> > is set to nothing or 0. I don't see how this isn't an improvement.
>
> I just wanted to point out that this patch changes something that works
> into something else that works also.


Works for more cases. The configure.ac sets it to 1. Setting it to 0 is a
logical choice looking at the configure.ac for what to do.

If I didn't know XXX= results in undefined, I doubt that is common
knowledge.


> The change is somewhat arbitrary.  It should be accompanied with a
> recommendation in the BSP developer documentation.  There should be also a
> ticket for this to change everything from #ifdef XYZ to #if XYZ, if we
> agree that this is actually better.  Only for BSP options, for stuff which
> is available via <bsp.h>, or does it stop, when we change all the #if
> defined(RTEMS_SMP) to #if RTEMS_SMP?
>

Setting something to 0 and using ifdef do not evaluate to the same thing so
for BSP options, I would tend to lean to #if since setting it to 0 and
nothing are equivalent. Plus may of the BSP options do take values so this
helps make them consistent.

For the RTEMS feature flags, there is no associated value and never has
been. It is a simple defined=true, not defined=false. I know there is no
functional difference, but I would say that those should stay to ifdef
since that's the intent. They also are directly from configure arguments
which are explicitly enable/disable so no oddity with user set values.

--joel

>
> For example BSP_FDT_IS_SUPPORTED is also used in libbsd:
>
> rtemsbsd/include/rtems/bsd/local/opt_platform.h
>
> Some BSPs use a define in <bsp.h> another uses a BSP option.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20190326/9448c9e7/attachment-0002.html>


More information about the devel mailing list