git: Add <machine/alignbytes.h>.

Rimvydas Jasinskas zrj at crater.dragonflybsd.org
Sun Oct 13 20:24:33 PDT 2019


commit f7aae1f1815cdcaa49887c3ea201b470db093355
Author: zrj <rimvydas.jasinskas at gmail.com>
Date:   Wed Oct 9 12:08:16 2019 +0300

    Add <machine/alignbytes.h>.
    
     Refactor ALIGN* macros to fix issue in <sys/socket.h> after the
     _CMSG_ALIGN() macro was adjusted to use ALIGNBYTES definition.
     * Including <sys/param.h> would introduce major namespace pollution.
     * Use NetBSD variant of namespace friendly double underscore versions.
     * Instead of <machine/cdefs.h> put double underscore versions into self
       contained header to minimize header poisoning.
     * Provide __ALIGNPTR() macro to avoid visibility issues with uintptr_t.
     * Move out single underscore versions from <machine/param.h>.  Keep them
       for OpenBSD compat that declares them in <ARCH/_types.h>.
     * Make non underscored versions user overridable (just like NetBSD).
       This is useful for cases where different alignment is needed.
    
     Later on this new header can be adjusted to provide other alignment
     macros like: STACKALIGNBYTES, ALIGNED_POINTER etc.
    
    In-discussion-with: swilder

Summary of changes:
 .../cpu/x86_64/include/alignbytes.h                | 24 ++++++++--------------
 sys/cpu/x86_64/include/param.h                     | 15 --------------
 sys/sys/param.h                                    | 16 +++++++++++++++
 sys/sys/socket.h                                   |  5 ++---
 4 files changed, 26 insertions(+), 34 deletions(-)
 copy include/alloca.h => sys/cpu/x86_64/include/alignbytes.h (77%)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f7aae1f1815cdcaa49887c3ea201b470db093355


-- 
DragonFly BSD source repository


More information about the Commits mailing list