linux-user: Move syscall error detection into safe_syscall_base
The current api from safe_syscall_base() is to return -errno, which is the interface provided by *some* linux kernel abis. The wrapper macro, safe_syscall(), detects error, stores into errno, and returns -1, to match the api of the system syscall(). For those kernel abis that do not return -errno natively, this leads to double syscall error detection. E.g. Linux ppc64, which sets the SO flag for error. Simplify the usage from C by moving the error detection into assembly, and usage from assembly by providing a C helper with which to set errno. Reviewed-by:Warner Losh <imp@bsdimp.com> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
Showing
- linux-user/host/aarch64/safe-syscall.inc.S 11 additions, 9 deletionslinux-user/host/aarch64/safe-syscall.inc.S
- linux-user/host/arm/safe-syscall.inc.S 18 additions, 9 deletionslinux-user/host/arm/safe-syscall.inc.S
- linux-user/host/i386/safe-syscall.inc.S 25 additions, 10 deletionslinux-user/host/i386/safe-syscall.inc.S
- linux-user/host/ppc64/safe-syscall.inc.S 11 additions, 13 deletionslinux-user/host/ppc64/safe-syscall.inc.S
- linux-user/host/riscv/safe-syscall.inc.S 11 additions, 9 deletionslinux-user/host/riscv/safe-syscall.inc.S
- linux-user/host/s390x/safe-syscall.inc.S 19 additions, 11 deletionslinux-user/host/s390x/safe-syscall.inc.S
- linux-user/host/x86_64/safe-syscall.inc.S 15 additions, 12 deletionslinux-user/host/x86_64/safe-syscall.inc.S
- linux-user/meson.build 1 addition, 0 deletionslinux-user/meson.build
- linux-user/safe-syscall-error.c 28 additions, 0 deletionslinux-user/safe-syscall-error.c
- linux-user/safe-syscall.h 5 additions, 11 deletionslinux-user/safe-syscall.h
Loading
Please register or sign in to comment