diff options
author | Arnd Bergmann <abergman@de.ibm.com> | 2006-03-22 18:00:08 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-26 22:48:22 -0500 |
commit | a7f31841a40776605c834053ad1eb82d539bd79f (patch) | |
tree | c603bce363b9feed7251ef9a29a2edf31009178e | |
parent | 5536408c21cdde38bfdbb59a6fd4fcbf1232699f (diff) |
[PATCH] powerpc: declare arch syscalls in <asm/syscalls.h>
powerpc currently declares some of its own system calls
in <asm/unistd.h>, but not all of them. That place also
contains remainders of the now almost unused kernel syscall
hack.
- Add a new <asm/syscalls.h> with clean declarations
- Include that file from every source that implements one
of these
- Get rid of old declarations in <asm/unistd.h>
This patch is required as a base for implementing system
calls from an SPU, but also makes sense as a general
cleanup.
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/kernel/process.c | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/rtas.c | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal_32.c | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal_64.c | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/syscalls.c | 1 | ||||
-rw-r--r-- | include/asm-powerpc/syscalls.h | 58 | ||||
-rw-r--r-- | include/asm-powerpc/unistd.h | 35 |
7 files changed, 64 insertions, 34 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 995b14688d3a..c6e81bbd615c 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <asm/prom.h> | 45 | #include <asm/prom.h> |
46 | #include <asm/machdep.h> | 46 | #include <asm/machdep.h> |
47 | #include <asm/time.h> | 47 | #include <asm/time.h> |
48 | #include <asm/syscalls.h> | ||
48 | #ifdef CONFIG_PPC64 | 49 | #ifdef CONFIG_PPC64 |
49 | #include <asm/firmware.h> | 50 | #include <asm/firmware.h> |
50 | #endif | 51 | #endif |
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index b5b2add7ad1e..142d818a31a6 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
33 | #include <asm/lmb.h> | 33 | #include <asm/lmb.h> |
34 | #include <asm/udbg.h> | 34 | #include <asm/udbg.h> |
35 | #include <asm/syscalls.h> | ||
35 | 36 | ||
36 | struct rtas_t rtas = { | 37 | struct rtas_t rtas = { |
37 | .lock = SPIN_LOCK_UNLOCKED | 38 | .lock = SPIN_LOCK_UNLOCKED |
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index d7a4e814974d..01e3c08cb550 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
@@ -42,6 +42,7 @@ | |||
42 | 42 | ||
43 | #include <asm/uaccess.h> | 43 | #include <asm/uaccess.h> |
44 | #include <asm/cacheflush.h> | 44 | #include <asm/cacheflush.h> |
45 | #include <asm/syscalls.h> | ||
45 | #include <asm/sigcontext.h> | 46 | #include <asm/sigcontext.h> |
46 | #include <asm/vdso.h> | 47 | #include <asm/vdso.h> |
47 | #ifdef CONFIG_PPC64 | 48 | #ifdef CONFIG_PPC64 |
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 47f910380a6a..82ec2f3f6713 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <asm/pgtable.h> | 33 | #include <asm/pgtable.h> |
34 | #include <asm/unistd.h> | 34 | #include <asm/unistd.h> |
35 | #include <asm/cacheflush.h> | 35 | #include <asm/cacheflush.h> |
36 | #include <asm/syscalls.h> | ||
36 | #include <asm/vdso.h> | 37 | #include <asm/vdso.h> |
37 | 38 | ||
38 | #define DEBUG_SIG 0 | 39 | #define DEBUG_SIG 0 |
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c index ad895c99813b..9b69d99a9103 100644 --- a/arch/powerpc/kernel/syscalls.c +++ b/arch/powerpc/kernel/syscalls.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <asm/uaccess.h> | 40 | #include <asm/uaccess.h> |
41 | #include <asm/ipc.h> | 41 | #include <asm/ipc.h> |
42 | #include <asm/semaphore.h> | 42 | #include <asm/semaphore.h> |
43 | #include <asm/syscalls.h> | ||
43 | #include <asm/time.h> | 44 | #include <asm/time.h> |
44 | #include <asm/unistd.h> | 45 | #include <asm/unistd.h> |
45 | 46 | ||
diff --git a/include/asm-powerpc/syscalls.h b/include/asm-powerpc/syscalls.h new file mode 100644 index 000000000000..c2fe79d4f90f --- /dev/null +++ b/include/asm-powerpc/syscalls.h | |||
@@ -0,0 +1,58 @@ | |||
1 | #ifndef __ASM_POWERPC_SYSCALLS_H | ||
2 | #define __ASM_POWERPC_SYSCALLS_H | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | #include <linux/compiler.h> | ||
6 | #include <linux/linkage.h> | ||
7 | #include <linux/types.h> | ||
8 | #include <asm/signal.h> | ||
9 | |||
10 | struct new_utsname; | ||
11 | struct pt_regs; | ||
12 | struct rtas_args; | ||
13 | struct sigaction; | ||
14 | |||
15 | asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, | ||
16 | unsigned long prot, unsigned long flags, | ||
17 | unsigned long fd, off_t offset); | ||
18 | asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len, | ||
19 | unsigned long prot, unsigned long flags, | ||
20 | unsigned long fd, unsigned long pgoff); | ||
21 | asmlinkage int sys_execve(unsigned long a0, unsigned long a1, | ||
22 | unsigned long a2, unsigned long a3, unsigned long a4, | ||
23 | unsigned long a5, struct pt_regs *regs); | ||
24 | asmlinkage int sys_clone(unsigned long clone_flags, unsigned long usp, | ||
25 | int __user *parent_tidp, void __user *child_threadptr, | ||
26 | int __user *child_tidp, int p6, struct pt_regs *regs); | ||
27 | asmlinkage int sys_fork(unsigned long p1, unsigned long p2, | ||
28 | unsigned long p3, unsigned long p4, unsigned long p5, | ||
29 | unsigned long p6, struct pt_regs *regs); | ||
30 | asmlinkage int sys_vfork(unsigned long p1, unsigned long p2, | ||
31 | unsigned long p3, unsigned long p4, unsigned long p5, | ||
32 | unsigned long p6, struct pt_regs *regs); | ||
33 | asmlinkage int sys_pipe(int __user *fildes); | ||
34 | asmlinkage long sys_rt_sigaction(int sig, | ||
35 | const struct sigaction __user *act, | ||
36 | struct sigaction __user *oact, size_t sigsetsize); | ||
37 | asmlinkage int sys_ipc(uint call, int first, unsigned long second, | ||
38 | long third, void __user *ptr, long fifth); | ||
39 | asmlinkage long ppc64_personality(unsigned long personality); | ||
40 | asmlinkage int ppc_rtas(struct rtas_args __user *uargs); | ||
41 | asmlinkage time_t sys64_time(time_t __user * tloc); | ||
42 | asmlinkage long ppc_newuname(struct new_utsname __user * name); | ||
43 | |||
44 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, | ||
45 | size_t sigsetsize); | ||
46 | |||
47 | #ifndef __powerpc64__ | ||
48 | asmlinkage long sys_sigaltstack(const stack_t __user *uss, | ||
49 | stack_t __user *uoss, int r5, int r6, int r7, int r8, | ||
50 | struct pt_regs *regs); | ||
51 | #else /* __powerpc64__ */ | ||
52 | asmlinkage long sys_sigaltstack(const stack_t __user *uss, | ||
53 | stack_t __user *uoss, unsigned long r5, unsigned long r6, | ||
54 | unsigned long r7, unsigned long r8, struct pt_regs *regs); | ||
55 | #endif /* __powerpc64__ */ | ||
56 | |||
57 | #endif /* __KERNEL__ */ | ||
58 | #endif /* __ASM_POWERPC_SYSCALLS_H */ | ||
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h index 35556993f066..1e990747dce7 100644 --- a/include/asm-powerpc/unistd.h +++ b/include/asm-powerpc/unistd.h | |||
@@ -425,6 +425,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 | |||
425 | #include <linux/types.h> | 425 | #include <linux/types.h> |
426 | #include <linux/compiler.h> | 426 | #include <linux/compiler.h> |
427 | #include <linux/linkage.h> | 427 | #include <linux/linkage.h> |
428 | #include <asm/syscalls.h> | ||
428 | 429 | ||
429 | #define __ARCH_WANT_IPC_PARSE_VERSION | 430 | #define __ARCH_WANT_IPC_PARSE_VERSION |
430 | #define __ARCH_WANT_OLD_READDIR | 431 | #define __ARCH_WANT_OLD_READDIR |
@@ -460,44 +461,10 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6 | |||
460 | * System call prototypes. | 461 | * System call prototypes. |
461 | */ | 462 | */ |
462 | #ifdef __KERNEL_SYSCALLS__ | 463 | #ifdef __KERNEL_SYSCALLS__ |
463 | extern pid_t setsid(void); | ||
464 | extern int write(int fd, const char *buf, off_t count); | ||
465 | extern int read(int fd, char *buf, off_t count); | ||
466 | extern off_t lseek(int fd, off_t offset, int count); | ||
467 | extern int dup(int fd); | ||
468 | extern int execve(const char *file, char **argv, char **envp); | 464 | extern int execve(const char *file, char **argv, char **envp); |
469 | extern int open(const char *file, int flag, int mode); | ||
470 | extern int close(int fd); | ||
471 | extern pid_t waitpid(pid_t pid, int *wait_stat, int options); | ||
472 | #endif /* __KERNEL_SYSCALLS__ */ | 465 | #endif /* __KERNEL_SYSCALLS__ */ |
473 | 466 | ||
474 | /* | 467 | /* |
475 | * Functions that implement syscalls. | ||
476 | */ | ||
477 | unsigned long sys_mmap(unsigned long addr, size_t len, unsigned long prot, | ||
478 | unsigned long flags, unsigned long fd, off_t offset); | ||
479 | unsigned long sys_mmap2(unsigned long addr, size_t len, | ||
480 | unsigned long prot, unsigned long flags, | ||
481 | unsigned long fd, unsigned long pgoff); | ||
482 | struct pt_regs; | ||
483 | int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2, | ||
484 | unsigned long a3, unsigned long a4, unsigned long a5, | ||
485 | struct pt_regs *regs); | ||
486 | int sys_clone(unsigned long clone_flags, unsigned long usp, | ||
487 | int __user *parent_tidp, void __user *child_threadptr, | ||
488 | int __user *child_tidp, int p6, struct pt_regs *regs); | ||
489 | int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3, | ||
490 | unsigned long p4, unsigned long p5, unsigned long p6, | ||
491 | struct pt_regs *regs); | ||
492 | int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3, | ||
493 | unsigned long p4, unsigned long p5, unsigned long p6, | ||
494 | struct pt_regs *regs); | ||
495 | int sys_pipe(int __user *fildes); | ||
496 | struct sigaction; | ||
497 | long sys_rt_sigaction(int sig, const struct sigaction __user *act, | ||
498 | struct sigaction __user *oact, size_t sigsetsize); | ||
499 | |||
500 | /* | ||
501 | * "Conditional" syscalls | 468 | * "Conditional" syscalls |
502 | * | 469 | * |
503 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | 470 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), |