/alps/pcitool

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to driver/rdma.c

  • Committer: Suren A. Chilingaryan
  • Date: 2018-02-11 04:18:31 UTC
  • Revision ID: csa@suren.me-20180211041831-r43p7okxzys402jq
Support kernel 4.12 by Timo

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
#include <linux/pagemap.h>
9
9
#include <linux/hugetlb.h>
10
10
#include <linux/cdev.h>
 
11
#include <linux/version.h>
11
12
 
12
13
#include "base.h"
13
14
 
18
19
    pmd_t *pmd;
19
20
    pte_t *pte;
20
21
 
 
22
 
21
23
    spinlock_t *ptl;
22
24
    unsigned long pfn = 0;
23
25
 
26
28
    if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
27
29
        return 0;
28
30
 
 
31
        // pud_offset compatibility with pgd_t* broken from Kernel Version 4.12 onwards. See: https://github.com/torvalds/linux/commit/048456dcf2c56ad6f6248e2899dda92fb6a613f6
 
32
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
 
33
    p4d_t *p4d;
 
34
    p4d = p4d_offset(pgd, address);
 
35
    pud = pud_offset(p4d, address);
 
36
#elif
29
37
    pud = pud_offset(pgd, address);
 
38
#endif
 
39
 
30
40
    if (pud_none(*pud) || unlikely(pud_bad(*pud)))
31
41
        return 0;
32
42