diff options
author | Benjamin Berg <benjamin.berg@intel.com> | 2024-09-19 14:45:02 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2024-10-10 12:29:08 +0200 |
commit | cbb8e65e234e0139c0c516bb6b9110d210eecd3f (patch) | |
tree | c6abe96d6276524f507a6c9f6548a9828d86b6b8 /arch/x86/um | |
parent | c6ce72005d1af98b983cc27aaa770afa66a1ca90 (diff) |
um: Add generic stub_syscall1 function
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>
Diffstat (limited to 'arch/x86/um')
-rw-r--r-- | arch/x86/um/shared/sysdep/stub_64.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/um/shared/sysdep/stub_64.h b/arch/x86/um/shared/sysdep/stub_64.h index 67f44284f1aa..8e4ff39dcade 100644 --- a/arch/x86/um/shared/sysdep/stub_64.h +++ b/arch/x86/um/shared/sysdep/stub_64.h @@ -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; |