xref: /linux/tools/perf/arch/powerpc/util/utils_header.h (revision 0526b56cbc3c489642bd6a5fe4b718dea7ef0ee8)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __PERF_UTIL_HEADER_H
3 #define __PERF_UTIL_HEADER_H
4 
5 #include <linux/stringify.h>
6 
7 #define mfspr(rn)       ({unsigned long rval; \
8 			asm volatile("mfspr %0," __stringify(rn) \
9 				: "=r" (rval)); rval; })
10 
11 #define SPRN_PVR        0x11F   /* Processor Version Register */
12 #define PVR_VER(pvr)    (((pvr) >>  16) & 0xFFFF) /* Version field */
13 #define PVR_REV(pvr)    (((pvr) >>   0) & 0xFFFF) /* Revision field */
14 
15 #endif /* __PERF_UTIL_HEADER_H */
16