git: e9e1f2a88e4b - stable/12 - powerpc: fix a few pmap related functions to return correct types

From: Dimitry Andric <>
Date: Sat, 29 Apr 2023 07:37:35 UTC
The branch stable/12 has been updated by dim:


commit e9e1f2a88e4bc6db9d6ecc3dcf95f29b4187e80e
Author:     Dimitry Andric <>
AuthorDate: 2023-04-23 13:22:44 +0000
Commit:     Dimitry Andric <>
CommitDate: 2023-04-29 07:35:10 +0000

    powerpc: fix a few pmap related functions to return correct types
    While experimenting with changing boolean_t to another type, I noticed
    that several powerpc pmap related functions returned the wrong type:
    boolean_t instead of int.
    Fix several declarations and definitions to match the actual pmap
    function types: pmap_dev_direct_mapped_t and pmap_ts_referenced_t.
    MFC after:      3 days
    (cherry picked from commit d142601887524fc595ed0f5e6a69419727222f0a)
 sys/powerpc/aim/mmu_oea.c           | 4 ++--
 sys/powerpc/aim/mmu_oea64.c         | 4 ++--
 sys/powerpc/booke/pmap.c            | 2 +-
 sys/powerpc/powerpc/pmap_dispatch.c | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c
index ea74879eba26..45c5af533926 100644
--- a/sys/powerpc/aim/mmu_oea.c
+++ b/sys/powerpc/aim/mmu_oea.c
@@ -314,7 +314,7 @@ vm_paddr_t moea_kextract(mmu_t, vm_offset_t);
 void moea_kenter_attr(mmu_t, vm_offset_t, vm_paddr_t, vm_memattr_t);
 void moea_kenter(mmu_t, vm_offset_t, vm_paddr_t);
 void moea_page_set_memattr(mmu_t mmu, vm_page_t m, vm_memattr_t ma);
-boolean_t moea_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t);
+int moea_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t);
 static void moea_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t);
 void moea_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t sz, void **va);
 void moea_scan_init(mmu_t mmu);
@@ -2613,7 +2613,7 @@ moea_bat_mapped(int idx, vm_paddr_t pa, vm_size_t size)
 	return (0);
 moea_dev_direct_mapped(mmu_t mmu, vm_paddr_t pa, vm_size_t size)
 	int i;
diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c
index e19cac8f314f..0a54e400c941 100644
--- a/sys/powerpc/aim/mmu_oea64.c
+++ b/sys/powerpc/aim/mmu_oea64.c
@@ -278,7 +278,7 @@ vm_paddr_t moea64_kextract(mmu_t, vm_offset_t);
 void moea64_page_set_memattr(mmu_t, vm_page_t m, vm_memattr_t ma);
 void moea64_kenter_attr(mmu_t, vm_offset_t, vm_paddr_t, vm_memattr_t ma);
 void moea64_kenter(mmu_t, vm_offset_t, vm_paddr_t);
-boolean_t moea64_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t);
+int moea64_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t);
 static void moea64_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t);
 void moea64_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t sz,
     void **va);
@@ -2722,7 +2722,7 @@ moea64_clear_bit(mmu_t mmu, vm_page_t m, u_int64_t ptebit)
 	return (count);
 moea64_dev_direct_mapped(mmu_t mmu, vm_paddr_t pa, vm_size_t size)
 	struct pvo_entry *pvo, key;
diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c
index f73c0207027e..79e774b33bf4 100644
--- a/sys/powerpc/booke/pmap.c
+++ b/sys/powerpc/booke/pmap.c
@@ -375,7 +375,7 @@ static vm_paddr_t	mmu_booke_kextract(mmu_t, vm_offset_t);
 static void		mmu_booke_kenter(mmu_t, vm_offset_t, vm_paddr_t);
 static void		mmu_booke_kenter_attr(mmu_t, vm_offset_t, vm_paddr_t, vm_memattr_t);
 static void		mmu_booke_kremove(mmu_t, vm_offset_t);
-static boolean_t	mmu_booke_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t);
+static int		mmu_booke_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t);
 static void		mmu_booke_sync_icache(mmu_t, pmap_t, vm_offset_t,
 static void		mmu_booke_dumpsys_map(mmu_t, vm_paddr_t pa, size_t,
diff --git a/sys/powerpc/powerpc/pmap_dispatch.c b/sys/powerpc/powerpc/pmap_dispatch.c
index 3cfa741d2ddb..424162a50444 100644
--- a/sys/powerpc/powerpc/pmap_dispatch.c
+++ b/sys/powerpc/powerpc/pmap_dispatch.c
@@ -528,7 +528,7 @@ pmap_decode_kernel_ptr(vm_offset_t addr, int *is_user, vm_offset_t *decoded)
 	return (MMU_DECODE_KERNEL_PTR(mmu_obj, addr, is_user, decoded));
 pmap_dev_direct_mapped(vm_paddr_t pa, vm_size_t size)