Module: xenomai-2.6
Branch: master
Commit: 31a8e54afd2de721afd2adc0031227d9beb25eda
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=31a8e54afd2de721afd2adc0031227d9beb25eda

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Fri Jan 27 09:25:35 2012 +0100

native: Interrupt rt_timer_spin syscall on pending signals

If a shadow task has pending signals, including SIGDEBUG sent by the
watchdog, interrupt the rt_timer_spin loop in the kernel and let the
syscall tail handle this.

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

---

 ksrc/skins/native/syscall.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/ksrc/skins/native/syscall.c b/ksrc/skins/native/syscall.c
index acf0375..39204b4 100644
--- a/ksrc/skins/native/syscall.c
+++ b/ksrc/skins/native/syscall.c
@@ -1020,13 +1020,21 @@ static int __rt_timer_inquire(struct pt_regs *regs)
 
 static int __rt_timer_spin(struct pt_regs *regs)
 {
+       xnthread_t *thread = xnpod_current_thread();
+       struct task_struct *p = current;
+       RTIME etime;
        RTIME ns;
 
        if (__xn_safe_copy_from_user(&ns, (void __user *)__xn_reg_arg1(regs),
                                     sizeof(ns)))
                return -EFAULT;
 
-       rt_timer_spin(ns);
+       etime = xnarch_get_cpu_tsc() + xnarch_ns_to_tsc(ns);
+       while ((SRTIME)(xnarch_get_cpu_tsc() - etime) < 0) {
+               if (signal_pending(p) || xnthread_amok_p(thread))
+                       return -EINTR;
+               cpu_relax();
+       }
 
        return 0;
 }


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

Reply via email to