xref: /freebsd/sys/dev/hwpmc/pmc_events.h (revision 848ee2a3a8b47c9905fc51fefcf60eb371edbb98)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2005  Joseph Koshy
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  *
28  * $FreeBSD$
29  */
30 
31 #ifndef _DEV_HWPMC_PMC_EVENTS_H_
32 #define	_DEV_HWPMC_PMC_EVENTS_H_
33 
34 /*
35  * Note: Documentation on adding events can be found both in
36  * the source tree at src/share/doc/papers/hwpmc/hwpmc.ms
37  * as well as on-line at:
38  *
39  * https://wiki.freebsd.org/PmcTools/PmcHardwareHowTo
40  *
41  * Please refer to those resources before you attempt to modify
42  * this file or the hwpmc driver/subsystem.
43  */
44 
45 /* * PMC event codes.
46  *
47  * __PMC_EV(CLASS, SYMBOLIC-NAME)
48  *
49  */
50 /* timestamp counters. */
51 #define        __PMC_EV_TSC()                                                  \
52 	__PMC_EV(TSC, TSC)
53 
54 #define        PMC_EV_TSC_FIRST        PMC_EV_TSC_TSC
55 #define        PMC_EV_TSC_LAST         PMC_EV_TSC_TSC
56 
57 #define	__PMC_EV_ALIAS_TSC()			\
58 __PMC_EV_ALIAS("cycles",	TSC_TSC)
59 
60 /*
61  * Software events are dynamically defined.
62  */
63 
64 #define        PMC_EV_DYN_COUNT        0x1000
65 
66 #define        PMC_EV_SOFT_FIRST       0x20000
67 #define        PMC_EV_SOFT_LAST        (PMC_EV_SOFT_FIRST + PMC_EV_DYN_COUNT - 1)
68 
69 /*
70  * AMD K7 Events, from "The AMD Athlon(tm) Processor x86 Code
71  * Optimization Guide" [Doc#22007K, Feb 2002]
72  */
73 
74 #define	__PMC_EV_K7()					\
75 __PMC_EV(K7, DC_ACCESSES)				\
76 __PMC_EV(K7, DC_MISSES)					\
77 __PMC_EV(K7, DC_REFILLS_FROM_L2)			\
78 __PMC_EV(K7, DC_REFILLS_FROM_SYSTEM)			\
79 __PMC_EV(K7, DC_WRITEBACKS)				\
80 __PMC_EV(K7, L1_DTLB_MISS_AND_L2_DTLB_HITS)		\
81 __PMC_EV(K7, L1_AND_L2_DTLB_MISSES)			\
82 __PMC_EV(K7, MISALIGNED_REFERENCES)			\
83 __PMC_EV(K7, IC_FETCHES)				\
84 __PMC_EV(K7, IC_MISSES)					\
85 __PMC_EV(K7, L1_ITLB_MISSES)				\
86 __PMC_EV(K7, L1_L2_ITLB_MISSES)				\
87 __PMC_EV(K7, RETIRED_INSTRUCTIONS)			\
88 __PMC_EV(K7, RETIRED_OPS)				\
89 __PMC_EV(K7, RETIRED_BRANCHES)				\
90 __PMC_EV(K7, RETIRED_BRANCHES_MISPREDICTED)		\
91 __PMC_EV(K7, RETIRED_TAKEN_BRANCHES)			\
92 __PMC_EV(K7, RETIRED_TAKEN_BRANCHES_MISPREDICTED)	\
93 __PMC_EV(K7, RETIRED_FAR_CONTROL_TRANSFERS)		\
94 __PMC_EV(K7, RETIRED_RESYNC_BRANCHES)			\
95 __PMC_EV(K7, INTERRUPTS_MASKED_CYCLES)			\
96 __PMC_EV(K7, INTERRUPTS_MASKED_WHILE_PENDING_CYCLES)	\
97 __PMC_EV(K7, HARDWARE_INTERRUPTS)
98 
99 #define	PMC_EV_K7_FIRST	PMC_EV_K7_DC_ACCESSES
100 #define	PMC_EV_K7_LAST	PMC_EV_K7_HARDWARE_INTERRUPTS
101 
102 /* AMD K8 PMCs */
103 
104 #define	__PMC_EV_K8()							\
105 __PMC_EV(K8, FP_DISPATCHED_FPU_OPS)					\
106 __PMC_EV(K8, FP_CYCLES_WITH_NO_FPU_OPS_RETIRED)				\
107 __PMC_EV(K8, FP_DISPATCHED_FPU_FAST_FLAG_OPS)				\
108 __PMC_EV(K8, LS_SEGMENT_REGISTER_LOAD)					\
109 __PMC_EV(K8, LS_MICROARCHITECTURAL_RESYNC_BY_SELF_MODIFYING_CODE)	\
110 __PMC_EV(K8, LS_MICROARCHITECTURAL_RESYNC_BY_SNOOP)			\
111 __PMC_EV(K8, LS_BUFFER2_FULL)						\
112 __PMC_EV(K8, LS_LOCKED_OPERATION)					\
113 __PMC_EV(K8, LS_MICROARCHITECTURAL_LATE_CANCEL)				\
114 __PMC_EV(K8, LS_RETIRED_CFLUSH_INSTRUCTIONS)				\
115 __PMC_EV(K8, LS_RETIRED_CPUID_INSTRUCTIONS)				\
116 __PMC_EV(K8, DC_ACCESS)							\
117 __PMC_EV(K8, DC_MISS)							\
118 __PMC_EV(K8, DC_REFILL_FROM_L2)						\
119 __PMC_EV(K8, DC_REFILL_FROM_SYSTEM)					\
120 __PMC_EV(K8, DC_COPYBACK)						\
121 __PMC_EV(K8, DC_L1_DTLB_MISS_AND_L2_DTLB_HIT)				\
122 __PMC_EV(K8, DC_L1_DTLB_MISS_AND_L2_DTLB_MISS)				\
123 __PMC_EV(K8, DC_MISALIGNED_DATA_REFERENCE)				\
124 __PMC_EV(K8, DC_MICROARCHITECTURAL_LATE_CANCEL)				\
125 __PMC_EV(K8, DC_MICROARCHITECTURAL_EARLY_CANCEL)			\
126 __PMC_EV(K8, DC_ONE_BIT_ECC_ERROR)					\
127 __PMC_EV(K8, DC_DISPATCHED_PREFETCH_INSTRUCTIONS)			\
128 __PMC_EV(K8, DC_DCACHE_ACCESSES_BY_LOCKS)				\
129 __PMC_EV(K8, BU_CPU_CLK_UNHALTED)					\
130 __PMC_EV(K8, BU_INTERNAL_L2_REQUEST)					\
131 __PMC_EV(K8, BU_FILL_REQUEST_L2_MISS)					\
132 __PMC_EV(K8, BU_FILL_INTO_L2)						\
133 __PMC_EV(K8, IC_FETCH)							\
134 __PMC_EV(K8, IC_MISS)							\
135 __PMC_EV(K8, IC_REFILL_FROM_L2)						\
136 __PMC_EV(K8, IC_REFILL_FROM_SYSTEM)					\
137 __PMC_EV(K8, IC_L1_ITLB_MISS_AND_L2_ITLB_HIT)				\
138 __PMC_EV(K8, IC_L1_ITLB_MISS_AND_L2_ITLB_MISS)				\
139 __PMC_EV(K8, IC_MICROARCHITECTURAL_RESYNC_BY_SNOOP)			\
140 __PMC_EV(K8, IC_INSTRUCTION_FETCH_STALL)				\
141 __PMC_EV(K8, IC_RETURN_STACK_HIT)					\
142 __PMC_EV(K8, IC_RETURN_STACK_OVERFLOW)					\
143 __PMC_EV(K8, FR_RETIRED_X86_INSTRUCTIONS)				\
144 __PMC_EV(K8, FR_RETIRED_UOPS)						\
145 __PMC_EV(K8, FR_RETIRED_BRANCHES)					\
146 __PMC_EV(K8, FR_RETIRED_BRANCHES_MISPREDICTED)				\
147 __PMC_EV(K8, FR_RETIRED_TAKEN_BRANCHES)					\
148 __PMC_EV(K8, FR_RETIRED_TAKEN_BRANCHES_MISPREDICTED)			\
149 __PMC_EV(K8, FR_RETIRED_FAR_CONTROL_TRANSFERS)				\
150 __PMC_EV(K8, FR_RETIRED_RESYNCS)					\
151 __PMC_EV(K8, FR_RETIRED_NEAR_RETURNS)					\
152 __PMC_EV(K8, FR_RETIRED_NEAR_RETURNS_MISPREDICTED)			\
153 __PMC_EV(K8, FR_RETIRED_TAKEN_BRANCHES_MISPREDICTED_BY_ADDR_MISCOMPARE)	\
154 __PMC_EV(K8, FR_RETIRED_FPU_INSTRUCTIONS)				\
155 __PMC_EV(K8, FR_RETIRED_FASTPATH_DOUBLE_OP_INSTRUCTIONS)		\
156 __PMC_EV(K8, FR_INTERRUPTS_MASKED_CYCLES)				\
157 __PMC_EV(K8, FR_INTERRUPTS_MASKED_WHILE_PENDING_CYCLES)			\
158 __PMC_EV(K8, FR_TAKEN_HARDWARE_INTERRUPTS)				\
159 __PMC_EV(K8, FR_DECODER_EMPTY)						\
160 __PMC_EV(K8, FR_DISPATCH_STALLS)					\
161 __PMC_EV(K8, FR_DISPATCH_STALL_FROM_BRANCH_ABORT_TO_RETIRE)		\
162 __PMC_EV(K8, FR_DISPATCH_STALL_FOR_SERIALIZATION)			\
163 __PMC_EV(K8, FR_DISPATCH_STALL_FOR_SEGMENT_LOAD)			\
164 __PMC_EV(K8, FR_DISPATCH_STALL_WHEN_REORDER_BUFFER_IS_FULL)		\
165 __PMC_EV(K8, FR_DISPATCH_STALL_WHEN_RESERVATION_STATIONS_ARE_FULL)	\
166 __PMC_EV(K8, FR_DISPATCH_STALL_WHEN_FPU_IS_FULL)			\
167 __PMC_EV(K8, FR_DISPATCH_STALL_WHEN_LS_IS_FULL)				\
168 __PMC_EV(K8, FR_DISPATCH_STALL_WHEN_WAITING_FOR_ALL_TO_BE_QUIET)	\
169 __PMC_EV(K8, FR_DISPATCH_STALL_WHEN_FAR_XFER_OR_RESYNC_BRANCH_PENDING)	\
170 __PMC_EV(K8, FR_FPU_EXCEPTIONS)						\
171 __PMC_EV(K8, FR_NUMBER_OF_BREAKPOINTS_FOR_DR0)				\
172 __PMC_EV(K8, FR_NUMBER_OF_BREAKPOINTS_FOR_DR1)				\
173 __PMC_EV(K8, FR_NUMBER_OF_BREAKPOINTS_FOR_DR2)				\
174 __PMC_EV(K8, FR_NUMBER_OF_BREAKPOINTS_FOR_DR3)				\
175 __PMC_EV(K8, NB_MEMORY_CONTROLLER_PAGE_ACCESS_EVENT)			\
176 __PMC_EV(K8, NB_MEMORY_CONTROLLER_PAGE_TABLE_OVERFLOW)			\
177 __PMC_EV(K8, NB_MEMORY_CONTROLLER_DRAM_COMMAND_SLOTS_MISSED)		\
178 __PMC_EV(K8, NB_MEMORY_CONTROLLER_TURNAROUND)				\
179 __PMC_EV(K8, NB_MEMORY_CONTROLLER_BYPASS_SATURATION)			\
180 __PMC_EV(K8, NB_SIZED_COMMANDS)						\
181 __PMC_EV(K8, NB_PROBE_RESULT)						\
182 __PMC_EV(K8, NB_HT_BUS0_BANDWIDTH)					\
183 __PMC_EV(K8, NB_HT_BUS1_BANDWIDTH)					\
184 __PMC_EV(K8, NB_HT_BUS2_BANDWIDTH)
185 
186 #define	PMC_EV_K8_FIRST		PMC_EV_K8_FP_DISPATCHED_FPU_OPS
187 #define	PMC_EV_K8_LAST		PMC_EV_K8_NB_HT_BUS2_BANDWIDTH
188 
189 /*
190  * Events supported by Intel architectural fixed function counters,
191  * from the "Intel 64 and IA-32 Architectures Software Developer's
192  * Manual Volume 3B: System Programming Guide, Part 2", July 2008.
193  */
194 #define	__PMC_EV_IAF()							\
195 __PMC_EV(IAF, INSTR_RETIRED_ANY)					\
196 __PMC_EV(IAF, CPU_CLK_UNHALTED_CORE)					\
197 __PMC_EV(IAF, CPU_CLK_UNHALTED_REF)
198 
199 #define	PMC_EV_IAF_FIRST	PMC_EV_IAF_INSTR_RETIRED_ANY
200 #define	PMC_EV_IAF_LAST		PMC_EV_IAF_CPU_CLK_UNHALTED_REF
201 
202 #define	__PMC_EV_ALIAS_IAF()						\
203 __PMC_EV_ALIAS("instruction-retired",	IAF_INSTR_RETIRED_ANY)		\
204 __PMC_EV_ALIAS("unhalted-core-cycles",	IAF_CPU_CLK_UNHALTED_CORE)	\
205 __PMC_EV_ALIAS("unhalted-reference-cycles", IAF_CPU_CLK_UNHALTED_REF)
206 
207 
208 #define	PMC_EV_IAP_FIRST	PMC_EV_IAP_ARCH_BR_INS_RET
209 #define	PMC_EV_IAP_LAST		PMC_EV_IAP_EVENT_FDH_40H
210 
211 /*
212  * Map "architectural" event names to event ids.
213  */
214 #define	__PMC_EV_ALIAS_INTEL_ARCHITECTURAL()				\
215 __PMC_EV_ALIAS("branch-instruction-retired",	IAP_ARCH_BR_INS_RET)	\
216 __PMC_EV_ALIAS("branch-misses-retired",		IAP_ARCH_BR_MIS_RET)	\
217 __PMC_EV_ALIAS("instruction-retired",		IAP_ARCH_INS_RET)	\
218 __PMC_EV_ALIAS("llc-misses",			IAP_ARCH_LLC_MIS)	\
219 __PMC_EV_ALIAS("llc-reference",			IAP_ARCH_LLC_REF)	\
220 __PMC_EV_ALIAS("unhalted-reference-cycles",	IAP_ARCH_UNH_REF_CYC)	\
221 __PMC_EV_ALIAS("unhalted-core-cycles",		IAP_ARCH_UNH_COR_CYC)
222 
223 #define        __PMC_EV_UCP()                          \
224 	__PMC_EV(UCP, EVENT_0CH_04H_E)					   \
225 	__PMC_EV(UCP, EVENT_0CH_04H_F)					   \
226 	__PMC_EV(UCP, EVENT_0CH_04H_M)					   \
227 	__PMC_EV(UCP, EVENT_0CH_04H_S)					   \
228 	__PMC_EV(UCP, EVENT_0CH_08H_E)					   \
229 	__PMC_EV(UCP, EVENT_0CH_08H_F)					   \
230 	__PMC_EV(UCP, EVENT_0CH_08H_M)					   \
231 	__PMC_EV(UCP, EVENT_0CH_08H_S)					   \
232 
233 /*
234  * ARMv7 Events
235  */
236 
237 #define	__PMC_EV_ARMV7()			\
238 	__PMC_EV(ARMV7, EVENT_00H)		\
239 	__PMC_EV(ARMV7, EVENT_01H)		\
240 	__PMC_EV(ARMV7, EVENT_02H)		\
241 	__PMC_EV(ARMV7, EVENT_03H)		\
242 	__PMC_EV(ARMV7, EVENT_04H)		\
243 	__PMC_EV(ARMV7, EVENT_05H)		\
244 	__PMC_EV(ARMV7, EVENT_06H)		\
245 	__PMC_EV(ARMV7, EVENT_07H)		\
246 	__PMC_EV(ARMV7, EVENT_08H)		\
247 	__PMC_EV(ARMV7, EVENT_09H)		\
248 	__PMC_EV(ARMV7, EVENT_0AH)		\
249 	__PMC_EV(ARMV7, EVENT_0BH)		\
250 	__PMC_EV(ARMV7, EVENT_0CH)		\
251 	__PMC_EV(ARMV7, EVENT_0DH)		\
252 	__PMC_EV(ARMV7, EVENT_0EH)		\
253 	__PMC_EV(ARMV7, EVENT_0FH)		\
254 	__PMC_EV(ARMV7, EVENT_10H)		\
255 	__PMC_EV(ARMV7, EVENT_11H)		\
256 	__PMC_EV(ARMV7, EVENT_12H)		\
257 	__PMC_EV(ARMV7, EVENT_13H)		\
258 	__PMC_EV(ARMV7, EVENT_14H)		\
259 	__PMC_EV(ARMV7, EVENT_15H)		\
260 	__PMC_EV(ARMV7, EVENT_16H)		\
261 	__PMC_EV(ARMV7, EVENT_17H)		\
262 	__PMC_EV(ARMV7, EVENT_18H)		\
263 	__PMC_EV(ARMV7, EVENT_19H)		\
264 	__PMC_EV(ARMV7, EVENT_1AH)		\
265 	__PMC_EV(ARMV7, EVENT_1BH)		\
266 	__PMC_EV(ARMV7, EVENT_1CH)		\
267 	__PMC_EV(ARMV7, EVENT_1DH)		\
268 	__PMC_EV(ARMV7, EVENT_1EH)		\
269 	__PMC_EV(ARMV7, EVENT_1FH)		\
270 	__PMC_EV(ARMV7, EVENT_20H)		\
271 	__PMC_EV(ARMV7, EVENT_21H)		\
272 	__PMC_EV(ARMV7, EVENT_22H)		\
273 	__PMC_EV(ARMV7, EVENT_23H)		\
274 	__PMC_EV(ARMV7, EVENT_24H)		\
275 	__PMC_EV(ARMV7, EVENT_25H)		\
276 	__PMC_EV(ARMV7, EVENT_26H)		\
277 	__PMC_EV(ARMV7, EVENT_27H)		\
278 	__PMC_EV(ARMV7, EVENT_28H)		\
279 	__PMC_EV(ARMV7, EVENT_29H)		\
280 	__PMC_EV(ARMV7, EVENT_2AH)		\
281 	__PMC_EV(ARMV7, EVENT_2BH)		\
282 	__PMC_EV(ARMV7, EVENT_2CH)		\
283 	__PMC_EV(ARMV7, EVENT_2DH)		\
284 	__PMC_EV(ARMV7, EVENT_2EH)		\
285 	__PMC_EV(ARMV7, EVENT_2FH)		\
286 	__PMC_EV(ARMV7, EVENT_30H)		\
287 	__PMC_EV(ARMV7, EVENT_31H)		\
288 	__PMC_EV(ARMV7, EVENT_32H)		\
289 	__PMC_EV(ARMV7, EVENT_33H)		\
290 	__PMC_EV(ARMV7, EVENT_34H)		\
291 	__PMC_EV(ARMV7, EVENT_35H)		\
292 	__PMC_EV(ARMV7, EVENT_36H)		\
293 	__PMC_EV(ARMV7, EVENT_37H)		\
294 	__PMC_EV(ARMV7, EVENT_38H)		\
295 	__PMC_EV(ARMV7, EVENT_39H)		\
296 	__PMC_EV(ARMV7, EVENT_3AH)		\
297 	__PMC_EV(ARMV7, EVENT_3BH)		\
298 	__PMC_EV(ARMV7, EVENT_3CH)		\
299 	__PMC_EV(ARMV7, EVENT_3DH)		\
300 	__PMC_EV(ARMV7, EVENT_3EH)		\
301 	__PMC_EV(ARMV7, EVENT_3FH)		\
302 	__PMC_EV(ARMV7, EVENT_40H)		\
303 	__PMC_EV(ARMV7, EVENT_41H)		\
304 	__PMC_EV(ARMV7, EVENT_42H)		\
305 	__PMC_EV(ARMV7, EVENT_43H)		\
306 	__PMC_EV(ARMV7, EVENT_44H)		\
307 	__PMC_EV(ARMV7, EVENT_45H)		\
308 	__PMC_EV(ARMV7, EVENT_46H)		\
309 	__PMC_EV(ARMV7, EVENT_47H)		\
310 	__PMC_EV(ARMV7, EVENT_48H)		\
311 	__PMC_EV(ARMV7, EVENT_49H)		\
312 	__PMC_EV(ARMV7, EVENT_4AH)		\
313 	__PMC_EV(ARMV7, EVENT_4BH)		\
314 	__PMC_EV(ARMV7, EVENT_4CH)		\
315 	__PMC_EV(ARMV7, EVENT_4DH)		\
316 	__PMC_EV(ARMV7, EVENT_4EH)		\
317 	__PMC_EV(ARMV7, EVENT_4FH)		\
318 	__PMC_EV(ARMV7, EVENT_50H)		\
319 	__PMC_EV(ARMV7, EVENT_51H)		\
320 	__PMC_EV(ARMV7, EVENT_52H)		\
321 	__PMC_EV(ARMV7, EVENT_53H)		\
322 	__PMC_EV(ARMV7, EVENT_54H)		\
323 	__PMC_EV(ARMV7, EVENT_55H)		\
324 	__PMC_EV(ARMV7, EVENT_56H)		\
325 	__PMC_EV(ARMV7, EVENT_57H)		\
326 	__PMC_EV(ARMV7, EVENT_58H)		\
327 	__PMC_EV(ARMV7, EVENT_59H)		\
328 	__PMC_EV(ARMV7, EVENT_5AH)		\
329 	__PMC_EV(ARMV7, EVENT_5BH)		\
330 	__PMC_EV(ARMV7, EVENT_5CH)		\
331 	__PMC_EV(ARMV7, EVENT_5DH)		\
332 	__PMC_EV(ARMV7, EVENT_5EH)		\
333 	__PMC_EV(ARMV7, EVENT_5FH)		\
334 	__PMC_EV(ARMV7, EVENT_60H)		\
335 	__PMC_EV(ARMV7, EVENT_61H)		\
336 	__PMC_EV(ARMV7, EVENT_62H)		\
337 	__PMC_EV(ARMV7, EVENT_63H)		\
338 	__PMC_EV(ARMV7, EVENT_64H)		\
339 	__PMC_EV(ARMV7, EVENT_65H)		\
340 	__PMC_EV(ARMV7, EVENT_66H)		\
341 	__PMC_EV(ARMV7, EVENT_67H)		\
342 	__PMC_EV(ARMV7, EVENT_68H)		\
343 	__PMC_EV(ARMV7, EVENT_69H)		\
344 	__PMC_EV(ARMV7, EVENT_6AH)		\
345 	__PMC_EV(ARMV7, EVENT_6BH)		\
346 	__PMC_EV(ARMV7, EVENT_6CH)		\
347 	__PMC_EV(ARMV7, EVENT_6DH)		\
348 	__PMC_EV(ARMV7, EVENT_6EH)		\
349 	__PMC_EV(ARMV7, EVENT_6FH)		\
350 	__PMC_EV(ARMV7, EVENT_70H)		\
351 	__PMC_EV(ARMV7, EVENT_71H)		\
352 	__PMC_EV(ARMV7, EVENT_72H)		\
353 	__PMC_EV(ARMV7, EVENT_73H)		\
354 	__PMC_EV(ARMV7, EVENT_74H)		\
355 	__PMC_EV(ARMV7, EVENT_75H)		\
356 	__PMC_EV(ARMV7, EVENT_76H)		\
357 	__PMC_EV(ARMV7, EVENT_77H)		\
358 	__PMC_EV(ARMV7, EVENT_78H)		\
359 	__PMC_EV(ARMV7, EVENT_79H)		\
360 	__PMC_EV(ARMV7, EVENT_7AH)		\
361 	__PMC_EV(ARMV7, EVENT_7BH)		\
362 	__PMC_EV(ARMV7, EVENT_7CH)		\
363 	__PMC_EV(ARMV7, EVENT_7DH)		\
364 	__PMC_EV(ARMV7, EVENT_7EH)		\
365 	__PMC_EV(ARMV7, EVENT_7FH)		\
366 	__PMC_EV(ARMV7, EVENT_80H)		\
367 	__PMC_EV(ARMV7, EVENT_81H)		\
368 	__PMC_EV(ARMV7, EVENT_82H)		\
369 	__PMC_EV(ARMV7, EVENT_83H)		\
370 	__PMC_EV(ARMV7, EVENT_84H)		\
371 	__PMC_EV(ARMV7, EVENT_85H)		\
372 	__PMC_EV(ARMV7, EVENT_86H)		\
373 	__PMC_EV(ARMV7, EVENT_87H)		\
374 	__PMC_EV(ARMV7, EVENT_88H)		\
375 	__PMC_EV(ARMV7, EVENT_89H)		\
376 	__PMC_EV(ARMV7, EVENT_8AH)		\
377 	__PMC_EV(ARMV7, EVENT_8BH)		\
378 	__PMC_EV(ARMV7, EVENT_8CH)		\
379 	__PMC_EV(ARMV7, EVENT_8DH)		\
380 	__PMC_EV(ARMV7, EVENT_8EH)		\
381 	__PMC_EV(ARMV7, EVENT_8FH)		\
382 	__PMC_EV(ARMV7, EVENT_90H)		\
383 	__PMC_EV(ARMV7, EVENT_91H)		\
384 	__PMC_EV(ARMV7, EVENT_92H)		\
385 	__PMC_EV(ARMV7, EVENT_93H)		\
386 	__PMC_EV(ARMV7, EVENT_94H)		\
387 	__PMC_EV(ARMV7, EVENT_95H)		\
388 	__PMC_EV(ARMV7, EVENT_96H)		\
389 	__PMC_EV(ARMV7, EVENT_97H)		\
390 	__PMC_EV(ARMV7, EVENT_98H)		\
391 	__PMC_EV(ARMV7, EVENT_99H)		\
392 	__PMC_EV(ARMV7, EVENT_9AH)		\
393 	__PMC_EV(ARMV7, EVENT_9BH)		\
394 	__PMC_EV(ARMV7, EVENT_9CH)		\
395 	__PMC_EV(ARMV7, EVENT_9DH)		\
396 	__PMC_EV(ARMV7, EVENT_9EH)		\
397 	__PMC_EV(ARMV7, EVENT_9FH)		\
398 	__PMC_EV(ARMV7, EVENT_A0H)		\
399 	__PMC_EV(ARMV7, EVENT_A1H)		\
400 	__PMC_EV(ARMV7, EVENT_A2H)		\
401 	__PMC_EV(ARMV7, EVENT_A3H)		\
402 	__PMC_EV(ARMV7, EVENT_A4H)		\
403 	__PMC_EV(ARMV7, EVENT_A5H)		\
404 	__PMC_EV(ARMV7, EVENT_A6H)		\
405 	__PMC_EV(ARMV7, EVENT_A7H)		\
406 	__PMC_EV(ARMV7, EVENT_A8H)		\
407 	__PMC_EV(ARMV7, EVENT_A9H)		\
408 	__PMC_EV(ARMV7, EVENT_AAH)		\
409 	__PMC_EV(ARMV7, EVENT_ABH)		\
410 	__PMC_EV(ARMV7, EVENT_ACH)		\
411 	__PMC_EV(ARMV7, EVENT_ADH)		\
412 	__PMC_EV(ARMV7, EVENT_AEH)		\
413 	__PMC_EV(ARMV7, EVENT_AFH)		\
414 	__PMC_EV(ARMV7, EVENT_B0H)		\
415 	__PMC_EV(ARMV7, EVENT_B1H)		\
416 	__PMC_EV(ARMV7, EVENT_B2H)		\
417 	__PMC_EV(ARMV7, EVENT_B3H)		\
418 	__PMC_EV(ARMV7, EVENT_B4H)		\
419 	__PMC_EV(ARMV7, EVENT_B5H)		\
420 	__PMC_EV(ARMV7, EVENT_B6H)		\
421 	__PMC_EV(ARMV7, EVENT_B7H)		\
422 	__PMC_EV(ARMV7, EVENT_B8H)		\
423 	__PMC_EV(ARMV7, EVENT_B9H)		\
424 	__PMC_EV(ARMV7, EVENT_BAH)		\
425 	__PMC_EV(ARMV7, EVENT_BBH)		\
426 	__PMC_EV(ARMV7, EVENT_BCH)		\
427 	__PMC_EV(ARMV7, EVENT_BDH)		\
428 	__PMC_EV(ARMV7, EVENT_BEH)		\
429 	__PMC_EV(ARMV7, EVENT_BFH)		\
430 	__PMC_EV(ARMV7, EVENT_C0H)		\
431 	__PMC_EV(ARMV7, EVENT_C1H)		\
432 	__PMC_EV(ARMV7, EVENT_C2H)		\
433 	__PMC_EV(ARMV7, EVENT_C3H)		\
434 	__PMC_EV(ARMV7, EVENT_C4H)		\
435 	__PMC_EV(ARMV7, EVENT_C5H)		\
436 	__PMC_EV(ARMV7, EVENT_C6H)		\
437 	__PMC_EV(ARMV7, EVENT_C7H)		\
438 	__PMC_EV(ARMV7, EVENT_C8H)		\
439 	__PMC_EV(ARMV7, EVENT_C9H)		\
440 	__PMC_EV(ARMV7, EVENT_CAH)		\
441 	__PMC_EV(ARMV7, EVENT_CBH)		\
442 	__PMC_EV(ARMV7, EVENT_CCH)		\
443 	__PMC_EV(ARMV7, EVENT_CDH)		\
444 	__PMC_EV(ARMV7, EVENT_CEH)		\
445 	__PMC_EV(ARMV7, EVENT_CFH)		\
446 	__PMC_EV(ARMV7, EVENT_D0H)		\
447 	__PMC_EV(ARMV7, EVENT_D1H)		\
448 	__PMC_EV(ARMV7, EVENT_D2H)		\
449 	__PMC_EV(ARMV7, EVENT_D3H)		\
450 	__PMC_EV(ARMV7, EVENT_D4H)		\
451 	__PMC_EV(ARMV7, EVENT_D5H)		\
452 	__PMC_EV(ARMV7, EVENT_D6H)		\
453 	__PMC_EV(ARMV7, EVENT_D7H)		\
454 	__PMC_EV(ARMV7, EVENT_D8H)		\
455 	__PMC_EV(ARMV7, EVENT_D9H)		\
456 	__PMC_EV(ARMV7, EVENT_DAH)		\
457 	__PMC_EV(ARMV7, EVENT_DBH)		\
458 	__PMC_EV(ARMV7, EVENT_DCH)		\
459 	__PMC_EV(ARMV7, EVENT_DDH)		\
460 	__PMC_EV(ARMV7, EVENT_DEH)		\
461 	__PMC_EV(ARMV7, EVENT_DFH)		\
462 	__PMC_EV(ARMV7, EVENT_E0H)		\
463 	__PMC_EV(ARMV7, EVENT_E1H)		\
464 	__PMC_EV(ARMV7, EVENT_E2H)		\
465 	__PMC_EV(ARMV7, EVENT_E3H)		\
466 	__PMC_EV(ARMV7, EVENT_E4H)		\
467 	__PMC_EV(ARMV7, EVENT_E5H)		\
468 	__PMC_EV(ARMV7, EVENT_E6H)		\
469 	__PMC_EV(ARMV7, EVENT_E7H)		\
470 	__PMC_EV(ARMV7, EVENT_E8H)		\
471 	__PMC_EV(ARMV7, EVENT_E9H)		\
472 	__PMC_EV(ARMV7, EVENT_EAH)		\
473 	__PMC_EV(ARMV7, EVENT_EBH)		\
474 	__PMC_EV(ARMV7, EVENT_ECH)		\
475 	__PMC_EV(ARMV7, EVENT_EDH)		\
476 	__PMC_EV(ARMV7, EVENT_EEH)		\
477 	__PMC_EV(ARMV7, EVENT_EFH)		\
478 	__PMC_EV(ARMV7, EVENT_F0H)		\
479 	__PMC_EV(ARMV7, EVENT_F1H)		\
480 	__PMC_EV(ARMV7, EVENT_F2H)		\
481 	__PMC_EV(ARMV7, EVENT_F3H)		\
482 	__PMC_EV(ARMV7, EVENT_F4H)		\
483 	__PMC_EV(ARMV7, EVENT_F5H)		\
484 	__PMC_EV(ARMV7, EVENT_F6H)		\
485 	__PMC_EV(ARMV7, EVENT_F7H)		\
486 	__PMC_EV(ARMV7, EVENT_F8H)		\
487 	__PMC_EV(ARMV7, EVENT_F9H)		\
488 	__PMC_EV(ARMV7, EVENT_FAH)		\
489 	__PMC_EV(ARMV7, EVENT_FBH)		\
490 	__PMC_EV(ARMV7, EVENT_FCH)		\
491 	__PMC_EV(ARMV7, EVENT_FDH)		\
492 	__PMC_EV(ARMV7, EVENT_FEH)		\
493 	__PMC_EV(ARMV7, EVENT_FFH)
494 
495 #define	PMC_EV_ARMV7_FIRST	PMC_EV_ARMV7_EVENT_00H
496 #define	PMC_EV_ARMV7_LAST	PMC_EV_ARMV7_EVENT_FFH
497 
498 #define	__PMC_EV_ALIAS_ARMV7_COMMON()					\
499 	__PMC_EV_ALIAS("PMNC_SW_INCR",		ARMV7_EVENT_00H)	\
500 	__PMC_EV_ALIAS("L1_ICACHE_REFILL",	ARMV7_EVENT_01H)	\
501 	__PMC_EV_ALIAS("ITLB_REFILL",		ARMV7_EVENT_02H)	\
502 	__PMC_EV_ALIAS("L1_DCACHE_REFILL",	ARMV7_EVENT_03H)	\
503 	__PMC_EV_ALIAS("L1_DCACHE_ACCESS",	ARMV7_EVENT_04H)	\
504 	__PMC_EV_ALIAS("DTLB_REFILL",		ARMV7_EVENT_05H)	\
505 	__PMC_EV_ALIAS("MEM_READ",		ARMV7_EVENT_06H)	\
506 	__PMC_EV_ALIAS("MEM_WRITE",		ARMV7_EVENT_07H)	\
507 	__PMC_EV_ALIAS("EXC_TAKEN",		ARMV7_EVENT_09H)	\
508 	__PMC_EV_ALIAS("EXC_EXECUTED",		ARMV7_EVENT_0AH)	\
509 	__PMC_EV_ALIAS("CID_WRITE",		ARMV7_EVENT_0BH)	\
510 	__PMC_EV_ALIAS("PC_WRITE",		ARMV7_EVENT_0CH)	\
511 	__PMC_EV_ALIAS("PC_IMM_BRANCH",		ARMV7_EVENT_0DH)	\
512 	__PMC_EV_ALIAS("MEM_UNALIGNED_ACCESS",	ARMV7_EVENT_0FH)	\
513 	__PMC_EV_ALIAS("PC_BRANCH_MIS_PRED",	ARMV7_EVENT_10H)	\
514 	__PMC_EV_ALIAS("CLOCK_CYCLES",		ARMV7_EVENT_11H)	\
515 	__PMC_EV_ALIAS("PC_BRANCH_PRED",	ARMV7_EVENT_12H)
516 
517 #define	__PMC_EV_ALIAS_ARMV7_COMMON_A8()				\
518 	__PMC_EV_ALIAS_ARMV7_COMMON()					\
519 	__PMC_EV_ALIAS("INSTR_EXECUTED",	ARMV7_EVENT_08H)	\
520 	__PMC_EV_ALIAS("PC_PROC_RETURN",	ARMV7_EVENT_0EH)	\
521 	__PMC_EV_ALIAS("MEM_ACCESS",		ARMV7_EVENT_13H)	\
522 	__PMC_EV_ALIAS("L1_ICACHE_ACCESS",	ARMV7_EVENT_14H)	\
523 	__PMC_EV_ALIAS("L1_DCACHE_WB",		ARMV7_EVENT_15H)	\
524 	__PMC_EV_ALIAS("L2_CACHE_ACCESS",	ARMV7_EVENT_16H)	\
525 	__PMC_EV_ALIAS("L2_CACHE_REFILL",	ARMV7_EVENT_17H)	\
526 	__PMC_EV_ALIAS("L2_CACHE_WB",		ARMV7_EVENT_18H)	\
527 	__PMC_EV_ALIAS("BUS_ACCESS",		ARMV7_EVENT_19H)	\
528 	__PMC_EV_ALIAS("MEM_ERROR",		ARMV7_EVENT_1AH)	\
529 	__PMC_EV_ALIAS("INSTR_SPEC",		ARMV7_EVENT_1BH)	\
530 	__PMC_EV_ALIAS("TTBR_WRITE",		ARMV7_EVENT_1CH)	\
531 	__PMC_EV_ALIAS("BUS_CYCLES",		ARMV7_EVENT_1DH)	\
532 	__PMC_EV_ALIAS("CPU_CYCLES",		ARMV7_EVENT_FFH)
533 
534 #define	__PMC_EV_ALIAS_ARMV7_CORTEX_A8()				 \
535 	__PMC_EV_ALIAS_ARMV7_COMMON_A8()				 \
536 	__PMC_EV_ALIAS("WRITE_BUF_FULL",		ARMV7_EVENT_40H) \
537 	__PMC_EV_ALIAS("L2_STORE_MERGED",		ARMV7_EVENT_41H) \
538 	__PMC_EV_ALIAS("L2_STORE_BUFFERABLE",		ARMV7_EVENT_42H) \
539 	__PMC_EV_ALIAS("L2_ACCESS",			ARMV7_EVENT_43H) \
540 	__PMC_EV_ALIAS("L2_CACHE_MISS",			ARMV7_EVENT_44H) \
541 	__PMC_EV_ALIAS("AXI_READ",			ARMV7_EVENT_45H) \
542 	__PMC_EV_ALIAS("AXI_WRITE",			ARMV7_EVENT_46H) \
543 	__PMC_EV_ALIAS("MEM_REPLAY_EVT",		ARMV7_EVENT_47H) \
544 	__PMC_EV_ALIAS("MEM_UNALIGNED_ACCESS_REPLAY",	ARMV7_EVENT_48H) \
545 	__PMC_EV_ALIAS("L1_DCACHE_HASH_MISS",		ARMV7_EVENT_49H) \
546 	__PMC_EV_ALIAS("L1_ICACHE_HASH_MISS",		ARMV7_EVENT_4AH) \
547 	__PMC_EV_ALIAS("L1_CACHE_PAGECOL_ALIAS",	ARMV7_EVENT_4BH) \
548 	__PMC_EV_ALIAS("L1_DCACHE_NEON_ACCESS",		ARMV7_EVENT_4CH) \
549 	__PMC_EV_ALIAS("L1_DCACHE_NEON_CACHEABLE",	ARMV7_EVENT_4DH) \
550 	__PMC_EV_ALIAS("L2_CACHE_NEON_MEM_ACCESS",	ARMV7_EVENT_4EH) \
551 	__PMC_EV_ALIAS("L2_CACHE_NEON_HIT",		ARMV7_EVENT_4FH) \
552 	__PMC_EV_ALIAS("L1_CACHE_ACCESS_NOCP15",	ARMV7_EVENT_50H) \
553 	__PMC_EV_ALIAS("RET_STACK_MISPREDICT",		ARMV7_EVENT_51H) \
554 	__PMC_EV_ALIAS("BRANCH_DIR_MISPREDICT",		ARMV7_EVENT_52H) \
555 	__PMC_EV_ALIAS("PRED_BRANCH_PRED_TAKEN",	ARMV7_EVENT_53H) \
556 	__PMC_EV_ALIAS("PRED_BRANCH_EXEC_TAKEN",	ARMV7_EVENT_54H) \
557 	__PMC_EV_ALIAS("OPS_ISSUED",			ARMV7_EVENT_55H) \
558 	__PMC_EV_ALIAS("CYCLES_NO_INSTRUCTION",		ARMV7_EVENT_56H) \
559 	__PMC_EV_ALIAS("INSTRUCTIONS_ISSUED_CYCLE",	ARMV7_EVENT_57H) \
560 	__PMC_EV_ALIAS("CYCLES_STALLED_NEON_MRC",	ARMV7_EVENT_58H) \
561 	__PMC_EV_ALIAS("CYCLES_STALLED_NEON_FULLQ",	ARMV7_EVENT_59H) \
562 	__PMC_EV_ALIAS("CYCLES_NONIDLE_NEON_INT",	ARMV7_EVENT_5AH) \
563 	__PMC_EV_ALIAS("PMUEXTIN0_EVT",			ARMV7_EVENT_70H) \
564 	__PMC_EV_ALIAS("PMUEXTIN1_EVT",			ARMV7_EVENT_71H) \
565 	__PMC_EV_ALIAS("PMUEXTIN_EVT",			ARMV7_EVENT_72H)
566 #define	PMC_EV_ARMV7_CORTEX_A8_FIRST	PMC_EV_ARMV7_PMNC_SW_INCR
567 #define	PMC_EV_ARMV7_CORTEX_A8_LAST	PMC_EV_ARMV7_PMUEXTIN_EVT
568 
569 #define	__PMC_EV_ALIAS_ARMV7_CORTEX_A9()					\
570 	__PMC_EV_ALIAS_ARMV7_COMMON()						\
571 	__PMC_EV_ALIAS("JAVA_BYTECODE",			ARMV7_EVENT_40H)	\
572 	__PMC_EV_ALIAS("SOFTWARE_JAVA_BYTECODE",	ARMV7_EVENT_41H)	\
573 	__PMC_EV_ALIAS("JAZELLE_BACKWARD_BRANCH",	ARMV7_EVENT_42H)	\
574 	__PMC_EV_ALIAS("COHERENT_LINEFILL_MISSC",	ARMV7_EVENT_50H)	\
575 	__PMC_EV_ALIAS("COHERENT_LINEFILL_HITC",	ARMV7_EVENT_51H)	\
576 	__PMC_EV_ALIAS("INSTR_CACHE_DEPENDENT_STALL",	ARMV7_EVENT_60H)	\
577 	__PMC_EV_ALIAS("DATA_CACHE_DEPENDENT_STALL",	ARMV7_EVENT_61H)	\
578 	__PMC_EV_ALIAS("MAIN_TLB_MISS_STALL",		ARMV7_EVENT_62H)	\
579 	__PMC_EV_ALIAS("STREX_PASSED",			ARMV7_EVENT_63H)	\
580 	__PMC_EV_ALIAS("STREX_FAILED",			ARMV7_EVENT_64H)	\
581 	__PMC_EV_ALIAS("DATA_EVICTION",			ARMV7_EVENT_65H)	\
582 	__PMC_EV_ALIAS("ISSUE_DNOT_DISPATCH_ANY_INSTR",	ARMV7_EVENT_66H)	\
583 	__PMC_EV_ALIAS("ISSUE_IS_EMPTY",		ARMV7_EVENT_67H)	\
584 	__PMC_EV_ALIAS("INSTR_RENAMED",			ARMV7_EVENT_68H)	\
585 	__PMC_EV_ALIAS("PREDICTABLE_FUNCTION_RETURN",	ARMV7_EVENT_6EH)	\
586 	__PMC_EV_ALIAS("MAIN_EXECUTION_UNIT_PIPE",	ARMV7_EVENT_70H)	\
587 	__PMC_EV_ALIAS("SECOND_EXECUTION_UNIT_PIPE",	ARMV7_EVENT_71H)	\
588 	__PMC_EV_ALIAS("LOAD_STORE_PIPE",		ARMV7_EVENT_72H)	\
589 	__PMC_EV_ALIAS("FLOATING_POINT_INSTR_RENAMED",	ARMV7_EVENT_73H)	\
590 	__PMC_EV_ALIAS("NEON_INSTRS_RENAMED",		ARMV7_EVENT_74H)	\
591 	__PMC_EV_ALIAS("PLD_STALL",			ARMV7_EVENT_80H)	\
592 	__PMC_EV_ALIAS("WRITE_STALL",			ARMV7_EVENT_81H)	\
593 	__PMC_EV_ALIAS("INSTR_MAIN_TLB_MISS_STALL",	ARMV7_EVENT_82H)	\
594 	__PMC_EV_ALIAS("DATA_MAIN_TLB_MISS_STALL",	ARMV7_EVENT_83H)	\
595 	__PMC_EV_ALIAS("INSTR_MICRO_TLB_MISS_STALL",	ARMV7_EVENT_84H)	\
596 	__PMC_EV_ALIAS("DATA_MICRO_TLB_MISS_STALL",	ARMV7_EVENT_85H)	\
597 	__PMC_EV_ALIAS("DMB_STALL",			ARMV7_EVENT_86H)	\
598 	__PMC_EV_ALIAS("INTEGER_CORE_CLOCK_ENABLED",	ARMV7_EVENT_8AH)	\
599 	__PMC_EV_ALIAS("DATA_ENGINE_CLOCK_ENABLED",	ARMV7_EVENT_8BH)	\
600 	__PMC_EV_ALIAS("ISB",				ARMV7_EVENT_90H)	\
601 	__PMC_EV_ALIAS("DSB",				ARMV7_EVENT_91H)	\
602 	__PMC_EV_ALIAS("DMB",				ARMV7_EVENT_92H)	\
603 	__PMC_EV_ALIAS("EXTERNAL_INTERRUPT",		ARMV7_EVENT_93H)	\
604 	__PMC_EV_ALIAS("PLE_CACHE_LINE_REQ_COMPLETED",	ARMV7_EVENT_A0H)	\
605 	__PMC_EV_ALIAS("PLE_CACHE_LINE_REQ_SKIPPED",	ARMV7_EVENT_A1H)	\
606 	__PMC_EV_ALIAS("PLE_FIFO_FLUSH",		ARMV7_EVENT_A2H)	\
607 	__PMC_EV_ALIAS("PLE_REQUEST_COMPLETED",		ARMV7_EVENT_A3H)	\
608 	__PMC_EV_ALIAS("PLE_FIFO_OVERFLOW",		ARMV7_EVENT_A4H)	\
609 	__PMC_EV_ALIAS("PLE_REQUEST_PROGRAMMED",	ARMV7_EVENT_A5H)
610 
611 /*
612  * ARMv8 Events
613  */
614 
615 #define	__PMC_EV_ARMV8()			\
616 	__PMC_EV(ARMV8, EVENT_00H)		\
617 	__PMC_EV(ARMV8, EVENT_01H)		\
618 	__PMC_EV(ARMV8, EVENT_02H)		\
619 	__PMC_EV(ARMV8, EVENT_03H)		\
620 	__PMC_EV(ARMV8, EVENT_04H)		\
621 	__PMC_EV(ARMV8, EVENT_05H)		\
622 	__PMC_EV(ARMV8, EVENT_06H)		\
623 	__PMC_EV(ARMV8, EVENT_07H)		\
624 	__PMC_EV(ARMV8, EVENT_08H)		\
625 	__PMC_EV(ARMV8, EVENT_09H)		\
626 	__PMC_EV(ARMV8, EVENT_0AH)		\
627 	__PMC_EV(ARMV8, EVENT_0BH)		\
628 	__PMC_EV(ARMV8, EVENT_0CH)		\
629 	__PMC_EV(ARMV8, EVENT_0DH)		\
630 	__PMC_EV(ARMV8, EVENT_0EH)		\
631 	__PMC_EV(ARMV8, EVENT_0FH)		\
632 	__PMC_EV(ARMV8, EVENT_10H)		\
633 	__PMC_EV(ARMV8, EVENT_11H)		\
634 	__PMC_EV(ARMV8, EVENT_12H)		\
635 	__PMC_EV(ARMV8, EVENT_13H)		\
636 	__PMC_EV(ARMV8, EVENT_14H)		\
637 	__PMC_EV(ARMV8, EVENT_15H)		\
638 	__PMC_EV(ARMV8, EVENT_16H)		\
639 	__PMC_EV(ARMV8, EVENT_17H)		\
640 	__PMC_EV(ARMV8, EVENT_18H)		\
641 	__PMC_EV(ARMV8, EVENT_19H)		\
642 	__PMC_EV(ARMV8, EVENT_1AH)		\
643 	__PMC_EV(ARMV8, EVENT_1BH)		\
644 	__PMC_EV(ARMV8, EVENT_1CH)		\
645 	__PMC_EV(ARMV8, EVENT_1DH)		\
646 	__PMC_EV(ARMV8, EVENT_1EH)		\
647 	__PMC_EV(ARMV8, EVENT_1FH)		\
648 	__PMC_EV(ARMV8, EVENT_20H)		\
649 	__PMC_EV(ARMV8, EVENT_21H)		\
650 	__PMC_EV(ARMV8, EVENT_22H)		\
651 	__PMC_EV(ARMV8, EVENT_23H)		\
652 	__PMC_EV(ARMV8, EVENT_24H)		\
653 	__PMC_EV(ARMV8, EVENT_25H)		\
654 	__PMC_EV(ARMV8, EVENT_26H)		\
655 	__PMC_EV(ARMV8, EVENT_27H)		\
656 	__PMC_EV(ARMV8, EVENT_28H)		\
657 	__PMC_EV(ARMV8, EVENT_29H)		\
658 	__PMC_EV(ARMV8, EVENT_2AH)		\
659 	__PMC_EV(ARMV8, EVENT_2BH)		\
660 	__PMC_EV(ARMV8, EVENT_2CH)		\
661 	__PMC_EV(ARMV8, EVENT_2DH)		\
662 	__PMC_EV(ARMV8, EVENT_2EH)		\
663 	__PMC_EV(ARMV8, EVENT_2FH)		\
664 	__PMC_EV(ARMV8, EVENT_30H)		\
665 	__PMC_EV(ARMV8, EVENT_31H)		\
666 	__PMC_EV(ARMV8, EVENT_32H)		\
667 	__PMC_EV(ARMV8, EVENT_33H)		\
668 	__PMC_EV(ARMV8, EVENT_34H)		\
669 	__PMC_EV(ARMV8, EVENT_35H)		\
670 	__PMC_EV(ARMV8, EVENT_36H)		\
671 	__PMC_EV(ARMV8, EVENT_37H)		\
672 	__PMC_EV(ARMV8, EVENT_38H)		\
673 	__PMC_EV(ARMV8, EVENT_39H)		\
674 	__PMC_EV(ARMV8, EVENT_3AH)		\
675 	__PMC_EV(ARMV8, EVENT_3BH)		\
676 	__PMC_EV(ARMV8, EVENT_3CH)		\
677 	__PMC_EV(ARMV8, EVENT_3DH)		\
678 	__PMC_EV(ARMV8, EVENT_3EH)		\
679 	__PMC_EV(ARMV8, EVENT_3FH)		\
680 	__PMC_EV(ARMV8, EVENT_40H)		\
681 	__PMC_EV(ARMV8, EVENT_41H)		\
682 	__PMC_EV(ARMV8, EVENT_42H)		\
683 	__PMC_EV(ARMV8, EVENT_43H)		\
684 	__PMC_EV(ARMV8, EVENT_44H)		\
685 	__PMC_EV(ARMV8, EVENT_45H)		\
686 	__PMC_EV(ARMV8, EVENT_46H)		\
687 	__PMC_EV(ARMV8, EVENT_47H)		\
688 	__PMC_EV(ARMV8, EVENT_48H)		\
689 	__PMC_EV(ARMV8, EVENT_49H)		\
690 	__PMC_EV(ARMV8, EVENT_4AH)		\
691 	__PMC_EV(ARMV8, EVENT_4BH)		\
692 	__PMC_EV(ARMV8, EVENT_4CH)		\
693 	__PMC_EV(ARMV8, EVENT_4DH)		\
694 	__PMC_EV(ARMV8, EVENT_4EH)		\
695 	__PMC_EV(ARMV8, EVENT_4FH)		\
696 	__PMC_EV(ARMV8, EVENT_50H)		\
697 	__PMC_EV(ARMV8, EVENT_51H)		\
698 	__PMC_EV(ARMV8, EVENT_52H)		\
699 	__PMC_EV(ARMV8, EVENT_53H)		\
700 	__PMC_EV(ARMV8, EVENT_54H)		\
701 	__PMC_EV(ARMV8, EVENT_55H)		\
702 	__PMC_EV(ARMV8, EVENT_56H)		\
703 	__PMC_EV(ARMV8, EVENT_57H)		\
704 	__PMC_EV(ARMV8, EVENT_58H)		\
705 	__PMC_EV(ARMV8, EVENT_59H)		\
706 	__PMC_EV(ARMV8, EVENT_5AH)		\
707 	__PMC_EV(ARMV8, EVENT_5BH)		\
708 	__PMC_EV(ARMV8, EVENT_5CH)		\
709 	__PMC_EV(ARMV8, EVENT_5DH)		\
710 	__PMC_EV(ARMV8, EVENT_5EH)		\
711 	__PMC_EV(ARMV8, EVENT_5FH)		\
712 	__PMC_EV(ARMV8, EVENT_60H)		\
713 	__PMC_EV(ARMV8, EVENT_61H)		\
714 	__PMC_EV(ARMV8, EVENT_62H)		\
715 	__PMC_EV(ARMV8, EVENT_63H)		\
716 	__PMC_EV(ARMV8, EVENT_64H)		\
717 	__PMC_EV(ARMV8, EVENT_65H)		\
718 	__PMC_EV(ARMV8, EVENT_66H)		\
719 	__PMC_EV(ARMV8, EVENT_67H)		\
720 	__PMC_EV(ARMV8, EVENT_68H)		\
721 	__PMC_EV(ARMV8, EVENT_69H)		\
722 	__PMC_EV(ARMV8, EVENT_6AH)		\
723 	__PMC_EV(ARMV8, EVENT_6BH)		\
724 	__PMC_EV(ARMV8, EVENT_6CH)		\
725 	__PMC_EV(ARMV8, EVENT_6DH)		\
726 	__PMC_EV(ARMV8, EVENT_6EH)		\
727 	__PMC_EV(ARMV8, EVENT_6FH)		\
728 	__PMC_EV(ARMV8, EVENT_70H)		\
729 	__PMC_EV(ARMV8, EVENT_71H)		\
730 	__PMC_EV(ARMV8, EVENT_72H)		\
731 	__PMC_EV(ARMV8, EVENT_73H)		\
732 	__PMC_EV(ARMV8, EVENT_74H)		\
733 	__PMC_EV(ARMV8, EVENT_75H)		\
734 	__PMC_EV(ARMV8, EVENT_76H)		\
735 	__PMC_EV(ARMV8, EVENT_77H)		\
736 	__PMC_EV(ARMV8, EVENT_78H)		\
737 	__PMC_EV(ARMV8, EVENT_79H)		\
738 	__PMC_EV(ARMV8, EVENT_7AH)		\
739 	__PMC_EV(ARMV8, EVENT_7BH)		\
740 	__PMC_EV(ARMV8, EVENT_7CH)		\
741 	__PMC_EV(ARMV8, EVENT_7DH)		\
742 	__PMC_EV(ARMV8, EVENT_7EH)		\
743 	__PMC_EV(ARMV8, EVENT_7FH)		\
744 	__PMC_EV(ARMV8, EVENT_80H)		\
745 	__PMC_EV(ARMV8, EVENT_81H)		\
746 	__PMC_EV(ARMV8, EVENT_82H)		\
747 	__PMC_EV(ARMV8, EVENT_83H)		\
748 	__PMC_EV(ARMV8, EVENT_84H)		\
749 	__PMC_EV(ARMV8, EVENT_85H)		\
750 	__PMC_EV(ARMV8, EVENT_86H)		\
751 	__PMC_EV(ARMV8, EVENT_87H)		\
752 	__PMC_EV(ARMV8, EVENT_88H)		\
753 	__PMC_EV(ARMV8, EVENT_89H)		\
754 	__PMC_EV(ARMV8, EVENT_8AH)		\
755 	__PMC_EV(ARMV8, EVENT_8BH)		\
756 	__PMC_EV(ARMV8, EVENT_8CH)		\
757 	__PMC_EV(ARMV8, EVENT_8DH)		\
758 	__PMC_EV(ARMV8, EVENT_8EH)		\
759 	__PMC_EV(ARMV8, EVENT_8FH)		\
760 	__PMC_EV(ARMV8, EVENT_90H)		\
761 	__PMC_EV(ARMV8, EVENT_91H)		\
762 	__PMC_EV(ARMV8, EVENT_92H)		\
763 	__PMC_EV(ARMV8, EVENT_93H)		\
764 	__PMC_EV(ARMV8, EVENT_94H)		\
765 	__PMC_EV(ARMV8, EVENT_95H)		\
766 	__PMC_EV(ARMV8, EVENT_96H)		\
767 	__PMC_EV(ARMV8, EVENT_97H)		\
768 	__PMC_EV(ARMV8, EVENT_98H)		\
769 	__PMC_EV(ARMV8, EVENT_99H)		\
770 	__PMC_EV(ARMV8, EVENT_9AH)		\
771 	__PMC_EV(ARMV8, EVENT_9BH)		\
772 	__PMC_EV(ARMV8, EVENT_9CH)		\
773 	__PMC_EV(ARMV8, EVENT_9DH)		\
774 	__PMC_EV(ARMV8, EVENT_9EH)		\
775 	__PMC_EV(ARMV8, EVENT_9FH)		\
776 	__PMC_EV(ARMV8, EVENT_A0H)		\
777 	__PMC_EV(ARMV8, EVENT_A1H)		\
778 	__PMC_EV(ARMV8, EVENT_A2H)		\
779 	__PMC_EV(ARMV8, EVENT_A3H)		\
780 	__PMC_EV(ARMV8, EVENT_A4H)		\
781 	__PMC_EV(ARMV8, EVENT_A5H)		\
782 	__PMC_EV(ARMV8, EVENT_A6H)		\
783 	__PMC_EV(ARMV8, EVENT_A7H)		\
784 	__PMC_EV(ARMV8, EVENT_A8H)		\
785 	__PMC_EV(ARMV8, EVENT_A9H)		\
786 	__PMC_EV(ARMV8, EVENT_AAH)		\
787 	__PMC_EV(ARMV8, EVENT_ABH)		\
788 	__PMC_EV(ARMV8, EVENT_ACH)		\
789 	__PMC_EV(ARMV8, EVENT_ADH)		\
790 	__PMC_EV(ARMV8, EVENT_AEH)		\
791 	__PMC_EV(ARMV8, EVENT_AFH)		\
792 	__PMC_EV(ARMV8, EVENT_B0H)		\
793 	__PMC_EV(ARMV8, EVENT_B1H)		\
794 	__PMC_EV(ARMV8, EVENT_B2H)		\
795 	__PMC_EV(ARMV8, EVENT_B3H)		\
796 	__PMC_EV(ARMV8, EVENT_B4H)		\
797 	__PMC_EV(ARMV8, EVENT_B5H)		\
798 	__PMC_EV(ARMV8, EVENT_B6H)		\
799 	__PMC_EV(ARMV8, EVENT_B7H)		\
800 	__PMC_EV(ARMV8, EVENT_B8H)		\
801 	__PMC_EV(ARMV8, EVENT_B9H)		\
802 	__PMC_EV(ARMV8, EVENT_BAH)		\
803 	__PMC_EV(ARMV8, EVENT_BBH)		\
804 	__PMC_EV(ARMV8, EVENT_BCH)		\
805 	__PMC_EV(ARMV8, EVENT_BDH)		\
806 	__PMC_EV(ARMV8, EVENT_BEH)		\
807 	__PMC_EV(ARMV8, EVENT_BFH)		\
808 	__PMC_EV(ARMV8, EVENT_C0H)		\
809 	__PMC_EV(ARMV8, EVENT_C1H)		\
810 	__PMC_EV(ARMV8, EVENT_C2H)		\
811 	__PMC_EV(ARMV8, EVENT_C3H)		\
812 	__PMC_EV(ARMV8, EVENT_C4H)		\
813 	__PMC_EV(ARMV8, EVENT_C5H)		\
814 	__PMC_EV(ARMV8, EVENT_C6H)		\
815 	__PMC_EV(ARMV8, EVENT_C7H)		\
816 	__PMC_EV(ARMV8, EVENT_C8H)		\
817 	__PMC_EV(ARMV8, EVENT_C9H)		\
818 	__PMC_EV(ARMV8, EVENT_CAH)		\
819 	__PMC_EV(ARMV8, EVENT_CBH)		\
820 	__PMC_EV(ARMV8, EVENT_CCH)		\
821 	__PMC_EV(ARMV8, EVENT_CDH)		\
822 	__PMC_EV(ARMV8, EVENT_CEH)		\
823 	__PMC_EV(ARMV8, EVENT_CFH)		\
824 	__PMC_EV(ARMV8, EVENT_D0H)		\
825 	__PMC_EV(ARMV8, EVENT_D1H)		\
826 	__PMC_EV(ARMV8, EVENT_D2H)		\
827 	__PMC_EV(ARMV8, EVENT_D3H)		\
828 	__PMC_EV(ARMV8, EVENT_D4H)		\
829 	__PMC_EV(ARMV8, EVENT_D5H)		\
830 	__PMC_EV(ARMV8, EVENT_D6H)		\
831 	__PMC_EV(ARMV8, EVENT_D7H)		\
832 	__PMC_EV(ARMV8, EVENT_D8H)		\
833 	__PMC_EV(ARMV8, EVENT_D9H)		\
834 	__PMC_EV(ARMV8, EVENT_DAH)		\
835 	__PMC_EV(ARMV8, EVENT_DBH)		\
836 	__PMC_EV(ARMV8, EVENT_DCH)		\
837 	__PMC_EV(ARMV8, EVENT_DDH)		\
838 	__PMC_EV(ARMV8, EVENT_DEH)		\
839 	__PMC_EV(ARMV8, EVENT_DFH)		\
840 	__PMC_EV(ARMV8, EVENT_E0H)		\
841 	__PMC_EV(ARMV8, EVENT_E1H)		\
842 	__PMC_EV(ARMV8, EVENT_E2H)		\
843 	__PMC_EV(ARMV8, EVENT_E3H)		\
844 	__PMC_EV(ARMV8, EVENT_E4H)		\
845 	__PMC_EV(ARMV8, EVENT_E5H)		\
846 	__PMC_EV(ARMV8, EVENT_E6H)		\
847 	__PMC_EV(ARMV8, EVENT_E7H)		\
848 	__PMC_EV(ARMV8, EVENT_E8H)		\
849 	__PMC_EV(ARMV8, EVENT_E9H)		\
850 	__PMC_EV(ARMV8, EVENT_EAH)		\
851 	__PMC_EV(ARMV8, EVENT_EBH)		\
852 	__PMC_EV(ARMV8, EVENT_ECH)		\
853 	__PMC_EV(ARMV8, EVENT_EDH)		\
854 	__PMC_EV(ARMV8, EVENT_EEH)		\
855 	__PMC_EV(ARMV8, EVENT_EFH)		\
856 	__PMC_EV(ARMV8, EVENT_F0H)		\
857 	__PMC_EV(ARMV8, EVENT_F1H)		\
858 	__PMC_EV(ARMV8, EVENT_F2H)		\
859 	__PMC_EV(ARMV8, EVENT_F3H)		\
860 	__PMC_EV(ARMV8, EVENT_F4H)		\
861 	__PMC_EV(ARMV8, EVENT_F5H)		\
862 	__PMC_EV(ARMV8, EVENT_F6H)		\
863 	__PMC_EV(ARMV8, EVENT_F7H)		\
864 	__PMC_EV(ARMV8, EVENT_F8H)		\
865 	__PMC_EV(ARMV8, EVENT_F9H)		\
866 	__PMC_EV(ARMV8, EVENT_FAH)		\
867 	__PMC_EV(ARMV8, EVENT_FBH)		\
868 	__PMC_EV(ARMV8, EVENT_FCH)		\
869 	__PMC_EV(ARMV8, EVENT_FDH)		\
870 	__PMC_EV(ARMV8, EVENT_FEH)		\
871 	__PMC_EV(ARMV8, EVENT_FFH)
872 
873 #define	PMC_EV_ARMV8_FIRST	PMC_EV_ARMV8_EVENT_00H
874 #define	PMC_EV_ARMV8_LAST	PMC_EV_ARMV8_EVENT_FFH
875 
876 #define	__PMC_EV_ALIAS_ARMV8_COMMON()					\
877 	__PMC_EV_ALIAS("SW_INCR",		ARMV8_EVENT_00H)	\
878 	__PMC_EV_ALIAS("L1I_CACHE_REFILL",	ARMV8_EVENT_01H)	\
879 	__PMC_EV_ALIAS("L1I_TLB_REFILL",	ARMV8_EVENT_02H)	\
880 	__PMC_EV_ALIAS("L1D_CACHE_REFILL",	ARMV8_EVENT_03H)	\
881 	__PMC_EV_ALIAS("L1D_CACHE",		ARMV8_EVENT_04H)	\
882 	__PMC_EV_ALIAS("L1D_TLB_REFILL",	ARMV8_EVENT_05H)	\
883 	__PMC_EV_ALIAS("INST_RETIRED",		ARMV8_EVENT_08H)	\
884 	__PMC_EV_ALIAS("EXC_TAKEN",		ARMV8_EVENT_09H)	\
885 	__PMC_EV_ALIAS("EXC_RETURN",		ARMV8_EVENT_0AH)	\
886 	__PMC_EV_ALIAS("CID_WRITE_RETIRED",	ARMV8_EVENT_0BH)	\
887 	__PMC_EV_ALIAS("BR_MIS_PRED",		ARMV8_EVENT_10H)	\
888 	__PMC_EV_ALIAS("CPU_CYCLES",		ARMV8_EVENT_11H)	\
889 	__PMC_EV_ALIAS("BR_PRED",		ARMV8_EVENT_12H)	\
890 	__PMC_EV_ALIAS("MEM_ACCESS",		ARMV8_EVENT_13H)	\
891 	__PMC_EV_ALIAS("L1I_CACHE",		ARMV8_EVENT_14H)	\
892 	__PMC_EV_ALIAS("L1D_CACHE_WB",		ARMV8_EVENT_15H)	\
893 	__PMC_EV_ALIAS("L2D_CACHE",		ARMV8_EVENT_16H)	\
894 	__PMC_EV_ALIAS("L2D_CACHE_REFILL",	ARMV8_EVENT_17H)	\
895 	__PMC_EV_ALIAS("L2D_CACHE_WB",		ARMV8_EVENT_18H)	\
896 	__PMC_EV_ALIAS("BUS_ACCESS",		ARMV8_EVENT_19H)	\
897 	__PMC_EV_ALIAS("MEMORY_ERROR",		ARMV8_EVENT_1AH)	\
898 	__PMC_EV_ALIAS("BUS_CYCLES",		ARMV8_EVENT_1DH)	\
899 	__PMC_EV_ALIAS("CHAIN",			ARMV8_EVENT_1EH)	\
900 	__PMC_EV_ALIAS("BUS_ACCESS_LD",		ARMV8_EVENT_60H)	\
901 	__PMC_EV_ALIAS("BUS_ACCESS_ST",		ARMV8_EVENT_61H)	\
902 	__PMC_EV_ALIAS("BR_INDIRECT_SPEC",	ARMV8_EVENT_7AH)	\
903 	__PMC_EV_ALIAS("EXC_IRQ",		ARMV8_EVENT_86H)	\
904 	__PMC_EV_ALIAS("EXC_FIQ",		ARMV8_EVENT_87H)
905 
906 #define	__PMC_EV_ALIAS_ARMV8_CORTEX_A53()				\
907 	__PMC_EV_ALIAS_ARMV8_COMMON()					\
908 	__PMC_EV_ALIAS("LD_RETIRED",		ARMV8_EVENT_06H)	\
909 	__PMC_EV_ALIAS("ST_RETIRED",		ARMV8_EVENT_07H)	\
910 	__PMC_EV_ALIAS("PC_WRITE_RETIRED",	ARMV8_EVENT_0CH)	\
911 	__PMC_EV_ALIAS("BR_IMMED_RETIRED",	ARMV8_EVENT_0DH)	\
912 	__PMC_EV_ALIAS("BR_RETURN_RETIRED",	ARMV8_EVENT_0EH)	\
913 	__PMC_EV_ALIAS("UNALIGNED_LDST_RETIRED",ARMV8_EVENT_0FH)
914 
915 #define	__PMC_EV_ALIAS_ARMV8_CORTEX_A57_A76()				\
916 	__PMC_EV_ALIAS_ARMV8_COMMON()					\
917 	__PMC_EV_ALIAS("INST_SPEC",		ARMV8_EVENT_1BH)	\
918 	__PMC_EV_ALIAS("TTBR_WRITE_RETIRED",	ARMV8_EVENT_1CH)	\
919 	__PMC_EV_ALIAS("L1D_CACHE_LD",		ARMV8_EVENT_40H)	\
920 	__PMC_EV_ALIAS("L1D_CACHE_ST",		ARMV8_EVENT_41H)	\
921 	__PMC_EV_ALIAS("L1D_CACHE_REFILL_LD",	ARMV8_EVENT_42H)	\
922 	__PMC_EV_ALIAS("L1D_CACHE_REFILL_ST",	ARMV8_EVENT_43H)	\
923 	__PMC_EV_ALIAS("L1D_CACHE_WB_VICTIM",	ARMV8_EVENT_46H)	\
924 	__PMC_EV_ALIAS("L1D_CACHE_WB_CLEAN",	ARMV8_EVENT_47H)	\
925 	__PMC_EV_ALIAS("L1D_CACHE_INVAL",	ARMV8_EVENT_48H)	\
926 	__PMC_EV_ALIAS("L1D_TLB_REFILL_LD",	ARMV8_EVENT_4CH)	\
927 	__PMC_EV_ALIAS("L1D_TLB_REFILL_ST",	ARMV8_EVENT_4DH)	\
928 	__PMC_EV_ALIAS("L2D_CACHE_LD",		ARMV8_EVENT_50H)	\
929 	__PMC_EV_ALIAS("L2D_CACHE_ST",		ARMV8_EVENT_51H)	\
930 	__PMC_EV_ALIAS("L2D_CACHE_REFILL_LD",	ARMV8_EVENT_52H)	\
931 	__PMC_EV_ALIAS("L2D_CACHE_REFILL_ST",	ARMV8_EVENT_53H)	\
932 	__PMC_EV_ALIAS("L2D_CACHE_WB_VICTIM",	ARMV8_EVENT_56H)	\
933 	__PMC_EV_ALIAS("L2D_CACHE_WB_CLEAN",	ARMV8_EVENT_57H)	\
934 	__PMC_EV_ALIAS("L2D_CACHE_INVAL",	ARMV8_EVENT_58H)	\
935 	__PMC_EV_ALIAS("MEM_ACCESS_LD",		ARMV8_EVENT_66H)	\
936 	__PMC_EV_ALIAS("MEM_ACCESS_ST",		ARMV8_EVENT_67H)	\
937 	__PMC_EV_ALIAS("UNALIGNED_LD_SPEC",	ARMV8_EVENT_68H)	\
938 	__PMC_EV_ALIAS("UNALIGNED_ST_SPEC",	ARMV8_EVENT_69H)	\
939 	__PMC_EV_ALIAS("UNALIGNED_LDST_SPEC",	ARMV8_EVENT_6AH)	\
940 	__PMC_EV_ALIAS("LDREX_SPEC",		ARMV8_EVENT_6CH)	\
941 	__PMC_EV_ALIAS("STREX_PASS_SPEC",	ARMV8_EVENT_6DH)	\
942 	__PMC_EV_ALIAS("STREX_FAIL_SPEC",	ARMV8_EVENT_6EH)	\
943 	__PMC_EV_ALIAS("LD_SPEC",		ARMV8_EVENT_70H)	\
944 	__PMC_EV_ALIAS("ST_SPEC",		ARMV8_EVENT_71H)	\
945 	__PMC_EV_ALIAS("LDST_SPEC",		ARMV8_EVENT_72H)	\
946 	__PMC_EV_ALIAS("DP_SPEC",		ARMV8_EVENT_73H)	\
947 	__PMC_EV_ALIAS("ASE_SPEC",		ARMV8_EVENT_74H)	\
948 	__PMC_EV_ALIAS("VFP_SPEC",		ARMV8_EVENT_75H)	\
949 	__PMC_EV_ALIAS("PC_WRITE_SPEC",		ARMV8_EVENT_76H)	\
950 	__PMC_EV_ALIAS("CRYPTO_SPEC",		ARMV8_EVENT_77H)	\
951 	__PMC_EV_ALIAS("BR_IMMED_SPEC",		ARMV8_EVENT_78H)	\
952 	__PMC_EV_ALIAS("BR_RETURN_SPEC",	ARMV8_EVENT_79H)	\
953 	__PMC_EV_ALIAS("ISB_SPEC",		ARMV8_EVENT_7CH)	\
954 	__PMC_EV_ALIAS("DSB_SPEC",		ARMV8_EVENT_7DH)	\
955 	__PMC_EV_ALIAS("DMB_SPEC",		ARMV8_EVENT_7EH)	\
956 	__PMC_EV_ALIAS("EXC_UNDEF",		ARMV8_EVENT_81H)	\
957 	__PMC_EV_ALIAS("EXC_SVC",		ARMV8_EVENT_82H)	\
958 	__PMC_EV_ALIAS("EXC_PABORT",		ARMV8_EVENT_83H)	\
959 	__PMC_EV_ALIAS("EXC_DABORT",		ARMV8_EVENT_84H)	\
960 	__PMC_EV_ALIAS("EXC_SMC",		ARMV8_EVENT_88H)	\
961 	__PMC_EV_ALIAS("EXC_HVC",		ARMV8_EVENT_8AH)	\
962 	__PMC_EV_ALIAS("EXC_TRAP_PABORT",	ARMV8_EVENT_8BH)	\
963 	__PMC_EV_ALIAS("EXC_TRAP_DABORT",	ARMV8_EVENT_8CH)	\
964 	__PMC_EV_ALIAS("EXC_TRAP_OTHER",	ARMV8_EVENT_8DH)	\
965 	__PMC_EV_ALIAS("EXC_TRAP_IRQ",		ARMV8_EVENT_8EH)	\
966 	__PMC_EV_ALIAS("EXC_TRAP_FIQ",		ARMV8_EVENT_8FH)	\
967 	__PMC_EV_ALIAS("RC_LD_SPEC",		ARMV8_EVENT_90H)	\
968 	__PMC_EV_ALIAS("RC_ST_SPEC",		ARMV8_EVENT_91H)
969 
970 #define	__PMC_EV_ALIAS_ARMV8_CORTEX_A57()				\
971 	__PMC_EV_ALIAS_ARMV8_CORTEX_A57_A76()				\
972 	__PMC_EV_ALIAS("BUS_ACCESS_SHARED",	ARMV8_EVENT_62H)	\
973 	__PMC_EV_ALIAS("BUS_ACCESS_NOT_SHARED",	ARMV8_EVENT_63H)	\
974 	__PMC_EV_ALIAS("BUS_ACCESS_NORMAL",	ARMV8_EVENT_64H)	\
975 	__PMC_EV_ALIAS("BUS_ACCESS_PERIPH",	ARMV8_EVENT_65H)
976 
977 #define	__PMC_EV_ALIAS_ARMV8_CORTEX_A76()				\
978 	__PMC_EV_ALIAS_ARMV8_CORTEX_A57_A76()				\
979 	__PMC_EV_ALIAS("L2D_CACHE_ALLOCATE",	ARMV8_EVENT_20H)	\
980 	__PMC_EV_ALIAS("BR_RETIRED",		ARMV8_EVENT_21H)	\
981 	__PMC_EV_ALIAS("BR_MIS_PRED_RETIRED",	ARMV8_EVENT_22H)	\
982 	__PMC_EV_ALIAS("STALL_FRONTEND",	ARMV8_EVENT_23H)	\
983 	__PMC_EV_ALIAS("STALL_BACKEND",		ARMV8_EVENT_24H)	\
984 	__PMC_EV_ALIAS("L1D_TLB",		ARMV8_EVENT_25H)	\
985 	__PMC_EV_ALIAS("L1I_TLB",		ARMV8_EVENT_26H)	\
986 	__PMC_EV_ALIAS("L3D_CACHE_ALLOCATE",	ARMV8_EVENT_29H)	\
987 	__PMC_EV_ALIAS("L3D_CACHE_REFILL",	ARMV8_EVENT_2AH)	\
988 	__PMC_EV_ALIAS("L3D_CACHE",		ARMV8_EVENT_2BH)	\
989 	__PMC_EV_ALIAS("L2D_TLB_REFILL",	ARMV8_EVENT_2DH)	\
990 	__PMC_EV_ALIAS("L2D_TLB",		ARMV8_EVENT_2FH)	\
991 	__PMC_EV_ALIAS("REMOTE_ACCESS",		ARMV8_EVENT_31H)	\
992 	__PMC_EV_ALIAS("DTLB_WALK",		ARMV8_EVENT_34H)	\
993 	__PMC_EV_ALIAS("ITLB_WALK",		ARMV8_EVENT_35H)	\
994 	__PMC_EV_ALIAS("LL_CACHE_RD",		ARMV8_EVENT_36H)	\
995 	__PMC_EV_ALIAS("LL_CACHE_MISS_RD",	ARMV8_EVENT_37H)	\
996 	__PMC_EV_ALIAS("L1D_CACHE_REFILL_INNER", ARMV8_EVENT_44H)	\
997 	__PMC_EV_ALIAS("L1D_CACHE_REFILL_OUTER", ARMV8_EVENT_45H)	\
998 	__PMC_EV_ALIAS("L1D_TLB_RD",		ARMV8_EVENT_4EH)	\
999 	__PMC_EV_ALIAS("L1D_TLB_WR",		ARMV8_EVENT_4FH)	\
1000 	__PMC_EV_ALIAS("L2D_TLB_REFILL_RD",	ARMV8_EVENT_5CH)	\
1001 	__PMC_EV_ALIAS("L2D_TLB_REFILL_WR",	ARMV8_EVENT_5DH)	\
1002 	__PMC_EV_ALIAS("L2D_TLB_RD",		ARMV8_EVENT_5EH)	\
1003 	__PMC_EV_ALIAS("L2D_TLB_WR",		ARMV8_EVENT_5FH)	\
1004 	__PMC_EV_ALIAS("STREX_SPEC",		ARMV8_EVENT_6FH)	\
1005 	__PMC_EV_ALIAS("L3_CACHE_RD",		ARMV8_EVENT_A0H)
1006 
1007 /*
1008  * MIPS Events from "Programming the MIPS32 24K Core Family",
1009  * Document Number: MD00355 Revision 04.63 December 19, 2008
1010  * These events are kept in the order found in Table 7.4.
1011  * For counters which are different between the left hand
1012  * column (0/2) and the right hand column (1/3) the left
1013  * hand is given first, e.g. BRANCH_COMPLETED and BRANCH_MISPRED
1014  * in the definition below.
1015  */
1016 
1017 #define __PMC_EV_MIPS24K()                         \
1018 	__PMC_EV(MIPS24K, CYCLE)                   \
1019 	__PMC_EV(MIPS24K, INSTR_EXECUTED)          \
1020 	__PMC_EV(MIPS24K, BRANCH_COMPLETED)        \
1021 	__PMC_EV(MIPS24K, BRANCH_MISPRED)          \
1022 	__PMC_EV(MIPS24K, RETURN)                  \
1023 	__PMC_EV(MIPS24K, RETURN_MISPRED)          \
1024 	__PMC_EV(MIPS24K, RETURN_NOT_31)           \
1025 	__PMC_EV(MIPS24K, RETURN_NOTPRED)          \
1026 	__PMC_EV(MIPS24K, ITLB_ACCESS)             \
1027 	__PMC_EV(MIPS24K, ITLB_MISS)               \
1028 	__PMC_EV(MIPS24K, DTLB_ACCESS)             \
1029 	__PMC_EV(MIPS24K, DTLB_MISS)               \
1030 	__PMC_EV(MIPS24K, JTLB_IACCESS)            \
1031 	__PMC_EV(MIPS24K, JTLB_IMISS)              \
1032 	__PMC_EV(MIPS24K, JTLB_DACCESS)            \
1033 	__PMC_EV(MIPS24K, JTLB_DMISS)              \
1034 	__PMC_EV(MIPS24K, IC_FETCH)                \
1035 	__PMC_EV(MIPS24K, IC_MISS)                 \
1036 	__PMC_EV(MIPS24K, DC_LOADSTORE)            \
1037 	__PMC_EV(MIPS24K, DC_WRITEBACK)            \
1038 	__PMC_EV(MIPS24K, DC_MISS)                 \
1039 	__PMC_EV(MIPS24K, STORE_MISS)              \
1040 	__PMC_EV(MIPS24K, LOAD_MISS)               \
1041 	__PMC_EV(MIPS24K, INTEGER_COMPLETED)       \
1042 	__PMC_EV(MIPS24K, FP_COMPLETED)            \
1043 	__PMC_EV(MIPS24K, LOAD_COMPLETED)          \
1044 	__PMC_EV(MIPS24K, STORE_COMPLETED)         \
1045 	__PMC_EV(MIPS24K, BARRIER_COMPLETED)       \
1046 	__PMC_EV(MIPS24K, MIPS16_COMPLETED)        \
1047 	__PMC_EV(MIPS24K, NOP_COMPLETED)           \
1048 	__PMC_EV(MIPS24K, INTEGER_MULDIV_COMPLETED)\
1049 	__PMC_EV(MIPS24K, RF_STALL)                \
1050 	__PMC_EV(MIPS24K, INSTR_REFETCH)           \
1051 	__PMC_EV(MIPS24K, STORE_COND_COMPLETED)    \
1052 	__PMC_EV(MIPS24K, STORE_COND_FAILED)       \
1053 	__PMC_EV(MIPS24K, ICACHE_REQUESTS)         \
1054 	__PMC_EV(MIPS24K, ICACHE_HIT)              \
1055 	__PMC_EV(MIPS24K, L2_WRITEBACK)            \
1056 	__PMC_EV(MIPS24K, L2_ACCESS)               \
1057 	__PMC_EV(MIPS24K, L2_MISS)                 \
1058 	__PMC_EV(MIPS24K, L2_ERR_CORRECTED)        \
1059 	__PMC_EV(MIPS24K, EXCEPTIONS)              \
1060 	__PMC_EV(MIPS24K, RF_CYCLES_STALLED)       \
1061 	__PMC_EV(MIPS24K, IFU_CYCLES_STALLED)      \
1062 	__PMC_EV(MIPS24K, ALU_CYCLES_STALLED)      \
1063 	__PMC_EV(MIPS24K, UNCACHED_LOAD)           \
1064 	__PMC_EV(MIPS24K, UNCACHED_STORE)          \
1065 	__PMC_EV(MIPS24K, CP2_REG_TO_REG_COMPLETED)\
1066 	__PMC_EV(MIPS24K, MFTC_COMPLETED)          \
1067 	__PMC_EV(MIPS24K, IC_BLOCKED_CYCLES)       \
1068 	__PMC_EV(MIPS24K, DC_BLOCKED_CYCLES)       \
1069 	__PMC_EV(MIPS24K, L2_IMISS_STALL_CYCLES)   \
1070 	__PMC_EV(MIPS24K, L2_DMISS_STALL_CYCLES)   \
1071 	__PMC_EV(MIPS24K, DMISS_CYCLES)            \
1072 	__PMC_EV(MIPS24K, L2_MISS_CYCLES)          \
1073 	__PMC_EV(MIPS24K, UNCACHED_BLOCK_CYCLES)   \
1074 	__PMC_EV(MIPS24K, MDU_STALL_CYCLES)        \
1075 	__PMC_EV(MIPS24K, FPU_STALL_CYCLES)        \
1076 	__PMC_EV(MIPS24K, CP2_STALL_CYCLES)        \
1077 	__PMC_EV(MIPS24K, COREXTEND_STALL_CYCLES)  \
1078 	__PMC_EV(MIPS24K, ISPRAM_STALL_CYCLES)     \
1079 	__PMC_EV(MIPS24K, DSPRAM_STALL_CYCLES)     \
1080 	__PMC_EV(MIPS24K, CACHE_STALL_CYCLES)      \
1081 	__PMC_EV(MIPS24K, LOAD_TO_USE_STALLS)      \
1082 	__PMC_EV(MIPS24K, BASE_MISPRED_STALLS)     \
1083 	__PMC_EV(MIPS24K, CPO_READ_STALLS)         \
1084 	__PMC_EV(MIPS24K, BRANCH_MISPRED_CYCLES)   \
1085 	__PMC_EV(MIPS24K, IFETCH_BUFFER_FULL)      \
1086 	__PMC_EV(MIPS24K, FETCH_BUFFER_ALLOCATED)  \
1087 	__PMC_EV(MIPS24K, EJTAG_ITRIGGER)          \
1088 	__PMC_EV(MIPS24K, EJTAG_DTRIGGER)          \
1089 	__PMC_EV(MIPS24K, FSB_LT_QUARTER)          \
1090 	__PMC_EV(MIPS24K, FSB_QUARTER_TO_HALF)     \
1091 	__PMC_EV(MIPS24K, FSB_GT_HALF)             \
1092 	__PMC_EV(MIPS24K, FSB_FULL_PIPELINE_STALLS)\
1093 	__PMC_EV(MIPS24K, LDQ_LT_QUARTER)          \
1094 	__PMC_EV(MIPS24K, LDQ_QUARTER_TO_HALF)     \
1095 	__PMC_EV(MIPS24K, LDQ_GT_HALF)             \
1096 	__PMC_EV(MIPS24K, LDQ_FULL_PIPELINE_STALLS)\
1097 	__PMC_EV(MIPS24K, WBB_LT_QUARTER)          \
1098 	__PMC_EV(MIPS24K, WBB_QUARTER_TO_HALF)     \
1099 	__PMC_EV(MIPS24K, WBB_GT_HALF)             \
1100 	__PMC_EV(MIPS24K, WBB_FULL_PIPELINE_STALLS) \
1101 	__PMC_EV(MIPS24K, REQUEST_LATENCY)         \
1102 	__PMC_EV(MIPS24K, REQUEST_COUNT)
1103 
1104 #define	PMC_EV_MIPS24K_FIRST	PMC_EV_MIPS24K_CYCLE
1105 #define	PMC_EV_MIPS24K_LAST	PMC_EV_MIPS24K_WBB_FULL_PIPELINE_STALLS
1106 
1107 /*
1108  * MIPS74k events.  Similar to MIPS24k, the arrangement
1109  * is (0,2) then (1,3) events.
1110  */
1111 #define __PMC_EV_MIPS74K()			\
1112 	__PMC_EV(MIPS74K, CYCLES)		\
1113 	__PMC_EV(MIPS74K, INSTR_EXECUTED)	\
1114 	__PMC_EV(MIPS74K, PREDICTED_JR_31)	\
1115 	__PMC_EV(MIPS74K, JR_31_MISPREDICTIONS)	\
1116 	__PMC_EV(MIPS74K, REDIRECT_STALLS)	\
1117 	__PMC_EV(MIPS74K, JR_31_NO_PREDICTIONS)	\
1118 	__PMC_EV(MIPS74K, ITLB_ACCESSES)	\
1119 	__PMC_EV(MIPS74K, ITLB_MISSES)		\
1120 	__PMC_EV(MIPS74K, JTLB_INSN_MISSES)	\
1121 	__PMC_EV(MIPS74K, ICACHE_ACCESSES)	\
1122 	__PMC_EV(MIPS74K, ICACHE_MISSES)	\
1123 	__PMC_EV(MIPS74K, ICACHE_MISS_STALLS)	\
1124 	__PMC_EV(MIPS74K, UNCACHED_IFETCH_STALLS)	\
1125 	__PMC_EV(MIPS74K, PDTRACE_BACK_STALLS)	\
1126 	__PMC_EV(MIPS74K, IFU_REPLAYS)		\
1127 	__PMC_EV(MIPS74K, KILLED_FETCH_SLOTS)	\
1128 	__PMC_EV(MIPS74K, IFU_IDU_MISS_PRED_UPSTREAM_CYCLES)	\
1129 	__PMC_EV(MIPS74K, IFU_IDU_NO_FETCH_CYCLES)	\
1130 	__PMC_EV(MIPS74K, IFU_IDU_CLOGED_DOWNSTREAM_CYCLES)	\
1131 	__PMC_EV(MIPS74K, DDQ0_FULL_DR_STALLS)	\
1132 	__PMC_EV(MIPS74K, DDQ1_FULL_DR_STALLS)	\
1133 	__PMC_EV(MIPS74K, ALCB_FULL_DR_STALLS)	\
1134 	__PMC_EV(MIPS74K, AGCB_FULL_DR_STALLS)	\
1135 	__PMC_EV(MIPS74K, CLDQ_FULL_DR_STALLS)	\
1136 	__PMC_EV(MIPS74K, IODQ_FULL_DR_STALLS)	\
1137 	__PMC_EV(MIPS74K, ALU_EMPTY_CYCLES)	\
1138 	__PMC_EV(MIPS74K, AGEN_EMPTY_CYCLES)	\
1139 	__PMC_EV(MIPS74K, ALU_OPERANDS_NOT_READY_CYCLES)	\
1140 	__PMC_EV(MIPS74K, AGEN_OPERANDS_NOT_READY_CYCLES)	\
1141 	__PMC_EV(MIPS74K, ALU_NO_ISSUES_CYCLES)	\
1142 	__PMC_EV(MIPS74K, AGEN_NO_ISSUES_CYCLES)	\
1143 	__PMC_EV(MIPS74K, ALU_BUBBLE_CYCLES)	\
1144 	__PMC_EV(MIPS74K, AGEN_BUBBLE_CYCLES)	\
1145 	__PMC_EV(MIPS74K, SINGLE_ISSUE_CYCLES)	\
1146 	__PMC_EV(MIPS74K, DUAL_ISSUE_CYCLES)	\
1147 	__PMC_EV(MIPS74K, OOO_ALU_ISSUE_CYCLES)	\
1148 	__PMC_EV(MIPS74K, OOO_AGEN_ISSUE_CYCLES)	\
1149 	__PMC_EV(MIPS74K, JALR_JALR_HB_INSNS)	\
1150 	__PMC_EV(MIPS74K, DCACHE_LINE_REFILL_REQUESTS)	\
1151 	__PMC_EV(MIPS74K, DCACHE_LOAD_ACCESSES)	\
1152 	__PMC_EV(MIPS74K, DCACHE_ACCESSES)	\
1153 	__PMC_EV(MIPS74K, DCACHE_WRITEBACKS)	\
1154 	__PMC_EV(MIPS74K, DCACHE_MISSES)	\
1155 	__PMC_EV(MIPS74K, JTLB_DATA_ACCESSES)	\
1156 	__PMC_EV(MIPS74K, JTLB_DATA_MISSES)	\
1157 	__PMC_EV(MIPS74K, LOAD_STORE_REPLAYS)	\
1158 	__PMC_EV(MIPS74K, VA_TRANSALTION_CORNER_CASES)	\
1159 	__PMC_EV(MIPS74K, LOAD_STORE_BLOCKED_CYCLES)	\
1160 	__PMC_EV(MIPS74K, LOAD_STORE_NO_FILL_REQUESTS)	\
1161 	__PMC_EV(MIPS74K, L2_CACHE_WRITEBACKS)	\
1162 	__PMC_EV(MIPS74K, L2_CACHE_ACCESSES)	\
1163 	__PMC_EV(MIPS74K, L2_CACHE_MISSES)	\
1164 	__PMC_EV(MIPS74K, L2_CACHE_MISS_CYCLES)	\
1165 	__PMC_EV(MIPS74K, FSB_FULL_STALLS)	\
1166 	__PMC_EV(MIPS74K, FSB_OVER_50_FULL)	\
1167 	__PMC_EV(MIPS74K, LDQ_FULL_STALLS)	\
1168 	__PMC_EV(MIPS74K, LDQ_OVER_50_FULL)	\
1169 	__PMC_EV(MIPS74K, WBB_FULL_STALLS)	\
1170 	__PMC_EV(MIPS74K, WBB_OVER_50_FULL)	\
1171 	__PMC_EV(MIPS74K, LOAD_MISS_CONSUMER_REPLAYS)	\
1172 	__PMC_EV(MIPS74K, CP1_CP2_LOAD_INSNS)	\
1173 	__PMC_EV(MIPS74K, JR_NON_31_INSNS)	\
1174 	__PMC_EV(MIPS74K, MISPREDICTED_JR_31_INSNS)	\
1175 	__PMC_EV(MIPS74K, BRANCH_INSNS)		\
1176 	__PMC_EV(MIPS74K, CP1_CP2_COND_BRANCH_INSNS)	\
1177 	__PMC_EV(MIPS74K, BRANCH_LIKELY_INSNS)	\
1178 	__PMC_EV(MIPS74K, MISPREDICTED_BRANCH_LIKELY_INSNS)	\
1179 	__PMC_EV(MIPS74K, COND_BRANCH_INSNS)	\
1180 	__PMC_EV(MIPS74K, MISPREDICTED_BRANCH_INSNS)	\
1181 	__PMC_EV(MIPS74K, INTEGER_INSNS)	\
1182 	__PMC_EV(MIPS74K, FPU_INSNS)		\
1183 	__PMC_EV(MIPS74K, LOAD_INSNS)		\
1184 	__PMC_EV(MIPS74K, STORE_INSNS)		\
1185 	__PMC_EV(MIPS74K, J_JAL_INSNS)		\
1186 	__PMC_EV(MIPS74K, MIPS16_INSNS)		\
1187 	__PMC_EV(MIPS74K, NOP_INSNS)		\
1188 	__PMC_EV(MIPS74K, NT_MUL_DIV_INSNS)	\
1189 	__PMC_EV(MIPS74K, DSP_INSNS)		\
1190 	__PMC_EV(MIPS74K, ALU_DSP_SATURATION_INSNS)	\
1191 	__PMC_EV(MIPS74K, DSP_BRANCH_INSNS)	\
1192 	__PMC_EV(MIPS74K, MDU_DSP_SATURATION_INSNS)	\
1193 	__PMC_EV(MIPS74K, UNCACHED_LOAD_INSNS)	\
1194 	__PMC_EV(MIPS74K, UNCACHED_STORE_INSNS)	\
1195 	__PMC_EV(MIPS74K, EJTAG_INSN_TRIGGERS)	\
1196 	__PMC_EV(MIPS74K, CP1_BRANCH_MISPREDICTIONS)	\
1197 	__PMC_EV(MIPS74K, SC_INSNS)		\
1198 	__PMC_EV(MIPS74K, FAILED_SC_INSNS)	\
1199 	__PMC_EV(MIPS74K, PREFETCH_INSNS)	\
1200 	__PMC_EV(MIPS74K, CACHE_HIT_PREFETCH_INSNS)	\
1201 	__PMC_EV(MIPS74K, NO_INSN_CYCLES)	\
1202 	__PMC_EV(MIPS74K, LOAD_MISS_INSNS)	\
1203 	__PMC_EV(MIPS74K, ONE_INSN_CYCLES)	\
1204 	__PMC_EV(MIPS74K, TWO_INSNS_CYCLES)	\
1205 	__PMC_EV(MIPS74K, GFIFO_BLOCKED_CYCLES)	\
1206 	__PMC_EV(MIPS74K, CP1_CP2_STORE_INSNS)	\
1207 	__PMC_EV(MIPS74K, MISPREDICTION_STALLS)	\
1208 	__PMC_EV(MIPS74K, MISPREDICTED_BRANCH_INSNS_CYCLES)	\
1209 	__PMC_EV(MIPS74K, EXCEPTIONS_TAKEN)	\
1210 	__PMC_EV(MIPS74K, GRADUATION_REPLAYS)	\
1211 	__PMC_EV(MIPS74K, COREEXTEND_EVENTS)	\
1212 	__PMC_EV(MIPS74K, ISPRAM_EVENTS)	\
1213 	__PMC_EV(MIPS74K, DSPRAM_EVENTS)	\
1214 	__PMC_EV(MIPS74K, L2_CACHE_SINGLE_BIT_ERRORS)	\
1215 	__PMC_EV(MIPS74K, SYSTEM_EVENT_0)	\
1216 	__PMC_EV(MIPS74K, SYSTEM_EVENT_1)	\
1217 	__PMC_EV(MIPS74K, SYSTEM_EVENT_2)	\
1218 	__PMC_EV(MIPS74K, SYSTEM_EVENT_3)	\
1219 	__PMC_EV(MIPS74K, SYSTEM_EVENT_4)	\
1220 	__PMC_EV(MIPS74K, SYSTEM_EVENT_5)	\
1221 	__PMC_EV(MIPS74K, SYSTEM_EVENT_6)	\
1222 	__PMC_EV(MIPS74K, SYSTEM_EVENT_7)	\
1223 	__PMC_EV(MIPS74K, OCP_ALL_REQUESTS)	\
1224 	__PMC_EV(MIPS74K, OCP_ALL_CACHEABLE_REQUESTS)	\
1225 	__PMC_EV(MIPS74K, OCP_READ_REQUESTS)	\
1226 	__PMC_EV(MIPS74K, OCP_READ_CACHEABLE_REQUESTS)	\
1227 	__PMC_EV(MIPS74K, OCP_WRITE_REQUESTS)	\
1228 	__PMC_EV(MIPS74K, OCP_WRITE_CACHEABLE_REQUESTS)	\
1229 	__PMC_EV(MIPS74K, FSB_LESS_25_FULL)	\
1230 	__PMC_EV(MIPS74K, FSB_25_50_FULL)	\
1231 	__PMC_EV(MIPS74K, LDQ_LESS_25_FULL)	\
1232 	__PMC_EV(MIPS74K, LDQ_25_50_FULL)	\
1233 	__PMC_EV(MIPS74K, WBB_LESS_25_FULL)	\
1234 	__PMC_EV(MIPS74K, WBB_25_50_FULL)
1235 
1236 #define	PMC_EV_MIPS74K_FIRST	PMC_EV_MIPS74K_CYCLES
1237 #define	PMC_EV_MIPS74K_LAST	PMC_EV_MIPS74K_WBB_25_50_FULL
1238 
1239 #define __PMC_EV_BERI()					\
1240 	__PMC_EV(BERI, CYCLE)				\
1241 	__PMC_EV(BERI, INST)				\
1242 	__PMC_EV(BERI, INST_USER)			\
1243 	__PMC_EV(BERI, INST_KERNEL)			\
1244 	__PMC_EV(BERI, IMPRECISE_SETBOUNDS)		\
1245 	__PMC_EV(BERI, UNREPRESENTABLE_CAPS)		\
1246 	__PMC_EV(BERI, ITLB_MISS)			\
1247 	__PMC_EV(BERI, DTLB_MISS)			\
1248 	__PMC_EV(BERI, ICACHE_WRITE_HIT)		\
1249 	__PMC_EV(BERI, ICACHE_WRITE_MISS)		\
1250 	__PMC_EV(BERI, ICACHE_READ_HIT)			\
1251 	__PMC_EV(BERI, ICACHE_READ_MISS)		\
1252 	__PMC_EV(BERI, ICACHE_EVICT)			\
1253 	__PMC_EV(BERI, DCACHE_WRITE_HIT)		\
1254 	__PMC_EV(BERI, DCACHE_WRITE_MISS)		\
1255 	__PMC_EV(BERI, DCACHE_READ_HIT)			\
1256 	__PMC_EV(BERI, DCACHE_READ_MISS)		\
1257 	__PMC_EV(BERI, DCACHE_EVICT)			\
1258 	__PMC_EV(BERI, DCACHE_SET_TAG_WRITE)		\
1259 	__PMC_EV(BERI, DCACHE_SET_TAG_READ)		\
1260 	__PMC_EV(BERI, L2CACHE_WRITE_HIT)		\
1261 	__PMC_EV(BERI, L2CACHE_WRITE_MISS)		\
1262 	__PMC_EV(BERI, L2CACHE_READ_HIT)		\
1263 	__PMC_EV(BERI, L2CACHE_READ_MISS)		\
1264 	__PMC_EV(BERI, L2CACHE_EVICT)			\
1265 	__PMC_EV(BERI, L2CACHE_SET_TAG_WRITE)		\
1266 	__PMC_EV(BERI, L2CACHE_SET_TAG_READ)		\
1267 	__PMC_EV(BERI, MEM_BYTE_READ)			\
1268 	__PMC_EV(BERI, MEM_BYTE_WRITE)			\
1269 	__PMC_EV(BERI, MEM_HWORD_READ)			\
1270 	__PMC_EV(BERI, MEM_HWORD_WRITE)			\
1271 	__PMC_EV(BERI, MEM_WORD_READ)			\
1272 	__PMC_EV(BERI, MEM_WORD_WRITE)			\
1273 	__PMC_EV(BERI, MEM_DWORD_READ)			\
1274 	__PMC_EV(BERI, MEM_DWORD_WRITE)			\
1275 	__PMC_EV(BERI, MEM_CAP_READ)			\
1276 	__PMC_EV(BERI, MEM_CAP_WRITE)			\
1277 	__PMC_EV(BERI, MEM_CAP_READ_TAG_SET)		\
1278 	__PMC_EV(BERI, MEM_CAP_WRITE_TAG_SET)		\
1279 	__PMC_EV(BERI, TAGCACHE_WRITE_HIT)		\
1280 	__PMC_EV(BERI, TAGCACHE_WRITE_MISS)		\
1281 	__PMC_EV(BERI, TAGCACHE_READ_HIT)		\
1282 	__PMC_EV(BERI, TAGCACHE_READ_MISS)		\
1283 	__PMC_EV(BERI, TAGCACHE_EVICT)			\
1284 	__PMC_EV(BERI, L2CACHEMASTER_READ_REQ)		\
1285 	__PMC_EV(BERI, L2CACHEMASTER_WRITE_REQ)		\
1286 	__PMC_EV(BERI, L2CACHEMASTER_WRITE_REQ_FLIT)	\
1287 	__PMC_EV(BERI, L2CACHEMASTER_READ_RSP)		\
1288 	__PMC_EV(BERI, L2CACHEMASTER_READ_RSP_FLIT)	\
1289 	__PMC_EV(BERI, L2CACHEMASTER_WRITE_RSP)		\
1290 	__PMC_EV(BERI, TAGCACHEMASTER_READ_REQ)		\
1291 	__PMC_EV(BERI, TAGCACHEMASTER_WRITE_REQ)	\
1292 	__PMC_EV(BERI, TAGCACHEMASTER_WRITE_REQ_FLIT)	\
1293 	__PMC_EV(BERI, TAGCACHEMASTER_READ_RSP)		\
1294 	__PMC_EV(BERI, TAGCACHEMASTER_READ_RSP_FLIT)	\
1295 	__PMC_EV(BERI, TAGCACHEMASTER_WRITE_RSP)
1296 
1297 #define	PMC_EV_BERI_FIRST	PMC_EV_BERI_CYCLE
1298 #define	PMC_EV_BERI_LAST	PMC_EV_BERI_TAGCACHEMASTER_WRITE_RSP
1299 
1300 /*
1301  * Cavium Octeon counters. Obtained from cvmx-core.h
1302  */
1303 #define __PMC_EV_OCTEON()                         \
1304     __PMC_EV(OCTEON, CLK)                         \
1305     __PMC_EV(OCTEON, ISSUE)                       \
1306     __PMC_EV(OCTEON, RET)                         \
1307     __PMC_EV(OCTEON, NISSUE)                      \
1308     __PMC_EV(OCTEON, SISSUE)                      \
1309     __PMC_EV(OCTEON, DISSUE)                      \
1310     __PMC_EV(OCTEON, IFI)                         \
1311     __PMC_EV(OCTEON, BR)                          \
1312     __PMC_EV(OCTEON, BRMIS)                       \
1313     __PMC_EV(OCTEON, J)                           \
1314     __PMC_EV(OCTEON, JMIS)                        \
1315     __PMC_EV(OCTEON, REPLAY)                      \
1316     __PMC_EV(OCTEON, IUNA)                        \
1317     __PMC_EV(OCTEON, TRAP)                        \
1318     __PMC_EV(OCTEON, UULOAD)                      \
1319     __PMC_EV(OCTEON, UUSTORE)                     \
1320     __PMC_EV(OCTEON, ULOAD)                       \
1321     __PMC_EV(OCTEON, USTORE)                      \
1322     __PMC_EV(OCTEON, EC)                          \
1323     __PMC_EV(OCTEON, MC)                          \
1324     __PMC_EV(OCTEON, CC)                          \
1325     __PMC_EV(OCTEON, CSRC)                        \
1326     __PMC_EV(OCTEON, CFETCH)                      \
1327     __PMC_EV(OCTEON, CPREF)                       \
1328     __PMC_EV(OCTEON, ICA)                         \
1329     __PMC_EV(OCTEON, II)                          \
1330     __PMC_EV(OCTEON, IP)                          \
1331     __PMC_EV(OCTEON, CIMISS)                      \
1332     __PMC_EV(OCTEON, WBUF)                        \
1333     __PMC_EV(OCTEON, WDAT)                        \
1334     __PMC_EV(OCTEON, WBUFLD)                      \
1335     __PMC_EV(OCTEON, WBUFFL)                      \
1336     __PMC_EV(OCTEON, WBUFTR)                      \
1337     __PMC_EV(OCTEON, BADD)                        \
1338     __PMC_EV(OCTEON, BADDL2)                      \
1339     __PMC_EV(OCTEON, BFILL)                       \
1340     __PMC_EV(OCTEON, DDIDS)                       \
1341     __PMC_EV(OCTEON, IDIDS)                       \
1342     __PMC_EV(OCTEON, DIDNA)                       \
1343     __PMC_EV(OCTEON, LDS)                         \
1344     __PMC_EV(OCTEON, LMLDS)                       \
1345     __PMC_EV(OCTEON, IOLDS)                       \
1346     __PMC_EV(OCTEON, DMLDS)                       \
1347     __PMC_EV(OCTEON, STS)                         \
1348     __PMC_EV(OCTEON, LMSTS)                       \
1349     __PMC_EV(OCTEON, IOSTS)                       \
1350     __PMC_EV(OCTEON, IOBDMA)                      \
1351     __PMC_EV(OCTEON, DTLB)                        \
1352     __PMC_EV(OCTEON, DTLBAD)                      \
1353     __PMC_EV(OCTEON, ITLB)                        \
1354     __PMC_EV(OCTEON, SYNC)                        \
1355     __PMC_EV(OCTEON, SYNCIOB)                     \
1356     __PMC_EV(OCTEON, SYNCW)
1357 
1358 #define	PMC_EV_OCTEON_FIRST	PMC_EV_OCTEON_CLK
1359 #define	PMC_EV_OCTEON_LAST	PMC_EV_OCTEON_SYNCW
1360 
1361 #define __PMC_EV_PPC7450()						\
1362 	__PMC_EV(PPC7450, CYCLE)					\
1363 	__PMC_EV(PPC7450, INSTR_COMPLETED)				\
1364 	__PMC_EV(PPC7450, TLB_BIT_TRANSITIONS)				\
1365 	__PMC_EV(PPC7450, INSTR_DISPATCHED)				\
1366 	__PMC_EV(PPC7450, PMON_EXCEPT)					\
1367 	__PMC_EV(PPC7450, PMON_SIG)					\
1368 	__PMC_EV(PPC7450, VPU_INSTR_COMPLETED)				\
1369 	__PMC_EV(PPC7450, VFPU_INSTR_COMPLETED)				\
1370 	__PMC_EV(PPC7450, VIU1_INSTR_COMPLETED)				\
1371 	__PMC_EV(PPC7450, VIU2_INSTR_COMPLETED)				\
1372 	__PMC_EV(PPC7450, MTVSCR_INSTR_COMPLETED)			\
1373 	__PMC_EV(PPC7450, MTVRSAVE_INSTR_COMPLETED)			\
1374 	__PMC_EV(PPC7450, VPU_INSTR_WAIT_CYCLES)			\
1375 	__PMC_EV(PPC7450, VFPU_INSTR_WAIT_CYCLES)			\
1376 	__PMC_EV(PPC7450, VIU1_INSTR_WAIT_CYCLES)			\
1377 	__PMC_EV(PPC7450, VIU2_INSTR_WAIT_CYCLES)			\
1378 	__PMC_EV(PPC7450, MFVSCR_SYNC_CYCLES)				\
1379 	__PMC_EV(PPC7450, VSCR_SAT_SET)					\
1380 	__PMC_EV(PPC7450, STORE_INSTR_COMPLETED)			\
1381 	__PMC_EV(PPC7450, L1_INSTR_CACHE_MISSES)			\
1382 	__PMC_EV(PPC7450, L1_DATA_SNOOPS)				\
1383 	__PMC_EV(PPC7450, UNRESOLVED_BRANCHES)				\
1384 	__PMC_EV(PPC7450, SPEC_BUFFER_CYCLES)				\
1385 	__PMC_EV(PPC7450, BRANCH_UNIT_STALL_CYCLES)			\
1386 	__PMC_EV(PPC7450, TRUE_BRANCH_TARGET_HITS)			\
1387 	__PMC_EV(PPC7450, BRANCH_LINK_STAC_PREDICTED)			\
1388 	__PMC_EV(PPC7450, GPR_ISSUE_QUEUE_DISPATCHES)			\
1389 	__PMC_EV(PPC7450, CYCLES_THREE_INSTR_DISPATCHED)		\
1390 	__PMC_EV(PPC7450, THRESHOLD_INSTR_QUEUE_ENTRIES_CYCLES)		\
1391 	__PMC_EV(PPC7450, THRESHOLD_VEC_INSTR_QUEUE_ENTRIES_CYCLES)	\
1392 	__PMC_EV(PPC7450, CYCLES_NO_COMPLETED_INSTRS)			\
1393 	__PMC_EV(PPC7450, IU2_INSTR_COMPLETED)				\
1394 	__PMC_EV(PPC7450, BRANCHES_COMPLETED)				\
1395 	__PMC_EV(PPC7450, EIEIO_INSTR_COMPLETED)			\
1396 	__PMC_EV(PPC7450, MTSPR_INSTR_COMPLETED)			\
1397 	__PMC_EV(PPC7450, SC_INSTR_COMPLETED)				\
1398 	__PMC_EV(PPC7450, LS_LM_COMPLETED)				\
1399 	__PMC_EV(PPC7450, ITLB_HW_TABLE_SEARCH_CYCLES)			\
1400 	__PMC_EV(PPC7450, DTLB_HW_SEARCH_CYCLES_OVER_THRESHOLD)		\
1401 	__PMC_EV(PPC7450, L1_INSTR_CACHE_ACCESSES)			\
1402 	__PMC_EV(PPC7450, INSTR_BKPT_MATCHES)				\
1403 	__PMC_EV(PPC7450, L1_DATA_CACHE_LOAD_MISS_CYCLES_OVER_THRESHOLD)\
1404 	__PMC_EV(PPC7450, L1_DATA_SNOOP_HIT_ON_MODIFIED)		\
1405 	__PMC_EV(PPC7450, LOAD_MISS_ALIAS)				\
1406 	__PMC_EV(PPC7450, LOAD_MISS_ALIAS_ON_TOUCH)			\
1407 	__PMC_EV(PPC7450, TOUCH_ALIAS)					\
1408 	__PMC_EV(PPC7450, L1_DATA_SNOOP_HIT_CASTOUT_QUEUE)		\
1409 	__PMC_EV(PPC7450, L1_DATA_SNOOP_HIT_CASTOUT)			\
1410 	__PMC_EV(PPC7450, L1_DATA_SNOOP_HITS)				\
1411 	__PMC_EV(PPC7450, WRITE_THROUGH_STORES)				\
1412 	__PMC_EV(PPC7450, CACHE_INHIBITED_STORES)			\
1413 	__PMC_EV(PPC7450, L1_DATA_LOAD_HIT)				\
1414 	__PMC_EV(PPC7450, L1_DATA_TOUCH_HIT)				\
1415 	__PMC_EV(PPC7450, L1_DATA_STORE_HIT)				\
1416 	__PMC_EV(PPC7450, L1_DATA_TOTAL_HITS)				\
1417 	__PMC_EV(PPC7450, DST_INSTR_DISPATCHED)				\
1418 	__PMC_EV(PPC7450, REFRESHED_DSTS)				\
1419 	__PMC_EV(PPC7450, SUCCESSFUL_DST_TABLE_SEARCHES)		\
1420 	__PMC_EV(PPC7450, DSS_INSTR_COMPLETED)				\
1421 	__PMC_EV(PPC7450, DST_STREAM_0_CACHE_LINE_FETCHES)		\
1422 	__PMC_EV(PPC7450, VTQ_SUSPENDS_DUE_TO_CTX_CHANGE)		\
1423 	__PMC_EV(PPC7450, VTQ_LINE_FETCH_HIT)				\
1424 	__PMC_EV(PPC7450, VEC_LOAD_INSTR_COMPLETED)			\
1425 	__PMC_EV(PPC7450, FP_STORE_INSTR_COMPLETED_IN_LSU)		\
1426 	__PMC_EV(PPC7450, FPU_RENORMALIZATION)				\
1427 	__PMC_EV(PPC7450, FPU_DENORMALIZATION)				\
1428 	__PMC_EV(PPC7450, FP_STORE_CAUSES_STALL_IN_LSU)			\
1429 	__PMC_EV(PPC7450, LD_ST_TRUE_ALIAS_STALL)			\
1430 	__PMC_EV(PPC7450, LSU_INDEXED_ALIAS_STALL)			\
1431 	__PMC_EV(PPC7450, LSU_ALIAS_VS_FSQ_WB0_WB1)			\
1432 	__PMC_EV(PPC7450, LSU_ALIAS_VS_CSQ)				\
1433 	__PMC_EV(PPC7450, LSU_LOAD_HIT_LINE_ALIAS_VS_CSQ0)		\
1434 	__PMC_EV(PPC7450, LSU_LOAD_MISS_LINE_ALIAS_VS_CSQ0)		\
1435 	__PMC_EV(PPC7450, LSU_TOUCH_LINE_ALIAS_VS_FSQ_WB0_WB1)		\
1436 	__PMC_EV(PPC7450, LSU_TOUCH_ALIAS_VS_CSQ)			\
1437 	__PMC_EV(PPC7450, LSU_LMQ_FULL_STALL)				\
1438 	__PMC_EV(PPC7450, FP_LOAD_INSTR_COMPLETED_IN_LSU)		\
1439 	__PMC_EV(PPC7450, FP_LOAD_SINGLE_INSTR_COMPLETED_IN_LSU)	\
1440 	__PMC_EV(PPC7450, FP_LOAD_DOUBLE_COMPLETED_IN_LSU)		\
1441 	__PMC_EV(PPC7450, LSU_RA_LATCH_STALL)				\
1442 	__PMC_EV(PPC7450, LSU_LOAD_VS_STORE_QUEUE_ALIAS_STALL)		\
1443 	__PMC_EV(PPC7450, LSU_LMQ_INDEX_ALIAS)				\
1444 	__PMC_EV(PPC7450, LSU_STORE_QUEUE_INDEX_ALIAS)			\
1445 	__PMC_EV(PPC7450, LSU_CSQ_FORWARDING)				\
1446 	__PMC_EV(PPC7450, LSU_MISALIGNED_LOAD_FINISH)			\
1447 	__PMC_EV(PPC7450, LSU_MISALIGN_STORE_COMPLETED)			\
1448 	__PMC_EV(PPC7450, LSU_MISALIGN_STALL)				\
1449 	__PMC_EV(PPC7450, FP_ONE_QUARTER_FPSCR_RENAMES_BUSY)		\
1450 	__PMC_EV(PPC7450, FP_ONE_HALF_FPSCR_RENAMES_BUSY)		\
1451 	__PMC_EV(PPC7450, FP_THREE_QUARTERS_FPSCR_RENAMES_BUSY)		\
1452 	__PMC_EV(PPC7450, FP_ALL_FPSCR_RENAMES_BUSY)			\
1453 	__PMC_EV(PPC7450, FP_DENORMALIZED_RESULT)			\
1454 	__PMC_EV(PPC7450, L1_DATA_TOTAL_MISSES)				\
1455 	__PMC_EV(PPC7450, DISPATCHES_TO_FPR_ISSUE_QUEUE)		\
1456 	__PMC_EV(PPC7450, LSU_INSTR_COMPLETED)				\
1457 	__PMC_EV(PPC7450, LOAD_INSTR_COMPLETED)				\
1458 	__PMC_EV(PPC7450, SS_SM_INSTR_COMPLETED)			\
1459 	__PMC_EV(PPC7450, TLBIE_INSTR_COMPLETED)			\
1460 	__PMC_EV(PPC7450, LWARX_INSTR_COMPLETED)			\
1461 	__PMC_EV(PPC7450, MFSPR_INSTR_COMPLETED)			\
1462 	__PMC_EV(PPC7450, REFETCH_SERIALIZATION)			\
1463 	__PMC_EV(PPC7450, COMPLETION_QUEUE_ENTRIES_OVER_THRESHOLD)	\
1464 	__PMC_EV(PPC7450, CYCLES_ONE_INSTR_DISPATCHED)			\
1465 	__PMC_EV(PPC7450, CYCLES_TWO_INSTR_COMPLETED)			\
1466 	__PMC_EV(PPC7450, ITLB_NON_SPECULATIVE_MISSES)			\
1467 	__PMC_EV(PPC7450, CYCLES_WAITING_FROM_L1_INSTR_CACHE_MISS)	\
1468 	__PMC_EV(PPC7450, L1_DATA_LOAD_ACCESS_MISS)			\
1469 	__PMC_EV(PPC7450, L1_DATA_TOUCH_MISS)				\
1470 	__PMC_EV(PPC7450, L1_DATA_STORE_MISS)				\
1471 	__PMC_EV(PPC7450, L1_DATA_TOUCH_MISS_CYCLES)			\
1472 	__PMC_EV(PPC7450, L1_DATA_CYCLES_USED)				\
1473 	__PMC_EV(PPC7450, DST_STREAM_1_CACHE_LINE_FETCHES)		\
1474 	__PMC_EV(PPC7450, VTQ_STREAM_CANCELED_PREMATURELY)		\
1475 	__PMC_EV(PPC7450, VTQ_RESUMES_DUE_TO_CTX_CHANGE)		\
1476 	__PMC_EV(PPC7450, VTQ_LINE_FETCH_MISS)				\
1477 	__PMC_EV(PPC7450, VTQ_LINE_FETCH)				\
1478 	__PMC_EV(PPC7450, TLBIE_SNOOPS)					\
1479 	__PMC_EV(PPC7450, L1_INSTR_CACHE_RELOADS)			\
1480 	__PMC_EV(PPC7450, L1_DATA_CACHE_RELOADS)			\
1481 	__PMC_EV(PPC7450, L1_DATA_CACHE_CASTOUTS_TO_L2)			\
1482 	__PMC_EV(PPC7450, STORE_MERGE_GATHER)				\
1483 	__PMC_EV(PPC7450, CACHEABLE_STORE_MERGE_TO_32_BYTES)		\
1484 	__PMC_EV(PPC7450, DATA_BKPT_MATCHES)				\
1485 	__PMC_EV(PPC7450, FALL_THROUGH_BRANCHES_PROCESSED)		\
1486 	__PMC_EV(PPC7450,						\
1487 	    FIRST_SPECULATIVE_BRANCH_BUFFER_RESOLVED_CORRECTLY)		\
1488 	__PMC_EV(PPC7450, SECOND_SPECULATION_BUFFER_ACTIVE)		\
1489 	__PMC_EV(PPC7450, BPU_STALL_ON_LR_DEPENDENCY)			\
1490 	__PMC_EV(PPC7450, BTIC_MISS)					\
1491 	__PMC_EV(PPC7450, BRANCH_LINK_STACK_CORRECTLY_RESOLVED)		\
1492 	__PMC_EV(PPC7450, FPR_ISSUE_STALLED)				\
1493 	__PMC_EV(PPC7450, SWITCHES_BETWEEN_PRIV_USER)			\
1494 	__PMC_EV(PPC7450, LSU_COMPLETES_FP_STORE_SINGLE)		\
1495 	__PMC_EV(PPC7450, VR_ISSUE_QUEUE_DISPATCHES)			\
1496 	__PMC_EV(PPC7450, VR_STALLS)					\
1497 	__PMC_EV(PPC7450, GPR_RENAME_BUFFER_ENTRIES_OVER_THRESHOLD)	\
1498 	__PMC_EV(PPC7450, FPR_ISSUE_QUEUE_ENTRIES)			\
1499 	__PMC_EV(PPC7450, FPU_INSTR_COMPLETED)				\
1500 	__PMC_EV(PPC7450, STWCX_INSTR_COMPLETED)			\
1501 	__PMC_EV(PPC7450, LS_LM_INSTR_PIECES)				\
1502 	__PMC_EV(PPC7450, ITLB_HW_SEARCH_CYCLES_OVER_THRESHOLD)		\
1503 	__PMC_EV(PPC7450, DTLB_MISSES)					\
1504 	__PMC_EV(PPC7450, CANCELLED_L1_INSTR_CACHE_MISSES)		\
1505 	__PMC_EV(PPC7450, L1_DATA_CACHE_OP_HIT)				\
1506 	__PMC_EV(PPC7450, L1_DATA_LOAD_MISS_CYCLES)			\
1507 	__PMC_EV(PPC7450, L1_DATA_PUSHES)				\
1508 	__PMC_EV(PPC7450, L1_DATA_TOTAL_MISS)				\
1509 	__PMC_EV(PPC7450, VT2_FETCHES)					\
1510 	__PMC_EV(PPC7450, TAKEN_BRANCHES_PROCESSED)			\
1511 	__PMC_EV(PPC7450, BRANCH_FLUSHES)				\
1512 	__PMC_EV(PPC7450,						\
1513 	    SECOND_SPECULATIVE_BRANCH_BUFFER_RESOLVED_CORRECTLY)	\
1514 	__PMC_EV(PPC7450, THIRD_SPECULATION_BUFFER_ACTIVE)		\
1515 	__PMC_EV(PPC7450, BRANCH_UNIT_STALL_ON_CTR_DEPENDENCY)		\
1516 	__PMC_EV(PPC7450, FAST_BTIC_HIT)				\
1517 	__PMC_EV(PPC7450, BRANCH_LINK_STACK_MISPREDICTED)		\
1518 	__PMC_EV(PPC7450, CYCLES_THREE_INSTR_COMPLETED)			\
1519 	__PMC_EV(PPC7450, CYCLES_NO_INSTR_DISPATCHED)			\
1520 	__PMC_EV(PPC7450, GPR_ISSUE_QUEUE_ENTRIES_OVER_THRESHOLD)	\
1521 	__PMC_EV(PPC7450, GPR_ISSUE_QUEUE_STALLED)			\
1522 	__PMC_EV(PPC7450, IU1_INSTR_COMPLETED)				\
1523 	__PMC_EV(PPC7450, DSSALL_INSTR_COMPLETED)			\
1524 	__PMC_EV(PPC7450, TLBSYNC_INSTR_COMPLETED)			\
1525 	__PMC_EV(PPC7450, SYNC_INSTR_COMPLETED)				\
1526 	__PMC_EV(PPC7450, SS_SM_INSTR_PIECES)				\
1527 	__PMC_EV(PPC7450, DTLB_HW_SEARCH_CYCLES)			\
1528 	__PMC_EV(PPC7450, SNOOP_RETRIES)				\
1529 	__PMC_EV(PPC7450, SUCCESSFUL_STWCX)				\
1530 	__PMC_EV(PPC7450, DST_STREAM_3_CACHE_LINE_FETCHES)		\
1531 	__PMC_EV(PPC7450,						\
1532 	    THIRD_SPECULATIVE_BRANCH_BUFFER_RESOLVED_CORRECTLY)		\
1533 	__PMC_EV(PPC7450, MISPREDICTED_BRANCHES)			\
1534 	__PMC_EV(PPC7450, FOLDED_BRANCHES)				\
1535 	__PMC_EV(PPC7450, FP_STORE_DOUBLE_COMPLETES_IN_LSU)		\
1536 	__PMC_EV(PPC7450, L2_CACHE_HITS)				\
1537 	__PMC_EV(PPC7450, L3_CACHE_HITS)				\
1538 	__PMC_EV(PPC7450, L2_INSTR_CACHE_MISSES)			\
1539 	__PMC_EV(PPC7450, L3_INSTR_CACHE_MISSES)			\
1540 	__PMC_EV(PPC7450, L2_DATA_CACHE_MISSES)				\
1541 	__PMC_EV(PPC7450, L3_DATA_CACHE_MISSES)				\
1542 	__PMC_EV(PPC7450, L2_LOAD_HITS)					\
1543 	__PMC_EV(PPC7450, L2_STORE_HITS)				\
1544 	__PMC_EV(PPC7450, L3_LOAD_HITS)					\
1545 	__PMC_EV(PPC7450, L3_STORE_HITS)				\
1546 	__PMC_EV(PPC7450, L2_TOUCH_HITS)				\
1547 	__PMC_EV(PPC7450, L3_TOUCH_HITS)				\
1548 	__PMC_EV(PPC7450, SNOOP_MODIFIED)				\
1549 	__PMC_EV(PPC7450, SNOOP_VALID)					\
1550 	__PMC_EV(PPC7450, INTERVENTION)					\
1551 	__PMC_EV(PPC7450, L2_CACHE_MISSES)				\
1552 	__PMC_EV(PPC7450, L3_CACHE_MISSES)				\
1553 	__PMC_EV(PPC7450, L2_CACHE_CASTOUTS)				\
1554 	__PMC_EV(PPC7450, L3_CACHE_CASTOUTS)				\
1555 	__PMC_EV(PPC7450, L2SQ_FULL_CYCLES)				\
1556 	__PMC_EV(PPC7450, L3SQ_FULL_CYCLES)				\
1557 	__PMC_EV(PPC7450, RAQ_FULL_CYCLES)				\
1558 	__PMC_EV(PPC7450, WAQ_FULL_CYCLES)				\
1559 	__PMC_EV(PPC7450, L1_EXTERNAL_INTERVENTIONS)			\
1560 	__PMC_EV(PPC7450, L2_EXTERNAL_INTERVENTIONS)			\
1561 	__PMC_EV(PPC7450, L3_EXTERNAL_INTERVENTIONS)			\
1562 	__PMC_EV(PPC7450, EXTERNAL_INTERVENTIONS)			\
1563 	__PMC_EV(PPC7450, EXTERNAL_PUSHES)				\
1564 	__PMC_EV(PPC7450, EXTERNAL_SNOOP_RETRY)				\
1565 	__PMC_EV(PPC7450, DTQ_FULL_CYCLES)				\
1566 	__PMC_EV(PPC7450, BUS_RETRY)					\
1567 	__PMC_EV(PPC7450, L2_VALID_REQUEST)				\
1568 	__PMC_EV(PPC7450, BORDQ_FULL)					\
1569 	__PMC_EV(PPC7450, BUS_TAS_FOR_READS)				\
1570 	__PMC_EV(PPC7450, BUS_TAS_FOR_WRITES)				\
1571 	__PMC_EV(PPC7450, BUS_READS_NOT_RETRIED)			\
1572 	__PMC_EV(PPC7450, BUS_WRITES_NOT_RETRIED)			\
1573 	__PMC_EV(PPC7450, BUS_READS_WRITES_NOT_RETRIED)			\
1574 	__PMC_EV(PPC7450, BUS_RETRY_DUE_TO_L1_RETRY)			\
1575 	__PMC_EV(PPC7450, BUS_RETRY_DUE_TO_PREVIOUS_ADJACENT)		\
1576 	__PMC_EV(PPC7450, BUS_RETRY_DUE_TO_COLLISION)			\
1577 	__PMC_EV(PPC7450, BUS_RETRY_DUE_TO_INTERVENTION_ORDERING)	\
1578 	__PMC_EV(PPC7450, SNOOP_REQUESTS)				\
1579 	__PMC_EV(PPC7450, PREFETCH_ENGINE_REQUEST)			\
1580 	__PMC_EV(PPC7450, PREFETCH_ENGINE_COLLISION_VS_LOAD)		\
1581 	__PMC_EV(PPC7450, PREFETCH_ENGINE_COLLISION_VS_STORE)		\
1582 	__PMC_EV(PPC7450, PREFETCH_ENGINE_COLLISION_VS_INSTR_FETCH)	\
1583 	__PMC_EV(PPC7450,						\
1584 	    PREFETCH_ENGINE_COLLISION_VS_LOAD_STORE_INSTR_FETCH)	\
1585 	__PMC_EV(PPC7450, PREFETCH_ENGINE_FULL)
1586 
1587 #define PMC_EV_PPC7450_FIRST	PMC_EV_PPC7450_CYCLE
1588 #define PMC_EV_PPC7450_LAST	PMC_EV_PPC7450_PREFETCH_ENGINE_FULL
1589 
1590 #define __PMC_EV_PPC970() \
1591 	__PMC_EV(PPC970, INSTR_COMPLETED) \
1592 	__PMC_EV(PPC970, MARKED_GROUP_DISPATCH) \
1593 	__PMC_EV(PPC970, MARKED_STORE_COMPLETED) \
1594 	__PMC_EV(PPC970, GCT_EMPTY) \
1595 	__PMC_EV(PPC970, RUN_CYCLES) \
1596 	__PMC_EV(PPC970, OVERFLOW) \
1597 	__PMC_EV(PPC970, CYCLES) \
1598 	__PMC_EV(PPC970, THRESHOLD_TIMEOUT) \
1599 	__PMC_EV(PPC970, GROUP_DISPATCH) \
1600 	__PMC_EV(PPC970, BR_MARKED_INSTR_FINISH) \
1601 	__PMC_EV(PPC970, GCT_EMPTY_BY_SRQ_FULL) \
1602 	__PMC_EV(PPC970, STOP_COMPLETION) \
1603 	__PMC_EV(PPC970, LSU_EMPTY) \
1604 	__PMC_EV(PPC970, MARKED_STORE_WITH_INTR) \
1605 	__PMC_EV(PPC970, CYCLES_IN_SUPER) \
1606 	__PMC_EV(PPC970, VPU_MARKED_INSTR_COMPLETED) \
1607 	__PMC_EV(PPC970, FXU0_IDLE_FXU1_BUSY) \
1608 	__PMC_EV(PPC970, SRQ_EMPTY) \
1609 	__PMC_EV(PPC970, MARKED_GROUP_COMPLETED) \
1610 	__PMC_EV(PPC970, CR_MARKED_INSTR_FINISH) \
1611 	__PMC_EV(PPC970, DISPATCH_SUCCESS) \
1612 	__PMC_EV(PPC970, FXU0_IDLE_FXU1_IDLE) \
1613 	__PMC_EV(PPC970, ONE_PLUS_INSTR_COMPLETED) \
1614 	__PMC_EV(PPC970, GROUP_MARKED_IDU) \
1615 	__PMC_EV(PPC970, MARKED_GROUP_COMPLETE_TIMEOUT) \
1616 	__PMC_EV(PPC970, FXU0_BUSY_FXU1_BUSY) \
1617 	__PMC_EV(PPC970, MARKED_STORE_SENT_TO_STS) \
1618 	__PMC_EV(PPC970, FXU_MARKED_INSTR_FINISHED) \
1619 	__PMC_EV(PPC970, MARKED_GROUP_ISSUED) \
1620 	__PMC_EV(PPC970, FXU0_BUSY_FXU1_IDLE) \
1621 	__PMC_EV(PPC970, GROUP_COMPLETED) \
1622 	__PMC_EV(PPC970, FPU_MARKED_INSTR_COMPLETED) \
1623 	__PMC_EV(PPC970, MARKED_INSTR_FINISH_ANY_UNIT) \
1624 	__PMC_EV(PPC970, EXTERNAL_INTERRUPT) \
1625 	__PMC_EV(PPC970, GROUP_DISPATCH_REJECT) \
1626 	__PMC_EV(PPC970, LSU_MARKED_INSTR_FINISH) \
1627 	__PMC_EV(PPC970, TIMEBASE_EVENT) \
1628 	__PMC_EV(PPC970, LSU_COMPLETION_STALL) \
1629 	__PMC_EV(PPC970, FXU_COMPLETION_STALL) \
1630 	__PMC_EV(PPC970, DCACHE_MISS_COMPLETION_STALL) \
1631 	__PMC_EV(PPC970, FPU_COMPLETION_STALL) \
1632 	__PMC_EV(PPC970, FXU_LONG_INSTR_COMPLETION_STALL) \
1633 	__PMC_EV(PPC970, REJECT_COMPLETION_STALL) \
1634 	__PMC_EV(PPC970, FPU_LONG_INSTR_COMPLETION_STALL) \
1635 	__PMC_EV(PPC970, GCT_EMPTY_BY_ICACHE_MISS) \
1636 	__PMC_EV(PPC970, REJECT_COMPLETION_STALL_ERAT_MISS) \
1637 	__PMC_EV(PPC970, GCT_EMPTY_BY_BRANCH_MISS_PREDICT) \
1638 	__PMC_EV(PPC970, BUS_HIGH) \
1639 	__PMC_EV(PPC970, BUS_LOW) \
1640 	__PMC_EV(PPC970, ADDER)
1641 
1642 
1643 #define PMC_EV_PPC970_FIRST		PMC_EV_PPC970_INSTR_COMPLETED
1644 #define PMC_EV_PPC970_LAST		PMC_EV_PPC970_ADDER
1645 
1646 #define __PMC_EV_E500() \
1647 	__PMC_EV(E500, CYCLES) \
1648 	__PMC_EV(E500, INSTR_COMPLETED) \
1649 	__PMC_EV(E500, UOPS_COMPLETED) \
1650 	__PMC_EV(E500, INSTR_FETCHED) \
1651 	__PMC_EV(E500, UOPS_DECODED) \
1652 	__PMC_EV(E500, PM_EVENT_TRANSITIONS) \
1653 	__PMC_EV(E500, PM_EVENT_CYCLES) \
1654 	__PMC_EV(E500, BRANCH_INSTRS_COMPLETED) \
1655 	__PMC_EV(E500, LOAD_UOPS_COMPLETED) \
1656 	__PMC_EV(E500, STORE_UOPS_COMPLETED) \
1657 	__PMC_EV(E500, CQ_REDIRECTS) \
1658 	__PMC_EV(E500, BRANCHES_FINISHED) \
1659 	__PMC_EV(E500, TAKEN_BRANCHES_FINISHED) \
1660 	__PMC_EV(E500, FINISHED_UNCOND_BRANCHES_MISS_BTB) \
1661 	__PMC_EV(E500, BRANCH_MISPRED) \
1662 	__PMC_EV(E500, BTB_BRANCH_MISPRED_FROM_DIRECTION) \
1663 	__PMC_EV(E500, BTB_HITS_PSEUDO_HITS) \
1664 	__PMC_EV(E500, CYCLES_DECODE_STALLED) \
1665 	__PMC_EV(E500, CYCLES_ISSUE_STALLED) \
1666 	__PMC_EV(E500, CYCLES_BRANCH_ISSUE_STALLED) \
1667 	__PMC_EV(E500, CYCLES_SU1_SCHED_STALLED) \
1668 	__PMC_EV(E500, CYCLES_SU2_SCHED_STALLED) \
1669 	__PMC_EV(E500, CYCLES_MU_SCHED_STALLED) \
1670 	__PMC_EV(E500, CYCLES_LRU_SCHED_STALLED) \
1671 	__PMC_EV(E500, CYCLES_BU_SCHED_STALLED) \
1672 	__PMC_EV(E500, TOTAL_TRANSLATED) \
1673 	__PMC_EV(E500, LOADS_TRANSLATED) \
1674 	__PMC_EV(E500, STORES_TRANSLATED) \
1675 	__PMC_EV(E500, TOUCHES_TRANSLATED) \
1676 	__PMC_EV(E500, CACHEOPS_TRANSLATED) \
1677 	__PMC_EV(E500, CACHE_INHIBITED_ACCESS_TRANSLATED) \
1678 	__PMC_EV(E500, GUARDED_LOADS_TRANSLATED) \
1679 	__PMC_EV(E500, WRITE_THROUGH_STORES_TRANSLATED) \
1680 	__PMC_EV(E500, MISALIGNED_LOAD_STORE_ACCESS_TRANSLATED) \
1681 	__PMC_EV(E500, TOTAL_ALLOCATED_TO_DLFB) \
1682 	__PMC_EV(E500, LOADS_TRANSLATED_ALLOCATED_TO_DLFB) \
1683 	__PMC_EV(E500, STORES_COMPLETED_ALLOCATED_TO_DLFB) \
1684 	__PMC_EV(E500, TOUCHES_TRANSLATED_ALLOCATED_TO_DLFB) \
1685 	__PMC_EV(E500, STORES_COMPLETED) \
1686 	__PMC_EV(E500, DATA_L1_CACHE_LOCKS) \
1687 	__PMC_EV(E500, DATA_L1_CACHE_RELOADS) \
1688 	__PMC_EV(E500, DATA_L1_CACHE_CASTOUTS) \
1689 	__PMC_EV(E500, LOAD_MISS_DLFB_FULL) \
1690 	__PMC_EV(E500, LOAD_MISS_LDQ_FULL) \
1691 	__PMC_EV(E500, LOAD_GUARDED_MISS) \
1692 	__PMC_EV(E500, STORE_TRANSLATE_WHEN_QUEUE_FULL) \
1693 	__PMC_EV(E500, ADDRESS_COLLISION) \
1694 	__PMC_EV(E500, DATA_MMU_MISS) \
1695 	__PMC_EV(E500, DATA_MMU_BUSY) \
1696 	__PMC_EV(E500, PART2_MISALIGNED_CACHE_ACCESS) \
1697 	__PMC_EV(E500, LOAD_MISS_DLFB_FULL_CYCLES) \
1698 	__PMC_EV(E500, LOAD_MISS_LDQ_FULL_CYCLES) \
1699 	__PMC_EV(E500, LOAD_GUARDED_MISS_CYCLES) \
1700 	__PMC_EV(E500, STORE_TRANSLATE_WHEN_QUEUE_FULL_CYCLES) \
1701 	__PMC_EV(E500, ADDRESS_COLLISION_CYCLES) \
1702 	__PMC_EV(E500, DATA_MMU_MISS_CYCLES) \
1703 	__PMC_EV(E500, DATA_MMU_BUSY_CYCLES) \
1704 	__PMC_EV(E500, PART2_MISALIGNED_CACHE_ACCESS_CYCLES) \
1705 	__PMC_EV(E500, INSTR_L1_CACHE_LOCKS) \
1706 	__PMC_EV(E500, INSTR_L1_CACHE_RELOADS) \
1707 	__PMC_EV(E500, INSTR_L1_CACHE_FETCHES) \
1708 	__PMC_EV(E500, INSTR_MMU_TLB4K_RELOADS) \
1709 	__PMC_EV(E500, INSTR_MMU_VSP_RELOADS) \
1710 	__PMC_EV(E500, DATA_MMU_TLB4K_RELOADS) \
1711 	__PMC_EV(E500, DATA_MMU_VSP_RELOADS) \
1712 	__PMC_EV(E500, L2MMU_MISSES) \
1713 	__PMC_EV(E500, BIU_MASTER_REQUESTS) \
1714 	__PMC_EV(E500, BIU_MASTER_INSTR_SIDE_REQUESTS) \
1715 	__PMC_EV(E500, BIU_MASTER_DATA_SIDE_REQUESTS) \
1716 	__PMC_EV(E500, BIU_MASTER_DATA_SIDE_CASTOUT_REQUESTS) \
1717 	__PMC_EV(E500, BIU_MASTER_RETRIES) \
1718 	__PMC_EV(E500, SNOOP_REQUESTS) \
1719 	__PMC_EV(E500, SNOOP_HITS) \
1720 	__PMC_EV(E500, SNOOP_PUSHES) \
1721 	__PMC_EV(E500, SNOOP_RETRIES) \
1722 	__PMC_EV(E500, DLFB_LOAD_MISS_CYCLES) \
1723 	__PMC_EV(E500, ILFB_FETCH_MISS_CYCLES) \
1724 	__PMC_EV(E500, EXT_INPU_INTR_LATENCY_CYCLES) \
1725 	__PMC_EV(E500, CRIT_INPUT_INTR_LATENCY_CYCLES) \
1726 	__PMC_EV(E500, EXT_INPUT_INTR_PENDING_LATENCY_CYCLES) \
1727 	__PMC_EV(E500, CRIT_INPUT_INTR_PENDING_LATENCY_CYCLES) \
1728 	__PMC_EV(E500, PMC0_OVERFLOW) \
1729 	__PMC_EV(E500, PMC1_OVERFLOW) \
1730 	__PMC_EV(E500, PMC2_OVERFLOW) \
1731 	__PMC_EV(E500, PMC3_OVERFLOW) \
1732 	__PMC_EV(E500, INTERRUPTS_TAKEN) \
1733 	__PMC_EV(E500, EXT_INPUT_INTR_TAKEN) \
1734 	__PMC_EV(E500, CRIT_INPUT_INTR_TAKEN) \
1735 	__PMC_EV(E500, SYSCALL_TRAP_INTR) \
1736 	__PMC_EV(E500, TLB_BIT_TRANSITIONS) \
1737 	__PMC_EV(E500, L2_LINEFILL_BUFFER) \
1738 	__PMC_EV(E500, LV2_VS) \
1739 	__PMC_EV(E500, CASTOUTS_RELEASED) \
1740 	__PMC_EV(E500, INTV_ALLOCATIONS) \
1741 	__PMC_EV(E500, DLFB_RETRIES_TO_MBAR) \
1742 	__PMC_EV(E500, STORE_RETRIES) \
1743 	__PMC_EV(E500, STASH_L1_HITS) \
1744 	__PMC_EV(E500, STASH_L2_HITS) \
1745 	__PMC_EV(E500, STASH_BUSY_1) \
1746 	__PMC_EV(E500, STASH_BUSY_2) \
1747 	__PMC_EV(E500, STASH_BUSY_3) \
1748 	__PMC_EV(E500, STASH_HITS) \
1749 	__PMC_EV(E500, STASH_HIT_DLFB) \
1750 	__PMC_EV(E500, STASH_REQUESTS) \
1751 	__PMC_EV(E500, STASH_REQUESTS_L1) \
1752 	__PMC_EV(E500, STASH_REQUESTS_L2) \
1753 	__PMC_EV(E500, STALLS_NO_CAQ_OR_COB) \
1754 	__PMC_EV(E500, L2_CACHE_ACCESSES) \
1755 	__PMC_EV(E500, L2_HIT_CACHE_ACCESSES) \
1756 	__PMC_EV(E500, L2_CACHE_DATA_ACCESSES) \
1757 	__PMC_EV(E500, L2_CACHE_DATA_HITS) \
1758 	__PMC_EV(E500, L2_CACHE_INSTR_ACCESSES) \
1759 	__PMC_EV(E500, L2_CACHE_INSTR_HITS) \
1760 	__PMC_EV(E500, L2_CACHE_ALLOCATIONS) \
1761 	__PMC_EV(E500, L2_CACHE_DATA_ALLOCATIONS) \
1762 	__PMC_EV(E500, L2_CACHE_DIRTY_DATA_ALLOCATIONS) \
1763 	__PMC_EV(E500, L2_CACHE_INSTR_ALLOCATIONS) \
1764 	__PMC_EV(E500, L2_CACHE_UPDATES) \
1765 	__PMC_EV(E500, L2_CACHE_CLEAN_UPDATES) \
1766 	__PMC_EV(E500, L2_CACHE_DIRTY_UPDATES) \
1767 	__PMC_EV(E500, L2_CACHE_CLEAN_REDUNDANT_UPDATES) \
1768 	__PMC_EV(E500, L2_CACHE_DIRTY_REDUNDANT_UPDATES) \
1769 	__PMC_EV(E500, L2_CACHE_LOCKS) \
1770 	__PMC_EV(E500, L2_CACHE_CASTOUTS) \
1771 	__PMC_EV(E500, L2_CACHE_DATA_DIRTY_HITS) \
1772 	__PMC_EV(E500, INSTR_LFB_WENT_HIGH_PRIORITY) \
1773 	__PMC_EV(E500, SNOOP_THROTTLING_TURNED_ON) \
1774 	__PMC_EV(E500, L2_CLEAN_LINE_INVALIDATIONS) \
1775 	__PMC_EV(E500, L2_INCOHERENT_LINE_INVALIDATIONS) \
1776 	__PMC_EV(E500, L2_COHERENT_LINE_INVALIDATIONS) \
1777 	__PMC_EV(E500, COHERENT_LOOKUP_MISS_DUE_TO_VALID_BUT_INCOHERENT_MATCHES) \
1778 	__PMC_EV(E500, IAC1S_DETECTED) \
1779 	__PMC_EV(E500, IAC2S_DETECTED) \
1780 	__PMC_EV(E500, DAC1S_DTECTED) \
1781 	__PMC_EV(E500, DAC2S_DTECTED) \
1782 	__PMC_EV(E500, DVT0_DETECTED) \
1783 	__PMC_EV(E500, DVT1_DETECTED) \
1784 	__PMC_EV(E500, DVT2_DETECTED) \
1785 	__PMC_EV(E500, DVT3_DETECTED) \
1786 	__PMC_EV(E500, DVT4_DETECTED) \
1787 	__PMC_EV(E500, DVT5_DETECTED) \
1788 	__PMC_EV(E500, DVT6_DETECTED) \
1789 	__PMC_EV(E500, DVT7_DETECTED) \
1790 	__PMC_EV(E500, CYCLES_COMPLETION_STALLED_NEXUS_FIFO_FULL) \
1791 	__PMC_EV(E500, FPU_DOUBLE_PUMP) \
1792 	__PMC_EV(E500, FPU_FINISH) \
1793 	__PMC_EV(E500, FPU_DIVIDE_CYCLES) \
1794 	__PMC_EV(E500, FPU_DENORM_INPUT_CYCLES) \
1795 	__PMC_EV(E500, FPU_RESULT_STALL_CYCLES) \
1796 	__PMC_EV(E500, FPU_FPSCR_FULL_STALL) \
1797 	__PMC_EV(E500, FPU_PIPE_SYNC_STALLS) \
1798 	__PMC_EV(E500, FPU_INPUT_DATA_STALLS) \
1799 	__PMC_EV(E500, DECORATED_LOADS) \
1800 	__PMC_EV(E500, DECORATED_STORES) \
1801 	__PMC_EV(E500, LOAD_RETRIES) \
1802 	__PMC_EV(E500, STWCX_SUCCESSES) \
1803 	__PMC_EV(E500, STWCX_FAILURES) \
1804 
1805 #define PMC_EV_E500_FIRST		PMC_EV_E500_CYCLES
1806 #define PMC_EV_E500_LAST		PMC_EV_E500_STWCX_FAILURES
1807 /*
1808  * All known PMC events.
1809  *
1810  * PMC event numbers are allocated sparsely to allow new PMC events to
1811  * be added to a PMC class without breaking ABI compatibility.  The
1812  * current allocation scheme is:
1813  *
1814  * START	#EVENTS		DESCRIPTION
1815  * 0		0x1000		Reserved
1816  * 0x1000	0x0001		TSC
1817  * 0x2000	0x0080		AMD K7 events
1818  * 0x2080	0x0100		AMD K8 events
1819  * 0x10000	0x0080		INTEL architectural fixed-function events
1820  * 0x10080	0x0F80		INTEL architectural programmable events
1821  * 0x11000	0x0080		INTEL Pentium 4 events
1822  * 0x11080	0x0080		INTEL Pentium MMX events
1823  * 0x11100	0x0100		INTEL Pentium Pro/P-II/P-III/Pentium-M events
1824  * 0x11200	0x00FF		free (was INTEL XScale events)
1825  * 0x11300	0x00FF		MIPS 24K events
1826  * 0x11400	0x00FF		Octeon events
1827  * 0x11500	0x00FF		MIPS 74K events
1828  * 0x11600	0x00FF		BERI statcounters
1829  * 0x13000	0x00FF		MPC7450 events
1830  * 0x13100	0x00FF		IBM PPC970 events
1831  * 0x13200	0x00FF		free (was IBM POWER8 events)
1832  * 0x13300	0x00FF		Freescale e500 events
1833  * 0x14000	0x0100		ARMv7 events
1834  * 0x14100	0x0100		ARMv8 events
1835  * 0x20000	0x1000		Software events
1836  */
1837 #define	__PMC_EVENTS()				\
1838 	__PMC_EV_BLOCK(TSC,	0x01000)	\
1839 	__PMC_EV_TSC()				\
1840 	__PMC_EV_BLOCK(IAF,     0x10000)	\
1841 	__PMC_EV_IAF()				\
1842 	__PMC_EV_BLOCK(K7,	0x2000)		\
1843 	__PMC_EV_K7()				\
1844 	__PMC_EV_BLOCK(K8,	0x2080)	        \
1845 	__PMC_EV_K8()				\
1846 	__PMC_EV_BLOCK(MIPS24K,	0x11300)	\
1847 	__PMC_EV_MIPS24K()			\
1848 	__PMC_EV_BLOCK(OCTEON,	0x11400)	\
1849 	__PMC_EV_OCTEON()			\
1850 	__PMC_EV_BLOCK(MIPS74K,	0x11500)        \
1851 	__PMC_EV_MIPS74K()			\
1852 	__PMC_EV_BLOCK(BERI,	0x11600)        \
1853 	__PMC_EV_BERI()				\
1854 	__PMC_EV_BLOCK(UCP,     0x12080)        \
1855 	__PMC_EV_UCP()				\
1856 	__PMC_EV_BLOCK(PPC7450,	0x13000)	\
1857 	__PMC_EV_PPC7450()			\
1858 	__PMC_EV_BLOCK(PPC970,	0x13100)	\
1859 	__PMC_EV_PPC970()			\
1860 	__PMC_EV_BLOCK(E500,	0x13300)	\
1861 	__PMC_EV_E500()				\
1862 	__PMC_EV_BLOCK(ARMV7,	0x14000)	\
1863 	__PMC_EV_ARMV7()			\
1864 	__PMC_EV_BLOCK(ARMV8,	0x14100)	\
1865 	__PMC_EV_ARMV8()
1866 
1867 #define	PMC_EVENT_FIRST	PMC_EV_TSC_TSC
1868 #define	PMC_EVENT_LAST	PMC_EV_SOFT_LAST
1869 
1870 #endif /* _DEV_HWPMC_PMC_EVENTS_H_ */
1871