]> git.ipfire.org Git - thirdparty/linux.git/commit
asm-generic: provide generic page_to_phys and phys_to_page implementations
authorChristoph Hellwig <hch@lst.de>
Wed, 23 Oct 2024 05:36:36 +0000 (07:36 +0200)
committerArnd Bergmann <arnd@arndb.de>
Mon, 28 Oct 2024 21:44:28 +0000 (21:44 +0000)
commitc5c3238d9b8cee58cd4b08bbbe9347a94a566390
tree3385a96ef2934aae9eb1c034bee9c3855727734a
parent6f043e75744596968b6547c4bd43e4d30bbb6d6e
asm-generic: provide generic page_to_phys and phys_to_page implementations

page_to_phys is duplicated by all architectures, and from some strange
reason placed in <asm/io.h> where it doesn't fit at all.

phys_to_page is only provided by a few architectures despite having a lot
of open coded users.

Provide generic versions in <asm-generic/memory_model.h> to make these
helpers more easily usable.

Note with this patch powerpc loses the CONFIG_DEBUG_VIRTUAL pfn_valid
check.  It will be added back in a generic version later.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
22 files changed:
arch/alpha/include/asm/io.h
arch/arc/include/asm/io.h
arch/arm/include/asm/memory.h
arch/arm64/include/asm/memory.h
arch/csky/include/asm/page.h
arch/hexagon/include/asm/page.h
arch/loongarch/include/asm/page.h
arch/m68k/include/asm/virtconvert.h
arch/microblaze/include/asm/page.h
arch/mips/include/asm/io.h
arch/nios2/include/asm/io.h
arch/openrisc/include/asm/page.h
arch/parisc/include/asm/page.h
arch/powerpc/include/asm/io.h
arch/riscv/include/asm/page.h
arch/s390/include/asm/page.h
arch/sh/include/asm/page.h
arch/sparc/include/asm/page.h
arch/um/include/asm/pgtable.h
arch/x86/include/asm/io.h
arch/xtensa/include/asm/page.h
include/asm-generic/memory_model.h