From: Johannes Berg <johannes.b...@intel.com>

Since Thomas's recent commit, 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.

Signed-off-by: Johannes Berg <johannes.b...@intel.com>
---
 arch/um/kernel/skas/syscall.c           | 11 ++++++++--
 arch/x86/um/shared/sysdep/ptrace.h      | 12 -----------
 arch/x86/um/shared/sysdep/syscalls.h    |  6 ------
 arch/x86/um/shared/sysdep/syscalls_32.h | 14 -------------
 arch/x86/um/shared/sysdep/syscalls_64.h | 28 -------------------------
 5 files changed, 9 insertions(+), 62 deletions(-)
 delete mode 100644 arch/x86/um/shared/sysdep/syscalls.h
 delete mode 100644 arch/x86/um/shared/sysdep/syscalls_32.h
 delete mode 100644 arch/x86/um/shared/sysdep/syscalls_64.h

diff --git a/arch/um/kernel/skas/syscall.c b/arch/um/kernel/skas/syscall.c
index a5beaea2967e..ba7494f9bfe4 100644
--- a/arch/um/kernel/skas/syscall.c
+++ b/arch/um/kernel/skas/syscall.c
@@ -9,8 +9,8 @@
 #include <kern_util.h>
 #include <sysdep/ptrace.h>
 #include <sysdep/ptrace_user.h>
-#include <sysdep/syscalls.h>
 #include <linux/time-internal.h>
+#include <asm/syscall.h>
 #include <asm/unistd.h>
 #include <asm/delay.h>
 
@@ -43,7 +43,14 @@ void handle_syscall(struct uml_pt_regs *r)
                tt_extra_sched_jiffies += 1;
 
        if (syscall >= 0 && syscall < __NR_syscalls) {
-               unsigned long ret = EXECUTE_SYSCALL(syscall, regs);
+               unsigned long ret;
+
+               ret = (*sys_call_table[syscall])(UPT_SYSCALL_ARG1(&regs->regs),
+                                                UPT_SYSCALL_ARG2(&regs->regs),
+                                                UPT_SYSCALL_ARG3(&regs->regs),
+                                                UPT_SYSCALL_ARG4(&regs->regs),
+                                                UPT_SYSCALL_ARG5(&regs->regs),
+                                                UPT_SYSCALL_ARG6(&regs->regs));
 
                PT_REGS_SET_SYSCALL_RETURN(regs, ret);
 
diff --git a/arch/x86/um/shared/sysdep/ptrace.h 
b/arch/x86/um/shared/sysdep/ptrace.h
index 8f7476ff6e95..572ea2d79131 100644
--- a/arch/x86/um/shared/sysdep/ptrace.h
+++ b/arch/x86/um/shared/sysdep/ptrace.h
@@ -44,18 +44,6 @@
 #include "ptrace_64.h"
 #endif
 
-struct syscall_args {
-       unsigned long args[6];
-};
-
-#define SYSCALL_ARGS(r) ((struct syscall_args) \
-                        { .args = { UPT_SYSCALL_ARG1(r),        \
-                                    UPT_SYSCALL_ARG2(r),        \
-                                    UPT_SYSCALL_ARG3(r),        \
-                                    UPT_SYSCALL_ARG4(r),        \
-                                    UPT_SYSCALL_ARG5(r),        \
-                                    UPT_SYSCALL_ARG6(r) } } )
-
 extern unsigned long host_fp_size;
 
 struct uml_pt_regs {
diff --git a/arch/x86/um/shared/sysdep/syscalls.h 
b/arch/x86/um/shared/sysdep/syscalls.h
deleted file mode 100644
index b2060ac707f0..000000000000
--- a/arch/x86/um/shared/sysdep/syscalls.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifdef __i386__
-#include "syscalls_32.h"
-#else
-#include "syscalls_64.h"
-#endif
diff --git a/arch/x86/um/shared/sysdep/syscalls_32.h 
b/arch/x86/um/shared/sysdep/syscalls_32.h
deleted file mode 100644
index f6e9f84397e7..000000000000
--- a/arch/x86/um/shared/sysdep/syscalls_32.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* 
- * Copyright (C) 2000 - 2008 Jeff Dike (jdike@{addtoit,linux.intel}.com)
- * Licensed under the GPL
- */
-
-#include <asm/unistd.h>
-#include <sysdep/ptrace.h>
-
-typedef long syscall_handler_t(struct syscall_args);
-
-extern syscall_handler_t *sys_call_table[];
-
-#define EXECUTE_SYSCALL(syscall, regs) \
-       ((*sys_call_table[syscall]))(SYSCALL_ARGS(&regs->regs))
diff --git a/arch/x86/um/shared/sysdep/syscalls_64.h 
b/arch/x86/um/shared/sysdep/syscalls_64.h
deleted file mode 100644
index b6b997225841..000000000000
--- a/arch/x86/um/shared/sysdep/syscalls_64.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2003 PathScale, Inc.
- *
- * Licensed under the GPL
- */
-
-#ifndef __SYSDEP_X86_64_SYSCALLS_H__
-#define __SYSDEP_X86_64_SYSCALLS_H__
-
-#include <linux/msg.h>
-#include <linux/shm.h>
-
-typedef long syscall_handler_t(long, long, long, long, long, long);
-
-extern syscall_handler_t *sys_call_table[];
-
-#define EXECUTE_SYSCALL(syscall, regs) \
-       (((*sys_call_table[syscall]))(UPT_SYSCALL_ARG1(&regs->regs), \
-                                     UPT_SYSCALL_ARG2(&regs->regs), \
-                                     UPT_SYSCALL_ARG3(&regs->regs), \
-                                     UPT_SYSCALL_ARG4(&regs->regs), \
-                                     UPT_SYSCALL_ARG5(&regs->regs), \
-                                     UPT_SYSCALL_ARG6(&regs->regs)))
-
-extern syscall_handler_t sys_modify_ldt;
-extern syscall_handler_t sys_arch_prctl;
-
-#endif
-- 
2.50.0


Reply via email to