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

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Wed Jul  6 19:14:34 2016 +0200

switchtest: clarify the mode switch

---

 src/testsuite/switchtest/switchtest.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/testsuite/switchtest/switchtest.c 
b/src/testsuite/switchtest/switchtest.c
index 476bcc0..ea195b4 100644
--- a/src/testsuite/switchtest/switchtest.c
+++ b/src/testsuite/switchtest/switchtest.c
@@ -683,13 +683,17 @@ static void *rtuo(void *cookie)
 
                /* Switch mode. */
                if (i % 3 == 2) {
+                       unsigned next_mode;
+
+                       next_mode = PTHREAD_PRIMARY - mode;
+
                        expected += 128;
+
                        if ((mode && param->fp & UFPP) ||
                                (!mode && param->fp & UFPS))
                                fp_regs_set(expected);
 
-                       if ((err = pthread_set_mode_np
-                                       (mode, PTHREAD_PRIMARY - mode))) {
+                       if ((err = pthread_set_mode_np(mode, next_mode))) {
                                fprintf(stderr,
                                        "rtuo: pthread_set_mode_np: %s\n",
                                        strerror(err));
@@ -703,7 +707,7 @@ static void *rtuo(void *cookie)
                                        handle_bad_fpreg(param->cpu, fp_val);
                        }
 
-                       mode = PTHREAD_PRIMARY - mode;
+                       mode = next_mode;
                }
 
                if(++i == 4000000000U)


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

Reply via email to