summaryrefslogtreecommitdiff
path: root/tools/perf/arch/powerpc/util/utils_header.h
blob: 5788eb1f1fe3398d0e5b95b5b8b780bc1d339811 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_UTIL_HEADER_H
#define __PERF_UTIL_HEADER_H

#include <linux/stringify.h>

#define mfspr(rn)       ({unsigned long rval; \
			asm volatile("mfspr %0," __stringify(rn) \
				: "=r" (rval)); rval; })

#define SPRN_PVR        0x11F   /* Processor Version Register */
#define PVR_VER(pvr)    (((pvr) >>  16) & 0xFFFF) /* Version field */
#define PVR_REV(pvr)    (((pvr) >>   0) & 0xFFFF) /* Revison field */

#endif /* __PERF_UTIL_HEADER_H */