On Thu, Apr 15, 2021 at 11:25 AM François Ozog francois.ozog@linaro.org wrote:
"packed" at least works otherwise no network protocol would be operating as expected.
that is a very common misconception. C code for networks existed for decades before packed existed.
packed does not exist in plan 9 compilers to this day and they work fine without it.
The use of packed almost always indicated non-portable assumptions or just plain bad design. Let's stop doing that.
Well, some HOBs can be like that because when you are configuring the DRAM
controllers and the like, each byte on data and instructions count. So those can't be anything but compact binary objects. As we grow up in the layers, HOBs may evolve. Natural candidate for embedded world is Device Tree. But why not CBOR or things like that.
I think device tree would be fine. And defining a marshaling rule from device tree to compact structs for DRAM controllers is a solved problem.
Device tree is a FAR better choice than HOBs. HOBs were a mistake from the time they were created.