]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
um: Add generic stub_syscall1 function
authorBenjamin Berg <benjamin.berg@intel.com>
Thu, 19 Sep 2024 12:45:02 +0000 (14:45 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 10 Oct 2024 10:29:08 +0000 (12:29 +0200)
The 64bit version did not have a stub_syscall1 function yet. Add it as
it will be useful to implement a static binary for stub loading.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20240919124511.282088-2-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
arch/x86/um/shared/sysdep/stub_64.h

index 67f44284f1aa41b4279bf67f7d93a3fd92155cd2..8e4ff39dcade59ad9ee4933366440c69c43e1d7b 100644 (file)
@@ -28,6 +28,17 @@ static __always_inline long stub_syscall0(long syscall)
        return ret;
 }
 
+static __always_inline long stub_syscall1(long syscall, long arg1)
+{
+       long ret;
+
+       __asm__ volatile (__syscall
+               : "=a" (ret)
+               : "0" (syscall), "D" (arg1) : __syscall_clobber );
+
+       return ret;
+}
+
 static __always_inline long stub_syscall2(long syscall, long arg1, long arg2)
 {
        long ret;