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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Jul 19 11:45:34 2009 +0200

testsuite: add missing compiler barriers to switchtest

---

 ksrc/drivers/testing/switchtest.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/ksrc/drivers/testing/switchtest.c 
b/ksrc/drivers/testing/switchtest.c
index dee2f9d..227596d 100644
--- a/ksrc/drivers/testing/switchtest.c
+++ b/ksrc/drivers/testing/switchtest.c
@@ -100,9 +100,11 @@ static int rtswitch_to_rt(rtswitch_context_t *ctx,
        ++ctx->switches_count;
        ctx->error.last_switch.from = from_idx;
        ctx->error.last_switch.to = to_idx;
+       barrier();
 
        if (ctx->pause_us) {
                ctx->next_task = to_idx;
+               barrier();
                rtdm_timer_start(&ctx->wake_up_delay,
                                 ctx->pause_us * 1000, 0,
                                 RTDM_TIMERMODE_RELATIVE);
@@ -111,6 +113,7 @@ static int rtswitch_to_rt(rtswitch_context_t *ctx,
                switch (to->base.flags & RTSWITCH_RT) {
                case RTSWITCH_NRT:
                        rtswitch_utask[ctx->cpu] = to;
+                       barrier();
                        rtdm_nrtsig_pend(&rtswitch_wake_utask);
                        xnpod_lock_sched();
                        break;
@@ -173,9 +176,11 @@ static int rtswitch_to_nrt(rtswitch_context_t *ctx,
        ++ctx->switches_count;
        ctx->error.last_switch.from = from_idx;
        ctx->error.last_switch.to = to_idx;
+       barrier();
 
        if (ctx->pause_us) {
                ctx->next_task = to_idx;
+               barrier();
                rtdm_timer_start(&ctx->wake_up_delay,
                                 ctx->pause_us * 1000, 0,
                                 RTDM_TIMERMODE_RELATIVE);


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

Reply via email to