Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753513AbbEAHGy (ORCPT ); Fri, 1 May 2015 03:06:54 -0400 Received: from e18.ny.us.ibm.com ([129.33.205.208]:60351 "EHLO e18.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753420AbbEAHGC (ORCPT ); Fri, 1 May 2015 03:06:02 -0400 From: Sukadev Bhattiprolu To: mingo@redhat.com, ak@linux.intel.com, Michael Ellerman , Jiri Olsa , Arnaldo Carvalho de Melo , Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org, Subject: [RFC][PATCH 3/4] perf/powerpc: Move mfspr and friends to header file Date: Fri, 1 May 2015 00:05:40 -0700 Message-Id: <1430463941-26109-4-git-send-email-sukadev@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1430463941-26109-1-git-send-email-sukadev@linux.vnet.ibm.com> References: <1430463941-26109-1-git-send-email-sukadev@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15050107-0045-0000-0000-00000015A8E7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1957 Lines: 53 mfspr() and related macros will be needed in two separate files. Move these defintions to a common header file. Signed-off-by: Sukadev Bhattiprolu --- tools/perf/arch/powerpc/util/header.c | 9 +-------- tools/perf/arch/powerpc/util/header.h | 9 +++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 tools/perf/arch/powerpc/util/header.h diff --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) diff --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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/