freebsd-dev/sys/compat/freebsd32
Justin Hibbits 47a57144af 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
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D35225
2022-05-19 10:49:55 -05:00
..
freebsd32_abort2.c freebsd32: add real abort2 2021-11-17 20:12:25 +00:00
freebsd32_capability.c fd: rename fget*_locked to fget*_noref 2022-02-22 18:53:43 +00:00
freebsd32_ioctl.c freebsd32: simplify memrange translation 2021-11-17 20:12:24 +00:00
freebsd32_ioctl.h Move 32-bit compat support for FIODGNAME to the right place. 2018-10-26 17:59:25 +00:00
freebsd32_ipc.h freebsd32: Fix layout of struct shmid_kernel32. 2022-01-18 10:42:21 -08:00
freebsd32_misc.c cpuset: Byte swap cpuset for compat32 on big endian architectures 2022-05-19 10:49:55 -05:00
freebsd32_misc.h Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
freebsd32_proto.h sysent: regen for syscallarg_t 2022-03-28 19:43:03 +01:00
freebsd32_signal.h sys/compat: Use C99 fixed-width integer types. 2021-12-28 09:41:33 -08:00
freebsd32_syscall.h Regen 2021-12-09 02:49:10 +02:00
freebsd32_syscalls.c Regen 2021-12-09 02:49:10 +02:00
freebsd32_sysent.c sysent: regen after 52a1d90c8b, posix_fadvise in capmode 2022-04-14 15:17:36 -04:00
freebsd32_systrace_args.c Regen 2021-12-09 02:49:10 +02:00
freebsd32_util.h sys/compat: Use C99 fixed-width integer types. 2021-12-28 09:41:33 -08:00
freebsd32.h proc: Add a sysctl to fetch virtual address space layout info 2022-01-17 16:12:43 -05:00
Makefile freebsd32: generate from sys/kern/syscalls.master 2021-11-22 22:36:58 +00:00
syscalls.conf freebsd32: generate from sys/kern/syscalls.master 2021-11-22 22:36:58 +00:00