[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] kentry version
On 03/26/14 10:27, David Gálvez wrote:
2014-03-26 0:12 GMT+01:00 David Gálvez <dgalvez75@gmail.com>:
2014-03-26 0:03 GMT+01:00 Alan Hourihane <alanh@fairlite.co.uk>:
On 03/25/14 22:02, David Gálvez wrote:
From sources (sys/mint/kentry.h):
/* ATTENTION!
* ----------
* Every structure size modification *must* increase the major version.
* Every other modifcation must increase the minor version.
*
* major and minor are of type unsigned char. I hope 255 major and minor
* versions are enough :-)
*/
About the comment above. kentry is a structure with some
substructures, if the size of some of those substructs is modified the
main structure's size changes too, so for my understanding according
to the note above the major number should be increased too. But
looking at the history of sys/mint/kentry.h when this has been done it
was increased the minor number.
http://sparemint.org/cgi-bin/cvsweb/freemint/sys/mint/kentry.h.diff?r1=1.30&r2=1.31
This change is quite bad for older modules because it changes the size
of the mch struct in the middle of the kentry struct.
Also there were some changes in the main kentry structure adding two
more substructs and again only the minor was changed.
http://sparemint.org/cgi-bin/cvsweb/freemint/sys/mint/kentry.h.diff?r1=1.33&r2=1.34
This one looked o.k. apart from the debug_level addition as most of it was
added to the end of the struct. So I think it's still broken because of
debug_level.
In some reverted change from ozk he added some reserve space to some
of the substructs and on that occasion he increased the major number.
http://sparemint.org/cgi-bin/cvsweb/freemint/sys/mint/kentry.h.diff?r1=1.34&r2=1.35
I can see what ozk was trying to do here, but looking at the above
patches it
seems that increases other struct sizes within the kentry struct can
break stuff
outside of this change.
I think the comment above should be more specific when major and minor
should be increased. What is exaclty a "structure size modification"?.
Is it something subjective and it depends of the importance of those
size changes?
To be honest, we've been lucky I think. Most modules compiled for FreeMiNT
have been shipped with the FreeMiNT build and they'll be in-sync with each
other.
There are a few binary only modules that we don't have source for, which
luckily don't use the kentry struct.
It's possible that anything that does has just been checking the minor
version
anyway and refusing to load if it doesn't match which is fine too.
Anyway, I'm o.k. with just bumping the minor again for now, and leaving the
major number as I've not heard of this breaking outside modules. But we'll
see.
Alan.