Module: xenomai-3
Branch: next
Commit: f00ac22822e1d2a29ba12046262073985b217b79
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f00ac22822e1d2a29ba12046262073985b217b79

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sun Nov  8 10:38:39 2015 +0100

cobalt/rtnet: tdma: remove deprecated construct

Replace RTDM_EXECUTE_ATOMICALLY with
cobalt_atomic_enter/cobalt_atomic_leave for now, in order to avoid
compilation warnings.

---

 kernel/drivers/net/stack/rtmac/tdma/tdma_dev.c |   29 +++++++++++++-----------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/kernel/drivers/net/stack/rtmac/tdma/tdma_dev.c 
b/kernel/drivers/net/stack/rtmac/tdma/tdma_dev.c
index 6b19465..e2816a5 100644
--- a/kernel/drivers/net/stack/rtmac/tdma/tdma_dev.c
+++ b/kernel/drivers/net/stack/rtmac/tdma/tdma_dev.c
@@ -47,30 +47,33 @@ static int tdma_dev_open(struct rtdm_fd *fd, int oflags)
 static void tdma_dev_close(struct rtdm_fd *fd)
 {
     struct tdma_dev_ctx *ctx = rtdm_fd_to_private(fd);
+    rtdm_lockctx_t lock_ctx;
 
 
-    RTDM_EXECUTE_ATOMICALLY(
-       if (ctx->cycle_waiter)
-           rtdm_task_unblock(ctx->cycle_waiter);
-                           );
+    cobalt_atomic_enter(lock_ctx);
+    if (ctx->cycle_waiter)
+       rtdm_task_unblock(ctx->cycle_waiter);
+    cobalt_atomic_leave(lock_ctx);
 }
 
 
 static int wait_on_sync(struct tdma_dev_ctx *tdma_ctx,
                        rtdm_event_t *sync_event)
 {
+    rtdm_lockctx_t lock_ctx;
     int ret;
 
 
-    RTDM_EXECUTE_ATOMICALLY(
-       /* keep it simple: only one waiter per device instance allowed */
-       if (!tdma_ctx->cycle_waiter) {
-           tdma_ctx->cycle_waiter = rtdm_task_current();
-           ret = rtdm_event_wait(sync_event);
-           tdma_ctx->cycle_waiter = NULL;
-       } else
-           ret = -EBUSY;
-                           );
+    cobalt_atomic_enter(lock_ctx);
+    /* keep it simple: only one waiter per device instance allowed */
+    if (!tdma_ctx->cycle_waiter) {
+       tdma_ctx->cycle_waiter = rtdm_task_current();
+       ret = rtdm_event_wait(sync_event);
+       tdma_ctx->cycle_waiter = NULL;
+    } else
+       ret = -EBUSY;
+    cobalt_atomic_leave(lock_ctx);
+
     return ret;
 }
 


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

Reply via email to