History log of /freebsd-head/sys/compat/linux/linux.h
Revision Date Author Comments
371726d1752f5ce493011c64efd99ea737a379b2 17-Sep-2020 trasz <trasz@FreeBSD.org> Get rid of sv_errtbl and SV_ABI_ERRNO().

Reviewed by: kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26388
283c1fe7cf3e8deb86ec76e0ff582b33e2bce398 29-Jun-2020 kevans <kevans@FreeBSD.org> linux: reposition the comment for bsd_to_linux_bits/linux_to_bsd_bits

rpokala notes that splitting the definitions like this is kind of silly,
since the comment applies to both. Move the comment up (or the definition
down, depending on your perspective on life) accordingly.

Reported by: rpokala
145ddba8bee2bb9e4affa5e3b9acdf21c6c7283d 29-Jun-2020 kevans <kevans@FreeBSD.org> linuxolator: implement memfd_create syscall

This effectively mirrors our libc implementation, but with minor fudging --
name needs to be copied in from userspace, so we just copy it straight into
stack-allocated memfd_name into the correct position rather than allocating
memory that needs to be cleaned up.

The sealing-related fcntl(2) commands, F_GET_SEALS and F_ADD_SEALS, have
also been implemented now that we support them.

Note that this implementation is still not quite at feature parity w.r.t.
the actual Linux version; some caveats, from my foggy memory:

- Need to implement SHM_GROW_ON_WRITE, default for memfd (in progress)
- LTP wants the memfd name exposed to fdescfs
- Linux allows open() of an fdescfs fd with O_TRUNC to truncate after dup.
(?)

Interested parties can install and run LTP from ports (devel/linux-ltp) to
confirm any fixes.

PR: 240874
Reviewed by: kib, trasz
Differential Revision: https://reviews.freebsd.org/D21845
cdba6f91c09527532a2c9078a05ed70c965da529 26-Mar-2020 markj <markj@FreeBSD.org> compat/linux/linux.h depends on queue.h since r353725.

Sponsored by: The FreeBSD Foundation
7b2d70eda730b3e45377e5d272168685e7ec07bd 06-Nov-2019 trasz <trasz@FreeBSD.org> Make linux(4) create /dev/shm. Linux applications often expect
a tmpfs to be mounted there, and because they like to verify it's
actually a mountpoint, a symlink won't do.

Reviewed by: dchagin (earlier version)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20333
ad16acfadb9196e6d3f626287de2461710b871bb 18-Oct-2019 yuripv <yuripv@FreeBSD.org> linux: futex_mtx should follow futex_list

Move futex_mtx to linux_common.ko for amd64 and aarch64 along
with respective list/mutex init/destroy.

PR: 240989
Reported by: Alex S <iwtcex@gmail.com>
fb90dea0cc91f07e9dcb8678bbfc47c7c9d98aa9 18-Oct-2019 yuripv <yuripv@FreeBSD.org> linux: provide just one instance of futex_list

Move futex_list definition to linux.c which is included once
in linux.ko (i386) and in linux_common.ko (amd64 and aarch64)
allowing 32/64 bit linux programs to access the same futexes
in the latter case.

PR: 240989
Reviewed by: dchagin
Differential Revision: https://reviews.freebsd.org/D22073
57102bcf40779603c9e7548e77d75bc66b7514a6 13-May-2019 dchagin <dchagin@FreeBSD.org> Our bsd_to_linux_sockaddr() and linux_to_bsd_sockaddr() functions
alter the userspace sockaddr to convert the format between linux and BSD versions.
That's the minimum 3 of copyin/copyout operations for one syscall.

Also some syscall uses linux_sa_put() and linux_getsockaddr() when load
sockaddr to userspace or from userspace accordingly.

To avoid this chaos, especially converting sockaddr in the userspace,
rewrite these 4 functions to convert sockaddr only in kernel and leave
only 2 of this functions.

Also in order to reduce duplication between MD parts of the Linuxulator put
struct sockaddr conversion functions that are MI out into linux_common module.

PR: 232920
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20157
b83adbe5912c68336dd5681ac6de5b308f366275 06-May-2019 dchagin <dchagin@FreeBSD.org> Rewrite linux_ifflags() in more readable Linuxulator style.

Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20146
90cdaa0665b339584f85be1ce3b5a4ae4db3a185 03-May-2019 dchagin <dchagin@FreeBSD.org> In order to reduce duplication between MD parts of the Linuxulator
move bits that are MI out into the headers in compat/linux.
For that remove bogus _packed attribute from struct l_sockaddr
and use MI types for struct members.

And continue to move into the linux_common module a code that is
intended for both Linuxulator modules (both instruction set - 32 & 64 bit)
or for external modules like linsysfs or linprocfs.

To avoid header pollution introduce new sys/compat/linux_common.h header.

Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20137
00d578928eca75be320b36d37543a7e2a4f9fbdb 27-May-2016 grehan <grehan@FreeBSD.org> Create branch for bhyve graphics import.
05243c722867c54470c4a8757c8c05652a7ad919 09-Jan-2016 dchagin <dchagin@FreeBSD.org> MFC r283474:

Rework signal code to allow using it by other modules, like linprocfs:

1. Linux sigset always 64 bit on all platforms. In order to move Linux
sigset code to the linux_common module define it as 64 bit int. Move
Linux sigset manipulation routines to the MI path.

2. Move Linux signal number definitions to the MI path. In general, they
are the same on all platforms except for a few signals.

3. Map Linux RT signals to the FreeBSD RT signals and hide signal conversion
tables to avoid conversion errors.

4. Emulate Linux SIGPWR signal via FreeBSD SIGRTMIN signal which is outside
of allowed on Linux signal numbers.

PR: 197216
fc55d94b4615c84cb107a77bee7297b9505a7510 24-May-2015 dchagin <dchagin@FreeBSD.org> Rework signal code to allow using it by other modules, like linprocfs:

1. Linux sigset always 64 bit on all platforms. In order to move Linux
sigset code to the linux_common module define it as 64 bit int. Move
Linux sigset manipulation routines to the MI path.

2. Move Linux signal number definitions to the MI path. In general, they
are the same on all platforms except for a few signals.

3. Map Linux RT signals to the FreeBSD RT signals and hide signal conversion
tables to avoid conversion errors.

4. Emulate Linux SIGPWR signal via FreeBSD SIGRTMIN signal which is outside
of allowed on Linux signal numbers.

PR: 197216