hurd: Implement MAP_32BIT
authorSergey Bugaev <bugaevc@gmail.com>
Sun, 23 Apr 2023 21:55:23 +0000 (00:55 +0300)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 24 Apr 2023 20:42:12 +0000 (22:42 +0200)
commit70b9173caa3a6e8e4cc1c8ebe93ed15a19388687
tree99a5c9ff253c8e1c2f7d3a0e3a9c39b74711ef2d
parent533deafbdf189f5fbb280c28562dd43ace2f4b0f
hurd: Implement MAP_32BIT

This is a flag that can be passed to mmap () to request that the mapping
being established should be located in the lower 2 GB area of the
address space, so only the lower 31 (not 32) bits can be set in its
address, and the address can be represented as a 32-bit integer without
truncating it.

This flag is intended to be compatible with Linux, FreeBSD, and Darwin
flags of the same name. Out of those systems, it appears Linux and
FreeBSD take MAP_32BIT to mean "map 31 bit", whereas Darwin allows the
32nd bit to be set in the address as well. The Hurd follows Linux and
FreeBSD behavior.

Unlike on those systems, on the Hurd MAP_32BIT is defined on all
supported architectures (which currently are only i386 and x86_64).

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Message-Id: <20230423215526.346009-1-bugaevc@gmail.com>
sysdeps/mach/hurd/bits/mman_ext.h
sysdeps/mach/hurd/dl-sysdep.c
sysdeps/mach/hurd/mmap.c