git: 915161b3d35e - main - hwpmc/arm64: fix the type for pm_arm64_evsel

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Tue, 25 Jun 2024 09:31:27 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=915161b3d35ed5a742e3a8d90d215a2d930dd199

commit 915161b3d35ed5a742e3a8d90d215a2d930dd199
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2024-06-25 08:41:37 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2024-06-25 09:07:19 +0000

    hwpmc/arm64: fix the type for pm_arm64_evsel
    
    It holds a 64-bit register, use a uint64_t.
    
    Reviewed by:    mhorne
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D45526
---
 sys/dev/hwpmc/hwpmc_arm64.c | 7 ++++---
 sys/dev/hwpmc/hwpmc_arm64.h | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/sys/dev/hwpmc/hwpmc_arm64.c b/sys/dev/hwpmc/hwpmc_arm64.c
index af8d25b098c4..4b2fd5cc746f 100644
--- a/sys/dev/hwpmc/hwpmc_arm64.c
+++ b/sys/dev/hwpmc/hwpmc_arm64.c
@@ -163,7 +163,7 @@ static int
 arm64_allocate_pmc(int cpu, int ri, struct pmc *pm,
   const struct pmc_op_pmcallocate *a)
 {
-	uint32_t config;
+	uint64_t config;
 	enum pmc_event pe;
 
 	KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
@@ -201,7 +201,8 @@ arm64_allocate_pmc(int cpu, int ri, struct pmc *pm,
 	}
 
 	pm->pm_md.pm_arm64.pm_arm64_evsel = config;
-	PMCDBG2(MDP, ALL, 2, "arm64-allocate ri=%d -> config=0x%x", ri, config);
+	PMCDBG2(MDP, ALL, 2, "arm64-allocate ri=%d -> config=0x%lx", ri,
+	    config);
 
 	return (0);
 }
@@ -299,7 +300,7 @@ arm64_config_pmc(int cpu, int ri, struct pmc *pm)
 static int
 arm64_start_pmc(int cpu, int ri, struct pmc *pm)
 {
-	uint32_t config;
+	uint64_t config;
 
 	config = pm->pm_md.pm_arm64.pm_arm64_evsel;
 
diff --git a/sys/dev/hwpmc/hwpmc_arm64.h b/sys/dev/hwpmc/hwpmc_arm64.h
index e1f605a0371b..97909d8e7c92 100644
--- a/sys/dev/hwpmc/hwpmc_arm64.h
+++ b/sys/dev/hwpmc/hwpmc_arm64.h
@@ -42,7 +42,7 @@
 #ifdef _KERNEL
 /* MD extension for 'struct pmc' */
 struct pmc_md_arm64_pmc {
-	uint32_t	pm_arm64_evsel;
+	uint64_t	pm_arm64_evsel;
 };
 #endif /* _KERNEL */
 #endif /* _DEV_HWPMC_ARMV8_H_ */