Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −36
Original line number Diff line number Diff line
#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 */
+6 −6
Original line number Diff line number Diff line
@@ -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:
+5 −6
Original line number Diff line number Diff line
@@ -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):
+1 −1
Original line number Diff line number Diff line
@@ -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)
{
+10 −10
Original line number Diff line number Diff line
@@ -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 @@ out:
	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 @@ out:
	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;
}
Loading