<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">On Thu, May 7, 2020 at 1:21 PM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</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 07/05/2020 09:35, Niteesh G. S. wrote:<br>
<br>
> This is what I was trying to convey in one of the previous mails.<br>
> <a href="https://lists.rtems.org/pipermail/devel/2020-May/059717.html" rel="noreferrer" target="_blank">https://lists.rtems.org/pipermail/devel/2020-May/059717.html</a><br>
> But in that mail, I was planning to replace KOBJLOOKUP.<br>
> Should I start working on it? From the top of my mind, the following has<br>
> to be done.<br>
> 1) Import openfirm.c openfirm.h, ofw_fdt.c<br>
> 2) Add ofw_fdt.h since all the functions in ofw_fdt are static.<br>
> Should we also import ofw_if.h? Because that is where OFW_* functions<br>
> are defined or just add a ofw_rtems_map.h which redefines them, instead<br>
> of importing ofw_if.h?<br>
<br>
The KOBJ stuff in the OFW support enables FreeBSD to have three <br>
different implementations of the OFW API which can be selected at runtime:<br>
<br>
sys/powerpc/ofw/ofw_real.c<br>
sys/dev/ofw/ofw_standard.c<br>
sys/dev/ofw/ofw_fdt.c<br>
<br>
In libbsd this is already short cut to the FDT implementation:<br>
<br>
#ifndef __rtems__<br>
static ofw_def_t *ofw_def_impl = NULL;<br>
#else /* __rtems__ */<br>
#define ofw_def_impl (&ofw_fdt)<br>
#endif /* __rtems__ */<br>
<br>
To me this looks like the KOBJ stuff was just used to enable some sort <br>
of object oriented programming. Do we need this flexibility at runtime <br>
in RTEMS? I would say no. I would hard wire this to the FDT <br>
implementation. If someone has a problem with it in the future, this <br>
decision can be readdressed.<br></blockquote><div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Ok. But what is the neatest way to hardwire this to the FDT implementation?</div><div class="gmail_default" style="font-size:small">One way as Christian mentioned would be to redefine OFW_* functions to</div><div class="gmail_default" style="font-size:small">call the functions in ofw_fdt.c directly. Is there any other way?</div><div class="gmail_default" style="font-size:small"></div><br></div><div> </div></div></div>