<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">On Mon, Jun 29, 2020 at 8:59 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>> wrote:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Jun 29, 2020 at 9:14 AM Niteesh G. S. <<a href="mailto:niteesh.gs@gmail.com" target="_blank">niteesh.gs@gmail.com</a>> wrote:<br>
><br>
> Hello,<br>
><br>
> <a href="https://lists.rtems.org/pipermail/devel/2020-June/060145.html" rel="noreferrer" target="_blank">https://lists.rtems.org/pipermail/devel/2020-June/060145.html</a><br>
> As agreed on the above mail I have started to create patches based<br>
> on the new build system. But I encountered a few issues related to<br>
> the inclusion of header files. I am using one of my patches as an example<br>
> to illustrate the issues.<br>
><br>
> The BUILD System was pulled from Sebastians build branch ( <a href="https://git.rtems.org/sebh/rtems.git/log/?h=build" rel="noreferrer" target="_blank">https://git.rtems.org/sebh/rtems.git/log/?h=build</a> )<br>
><br>
> PROJECT STRUCTURE:<br>
> The FreeBSD files imported to RTEMS are placed under cpukit/libfreebsd/freebsd<br>
> They follow the same file structure as in FreeBSD ( COMMIT [1] ).<br>
><br>
> I have also implemented a few structures to make porting from FreeBSD<br>
> easier and reduce the amount of redundant code. These files are *currently*<br>
> placed under cpukit/libfreebsd/rtems ( COMMIT [2] )<br>
><br>
> The spec file for libfreebsd is objfreebsd.yml [3] with the following contents in the<br>
> include path. We currently don't install anything.<br>
> install: []<br>
> includes:<br>
> - cpukit/libfreebsd<br>
> - cpukit/libfreebsd/freebsd<br>
> - cpukit/libfreebsd/freebsd/sys<br>
> - cpukit/libfreebsd/rtems<br>
><br>
> The files discussed here have the following structure<br>
><br>
> ti_pinmux.c, ti_pinmux.h, ti_cpuid.h are present under<br>
> libfreebsd/freebsd/sys/arm/ti<br>
><br>
> bus.c, device.h, bus.h are present under<br>
> libfreebsd/rtems<br>
><br>
> For full list of files please refer to [4]<br>
><br>
> ISSUES:<br>
> 1) Can't include headers present under libfreebsd in BSPs directory.<br>
> For eg: I want to include ti_cpuid.h [5] in BSP directory but can't do so<br>
> even though the path has been added to the spec file. [3]<br>
> In beagle/bspstart.c:<br>
> #include <arm/ti/ti_cpuid.h><br>
> throws an error even though the path has been added in the spec file.<br>
><br>
Seb addressed this.<br>
<br>
> 2) Is it possible to have two same files one in RTEMS and other in RTEMS-libBSD<br>
> without collision? At least with different install paths?<br>
> For eg: The openfirm.h in RTEMS under something like<br>
> libfreebsd/dev/ofw/openfirm.h<br>
> And the open in libBSD as it is done currently.<br>
> So this way we can include the RTEMS variant with<br>
> #include <libfreebsd/dev/ofw/openfirm.h><br>
><br>
This should be possible. However I see a few concerns with the idea:<br>
1. if the location is ambiguous then which header gets picked up could<br>
be system-specific based on how it handles include path searching.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">How will the path be ambiguous if they are installed into two different sub-directories?</div></div><div><div class="gmail_default" style="font-size:small">Say we install the RTEMS variant of openfirm.h in $PREFIX/libfreebsd/dev/ofw. This</div><div class="gmail_default" style="font-size:small">way we can include it using #include <libfreebsd/dev/ofw></div></div><div class="gmail_default" style="font-size:small">And we install the RTEMS-libBSD variant in its original directory which I guess ( not really sure)</div><div class="gmail_default" style="font-size:small">is $PREFIX/dev/ofw/openfirm.h.</div><div class="gmail_default" style="font-size:small">The files are in two different subdirectories, will this still be ambiguous?</div><div class="gmail_default" style="font-size:small"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
2. is there a need to keep them in sync between rtems and libbsd?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">I don't really understand what you mean by sync. If it is about maintaining the same file structure</div><div class="gmail_default" style="font-size:small">as in libbsd, then it depends on the use case.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">For example,</div><div class="gmail_default" style="font-size:small">For some files, it doesn't matter. An example is OpenFirmware functions. We can install the RTEMS</div><div class="gmail_default" style="font-size:small">variant to any directory as long as it doesn't collide with the libBSD variant.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">But in case of the pinmux driver, we will be porting it to RTEMS and will be removing it from libBSD</div><div class="gmail_default" style="font-size:small">in this case, it is really important to make sure we install it in the right directory i.e. maintain the same</div><div class="gmail_default" style="font-size:small">structure as it was in libBSD or else we will break things in libBSD.</div><div class="gmail_default" style="font-size:small">I am sorry if I misunderstood something.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks,</div><div class="gmail_default" style="font-size:small">Niteesh.</div><br></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">
> Thanks,<br>
> Niteesh<br>
><br>
> [1] <a href="https://github.com/gs-niteesh/rtems/commit/4e7b3cd7c3f8e6ea71f7a1e988562b0b7a5a540e" rel="noreferrer" target="_blank">https://github.com/gs-niteesh/rtems/commit/4e7b3cd7c3f8e6ea71f7a1e988562b0b7a5a540e</a><br>
> [2] <a href="https://github.com/gs-niteesh/rtems/commit/dbad2319a153513d02e7c0ab290ac72c04a5a715" rel="noreferrer" target="_blank">https://github.com/gs-niteesh/rtems/commit/dbad2319a153513d02e7c0ab290ac72c04a5a715</a><br>
> [3] <a href="https://github.com/gs-niteesh/rtems/commit/5eac1348c1b2fe2fdc406a3e573b66885f6eb93e" rel="noreferrer" target="_blank">https://github.com/gs-niteesh/rtems/commit/5eac1348c1b2fe2fdc406a3e573b66885f6eb93e</a><br>
> [4] <a href="https://github.com/gs-niteesh/rtems/tree/pinmux_rtems6/cpukit/libfreebsd" rel="noreferrer" target="_blank">https://github.com/gs-niteesh/rtems/tree/pinmux_rtems6/cpukit/libfreebsd</a><br>
> [5] <a href="https://github.com/gs-niteesh/rtems/blob/a4859fe053482b0b6b09c01b28fd06027356f3be/bsps/arm/beagle/start/bsp-soc-detect.h#L36" rel="noreferrer" target="_blank">https://github.com/gs-niteesh/rtems/blob/a4859fe053482b0b6b09c01b28fd06027356f3be/bsps/arm/beagle/start/bsp-soc-detect.h#L36</a><br>
><br>
> _______________________________________________<br>
> devel mailing list<br>
> <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div>