Dirk Mueller
0ed966f036
- drop: valgrind-3.9.0-merge.patches.from.Paul.McKenney.patch, valgrind-3.9.0-ppc64le-abiv2.patch - add: VEX-r2803.diff, VEX-r2808.diff, VEX-r2816.diff VEX-r2904.diff, VEX-r2910.diff, VEX-r2914.diff, VEX-r2915.diff, VEX-r2916.diff, r13767.diff, r13770.diff, r14184.diff, r14238.diff, r14239.diff, r14240.diff, r14246.diff OBS-URL: https://build.opensuse.org/package/show/devel:tools/valgrind?expand=0&rev=114
2099 lines
85 KiB
Diff
2099 lines
85 KiB
Diff
------------------------------------------------------------------------
|
|
r14238 | carll | 2014-08-08 01:17:29 +0200 (Fr, 08. Aug 2014) | 25 Zeilen
|
|
|
|
This commit is for Bugzilla 334384. The Bugzilla contains patch 1 of 3
|
|
to add PPC64 LE support. The other two patches can be found in Bugzillas
|
|
334834 and 334836. The commit does not have a VEX commit associated with it.
|
|
|
|
POWER PC, add initial Little Endian support
|
|
|
|
The IBM POWER processor now supports both Big Endian and Little Endian.
|
|
This patch renames the #defines with the name ppc64 to ppc64be for the BE
|
|
specific code. This patch adds the Little Endian #define ppc64le to the
|
|
|
|
Additionally, a few functions are renamed to remove BE from the name if the
|
|
function is used by BE and LE. Functions that are BE specific have BE put
|
|
in the name.
|
|
|
|
The goals of this patch is to make sure #defines, function names and
|
|
variables consistently use PPC64/ppc64 if it refers to BE and LE,
|
|
PPC64BE/ppc64be if it is specific to BE, PPC64LE/ppc64le if it is LE
|
|
specific. The patch does not break the code for PPC64 Big Endian.
|
|
|
|
The test files memcheck/tests/atomic_incs.c, tests/power_insn_available.c
|
|
and tests/power_insn_available.c are also updated to the new #define
|
|
definition for PPC64 BE.
|
|
|
|
Signed-off-by: Carl Love <carll@us.ibm.com>
|
|
|
|
------------------------------------------------------------------------
|
|
Index: Makefile.tool.am
|
|
===================================================================
|
|
--- Makefile.tool.am.orig
|
|
+++ Makefile.tool.am
|
|
@@ -46,7 +46,10 @@ TOOL_LDFLAGS_AMD64_LINUX = \
|
|
TOOL_LDFLAGS_PPC32_LINUX = \
|
|
$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@
|
|
|
|
-TOOL_LDFLAGS_PPC64_LINUX = \
|
|
+TOOL_LDFLAGS_PPC64BE_LINUX = \
|
|
+ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
|
|
+
|
|
+TOOL_LDFLAGS_PPC64LE_LINUX = \
|
|
$(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@
|
|
|
|
TOOL_LDFLAGS_ARM_LINUX = \
|
|
@@ -102,8 +105,11 @@ LIBREPLACEMALLOC_AMD64_LINUX = \
|
|
LIBREPLACEMALLOC_PPC32_LINUX = \
|
|
$(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc32-linux.a
|
|
|
|
-LIBREPLACEMALLOC_PPC64_LINUX = \
|
|
- $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64-linux.a
|
|
+LIBREPLACEMALLOC_PPC64BE_LINUX = \
|
|
+ $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64be-linux.a
|
|
+
|
|
+LIBREPLACEMALLOC_PPC64LE_LINUX = \
|
|
+ $(top_builddir)/coregrind/libreplacemalloc_toolpreload-ppc64le-linux.a
|
|
|
|
LIBREPLACEMALLOC_ARM_LINUX = \
|
|
$(top_builddir)/coregrind/libreplacemalloc_toolpreload-arm-linux.a
|
|
@@ -141,9 +147,14 @@ LIBREPLACEMALLOC_LDFLAGS_PPC32_LINUX = \
|
|
$(LIBREPLACEMALLOC_PPC32_LINUX) \
|
|
-Wl,--no-whole-archive
|
|
|
|
-LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX = \
|
|
+LIBREPLACEMALLOC_LDFLAGS_PPC64BE_LINUX = \
|
|
+ -Wl,--whole-archive \
|
|
+ $(LIBREPLACEMALLOC_PPC64BE_LINUX) \
|
|
+ -Wl,--no-whole-archive
|
|
+
|
|
+LIBREPLACEMALLOC_LDFLAGS_PPC64LE_LINUX = \
|
|
-Wl,--whole-archive \
|
|
- $(LIBREPLACEMALLOC_PPC64_LINUX) \
|
|
+ $(LIBREPLACEMALLOC_PPC64LE_LINUX) \
|
|
-Wl,--no-whole-archive
|
|
|
|
LIBREPLACEMALLOC_LDFLAGS_ARM_LINUX = \
|
|
Index: helgrind/tests/annotate_hbefore.c
|
|
===================================================================
|
|
--- helgrind/tests/annotate_hbefore.c.orig
|
|
+++ helgrind/tests/annotate_hbefore.c
|
|
@@ -20,7 +20,7 @@
|
|
|
|
typedef unsigned long int UWord;
|
|
|
|
-#if defined(VGA_ppc64)
|
|
+#if defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
|
|
// ppc64
|
|
/* return 1 if success, 0 if failure */
|
|
Index: drd/drd_bitmap.h
|
|
===================================================================
|
|
--- drd/drd_bitmap.h.orig
|
|
+++ drd/drd_bitmap.h
|
|
@@ -139,8 +139,8 @@ Addr make_address(const UWord a1, const
|
|
#if defined(VGA_x86) || defined(VGA_ppc32) || defined(VGA_arm) \
|
|
|| defined(VGA_mips32)
|
|
#define BITS_PER_BITS_PER_UWORD 5
|
|
-#elif defined(VGA_amd64) || defined(VGA_ppc64) || defined(VGA_s390x) \
|
|
- || defined(VGA_mips64) || defined(VGA_arm64)
|
|
+#elif defined(VGA_amd64) || defined(VGA_ppc64be) || defined(VGA_ppc64le) \
|
|
+ || defined(VGA_s390x) || defined(VGA_mips64) || defined(VGA_arm64)
|
|
#define BITS_PER_BITS_PER_UWORD 6
|
|
#else
|
|
#error Unknown platform.
|
|
Index: drd/tests/unit_bitmap.c
|
|
===================================================================
|
|
--- drd/tests/unit_bitmap.c.orig
|
|
+++ drd/tests/unit_bitmap.c
|
|
@@ -83,7 +83,8 @@ struct { Addr address; SizeT size; BmAcc
|
|
{ 0x00ffffffULL, 1, eLoad },
|
|
{ 0xffffffffULL - (((1 << ADDR_LSB_BITS) + 1) << ADDR_IGNORED_BITS),
|
|
1, eStore },
|
|
-#if defined(VGP_amd64_linux) || defined(VGP_ppc64_linux)
|
|
+#if defined(VGP_amd64_linux) || defined(VGP_ppc64be_linux) \
|
|
+ || defined(VGP_ppc64le_linux)
|
|
{ 0xffffffffULL - (1 << ADDR_LSB_BITS << ADDR_IGNORED_BITS),
|
|
1, eStore },
|
|
{ 0xffffffffULL, 1, eStore },
|
|
Index: drd/drd_load_store.c
|
|
===================================================================
|
|
--- drd/drd_load_store.c.orig
|
|
+++ drd/drd_load_store.c
|
|
@@ -43,7 +43,7 @@
|
|
#define STACK_POINTER_OFFSET OFFSET_amd64_RSP
|
|
#elif defined(VGA_ppc32)
|
|
#define STACK_POINTER_OFFSET OFFSET_ppc32_GPR1
|
|
-#elif defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
#define STACK_POINTER_OFFSET OFFSET_ppc64_GPR1
|
|
#elif defined(VGA_arm)
|
|
#define STACK_POINTER_OFFSET OFFSET_arm_R13
|
|
Index: coregrind/m_trampoline.S
|
|
===================================================================
|
|
--- coregrind/m_trampoline.S.orig
|
|
+++ coregrind/m_trampoline.S
|
|
@@ -416,7 +416,7 @@ VG_(trampoline_stuff_end):
|
|
|
|
/*---------------- ppc64-linux ----------------*/
|
|
#else
|
|
-#if defined(VGP_ppc64_linux)
|
|
+#if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
|
|
# define UD2_16 trap ; trap ; trap; trap
|
|
# define UD2_64 UD2_16 ; UD2_16 ; UD2_16 ; UD2_16
|
|
Index: coregrind/pub_core_mallocfree.h
|
|
===================================================================
|
|
--- coregrind/pub_core_mallocfree.h.orig
|
|
+++ coregrind/pub_core_mallocfree.h
|
|
@@ -71,13 +71,14 @@ typedef Int ArenaId;
|
|
// for any AltiVec- or SSE-related type. This matches the Darwin libc.
|
|
// Also, use 16 bytes for any PPC variant, since 16 is required to make
|
|
// Altiveccery work right.
|
|
-#elif defined(VGP_amd64_linux) || \
|
|
- defined(VGP_ppc32_linux) || \
|
|
- defined(VGP_ppc64_linux) || \
|
|
- defined(VGP_s390x_linux) || \
|
|
- defined(VGP_mips64_linux) || \
|
|
- defined(VGP_x86_darwin) || \
|
|
- defined(VGP_amd64_darwin) || \
|
|
+#elif defined(VGP_amd64_linux) || \
|
|
+ defined(VGP_ppc32_linux) || \
|
|
+ defined(VGP_ppc64be_linux) || \
|
|
+ defined(VGP_ppc64le_linux) || \
|
|
+ defined(VGP_s390x_linux) || \
|
|
+ defined(VGP_mips64_linux) || \
|
|
+ defined(VGP_x86_darwin) || \
|
|
+ defined(VGP_amd64_darwin) || \
|
|
defined(VGP_arm64_linux)
|
|
# define VG_MIN_MALLOC_SZB 16
|
|
#else
|
|
Index: coregrind/m_debuginfo/priv_storage.h
|
|
===================================================================
|
|
--- coregrind/m_debuginfo/priv_storage.h.orig
|
|
+++ coregrind/m_debuginfo/priv_storage.h
|
|
@@ -232,7 +232,7 @@ typedef
|
|
Int r7_off;
|
|
}
|
|
DiCfSI;
|
|
-#elif defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
/* Just have a struct with the common fields in, so that code that
|
|
processes the common fields doesn't have to be ifdef'd against
|
|
VGP_/VGA_ symbols. These are not used in any way on ppc32/64-linux
|
|
Index: coregrind/m_debuginfo/readmacho.c
|
|
===================================================================
|
|
--- coregrind/m_debuginfo/readmacho.c.orig
|
|
+++ coregrind/m_debuginfo/readmacho.c
|
|
@@ -197,8 +197,8 @@ static DiSlice map_image_aboard ( DebugI
|
|
f++, arch_be_ioff += sizeof(struct fat_arch)) {
|
|
# if defined(VGA_ppc)
|
|
Int cputype = CPU_TYPE_POWERPC;
|
|
-# elif defined(VGA_ppc64)
|
|
- Int cputype = CPU_TYPE_POWERPC64;
|
|
+# elif defined(VGA_ppc64be)
|
|
+ Int cputype = CPU_TYPE_POWERPC64BE;
|
|
# elif defined(VGA_x86)
|
|
Int cputype = CPU_TYPE_X86;
|
|
# elif defined(VGA_amd64)
|
|
Index: coregrind/m_debuginfo/d3basics.c
|
|
===================================================================
|
|
--- coregrind/m_debuginfo/d3basics.c.orig
|
|
+++ coregrind/m_debuginfo/d3basics.c
|
|
@@ -406,7 +406,7 @@ static Bool get_Dwarf_Reg( /*OUT*/Addr*
|
|
if (regno == 7/*RSP*/) { *a = regs->sp; return True; }
|
|
# elif defined(VGP_ppc32_linux)
|
|
if (regno == 1/*SP*/) { *a = regs->sp; return True; }
|
|
-# elif defined(VGP_ppc64_linux)
|
|
+# elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
if (regno == 1/*SP*/) { *a = regs->sp; return True; }
|
|
# elif defined(VGP_arm_linux)
|
|
if (regno == 13) { *a = regs->sp; return True; }
|
|
@@ -863,7 +863,8 @@ GXResult ML_(evaluate_Dwarf3_Expr) ( UCh
|
|
if (!regs)
|
|
FAIL("evaluate_Dwarf3_Expr: "
|
|
"DW_OP_call_frame_cfa but no reg info");
|
|
-#if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
|
|
+#if defined(VGP_ppc32_linux) || defined(VGP_ppc64be_linux) \
|
|
+ || defined(VGP_ppc64le_linux)
|
|
/* Valgrind on ppc32/ppc64 currently doesn't use unwind info. */
|
|
uw1 = ML_(read_Addr)((UChar*)regs->sp);
|
|
#else
|
|
Index: coregrind/m_debuginfo/readdwarf.c
|
|
===================================================================
|
|
--- coregrind/m_debuginfo/readdwarf.c.orig
|
|
+++ coregrind/m_debuginfo/readdwarf.c
|
|
@@ -1833,7 +1833,7 @@ void ML_(read_debuginfo_dwarf1) (
|
|
# define FP_REG 1
|
|
# define SP_REG 1
|
|
# define RA_REG_DEFAULT 65
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
# define FP_REG 1
|
|
# define SP_REG 1
|
|
# define RA_REG_DEFAULT 65
|
|
@@ -1873,8 +1873,9 @@ void ML_(read_debuginfo_dwarf1) (
|
|
arm-linux (320) seems ludicrously high, but the ARM IHI 0040A page
|
|
7 (DWARF for the ARM Architecture) specifies that values up to 320
|
|
might exist, for Neon/VFP-v3. */
|
|
-#if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux) \
|
|
- || defined(VGP_mips32_linux) || defined(VGP_mips64_linux)
|
|
+#if defined(VGP_ppc32_linux) || defined(VGP_ppc64be_linux) \
|
|
+ || defined(VGP_ppc64le_linux) || defined(VGP_mips32_linux) \
|
|
+ || defined(VGP_mips64_linux)
|
|
# define N_CFI_REGS 72
|
|
#elif defined(VGP_arm_linux)
|
|
# define N_CFI_REGS 320
|
|
@@ -2443,7 +2444,7 @@ static Bool summarise_context( /*OUT*/Di
|
|
# elif defined(VGA_arm64)
|
|
I_die_here;
|
|
|
|
-# elif defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+# elif defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
/* These don't use CFI based unwinding (is that really true?) */
|
|
|
|
# else
|
|
@@ -2535,7 +2536,8 @@ static Int copy_convert_CfiExpr_tree ( X
|
|
return ML_(CfiExpr_CfiReg)( dstxa, Creg_IA_IP );
|
|
# elif defined(VGA_arm64)
|
|
I_die_here;
|
|
-# elif defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+# elif defined(VGA_ppc32) || defined(VGA_ppc64be) \
|
|
+ || defined(VGA_ppc64le)
|
|
# else
|
|
# error "Unknown arch"
|
|
# endif
|
|
@@ -3702,7 +3704,8 @@ void ML_(read_callframe_info_dwarf3)
|
|
if (!is_ehframe)
|
|
vg_assert(frame_avma == 0);
|
|
|
|
-# if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc32_linux) || defined(VGP_ppc64be_linux) \
|
|
+ || defined(VGP_ppc64le_linux)
|
|
/* These targets don't use CFI-based stack unwinding. */
|
|
return;
|
|
# endif
|
|
Index: coregrind/m_debuginfo/debuginfo.c
|
|
===================================================================
|
|
--- coregrind/m_debuginfo/debuginfo.c.orig
|
|
+++ coregrind/m_debuginfo/debuginfo.c
|
|
@@ -825,8 +825,8 @@ ULong VG_(di_notify_mmap)( Addr a, Bool
|
|
|| defined(VGA_mips64)
|
|
is_rx_map = seg->hasR && seg->hasX;
|
|
is_rw_map = seg->hasR && seg->hasW;
|
|
-# elif defined(VGA_amd64) || defined(VGA_ppc64) || defined(VGA_arm) \
|
|
- || defined(VGA_arm64)
|
|
+# elif defined(VGA_amd64) || defined(VGA_ppc64be) || defined(VGA_ppc64le) \
|
|
+ || defined(VGA_arm) || defined(VGA_arm64)
|
|
is_rx_map = seg->hasR && seg->hasX && !seg->hasW;
|
|
is_rw_map = seg->hasR && seg->hasW && !seg->hasX;
|
|
# elif defined(VGP_s390x_linux)
|
|
@@ -1611,7 +1611,7 @@ Bool get_sym_name ( Bool do_cxx_demangli
|
|
return True;
|
|
}
|
|
|
|
-/* ppc64-linux only: find the TOC pointer (R2 value) that should be in
|
|
+/* ppc64be-linux only: find the TOC pointer (R2 value) that should be in
|
|
force at the entry point address of the function containing
|
|
guest_code_addr. Returns 0 if not known. */
|
|
Addr VG_(get_tocptr) ( Addr guest_code_addr )
|
|
@@ -2251,7 +2251,8 @@ UWord evalCfiExpr ( XArray* exprs, Int i
|
|
case Creg_IA_SP: return eec->uregs->sp;
|
|
case Creg_IA_BP: return eec->uregs->fp;
|
|
case Creg_MIPS_RA: return eec->uregs->ra;
|
|
-# elif defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+# elif defined(VGA_ppc32) || defined(VGA_ppc64be) \
|
|
+ || defined(VGA_ppc64le)
|
|
# elif defined(VGP_arm64_linux)
|
|
I_die_here;
|
|
# else
|
|
@@ -2497,7 +2498,7 @@ static Addr compute_cfa ( D3UnwindRegs*
|
|
case CFIC_IA_BPREL:
|
|
cfa = cfsi->cfa_off + uregs->fp;
|
|
break;
|
|
-# elif defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+# elif defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
# elif defined(VGP_arm64_linux)
|
|
I_die_here;
|
|
# else
|
|
@@ -2595,7 +2596,7 @@ Bool VG_(use_CF_info) ( /*MOD*/D3UnwindR
|
|
ipHere = uregsHere->ia;
|
|
# elif defined(VGA_mips32) || defined(VGA_mips64)
|
|
ipHere = uregsHere->pc;
|
|
-# elif defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+# elif defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
# elif defined(VGP_arm64_linux)
|
|
I_die_here;
|
|
# else
|
|
@@ -2677,7 +2678,7 @@ Bool VG_(use_CF_info) ( /*MOD*/D3UnwindR
|
|
COMPUTE(uregsPrev.pc, uregsHere->pc, cfsi->ra_how, cfsi->ra_off);
|
|
COMPUTE(uregsPrev.sp, uregsHere->sp, cfsi->sp_how, cfsi->sp_off);
|
|
COMPUTE(uregsPrev.fp, uregsHere->fp, cfsi->fp_how, cfsi->fp_off);
|
|
-# elif defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+# elif defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
# elif defined(VGP_arm64_linux)
|
|
I_die_here;
|
|
# else
|
|
Index: coregrind/m_debuginfo/readelf.c
|
|
===================================================================
|
|
--- coregrind/m_debuginfo/readelf.c.orig
|
|
+++ coregrind/m_debuginfo/readelf.c
|
|
@@ -204,19 +204,19 @@ void show_raw_elf_symbol ( DiImage* strt
|
|
.data, size of .data + size of .bss). I don't know if this is
|
|
really correct/justifiable, or not.
|
|
|
|
- For ppc64-linux it's more complex. If the symbol is seen to be in
|
|
+ For ppc64be-linux it's more complex. If the symbol is seen to be in
|
|
the .opd section, it is taken to be a function descriptor, and so
|
|
a dereference is attempted, in order to get hold of the real entry
|
|
point address. Also as part of the dereference, there is an attempt
|
|
to calculate the TOC pointer (R2 value) associated with the symbol.
|
|
|
|
- To support the ppc64-linux pre-"dotless" ABI (prior to gcc 4.0.0),
|
|
+ To support the ppc64be-linux pre-"dotless" ABI (prior to gcc 4.0.0),
|
|
if the symbol is seen to be outside the .opd section and its name
|
|
starts with a dot, an .opd deference is not attempted, and no TOC
|
|
pointer is calculated, but the the leading dot is removed from the
|
|
name.
|
|
|
|
- As a result, on ppc64-linux, the caller of this function may have
|
|
+ As a result, on ppc64be-linux, the caller of this function may have
|
|
to piece together the real size, address, name of the symbol from
|
|
multiple calls to this function. Ugly and confusing.
|
|
*/
|
|
@@ -229,22 +229,22 @@ Bool get_elf_symbol_info (
|
|
DiSlice* escn_strtab, /* holds the name */
|
|
Addr sym_svma, /* address as stated in the object file */
|
|
Bool symtab_in_debug, /* symbol table is in the debug file */
|
|
- DiSlice* escn_opd, /* the .opd (ppc64-linux only) */
|
|
+ DiSlice* escn_opd, /* the .opd (ppc64be-linux only) */
|
|
PtrdiffT opd_bias, /* for biasing AVMAs found in .opd */
|
|
/* OUTPUTS */
|
|
DiOffT* sym_name_out_ioff, /* name (in strtab) we should record */
|
|
Addr* sym_avma_out, /* addr we should record */
|
|
Int* sym_size_out, /* symbol size */
|
|
- Addr* sym_tocptr_out, /* ppc64-linux only: R2 value to be
|
|
+ Addr* sym_tocptr_out, /* ppc64be-linux only: R2 value to be
|
|
used on entry */
|
|
- Bool* from_opd_out, /* ppc64-linux only: did we deref an
|
|
+ Bool* from_opd_out, /* ppc64be-linux only: did we deref an
|
|
.opd entry? */
|
|
Bool* is_text_out, /* is this a text symbol? */
|
|
Bool* is_ifunc /* is this a STT_GNU_IFUNC function ?*/
|
|
)
|
|
{
|
|
Bool plausible;
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux)
|
|
Bool is_in_opd;
|
|
# endif
|
|
Bool in_text, in_data, in_sdata, in_rodata, in_bss, in_sbss;
|
|
@@ -374,9 +374,9 @@ Bool get_elf_symbol_info (
|
|
}
|
|
# endif
|
|
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux)
|
|
/* Allow STT_NOTYPE in the very special case where we're running on
|
|
- ppc64-linux and the symbol is one which the .opd-chasing hack
|
|
+ ppc64be-linux and the symbol is one which the .opd-chasing hack
|
|
below will chase. */
|
|
if (!plausible
|
|
&& *is_text_out
|
|
@@ -473,7 +473,7 @@ Bool get_elf_symbol_info (
|
|
return False;
|
|
}
|
|
|
|
- /* ppc64-linux nasty hack: if the symbol is in an .opd section,
|
|
+ /* ppc64be-linux nasty hack: if the symbol is in an .opd section,
|
|
then really what we have is the address of a function
|
|
descriptor. So use the first word of that as the function's
|
|
text.
|
|
@@ -481,7 +481,8 @@ Bool get_elf_symbol_info (
|
|
See thread starting at
|
|
http://gcc.gnu.org/ml/gcc-patches/2004-08/msg00557.html
|
|
*/
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux)
|
|
+ /* Host and guest may have different Endianess, used by BE only */
|
|
is_in_opd = False;
|
|
# endif
|
|
|
|
@@ -489,7 +490,7 @@ Bool get_elf_symbol_info (
|
|
&& di->opd_size > 0
|
|
&& *sym_avma_out >= di->opd_avma
|
|
&& *sym_avma_out < di->opd_avma + di->opd_size) {
|
|
-# if !defined(VGP_ppc64_linux)
|
|
+# if !defined(VGP_ppc64be_linux)
|
|
if (TRACE_SYMTAB_ENABLED) {
|
|
HChar* sym_name = ML_(img_strdup)(escn_strtab->img,
|
|
"di.gesi.6", sym_name_ioff);
|
|
@@ -584,7 +585,7 @@ Bool get_elf_symbol_info (
|
|
|
|
/* Here's yet another ppc64-linux hack. Get rid of leading dot if
|
|
the symbol is outside .opd. */
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux)
|
|
if (di->opd_size > 0
|
|
&& !is_in_opd
|
|
&& *sym_name_out_ioff != DiOffT_INVALID
|
|
@@ -668,7 +669,7 @@ Bool get_elf_symbol_info (
|
|
}
|
|
}
|
|
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux)
|
|
/* It's crucial that we never add symbol addresses in the .opd
|
|
section. This would completely mess up function redirection and
|
|
intercepting. This assert ensures that any symbols that make it
|
|
@@ -692,7 +693,7 @@ void read_elf_symtab__normal(
|
|
struct _DebugInfo* di, const HChar* tab_name,
|
|
DiSlice* escn_symtab,
|
|
DiSlice* escn_strtab,
|
|
- DiSlice* escn_opd, /* ppc64-linux only */
|
|
+ DiSlice* escn_opd, /* ppc64be-linux only */
|
|
Bool symtab_in_debug
|
|
)
|
|
{
|
|
@@ -768,7 +769,7 @@ void read_elf_symtab__normal(
|
|
|
|
|
|
/* Read an ELF symbol table (normal or dynamic). This one is for
|
|
- ppc64-linux, which requires special treatment. */
|
|
+ ppc64be-linux, which requires special treatment. */
|
|
|
|
typedef
|
|
struct {
|
|
@@ -806,7 +807,7 @@ static Word cmp_TempSymKey ( TempSymKey*
|
|
|
|
static
|
|
__attribute__((unused)) /* not referred to on all targets */
|
|
-void read_elf_symtab__ppc64_linux(
|
|
+void read_elf_symtab__ppc64be_linux(
|
|
struct _DebugInfo* di, const HChar* tab_name,
|
|
DiSlice* escn_symtab,
|
|
DiSlice* escn_strtab,
|
|
@@ -830,7 +831,7 @@ void read_elf_symtab__ppc64_linux(
|
|
return;
|
|
}
|
|
|
|
- TRACE_SYMTAB("\n--- Reading (ELF, ppc64-linux) %s (%lld entries) ---\n",
|
|
+ TRACE_SYMTAB("\n--- Reading (ELF, ppc64be-linux) %s (%lld entries) ---\n",
|
|
tab_name, escn_symtab->szB/sizeof(ElfXX_Sym) );
|
|
|
|
oset = VG_(OSetGen_Create)( offsetof(TempSym,key),
|
|
@@ -2113,7 +2114,7 @@ Bool ML_(read_elf_debug_info) ( struct _
|
|
BAD(".plt");
|
|
}
|
|
}
|
|
-# elif defined(VGP_ppc64_linux)
|
|
+# elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
/* Accept .plt where mapped as rw (data), or unmapped */
|
|
if (0 == VG_(strcmp)(name, ".plt")) {
|
|
if (inrw && !di->plt_present) {
|
|
@@ -2226,7 +2227,7 @@ Bool ML_(read_elf_debug_info) ( struct _
|
|
DiSlice dwarf1d_escn = DiSlice_INVALID; // .debug (dwarf1)
|
|
DiSlice dwarf1l_escn = DiSlice_INVALID; // .line (dwarf1)
|
|
DiSlice opd_escn = DiSlice_INVALID; // .opd (dwarf2,
|
|
- // ppc64-linux)
|
|
+ // ppc64be-linux)
|
|
DiSlice ehframe_escn[N_EHFRAME_SECTS]; // .eh_frame (dwarf2)
|
|
|
|
for (i = 0; i < N_EHFRAME_SECTS; i++)
|
|
@@ -2729,8 +2730,8 @@ Bool ML_(read_elf_debug_info) ( struct _
|
|
void (*read_elf_symtab)(struct _DebugInfo*, const HChar*,
|
|
DiSlice*, DiSlice*, DiSlice*, Bool);
|
|
Bool symtab_in_debug;
|
|
-# if defined(VGP_ppc64_linux)
|
|
- read_elf_symtab = read_elf_symtab__ppc64_linux;
|
|
+# if defined(VGP_ppc64be_linux)
|
|
+ read_elf_symtab = read_elf_symtab__ppc64be_linux;
|
|
# else
|
|
read_elf_symtab = read_elf_symtab__normal;
|
|
# endif
|
|
@@ -2772,7 +2773,7 @@ Bool ML_(read_elf_debug_info) ( struct _
|
|
seems OK though. Also skip on Android. */
|
|
# if !defined(VGP_amd64_linux) \
|
|
&& !defined(VGP_s390x_linux) \
|
|
- && !defined(VGP_ppc64_linux) \
|
|
+ && !defined(VGP_ppc64be_linux) \
|
|
&& !defined(VGPV_arm_linux_android) \
|
|
&& !defined(VGPV_x86_linux_android) \
|
|
&& !defined(VGP_mips64_linux)
|
|
Index: coregrind/m_debuginfo/storage.c
|
|
===================================================================
|
|
--- coregrind/m_debuginfo/storage.c.orig
|
|
+++ coregrind/m_debuginfo/storage.c
|
|
@@ -189,7 +189,7 @@ void ML_(ppDiCfSI) ( XArray* /* of CfiEx
|
|
SHOW_HOW(si->r11_how, si->r11_off);
|
|
VG_(printf)(" R7=");
|
|
SHOW_HOW(si->r7_how, si->r7_off);
|
|
-# elif defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+# elif defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
# elif defined(VGA_s390x) || defined(VGA_mips32) || defined(VGA_mips64)
|
|
VG_(printf)(" SP=");
|
|
SHOW_HOW(si->sp_how, si->sp_off);
|
|
Index: coregrind/m_stacktrace.c
|
|
===================================================================
|
|
--- coregrind/m_stacktrace.c.orig
|
|
+++ coregrind/m_stacktrace.c
|
|
@@ -620,7 +620,8 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId
|
|
|
|
/* -----------------------ppc32/64 ---------------------- */
|
|
|
|
-#if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
|
|
+#if defined(VGP_ppc32_linux) || defined(VGP_ppc64be_linux) \
|
|
+ || defined(VGP_ppc64le_linux)
|
|
|
|
UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known,
|
|
/*OUT*/Addr* ips, UInt max_n_ips,
|
|
@@ -629,7 +630,7 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId
|
|
Addr fp_max_orig )
|
|
{
|
|
Bool lr_is_first_RA = False;
|
|
-# if defined(VG_PLAT_USES_PPCTOC)
|
|
+# if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64le_linux)
|
|
Word redir_stack_size = 0;
|
|
Word redirs_used = 0;
|
|
# endif
|
|
@@ -648,7 +649,7 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId
|
|
Addr fp = sp;
|
|
# if defined(VGP_ppc32_linux)
|
|
Addr lr = startRegs->misc.PPC32.r_lr;
|
|
-# elif defined(VGP_ppc64_linux)
|
|
+# elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
Addr lr = startRegs->misc.PPC64.r_lr;
|
|
# endif
|
|
Addr fp_min = sp;
|
|
@@ -684,7 +685,7 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId
|
|
/* fp is %r1. ip is %cia. Note, ppc uses r1 as both the stack and
|
|
frame pointers. */
|
|
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
redir_stack_size = VEX_GUEST_PPC64_REDIR_STACK_SIZE;
|
|
redirs_used = 0;
|
|
# endif
|
|
@@ -740,7 +741,7 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId
|
|
/* On ppc64-linux (ppc64-elf, really), the lr save
|
|
slot is 2 words back from sp, whereas on ppc32-elf(?) it's
|
|
only one word back. */
|
|
-# if defined(VG_PLAT_USES_PPCTOC)
|
|
+# if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64le_linux)
|
|
const Int lr_offset = 2;
|
|
# else
|
|
const Int lr_offset = 1;
|
|
@@ -759,7 +760,7 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId
|
|
else
|
|
ip = (((UWord*)fp)[lr_offset]);
|
|
|
|
-# if defined(VG_PLAT_USES_PPCTOC)
|
|
+# if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64le_linux)
|
|
/* Nasty hack to do with function replacement/wrapping on
|
|
ppc64-linux. If LR points to our magic return stub,
|
|
then we are in a wrapped or intercepted function, in
|
|
Index: coregrind/m_translate.c
|
|
===================================================================
|
|
--- coregrind/m_translate.c.orig
|
|
+++ coregrind/m_translate.c
|
|
@@ -868,7 +868,7 @@ static Bool chase_into_ok ( void* closur
|
|
if (addr != VG_(redir_do_lookup)(addr, NULL))
|
|
goto dontchase;
|
|
|
|
-# if defined(VG_PLAT_USES_PPCTOC)
|
|
+# if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64le_linux)
|
|
/* This needs to be at the start of its own block. Don't chase. Re
|
|
ULong_to_Ptr, be careful to ensure we only compare 32 bits on a
|
|
32-bit target.*/
|
|
@@ -918,7 +918,7 @@ static IRExpr* mkU32 ( UInt n ) {
|
|
return IRExpr_Const(IRConst_U32(n));
|
|
}
|
|
|
|
-#if defined(VG_PLAT_USES_PPCTOC)
|
|
+#if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64le_linux)
|
|
static IRExpr* mkU8 ( UChar n ) {
|
|
return IRExpr_Const(IRConst_U8(n));
|
|
}
|
|
@@ -941,7 +941,7 @@ static void gen_PUSH ( IRSB* bb, IRExpr*
|
|
IRTemp t1;
|
|
IRExpr* one;
|
|
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
Int stack_size = VEX_GUEST_PPC64_REDIR_STACK_SIZE;
|
|
Int offB_REDIR_SP = offsetof(VexGuestPPC64State,guest_REDIR_SP);
|
|
Int offB_REDIR_STACK = offsetof(VexGuestPPC64State,guest_REDIR_STACK);
|
|
@@ -1035,7 +1035,7 @@ static void gen_PUSH ( IRSB* bb, IRExpr*
|
|
|
|
static IRTemp gen_POP ( IRSB* bb )
|
|
{
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
Int stack_size = VEX_GUEST_PPC64_REDIR_STACK_SIZE;
|
|
Int offB_REDIR_SP = offsetof(VexGuestPPC64State,guest_REDIR_SP);
|
|
Int offB_REDIR_STACK = offsetof(VexGuestPPC64State,guest_REDIR_STACK);
|
|
@@ -1127,7 +1127,7 @@ static IRTemp gen_POP ( IRSB* bb )
|
|
|
|
static void gen_push_and_set_LR_R2 ( IRSB* bb, Addr64 new_R2_value )
|
|
{
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux)
|
|
Addr64 bogus_RA = (Addr64)&VG_(ppctoc_magic_redirect_return_stub);
|
|
Int offB_GPR2 = offsetof(VexGuestPPC64State,guest_GPR2);
|
|
Int offB_LR = offsetof(VexGuestPPC64State,guest_LR);
|
|
@@ -1143,7 +1143,7 @@ static void gen_push_and_set_LR_R2 ( IRS
|
|
|
|
static void gen_pop_R2_LR_then_bLR ( IRSB* bb )
|
|
{
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
Int offB_GPR2 = offsetof(VexGuestPPC64State,guest_GPR2);
|
|
Int offB_LR = offsetof(VexGuestPPC64State,guest_LR);
|
|
Int offB_CIA = offsetof(VexGuestPPC64State,guest_CIA);
|
|
@@ -1277,7 +1277,7 @@ Bool mk_preamble__set_NRADDR_to_nraddr (
|
|
Int offB_GPR25 = offsetof(VexGuestMIPS64State, guest_r25);
|
|
addStmtToIRSB(bb, IRStmt_Put(offB_GPR25, mkU64(closure->readdr)));
|
|
# endif
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux)
|
|
addStmtToIRSB(
|
|
bb,
|
|
IRStmt_Put(
|
|
@@ -1513,7 +1513,7 @@ Bool VG_(translate) ( ThreadId tid,
|
|
vex_abiinfo.guest_ppc_zap_RZ_at_bl = NULL;
|
|
vex_abiinfo.host_ppc32_regalign_int64_args = True;
|
|
# endif
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux)
|
|
vex_abiinfo.guest_ppc_zap_RZ_at_blr = True;
|
|
vex_abiinfo.guest_ppc_zap_RZ_at_bl = const_True;
|
|
vex_abiinfo.host_ppc_calls_use_fndescrs = True;
|
|
Index: coregrind/m_signals.c
|
|
===================================================================
|
|
--- coregrind/m_signals.c.orig
|
|
+++ coregrind/m_signals.c
|
|
@@ -348,7 +348,7 @@ typedef struct SigQueue {
|
|
(srP)->misc.PPC32.r_lr = (uc)->uc_regs->mc_gregs[VKI_PT_LNK]; \
|
|
}
|
|
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
# define VG_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.gp_regs[VKI_PT_NIP])
|
|
# define VG_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.gp_regs[VKI_PT_R1])
|
|
/* Dubious hack: if there is an error, only consider the lowest 8
|
|
@@ -851,7 +851,7 @@ extern void my_sigreturn(void);
|
|
" sc\n" \
|
|
".previous\n"
|
|
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux)
|
|
# define _MY_SIGRETURN(name) \
|
|
".align 2\n" \
|
|
".globl my_sigreturn\n" \
|
|
Index: coregrind/pub_core_trampoline.h
|
|
===================================================================
|
|
--- coregrind/pub_core_trampoline.h.orig
|
|
+++ coregrind/pub_core_trampoline.h
|
|
@@ -81,7 +81,7 @@ extern UInt VG_(ppc32_linux_REDIR_FOR_s
|
|
extern void* VG_(ppc32_linux_REDIR_FOR_strchr)( void*, Int );
|
|
#endif
|
|
|
|
-#if defined(VGP_ppc64_linux)
|
|
+#if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
extern Addr VG_(ppc64_linux_SUBST_FOR_rt_sigreturn);
|
|
extern UInt VG_(ppc64_linux_REDIR_FOR_strlen)( void* );
|
|
extern void* VG_(ppc64_linux_REDIR_FOR_strchr)( void*, Int );
|
|
Index: coregrind/m_debugger.c
|
|
===================================================================
|
|
--- coregrind/m_debugger.c.orig
|
|
+++ coregrind/m_debugger.c
|
|
@@ -152,7 +152,7 @@ static Int ptrace_setregs(Int pid, VexGu
|
|
(void*)LibVEX_GuestPPC32_get_XER(vex));
|
|
return rc;
|
|
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
Int rc = 0;
|
|
/* FRJ: copied nearly verbatim from the ppc32 case. I compared the
|
|
vki-ppc64-linux.h with its ppc32 counterpart and saw no
|
|
Index: coregrind/pub_core_transtab_asm.h
|
|
===================================================================
|
|
--- coregrind/pub_core_transtab_asm.h.orig
|
|
+++ coregrind/pub_core_transtab_asm.h
|
|
@@ -62,8 +62,8 @@
|
|
#elif defined(VGA_s390x) || defined(VGA_arm)
|
|
# define VG_TT_FAST_HASH(_addr) ((((UWord)(_addr)) >> 1) & VG_TT_FAST_MASK)
|
|
|
|
-#elif defined(VGA_ppc32) || defined(VGA_ppc64) || defined(VGA_mips32) \
|
|
- || defined(VGA_mips64) || defined(VGA_arm64)
|
|
+#elif defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le) \
|
|
+ || defined(VGA_mips32) || defined(VGA_mips64) || defined(VGA_arm64)
|
|
# define VG_TT_FAST_HASH(_addr) ((((UWord)(_addr)) >> 2) & VG_TT_FAST_MASK)
|
|
|
|
#else
|
|
Index: coregrind/m_scheduler/scheduler.c
|
|
===================================================================
|
|
--- coregrind/m_scheduler/scheduler.c.orig
|
|
+++ coregrind/m_scheduler/scheduler.c
|
|
@@ -766,7 +766,7 @@ static void do_pre_run_checks ( ThreadSt
|
|
vg_assert(VG_IS_8_ALIGNED(offsetof(VexGuestAMD64State,guest_RIP)));
|
|
# endif
|
|
|
|
-# if defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+# if defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
/* ppc guest_state vector regs must be 16 byte aligned for
|
|
loads/stores. This is important! */
|
|
vg_assert(VG_IS_16_ALIGNED(& tst->arch.vex.guest_VSR0));
|
|
@@ -1601,7 +1601,7 @@ void VG_(nuke_all_threads_except) ( Thre
|
|
#elif defined(VGA_amd64)
|
|
# define VG_CLREQ_ARGS guest_RAX
|
|
# define VG_CLREQ_RET guest_RDX
|
|
-#elif defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
# define VG_CLREQ_ARGS guest_GPR4
|
|
# define VG_CLREQ_RET guest_GPR3
|
|
#elif defined(VGA_arm)
|
|
Index: coregrind/m_gdbserver/target.c
|
|
===================================================================
|
|
--- coregrind/m_gdbserver/target.c.orig
|
|
+++ coregrind/m_gdbserver/target.c
|
|
@@ -645,7 +645,7 @@ void valgrind_initialize_target(void)
|
|
arm_init_architecture(&the_low_target);
|
|
#elif defined(VGA_ppc32)
|
|
ppc32_init_architecture(&the_low_target);
|
|
-#elif defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
ppc64_init_architecture(&the_low_target);
|
|
#elif defined(VGA_s390x)
|
|
s390x_init_architecture(&the_low_target);
|
|
Index: coregrind/pub_core_debuginfo.h
|
|
===================================================================
|
|
--- coregrind/pub_core_debuginfo.h.orig
|
|
+++ coregrind/pub_core_debuginfo.h
|
|
@@ -122,7 +122,7 @@ typedef
|
|
typedef
|
|
struct { Addr pc; Addr sp; Addr lr; Addr fp; } /* PC, 31, 30, 29 */
|
|
D3UnwindRegs;
|
|
-#elif defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
typedef
|
|
UChar /* should be void, but gcc complains at use points */
|
|
D3UnwindRegs;
|
|
Index: coregrind/m_dispatch/dispatch-ppc64-linux.S
|
|
===================================================================
|
|
--- coregrind/m_dispatch/dispatch-ppc64-linux.S.orig
|
|
+++ coregrind/m_dispatch/dispatch-ppc64-linux.S
|
|
@@ -28,7 +28,7 @@
|
|
The GNU General Public License is contained in the file COPYING.
|
|
*/
|
|
|
|
-#if defined(VGP_ppc64_linux)
|
|
+#if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
|
|
#include "pub_core_basics_asm.h"
|
|
#include "pub_core_dispatch_asm.h"
|
|
@@ -193,7 +193,7 @@ VG_(disp_run_translations):
|
|
/* 88(sp) used later to load fpscr with zero */
|
|
/* 48:87(sp) free */
|
|
|
|
- /* Linkage Area (reserved)
|
|
+ /* Linkage Area (reserved) BE ABI
|
|
40(sp) : TOC
|
|
32(sp) : link editor doubleword
|
|
24(sp) : compiler doubleword
|
|
@@ -530,7 +530,7 @@ VG_(disp_cp_evcheck_fail):
|
|
/* Let the linker know we don't need an executable stack */
|
|
.section .note.GNU-stack,"",@progbits
|
|
|
|
-#endif // defined(VGP_ppc64_linux)
|
|
+#endif // defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
|
|
/*--------------------------------------------------------------------*/
|
|
/*--- end ---*/
|
|
Index: coregrind/m_initimg/initimg-linux.c
|
|
===================================================================
|
|
--- coregrind/m_initimg/initimg-linux.c.orig
|
|
+++ coregrind/m_initimg/initimg-linux.c
|
|
@@ -366,7 +366,7 @@ struct auxv *find_auxv(UWord* sp)
|
|
sp++;
|
|
sp++;
|
|
|
|
-#if defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+#if defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
# if defined AT_IGNOREPPC
|
|
while (*sp == AT_IGNOREPPC) // skip AT_IGNOREPPC entries
|
|
sp += 2;
|
|
@@ -457,7 +457,8 @@ Addr setup_client_stack( void* init_sp,
|
|
auxsize += sizeof(*cauxv);
|
|
}
|
|
|
|
-# if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc32_linux) || defined(VGP_ppc64be_linux) \
|
|
+ || defined(VGP_ppc64le_linux)
|
|
auxsize += 2 * sizeof(*cauxv);
|
|
# endif
|
|
|
|
@@ -614,7 +615,8 @@ Addr setup_client_stack( void* init_sp,
|
|
// We do not take ULong* (as ULong 8 bytes on a 32 bits),
|
|
// => we take UWord*
|
|
|
|
-# if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc32_linux) || defined(VGP_ppc64be_linux) \
|
|
+ || defined(VGP_ppc64le_linux)
|
|
auxv[0].a_type = AT_IGNOREPPC;
|
|
auxv[0].u.a_val = AT_IGNOREPPC;
|
|
auxv[1].a_type = AT_IGNOREPPC;
|
|
@@ -719,7 +721,7 @@ Addr setup_client_stack( void* init_sp,
|
|
"PPC32 icache line size %u (type %u)\n",
|
|
(UInt)auxv->u.a_val, (UInt)auxv->a_type );
|
|
}
|
|
-# elif defined(VGP_ppc64_linux)
|
|
+# elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
/* acquire cache info */
|
|
if (auxv->u.a_val > 0) {
|
|
VG_(machine_ppc64_set_clszB)( auxv->u.a_val );
|
|
@@ -730,7 +732,8 @@ Addr setup_client_stack( void* init_sp,
|
|
# endif
|
|
break;
|
|
|
|
-# if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc32_linux) || defined(VGP_ppc64be_linux) \
|
|
+ || defined(VGP_ppc64le_linux)
|
|
case AT_IGNOREPPC:
|
|
break;
|
|
# endif
|
|
@@ -750,7 +753,8 @@ Addr setup_client_stack( void* init_sp,
|
|
auxv->a_type = AT_IGNORE;
|
|
break;
|
|
|
|
-# if !defined(VGP_ppc32_linux) && !defined(VGP_ppc64_linux)
|
|
+# if !defined(VGP_ppc32_linux) && !defined(VGP_ppc64be_linux) \
|
|
+ && !defined(VGP_ppc64le_linux)
|
|
case AT_SYSINFO_EHDR: {
|
|
/* Trash this, because we don't reproduce it */
|
|
const NSegment* ehdrseg = VG_(am_find_nsegment)((Addr)auxv->u.a_ptr);
|
|
@@ -1036,7 +1040,7 @@ void VG_(ii_finalise_image)( IIFinaliseI
|
|
arch->vex.guest_GPR1 = iifii.initial_client_SP;
|
|
arch->vex.guest_CIA = iifii.initial_client_IP;
|
|
|
|
-# elif defined(VGP_ppc64_linux)
|
|
+# elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
vg_assert(0 == sizeof(VexGuestPPC64State) % 16);
|
|
|
|
/* Zero out the initial state, and set up the simulated FPU in a
|
|
Index: coregrind/m_main.c
|
|
===================================================================
|
|
--- coregrind/m_main.c.orig
|
|
+++ coregrind/m_main.c
|
|
@@ -2016,7 +2016,8 @@ Int valgrind_main ( Int argc, HChar **ar
|
|
|
|
# if defined(VGP_x86_linux)
|
|
iters = 10;
|
|
-# elif defined(VGP_amd64_linux) || defined(VGP_ppc64_linux)
|
|
+# elif defined(VGP_amd64_linux) || defined(VGP_ppc64be_linux) \
|
|
+ || defined(VGP_ppc64le_linux)
|
|
iters = 10;
|
|
# elif defined(VGP_ppc32_linux)
|
|
iters = 5;
|
|
@@ -2570,7 +2571,7 @@ void shutdown_actions_NORETURN( ThreadId
|
|
static void final_tidyup(ThreadId tid)
|
|
{
|
|
#if !defined(VGO_darwin)
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux)
|
|
Addr r2;
|
|
# endif
|
|
Addr __libc_freeres_wrapper = VG_(client___libc_freeres_wrapper);
|
|
@@ -2582,7 +2583,7 @@ static void final_tidyup(ThreadId tid)
|
|
0 == __libc_freeres_wrapper )
|
|
return; /* can't/won't do it */
|
|
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux)
|
|
r2 = VG_(get_tocptr)( __libc_freeres_wrapper );
|
|
if (r2 == 0) {
|
|
VG_(message)(Vg_UserMsg,
|
|
@@ -2600,12 +2601,12 @@ static void final_tidyup(ThreadId tid)
|
|
"Caught __NR_exit; running __libc_freeres()\n");
|
|
|
|
/* set thread context to point to libc_freeres_wrapper */
|
|
- /* ppc64-linux note: __libc_freeres_wrapper gives us the real
|
|
+ /* ppc64be-linux note: __libc_freeres_wrapper gives us the real
|
|
function entry point, not a fn descriptor, so can use it
|
|
directly. However, we need to set R2 (the toc pointer)
|
|
appropriately. */
|
|
VG_(set_IP)(tid, __libc_freeres_wrapper);
|
|
-# if defined(VGP_ppc64_linux)
|
|
+# if defined(VGP_ppc64be_linux)
|
|
VG_(threads)[tid].arch.vex.guest_GPR2 = r2;
|
|
# endif
|
|
/* mips-linux note: we need to set t9 */
|
|
@@ -2802,7 +2803,7 @@ asm("\n"
|
|
"\ttrap\n"
|
|
".previous\n"
|
|
);
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux)
|
|
asm("\n"
|
|
/* PPC64 ELF ABI says '_start' points to a function descriptor.
|
|
So we must have one, and that is what goes into the .opd section. */
|
|
@@ -3061,10 +3062,10 @@ void _start_in_C_linux ( UWord* pArgc )
|
|
|
|
the_iicii.sp_at_startup = (Addr)pArgc;
|
|
|
|
-# if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux) \
|
|
- || defined(VGP_arm64_linux)
|
|
+# if defined(VGP_ppc32_linux) || defined(VGP_ppc64be_linux) \
|
|
+ || defined(VGP_ppc64le_linux) || defined(VGP_arm64_linux)
|
|
{
|
|
- /* ppc/ppc64 can be configured with different page sizes.
|
|
+ /* ppc32/ppc64 can be configured with different page sizes.
|
|
Determine this early. This is an ugly hack and really should
|
|
be moved into valgrind_main. */
|
|
UWord *sp = &pArgc[1+argc+1];
|
|
Index: coregrind/m_libcassert.c
|
|
===================================================================
|
|
--- coregrind/m_libcassert.c.orig
|
|
+++ coregrind/m_libcassert.c
|
|
@@ -96,7 +96,7 @@
|
|
(srP)->r_sp = (ULong)r1; \
|
|
(srP)->misc.PPC32.r_lr = lr; \
|
|
}
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
# define GET_STARTREGS(srP) \
|
|
{ ULong cia, r1, lr; \
|
|
__asm__ __volatile__( \
|
|
Index: coregrind/m_libcfile.c
|
|
===================================================================
|
|
--- coregrind/m_libcfile.c.orig
|
|
+++ coregrind/m_libcfile.c
|
|
@@ -649,8 +649,8 @@ SysRes VG_(pread) ( Int fd, void* buf, I
|
|
res = VG_(do_syscall6)(__NR_pread64, fd, (UWord)buf, count,
|
|
0, 0, offset);
|
|
return res;
|
|
-# elif defined(VGP_amd64_linux) \
|
|
- || defined(VGP_ppc64_linux) || defined(VGP_s390x_linux) \
|
|
+# elif defined(VGP_amd64_linux) || defined(VGP_s390x_linux) \
|
|
+ || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \
|
|
|| defined(VGP_mips64_linux) \
|
|
|| defined(VGP_arm64_linux)
|
|
res = VG_(do_syscall4)(__NR_pread64, fd, (UWord)buf, count, offset);
|
|
@@ -895,7 +895,8 @@ static Int parse_inet_addr_and_port ( co
|
|
Int VG_(socket) ( Int domain, Int type, Int protocol )
|
|
{
|
|
# if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) \
|
|
- || defined(VGP_ppc64_linux) || defined(VGP_s390x_linux)
|
|
+ || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \
|
|
+ || defined(VGP_s390x_linux)
|
|
SysRes res;
|
|
UWord args[3];
|
|
args[0] = domain;
|
|
@@ -935,7 +936,8 @@ static
|
|
Int my_connect ( Int sockfd, struct vki_sockaddr_in* serv_addr, Int addrlen )
|
|
{
|
|
# if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) \
|
|
- || defined(VGP_ppc64_linux) || defined(VGP_s390x_linux)
|
|
+ || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \
|
|
+ || defined(VGP_s390x_linux)
|
|
SysRes res;
|
|
UWord args[3];
|
|
args[0] = sockfd;
|
|
@@ -974,7 +976,8 @@ Int VG_(write_socket)( Int sd, const voi
|
|
SIGPIPE */
|
|
|
|
# if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) \
|
|
- || defined(VGP_ppc64_linux) || defined(VGP_s390x_linux)
|
|
+ || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \
|
|
+ || defined(VGP_s390x_linux)
|
|
SysRes res;
|
|
UWord args[4];
|
|
args[0] = sd;
|
|
@@ -1005,7 +1008,8 @@ Int VG_(write_socket)( Int sd, const voi
|
|
Int VG_(getsockname) ( Int sd, struct vki_sockaddr *name, Int *namelen)
|
|
{
|
|
# if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) \
|
|
- || defined(VGP_ppc64_linux) || defined(VGP_s390x_linux) \
|
|
+ || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \
|
|
+ || defined(VGP_s390x_linux) \
|
|
|| defined(VGP_mips32_linux)
|
|
SysRes res;
|
|
UWord args[3];
|
|
@@ -1036,7 +1040,8 @@ Int VG_(getsockname) ( Int sd, struct vk
|
|
Int VG_(getpeername) ( Int sd, struct vki_sockaddr *name, Int *namelen)
|
|
{
|
|
# if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) \
|
|
- || defined(VGP_ppc64_linux) || defined(VGP_s390x_linux) \
|
|
+ || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \
|
|
+ || defined(VGP_s390x_linux) \
|
|
|| defined(VGP_mips32_linux)
|
|
SysRes res;
|
|
UWord args[3];
|
|
@@ -1068,7 +1073,8 @@ Int VG_(getsockopt) ( Int sd, Int level,
|
|
Int *optlen)
|
|
{
|
|
# if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) \
|
|
- || defined(VGP_ppc64_linux) || defined(VGP_s390x_linux)
|
|
+ || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \
|
|
+ || defined(VGP_s390x_linux)
|
|
SysRes res;
|
|
UWord args[5];
|
|
args[0] = sd;
|
|
@@ -1105,7 +1111,8 @@ Int VG_(setsockopt) ( Int sd, Int level,
|
|
Int optlen)
|
|
{
|
|
# if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) \
|
|
- || defined(VGP_ppc64_linux) || defined(VGP_s390x_linux)
|
|
+ || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \
|
|
+ || defined(VGP_s390x_linux)
|
|
SysRes res;
|
|
UWord args[5];
|
|
args[0] = sd;
|
|
Index: coregrind/launcher-linux.c
|
|
===================================================================
|
|
--- coregrind/launcher-linux.c.orig
|
|
+++ coregrind/launcher-linux.c
|
|
@@ -236,7 +236,7 @@ static const char *select_platform(const
|
|
if (ehdr->e_machine == EM_PPC64 &&
|
|
(ehdr->e_ident[EI_OSABI] == ELFOSABI_SYSV ||
|
|
ehdr->e_ident[EI_OSABI] == ELFOSABI_LINUX)) {
|
|
- platform = "ppc64-linux";
|
|
+ platform = "ppc64be-linux";
|
|
}
|
|
else
|
|
if (ehdr->e_machine == EM_S390 &&
|
|
@@ -320,7 +320,7 @@ int main(int argc, char** argv, char** e
|
|
if ((0==strcmp(VG_PLATFORM,"x86-linux")) ||
|
|
(0==strcmp(VG_PLATFORM,"amd64-linux")) ||
|
|
(0==strcmp(VG_PLATFORM,"ppc32-linux")) ||
|
|
- (0==strcmp(VG_PLATFORM,"ppc64-linux")) ||
|
|
+ (0==strcmp(VG_PLATFORM,"ppc64be-linux")) ||
|
|
(0==strcmp(VG_PLATFORM,"arm-linux")) ||
|
|
(0==strcmp(VG_PLATFORM,"arm64-linux")) ||
|
|
(0==strcmp(VG_PLATFORM,"s390x-linux")) ||
|
|
Index: coregrind/m_coredump/coredump-elf.c
|
|
===================================================================
|
|
--- coregrind/m_coredump/coredump-elf.c.orig
|
|
+++ coregrind/m_coredump/coredump-elf.c
|
|
@@ -322,7 +322,7 @@ static void fill_prstatus(const ThreadSt
|
|
regs->dsisr = 0;
|
|
regs->result = 0;
|
|
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux)
|
|
# define DO(n) regs->gpr[n] = arch->vex.guest_GPR##n
|
|
DO(0); DO(1); DO(2); DO(3); DO(4); DO(5); DO(6); DO(7);
|
|
DO(8); DO(9); DO(10); DO(11); DO(12); DO(13); DO(14); DO(15);
|
|
@@ -458,7 +458,7 @@ static void fill_fpu(const ThreadState *
|
|
DO(24); DO(25); DO(26); DO(27); DO(28); DO(29); DO(30); DO(31);
|
|
# undef DO
|
|
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
/* The guest state has the FPR fields declared as ULongs, so need
|
|
to fish out the values without converting them.
|
|
NOTE: The 32 FP registers map to the first 32 VSX registers.*/
|
|
Index: coregrind/m_machine.c
|
|
===================================================================
|
|
--- coregrind/m_machine.c.orig
|
|
+++ coregrind/m_machine.c
|
|
@@ -81,7 +81,7 @@ void VG_(get_UnwindStartRegs) ( /*OUT*/U
|
|
regs->r_sp = (ULong)VG_(threads)[tid].arch.vex.guest_GPR1;
|
|
regs->misc.PPC32.r_lr
|
|
= VG_(threads)[tid].arch.vex.guest_LR;
|
|
-# elif defined(VGA_ppc64)
|
|
+# elif defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
regs->r_pc = VG_(threads)[tid].arch.vex.guest_CIA;
|
|
regs->r_sp = VG_(threads)[tid].arch.vex.guest_GPR1;
|
|
regs->misc.PPC64.r_lr
|
|
@@ -212,7 +212,7 @@ static void apply_to_GPs_of_tid(ThreadId
|
|
(*f)(tid, "R13", vex->guest_R13);
|
|
(*f)(tid, "R14", vex->guest_R14);
|
|
(*f)(tid, "R15", vex->guest_R15);
|
|
-#elif defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
(*f)(tid, "GPR0" , vex->guest_GPR0 );
|
|
(*f)(tid, "GPR1" , vex->guest_GPR1 );
|
|
(*f)(tid, "GPR2" , vex->guest_GPR2 );
|
|
@@ -413,7 +413,7 @@ UInt VG_(machine_x86_have_mxcsr) = 0;
|
|
UInt VG_(machine_ppc32_has_FP) = 0;
|
|
UInt VG_(machine_ppc32_has_VMX) = 0;
|
|
#endif
|
|
-#if defined(VGA_ppc64)
|
|
+#if defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
ULong VG_(machine_ppc64_has_VMX) = 0;
|
|
#endif
|
|
#if defined(VGA_arm)
|
|
@@ -423,7 +423,7 @@ Int VG_(machine_arm_archlevel) = 4;
|
|
|
|
/* For hwcaps detection on ppc32/64, s390x, and arm we'll need to do SIGILL
|
|
testing, so we need a VG_MINIMAL_JMP_BUF. */
|
|
-#if defined(VGA_ppc32) || defined(VGA_ppc64) \
|
|
+#if defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le) \
|
|
|| defined(VGA_arm) || defined(VGA_s390x) || defined(VGA_mips32)
|
|
#include "pub_core_libcsetjmp.h"
|
|
static VG_MINIMAL_JMP_BUF(env_unsup_insn);
|
|
@@ -441,7 +441,7 @@ static void handler_unsup_insn ( Int x )
|
|
* Not very defensive: assumes that as long as the dcbz/dcbzl
|
|
* instructions don't raise a SIGILL, that they will zero an aligned,
|
|
* contiguous block of memory of a sensible size. */
|
|
-#if defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+#if defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
static void find_ppc_dcbz_sz(VexArchInfo *arch_info)
|
|
{
|
|
Int dcbz_szB = 0;
|
|
@@ -494,7 +494,7 @@ static void find_ppc_dcbz_sz(VexArchInfo
|
|
dcbz_szB, dcbzl_szB);
|
|
# undef MAX_DCBZL_SZB
|
|
}
|
|
-#endif /* defined(VGA_ppc32) || defined(VGA_ppc64) */
|
|
+#endif /* defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le) */
|
|
|
|
#ifdef VGA_s390x
|
|
|
|
@@ -1033,7 +1033,7 @@ Bool VG_(machine_get_hwcaps)( void )
|
|
return True;
|
|
}
|
|
|
|
-#elif defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc64be)|| defined(VGA_ppc64le)
|
|
{
|
|
/* Same instruction set detection algorithm as for ppc32. */
|
|
vki_sigset_t saved_set, tmp_set;
|
|
@@ -1147,7 +1147,7 @@ Bool VG_(machine_get_hwcaps)( void )
|
|
(Int)have_F, (Int)have_V, (Int)have_FX,
|
|
(Int)have_GX, (Int)have_VX, (Int)have_DFP,
|
|
(Int)have_isa_2_07);
|
|
- /* on ppc64, if we don't even have FP, just give up. */
|
|
+ /* on ppc64be, if we don't even have FP, just give up. */
|
|
if (!have_F)
|
|
return False;
|
|
|
|
@@ -1565,7 +1565,7 @@ void VG_(machine_ppc32_set_clszB)( Int s
|
|
|
|
|
|
/* Notify host cpu instruction cache line size. */
|
|
-#if defined(VGA_ppc64)
|
|
+#if defined(VGA_ppc64be)|| defined(VGA_ppc64le)
|
|
void VG_(machine_ppc64_set_clszB)( Int szB )
|
|
{
|
|
vg_assert(hwcaps_done);
|
|
@@ -1647,7 +1647,7 @@ Int VG_(machine_get_size_of_largest_gues
|
|
if (vai.hwcaps & VEX_HWCAPS_PPC32_DFP) return 16;
|
|
return 8;
|
|
|
|
-# elif defined(VGA_ppc64)
|
|
+# elif defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
/* 8 if boring; 16 if signs of Altivec or other exotic stuff */
|
|
if (vai.hwcaps & VEX_HWCAPS_PPC64_V) return 16;
|
|
if (vai.hwcaps & VEX_HWCAPS_PPC64_VX) return 16;
|
|
@@ -1685,12 +1685,12 @@ Int VG_(machine_get_size_of_largest_gues
|
|
void* VG_(fnptr_to_fnentry)( void* f )
|
|
{
|
|
# if defined(VGP_x86_linux) || defined(VGP_amd64_linux) \
|
|
- || defined(VGP_arm_linux) \
|
|
- || defined(VGP_ppc32_linux) || defined(VGO_darwin) \
|
|
+ || defined(VGP_arm_linux) || defined(VGO_darwin) \
|
|
+ || defined(VGP_ppc32_linux) || defined(VGP_ppc64le_linux) \
|
|
|| defined(VGP_s390x_linux) || defined(VGP_mips32_linux) \
|
|
|| defined(VGP_mips64_linux) || defined(VGP_arm64_linux)
|
|
return f;
|
|
-# elif defined(VGP_ppc64_linux)
|
|
+# elif defined(VGP_ppc64be_linux)
|
|
/* ppc64-linux uses the AIX scheme, in which f is a pointer to a
|
|
3-word function descriptor, of which the first word is the entry
|
|
address. */
|
|
Index: coregrind/m_syscall.c
|
|
===================================================================
|
|
--- coregrind/m_syscall.c.orig
|
|
+++ coregrind/m_syscall.c
|
|
@@ -386,7 +386,7 @@ asm(
|
|
".previous\n"
|
|
);
|
|
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux)
|
|
/* Due to the need to return 65 bits of result, this is completely
|
|
different from the ppc32 case. The single arg register points to a
|
|
7-word block containing the syscall # and the 6 args. The syscall
|
|
@@ -720,7 +720,7 @@ SysRes VG_(do_syscall) ( UWord sysno, UW
|
|
UInt cr0so = (UInt)(ret);
|
|
return VG_(mk_SysRes_ppc32_linux)( val, cr0so );
|
|
|
|
-# elif defined(VGP_ppc64_linux)
|
|
+# elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
ULong argblock[7];
|
|
argblock[0] = sysno;
|
|
argblock[1] = a1;
|
|
Index: coregrind/m_ume/macho.c
|
|
===================================================================
|
|
--- coregrind/m_ume/macho.c.orig
|
|
+++ coregrind/m_ume/macho.c
|
|
@@ -699,8 +699,8 @@ load_fat_file(int fd, vki_off_t offset,
|
|
|
|
#if defined(VGA_ppc32)
|
|
good_arch = CPU_TYPE_POWERPC;
|
|
-#elif defined(VGA_ppc64)
|
|
- good_arch = CPU_TYPE_POWERPC64;
|
|
+#elif defined(VGA_ppc64be)
|
|
+ good_arch = CPU_TYPE_POWERPC64BE;
|
|
#elif defined(VGA_x86)
|
|
good_arch = CPU_TYPE_I386;
|
|
#elif defined(VGA_amd64)
|
|
Index: coregrind/m_ume/elf.c
|
|
===================================================================
|
|
--- coregrind/m_ume/elf.c.orig
|
|
+++ coregrind/m_ume/elf.c
|
|
@@ -511,9 +511,9 @@ Int VG_(load_ELF)(Int fd, const HChar* n
|
|
info->exe_base = minaddr + ebase;
|
|
info->exe_end = maxaddr + ebase;
|
|
|
|
-#if defined(VGP_ppc64_linux)
|
|
- /* On PPC64, a func ptr is represented by a TOC entry ptr. This
|
|
- TOC entry contains three words; the first word is the function
|
|
+#if defined(VGP_ppc64be_linux)
|
|
+ /* On PPC64BE, ELF ver 1, a func ptr is represented by a TOC entry ptr.
|
|
+ This TOC entry contains three words; the first word is the function
|
|
address, the second word is the TOC ptr (r2), and the third word
|
|
is the static chain value. */
|
|
info->init_ip = ((ULong*)entry)[0];
|
|
Index: coregrind/launcher-darwin.c
|
|
===================================================================
|
|
--- coregrind/launcher-darwin.c.orig
|
|
+++ coregrind/launcher-darwin.c
|
|
@@ -59,11 +59,11 @@ static struct {
|
|
const char *apple_name; // e.g. x86_64
|
|
const char *valgrind_name; // e.g. amd64
|
|
} valid_archs[] = {
|
|
- { CPU_TYPE_X86, "i386", "x86" },
|
|
- { CPU_TYPE_X86_64, "x86_64", "amd64" },
|
|
- { CPU_TYPE_ARM, "arm", "arm" },
|
|
- { CPU_TYPE_POWERPC, "ppc", "ppc32" },
|
|
- { CPU_TYPE_POWERPC64, "ppc64", "ppc64" },
|
|
+ { CPU_TYPE_X86, "i386", "x86" },
|
|
+ { CPU_TYPE_X86_64, "x86_64", "amd64" },
|
|
+ { CPU_TYPE_ARM, "arm", "arm" },
|
|
+ { CPU_TYPE_POWERPC, "ppc", "ppc32" },
|
|
+ { CPU_TYPE_POWERPC64BE, "ppc64be", "ppc64be" },
|
|
};
|
|
static int valid_archs_count = sizeof(valid_archs)/sizeof(valid_archs[0]);
|
|
|
|
Index: coregrind/pub_core_threadstate.h
|
|
===================================================================
|
|
--- coregrind/pub_core_threadstate.h.orig
|
|
+++ coregrind/pub_core_threadstate.h
|
|
@@ -84,7 +84,7 @@ typedef
|
|
typedef VexGuestAMD64State VexGuestArchState;
|
|
#elif defined(VGA_ppc32)
|
|
typedef VexGuestPPC32State VexGuestArchState;
|
|
-#elif defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
typedef VexGuestPPC64State VexGuestArchState;
|
|
#elif defined(VGA_arm)
|
|
typedef VexGuestARMState VexGuestArchState;
|
|
Index: coregrind/m_aspacemgr/aspacemgr-common.c
|
|
===================================================================
|
|
--- coregrind/m_aspacemgr/aspacemgr-common.c.orig
|
|
+++ coregrind/m_aspacemgr/aspacemgr-common.c
|
|
@@ -162,7 +162,8 @@ SysRes VG_(am_do_mmap_NO_NOTIFY)( Addr s
|
|
aspacem_assert((offset % 4096) == 0);
|
|
res = VG_(do_syscall6)(__NR_mmap2, (UWord)start, length,
|
|
prot, flags, fd, offset / 4096);
|
|
-# elif defined(VGP_amd64_linux) || defined(VGP_ppc64_linux) \
|
|
+# elif defined(VGP_amd64_linux) \
|
|
+ || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \
|
|
|| defined(VGP_s390x_linux) || defined(VGP_mips32_linux) \
|
|
|| defined(VGP_mips64_linux) || defined(VGP_arm64_linux)
|
|
res = VG_(do_syscall6)(__NR_mmap, (UWord)start, length,
|
|
Index: coregrind/m_syswrap/syswrap-main.c
|
|
===================================================================
|
|
--- coregrind/m_syswrap/syswrap-main.c.orig
|
|
+++ coregrind/m_syswrap/syswrap-main.c
|
|
@@ -441,7 +441,7 @@ void getSyscallArgsFromGuestState ( /*OU
|
|
canonical->arg7 = 0;
|
|
canonical->arg8 = 0;
|
|
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
VexGuestPPC64State* gst = (VexGuestPPC64State*)gst_vanilla;
|
|
canonical->sysno = gst->guest_GPR0;
|
|
canonical->arg1 = gst->guest_GPR3;
|
|
@@ -687,7 +687,7 @@ void putSyscallArgsIntoGuestState ( /*IN
|
|
gst->guest_GPR7 = canonical->arg5;
|
|
gst->guest_GPR8 = canonical->arg6;
|
|
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
VexGuestPPC64State* gst = (VexGuestPPC64State*)gst_vanilla;
|
|
gst->guest_GPR0 = canonical->sysno;
|
|
gst->guest_GPR3 = canonical->arg1;
|
|
@@ -818,7 +818,7 @@ void getSyscallStatusFromGuestState ( /*
|
|
canonical->sres = VG_(mk_SysRes_ppc32_linux)( gst->guest_GPR3, cr0so );
|
|
canonical->what = SsComplete;
|
|
|
|
-# elif defined(VGP_ppc64_linux)
|
|
+# elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
VexGuestPPC64State* gst = (VexGuestPPC64State*)gst_vanilla;
|
|
UInt cr = LibVEX_GuestPPC64_get_CR( gst );
|
|
UInt cr0so = (cr >> 28) & 1;
|
|
@@ -976,7 +976,7 @@ void putSyscallStatusIntoGuestState ( /*
|
|
VG_TRACK( post_reg_write, Vg_CoreSysCall, tid,
|
|
OFFSET_ppc32_CR0_0, sizeof(UChar) );
|
|
|
|
-# elif defined(VGP_ppc64_linux)
|
|
+# elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
VexGuestPPC64State* gst = (VexGuestPPC64State*)gst_vanilla;
|
|
UInt old_cr = LibVEX_GuestPPC64_get_CR(gst);
|
|
vg_assert(canonical->what == SsComplete);
|
|
@@ -1181,7 +1181,7 @@ void getSyscallArgLayout ( /*OUT*/Syscal
|
|
layout->uu_arg7 = -1; /* impossible value */
|
|
layout->uu_arg8 = -1; /* impossible value */
|
|
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
layout->o_sysno = OFFSET_ppc64_GPR0;
|
|
layout->o_arg1 = OFFSET_ppc64_GPR3;
|
|
layout->o_arg2 = OFFSET_ppc64_GPR4;
|
|
@@ -1987,7 +1987,7 @@ void ML_(fixup_guest_state_to_restart_sy
|
|
vg_assert(p[0] == 0x0F && p[1] == 0x05);
|
|
}
|
|
|
|
-#elif defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc32_linux) || defined(VGP_ppc64be_linux)
|
|
arch->vex.guest_CIA -= 4; // sizeof(ppc32 instr)
|
|
|
|
/* Make sure our caller is actually sane, and we're really backing
|
|
Index: coregrind/m_syswrap/syswrap-ppc64-linux.c
|
|
===================================================================
|
|
--- coregrind/m_syswrap/syswrap-ppc64-linux.c.orig
|
|
+++ coregrind/m_syswrap/syswrap-ppc64-linux.c
|
|
@@ -28,7 +28,7 @@
|
|
The GNU General Public License is contained in the file COPYING.
|
|
*/
|
|
|
|
-#if defined(VGP_ppc64_linux)
|
|
+#if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
|
|
#include "pub_core_basics.h"
|
|
#include "pub_core_vki.h"
|
|
@@ -1072,7 +1072,7 @@ SyscallTableEntry* ML_(get_linux_syscall
|
|
return NULL;
|
|
}
|
|
|
|
-#endif // defined(VGP_ppc64_linux)
|
|
+#endif // defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
|
|
/*--------------------------------------------------------------------*/
|
|
/*--- end ---*/
|
|
Index: coregrind/m_syswrap/syswrap-linux.c
|
|
===================================================================
|
|
--- coregrind/m_syswrap/syswrap-linux.c.orig
|
|
+++ coregrind/m_syswrap/syswrap-linux.c
|
|
@@ -244,7 +244,8 @@ static void run_a_thread_NORETURN ( Word
|
|
: "n" (VgTs_Empty), "n" (__NR_exit), "m" (tst->os_state.exitcode)
|
|
: "rax", "rdi"
|
|
);
|
|
-#elif defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc32_linux) || defined(VGP_ppc64be_linux) \
|
|
+ || defined(VGP_ppc64le_linux)
|
|
{ UInt vgts_empty = (UInt)VgTs_Empty;
|
|
asm volatile (
|
|
"stw %1,%0\n\t" /* set tst->status = VgTs_Empty */
|
|
@@ -385,7 +386,7 @@ void VG_(main_thread_wrapper_NORETURN)(T
|
|
sp -= 16;
|
|
sp &= ~0xF;
|
|
*(UWord *)sp = 0;
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
/* make a stack frame */
|
|
sp -= 112;
|
|
sp &= ~((Addr)0xF);
|
|
@@ -438,7 +439,8 @@ SysRes ML_(do_fork_clone) ( ThreadId tid
|
|
/* Since this is the fork() form of clone, we don't need all that
|
|
VG_(clone) stuff */
|
|
#if defined(VGP_x86_linux) \
|
|
- || defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux) \
|
|
+ || defined(VGP_ppc32_linux) \
|
|
+ || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \
|
|
|| defined(VGP_arm_linux) || defined(VGP_mips32_linux) \
|
|
|| defined(VGP_mips64_linux) || defined(VGP_arm64_linux)
|
|
res = VG_(do_syscall5)( __NR_clone, flags,
|
|
Index: coregrind/m_syswrap/priv_types_n_macros.h
|
|
===================================================================
|
|
--- coregrind/m_syswrap/priv_types_n_macros.h.orig
|
|
+++ coregrind/m_syswrap/priv_types_n_macros.h
|
|
@@ -90,7 +90,8 @@ typedef
|
|
// field names), the s_arg value is the offset from the stack pointer.
|
|
Int o_sysno;
|
|
# if defined(VGP_x86_linux) || defined(VGP_amd64_linux) \
|
|
- || defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux) \
|
|
+ || defined(VGP_ppc32_linux) \
|
|
+ || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \
|
|
|| defined(VGP_arm_linux) || defined(VGP_s390x_linux) \
|
|
|| defined(VGP_mips64_linux) || defined(VGP_arm64_linux)
|
|
Int o_arg1;
|
|
Index: coregrind/m_syswrap/syscall-ppc64-linux.S
|
|
===================================================================
|
|
--- coregrind/m_syswrap/syscall-ppc64-linux.S.orig
|
|
+++ coregrind/m_syswrap/syscall-ppc64-linux.S
|
|
@@ -27,7 +27,7 @@
|
|
The GNU General Public License is contained in the file COPYING.
|
|
*/
|
|
|
|
-#if defined(VGP_ppc64_linux)
|
|
+#if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
|
|
#include "pub_core_basics_asm.h"
|
|
#include "pub_core_vkiscnums_asm.h"
|
|
@@ -165,7 +165,7 @@ ML_(blksys_finished): .quad 5b
|
|
/* Let the linker know we don't need an executable stack */
|
|
.section .note.GNU-stack,"",@progbits
|
|
|
|
-#endif // defined(VGP_ppc64_linux)
|
|
+#endif // defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
|
|
/*--------------------------------------------------------------------*/
|
|
/*--- end ---*/
|
|
Index: coregrind/m_debuglog.c
|
|
===================================================================
|
|
--- coregrind/m_debuglog.c.orig
|
|
+++ coregrind/m_debuglog.c
|
|
@@ -189,7 +189,7 @@ static UInt local_sys_getpid ( void )
|
|
return __res;
|
|
}
|
|
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
|
|
static UInt local_sys_write_stderr ( const HChar* buf, Int n )
|
|
{
|
|
Index: coregrind/m_vki.c
|
|
===================================================================
|
|
--- coregrind/m_vki.c.orig
|
|
+++ coregrind/m_vki.c
|
|
@@ -42,8 +42,8 @@
|
|
/* ppc32/64-linux determines page size at startup, hence m_vki is
|
|
the logical place to store that info. */
|
|
|
|
-#if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux) \
|
|
- || defined(VGP_arm64_linux)
|
|
+#if defined(VGP_ppc32_linux) || defined(VGP_ppc64be_linux) \
|
|
+ || defined(VGP_ppc64le_linux) || defined(VGP_arm64_linux)
|
|
unsigned long VKI_PAGE_SHIFT = 12;
|
|
unsigned long VKI_PAGE_SIZE = 1UL << 12;
|
|
#endif
|
|
Index: coregrind/pub_core_basics.h
|
|
===================================================================
|
|
--- coregrind/pub_core_basics.h.orig
|
|
+++ coregrind/pub_core_basics.h
|
|
@@ -54,7 +54,7 @@
|
|
# include "libvex_guest_amd64.h"
|
|
#elif defined(VGA_ppc32)
|
|
# include "libvex_guest_ppc32.h"
|
|
-#elif defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
# include "libvex_guest_ppc64.h"
|
|
#elif defined(VGA_arm)
|
|
# include "libvex_guest_arm.h"
|
|
Index: coregrind/m_sigframe/sigframe-ppc64-linux.c
|
|
===================================================================
|
|
--- coregrind/m_sigframe/sigframe-ppc64-linux.c.orig
|
|
+++ coregrind/m_sigframe/sigframe-ppc64-linux.c
|
|
@@ -31,7 +31,7 @@
|
|
The GNU General Public License is contained in the file COPYING.
|
|
*/
|
|
|
|
-#if defined(VGP_ppc64_linux)
|
|
+#if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
|
|
#include "pub_core_basics.h"
|
|
#include "pub_core_vki.h"
|
|
@@ -388,7 +388,7 @@ void VG_(sigframe_destroy)( ThreadId tid
|
|
VG_TRACK( post_deliver_signal, tid, sigNo );
|
|
}
|
|
|
|
-#endif // defined(VGP_ppc64_linux)
|
|
+#endif // defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
|
|
/*--------------------------------------------------------------------*/
|
|
/*--- end ---*/
|
|
Index: coregrind/m_libcsetjmp.c
|
|
===================================================================
|
|
--- coregrind/m_libcsetjmp.c.orig
|
|
+++ coregrind/m_libcsetjmp.c
|
|
@@ -149,7 +149,7 @@ __asm__(
|
|
|
|
/* ------------ ppc64-linux ------------ */
|
|
|
|
-#if defined(VGP_ppc64_linux)
|
|
+#if defined(VGP_ppc64be_linux)
|
|
|
|
__asm__(
|
|
".section \".toc\",\"aw\"" "\n"
|
|
@@ -270,7 +270,7 @@ __asm__(
|
|
".previous" "\n"
|
|
);
|
|
|
|
-#endif /* VGP_ppc64_linux */
|
|
+#endif /* VGP_ppc64be_linux */
|
|
|
|
|
|
/* ------------ amd64-{linux,darwin} ------------ */
|
|
Index: coregrind/m_libcproc.c
|
|
===================================================================
|
|
--- coregrind/m_libcproc.c.orig
|
|
+++ coregrind/m_libcproc.c
|
|
@@ -555,8 +555,8 @@ Int VG_(getgroups)( Int size, UInt* list
|
|
list[i] = (UInt)list16[i];
|
|
return sr_Res(sres);
|
|
|
|
-# elif defined(VGP_amd64_linux) || defined(VGP_ppc64_linux) \
|
|
- || defined(VGP_arm_linux) \
|
|
+# elif defined(VGP_amd64_linux) || defined(VGP_arm_linux) \
|
|
+ || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \
|
|
|| defined(VGO_darwin) || defined(VGP_s390x_linux) \
|
|
|| defined(VGP_mips32_linux) || defined(VGP_arm64_linux)
|
|
SysRes sres;
|
|
@@ -741,7 +741,7 @@ void VG_(invalidate_icache) ( void *ptr,
|
|
// If I-caches are coherent, nothing needs to be done here
|
|
if (vai.hwcache_info.icaches_maintain_coherence) return;
|
|
|
|
-# if defined(VGA_ppc32) || defined(VGA_ppc64)
|
|
+# if defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
Addr startaddr = (Addr) ptr;
|
|
Addr endaddr = startaddr + nbytes;
|
|
Addr cls;
|
|
Index: coregrind/m_cache.c
|
|
===================================================================
|
|
--- coregrind/m_cache.c.orig
|
|
+++ coregrind/m_cache.c
|
|
@@ -538,7 +538,8 @@ get_cache_info(VexArchInfo *vai)
|
|
return ret == 0 ? True : False;
|
|
}
|
|
|
|
-#elif defined(VGA_arm) || defined(VGA_ppc32) || defined(VGA_ppc64) || \
|
|
+#elif defined(VGA_arm) || defined(VGA_ppc32) || \
|
|
+ defined(VGA_ppc64be) || defined(VGA_ppc64le) || \
|
|
defined(VGA_mips32) || defined(VGA_mips64) || defined(VGA_arm64)
|
|
|
|
static Bool
|
|
Index: coregrind/m_redir.c
|
|
===================================================================
|
|
--- coregrind/m_redir.c.orig
|
|
+++ coregrind/m_redir.c
|
|
@@ -1278,7 +1278,7 @@ void VG_(redir_initialise) ( void )
|
|
);
|
|
}
|
|
|
|
-# elif defined(VGP_ppc64_linux)
|
|
+# elif defined(VGP_ppc64be_linux)
|
|
/* If we're using memcheck, use these intercepts right from
|
|
the start, otherwise ld.so makes a lot of noise. */
|
|
if (0==VG_(strcmp)("Memcheck", VG_(details).name)) {
|
|
Index: coregrind/pub_core_aspacemgr.h
|
|
===================================================================
|
|
--- coregrind/pub_core_aspacemgr.h.orig
|
|
+++ coregrind/pub_core_aspacemgr.h
|
|
@@ -344,7 +344,8 @@ extern Bool VG_(am_relocate_nooverlap_cl
|
|
// stacks. The address space manager provides and suitably
|
|
// protects such stacks.
|
|
|
|
-#if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux) \
|
|
+#if defined(VGP_ppc32_linux) \
|
|
+ || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \
|
|
|| defined(VGP_mips32_linux) || defined(VGP_mips64_linux) \
|
|
|| defined(VGP_arm64_linux)
|
|
# define VG_STACK_GUARD_SZB 65536 // 1 or 16 pages
|
|
Index: coregrind/pub_core_machine.h
|
|
===================================================================
|
|
--- coregrind/pub_core_machine.h.orig
|
|
+++ coregrind/pub_core_machine.h
|
|
@@ -56,7 +56,7 @@
|
|
# define VG_ELF_MACHINE EM_PPC
|
|
# define VG_ELF_CLASS ELFCLASS32
|
|
# undef VG_PLAT_USES_PPCTOC
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux)
|
|
# define VG_ELF_DATA2XXX ELFDATA2MSB
|
|
# define VG_ELF_MACHINE EM_PPC64
|
|
# define VG_ELF_CLASS ELFCLASS64
|
|
@@ -119,7 +119,7 @@
|
|
# define VG_INSTR_PTR guest_CIA
|
|
# define VG_STACK_PTR guest_GPR1
|
|
# define VG_FRAME_PTR guest_GPR1 // No frame ptr for PPC
|
|
-#elif defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
# define VG_INSTR_PTR guest_CIA
|
|
# define VG_STACK_PTR guest_GPR1
|
|
# define VG_FRAME_PTR guest_GPR1 // No frame ptr for PPC
|
|
@@ -233,7 +233,7 @@ extern Bool VG_(machine_get_cache_info)(
|
|
extern void VG_(machine_ppc32_set_clszB)( Int );
|
|
#endif
|
|
|
|
-#if defined(VGA_ppc64)
|
|
+#if defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
extern void VG_(machine_ppc64_set_clszB)( Int );
|
|
#endif
|
|
|
|
@@ -265,7 +265,7 @@ extern UInt VG_(machine_ppc32_has_VMX);
|
|
/* PPC64: set to 1 if Altivec instructions are supported in
|
|
user-space, else 0. Is referenced from assembly code, so do not
|
|
change from a 64-bit int. */
|
|
-#if defined(VGA_ppc64)
|
|
+#if defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
extern ULong VG_(machine_ppc64_has_VMX);
|
|
#endif
|
|
|
|
Index: Makefile.all.am
|
|
===================================================================
|
|
--- Makefile.all.am.orig
|
|
+++ Makefile.all.am
|
|
@@ -212,15 +212,16 @@ if VGCONF_PLATVARIANT_IS_ANDROID
|
|
PRELOAD_LDFLAGS_COMMON_LINUX += -nostdlib
|
|
endif
|
|
|
|
-PRELOAD_LDFLAGS_X86_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
|
|
-PRELOAD_LDFLAGS_AMD64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
|
|
-PRELOAD_LDFLAGS_PPC32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
|
|
-PRELOAD_LDFLAGS_PPC64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
|
|
-PRELOAD_LDFLAGS_ARM_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
|
|
-PRELOAD_LDFLAGS_ARM64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
|
|
-PRELOAD_LDFLAGS_X86_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch i386
|
|
-PRELOAD_LDFLAGS_AMD64_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch x86_64
|
|
-PRELOAD_LDFLAGS_S390X_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
|
|
-PRELOAD_LDFLAGS_MIPS32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
|
|
-PRELOAD_LDFLAGS_MIPS64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
|
|
+PRELOAD_LDFLAGS_X86_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
|
|
+PRELOAD_LDFLAGS_AMD64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
|
|
+PRELOAD_LDFLAGS_PPC32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
|
|
+PRELOAD_LDFLAGS_PPC64BE_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
|
|
+PRELOAD_LDFLAGS_PPC64LE_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
|
|
+PRELOAD_LDFLAGS_ARM_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
|
|
+PRELOAD_LDFLAGS_ARM64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
|
|
+PRELOAD_LDFLAGS_X86_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch i386
|
|
+PRELOAD_LDFLAGS_AMD64_DARWIN = $(PRELOAD_LDFLAGS_COMMON_DARWIN) -arch x86_64
|
|
+PRELOAD_LDFLAGS_S390X_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
|
|
+PRELOAD_LDFLAGS_MIPS32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
|
|
+PRELOAD_LDFLAGS_MIPS64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
|
|
|
|
Index: tests/arch_test.c
|
|
===================================================================
|
|
--- tests/arch_test.c.orig
|
|
+++ tests/arch_test.c
|
|
@@ -48,7 +48,7 @@ static Bool go(char* arch)
|
|
#elif defined(VGP_ppc32_linux)
|
|
if ( 0 == strcmp( arch, "ppc32" ) ) return True;
|
|
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux)
|
|
if ( 0 == strcmp( arch, "ppc64" ) ) return True;
|
|
#if defined(VGA_SEC_ppc32)
|
|
if ( 0 == strcmp( arch, "ppc32" ) ) return True;
|
|
Index: include/valgrind.h
|
|
===================================================================
|
|
--- include/valgrind.h.orig
|
|
+++ include/valgrind.h
|
|
@@ -115,7 +115,7 @@
|
|
#undef PLAT_x86_linux
|
|
#undef PLAT_amd64_linux
|
|
#undef PLAT_ppc32_linux
|
|
-#undef PLAT_ppc64_linux
|
|
+#undef PLAT_ppc64be_linux
|
|
#undef PLAT_arm_linux
|
|
#undef PLAT_arm64_linux
|
|
#undef PLAT_s390x_linux
|
|
@@ -138,8 +138,9 @@
|
|
# define PLAT_amd64_linux 1
|
|
#elif defined(__linux__) && defined(__powerpc__) && !defined(__powerpc64__)
|
|
# define PLAT_ppc32_linux 1
|
|
-#elif defined(__linux__) && defined(__powerpc__) && defined(__powerpc64__)
|
|
-# define PLAT_ppc64_linux 1
|
|
+#elif defined(__linux__) && defined(__powerpc__) && defined(__powerpc64__) && _CALL_ELF != 2
|
|
+/* Big Endian uses ELF version 1 */
|
|
+# define PLAT_ppc64be_linux 1
|
|
#elif defined(__linux__) && defined(__arm__) && !defined(__aarch64__)
|
|
# define PLAT_arm_linux 1
|
|
#elif defined(__linux__) && defined(__aarch64__) && !defined(__arm__)
|
|
@@ -510,7 +511,7 @@ typedef
|
|
|
|
/* ------------------------ ppc64-linux ------------------------ */
|
|
|
|
-#if defined(PLAT_ppc64_linux)
|
|
+#if defined(PLAT_ppc64be_linux)
|
|
|
|
typedef
|
|
struct {
|
|
@@ -585,7 +586,8 @@ typedef
|
|
); \
|
|
} while (0)
|
|
|
|
-#endif /* PLAT_ppc64_linux */
|
|
+#endif /* PLAT_ppc64be_linux */
|
|
+
|
|
|
|
/* ------------------------- arm-linux ------------------------- */
|
|
|
|
@@ -2525,7 +2527,7 @@ typedef
|
|
|
|
/* ------------------------ ppc64-linux ------------------------ */
|
|
|
|
-#if defined(PLAT_ppc64_linux)
|
|
+#if defined(PLAT_ppc64be_linux)
|
|
|
|
/* ARGREGS: r3 r4 r5 r6 r7 r8 r9 r10 (the rest on stack somewhere) */
|
|
|
|
@@ -3078,7 +3080,7 @@ typedef
|
|
lval = (__typeof__(lval)) _res; \
|
|
} while (0)
|
|
|
|
-#endif /* PLAT_ppc64_linux */
|
|
+#endif /* PLAT_ppc64be_linux */
|
|
|
|
/* ------------------------- arm-linux ------------------------- */
|
|
|
|
@@ -5627,7 +5629,7 @@ VALGRIND_PRINTF_BACKTRACE(const char *fo
|
|
#undef PLAT_x86_linux
|
|
#undef PLAT_amd64_linux
|
|
#undef PLAT_ppc32_linux
|
|
-#undef PLAT_ppc64_linux
|
|
+#undef PLAT_ppc64be_linux
|
|
#undef PLAT_arm_linux
|
|
#undef PLAT_s390x_linux
|
|
#undef PLAT_mips32_linux
|
|
Index: include/pub_tool_vkiscnums_asm.h
|
|
===================================================================
|
|
--- include/pub_tool_vkiscnums_asm.h.orig
|
|
+++ include/pub_tool_vkiscnums_asm.h
|
|
@@ -42,7 +42,7 @@
|
|
#elif defined(VGP_ppc32_linux)
|
|
# include "vki/vki-scnums-ppc32-linux.h"
|
|
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
# include "vki/vki-scnums-ppc64-linux.h"
|
|
|
|
#elif defined(VGP_s390x_linux)
|
|
Index: include/pub_tool_libcsetjmp.h
|
|
===================================================================
|
|
--- include/pub_tool_libcsetjmp.h.orig
|
|
+++ include/pub_tool_libcsetjmp.h
|
|
@@ -82,7 +82,7 @@ __attribute__((noreturn))
|
|
void VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
|
|
|
|
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
|
|
#define VG_MINIMAL_JMP_BUF(_name) ULong _name [32+1+1]
|
|
__attribute__((returns_twice))
|
|
Index: include/vki/vki-linux.h
|
|
===================================================================
|
|
--- include/vki/vki-linux.h.orig
|
|
+++ include/vki/vki-linux.h
|
|
@@ -85,7 +85,7 @@
|
|
# include "vki-posixtypes-amd64-linux.h"
|
|
#elif defined(VGA_ppc32)
|
|
# include "vki-posixtypes-ppc32-linux.h"
|
|
-#elif defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
# include "vki-posixtypes-ppc64-linux.h"
|
|
#elif defined(VGA_arm)
|
|
# include "vki-posixtypes-arm-linux.h"
|
|
@@ -211,7 +211,7 @@ typedef unsigned int vki_uint;
|
|
# include "vki-amd64-linux.h"
|
|
#elif defined(VGA_ppc32)
|
|
# include "vki-ppc32-linux.h"
|
|
-#elif defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
# include "vki-ppc64-linux.h"
|
|
#elif defined(VGA_arm)
|
|
# include "vki-arm-linux.h"
|
|
Index: include/pub_tool_basics.h
|
|
===================================================================
|
|
--- include/pub_tool_basics.h.orig
|
|
+++ include/pub_tool_basics.h
|
|
@@ -270,9 +270,9 @@ static inline Bool sr_EQ ( SysRes sr1, S
|
|
|
|
#if defined(VGA_x86) || defined(VGA_amd64) || defined (VGA_arm) \
|
|
|| ((defined(VGA_mips32) || defined(VGA_mips64)) && defined (_MIPSEL)) \
|
|
- || defined(VGA_arm64)
|
|
+ || defined(VGA_arm64) || defined(VGA_ppc64le)
|
|
# define VG_LITTLEENDIAN 1
|
|
-#elif defined(VGA_ppc32) || defined(VGA_ppc64) || defined(VGA_s390x) \
|
|
+#elif defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_s390x) \
|
|
|| ((defined(VGA_mips32) || defined(VGA_mips64)) && defined (_MIPSEB))
|
|
# define VG_BIGENDIAN 1
|
|
#else
|
|
@@ -283,7 +283,8 @@ static inline Bool sr_EQ ( SysRes sr1, S
|
|
#if defined(VGA_x86)
|
|
# define VG_REGPARM(n) __attribute__((regparm(n)))
|
|
#elif defined(VGA_amd64) || defined(VGA_ppc32) \
|
|
- || defined(VGA_ppc64) || defined(VGA_arm) || defined(VGA_s390x) \
|
|
+ || defined(VGA_ppc64be) || defined(VGA_ppc64le) \
|
|
+ || defined(VGA_arm) || defined(VGA_s390x) \
|
|
|| defined(VGA_mips32) || defined(VGA_mips64) \
|
|
|| defined(VGA_arm64)
|
|
# define VG_REGPARM(n) /* */
|
|
Index: include/pub_tool_machine.h
|
|
===================================================================
|
|
--- include/pub_tool_machine.h.orig
|
|
+++ include/pub_tool_machine.h
|
|
@@ -53,7 +53,7 @@
|
|
# define VG_CLREQ_SZB 20
|
|
# define VG_STACK_REDZONE_SZB 0
|
|
|
|
-#elif defined(VGP_ppc64_linux)
|
|
+#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
|
|
# define VG_MIN_INSTR_SZB 4
|
|
# define VG_MAX_INSTR_SZB 4
|
|
# define VG_CLREQ_SZB 20
|
|
Index: configure.ac
|
|
===================================================================
|
|
--- configure.ac.orig
|
|
+++ configure.ac
|
|
@@ -163,6 +163,18 @@ AC_MSG_CHECKING([for a supported CPU])
|
|
# is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32.
|
|
# Ditto for amd64. It is used for more configuration below, but is not used
|
|
# outside this file.
|
|
+#
|
|
+# Power PC returns powerpc for Big Endian. This was not changed when Little
|
|
+# Endian support was added to the 64-bit architecture. The 64-bit Little
|
|
+# Endian systems explicitly state le in the host_cpu. For clarity in the
|
|
+# Valgrind code, the ARCH_MAX name will state LE or BE for the endianess of
|
|
+# the 64-bit system. Big Endian is the only mode supported on 32-bit Power PC.
|
|
+# The abreviation PPC or ppc refers to 32-bit and 64-bit systems with either
|
|
+# Endianess. The name PPC64 or ppc64 to 64-bit systems of either Endianess.
|
|
+# The names ppc64be or PPC64BE refer to only 64-bit systems that are Big
|
|
+# Endian. Similarly, ppc64le or PPC64LE refer to only 64-bit systems that are
|
|
+# Little Endian.
|
|
+
|
|
case "${host_cpu}" in
|
|
i?86)
|
|
AC_MSG_RESULT([ok (${host_cpu})])
|
|
@@ -175,8 +187,15 @@ case "${host_cpu}" in
|
|
;;
|
|
|
|
powerpc64)
|
|
+ # this only referrs to 64-bit Big Endian
|
|
AC_MSG_RESULT([ok (${host_cpu})])
|
|
- ARCH_MAX="ppc64"
|
|
+ ARCH_MAX="ppc64be"
|
|
+ ;;
|
|
+
|
|
+ powerpc64le)
|
|
+ # this only referrs to 64-bit Little Endian
|
|
+ AC_MSG_RESULT([ok (${host_cpu})])
|
|
+ ARCH_MAX="ppc64le"
|
|
;;
|
|
|
|
powerpc)
|
|
@@ -371,7 +390,7 @@ esac
|
|
# does not support building 32 bit programs
|
|
|
|
case "$ARCH_MAX-$VGCONF_OS" in
|
|
- amd64-linux|ppc64-linux)
|
|
+ amd64-linux|ppc64be-linux)
|
|
AC_MSG_CHECKING([for 32 bit build support])
|
|
safe_CFLAGS=$CFLAGS
|
|
CFLAGS="-m32"
|
|
@@ -489,13 +508,13 @@ case "$ARCH_MAX-$VGCONF_OS" in
|
|
valt_load_address_sec_inner="0xUNSET"
|
|
AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
|
|
;;
|
|
- ppc64-linux)
|
|
+ ppc64be-linux)
|
|
valt_load_address_sec_norml="0xUNSET"
|
|
valt_load_address_sec_inner="0xUNSET"
|
|
if test x$vg_cv_only64bit = xyes; then
|
|
- VGCONF_ARCH_PRI="ppc64"
|
|
+ VGCONF_ARCH_PRI="ppc64be"
|
|
VGCONF_ARCH_SEC=""
|
|
- VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
|
|
+ VGCONF_PLATFORM_PRI_CAPS="PPC64BE_LINUX"
|
|
VGCONF_PLATFORM_SEC_CAPS=""
|
|
valt_load_address_pri_norml="0x38000000"
|
|
valt_load_address_pri_inner="0x28000000"
|
|
@@ -507,9 +526,9 @@ case "$ARCH_MAX-$VGCONF_OS" in
|
|
valt_load_address_pri_norml="0x38000000"
|
|
valt_load_address_pri_inner="0x28000000"
|
|
else
|
|
- VGCONF_ARCH_PRI="ppc64"
|
|
+ VGCONF_ARCH_PRI="ppc64be"
|
|
VGCONF_ARCH_SEC="ppc32"
|
|
- VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
|
|
+ VGCONF_PLATFORM_PRI_CAPS="PPC64BE_LINUX"
|
|
VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX"
|
|
valt_load_address_pri_norml="0x38000000"
|
|
valt_load_address_pri_inner="0x28000000"
|
|
@@ -518,6 +537,18 @@ case "$ARCH_MAX-$VGCONF_OS" in
|
|
fi
|
|
AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
|
|
;;
|
|
+ ppc64le-linux)
|
|
+ # Little Endian is only supported on PPC64
|
|
+ valt_load_address_sec_norml="0xUNSET"
|
|
+ valt_load_address_sec_inner="0xUNSET"
|
|
+ VGCONF_ARCH_PRI="ppc64le"
|
|
+ VGCONF_ARCH_SEC=""
|
|
+ VGCONF_PLATFORM_PRI_CAPS="PPC64LE_LINUX"
|
|
+ VGCONF_PLATFORM_SEC_CAPS=""
|
|
+ valt_load_address_pri_norml="0x38000000"
|
|
+ valt_load_address_pri_inner="0x28000000"
|
|
+ AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
|
|
+ ;;
|
|
# Darwin gets identified as 32-bit even when it supports 64-bit.
|
|
# (Not sure why, possibly because 'uname' returns "i386"?) Just about
|
|
# all Macs support both 32-bit and 64-bit, so we just build both. If
|
|
@@ -656,7 +687,8 @@ AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC3
|
|
test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
|
|
-o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX )
|
|
AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64,
|
|
- test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX )
|
|
+ test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX \
|
|
+ -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX )
|
|
AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM,
|
|
test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
|
|
-o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX )
|
|
@@ -679,8 +711,10 @@ AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_
|
|
AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX,
|
|
test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
|
|
-o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX)
|
|
-AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX,
|
|
- test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX)
|
|
+AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64BE_LINUX,
|
|
+ test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX)
|
|
+AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64LE_LINUX,
|
|
+ test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX)
|
|
AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX,
|
|
test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
|
|
-o x$VGCONF_PLATFORM_SEC_CAPS = xARM_LINUX)
|
|
@@ -707,7 +741,8 @@ AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
|
|
test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
|
|
-o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
|
|
-o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
|
|
- -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
|
|
+ -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64BE_LINUX \
|
|
+ -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64LE_LINUX \
|
|
-o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
|
|
-o x$VGCONF_PLATFORM_PRI_CAPS = xARM64_LINUX \
|
|
-o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
|
|
Index: memcheck/tests/unit_libcbase.c
|
|
===================================================================
|
|
--- memcheck/tests/unit_libcbase.c.orig
|
|
+++ memcheck/tests/unit_libcbase.c
|
|
@@ -56,7 +56,8 @@ void test_VG_STREQN(void)
|
|
}
|
|
|
|
// On PPC/Linux VKI_PAGE_SIZE is a variable, not a macro.
|
|
-#if defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
|
|
+#if defined(VGP_ppc32_linux) || defined(VGP_ppc64be_linux) \
|
|
+ || defined(VGP_ppc64le_linux)
|
|
unsigned long VKI_PAGE_SIZE = 1UL << 12;
|
|
#endif
|
|
|
|
Index: memcheck/tests/atomic_incs.c
|
|
===================================================================
|
|
--- memcheck/tests/atomic_incs.c.orig
|
|
+++ memcheck/tests/atomic_incs.c
|
|
@@ -62,7 +62,7 @@ __attribute__((noinline)) void atomic_ad
|
|
: /*trash*/ "memory", "cc", "r15"
|
|
);
|
|
} while (success != 1);
|
|
-#elif defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc64be)
|
|
/* Nasty hack. Does correctly atomically do *p += n, but only if p
|
|
is 8-aligned -- guaranteed by caller. */
|
|
unsigned long success;
|
|
@@ -243,7 +243,7 @@ __attribute__((noinline)) void atomic_ad
|
|
: /*trash*/ "memory", "cc", "r15"
|
|
);
|
|
} while (success != 1);
|
|
-#elif defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc64be)
|
|
/* Nasty hack. Does correctly atomically do *p += n, but only if p
|
|
is 8-aligned -- guaranteed by caller. */
|
|
unsigned long success;
|
|
@@ -421,7 +421,7 @@ __attribute__((noinline)) void atomic_ad
|
|
: /*trash*/ "memory", "cc", "r15"
|
|
);
|
|
} while (success != 1);
|
|
-#elif defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc64be)
|
|
/* Nasty hack. Does correctly atomically do *p += n, but only if p
|
|
is 8-aligned -- guaranteed by caller. */
|
|
unsigned long success;
|
|
@@ -520,7 +520,7 @@ __attribute__((noinline)) void atomic_ad
|
|
"lock; addq %%rbx,(%%rax)" "\n"
|
|
: : "S"(&block[0])/* S means "rsi only" */ : "memory","cc","rax","rbx"
|
|
);
|
|
-#elif defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc64be)
|
|
unsigned long success;
|
|
do {
|
|
__asm__ __volatile__(
|
|
Index: memcheck/mc_machine.c
|
|
===================================================================
|
|
--- memcheck/mc_machine.c.orig
|
|
+++ memcheck/mc_machine.c
|
|
@@ -61,7 +61,7 @@
|
|
# define MC_SIZEOF_GUEST_STATE sizeof(VexGuestPPC32State)
|
|
#endif
|
|
|
|
-#if defined(VGA_ppc64)
|
|
+#if defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
# include "libvex_guest_ppc64.h"
|
|
# define MC_SIZEOF_GUEST_STATE sizeof(VexGuestPPC64State)
|
|
#endif
|
|
@@ -150,7 +150,7 @@ static Int get_otrack_shadow_offset_wrk
|
|
{
|
|
/* -------------------- ppc64 -------------------- */
|
|
|
|
-# if defined(VGA_ppc64)
|
|
+# if defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
|
|
# define GOF(_fieldname) \
|
|
(offsetof(VexGuestPPC64State,guest_##_fieldname))
|
|
@@ -160,7 +160,6 @@ static Int get_otrack_shadow_offset_wrk
|
|
Int sz = szB;
|
|
Int o = offset;
|
|
tl_assert(sz > 0);
|
|
- tl_assert(host_is_big_endian());
|
|
|
|
if (sz == 8 || sz == 4) {
|
|
/* The point of this is to achieve
|
|
@@ -1201,7 +1200,7 @@ static Int get_otrack_shadow_offset_wrk
|
|
IRType MC_(get_otrack_reg_array_equiv_int_type) ( IRRegArray* arr )
|
|
{
|
|
/* -------------------- ppc64 -------------------- */
|
|
-# if defined(VGA_ppc64)
|
|
+# if defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
/* The redir stack. */
|
|
if (arr->base == offsetof(VexGuestPPC64State,guest_REDIR_STACK[0])
|
|
&& arr->elemTy == Ity_I64
|
|
Index: cachegrind/cg_branchpred.c
|
|
===================================================================
|
|
--- cachegrind/cg_branchpred.c.orig
|
|
+++ cachegrind/cg_branchpred.c
|
|
@@ -44,7 +44,7 @@
|
|
|
|
/* How many bits at the bottom of an instruction address are
|
|
guaranteed to be zero? */
|
|
-#if defined(VGA_ppc32) || defined(VGA_ppc64) \
|
|
+#if defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le) \
|
|
|| defined(VGA_mips32) || defined(VGA_mips64) || defined(VGA_arm64)
|
|
# define N_IADDR_LO_ZERO_BITS 2
|
|
#elif defined(VGA_x86) || defined(VGA_amd64)
|
|
Index: cachegrind/cg_arch.c
|
|
===================================================================
|
|
--- cachegrind/cg_arch.c.orig
|
|
+++ cachegrind/cg_arch.c
|
|
@@ -353,7 +353,7 @@ configure_caches(cache_t *I1c, cache_t *
|
|
*D1c = (cache_t) { 65536, 2, 64 };
|
|
*LLc = (cache_t) { 262144, 8, 64 };
|
|
|
|
-#elif defined(VGA_ppc64)
|
|
+#elif defined(VGA_ppc64be) || defined(VGA_ppc64le)
|
|
|
|
// Default cache configuration
|
|
*I1c = (cache_t) { 65536, 2, 64 };
|