Continued update of master's rtdm part to xenomai 3 : rtdm_user_info_t now replaced by rtdm_fd stable-1.5
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Tue, 11 Sep 2018 08:43:17 +0200
branchstable-1.5
changeset 2706 43f8e40a183d
parent 2705 c6e3c6d66af0
child 2707 245d8592cfdc
Continued update of master's rtdm part to xenomai 3 : rtdm_user_info_t now replaced by rtdm_fd
master/rtdm.c
--- a/master/rtdm.c	Mon Sep 10 22:40:27 2018 +0200
+++ b/master/rtdm.c	Tue Sep 11 08:43:17 2018 +0200
@@ -49,15 +49,15 @@
 /** Context structure for an open RTDM file handle.
  */
 typedef struct {
-    rtdm_user_info_t *user_info; /**< RTDM user data. */
+    struct rtdm_fd *fd; /**< RTDM user data. */
     ec_ioctl_context_t ioctl_ctx; /**< Context structure. */
 } ec_rtdm_context_t;
 
 /****************************************************************************/
 
-int ec_rtdm_open(struct rtdm_dev_context *, rtdm_user_info_t *, int);
-int ec_rtdm_close(struct rtdm_dev_context *, rtdm_user_info_t *);
-int ec_rtdm_ioctl(struct rtdm_dev_context *, rtdm_user_info_t *,
+int ec_rtdm_open(struct rtdm_dev_context *, struct rtdm_fd *, int);
+int ec_rtdm_close(struct rtdm_dev_context *, struct rtdm_fd *);
+int ec_rtdm_ioctl(struct rtdm_dev_context *, struct rtdm_fd *,
         unsigned int, void __user *);
 
 /****************************************************************************/
@@ -69,7 +69,7 @@
 							  1),
 	.device_flags		=	RTDM_NAMED_DEVICE,
 	.device_count		=	1,
-	.context_size		=	sizeof(ec_rtdm_context_t).
+	.context_size		=	sizeof(ec_rtdm_context_t),
 	.ops = {
         .open      = ec_rtdm_open;
         .close_nrt = ec_rtdm_close,
@@ -156,7 +156,7 @@
  */
 int ec_rtdm_open(
         struct rtdm_dev_context *context, /**< Context. */
-        rtdm_user_info_t *user_info, /**< User data. */
+        struct rtdm_fd *fd, /**< User data. */
         int oflags /**< Open flags. */
         )
 {
@@ -165,7 +165,7 @@
     ec_rtdm_dev_t *rtdm_dev = (ec_rtdm_dev_t *) context->device->device_data;
 #endif
 
-    ctx->user_info = user_info;
+    ctx->fd = fd;
     ctx->ioctl_ctx.writable = oflags & O_WRONLY || oflags & O_RDWR;
     ctx->ioctl_ctx.requested = 0;
     ctx->ioctl_ctx.process_data = NULL;
@@ -186,7 +186,7 @@
  */
 int ec_rtdm_close(
         struct rtdm_dev_context *context, /**< Context. */
-        rtdm_user_info_t *user_info /**< User data. */
+        struct rtdm_fd *fd /**< User data. */
         )
 {
     ec_rtdm_context_t *ctx = (ec_rtdm_context_t *) context->dev_private;
@@ -211,7 +211,7 @@
  */
 int ec_rtdm_ioctl(
         struct rtdm_dev_context *context, /**< Context. */
-        rtdm_user_info_t *user_info, /**< User data. */
+        struct rtdm_fd *fd, /**< User data. */
         unsigned int request, /**< Request. */
         void __user *arg /**< Argument. */
         )
@@ -242,7 +242,7 @@
         container_of(ioctl_ctx, ec_rtdm_context_t, ioctl_ctx);
     int ret;
 
-    ret = rtdm_mmap_to_user(ctx->user_info,
+    ret = rtdm_mmap_to_user(ctx->fd,
             ioctl_ctx->process_data, ioctl_ctx->process_data_size,
             PROT_READ | PROT_WRITE,
             user_address,