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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Sep 20 07:02:55 2010 +0200

psos: fix t_shadow() regression

Introducing the u_mode support caused the t_shadow routine to send a
bad arglist to the __t_create syscall used internally.

---

 ksrc/skins/psos+/syscall.c |    3 ++-
 src/skins/psos+/task.c     |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ksrc/skins/psos+/syscall.c b/ksrc/skins/psos+/syscall.c
index ef20b48..3ce53cc 100644
--- a/ksrc/skins/psos+/syscall.c
+++ b/ksrc/skins/psos+/syscall.c
@@ -110,7 +110,8 @@ static int __t_create(struct pt_regs *regs)
                 * TCB pointer freely. */
                tid = xnthread_handle(&task->threadbase);
                task->pthread = bulk.a5; /* hidden pthread_t identifier. */
-               if (__xn_safe_copy_to_user((void __user *)__xn_reg_arg2(regs), 
&tid,
+               if (__xn_reg_arg2(regs) &&
+                   __xn_safe_copy_to_user((void __user *)__xn_reg_arg2(regs), 
&tid,
                                           sizeof(tid)))
                        return -EFAULT;
 
diff --git a/src/skins/psos+/task.c b/src/skins/psos+/task.c
index 89b22ed..89871cb 100644
--- a/src/skins/psos+/task.c
+++ b/src/skins/psos+/task.c
@@ -180,10 +180,10 @@ u_long t_shadow(const char *name, /* Xenomai extension. */
        bulk.a1 = (u_long)name;
        bulk.a2 = (u_long)prio;
        bulk.a3 = (u_long)flags;
-       bulk.a4 = (u_long)tid_r;
+       bulk.a4 = (u_long)xeno_init_current_mode();
        bulk.a5 = (u_long)pthread_self();
 
-       ret = XENOMAI_SKINCALL2(__psos_muxid, __psos_t_create, &bulk, NULL);
+       ret = XENOMAI_SKINCALL3(__psos_muxid, __psos_t_create, &bulk, tid_r, 
NULL);
        if (!ret)
                xeno_set_current();
 


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

Reply via email to