Commit 400da241 authored by David Mosberger's avatar David Mosberger

ia64: Add message-queue support to copy_siginfo_from_user().

parent 2116be64
...@@ -169,7 +169,12 @@ copy_siginfo_to_user32 (siginfo_t32 *to, siginfo_t *from) ...@@ -169,7 +169,12 @@ copy_siginfo_to_user32 (siginfo_t32 *to, siginfo_t *from)
addr = (unsigned long) from->si_ptr; addr = (unsigned long) from->si_ptr;
err |= __put_user(addr, &to->si_ptr); err |= __put_user(addr, &to->si_ptr);
break; break;
/* case __SI_RT: This is not generated by the kernel as of now. */ case __SI_RT >> 16: /* Not generated by the kernel as of now. */
case __SI_MESGQ >> 16:
err |= __put_user(from->si_uid, &to->si_uid);
err |= __put_user(from->si_pid, &to->si_pid);
err |= __put_user(from->si_ptr, &to->si_ptr);
break;
} }
} }
return err; return err;
...@@ -612,7 +617,6 @@ sys32_rt_sigtimedwait (compat_sigset_t *uthese, siginfo_t32 *uinfo, ...@@ -612,7 +617,6 @@ sys32_rt_sigtimedwait (compat_sigset_t *uthese, siginfo_t32 *uinfo,
asmlinkage long asmlinkage long
sys32_rt_sigqueueinfo (int pid, int sig, siginfo_t32 *uinfo) sys32_rt_sigqueueinfo (int pid, int sig, siginfo_t32 *uinfo)
{ {
extern int copy_siginfo_from_user32 (siginfo_t *to, siginfo_t32 *from);
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
siginfo_t info; siginfo_t info;
int ret; int ret;
......
...@@ -205,6 +205,12 @@ copy_siginfo_to_user (siginfo_t *to, siginfo_t *from) ...@@ -205,6 +205,12 @@ copy_siginfo_to_user (siginfo_t *to, siginfo_t *from)
err |= __put_user(from->si_overrun, &to->si_overrun); err |= __put_user(from->si_overrun, &to->si_overrun);
err |= __put_user(from->si_ptr, &to->si_ptr); err |= __put_user(from->si_ptr, &to->si_ptr);
break; break;
case __SI_RT >> 16: /* Not generated by the kernel as of now. */
case __SI_MESGQ >> 16:
err |= __put_user(from->si_uid, &to->si_uid);
err |= __put_user(from->si_pid, &to->si_pid);
err |= __put_user(from->si_ptr, &to->si_ptr);
break;
case __SI_CHLD >> 16: case __SI_CHLD >> 16:
err |= __put_user(from->si_utime, &to->si_utime); err |= __put_user(from->si_utime, &to->si_utime);
err |= __put_user(from->si_stime, &to->si_stime); err |= __put_user(from->si_stime, &to->si_stime);
...@@ -213,45 +219,11 @@ copy_siginfo_to_user (siginfo_t *to, siginfo_t *from) ...@@ -213,45 +219,11 @@ copy_siginfo_to_user (siginfo_t *to, siginfo_t *from)
err |= __put_user(from->si_uid, &to->si_uid); err |= __put_user(from->si_uid, &to->si_uid);
err |= __put_user(from->si_pid, &to->si_pid); err |= __put_user(from->si_pid, &to->si_pid);
break; break;
/* case __SI_RT: This is not generated by the kernel as of now. */
} }
return err; return err;
} }
} }
int
copy_siginfo_from_user (siginfo_t *to, siginfo_t *from)
{
if (!access_ok(VERIFY_READ, from, sizeof(siginfo_t)))
return -EFAULT;
if (__copy_from_user(to, from, sizeof(siginfo_t)) != 0)
return -EFAULT;
if (SI_FROMUSER(to))
return 0;
to->si_code &= ~__SI_MASK;
if (to->si_code != 0) {
switch (to->si_signo) {
case SIGILL: case SIGFPE: case SIGSEGV: case SIGBUS: case SIGTRAP:
to->si_code |= __SI_FAULT;
break;
case SIGCHLD:
to->si_code |= __SI_CHLD;
break;
case SIGPOLL:
to->si_code |= __SI_POLL;
break;
default:
break;
}
}
return 0;
}
long long
ia64_rt_sigreturn (struct sigscratch *scr) ia64_rt_sigreturn (struct sigscratch *scr)
{ {
......
...@@ -136,8 +136,6 @@ copy_siginfo (siginfo_t *to, siginfo_t *from) ...@@ -136,8 +136,6 @@ copy_siginfo (siginfo_t *to, siginfo_t *from)
memcpy(to, from, 4*sizeof(int) + sizeof(from->_sifields._sigchld)); memcpy(to, from, 4*sizeof(int) + sizeof(from->_sifields._sigchld));
} }
extern int copy_siginfo_from_user(siginfo_t *to, siginfo_t *from);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _ASM_IA64_SIGINFO_H */ #endif /* _ASM_IA64_SIGINFO_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment