equal
deleted
inserted
replaced
251 * ecdev_mmap(). |
251 * ecdev_mmap(). |
252 * |
252 * |
253 * \return Zero on success, otherwise a negative error code. |
253 * \return Zero on success, otherwise a negative error code. |
254 */ |
254 */ |
255 static int eccdev_vma_fault( |
255 static int eccdev_vma_fault( |
|
256 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) |
256 struct vm_area_struct *vma, /**< Virtual memory area. */ |
257 struct vm_area_struct *vma, /**< Virtual memory area. */ |
|
258 #endif |
257 struct vm_fault *vmf /**< Fault data. */ |
259 struct vm_fault *vmf /**< Fault data. */ |
258 ) |
260 ) |
259 { |
261 { |
|
262 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) |
|
263 struct vm_area_struct *vma = vmf->vma; |
|
264 #endif |
260 unsigned long offset = vmf->pgoff << PAGE_SHIFT; |
265 unsigned long offset = vmf->pgoff << PAGE_SHIFT; |
261 ec_cdev_priv_t *priv = (ec_cdev_priv_t *) vma->vm_private_data; |
266 ec_cdev_priv_t *priv = (ec_cdev_priv_t *) vma->vm_private_data; |
262 struct page *page; |
267 struct page *page; |
263 |
268 |
264 if (offset >= priv->ctx.process_data_size) { |
269 if (offset >= priv->ctx.process_data_size) { |