git: 286ed9ef4f9f - stable/13 - powerpc: fix a few pmap related functions to return correct types

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sat, 29 Apr 2023 07:36:48 UTC
The branch stable/13 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=286ed9ef4f9fdd23bddc12ff656af641ecc43a03

commit 286ed9ef4f9fdd23bddc12ff656af641ecc43a03
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-04-23 13:22:44 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-04-29 07:23:20 +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/aim/mmu_radix.c         | 8 ++++----
 sys/powerpc/booke/pmap.c            | 2 +-
 sys/powerpc/powerpc/pmap_dispatch.c | 4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c
index e86df137c963..59a742ff9967 100644
--- a/sys/powerpc/aim/mmu_oea.c
+++ b/sys/powerpc/aim/mmu_oea.c
@@ -320,7 +320,7 @@ vm_paddr_t moea_kextract(vm_offset_t);
 void moea_kenter_attr(vm_offset_t, vm_paddr_t, vm_memattr_t);
 void moea_kenter(vm_offset_t, vm_paddr_t);
 void moea_page_set_memattr(vm_page_t m, vm_memattr_t ma);
-boolean_t moea_dev_direct_mapped(vm_paddr_t, vm_size_t);
+int moea_dev_direct_mapped(vm_paddr_t, vm_size_t);
 static void moea_sync_icache(pmap_t, vm_offset_t, vm_size_t);
 void moea_dumpsys_map(vm_paddr_t pa, size_t sz, void **va);
 void moea_scan_init(void);
@@ -2658,7 +2658,7 @@ moea_bat_mapped(int idx, vm_paddr_t pa, vm_size_t size)
 	return (0);
 }
 
-boolean_t
+int
 moea_dev_direct_mapped(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 156463148f64..84b6cd0c3730 100644
--- a/sys/powerpc/aim/mmu_oea64.c
+++ b/sys/powerpc/aim/mmu_oea64.c
@@ -426,7 +426,7 @@ vm_paddr_t moea64_kextract(vm_offset_t);
 void moea64_page_set_memattr(vm_page_t m, vm_memattr_t ma);
 void moea64_kenter_attr(vm_offset_t, vm_paddr_t, vm_memattr_t ma);
 void moea64_kenter(vm_offset_t, vm_paddr_t);
-boolean_t moea64_dev_direct_mapped(vm_paddr_t, vm_size_t);
+int moea64_dev_direct_mapped(vm_paddr_t, vm_size_t);
 static void moea64_sync_icache(pmap_t, vm_offset_t, vm_size_t);
 void moea64_dumpsys_map(vm_paddr_t pa, size_t sz,
     void **va);
@@ -3149,7 +3149,7 @@ moea64_clear_bit(vm_page_t m, u_int64_t ptebit)
 	return (count);
 }
 
