Add <machine/alignbytes.h>.
authorzrj <rimvydas.jasinskas@gmail.com>
Wed, 9 Oct 2019 09:08:16 +0000 (12:08 +0300)
committerzrj <rimvydas.jasinskas@gmail.com>
Mon, 14 Oct 2019 03:44:00 +0000 (06:44 +0300)
commitf7aae1f1815cdcaa49887c3ea201b470db093355
tree7b05615ddd391c4f852dac94290320fdf21d79f3
parent0fa5fd16b6b3a2e2d7692bbaed7a5cc66d24773b
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
sys/cpu/x86_64/include/alignbytes.h [new file with mode: 0644]
sys/cpu/x86_64/include/param.h
sys/sys/param.h
sys/sys/socket.h