master/cdev.c
branchstable-1.5
changeset 2516 3680924f6f87
parent 2433 3bdd7a747fae
child 2522 ec403cf308eb
equal deleted inserted replaced
2515:1f03f2543fc3 2516:3680924f6f87
   210     return ec_ioctl(priv->cdev->master, &priv->ctx, cmd, (void __user *) arg);
   210     return ec_ioctl(priv->cdev->master, &priv->ctx, cmd, (void __user *) arg);
   211 }
   211 }
   212 
   212 
   213 /*****************************************************************************/
   213 /*****************************************************************************/
   214 
   214 
       
   215 #ifndef VM_DONTDUMP
       
   216 /** VM_RESERVED disappeared in 3.7.
       
   217  */
       
   218 #define VM_DONTDUMP VM_RESERVED
       
   219 #endif
       
   220 
   215 /** Memory-map callback for the EtherCAT character device.
   221 /** Memory-map callback for the EtherCAT character device.
   216  *
   222  *
   217  * The actual mapping will be done in the eccdev_vma_nopage() callback of the
   223  * The actual mapping will be done in the eccdev_vma_nopage() callback of the
   218  * virtual memory area.
   224  * virtual memory area.
   219  */
   225  */
   225     ec_cdev_priv_t *priv = (ec_cdev_priv_t *) filp->private_data;
   231     ec_cdev_priv_t *priv = (ec_cdev_priv_t *) filp->private_data;
   226 
   232 
   227     EC_MASTER_DBG(priv->cdev->master, 1, "mmap()\n");
   233     EC_MASTER_DBG(priv->cdev->master, 1, "mmap()\n");
   228 
   234 
   229     vma->vm_ops = &eccdev_vm_ops;
   235     vma->vm_ops = &eccdev_vm_ops;
   230     vma->vm_flags |= VM_RESERVED; /* Pages will not be swapped out */
   236     vma->vm_flags |= VM_DONTDUMP; /* Pages will not be swapped out */
   231     vma->vm_private_data = priv;
   237     vma->vm_private_data = priv;
   232 
   238 
   233     return 0;
   239     return 0;
   234 }
   240 }
   235 
   241