]> xenbits.xensource.com Git - xen.git/commit
xen: Implement common byte{order,swap}.h
authorLin Liu <lin.liu@citrix.com>
Mon, 9 May 2022 05:47:10 +0000 (01:47 -0400)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 18 Apr 2025 14:16:12 +0000 (15:16 +0100)
commitf6784ea2f967f0bacaad83a0e6a86a648e5d2d65
treece719d65352cec05089f782139b8ba433c3bc22e
parenta20e5908e218d07c293ac8d49fb58f0f3a72125b
xen: Implement common byte{order,swap}.h

The current swab??() infrastructure is unnecessarily complicated, and can be
replaced entirely with compiler builtins.

All supported compilers provide __BYTE_ORDER__ and __builtin_bswap??().

Nothing in Xen cares about the values of __{BIG,LITTLE}_ENDIAN; just that one
of them is defined.  Therefore, centralise their definitions in xen/config.h

Signed-off-by: Lin Liu <lin.liu@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/include/xen/byteorder.h [new file with mode: 0644]
xen/include/xen/byteorder/big_endian.h
xen/include/xen/byteorder/little_endian.h
xen/include/xen/byteswap.h [new file with mode: 0644]
xen/include/xen/config.h