diff options
author | Chen Liqin <liqin.chen@sunplusct.com> | 2009-08-30 00:33:30 -0400 |
---|---|---|
committer | Chen Liqin <liqin.chen@sunplusct.com> | 2009-08-30 00:33:30 -0400 |
commit | cf52c468352993ca420fe0b4ada976dc1f614026 (patch) | |
tree | 93d0cdc86189349a5eaf723a2ffc139d5a9806d2 /arch/score/kernel | |
parent | 324f40fbb02ed9339ddbdc450ff8ba614a92a630 (diff) |
score: add old syscall support
Diffstat (limited to 'arch/score/kernel')
-rw-r--r-- | arch/score/kernel/entry.S | 13 | ||||
-rw-r--r-- | arch/score/kernel/sys_score.c | 24 |
2 files changed, 35 insertions, 2 deletions
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) | |||
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 | ||
504 | ENTRY(sys_fork) | ||
505 | mv r4, r0 | ||
506 | la r8, score_fork | ||
507 | br r8 | ||
508 | |||
509 | ENTRY(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 61aff8a9344..00124946986 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(¤t->mm->mmap_sem); | 52 | down_write(¤t->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(¤t->mm->mmap_sem); | 54 | up_write(¤t->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 | ||
62 | asmlinkage long | ||
63 | sys_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 | |||
69 | asmlinkage long | ||
70 | score_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 | ||
97 | asmlinkage long | ||
98 | score_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 |