qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC 4/4] common-user: Allow return codes to be adjusted after sytse


From: Richard Henderson
Subject: Re: [RFC 4/4] common-user: Allow return codes to be adjusted after sytsem call
Date: Mon, 8 Nov 2021 16:10:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 11/8/21 3:37 AM, Warner Losh wrote:
All the *-users generally use the Linux style of negative return codes
for errno. However, other systems, like FreeBSD, have a different
convention. Allow those systems to insert code after the syscall that
adjusts the return value of the system call to match the native linux
format.

Signed-off-by: Warner Losh <imp@bsdimp.com>
---
  common-user/host/aarch64/safe-syscall.inc.S | 1 +
  common-user/host/arm/safe-syscall.inc.S     | 1 +
  common-user/host/i386/safe-syscall.inc.S    | 1 +
  common-user/host/ppc64/safe-syscall.inc.S   | 1 +
  common-user/host/riscv/safe-syscall.inc.S   | 1 +
  common-user/host/s390x/safe-syscall.inc.S   | 1 +
  common-user/host/x86_64/safe-syscall.inc.S  | 1 +
  linux-user/safe-syscall.S                   | 1 +
  8 files changed, 8 insertions(+)

diff --git a/common-user/host/aarch64/safe-syscall.inc.S 
b/common-user/host/aarch64/safe-syscall.inc.S
index bc1f5a9792..81d83e8e79 100644
--- a/common-user/host/aarch64/safe-syscall.inc.S
+++ b/common-user/host/aarch64/safe-syscall.inc.S
@@ -64,6 +64,7 @@ safe_syscall_start:
        svc     0x0
  safe_syscall_end:
        /* code path for having successfully executed the syscall */
+       ADJUST_SYSCALL_RETCODE
        ret
0:

Not sure about this, really. Is it really that much cleaner to insert this than create separate 10-line files, with the adjustment included?


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]