提交 e513588f 编写于 作者: A Arnd Bergmann 提交者: 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: NArnd Bergmann <arnd@arndb.de>
Signed-off-by: NMichal Simek <monstr@monstr.eu>
上级 3183e068
#ifndef __ASM_MICROBLAZE_SYSCALLS_H
#define __ASM_MICROBLAZE_SYSCALLS_H
#ifdef __KERNEL__
#include <linux/compiler.h>
#include <linux/linkage.h>
#include <linux/types.h>
#include <linux/signal.h>
asmlinkage long sys_clone(int flags, unsigned long stack, struct pt_regs *regs);
#define sys_clone sys_clone
/* FIXME will be removed */
asmlinkage int sys_ipc(uint call, int first, int second,
int third, void *ptr, long fifth);
#include <asm-generic/syscalls.h>
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 */
......@@ -551,16 +551,16 @@ no_work_pending:
rtid r14, 0
nop
sys_vfork_wrapper:
brid sys_vfork
sys_vfork:
brid microblaze_vfork
addk r5, r1, r0
sys_clone_wrapper:
brid sys_clone
sys_clone:
brid microblaze_clone
addk r7, r1, r0
sys_execve_wrapper:
brid sys_execve
sys_execve:
brid microblaze_execve
addk r8, r1, r0
sys_rt_sigreturn_wrapper:
......
......@@ -429,12 +429,11 @@ C_ENTRY(ret_from_fork):
brid ret_from_trap; /* Do normal trap return */
nop;
C_ENTRY(sys_vfork_wrapper):
C_ENTRY(sys_vfork):
brid microblaze_vfork /* Do real work (tail-call) */
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. */
lwi r6, r1, PTO+PT_R1; /* If so, use paret's stack ptr */
1: la r7, r1, PTO; /* Arg 2: parent context */
......@@ -444,9 +443,9 @@ C_ENTRY(sys_clone_wrapper):
brid do_fork /* Do real work (tail-call) */
nop;
C_ENTRY(sys_execve_wrapper):
C_ENTRY(sys_execve):
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;
C_ENTRY(sys_rt_sigsuspend_wrapper):
......
......@@ -46,7 +46,7 @@
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,
struct pt_regs *regs)
{
......
......@@ -39,7 +39,7 @@
*
* 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)
{
int version, ret;
......@@ -134,20 +134,20 @@ sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth)
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,
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)
stack = regs->r1;
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)
{
int error;
......@@ -163,8 +163,8 @@ asmlinkage int sys_execve(char __user *filenamei, char __user *__user *argv,
return error;
}
asmlinkage unsigned long
sys_mmap2(unsigned long addr, size_t len,
asmlinkage long
sys_mmap2(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff)
{
......@@ -189,18 +189,18 @@ sys_mmap2(unsigned long addr, size_t len,
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 fd, off_t offset)
unsigned long fd, off_t pgoff)
{
int err = -EINVAL;
if (offset & ~PAGE_MASK) {
if (pgoff & ~PAGE_MASK) {
printk(KERN_INFO "no pagemask in mmap\r\n");
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:
return err;
}
......
......@@ -15,7 +15,7 @@ ENTRY(sys_call_table)
.long sys_creat
.long sys_link
.long sys_unlink /* 10 */
.long sys_execve_wrapper
.long sys_execve
.long sys_chdir
.long sys_time
.long sys_mknod
......@@ -124,7 +124,7 @@ ENTRY(sys_call_table)
.long sys_ipc
.long sys_fsync
.long sys_ni_syscall /* sys_sigreturn_wrapper */
.long sys_clone_wrapper /* 120 */
.long sys_clone /* 120 */
.long sys_setdomainname
.long sys_newuname
.long sys_ni_syscall /* modify_ldt */
......@@ -194,7 +194,7 @@ ENTRY(sys_call_table)
.long sys_sendfile
.long sys_ni_syscall /* reserved for streams1 */
.long sys_ni_syscall /* reserved for streams2 */
.long sys_vfork_wrapper /* 190 */
.long sys_vfork /* 190 */
.long sys_getrlimit
.long sys_mmap2 /* mmap2 */
.long sys_truncate64
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册