diff options
author | Arnd Bergmann <arnd@arndb.de> | 2009-06-18 13:55:30 -0400 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2009-07-06 04:26:59 -0400 |
commit | e513588f75912f022677866244de6b19b98b8d9a (patch) | |
tree | 4c15e257676b77ea229464c71bbc735e9b5db60c /arch | |
parent | 3183e06863f49a500fc76427db4d60825a26f81b (diff) |
microblaze: use generic syscalls.h
The prototypes in syscalls.h all make sense for
microblaze, but for some of them, the actual implementation
in sys_microblaze.c needs to be adapted.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/microblaze/include/asm/syscalls.h | 39 | ||||
-rw-r--r-- | arch/microblaze/kernel/entry-nommu.S | 12 | ||||
-rw-r--r-- | arch/microblaze/kernel/entry.S | 11 | ||||
-rw-r--r-- | arch/microblaze/kernel/signal.c | 2 | ||||
-rw-r--r-- | arch/microblaze/kernel/sys_microblaze.c | 20 | ||||
-rw-r--r-- | arch/microblaze/kernel/syscall_table.S | 6 |
6 files changed, 28 insertions, 62 deletions
diff --git a/arch/microblaze/include/asm/syscalls.h b/arch/microblaze/include/asm/syscalls.h index ea23843e2c26..720761cc741f 100644 --- a/arch/microblaze/include/asm/syscalls.h +++ b/arch/microblaze/include/asm/syscalls.h | |||
@@ -1,41 +1,8 @@ | |||
1 | #ifndef __ASM_MICROBLAZE_SYSCALLS_H | 1 | #ifndef __ASM_MICROBLAZE_SYSCALLS_H |
2 | #define __ASM_MICROBLAZE_SYSCALLS_H | ||
3 | #ifdef __KERNEL__ | ||
4 | 2 | ||
5 | #include <linux/compiler.h> | 3 | asmlinkage long sys_clone(int flags, unsigned long stack, struct pt_regs *regs); |
6 | #include <linux/linkage.h> | 4 | #define sys_clone sys_clone |
7 | #include <linux/types.h> | ||
8 | #include <linux/signal.h> | ||
9 | 5 | ||
10 | /* FIXME will be removed */ | 6 | #include <asm-generic/syscalls.h> |
11 | asmlinkage int sys_ipc(uint call, int first, int second, | ||
12 | int third, void *ptr, long fifth); | ||
13 | 7 | ||
14 | struct pt_regs; | ||
15 | asmlinkage int sys_vfork(struct pt_regs *regs); | ||
16 | asmlinkage int sys_clone(int flags, unsigned long stack, struct pt_regs *regs); | ||
17 | asmlinkage int sys_execve(char __user *filenamei, char __user *__user *argv, | ||
18 | char __user *__user *envp, struct pt_regs *regs); | ||
19 | |||
20 | asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len, | ||
21 | unsigned long prot, unsigned long flags, | ||
22 | unsigned long fd, unsigned long pgoff); | ||
23 | |||
24 | asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, | ||
25 | unsigned long prot, unsigned long flags, | ||
26 | unsigned long fd, off_t offset); | ||
27 | |||
28 | /* from signal.c */ | ||
29 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize, | ||
30 | struct pt_regs *regs); | ||
31 | |||
32 | asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act, | ||
33 | struct sigaction __user *oact, size_t sigsetsize); | ||
34 | |||
35 | asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | ||
36 | struct pt_regs *regs); | ||
37 | |||
38 | asmlinkage long sys_rt_sigreturn(struct pt_regs *regs); | ||
39 | |||
40 | #endif /* __KERNEL__ */ | ||
41 | #endif /* __ASM_MICROBLAZE_SYSCALLS_H */ | 8 | #endif /* __ASM_MICROBLAZE_SYSCALLS_H */ |
diff --git a/arch/microblaze/kernel/entry-nommu.S b/arch/microblaze/kernel/entry-nommu.S index 2eaf3946cb42..9083d85376a4 100644 --- a/arch/microblaze/kernel/entry-nommu.S +++ b/arch/microblaze/kernel/entry-nommu.S | |||
@@ -551,16 +551,16 @@ no_work_pending: | |||
551 | rtid r14, 0 | 551 | rtid r14, 0 |
552 | nop | 552 | nop |
553 | 553 | ||
554 | sys_vfork_wrapper: | 554 | sys_vfork: |
555 | brid sys_vfork | 555 | brid microblaze_vfork |
556 | addk r5, r1, r0 | 556 | addk r5, r1, r0 |
557 | 557 | ||
558 | sys_clone_wrapper: | 558 | sys_clone: |
559 | brid sys_clone | 559 | brid microblaze_clone |
560 | addk r7, r1, r0 | 560 | addk r7, r1, r0 |
561 | 561 | ||
562 | sys_execve_wrapper: | 562 | sys_execve: |
563 | brid sys_execve | 563 | brid microblaze_execve |
564 | addk r8, r1, r0 | 564 | addk r8, r1, r0 |
565 | 565 | ||
566 | sys_rt_sigreturn_wrapper: | 566 | sys_rt_sigreturn_wrapper: |
diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S index ea7107652d8d..c7353e79f4a2 100644 --- a/arch/microblaze/kernel/entry.S +++ b/arch/microblaze/kernel/entry.S | |||
@@ -429,12 +429,11 @@ C_ENTRY(ret_from_fork): | |||
429 | brid ret_from_trap; /* Do normal trap return */ | 429 | brid ret_from_trap; /* Do normal trap return */ |
430 | nop; | 430 | nop; |
431 | 431 | ||
432 | C_ENTRY(sys_vfork_wrapper): | 432 | C_ENTRY(sys_vfork): |
433 | brid microblaze_vfork /* Do real work (tail-call) */ | ||
433 | la r5, r1, PTO | 434 | la r5, r1, PTO |
434 | brid sys_vfork /* Do real work (tail-call) */ | ||
435 | nop | ||
436 | 435 | ||
437 | C_ENTRY(sys_clone_wrapper): | 436 | C_ENTRY(sys_clone): |
438 | bnei r6, 1f; /* See if child SP arg (arg 1) is 0. */ | 437 | bnei r6, 1f; /* See if child SP arg (arg 1) is 0. */ |
439 | lwi r6, r1, PTO+PT_R1; /* If so, use paret's stack ptr */ | 438 | lwi r6, r1, PTO+PT_R1; /* If so, use paret's stack ptr */ |
440 | 1: la r7, r1, PTO; /* Arg 2: parent context */ | 439 | 1: la r7, r1, PTO; /* Arg 2: parent context */ |
@@ -444,9 +443,9 @@ C_ENTRY(sys_clone_wrapper): | |||
444 | brid do_fork /* Do real work (tail-call) */ | 443 | brid do_fork /* Do real work (tail-call) */ |
445 | nop; | 444 | nop; |
446 | 445 | ||
447 | C_ENTRY(sys_execve_wrapper): | 446 | C_ENTRY(sys_execve): |
448 | la r8, r1, PTO; /* add user context as 4th arg */ | 447 | la r8, r1, PTO; /* add user context as 4th arg */ |
449 | brid sys_execve; /* Do real work (tail-call).*/ | 448 | brid microblaze_execve; /* Do real work (tail-call).*/ |
450 | nop; | 449 | nop; |
451 | 450 | ||
452 | C_ENTRY(sys_rt_sigsuspend_wrapper): | 451 | C_ENTRY(sys_rt_sigsuspend_wrapper): |
diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c index 2e5862c3002a..493819c25fba 100644 --- a/arch/microblaze/kernel/signal.c +++ b/arch/microblaze/kernel/signal.c | |||
@@ -46,7 +46,7 @@ | |||
46 | asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_sycall); | 46 | asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_sycall); |
47 | 47 | ||
48 | 48 | ||
49 | asmlinkage int | 49 | asmlinkage long |
50 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | 50 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, |
51 | struct pt_regs *regs) | 51 | struct pt_regs *regs) |
52 | { | 52 | { |
diff --git a/arch/microblaze/kernel/sys_microblaze.c b/arch/microblaze/kernel/sys_microblaze.c index 31905ff590b7..8c9ebac5da10 100644 --- a/arch/microblaze/kernel/sys_microblaze.c +++ b/arch/microblaze/kernel/sys_microblaze.c | |||
@@ -39,7 +39,7 @@ | |||
39 | * | 39 | * |
40 | * This is really horribly ugly. This will be remove with new toolchain. | 40 | * This is really horribly ugly. This will be remove with new toolchain. |
41 | */ | 41 | */ |
42 | asmlinkage int | 42 | asmlinkage long |
43 | sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth) | 43 | sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth) |
44 | { | 44 | { |
45 | int version, ret; | 45 | int version, ret; |
@@ -134,20 +134,20 @@ sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth) | |||
134 | return ret; | 134 | return ret; |
135 | } | 135 | } |
136 | 136 | ||
137 | asmlinkage int sys_vfork(struct pt_regs *regs) | 137 | asmlinkage long microblaze_vfork(struct pt_regs *regs) |
138 | { | 138 | { |
139 | return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->r1, | 139 | return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->r1, |
140 | regs, 0, NULL, NULL); | 140 | regs, 0, NULL, NULL); |
141 | } | 141 | } |
142 | 142 | ||
143 | asmlinkage int sys_clone(int flags, unsigned long stack, struct pt_regs *regs) | 143 | asmlinkage long microblaze_clone(int flags, unsigned long stack, struct pt_regs *regs) |
144 | { | 144 | { |
145 | if (!stack) | 145 | if (!stack) |
146 | stack = regs->r1; | 146 | stack = regs->r1; |
147 | return do_fork(flags, stack, regs, 0, NULL, NULL); | 147 | return do_fork(flags, stack, regs, 0, NULL, NULL); |
148 | } | 148 | } |
149 | 149 | ||
150 | asmlinkage int sys_execve(char __user *filenamei, char __user *__user *argv, | 150 | asmlinkage long microblaze_execve(char __user *filenamei, char __user *__user *argv, |
151 | char __user *__user *envp, struct pt_regs *regs) | 151 | char __user *__user *envp, struct pt_regs *regs) |
152 | { | 152 | { |
153 | int error; | 153 | int error; |
@@ -163,8 +163,8 @@ out: | |||
163 | return error; | 163 | return error; |
164 | } | 164 | } |
165 | 165 | ||
166 | asmlinkage unsigned long | 166 | asmlinkage long |
167 | sys_mmap2(unsigned long addr, size_t len, | 167 | sys_mmap2(unsigned long addr, unsigned long len, |
168 | unsigned long prot, unsigned long flags, | 168 | unsigned long prot, unsigned long flags, |
169 | unsigned long fd, unsigned long pgoff) | 169 | unsigned long fd, unsigned long pgoff) |
170 | { | 170 | { |
@@ -189,18 +189,18 @@ out: | |||
189 | return ret; | 189 | return ret; |
190 | } | 190 | } |
191 | 191 | ||
192 | asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, | 192 | asmlinkage long sys_mmap(unsigned long addr, unsigned long len, |
193 | unsigned long prot, unsigned long flags, | 193 | unsigned long prot, unsigned long flags, |
194 | unsigned long fd, off_t offset) | 194 | unsigned long fd, off_t pgoff) |
195 | { | 195 | { |
196 | int err = -EINVAL; | 196 | int err = -EINVAL; |
197 | 197 | ||
198 | if (offset & ~PAGE_MASK) { | 198 | if (pgoff & ~PAGE_MASK) { |
199 | printk(KERN_INFO "no pagemask in mmap\r\n"); | 199 | printk(KERN_INFO "no pagemask in mmap\r\n"); |
200 | goto out; | 200 | goto out; |
201 | } | 201 | } |
202 | 202 | ||
203 | err = sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); | 203 | err = sys_mmap2(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT); |
204 | out: | 204 | out: |
205 | return err; | 205 | return err; |
206 | } | 206 | } |
diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S index ef0e8932af33..8a609354ddea 100644 --- a/arch/microblaze/kernel/syscall_table.S +++ b/arch/microblaze/kernel/syscall_table.S | |||
@@ -15,7 +15,7 @@ ENTRY(sys_call_table) | |||
15 | .long sys_creat | 15 | .long sys_creat |
16 | .long sys_link | 16 | .long sys_link |
17 | .long sys_unlink /* 10 */ | 17 | .long sys_unlink /* 10 */ |
18 | .long sys_execve_wrapper | 18 | .long sys_execve |
19 | .long sys_chdir | 19 | .long sys_chdir |
20 | .long sys_time | 20 | .long sys_time |
21 | .long sys_mknod | 21 | .long sys_mknod |
@@ -124,7 +124,7 @@ ENTRY(sys_call_table) | |||
124 | .long sys_ipc | 124 | .long sys_ipc |
125 | .long sys_fsync | 125 | .long sys_fsync |
126 | .long sys_ni_syscall /* sys_sigreturn_wrapper */ | 126 | .long sys_ni_syscall /* sys_sigreturn_wrapper */ |
127 | .long sys_clone_wrapper /* 120 */ | 127 | .long sys_clone /* 120 */ |
128 | .long sys_setdomainname | 128 | .long sys_setdomainname |
129 | .long sys_newuname | 129 | .long sys_newuname |
130 | .long sys_ni_syscall /* modify_ldt */ | 130 | .long sys_ni_syscall /* modify_ldt */ |
@@ -194,7 +194,7 @@ ENTRY(sys_call_table) | |||
194 | .long sys_sendfile | 194 | .long sys_sendfile |
195 | .long sys_ni_syscall /* reserved for streams1 */ | 195 | .long sys_ni_syscall /* reserved for streams1 */ |
196 | .long sys_ni_syscall /* reserved for streams2 */ | 196 | .long sys_ni_syscall /* reserved for streams2 */ |
197 | .long sys_vfork_wrapper /* 190 */ | 197 | .long sys_vfork /* 190 */ |
198 | .long sys_getrlimit | 198 | .long sys_getrlimit |
199 | .long sys_mmap2 /* mmap2 */ | 199 | .long sys_mmap2 /* mmap2 */ |
200 | .long sys_truncate64 | 200 | .long sys_truncate64 |