diff options
| -rw-r--r-- | arch/score/include/asm/unistd.h | 5 | ||||
| -rw-r--r-- | arch/score/kernel/entry.S | 13 | ||||
| -rw-r--r-- | arch/score/kernel/sys_score.c | 24 |
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 | ||
| 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 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(¤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 |
