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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Apr 22 18:52:50 2014 +0200

cobalt/shadow: expose XNBREAK to userland

---

 include/cobalt/kernel/thread.h      |   20 +++++++++++++-------
 include/cobalt/uapi/kernel/thread.h |    1 +
 kernel/cobalt/shadow.c              |    1 +
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/include/cobalt/kernel/thread.h b/include/cobalt/kernel/thread.h
index e053845..d235d9c 100644
--- a/include/cobalt/kernel/thread.h
+++ b/include/cobalt/kernel/thread.h
@@ -283,22 +283,28 @@ struct xnthread *xnthread_lookup(xnhandle_t threadh)
 
 static inline void xnthread_sync_window(struct xnthread *thread)
 {
-       if (thread->u_window)
+       if (thread->u_window) {
                thread->u_window->state = thread->state;
+               thread->u_window->info = thread->info;
+       }
 }
 
 static inline
-void xnthread_clear_sync_window(struct xnthread *thread, int bits)
+void xnthread_clear_sync_window(struct xnthread *thread, int state_bits)
 {
-       if (thread->u_window)
-               thread->u_window->state = thread->state & ~bits;
+       if (thread->u_window) {
+               thread->u_window->state = thread->state & ~state_bits;
+               thread->u_window->info = thread->info;
+       }
 }
 
 static inline
-void xnthread_set_sync_window(struct xnthread *thread, int bits)
+void xnthread_set_sync_window(struct xnthread *thread, int state_bits)
 {
-       if (thread->u_window)
-               thread->u_window->state = thread->state | bits;
+       if (thread->u_window) {
+               thread->u_window->state = thread->state | state_bits;
+               thread->u_window->info = thread->info;
+       }
 }
 
 static inline int xnthread_try_grab(struct xnthread *thread,
diff --git a/include/cobalt/uapi/kernel/thread.h 
b/include/cobalt/uapi/kernel/thread.h
index 439e636..1c01654 100644
--- a/include/cobalt/uapi/kernel/thread.h
+++ b/include/cobalt/uapi/kernel/thread.h
@@ -97,6 +97,7 @@
 
 struct xnthread_user_window {
        unsigned long state;
+       unsigned long info;
        unsigned long grant_value;
 };
 
diff --git a/kernel/cobalt/shadow.c b/kernel/cobalt/shadow.c
index 9da7c22..4115362 100644
--- a/kernel/cobalt/shadow.c
+++ b/kernel/cobalt/shadow.c
@@ -223,6 +223,7 @@ static void request_syscall_restart(struct xnthread *thread,
                                          (sysflags & __xn_exec_norestart) ?
                                          -EINTR : -ERESTARTSYS);
                        notify = !xnthread_test_state(thread, XNDEBUG);
+                       xnthread_clear_info(thread, XNBREAK);
                }
                xnthread_clear_info(thread, XNKICKED);
        }


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

Reply via email to