aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Liqin <liqin.chen@sunplusct.com>2009-08-30 00:33:30 -0400
committerChen Liqin <liqin.chen@sunplusct.com>2009-08-30 00:33:30 -0400
commitcf52c468352993ca420fe0b4ada976dc1f614026 (patch)
tree93d0cdc86189349a5eaf723a2ffc139d5a9806d2
parent324f40fbb02ed9339ddbdc450ff8ba614a92a630 (diff)
score: add old syscall support
-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 0d98b72f462a..4aa957364d4d 100644
--- a/arch/score/include/asm/unistd.h
+++ b/arch/score/include/asm/unistd.h
@@ -3,6 +3,11 @@
3 3
4#define __ARCH_HAVE_MMU 4#define __ARCH_HAVE_MMU
5 5
6#define __ARCH_WANT_SYSCALL_NO_AT
7#define __ARCH_WANT_SYSCALL_NO_FLAGS
8#define __ARCH_WANT_SYSCALL_OFF_T
9#define __ARCH_WANT_SYSCALL_DEPRECATED
10
6#include <asm-generic/unistd.h> 11#include <asm-generic/unistd.h>
7 12
8#endif /* _ASM_SCORE_UNISTD_H */ 13#endif /* _ASM_SCORE_UNISTD_H */
diff --git a/arch/score/kernel/entry.S b/arch/score/kernel/entry.S
index 10e859ddefd1..577abba3fac6 100644
--- a/arch/score/kernel/entry.S
+++ b/arch/score/kernel/entry.S
@@ -499,3 +499,16 @@ ENTRY(sys_sigaltstack)
499 mv r4, r0 499 mv r4, r0
500 la r8, score_sigaltstack 500 la r8, score_sigaltstack
501 br r8 501 br r8
502
503#ifdef __ARCH_WANT_SYSCALL_DEPRECATED
504ENTRY(sys_fork)
505 mv r4, r0
506 la r8, score_fork
507 br r8
508
509ENTRY(sys_vfork)
510 mv r4, r0
511 la r8, score_vfork
512 br r8
513#endif /* __ARCH_WANT_SYSCALL_DEPRECATED */
514
diff --git a/arch/score/kernel/sys_score.c b/arch/score/kernel/sys_score.c
index 61aff8a93443..001249469866 100644
--- a/arch/score/kernel/sys_score.c
+++ b/arch/score/kernel/sys_score.c
@@ -25,6 +25,7 @@
25 25
26#include <linux/file.h> 26#include <linux/file.h>
27#include <linux/fs.h> 27#include <linux/fs.h>
28#include <linux/mm.h>
28#include <linux/mman.h> 29#include <linux/mman.h>
29#include <linux/module.h> 30#include <linux/module.h>
30#include <linux/unistd.h> 31#include <linux/unistd.h>
@@ -49,8 +50,7 @@ sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
49 } 50 }
50 51
51 down_write(&current->mm->mmap_sem); 52 down_write(&current->mm->mmap_sem);
52 error = do_mmap_pgoff(file, addr, len, prot, flags, 53 error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
53 pgoff >> (PAGE_SHIFT - 12));
54 up_write(&current->mm->mmap_sem); 54 up_write(&current->mm->mmap_sem);
55 55
56 if (file) 56 if (file)
@@ -59,6 +59,19 @@ sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
59 return error; 59 return error;
60} 60}
61 61
62asmlinkage long
63sys_mmap(unsigned long addr, unsigned long len, unsigned long prot,
64 unsigned long flags, unsigned long fd, off_t pgoff)
65{
66 return sys_mmap2(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT);
67}
68
69asmlinkage long
70score_fork(struct pt_regs *regs)
71{
72 return do_fork(SIGCHLD, regs->regs[0], regs, 0, NULL, NULL);
73}
74
62/* 75/*
63 * Clone a task - this clones the calling program thread. 76 * Clone a task - this clones the calling program thread.
64 * This is called indirectly via a small wrapper 77 * This is called indirectly via a small wrapper
@@ -81,6 +94,13 @@ score_clone(struct pt_regs *regs)
81 parent_tidptr, child_tidptr); 94 parent_tidptr, child_tidptr);
82} 95}
83 96
97asmlinkage long
98score_vfork(struct pt_regs *regs)
99{
100 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD,
101 regs->regs[0], regs, 0, NULL, NULL);
102}
103
84/* 104/*
85 * sys_execve() executes a new program. 105 * sys_execve() executes a new program.
86 * This is called indirectly via a small wrapper 106 * This is called indirectly via a small wrapper