<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 26, 2019 at 11:55 AM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">----- Am 26. Mrz 2019 um 16:17 schrieb joel <a href="mailto:joel@rtems.org" target="_blank">joel@rtems.org</a>:<br>
<br>
> On Tue, Mar 26, 2019 at 9:36 AM Sebastian Huber <<br>
> <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>> wrote:<br>
> <br>
>> On 26/03/2019 14:56, Lou Woods wrote:<br>
>> > From: Lou Woods <Lou.Woods@OARCorp.com><br>
>> ><br>
>> > I discovered that I was not able to turn off interrupt-based console<br>
>> mode on the<br>
>> > Xilinx Zynq BSP under Qemu via the configure command.  The fix simply<br>
>> exchanges<br>
>> > #ifdef XXX_CONSOLE_USE_INTERRUPTS for<br>
>> > #if XXX_CONSOLE_USE_INTERRUPTS for the BSP specific console code.<br>
>><br>
>> You can disable it via the configure command line, just use<br>
>><br>
>> XXX_CONSOLE_USE_INTERRUPTS=<br>
>><br>
>> I have never seen setting it to nothing ever documented anywhere in<br>
> the RTEMS pantheon of material. All examples I have ever seen set<br>
> these to a value<br>
> <br>
> <br>
>> These feature defines are not uniformly used, some use #if other use<br>
>> #ifdef.<br>
>><br>
> <br>
> Changing these ifdef CONSOLE_USE to #if ensures they work if the value<br>
> is set to nothing or 0. I don't see how this isn't an improvement.<br>
<br>
I just wanted to point out that this patch changes something that works into something else that works also. </blockquote><div><br></div><div>Works for more cases. The <a href="http://configure.ac">configure.ac</a> sets it to 1. Setting it to 0 is a logical choice looking at the <a href="http://configure.ac">configure.ac</a> for what to do. </div><div><br></div><div>If I didn't know XXX= results in undefined, I doubt that is common knowledge.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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?<br></blockquote><div><br></div><div>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. </div><div><br></div><div>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.</div><div><br></div><div>--joel</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
For example BSP_FDT_IS_SUPPORTED is also used in libbsd:<br>
<br>
rtemsbsd/include/rtems/bsd/local/opt_platform.h<br>
<br>
Some BSPs use a define in <bsp.h> another uses a BSP option.<br>
</blockquote></div></div>