Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

um: simplify syscall header files

Since Thomas's recent commit 2af10530639b ("um/x86: Add
system call table to header file") , we now have two
extern declarations of the syscall table, one internal
and one external, and they don't even match on 32-bit.
Clean this up and remove all the extra code.

Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Link: https://patch.msgid.link/20250704141243.a68366f6acc3.If8587a4aafdb90644fc6d0b2f5e31a2d1887915f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+9 -62
+9 -2
arch/um/kernel/skas/syscall.c
··· 9 9 #include <kern_util.h> 10 10 #include <sysdep/ptrace.h> 11 11 #include <sysdep/ptrace_user.h> 12 - #include <sysdep/syscalls.h> 13 12 #include <linux/time-internal.h> 13 + #include <asm/syscall.h> 14 14 #include <asm/unistd.h> 15 15 #include <asm/delay.h> 16 16 ··· 43 43 tt_extra_sched_jiffies += 1; 44 44 45 45 if (syscall >= 0 && syscall < __NR_syscalls) { 46 - unsigned long ret = EXECUTE_SYSCALL(syscall, regs); 46 + unsigned long ret; 47 + 48 + ret = (*sys_call_table[syscall])(UPT_SYSCALL_ARG1(&regs->regs), 49 + UPT_SYSCALL_ARG2(&regs->regs), 50 + UPT_SYSCALL_ARG3(&regs->regs), 51 + UPT_SYSCALL_ARG4(&regs->regs), 52 + UPT_SYSCALL_ARG5(&regs->regs), 53 + UPT_SYSCALL_ARG6(&regs->regs)); 47 54 48 55 PT_REGS_SET_SYSCALL_RETURN(regs, ret); 49 56
-12
arch/x86/um/shared/sysdep/ptrace.h
··· 44 44 #include "ptrace_64.h" 45 45 #endif 46 46 47 - struct syscall_args { 48 - unsigned long args[6]; 49 - }; 50 - 51 - #define SYSCALL_ARGS(r) ((struct syscall_args) \ 52 - { .args = { UPT_SYSCALL_ARG1(r), \ 53 - UPT_SYSCALL_ARG2(r), \ 54 - UPT_SYSCALL_ARG3(r), \ 55 - UPT_SYSCALL_ARG4(r), \ 56 - UPT_SYSCALL_ARG5(r), \ 57 - UPT_SYSCALL_ARG6(r) } } ) 58 - 59 47 extern unsigned long host_fp_size; 60 48 61 49 struct uml_pt_regs {
-6
arch/x86/um/shared/sysdep/syscalls.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifdef __i386__ 3 - #include "syscalls_32.h" 4 - #else 5 - #include "syscalls_64.h" 6 - #endif
-14
arch/x86/um/shared/sysdep/syscalls_32.h
··· 1 - /* 2 - * Copyright (C) 2000 - 2008 Jeff Dike (jdike@{addtoit,linux.intel}.com) 3 - * Licensed under the GPL 4 - */ 5 - 6 - #include <asm/unistd.h> 7 - #include <sysdep/ptrace.h> 8 - 9 - typedef long syscall_handler_t(struct syscall_args); 10 - 11 - extern syscall_handler_t *sys_call_table[]; 12 - 13 - #define EXECUTE_SYSCALL(syscall, regs) \ 14 - ((*sys_call_table[syscall]))(SYSCALL_ARGS(&regs->regs))
-28
arch/x86/um/shared/sysdep/syscalls_64.h
··· 1 - /* 2 - * Copyright 2003 PathScale, Inc. 3 - * 4 - * Licensed under the GPL 5 - */ 6 - 7 - #ifndef __SYSDEP_X86_64_SYSCALLS_H__ 8 - #define __SYSDEP_X86_64_SYSCALLS_H__ 9 - 10 - #include <linux/msg.h> 11 - #include <linux/shm.h> 12 - 13 - typedef long syscall_handler_t(long, long, long, long, long, long); 14 - 15 - extern syscall_handler_t *sys_call_table[]; 16 - 17 - #define EXECUTE_SYSCALL(syscall, regs) \ 18 - (((*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(&regs->regs), \ 19 - UPT_SYSCALL_ARG2(&regs->regs), \ 20 - UPT_SYSCALL_ARG3(&regs->regs), \ 21 - UPT_SYSCALL_ARG4(&regs->regs), \ 22 - UPT_SYSCALL_ARG5(&regs->regs), \ 23 - UPT_SYSCALL_ARG6(&regs->regs))) 24 - 25 - extern syscall_handler_t sys_modify_ldt; 26 - extern syscall_handler_t sys_arch_prctl; 27 - 28 - #endif