Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154383912
D30602.id90277.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
732 B
Referenced Files
None
Subscribers
None
D30602.id90277.diff
View Options
Index: sys/dev/hwpmc/hwpmc_arm64.c
===================================================================
--- sys/dev/hwpmc/hwpmc_arm64.c
+++ sys/dev/hwpmc/hwpmc_arm64.c
@@ -181,9 +181,15 @@
}
pe = a->pm_ev;
- config = (uint32_t)pe - PMC_EV_ARMV8_FIRST;
- if (config > (PMC_EV_ARMV8_LAST - PMC_EV_ARMV8_FIRST))
+ /*
+ * pm_ev may contain the raw event code, or an ARMV8-class event code in the
+ * range [PMC_EV_ARMV8_FIRST, PMC_EV_ARMV8_LAST].
+ */
+ config = (uint32_t)pe;
+ if (config > PMC_EV_ARMV8_LAST)
return (EINVAL);
+ else if (config >= PMC_EV_ARMV8_FIRST)
+ config -= PMC_EV_ARMV8_FIRST;
pm->pm_md.pm_arm64.pm_arm64_evsel = config;
PMCDBG2(MDP, ALL, 2, "arm64-allocate ri=%d -> config=0x%x", ri, config);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 29, 6:22 AM (14 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32328722
Default Alt Text
D30602.id90277.diff (732 B)
Attached To
Mode
D30602: hwpmc_arm64: accept raw event codes for PMC_OP_PMCALLOCATE
Attached
Detach File
Event Timeline
Log In to Comment