am 516b26f2: am 0837c69a: am edf09bf9: am 316ee626: Merge "MIPS support to sigsuspend and sigwait routines"

* commit '516b26f2bf755879feb51d06dcd9511903d0a9bd':
  MIPS support to sigsuspend and sigwait routines
This commit is contained in:
Elliott Hughes 2012-08-10 15:20:58 -07:00 committed by Android Git Automerger
commit 6a80cc9e08
4 changed files with 24 additions and 6 deletions

View File

@ -216,7 +216,8 @@ int utimensat(int, const char *, const struct timespec times[2], int)
# signals # signals
int sigaction(int, const struct sigaction *, struct sigaction *) 67 int sigaction(int, const struct sigaction *, struct sigaction *) 67
int sigprocmask(int, const sigset_t *, sigset_t *) 126 int sigprocmask(int, const sigset_t *, sigset_t *) 126
int __sigsuspend:sigsuspend(int unused1, int unused2, unsigned mask) 72 int __sigsuspend:sigsuspend(int unused1, int unused2, unsigned mask) 72,72,-1
int __sigsuspend:sigsuspend(const sigset_t *mask) -1,-1,72
int __rt_sigaction:rt_sigaction (int sig, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize) 174,174,194 int __rt_sigaction:rt_sigaction (int sig, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize) 174,174,194
int __rt_sigprocmask:rt_sigprocmask (int how, const sigset_t *set, sigset_t *oset, size_t sigsetsize) 175,175,195 int __rt_sigprocmask:rt_sigprocmask (int how, const sigset_t *set, sigset_t *oset, size_t sigsetsize) 175,175,195
int __rt_sigtimedwait:rt_sigtimedwait(const sigset_t *set, struct siginfo_t *info, struct timespec_t *timeout, size_t sigset_size) 177,177,197 int __rt_sigtimedwait:rt_sigtimedwait(const sigset_t *set, struct siginfo_t *info, struct timespec_t *timeout, size_t sigset_size) 177,177,197

View File

