master/ioctl.c
branchstable-1.5
changeset 2712 5d21d80777a6
parent 2693 8051d05cb935
child 2719 94c9657e0bee
equal deleted inserted replaced
2711:a5c4ccc02285 2712:5d21d80777a6
  1702     int ret;
  1702     int ret;
  1703 
  1703 
  1704     if (unlikely(!ctx->requested))
  1704     if (unlikely(!ctx->requested))
  1705         return -EPERM;
  1705         return -EPERM;
  1706 
  1706 
  1707     io.process_data = NULL;
       
  1708 
       
  1709     /* Get the sum of the domains' process data sizes. */
  1707     /* Get the sum of the domains' process data sizes. */
  1710 
  1708 
  1711     ctx->process_data_size = 0;
  1709     ctx->process_data_size = 0;
  1712 
  1710 
  1713     if (down_interruptible(&master->master_sem))
  1711     if (down_interruptible(&master->master_sem))
  1733         list_for_each_entry(domain, &master->domains, list) {
  1731         list_for_each_entry(domain, &master->domains, list) {
  1734             ecrt_domain_external_memory(domain,
  1732             ecrt_domain_external_memory(domain,
  1735                     ctx->process_data + offset);
  1733                     ctx->process_data + offset);
  1736             offset += ecrt_domain_size(domain);
  1734             offset += ecrt_domain_size(domain);
  1737         }
  1735         }
  1738 
       
  1739 #ifdef EC_IOCTL_RTDM
       
  1740         /* RTDM uses a different approach for memory-mapping, which has to be
       
  1741          * initiated by the kernel.
       
  1742          */
       
  1743         ret = ec_rtdm_mmap(ctx, &io.process_data);
       
  1744         if (ret < 0) {
       
  1745             EC_MASTER_ERR(master, "Failed to map process data"
       
  1746                     " memory to user space (code %i).\n", ret);
       
  1747             return ret;
       
  1748         }
       
  1749 #endif
       
  1750     }
  1736     }
  1751 
  1737 
  1752     io.process_data_size = ctx->process_data_size;
  1738     io.process_data_size = ctx->process_data_size;
  1753 
  1739 
  1754 #ifndef EC_IOCTL_RTDM
  1740 #ifndef EC_IOCTL_RTDM