Commit e513588f authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Michal Simek

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: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarMichal Simek <monstr@monstr.eu>
parent 3183e068
#ifndef __ASM_MICROBLAZE_SYSCALLS_H #ifndef __ASM_MICROBLAZE_SYSCALLS_H
#define __ASM_MICROBLAZE_SYSCALLS_H
#ifdef __KERNEL__
#include <linux/compiler.h> asmlinkage long sys_clone(int flags, unsigned long stack, struct pt_regs *regs);
#include <linux/linkage.h> #define sys_clone sys_clone
#include <linux/types.h>
#include <linux/signal.h>
/* FIXME will be removed */ #include <asm-generic/syscalls.h>
asmlinkage int sys_ipc(uint call, int first, int second,
int third, void *ptr, long fifth);
struct pt_regs;
asmlinkage int sys_vfork(struct pt_regs *regs);
asmlinkage int sys_clone(int flags, unsigned long stack, struct pt_regs *regs);
asmlinkage int sys_execve(char __user *filenamei, char __user *__user *argv,
char __user *__user *envp, struct pt_regs *regs);
asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff);
asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
unsigned long prot, unsigned long flags,
unsigned long fd, off_t offset);
/* from signal.c */
asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize,
struct pt_regs *regs);
asmlinkage long sys_rt_sigaction(int sig, const struct sigaction __user *act,
struct sigaction __user *oact, size_t sigsetsize);
asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
struct pt_regs *regs);
asmlinkage long sys_rt_sigreturn(struct pt_regs *regs);
#endif /* __KERNEL__ */
#endif /* __ASM_MICROBLAZE_SYSCALLS_H */ #endif /* __ASM_MICROBLAZE_SYSCALLS_H */
...@@ -551,16 +551,16 @@ no_work_pending: ...@@ -551,16 +551,16 @@ no_work_pending:
rtid r14, 0 rtid r14, 0
nop nop
sys_vfork_wrapper: sys_vfork:
brid sys_vfork brid microblaze_vfork
addk r5, r1, r0 addk r5, r1, r0
sys_clone_wrapper: sys_clone:
brid sys_clone brid microblaze_clone
addk r7, r1, r0 addk r7, r1, r0
sys_execve_wrapper: sys_execve:
brid sys_execve brid microblaze_execve
addk r8, r1, r0 addk r8, r1, r0
sys_rt_sigreturn_wrapper: sys_rt_sigreturn_wrapper:
......
...@@ -429,12 +429,11 @@ C_ENTRY(ret_from_fork): ...@@ -429,12 +429,11 @@ C_ENTRY(ret_from_fork):
brid ret_from_trap; /* Do normal trap return */ brid ret_from_trap; /* Do normal trap return */
nop; nop;
C_ENTRY(sys_vfork_wrapper): C_ENTRY(sys_vfork):
brid microblaze_vfork /* Do real work (tail-call) */
la r5, r1, PTO la r5, r1, PTO
brid sys_vfork /* Do real work (tail-call) */
nop
C_ENTRY(sys_clone_wrapper): C_ENTRY(sys_clone):
bnei r6, 1f; /* See if child SP arg (arg 1) is 0. */ bnei r6, 1f; /* See if child SP arg (arg 1) is 0. */
lwi r6, r1, PTO+PT_R1; /* If so, use paret's stack ptr */ lwi r6, r1, PTO+PT_R1; /* If so, use paret's stack ptr */
1: la r7, r1, PTO; /* Arg 2: parent context */ 1: la r7, r1, PTO; /* Arg 2: parent context */
...@@ -444,9 +443,9 @@ C_ENTRY(sys_clone_wrapper): ...@@ -444,9 +443,9 @@ C_ENTRY(sys_clone_wrapper):
brid do_fork /* Do real work (tail-call) */ brid do_fork /* Do real work (tail-call) */
nop; nop;
C_ENTRY(sys_execve_wrapper): C_ENTRY(sys_execve):
la r8, r1, PTO; /* add user context as 4th arg */ la r8, r1, PTO; /* add user context as 4th arg */
brid sys_execve; /* Do real work (tail-call).*/ brid microblaze_execve; /* Do real work (tail-call).*/
nop; nop;
C_ENTRY(sys_rt_sigsuspend_wrapper): C_ENTRY(sys_rt_sigsuspend_wrapper):
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_sycall); asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_sycall);
asmlinkage int asmlinkage long
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
struct pt_regs *regs) struct pt_regs *regs)
{ {
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
* *
* This is really horribly ugly. This will be remove with new toolchain. * This is really horribly ugly. This will be remove with new toolchain.
*/ */
asmlinkage int asmlinkage long
sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth) sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth)
{ {
int version, ret; int version, ret;
...@@ -134,20 +134,20 @@ sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth) ...@@ -134,20 +134,20 @@ sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth)
return ret; return ret;
} }
asmlinkage int sys_vfork(struct pt_regs *regs) asmlinkage long microblaze_vfork(struct pt_regs *regs)
{ {
return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->r1, return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->r1,
regs, 0, NULL, NULL); regs, 0, NULL, NULL);
} }
asmlinkage int sys_clone(int flags, unsigned long stack, struct pt_regs *regs) asmlinkage long microblaze_clone(int flags, unsigned long stack, struct pt_regs *regs)
{ {
if (!stack) if (!stack)
stack = regs->r1; stack = regs->r1;
return do_fork(flags, stack, regs, 0, NULL, NULL); return do_fork(flags, stack, regs, 0, NULL, NULL);
} }
asmlinkage int sys_execve(char __user *filenamei, char __user *__user *argv, asmlinkage long microblaze_execve(char __user *filenamei, char __user *__user *argv,
char __user *__user *envp, struct pt_regs *regs) char __user *__user *envp, struct pt_regs *regs)
{ {
int error; int error;
...@@ -163,8 +163,8 @@ asmlinkage int sys_execve(char __user *filenamei, char __user *__user *argv, ...@@ -163,8 +163,8 @@ asmlinkage int sys_execve(char __user *filenamei, char __user *__user *argv,
return error; return error;
} }
asmlinkage unsigned long asmlinkage long
sys_mmap2(unsigned long addr, size_t len, sys_mmap2(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags, unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff) unsigned long fd, unsigned long pgoff)
{ {
...@@ -189,18 +189,18 @@ sys_mmap2(unsigned long addr, size_t len, ...@@ -189,18 +189,18 @@ sys_mmap2(unsigned long addr, size_t len,
return ret; return ret;
} }
asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, asmlinkage long sys_mmap(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags, unsigned long prot, unsigned long flags,
unsigned long fd, off_t offset) unsigned long fd, off_t pgoff)
{ {
int err = -EINVAL; int err = -EINVAL;
if (offset & ~PAGE_MASK) { if (pgoff & ~PAGE_MASK) {
printk(KERN_INFO "no pagemask in mmap\r\n"); printk(KERN_INFO "no pagemask in mmap\r\n");
goto out; goto out;
} }
err = sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); err = sys_mmap2(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT);
out: out:
return err; return err;
} }
......
...@@ -15,7 +15,7 @@ ENTRY(sys_call_table) ...@@ -15,7 +15,7 @@ ENTRY(sys_call_table)
.long sys_creat .long sys_creat
.long sys_link .long sys_link
.long sys_unlink /* 10 */ .long sys_unlink /* 10 */
.long sys_execve_wrapper .long sys_execve
.long sys_chdir .long sys_chdir
.long sys_time .long sys_time
.long sys_mknod .long sys_mknod
...@@ -124,7 +124,7 @@ ENTRY(sys_call_table) ...@@ -124,7 +124,7 @@ ENTRY(sys_call_table)
.long sys_ipc .long sys_ipc
.long sys_fsync .long sys_fsync
.long sys_ni_syscall /* sys_sigreturn_wrapper */ .long sys_ni_syscall /* sys_sigreturn_wrapper */
.long sys_clone_wrapper /* 120 */ .long sys_clone /* 120 */
.long sys_setdomainname .long sys_setdomainname
.long sys_newuname .long sys_newuname
.long sys_ni_syscall /* modify_ldt */ .long sys_ni_syscall /* modify_ldt */
...@@ -194,7 +194,7 @@ ENTRY(sys_call_table) ...@@ -194,7 +194,7 @@ ENTRY(sys_call_table)
.long sys_sendfile .long sys_sendfile
.long sys_ni_syscall /* reserved for streams1 */ .long sys_ni_syscall /* reserved for streams1 */
.long sys_ni_syscall /* reserved for streams2 */ .long sys_ni_syscall /* reserved for streams2 */
.long sys_vfork_wrapper /* 190 */ .long sys_vfork /* 190 */
.long sys_getrlimit .long sys_getrlimit
.long sys_mmap2 /* mmap2 */ .long sys_mmap2 /* mmap2 */
.long sys_truncate64 .long sys_truncate64
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment