blob: c2a898aa57aada4b16cff08ea6da84d797f88ab9 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/arch/arm/kernel/sys_arm.c
3 *
4 * Copyright (C) People who wrote linux/arch/i386/kernel/sys_i386.c
5 * Copyright (C) 1995, 1996 Russell King.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This file contains various random system calls that
12 * have a non-standard calling sequence on the Linux/arm
13 * platform.
14 */
Paul Gortmakerecea4ab2011-07-22 10:58:34 -040015#include <linux/export.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#include <linux/errno.h>
17#include <linux/sched.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070018#include <linux/mm.h>
19#include <linux/sem.h>
20#include <linux/msg.h>
21#include <linux/shm.h>
22#include <linux/stat.h>
23#include <linux/syscalls.h>
24#include <linux/mman.h>
25#include <linux/fs.h>
26#include <linux/file.h>
Adrian Bunkcba4fbb2007-10-16 23:29:24 -070027#include <linux/ipc.h>
Russell King33fa9b12008-09-06 11:35:55 +010028#include <linux/uaccess.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090029#include <linux/slab.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
Linus Torvalds1da177e2005-04-16 15:20:36 -070031/* Fork a new task - this creates a new program thread.
32 * This is called indirectly via a small wrapper
33 */
34asmlinkage int sys_fork(struct pt_regs *regs)
35{
Hyok S. Choif24284a2006-02-24 21:37:50 +000036#ifdef CONFIG_MMU
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 return do_fork(SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL);
Hyok S. Choif24284a2006-02-24 21:37:50 +000038#else
39 /* can not support in nommu mode */
40 return(-EINVAL);
41#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070042}
43
44/* Clone a task - this clones the calling program thread.
45 * This is called indirectly via a small wrapper
46 */
47asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
48 int __user *parent_tidptr, int tls_val,
49 int __user *child_tidptr, struct pt_regs *regs)
50{
51 if (!newsp)
52 newsp = regs->ARM_sp;
53
54 return do_fork(clone_flags, newsp, regs, 0, parent_tidptr, child_tidptr);
55}
56
57asmlinkage int sys_vfork(struct pt_regs *regs)
58{
59 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL);
60}
61
Nicolas Pitre68d91022005-09-01 12:37:13 +010062/*
Simon Arlott6cbdc8c2007-05-11 20:40:30 +010063 * Since loff_t is a 64 bit type we avoid a lot of ABI hassle
Nicolas Pitre68d91022005-09-01 12:37:13 +010064 * with a different argument ordering.
65 */
66asmlinkage long sys_arm_fadvise64_64(int fd, int advice,
67 loff_t offset, loff_t len)
68{
69 return sys_fadvise64_64(fd, offset, len, advice);
70}