From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: mingo@redhat.com, ak@linux.intel.com,
Michael Ellerman <mpe@ellerman.id.au>,
Jiri Olsa <jolsa@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org, <linux-kernel@vger.kernel.org>
Subject: [RFC][PATCH 3/4] perf/powerpc: Move mfspr and friends to header file
Date: Fri, 1 May 2015 00:05:40 -0700 [thread overview]
Message-ID: <1430463941-26109-4-git-send-email-sukadev@linux.vnet.ibm.com> (raw)
In-Reply-To: <1430463941-26109-1-git-send-email-sukadev@linux.vnet.ibm.com>
mfspr() and related macros will be needed in two separate files.
Move these defintions to a common header file.
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
| 9 +--------
| 9 +++++++++
2 files changed, 10 insertions(+), 8 deletions(-)
create mode 100644 tools/perf/arch/powerpc/util/header.h
--git a/tools/perf/arch/powerpc/util/header.c b/tools/perf/arch/powerpc/util/header.c
index 6c1b8a7..05d3fc8 100644
--- a/tools/perf/arch/powerpc/util/header.c
+++ b/tools/perf/arch/powerpc/util/header.c
@@ -6,14 +6,7 @@
#include "../../util/header.h"
#include "../../util/util.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 */
+#include "header.h"
int
get_cpuid(char *buffer, size_t sz)
--git a/tools/perf/arch/powerpc/util/header.h b/tools/perf/arch/powerpc/util/header.h
new file mode 100644
index 0000000..b9d3a0d
--- /dev/null
+++ b/tools/perf/arch/powerpc/util/header.h
@@ -0,0 +1,9 @@
+#include "../../util/util.h" // __stringify
+
+#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 */
--
1.7.9.5
next prev parent reply other threads:[~2015-05-01 7:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-01 7:05 [RFC][PATCH 0/4] perf: Enable symbolic event names Sukadev Bhattiprolu
2015-05-01 7:05 ` [RFC][PATCH 1/4] perf: Create a table of Power7 PMU events Sukadev Bhattiprolu
2015-05-01 7:05 ` [RFC][PATCH 2/4] perf: Create a table of Power8 " Sukadev Bhattiprolu
2015-05-01 7:05 ` Sukadev Bhattiprolu [this message]
2015-05-01 7:05 ` [RFC][PATCH 4/4] perf: Create aliases for " Sukadev Bhattiprolu
2015-05-02 7:04 ` Vineet Gupta
2015-05-02 15:38 ` Jiri Olsa
2015-05-04 11:44 ` Andi Kleen
2015-05-02 7:02 ` [RFC][PATCH 0/4] perf: Enable symbolic event names Vineet Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1430463941-26109-4-git-send-email-sukadev@linux.vnet.ibm.com \
--to=sukadev@linux.vnet.ibm.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).