@ -47,7 +47,6 @@
#define __NR_getppid (__NR_SYSCALL_BASE + 64) #define __NR_getppid (__NR_SYSCALL_BASE + 64)
#define __NR_setsid (__NR_SYSCALL_BASE + 66) #define __NR_setsid (__NR_SYSCALL_BASE + 66)
#define __NR_sigaction (__NR_SYSCALL_BASE + 67) #define __NR_sigaction (__NR_SYSCALL_BASE + 67)
#define __NR_sigsuspend (__NR_SYSCALL_BASE + 72)
#define __NR_sigpending (__NR_SYSCALL_BASE + 73) #define __NR_sigpending (__NR_SYSCALL_BASE + 73)
#define __NR_setrlimit (__NR_SYSCALL_BASE + 75) #define __NR_setrlimit (__NR_SYSCALL_BASE + 75)
#define __NR_getrusage (__NR_SYSCALL_BASE + 77) #define __NR_getrusage (__NR_SYSCALL_BASE + 77)
@ -168,6 +167,7 @@
#define __NR_timer_delete (__NR_SYSCALL_BASE + 261) #define __NR_timer_delete (__NR_SYSCALL_BASE + 261)
#define __NR_utimes (__NR_SYSCALL_BASE + 269) #define __NR_utimes (__NR_SYSCALL_BASE + 269)
#define __NR_utimensat (__NR_SYSCALL_BASE + 348) #define __NR_utimensat (__NR_SYSCALL_BASE + 348)
#define __NR_sigsuspend (__NR_SYSCALL_BASE + 72)
#define __NR_rt_sigaction (__NR_SYSCALL_BASE + 174) #define __NR_rt_sigaction (__NR_SYSCALL_BASE + 174)
#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE + 175) #define __NR_rt_sigprocmask (__NR_SYSCALL_BASE + 175)
#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE + 177) #define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE + 177)
@ -216,6 +216,7 @@
#define __NR_waitpid (__NR_SYSCALL_BASE + 7) #define __NR_waitpid (__NR_SYSCALL_BASE + 7)
#define __NR_kill (__NR_SYSCALL_BASE + 37) #define __NR_kill (__NR_SYSCALL_BASE + 37)
#define __NR_pipe (__NR_SYSCALL_BASE + 42) #define __NR_pipe (__NR_SYSCALL_BASE + 42)
#define __NR_sigsuspend (__NR_SYSCALL_BASE + 72)
#define __NR_socketcall (__NR_SYSCALL_BASE + 102) #define __NR_socketcall (__NR_SYSCALL_BASE + 102)
#define __NR_fdatasync (__NR_SYSCALL_BASE + 148) #define __NR_fdatasync (__NR_SYSCALL_BASE + 148)
#define __NR_mlock (__NR_SYSCALL_BASE + 150) #define __NR_mlock (__NR_SYSCALL_BASE + 150)
@ -339,6 +340,7 @@
#define __NR_getegid (__NR_SYSCALL_BASE + 50) #define __NR_getegid (__NR_SYSCALL_BASE + 50)
#define __NR_setreuid (__NR_SYSCALL_BASE + 70) #define __NR_setreuid (__NR_SYSCALL_BASE + 70)
#define __NR_setregid (__NR_SYSCALL_BASE + 71) #define __NR_setregid (__NR_SYSCALL_BASE + 71)
#define __NR_sigsuspend (__NR_SYSCALL_BASE + 72)
#define __NR_getrlimit (__NR_SYSCALL_BASE + 76) #define __NR_getrlimit (__NR_SYSCALL_BASE + 76)
#define __NR_getgroups (__NR_SYSCALL_BASE + 80) #define __NR_getgroups (__NR_SYSCALL_BASE + 80)
#define __NR_setgroups (__NR_SYSCALL_BASE + 81) #define __NR_setgroups (__NR_SYSCALL_BASE + 81)

View File

@ -26,12 +26,18 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include <signal.h> #include <signal.h>
#ifdef __mips__
extern int __sigsuspend(const sigset_t *);
#else
extern int __sigsuspend(int, int, unsigned int); extern int __sigsuspend(int, int, unsigned int);
#endif
int sigsuspend(const sigset_t *_mask) int sigsuspend(const sigset_t *_mask)
{ {
#ifdef __mips__
return __sigsuspend(_mask);
#else
unsigned int mask = (unsigned int)*_mask; unsigned int mask = (unsigned int)*_mask;
return __sigsuspend(0, 0, mask); return __sigsuspend(0, 0, mask);
#endif
} }

View File

@ -47,6 +47,14 @@ int __rt_sigtimedwait(const sigset_t *uthese, siginfo_t *uinfo, const struct tim
int sigwait(const sigset_t *set, int *sig) int sigwait(const sigset_t *set, int *sig)
{ {
int ret; int ret;
#ifdef __mips__
/* use a union to get rid of aliasing warnings. On MIPS sigset_t is 128 bits */
union {
sigset_t kernel_sigset;
sigset_t dummy_sigset;
} u;
u.dummy_sigset = *set;
#else
/* use a union to get rid of aliasing warnings */ /* use a union to get rid of aliasing warnings */
union { union {
unsigned long kernel_sigset[2]; unsigned long kernel_sigset[2];
@ -55,6 +63,7 @@ int sigwait(const sigset_t *set, int *sig)
u.kernel_sigset[0] = *set; u.kernel_sigset[0] = *set;
u.kernel_sigset[1] = 0; /* no real-time signals supported ? */ u.kernel_sigset[1] = 0; /* no real-time signals supported ? */
#endif
for (;;) for (;;)
{ {
/* __rt_sigtimedwait can return EAGAIN or EINTR, we need to loop /* __rt_sigtimedwait can return EAGAIN or EINTR, we need to loop