]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fork: Allow ABI to specify fork return values for child.
authorDmitry Chagin <dchagin@FreeBSD.org>
Thu, 12 Aug 2021 08:45:25 +0000 (11:45 +0300)
committerDmitry Chagin <dchagin@FreeBSD.org>
Thu, 12 Aug 2021 08:45:25 +0000 (11:45 +0300)
commitde8374df28cc23ce0d893fd96d1ad0a861414154
tree55b80d76c65061e6746ca6f7635b201829229d5c
parentfc37be246021ee9b7110c9f506141c2bf0bc9fb0
fork: Allow ABI to specify fork return values for child.

At least Linux x86 ABI's does not use carry bit and expects that the dx register
is preserved. For this add a new sv_set_fork_retval hook and call it from cpu_fork().

Add a short comment about touching dx in x86_set_fork_retval(), for more details
see phab comments from kib@ and imp@.

Reviewed by: kib
Differential revision: https://reviews.freebsd.org/D31472
MFC after: 2 weeks
15 files changed:
sys/amd64/amd64/elf_machdep.c
sys/amd64/amd64/vm_machdep.c
sys/amd64/cloudabi32/cloudabi32_sysvec.c
sys/amd64/cloudabi64/cloudabi64_sysvec.c
sys/amd64/linux/linux_sysvec.c
sys/amd64/linux32/linux32_sysvec.c
sys/compat/ia32/ia32_sysvec.c
sys/i386/cloudabi32/cloudabi32_sysvec.c
sys/i386/i386/elf_machdep.c
sys/i386/i386/vm_machdep.c
sys/i386/linux/linux_sysvec.c
sys/kern/imgact_aout.c
sys/kern/init_main.c
sys/sys/sysent.h
sys/x86/include/x86_var.h