2005-04-16 22:20:36 +00:00
|
|
|
/*
|
2008-08-02 09:55:55 +00:00
|
|
|
* arch/arm/include/asm/unistd.h
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2001-2005 Russell King
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
|
|
|
|
* no matter what the change is. Thanks!
|
|
|
|
*/
|
|
|
|
#ifndef __ASM_ARM_UNISTD_H
|
|
|
|
#define __ASM_ARM_UNISTD_H
|
|
|
|
|
2012-10-12 12:05:52 +00:00
|
|
|
#include <uapi/asm/unistd.h>
|
2006-01-14 16:31:29 +00:00
|
|
|
|
2012-09-07 17:18:25 +00:00
|
|
|
#define __NR_syscalls (380)
|
2009-11-09 23:53:29 +00:00
|
|
|
#define __ARM_NR_cmpxchg (__ARM_NR_BASE+0x00fff0)
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#define __ARCH_WANT_STAT64
|
|
|
|
#define __ARCH_WANT_SYS_GETHOSTNAME
|
|
|
|
#define __ARCH_WANT_SYS_PAUSE
|
|
|
|
#define __ARCH_WANT_SYS_GETPGRP
|
|
|
|
#define __ARCH_WANT_SYS_LLSEEK
|
|
|
|
#define __ARCH_WANT_SYS_NICE
|
|
|
|
#define __ARCH_WANT_SYS_SIGPENDING
|
|
|
|
#define __ARCH_WANT_SYS_SIGPROCMASK
|
|
|
|
#define __ARCH_WANT_SYS_RT_SIGACTION
|
ARM: 5677/1: ARM support for TIF_RESTORE_SIGMASK/pselect6/ppoll/epoll_pwait
This patch adds support for TIF_RESTORE_SIGMASK to ARM's
signal handling, which allows to hook up the pselect6, ppoll,
and epoll_pwait syscalls on ARM.
Tested here with eabi userspace and a test program with a
deliberate race between a child's exit and the parent's
sigprocmask/select sequence. Using sys_pselect6() instead
of sigprocmask/select reliably prevents the race.
The other arch's support for TIF_RESTORE_SIGMASK has evolved
over time:
In 2.6.16:
- add TIF_RESTORE_SIGMASK which parallels TIF_SIGPENDING
- test both when checking for pending signal [changed later]
- reimplement sys_sigsuspend() to use current->saved_sigmask,
TIF_RESTORE_SIGMASK [changed later], and -ERESTARTNOHAND;
ditto for sys_rt_sigsuspend(), but drop private code and
use common code via __ARCH_WANT_SYS_RT_SIGSUSPEND;
- there are now no "extra" calls to do_signal() so its oldset
parameter is always ¤t->blocked so need not be passed,
also its return value is changed to void
- change handle_signal() to return 0/-errno
- change do_signal() to honor TIF_RESTORE_SIGMASK:
+ get oldset from current->saved_sigmask if TIF_RESTORE_SIGMASK
is set
+ if handle_signal() was successful then clear TIF_RESTORE_SIGMASK
+ if no signal was delivered and TIF_RESTORE_SIGMASK is set then
clear it and restore the sigmask
- hook up sys_pselect6() and sys_ppoll()
In 2.6.19:
- hook up sys_epoll_pwait()
In 2.6.26:
- allow archs to override how TIF_RESTORE_SIGMASK is implemented;
default set_restore_sigmask() sets both TIF_RESTORE_SIGMASK and
TIF_SIGPENDING; archs need now just test TIF_SIGPENDING again
when checking for pending signal work; some archs now implement
TIF_RESTORE_SIGMASK as a secondary/non-atomic thread flag bit
- call set_restore_sigmask() in sys_sigsuspend() instead of setting
TIF_RESTORE_SIGMASK
In 2.6.29-rc:
- kill sys_pselect7() which no arch wanted
So for 2.6.31-rc6/ARM this patch does the following:
- Add TIF_RESTORE_SIGMASK. Use the generic set_restore_sigmask()
which sets both TIF_SIGPENDING and TIF_RESTORE_SIGMASK, so
TIF_RESTORE_SIGMASK need not claim one of the scarce low thread
flags, and existing TIF_SIGPENDING and _TIF_WORK_MASK tests need
not be extended for TIF_RESTORE_SIGMASK.
- sys_sigsuspend() is reimplemented to use current->saved_sigmask
and set_restore_sigmask(), making it identical to most other archs
- The private code for sys_rt_sigsuspend() is removed, instead
generic code supplies it via __ARCH_WANT_SYS_RT_SIGSUSPEND.
- sys_sigsuspend() and sys_rt_sigsuspend() no longer need a pt_regs
parameter, so their assembly code wrappers are removed.
- handle_signal() is changed to return 0 on success or -errno.
- The oldset parameter to do_signal() is now redundant and removed,
and the return value is now also redundant and changed to void.
- do_signal() is changed to honor TIF_RESTORE_SIGMASK:
+ get oldset from current->saved_sigmask if TIF_RESTORE_SIGMASK
is set
+ if handle_signal() was successful then clear TIF_RESTORE_SIGMASK
+ if no signal was delivered and TIF_RESTORE_SIGMASK is set then
clear it and restore the sigmask
- Hook up sys_pselect6, sys_ppoll, and sys_epoll_pwait.
Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-08-15 11:58:11 +00:00
|
|
|
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
|
2010-03-10 23:21:15 +00:00
|
|
|
#define __ARCH_WANT_SYS_OLD_MMAP
|
2010-03-10 23:21:13 +00:00
|
|
|
#define __ARCH_WANT_SYS_OLD_SELECT
|
2006-01-14 16:36:12 +00:00
|
|
|
|
|
|
|
#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
|
|
|
|
#define __ARCH_WANT_SYS_TIME
|
2010-03-10 23:21:18 +00:00
|
|
|
#define __ARCH_WANT_SYS_IPC
|
2006-01-14 16:36:12 +00:00
|
|
|
#define __ARCH_WANT_SYS_OLDUMOUNT
|
|
|
|
#define __ARCH_WANT_SYS_ALARM
|
|
|
|
#define __ARCH_WANT_SYS_UTIME
|
|
|
|
#define __ARCH_WANT_SYS_OLD_GETRLIMIT
|
|
|
|
#define __ARCH_WANT_OLD_READDIR
|
|
|
|
#define __ARCH_WANT_SYS_SOCKETCALL
|
|
|
|
#endif
|
2012-08-02 07:52:41 +00:00
|
|
|
#define __ARCH_WANT_SYS_EXECVE
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* "Conditional" syscalls
|
|
|
|
*
|
|
|
|
* What we want is __attribute__((weak,alias("sys_ni_syscall"))),
|
|
|
|
* but it doesn't work on all toolchains, so we just do it by hand
|
|
|
|
*/
|
|
|
|
#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
|
|
|
|
|
2007-05-16 11:41:15 +00:00
|
|
|
/*
|
|
|
|
* Unimplemented (or alternatively implemented) syscalls
|
|
|
|
*/
|
2011-09-17 11:50:27 +00:00
|
|
|
#define __IGNORE_fadvise64_64
|
|
|
|
#define __IGNORE_migrate_pages
|
2012-09-21 16:55:20 +00:00
|
|
|
#define __IGNORE_kcmp
|
2007-05-16 11:41:15 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif /* __ASM_ARM_UNISTD_H */
|