summaryrefslogtreecommitdiffstats
path: root/arch/score
diff options
context:
space:
mode:
authorChen Liqin <liqin.chen@sunplusct.com>2009-08-30 12:33:30 +0800
committerChen Liqin <liqin.chen@sunplusct.com>2009-08-30 12:33:30 +0800
commitcf52c468352993ca420fe0b4ada976dc1f614026 (patch)
tree93d0cdc86189349a5eaf723a2ffc139d5a9806d2 /arch/score
parent324f40fbb02ed9339ddbdc450ff8ba614a92a630 (diff)
score: add old syscall support
Diffstat (limited to 'arch/score')
-rw-r--r--arch/score/include/asm/unistd.h5
-rw-r--r--arch/score/kernel/entry.S13
-rw-r--r--arch/score/kernel/sys_score.c24
3 files changed, 40 insertions, 2 deletions
diff --git a/arch/score/include/asm/unistd.h b/arch/score/include/asm/unistd.h
index 0d98b72f462..4aa957364d4 100644
--- a/arch/score/include/asm/unistd.h
+++ b/arch/score/include/asm/unistd.h
@@ -3,6 +3,11 @@
#define __ARCH_HAVE_MMU
+#define __ARCH_WANT_SYSCALL_NO_AT
+#define __ARCH_WANT_SYSCALL_NO_FLAGS
+#define __ARCH_WANT_SYSCALL_OFF_T
+#define __ARCH_WANT_SYSCALL_DEPRECATED
+
#include <asm-generic/unistd.h>
#endif /* _ASM_SCORE_UNISTD_H */
diff --git a/arch/score/kernel/entry.S b/arch/score/kernel/entry.S
index 10e859ddefd..577abba3fac 100644
--- a/arch/score/kernel/entry.S
+++ b/arch/score/kernel/entry.S
@@ -499,3 +499,16 @@ ENTRY(sys_sigaltstack)
mv r4, r0
la r8, score_sigaltstack
br r8
+
+#ifdef __ARCH_WANT_SYSCALL_DEPRECATED
+ENTRY(sys_fork)
+ mv r4, r0
+ la r8, score_fork
+ br r8
+
+ENTRY(sys_vfork)
+ mv r4, r0
+ la r8, score_vfork
+ br r8
+#endif /* __ARCH_WANT_SYSCALL_DEPRECATED */
+
diff --git a/arch/score/kernel/sys_score.c b/arch/score/kernel/sys_score.c
index 61aff8a9344..00124946986 100644
--- a/arch/score/kernel/sys_score.c
+++ b/arch/score/kernel/sys_score.c
@@ -25,6 +25,7 @@
#include <linux/file.h>
#include <linux/fs.h>
+#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/module.h>
#include <linux/unistd.h>
@@ -49,8 +50,7 @@ sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
}
down_write(&current->mm->mmap_sem);
- error = do_mmap_pgoff(file, addr, len, prot, flags,
- pgoff >> (PAGE_SHIFT - 12));
+ error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
up_write(&current->mm->mmap_sem);
if (file)
@@ -59,6 +59,19 @@ sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
return error;
}
+asmlinkage long
+sys_mmap(unsigned long addr, unsigned long len, unsigned long prot,
+ unsigned long flags, unsigned long fd, off_t pgoff)
+{
+ return sys_mmap2(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT);
+}
+
+asmlinkage long
+score_fork(struct pt_regs *regs)
+{
+ return do_fork(SIGCHLD, regs->regs[0], regs, 0, NULL, NULL);
+}
+
/*
* Clone a task - this clones the calling program thread.
* This is called indirectly via a small wrapper
@@ -81,6 +94,13 @@ score_clone(struct pt_regs *regs)
parent_tidptr, child_tidptr);
}
+asmlinkage long
+score_vfork(struct pt_regs *regs)
+{
+ return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD,
+ regs->regs[0], regs, 0, NULL, NULL);
+}
+
/*
* sys_execve() executes a new program.
* This is called indirectly via a small wrapper