svn commit: r283671 - head/sys/sys

Brooks Davis brooks at freebsd.org
Fri May 29 20:35:48 UTC 2015


On Fri, May 29, 2015 at 05:40:16PM +1000, Bruce Evans wrote:
> On Thu, 28 May 2015, Brooks Davis wrote:
> 
> > Log:
> >  Revert r102953
> >
> >  The bitfile padding was always unallocated on real-world FreeBSD systems and
> >  depended on the assumption that (abs(sizeof(long) - sizeof(char*)) <= 32).
> 
> Actually, it was bit-field padding that depended  on the assumption  that
> (abs(sizeof(long) - sizeof(char*)) <= CHAR_BIT * sizeof(int).
> 
> It did work under this assumption, and was needed on non-real-world FreeBSD
> systems with correctly-sized longs.  Why break it?

It doesn't work on CHERI where pointers are 64, 128 or 256 bits
depending on the compilation mode and hardware type (in the latter two
cases they are not arithmetic types).

If this was something we were worried about in practice, forcing the
alignment of n_name and n_type to max(sizeof(long), sizeof(char *))
would accomplish the padding in a way that works for any compiler we
care about and irrespective of size.

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20150529/c28799a8/attachment.sig>


More information about the svn-src-all mailing list