LinuxKPI: Add page_to_virt function

Sponsored by:	Serenity Cyber Security, LLC
MFC after:	1 week
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D45843
This commit is contained in:
Vladimir Kondratyev 2024-07-21 16:09:01 +03:00
parent 742088d9fb
commit 80aa295a52

View File

@ -72,6 +72,7 @@ pgprot2cachemode(pgprot_t prot)
return (VM_MEMATTR_DEFAULT);
}
#define page_to_virt(page) linux_page_address(page)
#define virt_to_page(x) PHYS_TO_VM_PAGE(vtophys(x))
#define page_to_pfn(pp) (VM_PAGE_TO_PHYS(pp) >> PAGE_SHIFT)
#define pfn_to_page(pfn) (PHYS_TO_VM_PAGE((pfn) << PAGE_SHIFT))