K 10 svn:author V 8 jhibbits K 8 svn:date V 27 2022-05-23T22:12:55.563095Z K 7 svn:log V 1064 cpuset: Byte swap cpuset for compat32 on big endian architectures Summary: BITSET uses long as its basic underlying type, which is dependent on the compile type, meaning on 32-bit builds the basic type is 32 bits, but on 64-bit builds it's 64 bits. On little endian architectures this doesn't matter, because the LSB is always at the low bit, so the words get effectively concatenated moving between 32-bit and 64-bit, but on big-endian architectures it throws a wrench in, as setting bit 0 in 32-bit mode is equivalent to setting bit 32 in 64-bit mode. To demonstrate: 32-bit mode: BIT_SET(foo, 0): 0x00000001 64-bit sees: 0x0000000100000000 cpuset is the only system interface that uses bitsets, so solve this by swapping the integer sub-components at the copyin/copyout points. Reviewed by: kib Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D35225 (cherry picked from commit 47a57144af25a7bd768b29272d50a36fdf2874ba) Git Hash: 3b70988d73766cafdfd142e43f61f4498edd4b20 Git Author: jhibbits@FreeBSD.org END