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

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sun Jun 19 11:09:21 2011 +0200

nucleus: reverse ppd cleanup order

---

 ksrc/nucleus/shadow.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
index 9f82fa8..679826e 100644
--- a/ksrc/nucleus/shadow.c
+++ b/ksrc/nucleus/shadow.c
@@ -563,7 +563,7 @@ static unsigned ppd_lookup_inner(xnqueue_t **pq,
        }
        while (holder &&
               (ppd->key.mm < pkey->mm ||
-               (ppd->key.mm == pkey->mm && ppd->key.muxid < pkey->muxid)));
+               (ppd->key.mm == pkey->mm && ppd->key.muxid > pkey->muxid)));
 
        if (ppd->key.mm == pkey->mm && ppd->key.muxid == pkey->muxid) {
                /* found it, return it. */
@@ -573,7 +573,7 @@ static unsigned ppd_lookup_inner(xnqueue_t **pq,
 
        /* not found, return successor for insertion. */
        if (ppd->key.mm < pkey->mm ||
-           (ppd->key.mm == pkey->mm && ppd->key.muxid < pkey->muxid))
+           (ppd->key.mm == pkey->mm && ppd->key.muxid > pkey->muxid))
                *pholder = holder ? link2ppd(holder) : NULL;
        else
                *pholder = ppd;
@@ -596,10 +596,11 @@ static int ppd_insert(xnshadow_ppd_t * holder)
        }
 
        inith(&holder->link);
-       if (next)
+       if (next) {
                insertq(q, &next->link, &holder->link);
-       else
+       } else {
                appendq(q, &holder->link);
+       }
        xnlock_put_irqrestore(&nklock, s);
 
        return 0;
@@ -647,7 +648,7 @@ static inline void ppd_remove_mm(struct mm_struct *mm,
        xnqueue_t *q;
        spl_t s;
 
-       key.muxid = 0;
+       key.muxid = ~0UL;
        key.mm = mm;
        xnlock_get_irqsave(&nklock, s);
        ppd_lookup_inner(&q, &ppd, &key);


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

Reply via email to