summaryrefslogtreecommitdiffstats
path: root/sys/sys/pmc.h
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-05-19 18:58:18 +0000
committerjhb <jhb@FreeBSD.org>2015-05-19 18:58:18 +0000
commitd8d8e019c09564f7481439b2714426c420684b42 (patch)
treeaa664d8329f113634ac3854a3d1ae6a917e94b85 /sys/sys/pmc.h
parenta7c0f715c79bd7b1f11f62502ce7ec0fc2ffed0f (diff)
downloadFreeBSD-src-d8d8e019c09564f7481439b2714426c420684b42.zip
FreeBSD-src-d8d8e019c09564f7481439b2714426c420684b42.tar.gz
Use fixed enum values for PMC_CLASSES().
This removes one of the frequent causes of ABI breakage when new CPU types are added to hwpmc(4). Differential Revision: https://reviews.freebsd.org/D2586 Reviewed by: davide, emaste, gnn (earlier version) MFC after: 2 weeks
Diffstat (limited to 'sys/sys/pmc.h')
-rw-r--r--sys/sys/pmc.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h
index 6c1517b..f4d46b2 100644
--- a/sys/sys/pmc.h
+++ b/sys/sys/pmc.h
@@ -123,30 +123,30 @@ enum pmc_cputype {
*/
#define __PMC_CLASSES() \
- __PMC_CLASS(TSC) /* CPU Timestamp counter */ \
- __PMC_CLASS(K7) /* AMD K7 performance counters */ \
- __PMC_CLASS(K8) /* AMD K8 performance counters */ \
- __PMC_CLASS(P5) /* Intel Pentium counters */ \
- __PMC_CLASS(P6) /* Intel Pentium Pro counters */ \
- __PMC_CLASS(P4) /* Intel Pentium-IV counters */ \
- __PMC_CLASS(IAF) /* Intel Core2/Atom, fixed function */ \
- __PMC_CLASS(IAP) /* Intel Core...Atom, programmable */ \
- __PMC_CLASS(UCF) /* Intel Uncore fixed function */ \
- __PMC_CLASS(UCP) /* Intel Uncore programmable */ \
- __PMC_CLASS(XSCALE) /* Intel XScale counters */ \
- __PMC_CLASS(ARMV7) /* ARMv7 */ \
- __PMC_CLASS(ARMV8) /* ARMv8 */ \
- __PMC_CLASS(MIPS24K) /* MIPS 24K */ \
- __PMC_CLASS(OCTEON) /* Cavium Octeon */ \
- __PMC_CLASS(MIPS74K) /* MIPS 74K */ \
- __PMC_CLASS(PPC7450) /* Motorola MPC7450 class */ \
- __PMC_CLASS(PPC970) /* IBM PowerPC 970 class */ \
- __PMC_CLASS(E500) /* Freescale e500 class */ \
- __PMC_CLASS(SOFT) /* Software events */
+ __PMC_CLASS(TSC, 0x000, "CPU Timestamp counter") \
+ __PMC_CLASS(K7, 0x100, "AMD K7 performance counters") \
+ __PMC_CLASS(K8, 0x101, "AMD K8 performance counters") \
+ __PMC_CLASS(P5, 0x102, "Intel Pentium counters") \
+ __PMC_CLASS(P6, 0x103, "Intel Pentium Pro counters") \
+ __PMC_CLASS(P4, 0x104, "Intel Pentium-IV counters") \
+ __PMC_CLASS(IAF, 0x105, "Intel Core2/Atom, fixed function") \
+ __PMC_CLASS(IAP, 0x106, "Intel Core...Atom, programmable") \
+ __PMC_CLASS(UCF, 0x107, "Intel Uncore fixed function") \
+ __PMC_CLASS(UCP, 0x108, "Intel Uncore programmable") \
+ __PMC_CLASS(XSCALE, 0x200, "Intel XScale counters") \
+ __PMC_CLASS(ARMV7, 0x201, "ARMv7") \
+ __PMC_CLASS(ARMV8, 0x202, "ARMv8") \
+ __PMC_CLASS(MIPS24K, 0x300, "MIPS 24K") \
+ __PMC_CLASS(OCTEON, 0x301, "Cavium Octeon") \
+ __PMC_CLASS(MIPS74K, 0x302, "MIPS 74K") \
+ __PMC_CLASS(PPC7450, 0x400, "Motorola MPC7450 class") \
+ __PMC_CLASS(PPC970, 0x401, "IBM PowerPC 970 class") \
+ __PMC_CLASS(E500, 0x402, "Freescale e500 class") \
+ __PMC_CLASS(SOFT, 0x8000, "Software events")
enum pmc_class {
#undef __PMC_CLASS
-#define __PMC_CLASS(N) PMC_CLASS_##N ,
+#define __PMC_CLASS(S,V,D) PMC_CLASS_##S = V,
__PMC_CLASSES()
};
OpenPOWER on IntegriCloud