[LinuxBIOS] drop struct lb_uint64?

Eric W. Biederman ebiederman at lnxi.com
Sun Nov 13 09:43:27 CET 2005

Stefan Reinauer <stepan at openbios.org> writes:

> * Eric W. Biederman <ebiederman at lnxi.com> [051112 22:13]:
>> > struct lb_uint64 {
>> >         uint32_t lo;
>> >         uint32_t hi;
>> > };
>> No, it used to be a uint64_t and that caused problems.  For reasons of
>> backwards compatibility we want 32bit alignment not 64bit alignment.
>> x86 only requires 32bit alignment for a unit64_t but x86_64 requires
>> 64bit alignment.  
> Ok alignment might be an issue. Though that is a tough assumption made
> that a compiler won't happen to align the above struct to 64bit under
> some circumstances.

Compilers can do a lot but it would have to be a non-ABI conformant
C compiler to request 64bit alignment for that structure.

> Do you remember the problems that this caused? 
> If so, we should probably add a comment to the source, drop one
> version of the [un]pack_lb64 functions and put the other one in a
> common place.
> The reason for my bitching is that there are so many of these things
> that some of us know to be necessary whereas from an outsiders view it
> might look like the left over of a long-fixed compiler bug or
> something.

I actually a little surprised you don't remember as I think you were
the one who brought it to the list.  Someone was using the old
definition which was uint64_t in a 64bit environment and they couldn't
read the table.

I don't have a problem with adding a comment and cleaning up the
implementation.  At the bug fix out was the important piece.  Looking
at this started all kinds of discussion on how we needed to structure
the linuxbios table.  With this fix we did not have to redo everything
so life continued forward.


More information about the coreboot mailing list