On Fri, 24 Mar 2023, Segher Boessenkool wrote:
On Fri, Mar 24, 2023 at 12:20:01AM +0100, BALATON Zoltan wrote:
If there were already a significant amount of Forth code in the PCI bindings then a Forth solution such as yours would be a better approach, however for now my preference would be to use the approach from my original series since the glue code provides a much more intuitive solution given that the PCI bindings are written in C.
I disagree but since nobody else here seems to have an opinion or care about OpenBIOS in the end you do what you want. Forth and C are mixed in OpenBIOS also in pci.c already so using that to make pci.c less cluttered and easier to read by adding some very simple forth that's also easily understandable would make this easier to maintain but if this did not convince you I can't do much else.
I care. I find doing as much as possible in C incredibly clumsy, just like you it seems -- you are not alone :-)
But, I don't maintain this code. Whoever does the work gets to make the decisions. I just throw nuts from the peanut gallery sometimes.
I would do some work but apparently I'm not allowed to... Another point is that Mark's proposed changes are something he would never merge if I submitted it so he should be equally critical with his own work and make a cleaner change. What I proposed as an alternative does the same simpler and we have at least 1 and a half votes for it against the 1 vote for Mark's series but if it's still not good enough then do it in C but in a cleaner way, without patching the Forth-C bridge which should also be possible. But I really don't see what would be the advantage of keeping these methods in C which just makes pci.c more cluttered and harder to read and maintain.
Regards, BALATON Zoltan