summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2004-06-17 15:57:43 +0000
committerNed Ludd <solar@gentoo.org>2004-06-17 15:57:43 +0000
commit1277f5862b3d16b3ff09c697ac93041e1a63242c (patch)
tree36df6439c2835738afdf5d010a3642fff4d53c31 /dev-util/valgrind/files
parentfixed SRC_URI (Manifest recommit) (diff)
downloadgentoo-2-1277f5862b3d16b3ff09c697ac93041e1a63242c.tar.gz
gentoo-2-1277f5862b3d16b3ff09c697ac93041e1a63242c.tar.bz2
gentoo-2-1277f5862b3d16b3ff09c697ac93041e1a63242c.zip
added patch from bug 54068 to make valgrind pic aware
Diffstat (limited to 'dev-util/valgrind/files')
-rw-r--r--dev-util/valgrind/files/digest-valgrind-2.1.1-r11
-rw-r--r--dev-util/valgrind/files/valgrind-2.1.1-pic.patch259
2 files changed, 260 insertions, 0 deletions
diff --git a/dev-util/valgrind/files/digest-valgrind-2.1.1-r1 b/dev-util/valgrind/files/digest-valgrind-2.1.1-r1
new file mode 100644
index 000000000000..97e55a36aa84
--- /dev/null
+++ b/dev-util/valgrind/files/digest-valgrind-2.1.1-r1
@@ -0,0 +1 @@
+MD5 0010c3e8f054ecc633151c62044b646d valgrind-2.1.1.tar.bz2 923532
diff --git a/dev-util/valgrind/files/valgrind-2.1.1-pic.patch b/dev-util/valgrind/files/valgrind-2.1.1-pic.patch
new file mode 100644
index 000000000000..d598f5523103
--- /dev/null
+++ b/dev-util/valgrind/files/valgrind-2.1.1-pic.patch
@@ -0,0 +1,259 @@
+Index: cachegrind/cg_main.c
+===================================================================
+RCS file: /home/kde/valgrind/cachegrind/cg_main.c,v
+retrieving revision 1.65
+diff -u -u -w -r1.65 cg_main.c
+--- cachegrind/cg_main.c 15 Mar 2004 16:43:57 -0000 1.65
++++ cachegrind/cg_main.c 16 Jun 2004 18:20:54 -0000
+@@ -1177,15 +1177,6 @@
+ * them.
+ */
+
+-static __inline__ void cpuid(Int n, UInt *a, UInt *b, UInt *c, UInt *d)
+-{
+- __asm__ __volatile__ (
+- "cpuid"
+- : "=a" (*a), "=b" (*b), "=c" (*c), "=d" (*d) /* output */
+- : "0" (n) /* input */
+- );
+-}
+-
+ static void micro_ops_warn(Int actual_size, Int used_size, Int line_size)
+ {
+ VG_(message)(Vg_DebugMsg,
+@@ -1214,7 +1205,7 @@
+ return -1;
+ }
+
+- cpuid(2, (Int*)&info[0], (Int*)&info[4],
++ VG_(cpuid)(2, (Int*)&info[0], (Int*)&info[4],
+ (Int*)&info[8], (Int*)&info[12]);
+ trials = info[0] - 1; /* AL register - bits 0..7 of %eax */
+ info[0] = 0x0; /* reset AL */
+@@ -1358,10 +1349,10 @@
+ Int AMD_cache_info(cache_t* I1c, cache_t* D1c, cache_t* L2c)
+ {
+ UInt ext_level;
+- Int dummy, model;
+- Int I1i, D1i, L2i;
++ UInt dummy, model;
++ UInt I1i, D1i, L2i;
+
+- cpuid(0x80000000, &ext_level, &dummy, &dummy, &dummy);
++ VG_(cpuid)(0x80000000, &ext_level, &dummy, &dummy, &dummy);
+
+ if (0 == (ext_level & 0x80000000) || ext_level < 0x80000006) {
+ VG_(message)(Vg_UserMsg,
+@@ -1370,10 +1361,10 @@
+ return -1;
+ }
+
+- cpuid(0x80000005, &dummy, &dummy, &D1i, &I1i);
+- cpuid(0x80000006, &dummy, &dummy, &L2i, &dummy);
++ VG_(cpuid)(0x80000005, &dummy, &dummy, &D1i, &I1i);
++ VG_(cpuid)(0x80000006, &dummy, &dummy, &L2i, &dummy);
+
+- cpuid(0x1, &model, &dummy, &dummy, &dummy);
++ VG_(cpuid)(0x1, &model, &dummy, &dummy, &dummy);
+ /*VG_(message)(Vg_UserMsg,"CPU model %04x",model);*/
+
+ /* Check for Duron bug */
+@@ -1426,7 +1417,7 @@
+ /* Trap for illegal instruction, in case it's a really old processor that
+ * doesn't support CPUID. */
+ if (__builtin_setjmp(cpuid_jmpbuf) == 0) {
+- cpuid(0, &level, (int*)&vendor_id[0],
++ VG_(cpuid)(0, &level, (int*)&vendor_id[0],
+ (int*)&vendor_id[8], (int*)&vendor_id[4]);
+ vendor_id[12] = '\0';
+
+Index: coregrind/Makefile.am
+===================================================================
+RCS file: /home/kde/valgrind/coregrind/Makefile.am,v
+retrieving revision 1.71
+diff -u -u -w -r1.71 Makefile.am
+--- coregrind/Makefile.am 16 Apr 2004 23:02:28 -0000 1.71
++++ coregrind/Makefile.am 16 Jun 2004 18:20:55 -0000
+@@ -75,7 +75,8 @@
+ vg_toolint.c \
+ vg_translate.c \
+ vg_transtab.c \
+- vg_ldt.c
++ vg_ldt.c \
++ vg_cpuid.S
+ stage2_DEPENDENCIES = $(srcdir)/valgrind.vs x86/stage2.lds
+ stage2_LDFLAGS=-Wl,--export-dynamic -Wl,-e,_ume_entry -g \
+ -Wl,-defsym,kickstart_base=0xb8000000 \
+Index: coregrind/vg_cpuid.S
+===================================================================
+RCS file: coregrind/vg_cpuid.S
+diff -N coregrind/vg_cpuid.S
+--- /dev/null 1 Jan 1970 00:00:00 -0000
++++ coregrind/vg_cpuid.S 16 Jun 2004 18:20:55 -0000
+@@ -0,0 +1,77 @@
++
++##--------------------------------------------------------------------##
++##--- Support for determining CPU characteristics. ---##
++##--- vg_cpuid.S ---##
++##--------------------------------------------------------------------##
++
++/*
++ This file is part of Valgrind, an extensible x86 protected-mode
++ emulator for monitoring program execution on x86-Unixes.
++
++ Copyright (C) 2000-2004 Julian Seward
++ jseward@acm.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 "vg_constants.h"
++#include "vg_unistd.h"
++
++/*
++ int VG_(cpuid)(UInt eax,
++ UInt *eax_ret, UInt *ebx_ret, UInt *ecx_ret, UInt *edx_ret)
++ */
++.globl VG_(cpuid)
++VG_(cpuid):
++ pushl %ebp
++ movl %esp, %ebp
++ pushl %eax
++ pushl %ebx
++ pushl %ecx
++ pushl %edx
++ pushl %esi
++ movl 8(%ebp), %eax
++ cpuid
++ movl 12(%ebp), %esi
++ testl %esi, %esi
++ jz 1f
++ movl %eax, (%esi)
++1:
++ movl 16(%ebp), %esi
++ testl %esi, %esi
++ jz 2f
++ movl %ebx, (%esi)
++2:
++ movl 20(%ebp), %esi
++ testl %esi, %esi
++ jz 3f
++ movl %ecx, (%esi)
++3:
++ movl 24(%ebp), %esi
++ testl %esi, %esi
++ jz 4f
++ movl %edx, (%esi)
++4:
++ popl %esi
++ popl %edx
++ popl %ecx
++ popl %ebx
++ popl %eax
++ movl %ebp, %esp
++ popl %ebp
++ ret
+Index: coregrind/vg_to_ucode.c
+===================================================================
+RCS file: /home/kde/valgrind/coregrind/vg_to_ucode.c,v
+retrieving revision 1.138
+diff -u -u -w -r1.138 vg_to_ucode.c
+--- coregrind/vg_to_ucode.c 2 Jun 2004 14:48:16 -0000 1.138
++++ coregrind/vg_to_ucode.c 16 Jun 2004 18:20:57 -0000
+@@ -95,29 +95,6 @@
+ return flag_is_changeable(EFlagID);
+ }
+
+-static inline UInt cpuid_eax(UInt eax)
+-{
+- asm("cpuid" : "=a" (eax) : "0" (eax) : "bx", "cx", "dx");
+- return eax;
+-}
+-
+-static inline void cpuid(UInt eax,
+- UInt *eax_ret, UInt *ebx_ret, UInt *ecx_ret, UInt *edx_ret)
+-{
+- UInt ebx, ecx, edx;
+-
+- asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "0" (eax));
+-
+- if (eax_ret)
+- *eax_ret = eax;
+- if (ebx_ret)
+- *ebx_ret = ebx;
+- if (ecx_ret)
+- *ecx_ret = ecx;
+- if (edx_ret)
+- *edx_ret = edx;
+-}
+-
+ static void get_cpu_features(void)
+ {
+ Char vendorstr[13];
+@@ -130,7 +107,7 @@
+
+ cpu_features[VG_INT_FEAT] |= (1 << (VG_X86_FEAT_CPUID%32));
+
+- cpuid(0, &cpuid_level, (UInt *)&vendorstr[0], (UInt *)&vendorstr[8], (UInt *)&vendorstr[4]);
++ VG_(cpuid)(0, &cpuid_level, (UInt *)&vendorstr[0], (UInt *)&vendorstr[8], (UInt *)&vendorstr[4]);
+ vendorstr[12] = '\0';
+
+ for(i = 0; i < sizeof(cpu_vendors)/sizeof(*cpu_vendors); i++)
+@@ -140,12 +117,12 @@
+ }
+
+ if (cpuid_level >= 1)
+- cpuid(1, NULL, NULL, &cpu_features[VG_EXT_FEAT], &cpu_features[VG_X86_FEAT]);
++ VG_(cpuid)(1, NULL, NULL, &cpu_features[VG_EXT_FEAT], &cpu_features[VG_X86_FEAT]);
+
+ switch(cpu_vendor) {
+ case VG_CPU_VENDOR_AMD:
+ /* get AMD-specific flags */
+- cpuid(0x80000001, NULL, NULL, NULL, &cpu_features[VG_AMD_FEAT]);
++ VG_(cpuid)(0x80000001, NULL, NULL, NULL, &cpu_features[VG_AMD_FEAT]);
+ break;
+
+ default:
+@@ -259,7 +236,7 @@
+ if (cpuid_level == -2)
+ get_cpu_features(); /* for cpu_vendor */
+
+- cpuid(op, &eax, &ebx, &ecx, &edx);
++ VG_(cpuid)(op, &eax, &ebx, &ecx, &edx);
+
+ /* Common mangling */
+ switch(op) {
+Index: include/vg_skin.h.base
+===================================================================
+RCS file: /home/kde/valgrind/include/vg_skin.h.base,v
+retrieving revision 1.18
+diff -u -u -w -r1.18 vg_skin.h.base
+--- include/vg_skin.h.base 13 Jun 2004 09:55:21 -0000 1.18
++++ include/vg_skin.h.base 16 Jun 2004 18:20:57 -0000
+@@ -585,6 +585,10 @@
+ /* other, randomly useful functions */
+ extern UInt VG_(read_millisecond_timer) ( void );
+
++extern void VG_(cpuid) ( UInt eax,
++ UInt *eax_ret, UInt *ebx_ret,
++ UInt *ecx_ret, UInt *edx_ret );
++
+ /*====================================================================*/
+ /*=== UCode definition ===*/
+ /*====================================================================*/
+