-boolean_t
+int
 moea64_dev_direct_mapped(vm_paddr_t pa, vm_size_t size)
 {
 	struct pvo_entry *pvo, key;
diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c
index 9f59d524196f..4210f1faf0a6 100644
--- a/sys/powerpc/aim/mmu_radix.c
+++ b/sys/powerpc/aim/mmu_radix.c
@@ -458,7 +458,7 @@ void mmu_radix_qenter(vm_offset_t, vm_page_t *, int);
 void mmu_radix_qremove(vm_offset_t, int);
 vm_offset_t mmu_radix_quick_enter_page(vm_page_t);
 void mmu_radix_quick_remove_page(vm_offset_t);
-boolean_t mmu_radix_ts_referenced(vm_page_t);
+int mmu_radix_ts_referenced(vm_page_t);
 void mmu_radix_release(pmap_t);
 void mmu_radix_remove(pmap_t, vm_offset_t, vm_offset_t);
 void mmu_radix_remove_all(vm_page_t);
@@ -492,7 +492,7 @@ static void *mmu_radix_mapdev(vm_paddr_t, vm_size_t);
 static void *mmu_radix_mapdev_attr(vm_paddr_t, vm_size_t, vm_memattr_t);
 static void mmu_radix_unmapdev(vm_offset_t, vm_size_t);
 static void mmu_radix_kenter_attr(vm_offset_t, vm_paddr_t, vm_memattr_t ma);
-static boolean_t mmu_radix_dev_direct_mapped(vm_paddr_t, vm_size_t);
+static int mmu_radix_dev_direct_mapped(vm_paddr_t, vm_size_t);
 static void mmu_radix_dumpsys_map(vm_paddr_t pa, size_t sz, void **va);
 static void mmu_radix_scan_init(void);
 static void	mmu_radix_cpu_bootstrap(int ap);
@@ -3838,7 +3838,7 @@ mmu_radix_is_referenced(vm_page_t m)
  *	invalidations are performed before the PV list lock is
  *	released.
  */
-boolean_t
+int
 mmu_radix_ts_referenced(vm_page_t m)
 {
 	struct md_page *pvh;
@@ -6090,7 +6090,7 @@ mmu_radix_decode_kernel_ptr(vm_offset_t addr,
 	return (0);
 }
 
-static boolean_t
+static int
 mmu_radix_dev_direct_mapped(vm_paddr_t pa, vm_size_t size)
 {
 
diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c
index 6c48584096c5..2d16bba90925 100644
--- a/sys/powerpc/booke/pmap.c
+++ b/sys/powerpc/booke/pmap.c
@@ -338,7 +338,7 @@ static vm_paddr_t	mmu_booke_kextract(vm_offset_t);
 static void		mmu_booke_kenter(vm_offset_t, vm_paddr_t);
 static void		mmu_booke_kenter_attr(vm_offset_t, vm_paddr_t, vm_memattr_t);
 static void		mmu_booke_kremove(vm_offset_t);
-static boolean_t	mmu_booke_dev_direct_mapped(vm_paddr_t, vm_size_t);
+static int		mmu_booke_dev_direct_mapped(vm_paddr_t, vm_size_t);
 static void		mmu_booke_sync_icache(pmap_t, vm_offset_t,
     vm_size_t);
 static void		mmu_booke_dumpsys_map(vm_paddr_t pa, size_t,
diff --git a/sys/powerpc/powerpc/pmap_dispatch.c b/sys/powerpc/powerpc/pmap_dispatch.c
index 00d4a2074327..1adfc42eefd1 100644
--- a/sys/powerpc/powerpc/pmap_dispatch.c
+++ b/sys/powerpc/powerpc/pmap_dispatch.c
@@ -150,7 +150,7 @@ DEFINE_PMAP_IFUNC(void, qenter, (vm_offset_t, vm_page_t *, int));
 DEFINE_PMAP_IFUNC(void, qremove, (vm_offset_t, int));
 DEFINE_PMAP_IFUNC(vm_offset_t, quick_enter_page, (vm_page_t));
 DEFINE_PMAP_IFUNC(void, quick_remove_page, (vm_offset_t));
-DEFINE_PMAP_IFUNC(boolean_t, ts_referenced, (vm_page_t));
+DEFINE_PMAP_IFUNC(int, ts_referenced, (vm_page_t));
 DEFINE_PMAP_IFUNC(void, release, (pmap_t));
 DEFINE_PMAP_IFUNC(void, remove, (pmap_t, vm_offset_t, vm_offset_t));
 DEFINE_PMAP_IFUNC(void, remove_all, (vm_page_t));
@@ -179,7 +179,7 @@ DEFINE_PMAP_IFUNC(void, unmapdev, (vm_offset_t, vm_size_t));
 DEFINE_PMAP_IFUNC(int, map_user_ptr,
     (pmap_t, volatile const void *, void **, size_t, size_t *));
 DEFINE_PMAP_IFUNC(int, decode_kernel_ptr, (vm_offset_t, int *, vm_offset_t *));
-DEFINE_PMAP_IFUNC(boolean_t, dev_direct_mapped, (vm_paddr_t, vm_size_t));
+DEFINE_PMAP_IFUNC(int, dev_direct_mapped, (vm_paddr_t, vm_size_t));
 DEFINE_PMAP_IFUNC(void, sync_icache, (pmap_t, vm_offset_t, vm_size_t));
 DEFINE_PMAP_IFUNC(int, change_attr, (vm_offset_t, vm_size_t, vm_memattr_t));
 DEFINE_PMAP_IFUNC(void, page_array_startup, (long));