u2mfn: Make compatible with kernel versions >= 5.3.y
This commit is contained in:
parent
425f7f4f07
commit
5a83961a88
@ -54,10 +54,17 @@ static inline unsigned long VIRT_TO_MFN(void *addr)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0)
|
||||||
|
static int u2mfn_get_mfn(pte_t *pte, unsigned long addr, void *data) {
|
||||||
|
*((unsigned long *) data) = pfn_to_mfn(pte_pfn(*pte));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
static int u2mfn_get_mfn(pte_t *pte, pgtable_t token, unsigned long addr, void *data) {
|
static int u2mfn_get_mfn(pte_t *pte, pgtable_t token, unsigned long addr, void *data) {
|
||||||
*((unsigned long *) data) = pfn_to_mfn(pte_pfn(*pte));
|
*((unsigned long *) data) = pfn_to_mfn(pte_pfn(*pte));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/// User virtual address to mfn translator
|
/// User virtual address to mfn translator
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user