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

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Wed Jul  6 20:45:20 2016 +0200

switchtest: align kernel-space fpu register values

with user-space

---

 ksrc/drivers/testing/switchtest.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/ksrc/drivers/testing/switchtest.c 
b/ksrc/drivers/testing/switchtest.c
index ad04dc4..6e437a4 100644
--- a/ksrc/drivers/testing/switchtest.c
+++ b/ksrc/drivers/testing/switchtest.c
@@ -266,8 +266,8 @@ static int rtswitch_to_nrt(rtswitch_context_t *ctx,
                                goto signal_nofp;
                        }
 
-                       expected = from_idx + 500 +
-                               (ctx->switches_count % 4000000) * 1000;
+                       expected = (from_idx + 500) * 1000 +
+                               (ctx->switches_count % 4000000000U) * 1000000;
 
                        fp_regs_set(expected);
                        rtdm_event_signal(&to->rt_synch);
@@ -289,8 +289,8 @@ static int rtswitch_to_nrt(rtswitch_context_t *ctx,
                        ctx->error.last_switch.to = to_idx;
                        if ((to->base.flags & RTSWITCH_RT) == RTSWITCH_NRT)
                                goto switch_to_nrt;
-                       expected = from_idx + 500 +
-                               (ctx->switches_count % 4000000) * 1000;
+                       expected = (from_idx + 500) * 1000 +
+                               (ctx->switches_count % 4000000000U) * 1000000;
                        barrier();
 
                        fp_linux_begin();
@@ -402,7 +402,7 @@ static void rtswitch_ktask(void *cookie)
 
        for(;;) {
                if (task->base.flags & RTTST_SWTEST_USE_FPU)
-                       fp_regs_set(task->base.index + i * 1000);
+                       fp_regs_set(task->base.index * 1000 + i * 1000000);
 
                switch(i % 3) {
                case 0:
@@ -425,7 +425,7 @@ static void rtswitch_ktask(void *cookie)
                if (task->base.flags & RTTST_SWTEST_USE_FPU) {
                        unsigned fp_val, expected;
 
-                       expected = task->base.index + i * 1000;
+                       expected = task->base.index * 1000 + i * 1000000;
                        fp_val = fp_regs_check(expected);
 
                        if (fp_val != expected) {
@@ -435,7 +435,7 @@ static void rtswitch_ktask(void *cookie)
                        }
                }
 
-               if (++i == 4000000)
+               if (++i == 4000000000U)
                        i = 0;
        }
 }


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

Reply via email to