LinuxKPI: page.h: use atop() and ptoa() instead of PAGE_SHIFT

With upcoming changes to 'struct page' this will make the lines
easier to read by using the predefined macros from param.h.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	markj, kib
Differential Revision: https://reviews.freebsd.org/D58298

(cherry picked from commit f45506c6a6f4742cd5129d636902b61045c4754b)
This commit is contained in:
Bjoern A. Zeeb 2026-07-17 13:09:01 +00:00 • committed by Franco Fichtner
parent 4693c24f66
commit 40754bcffb

View file

@ -74,8 +74,8 @@ pgprot2cachemode(pgprot_t prot)
#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))
#define page_to_pfn(pp) atop(VM_PAGE_TO_PHYS(pp))
#define pfn_to_page(pfn) PHYS_TO_VM_PAGE(ptoa(pfn))
#define nth_page(page,n) pfn_to_page(page_to_pfn(page) + (n))
#define page_to_phys(page) VM_PAGE_TO_PHYS(page)