x86: Introducing asm-x86/syscalls.h
Subsystems (3)
PATCH 1/1 x86: Introducing asm-x86/syscalls.h
declaring arch-dependent syscalls for x86 under one hood
--- arch/x86/kernel/ldt.c | 1 + arch/x86/kernel/process_32.c | 1 + arch/x86/kernel/signal_32.c | 1 + arch/x86/kernel/tls.c | 1 + arch/x86/kernel/vm86_32.c | 1 + include/asm-x86/syscalls.h | 84 ++++++++++++++++++++++++++++++++++++++++++ include/linux/syscalls.h | 4 ++ 7 files changed, 93 insertions(+), 0 deletions(-) create mode 100644 include/asm-x86/syscalls.h
arch/x86/kernel/ldt.c +1 -0
@@ -12,6 +12,7 @@#include <linux/mm.h> #include <linux/smp.h> #include <linux/vmalloc.h> +#include <linux/syscalls.h> #include <asm/uaccess.h> #include <asm/system.h>
arch/x86/kernel/process_32.c +1 -0
@@ -37,6 +37,7 @@#include <linux/tick.h> #include <linux/percpu.h> #include <linux/prctl.h> +#include <linux/syscalls.h> #include <asm/uaccess.h> #include <asm/pgtable.h>
arch/x86/kernel/signal_32.c +1 -0
@@ -20,6 +20,7 @@#include <linux/elf.h> #include <linux/smp.h> #include <linux/mm.h> +#include <linux/syscalls.h> #include <asm/processor.h> #include <asm/ucontext.h>
arch/x86/kernel/tls.c +1 -0
@@ -3,6 +3,7 @@#include <linux/sched.h> #include <linux/user.h> #include <linux/regset.h> +#include <linux/syscalls.h> #include <asm/uaccess.h> #include <asm/desc.h>
arch/x86/kernel/vm86_32.c +1 -0
@@ -41,6 +41,7 @@#include <linux/ptrace.h> #include <linux/audit.h> #include <linux/stddef.h> +#include <linux/syscalls.h> #include <asm/uaccess.h> #include <asm/io.h>
include/asm-x86/syscalls.h new file +84 -0
84 lines not on this page · raw message
include/linux/syscalls.h +4 -0
@@ -65,6 +65,10 @@ struct getcpu_cache;#include <linux/quota.h> #include <linux/key.h> +#ifdef CONFIG_X86 +#include <asm/syscalls.h> +#endif +asmlinkage long sys_time (time_t __user *tloc);asmlinkage long sys_stime (time_t __user *tptr); asmlinkage long sys_gettimeofday(struct timeval __user *tv,
Signature · 1 line
1.5.5.1
Updated Patch:
declaring arch-dependent syscalls for x86 under one hood
--- arch/x86/kernel/ldt.c | 1 + arch/x86/kernel/process_32.c | 1 + arch/x86/kernel/process_64.c | 1 + arch/x86/kernel/signal_32.c | 1 + arch/x86/kernel/signal_64.c | 1 + arch/x86/kernel/tls.c | 1 + arch/x86/kernel/vm86_32.c | 1 + include/asm-x86/syscalls.h | 84 ++++++++++++++++++++++++++++++++++++++++++ include/linux/syscalls.h | 4 ++ 9 files changed, 95 insertions(+), 0 deletions(-) create mode 100644 include/asm-x86/syscalls.h
arch/x86/kernel/ldt.c +1 -0
@@ -12,6 +12,7 @@#include <linux/mm.h> #include <linux/smp.h> #include <linux/vmalloc.h> +#include <linux/syscalls.h> #include <asm/uaccess.h> #include <asm/system.h>
arch/x86/kernel/process_32.c +1 -0
@@ -37,6 +37,7 @@#include <linux/tick.h> #include <linux/percpu.h> #include <linux/prctl.h> +#include <linux/syscalls.h> #include <asm/uaccess.h> #include <asm/pgtable.h>
arch/x86/kernel/process_64.c +1 -0
@@ -37,6 +37,7 @@#include <linux/kdebug.h> #include <linux/tick.h> #include <linux/prctl.h> +#include <linux/syscalls.h> #include <asm/uaccess.h> #include <asm/pgtable.h>
arch/x86/kernel/signal_32.c +1 -0
@@ -20,6 +20,7 @@#include <linux/elf.h> #include <linux/smp.h> #include <linux/mm.h> +#include <linux/syscalls.h> #include <asm/processor.h> #include <asm/ucontext.h>
arch/x86/kernel/signal_64.c +1 -0
@@ -19,6 +19,7 @@#include <linux/stddef.h> #include <linux/personality.h> #include <linux/compiler.h> +#include <linux/syscalls.h> #include <asm/processor.h> #include <asm/ucontext.h> #include <asm/uaccess.h>
arch/x86/kernel/tls.c +1 -0
@@ -3,6 +3,7 @@#include <linux/sched.h> #include <linux/user.h> #include <linux/regset.h> +#include <linux/syscalls.h> #include <asm/uaccess.h> #include <asm/desc.h>
arch/x86/kernel/vm86_32.c +1 -0
@@ -41,6 +41,7 @@#include <linux/ptrace.h> #include <linux/audit.h> #include <linux/stddef.h> +#include <linux/syscalls.h> #include <asm/uaccess.h> #include <asm/io.h>
include/asm-x86/syscalls.h new file +84 -0
84 lines not on this page · raw message
include/linux/syscalls.h +4 -0
@@ -65,6 +65,10 @@ struct getcpu_cache;#include <linux/quota.h> #include <linux/key.h> +#ifdef CONFIG_X86 +#include <asm/syscalls.h> +#endif +asmlinkage long sys_time (time_t __user *tloc);asmlinkage long sys_stime (time_t __user *tptr); asmlinkage long sys_gettimeofday(struct timeval __user *tv,
Signature · 1 line
1.5.5.1
Quoted 3 lines · Jaswinder Singh
Updated Patch:
declaring arch-dependent syscalls for x86 under one hood
Thanks Jaswinder, this looks quite sensible in general and should go some way towards making sparse shut up about undeclared functions. You should Cc Ingo though.
I don't like this bit though:
include/linux/syscalls.h struct getcpu_cache; · line 74
Quoted 13 lines
include/linux/syscalls.h +4
-0@@ -65,6 +65,10 @@ struct getcpu_cache;#include <linux/quota.h> #include <linux/key.h> +#ifdef CONFIG_X86 +#include <asm/syscalls.h> +#endif +asmlinkage long sys_time (time_t __user *tloc);asmlinkage long sys_stime (time_t __user *tptr); asmlinkage long sys_gettimeofday(struct timeval __user *tv,
We're going to want to do this for all architectures, aren't we? Perhaps it's better to provide <asm/syscalls.h> for all architectures from the beginning, and not bother with the ifdef? Or if you must have an ifdef, perhaps make it on something like ARCH_HAS_ASM_SYSCALLS_H rather than having to change it every time an architecture adds its own <asm/syscalls.h> file?
Signature · 1 line
dwmw2
Hello David,
Quoted 8 lines · David Woodhouse
I don't like this bit though:
Quoted 6 lines
include/linux/syscalls.h +0
-0@@ -65,6 +65,10 @@ struct getcpu_cache;#include <linux/quota.h> #include <linux/key.h>
Quoted 15 lines
include/linux/syscalls.h struct getcpu_cache; · line 74
Quoted 7 lines
include/linux/syscalls.h +4
-0+#ifdef CONFIG_X86 +#include <asm/syscalls.h> +#endif +asmlinkage long sys_time (time_t __user *tloc);asmlinkage long sys_stime (time_t __user *tptr); asmlinkage long sys_gettimeofday(struct timeval __user *tv,We're going to want to do this for all architectures, aren't we? Perhaps it's better to provide <
asm/syscalls.h> for all architectures from the beginning, and not bother with the ifdef? Or if you must have an ifdef, perhaps make it on something likeARCH_HAS_ASM_SYSCALLS_Hrather than having to change it every time an architecture adds its own <asm/syscalls.h> file?
OK, I will also create asm/syscalls.h for all the architectures.
Thank you,
Jaswinder Singh.