Skip to contentSkip to conversation

x86: Introducing asm-x86/syscalls.h

PATCH In review Jaswinder Singh 2 participants 4 messages Jul 15, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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
index 21f2bae..a278afc 100644
@@ -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
index 0c3927a..8e46d82 100644
@@ -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
index d923736..954a3b8 100644
@@ -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
index ab6bf37..90bc24c 100644
@@ -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
index 38f566f..d77e312 100644
@@ -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
index 0522f36..dfd6744 100644
@@ -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
#1 lore raw

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
index 21f2bae..a278afc 100644
@@ -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
index 0c3927a..8e46d82 100644
@@ -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
index a8e5362..f99381b 100644
@@ -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
index d923736..954a3b8 100644
@@ -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
index e53b267..12c0ab5 100644
@@ -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
index ab6bf37..90bc24c 100644
@@ -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
index 38f566f..d77e312 100644
@@ -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
index 0522f36..dfd6744 100644
@@ -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
#2 lore raw
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
#3 lore raw

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 like ARCH_HAS_ASM_SYSCALLS_H rather 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.