summaryrefslogtreecommitdiff
path: root/cachegrind
diff options
context:
space:
mode:
authorsewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-11-29 13:05:56 +0000
committersewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-11-29 13:05:56 +0000
commit2c48c7b0a453d32375a4df17e153011b797ef28c (patch)
treefafe325c523667f053ec7b95ac58618acfa7fc01 /cachegrind
parent9856aacece5a8f08b869d4b371a5e543480ff501 (diff)
Add framework for ppc64 support. Apologies in advance for the
inevitable breakage to other platforms. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5250 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'cachegrind')
-rw-r--r--cachegrind/Makefile.am11
-rw-r--r--cachegrind/cg-ppc64.c61
-rw-r--r--cachegrind/tests/Makefile.am3
3 files changed, 75 insertions, 0 deletions
diff --git a/cachegrind/Makefile.am b/cachegrind/Makefile.am
index 863c12bc..51bd5bd9 100644
--- a/cachegrind/Makefile.am
+++ b/cachegrind/Makefile.am
@@ -14,11 +14,15 @@ endif
if VG_PPC32_LINUX
noinst_PROGRAMS += cachegrind-ppc32-linux
endif
+if VG_PPC64_LINUX
+noinst_PROGRAMS += cachegrind-ppc64-linux
+endif
CACHEGRIND_SOURCES_COMMON = cg_main.c
CACHEGRIND_SOURCES_X86 = cg-x86.c
CACHEGRIND_SOURCES_AMD64 = cg-amd64.c
CACHEGRIND_SOURCES_PPC32 = cg-ppc32.c
+CACHEGRIND_SOURCES_PPC64 = cg-ppc64.c
cachegrind_x86_linux_SOURCES = $(CACHEGRIND_SOURCES_COMMON) $(CACHEGRIND_SOURCES_X86)
cachegrind_x86_linux_CPPFLAGS = $(AM_CPPFLAGS_X86_LINUX)
@@ -40,3 +44,10 @@ cachegrind_ppc32_linux_CFLAGS = $(AM_CFLAGS_PPC32_LINUX)
cachegrind_ppc32_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC32_LINUX)
cachegrind_ppc32_linux_LDADD = $(TOOL_LDADD_PPC32_LINUX)
cachegrind_ppc32_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC32_LINUX)
+
+cachegrind_ppc64_linux_SOURCES = $(CACHEGRIND_SOURCES_COMMON) $(CACHEGRIND_SOURCES_PPC64)
+cachegrind_ppc64_linux_CPPFLAGS = $(AM_CPPFLAGS_PPC64_LINUX)
+cachegrind_ppc64_linux_CFLAGS = $(AM_CFLAGS_PPC64_LINUX)
+cachegrind_ppc64_linux_DEPENDENCIES = $(COREGRIND_LIBS_PPC64_LINUX)
+cachegrind_ppc64_linux_LDADD = $(TOOL_LDADD_PPC64_LINUX)
+cachegrind_ppc64_linux_LDFLAGS = $(TOOL_LDFLAGS_PPC64_LINUX)
diff --git a/cachegrind/cg-ppc64.c b/cachegrind/cg-ppc64.c
new file mode 100644
index 00000000..18a0e07a
--- /dev/null
+++ b/cachegrind/cg-ppc64.c
@@ -0,0 +1,61 @@
+
+/*--------------------------------------------------------------------*/
+/*--- PPC64-specific definitions. ppc64/cg-ppc64.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Cachegrind, a Valgrind tool for cache
+ profiling programs.
+
+ Copyright (C) 2005 Nicholas Nethercote
+ njn@valgrind.org
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#include "pub_tool_basics.h"
+#include "pub_tool_libcbase.h"
+#include "pub_tool_libcassert.h"
+#include "pub_tool_libcprint.h"
+
+#include "cg_arch.h"
+
+void VG_(configure_caches)(cache_t* I1c, cache_t* D1c, cache_t* L2c,
+ Bool all_caches_clo_defined)
+{
+ // Set caches to default.
+ *I1c = (cache_t) { 65536, 2, 64 };
+ *D1c = (cache_t) { 65536, 2, 64 };
+ *L2c = (cache_t) { 262144, 8, 64 };
+
+ // Warn if config not completely specified from cmd line. Note that
+ // this message is slightly different from the one we give on x86/AMD64
+ // when auto-detection fails; this lets us filter out this one (which is
+ // not important) in the regression test suite without filtering the
+ // x86/AMD64 one (which we want to see if it ever occurs in the
+ // regression test suite).
+ if (!all_caches_clo_defined) {
+ VG_(message)(Vg_DebugMsg,
+ "Warning: Cannot auto-detect cache config on PPC64, using one "
+ "or more defaults ");
+ }
+}
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
diff --git a/cachegrind/tests/Makefile.am b/cachegrind/tests/Makefile.am
index 9ebfe900..aee2531e 100644
--- a/cachegrind/tests/Makefile.am
+++ b/cachegrind/tests/Makefile.am
@@ -8,6 +8,9 @@ endif
if VG_PPC32_LINUX
SUBDIRS += ppc32
endif
+if VG_PPC64_LINUX
+SUBDIRS += ppc64
+endif
DIST_SUBDIRS = ${VG_ARCH_ALL} .