Module: xenomai-jki
Branch: for-forge
Commit: d1d45d106cd0b15df4f3a45284f8a71e7ae64d7c
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=d1d45d106cd0b15df4f3a45284f8a71e7ae64d7c

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Tue Mar  7 17:32:46 2017 +0100

cobalt/posix: Move signal_put_siginfo unmodified

We will need it inside signal_wait. No functional changes.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 kernel/cobalt/posix/signal.c |   72 +++++++++++++++++++++---------------------
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/kernel/cobalt/posix/signal.c b/kernel/cobalt/posix/signal.c
index 416d3e4..0281cb5 100644
--- a/kernel/cobalt/posix/signal.c
+++ b/kernel/cobalt/posix/signal.c
@@ -201,6 +201,42 @@ void cobalt_signal_flush(struct cobalt_thread *thread)
        sigemptyset(&thread->sigpending);
 }
 
+static int signal_put_siginfo(void __user *u_si, const struct siginfo *si,
+                             int overrun)
+{
+       struct siginfo __user *u_p = u_si;
+       int code, ret;
+
+       /* Translate kernel codes for userland. */
+       code = si->si_code;
+       if (code & __SI_MASK)
+               code |= __SI_MASK;
+
+       ret = __xn_put_user(si->si_signo, &u_p->si_signo);
+       ret |= __xn_put_user(si->si_errno, &u_p->si_errno);
+       ret |= __xn_put_user(code, &u_p->si_code);
+
+       /*
+        * Copy the generic/standard siginfo bits to userland.
+        */
+       switch (si->si_code) {
+       case SI_TIMER:
+               ret |= __xn_put_user(si->si_tid, &u_p->si_tid);
+               ret |= __xn_put_user(si->si_ptr, &u_p->si_ptr);
+               ret |= __xn_put_user(overrun, &u_p->si_overrun);
+               break;
+       case SI_QUEUE:
+       case SI_MESGQ:
+               ret |= __xn_put_user(si->si_ptr, &u_p->si_ptr);
+               /* falldown wanted. */
+       case SI_USER:
+               ret |= __xn_put_user(si->si_pid, &u_p->si_pid);
+               ret |= __xn_put_user(si->si_uid, &u_p->si_uid);
+       }
+
+       return ret;
+}
+
 static int signal_wait(sigset_t *set, xnticks_t timeout,
                       void __user *u_si,
                       int (*put_siginfo)(void __user *u_si,
@@ -335,42 +371,6 @@ fail:
        return ret;
 }
 
-static int signal_put_siginfo(void __user *u_si, const struct siginfo *si,
-                             int overrun)
-{
-       struct siginfo __user *u_p = u_si;
-       int code, ret;
-
-       /* Translate kernel codes for userland. */
-       code = si->si_code;
-       if (code & __SI_MASK)
-               code |= __SI_MASK;
-
-       ret = __xn_put_user(si->si_signo, &u_p->si_signo);
-       ret |= __xn_put_user(si->si_errno, &u_p->si_errno);
-       ret |= __xn_put_user(code, &u_p->si_code);
-
-       /*
-        * Copy the generic/standard siginfo bits to userland.
-        */
-       switch (si->si_code) {
-       case SI_TIMER:
-               ret |= __xn_put_user(si->si_tid, &u_p->si_tid);
-               ret |= __xn_put_user(si->si_ptr, &u_p->si_ptr);
-               ret |= __xn_put_user(overrun, &u_p->si_overrun);
-               break;
-       case SI_QUEUE:
-       case SI_MESGQ:
-               ret |= __xn_put_user(si->si_ptr, &u_p->si_ptr);
-               /* falldown wanted. */
-       case SI_USER:
-               ret |= __xn_put_user(si->si_pid, &u_p->si_pid);
-               ret |= __xn_put_user(si->si_uid, &u_p->si_uid);
-       }
-
-       return ret;
-}
-
 int __cobalt_sigwait(sigset_t *set)
 {
        return signal_wait(set, XN_INFINITE, NULL, NULL);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to