You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(32) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
(44) |
2
(9) |
3
(30) |
4
(28) |
5
(42) |
6
(14) |
7
(10) |
|
8
(7) |
9
(8) |
10
(6) |
11
(15) |
12
(13) |
13
(14) |
14
(23) |
|
15
(17) |
16
(10) |
17
(82) |
18
(14) |
19
(21) |
20
(14) |
21
(21) |
|
22
(7) |
23
(13) |
24
(16) |
25
(11) |
26
(11) |
27
(6) |
28
(7) |
|
29
(8) |
30
(13) |
31
(8) |
|
|
|
|
|
From: <sv...@va...> - 2006-10-17 01:05:11
|
Author: sewardj
Date: 2006-10-17 02:05:09 +0100 (Tue, 17 Oct 2006)
New Revision: 6246
Log:
Merge r6095:
A minimal sigframe implementation for AIX5. Works but does not
provide valid siginfo or ucontext to handlers.
Added:
trunk/coregrind/m_sigframe/sigframe-ppc32-aix5.c
trunk/coregrind/m_sigframe/sigframe-ppc64-aix5.c
Added: trunk/coregrind/m_sigframe/sigframe-ppc32-aix5.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_sigframe/sigframe-ppc32-aix5.c =
(rev 0)
+++ trunk/coregrind/m_sigframe/sigframe-ppc32-aix5.c 2006-10-17 01:05:09 =
UTC (rev 6246)
@@ -0,0 +1,220 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Create/destroy signal delivery frames. ---*/
+/*--- sigframe-ppc32-aix5.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2006-2006 OpenWorks LLP
+ in...@op...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#include "pub_core_basics.h"
+#include "pub_core_vki.h"
+#include "pub_core_vkiscnums.h"
+#include "pub_core_threadstate.h"
+#include "pub_core_aspacemgr.h"
+#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
+#include "pub_core_libcprint.h"
+#include "pub_core_machine.h"
+#include "pub_core_options.h"
+#include "pub_core_signals.h"
+#include "pub_core_tooliface.h"
+#include "pub_core_trampoline.h"
+#include "pub_core_transtab.h" // VG_(discard_translations)
+#include "pub_core_sigframe.h" /* self */
+
+
+/* This module creates and removes signal frames for signal deliveries
+ on ppc32-aix5. Kludgey; the machine state ought to be saved in a
+ ucontext and retrieved from it later, so the handler can modify it
+ and return. However .. for now .. just stick the vex guest state
+ in the frame and snarf it again later.
+
+ Also, don't bother with creating siginfo and ucontext in the
+ handler, although do point them somewhere non-faulting.
+*/
+struct hacky_sigframe {
+ UChar lower_guardzone[512]; // put nothing here
+ VexGuestPPC32State gst;
+ VexGuestPPC32State gshadow;
+ UInt magicPI;
+ UInt sigNo_private;
+ UInt tramp[2];
+ UChar upper_guardzone[512]; // put nothing here
+};
+
+
+/* Extend the stack segment downwards if needed so as to ensure the
+ new signal frames are mapped to something. Return a Bool
+ indicating whether or not the operation was successful.
+*/
+static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
+{
+ /* For tracking memory events, indicate the entire frame has been
+ allocated. Except, don't mess with the area which
+ overlaps the previous frame's redzone. */
+ VG_TRACK( new_mem_stack_signal, addr, size - VG_STACK_REDZONE_SZB );
+ return True;
+}
+
+#define SET_SIGNAL_LR(zztst, zzval) \
+ do { tst->arch.vex.guest_LR =3D (zzval); \
+ VG_TRACK( post_reg_write, Vg_CoreSignal, tst->tid, \
+ offsetof(VexGuestPPC32State,guest_LR), \
+ sizeof(UWord) ); \
+ } while (0)
+
+#define SET_SIGNAL_GPR(zztst, zzn, zzval) \
+ do { tst->arch.vex.guest_GPR##zzn =3D (zzval); \
+ VG_TRACK( post_reg_write, Vg_CoreSignal, tst->tid, \
+ offsetof(VexGuestPPC32State,guest_GPR##zzn), \
+ sizeof(UWord) ); \
+ } while (0)
+
+
+/* Create a signal frame for thread 'tid'. */
+void VG_(sigframe_create) ( ThreadId tid,
+ Addr sp_top_of_frame,
+ const vki_siginfo_t *siginfo,
+ void *handler,
+ UInt flags,
+ const vki_sigset_t *mask,
+ void *restorer )
+{
+ ThreadState* tst;
+ Addr sp;
+ struct hacky_sigframe* frame;
+ Int sigNo =3D siginfo->si_signo;
+ Int __NR_FAKE_SIGRETURN =3D __NR_AIX5_FAKE_SIGRETURN;
+
+ vg_assert(VG_IS_16_ALIGNED(sizeof(struct hacky_sigframe)));
+
+ sp_top_of_frame &=3D ~0xf;
+ sp =3D sp_top_of_frame - sizeof(struct hacky_sigframe);
+
+ tst =3D VG_(get_ThreadState)(tid);
+ if (!extend(tst, sp, sp_top_of_frame - sp))
+ return;
+
+ vg_assert(VG_IS_16_ALIGNED(sp));
+
+ frame =3D (struct hacky_sigframe *) sp;
+
+ /* clear it (very conservatively) */
+ VG_(memset)(&frame->lower_guardzone, 0, 512);
+ VG_(memset)(&frame->gst, 0, sizeof(VexGuestPPC32State));
+ VG_(memset)(&frame->gshadow, 0, sizeof(VexGuestPPC32State));
+
+ /* save stuff in frame */
+ frame->gst =3D tst->arch.vex;
+ frame->gshadow =3D tst->arch.vex_shadow;
+ frame->sigNo_private =3D sigNo;
+ frame->magicPI =3D 0x31415927;
+
+ /* Set up stack frame pointer */
+ sp +=3D 256;
+ vg_assert(sp =3D=3D (Addr)&frame->lower_guardzone[256]);
+ VG_TRACK( pre_mem_write, Vg_CoreSignal, tid, "signal handler frame",
+ sp, sizeof(UWord) );
+ *(Addr*)sp =3D tst->arch.vex.guest_GPR1;
+ VG_TRACK( post_mem_write, Vg_CoreSignal, tid,
+ sp, sizeof(UWord) );
+
+ /* Set regs for the handler */
+ SET_SIGNAL_GPR(tid, 1, sp);
+ SET_SIGNAL_GPR(tid, 2, ((UWord*)handler)[1]);
+ SET_SIGNAL_GPR(tid, 3, sigNo);
+ SET_SIGNAL_GPR(tid, 4, 0); /* XXX: the siginfo* */
+ SET_SIGNAL_GPR(tid, 5, 0); /* XXX: the ucontext* */
+ tst->arch.vex.guest_CIA =3D ((UWord*)handler)[0];
+
+ /* set up return trampoline */
+ vg_assert(__NR_FAKE_SIGRETURN >=3D 10000);
+ vg_assert(__NR_FAKE_SIGRETURN <=3D 32767);
+ frame->tramp[0] =3D 0x38400000U=20
+ + __NR_FAKE_SIGRETURN; /* li 2,__NR_FAKE_SIGRETURN =
*/
+ frame->tramp[1] =3D 0x44000002U; /* sc */
+
+ /* invalidate any translation of this area */
+ VG_(discard_translations)( (Addr64)(Addr)&frame->tramp[0],=20
+ sizeof(frame->tramp), "sigframe tramp" ); =
=20
+ /* set the signal handler to return to the trampoline */
+ SET_SIGNAL_LR(tst, (Addr) &frame->tramp[0]);
+
+ VG_TRACK(post_mem_write, Vg_CoreSignal, tst->tid,
+ (Addr)&frame->tramp, sizeof(frame->tramp));
+
+ if (0) {
+ VG_(printf)("pushed signal frame for sig %d; R1 now =3D %p, "
+ "next %%CIA =3D %p, status=3D%d\n",=20
+ sigNo,
+ sp, tst->arch.vex.guest_CIA, tst->status);
+ VG_(printf)("trampoline is at %p\n", &frame->tramp[0]);
+ }
+}
+
+
+/* Remove a signal frame from thread 'tid's stack, and restore the CPU
+ state from it. Note, isRT is irrelevant here. */
+void VG_(sigframe_destroy)( ThreadId tid, Bool isRT )
+{
+ ThreadState *tst;
+ Addr sp;
+ Int sigNo;
+ struct hacky_sigframe* frame;
+=20
+ vg_assert(VG_(is_valid_tid)(tid));
+ tst =3D VG_(get_ThreadState)(tid);
+
+ /* Check that the stack frame looks valid */
+ sp =3D tst->arch.vex.guest_GPR1;
+ vg_assert(VG_IS_16_ALIGNED(sp));
+
+ frame =3D (struct hacky_sigframe*)(sp - 256);
+ vg_assert(frame->magicPI =3D=3D 0x31415927);
+
+ /* restore the entire guest state, and shadow, from the
+ frame. Note, as per comments above, this is a kludge - should
+ restore it from saved ucontext. Oh well. */
+ tst->arch.vex =3D frame->gst;
+ tst->arch.vex_shadow =3D frame->gshadow;
+ sigNo =3D frame->sigNo_private;
+
+ if (VG_(clo_trace_signals))
+ VG_(message)(Vg_DebugMsg,
+ "vg_pop_signal_frame (thread %d): valid magic; CIA=3D=
%p",
+ tid, tst->arch.vex.guest_CIA);
+
+ VG_TRACK( die_mem_stack_signal,=20
+ (Addr)frame,=20
+ sizeof(struct hacky_sigframe) - VG_STACK_REDZONE_SZB );
+
+ /* tell the tools */
+ VG_TRACK( post_deliver_signal, tid, sigNo );
+}
+
+/*--------------------------------------------------------------------*/
+/*--- end sigframe-ppc32-linux.c ---*/
+/*--------------------------------------------------------------------*/
Added: trunk/coregrind/m_sigframe/sigframe-ppc64-aix5.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_sigframe/sigframe-ppc64-aix5.c =
(rev 0)
+++ trunk/coregrind/m_sigframe/sigframe-ppc64-aix5.c 2006-10-17 01:05:09 =
UTC (rev 6246)
@@ -0,0 +1,254 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Create/destroy signal delivery frames. ---*/
+/*--- sigframe-ppc64-aix5.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2006-2006 OpenWorks LLP
+ in...@op...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#include "pub_core_basics.h"
+#include "pub_core_vki.h"
+#include "pub_core_vkiscnums.h"
+#include "pub_core_threadstate.h"
+#include "pub_core_aspacemgr.h"
+#include "pub_core_libcbase.h"
+#include "pub_core_libcassert.h"
+#include "pub_core_libcprint.h"
+#include "pub_core_machine.h"
+#include "pub_core_options.h"
+#include "pub_core_signals.h"
+#include "pub_core_tooliface.h"
+#include "pub_core_trampoline.h"
+#include "pub_core_transtab.h" // VG_(discard_translations)
+#include "pub_core_sigframe.h" /* self */
+
+
+/* This module creates and removes signal frames for signal deliveries
+ on ppc64-aix5. Kludgey; the machine state ought to be saved in a
+ ucontext and retrieved from it later, so the handler can modify it
+ and return. However .. for now .. just stick the vex guest state
+ in the frame and snarf it again later.
+
+ Also, don't bother with creating siginfo and ucontext in the
+ handler, although do point them somewhere non-faulting.
+*/
+struct hacky_sigframe {
+ UChar lower_guardzone[1024]; // put nothing here
+ VexGuestPPC64State gst;
+ VexGuestPPC64State gshadow;
+ UInt magicPI;
+ UInt sigNo_private;
+ UInt tramp[2];
+ UChar upper_guardzone[1024]; // put nothing here
+};
+
+
+/* Extend the stack segment downwards if needed so as to ensure the
+ new signal frames are mapped to something. Return a Bool
+ indicating whether or not the operation was successful.
+*/
+static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
+{
+ /* For tracking memory events, indicate the entire frame has been
+ allocated. Except, don't mess with the area which
+ overlaps the previous frame's redzone. */
+ VG_TRACK( new_mem_stack_signal, addr, size - VG_STACK_REDZONE_SZB );
+ return True;
+}
+
+#define SET_SIGNAL_LR(zztst, zzval) \
+ do { tst->arch.vex.guest_LR =3D (zzval); \
+ VG_TRACK( post_reg_write, Vg_CoreSignal, tst->tid, \
+ offsetof(VexGuestPPC64State,guest_LR), \
+ sizeof(UWord) ); \
+ } while (0)
+
+#define SET_SIGNAL_GPR(zztst, zzn, zzval) \
+ do { tst->arch.vex.guest_GPR##zzn =3D (zzval); \
+ VG_TRACK( post_reg_write, Vg_CoreSignal, tst->tid, \
+ offsetof(VexGuestPPC64State,guest_GPR##zzn), \
+ sizeof(UWord) ); \
+ } while (0)
+
+
+/* Create a signal frame for thread 'tid'. */
+void VG_(sigframe_create) ( ThreadId tid,
+ Addr sp_top_of_frame,
+ const vki_siginfo_t *siginfo,
+ void *handler,
+ UInt flags,
+ const vki_sigset_t *mask,
+ void *restorer )
+{
+ ThreadState* tst;
+ Addr sp;
+ struct hacky_sigframe* frame;
+ Int sigNo =3D siginfo->si_signo;
+ Int __NR_FAKE_SIGRETURN =3D __NR_AIX5_FAKE_SIGRETURN;
+
+ vg_assert(VG_IS_16_ALIGNED(sizeof(struct hacky_sigframe)));
+
+ sp_top_of_frame &=3D ~0xf;
+ sp =3D sp_top_of_frame - sizeof(struct hacky_sigframe);
+
+ tst =3D VG_(get_ThreadState)(tid);
+ if (!extend(tst, sp, sp_top_of_frame - sp))
+ return;
+
+ vg_assert(VG_IS_16_ALIGNED(sp));
+
+ frame =3D (struct hacky_sigframe *) sp;
+
+ /* clear it (very conservatively) */
+ VG_(memset)(&frame->lower_guardzone, 0, 1024);
+ VG_(memset)(&frame->gst, 0, sizeof(VexGuestPPC64State));
+ VG_(memset)(&frame->gshadow, 0, sizeof(VexGuestPPC64State));
+
+ /* save stuff in frame */
+ frame->gst =3D tst->arch.vex;
+ frame->gshadow =3D tst->arch.vex_shadow;
+ frame->sigNo_private =3D sigNo;
+ frame->magicPI =3D 0x31415927;
+
+ /* Set up stack frame pointer */
+ sp +=3D 512;
+ vg_assert(sp =3D=3D (Addr)&frame->lower_guardzone[512]);
+ VG_TRACK( pre_mem_write, Vg_CoreSignal, tid, "signal handler frame",
+ sp, sizeof(UWord) );
+ *(Addr*)sp =3D tst->arch.vex.guest_GPR1;
+ VG_TRACK( post_mem_write, Vg_CoreSignal, tid,
+ sp, sizeof(UWord) );
+
+ /* Set regs for the handler */
+ SET_SIGNAL_GPR(tid, 1, sp);
+ SET_SIGNAL_GPR(tid, 2, ((UWord*)handler)[1]);
+ SET_SIGNAL_GPR(tid, 3, sigNo);
+ SET_SIGNAL_GPR(tid, 4, 0); /* XXX: the siginfo* */
+ SET_SIGNAL_GPR(tid, 5, 0); /* XXX: the ucontext* */
+ tst->arch.vex.guest_CIA =3D ((UWord*)handler)[0];
+
+ /* set up return trampoline */
+ vg_assert(__NR_FAKE_SIGRETURN >=3D 10000);
+ vg_assert(__NR_FAKE_SIGRETURN <=3D 32767);
+ frame->tramp[0] =3D 0x38400000U=20
+ + __NR_FAKE_SIGRETURN; /* li 2,__NR_FAKE_SIGRETURN =
*/
+ frame->tramp[1] =3D 0x44000002U; /* sc */
+
+ /* invalidate any translation of this area */
+ VG_(discard_translations)( (Addr64)(Addr)&frame->tramp[0],=20
+ sizeof(frame->tramp), "sigframe tramp" ); =
=20
+ /* set the signal handler to return to the trampoline */
+ SET_SIGNAL_LR(tst, (Addr) &frame->tramp[0]);
+
+ VG_TRACK(post_mem_write, Vg_CoreSignal, tst->tid,
+ (Addr)&frame->tramp, sizeof(frame->tramp));
+
+ if (0) {
+ VG_(printf)("pushed signal frame for sig %d; R1 now =3D %p, "
+ "next %%CIA =3D %p, status=3D%d\n",=20
+ sigNo,
+ sp, tst->arch.vex.guest_CIA, tst->status);
+ VG_(printf)("trampoline is at %p\n", &frame->tramp[0]);
+ }
+}
+
+
+/* Remove a signal frame from thread 'tid's stack, and restore the CPU
+ state from it. Note, isRT is irrelevant here. */
+void VG_(sigframe_destroy)( ThreadId tid, Bool isRT )
+{
+ ThreadState *tst;
+ Addr sp, sp_max;
+ const UWord one_meg =3D 1048576;
+ UWord scannable_bytes;
+
+ Int sigNo, i;
+ struct hacky_sigframe* frame;
+=20
+ vg_assert(VG_(is_valid_tid)(tid));
+ tst =3D VG_(get_ThreadState)(tid);
+
+ /* Check that the stack frame looks valid */
+ sp =3D tst->arch.vex.guest_GPR1;
+ vg_assert(VG_IS_16_ALIGNED(sp));
+
+ /* If the frame is being cleared by some mechanism other than our
+ fake sigreturn, sp may not be as it was after the frame was
+ constructed. If so, scan back up the stack looking for the most
+ recently pushed frame and assume that's the right one to use.
+ Urk. */
+ sp_max =3D tst->client_stack_highest_word;
+ scannable_bytes =3D 0;
+ if (sp_max > sp)
+ scannable_bytes =3D sp_max - sp;
+ if (scannable_bytes > one_meg)
+ scannable_bytes =3D one_meg;
+ if (scannable_bytes < (sizeof(struct hacky_sigframe)-512))=20
+ scannable_bytes =3D 0;
+ else
+ scannable_bytes -=3D (sizeof(struct hacky_sigframe)-512);
+
+ vg_assert(scannable_bytes <=3D one_meg);
+
+ frame =3D (struct hacky_sigframe*)(sp - 512);
+ if (frame->magicPI !=3D 0x31415927) {
+ if (!VG_(clo_xml))
+ VG_(message)(Vg_DebugMsg,=20
+ "WARNING: dubious signal return: searching %ld bytes for fra=
me",=20
+ scannable_bytes);
+ for (i =3D 0; i < scannable_bytes/4; i++) {
+ if (frame->magicPI =3D=3D 0x31415927)
+ break;
+ frame =3D (struct hacky_sigframe*)(((Addr)frame)+4);
+ }
+ }
+
+ /* If we haven't found the frame by now, we're hosed. */
+ vg_assert(frame->magicPI =3D=3D 0x31415927);
+
+ /* restore the entire guest state, and shadow, from the
+ frame. Note, as per comments above, this is a kludge - should
+ restore it from saved ucontext. Oh well. */
+ tst->arch.vex =3D frame->gst;
+ tst->arch.vex_shadow =3D frame->gshadow;
+ sigNo =3D frame->sigNo_private;
+
+ if (VG_(clo_trace_signals))
+ VG_(message)(Vg_DebugMsg,
+ "vg_pop_signal_frame (thread %d): valid magic; CIA=3D=
%p",
+ tid, tst->arch.vex.guest_CIA);
+
+ VG_TRACK( die_mem_stack_signal,=20
+ (Addr)frame,=20
+ sizeof(struct hacky_sigframe) - VG_STACK_REDZONE_SZB );
+
+ /* tell the tools */
+ VG_TRACK( post_deliver_signal, tid, sigNo );
+}
+
+/*--------------------------------------------------------------------*/
+/*--- end sigframe-ppc64-linux.c ---*/
+/*--------------------------------------------------------------------*/
|
|
From: <sv...@va...> - 2006-10-17 01:04:18
|
Author: sewardj
Date: 2006-10-17 02:04:15 +0100 (Tue, 17 Oct 2006)
New Revision: 6245
Log:
Merge r6092 and some of r6093:
AIX5 kernel-interface stuff.
Added:
trunk/auxprogs/aix5_VKI_info.c
trunk/auxprogs/aix5_proc_self_sysent.c
trunk/include/vki/vki-ppc32-aix5.h
trunk/include/vki/vki-ppc64-aix5.h
trunk/include/vki/vki-scnums-aix5.h
Added: trunk/auxprogs/aix5_VKI_info.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/auxprogs/aix5_VKI_info.c (rev 0)
+++ trunk/auxprogs/aix5_VKI_info.c 2006-10-17 01:04:15 UTC (rev 6245)
@@ -0,0 +1,340 @@
+
+/* Used to generate include/vki/vki-ppc{32,64}-aix5.h. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/statfs.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <errno.h>
+#include <string.h>
+#include <time.h>
+#include <sys/ptrace.h>
+#include <sys/uio.h>
+#include <sys/ioctl.h>
+
+#undef offsetof
+
+/* This is so useful it should be visible absolutely everywhere. */
+#if !defined(offsetof)
+# define offsetof(type,memb) ((int)&((type*)0)->memb)
+#endif
+
+
+int main ( void )
+{
+ printf ("aix5_VKI_info: sizeof(void*) =3D %d\n", (int)sizeof(void*));
+
+ printf("/* ---------------- Errors ---------------- */\n");
+ printf("\n");
+ printf("#define VKI_EINVAL %d\n", EINVAL);
+ printf("#define VKI_EINTR %d\n", EINTR);
+ printf("#define VKI_ENOSYS %d\n", ENOSYS);
+ printf("#define VKI_EAGAIN %d\n", EAGAIN);
+ printf("#define VKI_ENOMEM %d\n", ENOMEM);
+ printf("#define VKI_EACCES %d\n", EACCES);
+ printf("#define VKI_EEXIST %d\n", EEXIST);
+ printf("#define VKI_EPERM %d\n", EPERM);
+ printf("#define VKI_ENOENT %d\n", ENOENT);
+ printf("#define VKI_ESRCH %d\n", ESRCH);
+ printf("#define VKI_EBADF %d\n", EBADF);
+ printf("#define VKI_EFAULT %d\n", EFAULT);
+ printf("#define VKI_EMFILE %d\n", EMFILE);
+ printf("#define VKI_ECHILD %d\n", ECHILD);
+ printf("#define VKI_EOVERFLOW %d\n", EOVERFLOW);
+ printf("\n");
+ printf("/* ---------------- File I/O ---------------- */\n");
+ printf("\n");
+ printf("#define VKI_O_WRONLY 0x%08x\n", O_WRONLY);
+ printf("#define VKI_O_RDONLY 0x%08x\n", O_RDONLY);
+ printf("#define VKI_O_APPEND 0x%08x\n", O_APPEND);
+ printf("#define VKI_O_CREAT 0x%08x\n", O_CREAT);
+ printf("#define VKI_O_RDWR 0x%08x\n", O_RDWR);
+ printf("#define VKI_O_EXCL 0x%08x\n", O_EXCL);
+ printf("#define VKI_O_TRUNC 0x%08x\n", O_TRUNC);
+ printf("\n");
+ printf("#define VKI_S_IRUSR 0x%08x\n", S_IRUSR);
+ printf("#define VKI_S_IXUSR 0x%08x\n", S_IXUSR);
+ printf("#define VKI_S_IXGRP 0x%08x\n", S_IXGRP);
+ printf("#define VKI_S_IXOTH 0x%08x\n", S_IXOTH);
+ printf("#define VKI_S_IWUSR 0x%08x\n", S_IWUSR);
+ printf("#define VKI_S_ISUID 0x%08x\n", S_ISUID);
+ printf("#define VKI_S_ISGID 0x%08x\n", S_ISGID);
+ printf("#define VKI_S_IFMT 0x%08x\n", S_IFMT);
+ printf("#define VKI_S_IFDIR 0x%08x\n", S_IFDIR);
+ printf("#define VKI_S_IFCHR 0x%08x\n", S_IFCHR);
+ printf("#define VKI_S_IFBLK 0x%08x\n", S_IFBLK);
+ printf("\n");
+ printf("#define VKI_F_DUPFD 0x%08x\n", F_DUPFD);
+ printf("#define VKI_F_SETFD 0x%08x\n", F_SETFD);
+ printf("#define VKI_FD_CLOEXEC 0x%08x\n", FD_CLOEXEC);
+ printf("\n");
+ printf("#define VKI_R_OK 0x%08x\n", R_OK);
+ printf("#define VKI_W_OK 0x%08x\n", W_OK);
+ printf("#define VKI_X_OK 0x%08x\n", X_OK);
+
+ /* info about struct stat */
+ struct stat st;
+ printf("\nsizeof(struct stat) =3D %d\n", (int)sizeof(struct stat));
+
+ printf(" st_size: off %2d sz %d\n",=20
+ offsetof(struct stat, st_size),
+ (int)sizeof(st.st_size));
+
+ printf(" st_mode: off %2d sz %d\n",=20
+ offsetof(struct stat, st_mode),
+ (int)sizeof(st.st_mode));
+
+ printf(" st_uid: off %2d sz %d\n",=20
+ offsetof(struct stat, st_uid),
+ (int)sizeof(st.st_uid));
+
+ printf(" st_gid: off %2d sz %d\n",=20
+ offsetof(struct stat, st_gid),
+ (int)sizeof(st.st_gid));
+
+ printf(" st_dev: off %2d sz %d\n",=20
+ offsetof(struct stat, st_dev),
+ (int)sizeof(st.st_dev));
+
+ printf(" st_ino: off %2d sz %d\n",=20
+ offsetof(struct stat, st_ino),
+ (int)sizeof(st.st_ino));
+
+ printf("\n");
+ printf("#define VKI_STX_NORMAL %d\n", (int)STX_NORMAL);
+ printf("\n");
+ printf("sizeof(size_t) =3D %d\n", (int)sizeof(size_t) );
+ printf("\n");
+ printf("#define VKI_SEEK_SET %d\n", SEEK_SET);
+ printf("#define VKI_PATH_MAX %d\n", PATH_MAX);
+
+ /* info about struct iovec */
+ struct iovec iov;
+ printf("\nsizeof(struct iovec) =3D %d\n", (int)sizeof(struct iovec));
+ printf(" iov_base: off %2d sz %d\n",=20
+ offsetof(struct iovec, iov_base),
+ (int)sizeof(iov.iov_base));
+ printf(" iov_len: off %2d sz %d\n",=20
+ offsetof(struct iovec, iov_len),
+ (int)sizeof(iov.iov_len));
+
+ printf("\n");
+ printf("#define _VKI_IOC_NONE %d\n", 3 & (IOC_VOID >> 30));
+ printf("#define _VKI_IOC_READ %d\n", 3 & (IOC_OUT >> 30));
+ printf("#define _VKI_IOC_WRITE %d\n", 3 & (IOC_IN >> 30));
+ printf("\n");
+ printf("/* ---------------- MMappery ---------------- */\n");
+ printf("\n");
+ printf("#define VKI_PAGE_SIZE %d\n", (int)sysconf(_SC_PAGESIZE));
+ printf("\n");
+ printf("#define VKI_PROT_NONE 0x%08x\n", PROT_NONE);
+ printf("#define VKI_PROT_READ 0x%08x\n", PROT_READ);
+ printf("#define VKI_PROT_WRITE 0x%08x\n", PROT_WRITE);
+ printf("#define VKI_PROT_EXEC 0x%08x\n", PROT_EXEC);
+ printf("\n");
+ printf("#define VKI_MAP_FIXED 0x%08x\n", MAP_FIXED);
+ printf("#define VKI_MAP_PRIVATE 0x%08x\n", MAP_PRIVATE);
+ printf("#define VKI_MAP_ANONYMOUS 0x%08x\n", MAP_ANONYMOUS);
+ printf("\n");
+ printf("/* ---------------- RLimitery ---------------- */\n");
+ printf("\n");
+ printf("#define VKI_RLIMIT_DATA 0x%08x\n", RLIMIT_DATA);
+ printf("#define VKI_RLIMIT_NOFILE 0x%08x\n", RLIMIT_NOFILE);
+ printf("#define VKI_RLIMIT_STACK 0x%08x\n", RLIMIT_STACK);
+ printf("#define VKI_RLIMIT_CORE 0x%08x\n", RLIMIT_CORE);
+
+ /* info about struct rlimit */
+ struct rlimit rl;
+ printf("\nsizeof(struct rlimit) =3D %d\n", (int)sizeof(struct rlimit)=
);
+ printf(" rlim_cur: off %2d sz %d\n",=20
+ offsetof(struct rlimit, rlim_cur),
+ (int)sizeof(rl.rlim_cur));
+ printf(" rlim_max: off %2d sz %d\n",=20
+ offsetof(struct rlimit, rlim_max),
+ (int)sizeof(rl.rlim_max));
+ printf("\n");
+ printf("/* ---------------- Time ---------------- */\n");
+ printf("\n");
+
+ /* print info about struct timeval */
+ struct timeval tv;
+ printf("sizeof(struct timeval) =3D %d\n", (int)sizeof(struct timeval)=
);
+ printf(" tv_sec: off %2d sz %d\n",=20
+ offsetof(struct timeval, tv_sec),
+ (int)sizeof(tv.tv_sec));
+ printf(" tv_usec: off %2d sz %d\n",=20
+ offsetof(struct timeval, tv_usec),
+ (int)sizeof(tv.tv_usec));
+
+ /* print info about struct timespec */
+ struct timespec ts;
+ printf("\nsizeof(struct timespec) =3D %d\n", (int)sizeof(struct times=
pec));
+ printf(" tv_sec: off %2d sz %d\n",=20
+ offsetof(struct timespec, tv_sec),
+ (int)sizeof(ts.tv_sec));
+ printf(" tv_nsec: off %2d sz %d\n",=20
+ offsetof(struct timespec, tv_nsec),
+ (int)sizeof(ts.tv_nsec));
+
+ printf("\n");
+ printf("/* ---------------- Signals ---------------- */\n");
+ printf("\n");
+ printf("#define _VKI_NSIG %ld\n", 8 * sizeof(sigset_t) );
+ printf("\n");
+ printf("#define VKI_SIGSEGV %d\n", SIGSEGV);
+ printf("#define VKI_SIGBUS %d\n", SIGBUS);
+ printf("#define VKI_SIGFPE %d\n", SIGFPE);
+ printf("#define VKI_SIGHUP %d\n", SIGHUP);
+ printf("#define VKI_SIGINT %d\n", SIGINT);
+ printf("#define VKI_SIGQUIT %d\n", SIGQUIT);
+ printf("#define VKI_SIGABRT %d\n", SIGABRT);
+ printf("#define VKI_SIGUSR1 %d\n", SIGUSR1);
+ printf("#define VKI_SIGUSR2 %d\n", SIGUSR2);
+ printf("#define VKI_SIGPIPE %d\n", SIGPIPE);
+ printf("#define VKI_SIGALRM %d\n", SIGALRM);
+ printf("#define VKI_SIGTERM %d\n", SIGTERM);
+ printf("/* VKI_SIGSTKFLT does not exist on AIX 5.2 */\n");
+ printf("#define VKI_SIGTTIN %d\n", SIGTTIN);
+ printf("#define VKI_SIGTTOU %d\n", SIGTTOU);
+ printf("#define VKI_SIGXCPU %d\n", SIGXCPU);
+ printf("#define VKI_SIGXFSZ %d\n", SIGXFSZ);
+ printf("#define VKI_SIGVTALRM %d\n", SIGVTALRM);
+ printf("#define VKI_SIGPROF %d\n", SIGPROF);
+ printf("#define VKI_SIGIO %d\n", SIGIO);
+ printf("#define VKI_SIGPWR %d\n", SIGPWR);
+ printf("/* VKI_SIGUNUSED does not exist on AIX 5.2 */\n");
+ printf("#define VKI_SIGRTMIN %d\n", SIGRTMIN);
+ printf("#define VKI_SIGRTMAX %d\n", SIGRTMAX);
+ printf("#define VKI_SIGTRAP %d\n", SIGTRAP);
+ printf("#define VKI_SIGCONT %d\n", SIGCONT);
+ printf("#define VKI_SIGCHLD %d\n", SIGCHLD);
+ printf("#define VKI_SIGWINCH %d\n", SIGWINCH);
+ printf("#define VKI_SIGURG %d\n", SIGURG);
+ printf("#define VKI_SIGILL %d\n", SIGILL);
+ printf("#define VKI_SIGSTOP %d\n", SIGSTOP);
+ printf("#define VKI_SIGKILL %d\n", SIGKILL);
+ printf("#define VKI_SIGTSTP %d\n", SIGTSTP);
+ printf("#define VKI_SIGSYS %d\n", SIGSYS);
+
+ /* print info about struct sigaction */
+ struct sigaction sa;
+ printf("\n");
+ printf("sizeof(struct sigaction) =3D %d\n", (int)sizeof(struct sigact=
ion));
+ printf(" sa_handler: off %2d sz %d\n",=20
+ offsetof(struct sigaction, sa_handler),
+ (int)sizeof(sa.sa_handler));
+ printf(" sa_mask: off %2d sz %d\n",=20
+ offsetof(struct sigaction, sa_mask),
+ (int)sizeof(sa.sa_mask));
+ printf(" sa_flags: off %2d sz %d\n",=20
+ offsetof(struct sigaction, sa_flags),
+ (int)sizeof(sa.sa_flags));
+ printf("sa_sigaction: off %2d sz %d\n",=20
+ offsetof(struct sigaction, sa_sigaction),
+ (int)sizeof(sa.sa_sigaction));
+ printf("\n");
+ printf("#define VKI_SA_ONSTACK %d\n",SA_ONSTACK );
+ printf("#define VKI_SA_RESTART %d\n",SA_RESTART );
+ printf("#define VKI_SA_RESETHAND %d\n",SA_RESETHAND );
+ printf("#define VKI_SA_SIGINFO %d\n",SA_SIGINFO);
+ printf("#define VKI_SA_NODEFER %d\n",SA_NODEFER );
+ // printf("#define VKI_SA_NOMASK %d\n",SA_NOMASK ) ;
+ // printf("#define VKI_SA_ONESHOT %d\n",SA_ONESHOT );
+ printf("#define VKI_SA_NOCLDSTOP %d\n",SA_NOCLDSTOP );
+ printf("#define VKI_SA_NOCLDWAIT %d\n",SA_NOCLDWAIT );
+ // printf("#define VKI_SA_RESTORER %d\n",SA_RESTORER );
+ printf("\n");
+ printf("#define VKI_SS_ONSTACK %d\n",SS_ONSTACK );
+ printf("#define VKI_SS_DISABLE %d\n",SS_DISABLE );
+ printf("\n");
+ printf("#define VKI_MINSIGSTKSZ %ld\n",MINSIGSTKSZ );
+ printf("\n");
+ printf("#define VKI_SI_USER %d\n",SI_USER );
+ printf("\n");
+ printf("#define VKI_SIG_BLOCK %d\n",SIG_BLOCK );
+ printf("#define VKI_SIG_SETMASK %d\n",SIG_SETMASK );
+ printf("#define VKI_SIG_UNBLOCK %d\n",SIG_UNBLOCK );
+ printf("#define VKI_SIG_IGN (void*)%d\n",(int)SIG_IGN );
+ printf("#define VKI_SIG_DFL (void*)%d\n",(int)SIG_DFL );
+ printf("\n");
+ // printf("#define VKI_SI_TKILL %d\n",SI_TKILL );
+ printf("#define VKI_SI_USER %d\n",SI_USER );
+ printf("\n");
+ printf("#define VKI_SEGV_ACCERR %d\n", SEGV_ACCERR);
+ printf("#define VKI_SEGV_MAPERR %d\n", SEGV_MAPERR);
+ printf("\n");
+ printf("#define VKI_TRAP_TRACE %d\n", TRAP_TRACE);
+ printf("#define VKI_BUS_OBJERR %d\n", BUS_OBJERR);
+ printf("#define VKI_BUS_ADRERR %d\n", BUS_ADRERR);
+ printf("#define VKI_BUS_ADRALN %d\n", BUS_ADRALN);
+ printf("#define VKI_FPE_FLTSUB %d\n", FPE_FLTSUB);
+ printf("#define VKI_FPE_FLTINV %d\n", FPE_FLTINV);
+ printf("#define VKI_FPE_FLTRES %d\n", FPE_FLTRES);
+ printf("#define VKI_FPE_FLTUND %d\n", FPE_FLTUND);
+ printf("#define VKI_FPE_FLTOVF %d\n", FPE_FLTOVF);
+ printf("#define VKI_FPE_FLTDIV %d\n", FPE_FLTDIV);
+ printf("#define VKI_FPE_INTOVF %d\n", FPE_INTOVF);
+ printf("#define VKI_FPE_INTDIV %d\n", FPE_INTDIV);
+ printf("\n");
+ printf("#define VKI_ILL_BADSTK %d\n", ILL_BADSTK);
+ printf("#define VKI_ILL_COPROC %d\n", ILL_COPROC);
+ printf("#define VKI_ILL_PRVREG %d\n", ILL_PRVREG);
+ printf("#define VKI_ILL_PRVOPC %d\n", ILL_PRVOPC);
+ printf("#define VKI_ILL_ILLTRP %d\n", ILL_ILLTRP);
+ printf("#define VKI_ILL_ILLADR %d\n", ILL_ILLADR);
+ printf("#define VKI_ILL_ILLOPN %d\n", ILL_ILLOPN);
+ printf("#define VKI_ILL_ILLOPC %d\n", ILL_ILLOPC);
+
+ /* info about siginfo_t */
+ siginfo_t si;
+ printf("\nsizeof(siginfo_t) =3D %d\n", (int)sizeof(siginfo_t));
+ printf(" si_signo: off %2d sz %d\n",=20
+ offsetof(siginfo_t, si_signo),
+ (int)sizeof(si.si_signo));
+ printf(" si_code: off %2d sz %d\n",=20
+ offsetof(siginfo_t, si_code),
+ (int)sizeof(si.si_code));
+ printf(" si_pid: off %2d sz %d\n",
+ offsetof(siginfo_t, si_pid),
+ (int)sizeof(si.si_pid));
+ printf(" si_addr: off %2d sz %d\n",=20
+ offsetof(siginfo_t, si_addr),
+ (int)sizeof(si.si_addr));
+
+ /* info about sigaltstack */
+ stack_t ss;
+ printf("\nsizeof(stack_t) =3D %d\n", (int)sizeof(stack_t));
+ printf(" ss_sp: off %2d sz %d\n",=20
+ offsetof(stack_t, ss_sp),
+ (int)sizeof(ss.ss_sp));
+ printf(" ss_size: off %2d sz %d\n",=20
+ offsetof(stack_t, ss_size),
+ (int)sizeof(ss.ss_size));
+ printf(" ss_flags: off %2d sz %d\n",=20
+ offsetof(stack_t, ss_flags),
+ (int)sizeof(ss.ss_flags));
+
+ printf("\n");
+ printf("/* ---------------- Misc ---------------- */\n");
+ printf("\n");
+ printf("#define VKI_PTRACE_TRACEME %d\n", PT_TRACE_ME);
+ printf("#define VKI_PTRACE_DETACH %d\n", PT_DETACH);
+ printf("\n");
+
+#if 0
+ printf("#define VKI_ %d\n", );
+ printf("#define VKI_ %d\n", );
+ printf("#define VKI_ %d\n", );
+ printf("#define VKI_ %d\n", );
+
+ printf("#define VKI_ 0x%08x\n", );
+ printf("#define VKI_ 0x%08x\n", );
+ printf("#define VKI_ 0x%08x\n", );
+ printf("#define VKI_ 0x%08x\n", );
+#endif
+ return 0;
+}
Added: trunk/auxprogs/aix5_proc_self_sysent.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/auxprogs/aix5_proc_self_sysent.c (rev 0=
)
+++ trunk/auxprogs/aix5_proc_self_sysent.c 2006-10-17 01:04:15 UTC (rev 6=
245)
@@ -0,0 +1,37 @@
+
+/* A program which prints its own syscall name-to-number bindings.
+ Used to generate the basis of include/vki/vki-scnums-aix5.h and
+ coregrind/m_vkiscnums.c. */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <assert.h>
+
+#include <sys/procfs.h>
+
+#define NN 100000
+char buf[NN];
+int nbuf =3D 0;
+
+int main ( void )
+{
+ int i;
+ char name[50];
+ sprintf(name, "/proc/%d/sysent", getpid());
+ FILE* f =3D fopen(name, "r");
+ assert(f);
+ nbuf =3D fread(buf, 1, NN, f);
+ assert(nbuf > 0 && nbuf <=3D NN);
+
+ prsysent_t* header =3D (prsysent_t*)&buf[0];
+ if (0) printf("Found %u syscalls\n\n", header->pr_nsyscalls);
+
+ for (i =3D 0; i < header->pr_nsyscalls; i++) {
+ printf("%3u %s\n", header->pr_syscall[i].pr_number,
+ &buf[ header->pr_syscall[i].pr_nameoff ]);
+ }
+
+ fclose(f);
+ return 0;
+}
Added: trunk/include/vki/vki-ppc32-aix5.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/vki/vki-ppc32-aix5.h (rev 0)
+++ trunk/include/vki/vki-ppc32-aix5.h 2006-10-17 01:04:15 UTC (rev 6245)
@@ -0,0 +1,457 @@
+
+/*--------------------------------------------------------------------*/
+/*--- 32-bit AIX5-specific kernel interface. vki-ppc32-aix5.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2006-2006 OpenWorks LLP
+ in...@op...
+
+ 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.
+*/
+
+/* This file defines types and constants for the kernel interface, and t=
o
+ make that clear everything is prefixed VKI_/vki_.
+*/
+
+/* This file was generated by running auxprogs/aix5_VKI_info.c. */
+
+#ifndef __VKI_PPC32_AIX5_H
+#define __VKI_PPC32_AIX5_H
+
+#if !defined(VGP_ppc32_aix5)
+# error This file should be included in 32-bit AIX5 builds only.
+#endif
+
+//--------------------------------------------------------------
+// VERIFIED
+//--------------------------------------------------------------
+
+/* ---------------- Errors ---------------- */
+
+#define VKI_EINVAL 22
+#define VKI_EINTR 4
+#define VKI_ENOSYS 109
+#define VKI_EAGAIN 11
+#define VKI_ENOMEM 12
+#define VKI_EACCES 13
+#define VKI_EEXIST 17
+#define VKI_EPERM 1
+#define VKI_ENOENT 2
+#define VKI_ESRCH 3
+#define VKI_EBADF 9
+#define VKI_EFAULT 14
+#define VKI_EMFILE 24
+#define VKI_ECHILD 10
+#define VKI_EOVERFLOW 127
+#define VKI_ERESTARTSYS 0 /* AIX doesn't have this */
+
+/* ---------------- File I/O ---------------- */
+
+#define VKI_O_WRONLY 0x00000001
+#define VKI_O_RDONLY 0x00000000
+#define VKI_O_APPEND 0x00000008
+#define VKI_O_CREAT 0x00000100
+#define VKI_O_RDWR 0x00000002
+#define VKI_O_EXCL 0x00000400
+#define VKI_O_TRUNC 0x00000200
+
+#define VKI_S_IRUSR 0x00000100
+#define VKI_S_IXUSR 0x00000040
+#define VKI_S_IXGRP 0x00000008
+#define VKI_S_IXOTH 0x00000001
+#define VKI_S_IWUSR 0x00000080
+#define VKI_S_ISUID 0x00000800
+#define VKI_S_ISGID 0x00000400
+#define VKI_S_IFMT 0x0000f000
+#define VKI_S_IFDIR 0x00004000
+#define VKI_S_IFCHR 0x00002000
+#define VKI_S_IFBLK 0x00006000
+
+/* Next 3 are from include/vki/vki-linux.h */
+#define VKI_S_ISDIR(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFDIR)
+#define VKI_S_ISCHR(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFCHR)
+#define VKI_S_ISBLK(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFBLK)
+
+#define VKI_F_DUPFD 0x00000000
+#define VKI_F_SETFD 0x00000002
+#define VKI_FD_CLOEXEC 0x00000001
+
+#define VKI_R_OK 0x00000004
+#define VKI_W_OK 0x00000002
+#define VKI_X_OK 0x00000001
+
+/* Known:
+ sizeof(struct stat) =3D 116
+ st_dev: off 0 sz 4
+ st_ino: off 4 sz 4
+ st_mode: off 8 sz 4
+ st_uid: off 16 sz 4
+ st_gid: off 20 sz 4
+ st_size: off 28 sz 4
+*/
+struct vki_stat {
+ /* 0 */ UInt st_dev;
+ /* 4 */ UInt st_ino;
+ /* 8 */ UInt st_mode;
+ /* 12 */ UInt __off12;
+ /* 16 */ UInt st_uid;
+ /* 20 */ UInt st_gid;
+ /* 24 */ UInt __off24;
+ /* 28 */ UInt st_size;
+ /* 32 */ UChar __off32[116-32];
+};
+
+#define VKI_STX_NORMAL 0
+
+typedef UInt vki_size_t;
+
+#define VKI_SEEK_SET 0
+#define VKI_PATH_MAX 1023
+
+/* Known:
+ sizeof(struct iovec) =3D 8
+ iov_base: off 0 sz 4
+ iov_len: off 4 sz 4
+*/
+struct vki_iovec {
+ /* 0 */ Addr iov_base;
+ /* 4 */ UInt iov_len;
+};
+
+#define _VKI_IOC_NONE 0
+#define _VKI_IOC_READ 1 /* kernel reads, userspace writes */
+#define _VKI_IOC_WRITE 2 /* kernel writes, userspace reads */
+#define _VKI_IOC_DIR(_x) (((_x) >> 30) & 3)
+#define _VKI_IOC_SIZE(_x) (((_x) >> 16) & 0x7F)
+
+/* ---------------- MMappery ---------------- */
+
+#define VKI_PAGE_SIZE 4096 /* this is checked by the launcher */
+
+#define VKI_PROT_NONE 0x00000000
+#define VKI_PROT_READ 0x00000001
+#define VKI_PROT_WRITE 0x00000002
+#define VKI_PROT_EXEC 0x00000004
+
+#define VKI_MAP_FIXED 0x00000100
+#define VKI_MAP_PRIVATE 0x00000002
+#define VKI_MAP_ANONYMOUS 0x00000010
+
+/* ---------------- RLimitery ---------------- */
+
+/* rlimit: these pertain to syscall "appgetrlimit" */
+#define VKI_RLIMIT_DATA 0x00000002
+#define VKI_RLIMIT_NOFILE 0x00000007
+#define VKI_RLIMIT_STACK 0x00000003
+#define VKI_RLIMIT_CORE 0x00000004
+
+/* Known:
+ sizeof(struct rlimit) =3D 8
+ rlim_cur: off 0 sz 4
+ rlim_max: off 4 sz 4
+*/
+struct vki_rlimit {
+ UInt rlim_cur;
+ UInt rlim_max;
+};
+
+/* ---------------- Time ---------------- */
+
+/* Known:
+ sizeof(struct timeval) =3D 8
+ tv_sec: off 0 sz 4
+ tv_usec: off 4 sz 4
+*/
+struct vki_timeval {
+ UInt tv_sec; /* seconds */
+ UInt tv_usec; /* microseconds */
+};
+
+/* Known:
+ sizeof(struct timespec) =3D 8
+ tv_sec: off 0 sz 4
+ tv_nsec: off 4 sz 4
+*/
+struct vki_timespec {
+ UInt tv_sec; /* seconds */
+ UInt tv_nsec; /* nanoseconds */
+};
+
+/* ---------------- Signals ---------------- */
+
+/* This layout verified 27 July 06. */
+#define _VKI_NSIG_BPW 32
+#define _VKI_NSIG 64
+#define _VKI_NSIG_WORDS (_VKI_NSIG / _VKI_NSIG_BPW)
+
+typedef struct {
+ UInt sig[_VKI_NSIG_WORDS];
+} vki_sigset_t;
+
+#define VKI_SIGSEGV 11
+#define VKI_SIGBUS 10
+#define VKI_SIGFPE 8
+#define VKI_SIGHUP 1
+#define VKI_SIGINT 2
+#define VKI_SIGQUIT 3
+#define VKI_SIGABRT 6
+#define VKI_SIGUSR1 30
+#define VKI_SIGUSR2 31
+#define VKI_SIGPIPE 13
+#define VKI_SIGALRM 14
+#define VKI_SIGTERM 15
+/* VKI_SIGSTKFLT does not exist on AIX 5.2 */
+#define VKI_SIGTTIN 21
+#define VKI_SIGTTOU 22
+#define VKI_SIGXCPU 24
+#define VKI_SIGXFSZ 25
+#define VKI_SIGVTALRM 34
+#define VKI_SIGPROF 32
+#define VKI_SIGIO 23
+#define VKI_SIGPWR 29
+/* VKI_SIGUNUSED does not exist on AIX 5.2 */
+#define VKI_SIGRTMIN 50
+#define VKI_SIGRTMAX 57
+#define VKI_SIGTRAP 5
+#define VKI_SIGCONT 19
+#define VKI_SIGCHLD 20
+#define VKI_SIGWINCH 28
+#define VKI_SIGURG 16
+#define VKI_SIGILL 4
+#define VKI_SIGSTOP 17
+#define VKI_SIGKILL 9
+#define VKI_SIGTSTP 18
+#define VKI_SIGSYS 12
+
+/* Known:
+ sizeof(struct sigaction) =3D 16
+ sa_handler: off 0 sz 4
+ sa_mask: off 4 sz 8
+ sa_flags: off 12 sz 4
+ sa_sigaction: off 0 sz 4
+*/
+struct vki_sigaction {
+ void* ksa_handler;
+ vki_sigset_t sa_mask;
+ UInt sa_flags;
+};
+
+#define VKI_SA_ONSTACK 1
+#define VKI_SA_RESTART 8
+#define VKI_SA_RESETHAND 2
+#define VKI_SA_SIGINFO 256
+#define VKI_SA_NODEFER 512
+#define VKI_SA_NOCLDSTOP 4
+#define VKI_SA_NOCLDWAIT 1024
+
+#define VKI_SA_RESTORER 0 /* AIX doesn't have this */
+#define VKI_SA_NOMASK 0 /* AIX doesn't have this */
+#define VKI_SA_ONESHOT 0 /* AIX doesn't have this */
+
+#define VKI_SS_ONSTACK 1
+#define VKI_SS_DISABLE 2
+
+#define VKI_MINSIGSTKSZ 1168
+
+#define VKI_SI_TKILL 0 /* AIX doesn't have this */
+#define VKI_SI_USER 0 /* but it does have this */
+
+#define VKI_SIG_BLOCK 0
+#define VKI_SIG_SETMASK 2
+#define VKI_SIG_UNBLOCK 1
+#define VKI_SIG_IGN (void*)1
+#define VKI_SIG_DFL (void*)0
+
+#define VKI_SEGV_ACCERR 51
+#define VKI_SEGV_MAPERR 50
+
+#define VKI_TRAP_TRACE 61
+#define VKI_BUS_OBJERR 3
+#define VKI_BUS_ADRERR 2
+#define VKI_BUS_ADRALN 1
+#define VKI_FPE_FLTSUB 27
+#define VKI_FPE_FLTINV 26
+#define VKI_FPE_FLTRES 25
+#define VKI_FPE_FLTUND 24
+#define VKI_FPE_FLTOVF 23
+#define VKI_FPE_FLTDIV 22
+#define VKI_FPE_INTOVF 21
+#define VKI_FPE_INTDIV 20
+#define VKI_ILL_BADSTK 37
+#define VKI_ILL_COPROC 36
+#define VKI_ILL_PRVREG 35
+#define VKI_ILL_PRVOPC 34
+#define VKI_ILL_ILLTRP 33
+#define VKI_ILL_ILLADR 32
+#define VKI_ILL_ILLOPN 31
+#define VKI_ILL_ILLOPC 30
+
+/* Known:=20
+ sizeof(siginfo_t) =3D 64
+ si_signo: off 0 sz 4
+ si_code: off 8 sz 4
+ si_pid: off 12 sz 4
+ si_addr: off 20 sz 4
+*/
+typedef struct {
+ UInt si_signo;
+ UInt __off4;
+ UInt si_code;
+ UInt si_pid;
+ UInt __off16;
+ void* si_addr;
+ UInt __off24;
+ UInt __off28;
+ UInt __off32;
+ UInt __off36;
+ UInt __off40;
+ UInt __off44;
+ UInt __off48;
+ UInt __off52;
+ UInt __off56;
+ UInt __off60;
+} vki_siginfo_t;
+
+/* Known:
+ sizeof(stack_t) =3D 28
+ ss_sp: off 0 sz 4
+ ss_size: off 4 sz 4
+ ss_flags: off 8 sz 4
+*/
+typedef struct vki_sigaltstack {
+ /* 0 */ void* ss_sp;
+ /* 4 */ UInt ss_size;
+ /* 8 */ UInt ss_flags;
+ /* 12 */ UInt __off12;
+ /* 16 */ UInt __off16;
+ /* 20 */ UInt __off20;
+ /* 24 */ UInt __off24;
+} vki_stack_t;
+
+/* ---------------- Misc ---------------- */
+
+#define VKI_PTRACE_TRACEME 0 /* nb: is really PT_TRACE_ME */
+#define VKI_PTRACE_DETACH 31 /* nb: is really PT_DETACH */
+
+
+//--------------------------------------------------------------
+// BOGUS
+//--------------------------------------------------------------
+
+struct vki_dirent {
+ int bogus;
+};
+
+struct vki_sockaddr {
+ int bogus;
+};
+
+struct vki_pollfd {
+ int bogus;
+};
+
+/* Structure describing an Internet (IP) socket address. */
+//struct vki_sockaddr_in {
+// int bogus;
+//};
+
+struct vki_ucontext {
+ int bogus;
+};
+
+
+//--------------------------------------------------------------
+// FROM glibc-ports-2.4/sysdeps/unix/sysv/aix/dlldr.h
+//--------------------------------------------------------------
+
+/* Copyright (C) 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+
+/*
+
+ int __loadx(flag, module, arg1, arg2, arg3)
+
+ The __loadx() is a call to ld_loadutil() kernel function, which
+ does the real work. Note ld_loadutil() is not exported an cannot be
+ called directly from user space.
+
+ void *ld_loadutil() call is a utility function used for loader extensio=
ns
+ supporting run-time linking and dl*() functions.
+
+ void * - will return the modules entry point if it succeds of NULL
+ on failure.
+
+ int flag - the flag field performas a dual role: the top 8 bits specify
+ the work for __loadx() to perform, the bottom 8 bits are
+ used to pass flags to the work routines, all other bits are
+ reserved.
+
+*/
+
+#define VKI_DL_LOAD 0x1000000 /* __loadx(flag,buf, buf_len, filena=
me, libr_path) */
+#define VKI_DL_POSTLOADQ 0x2000000 /* __loadx(flag,buf, buf_len, module=
_handle) */
+#define VKI_DL_EXECQ 0x3000000 /* __loadx(flag,buf, buf_len) */
+#define VKI_DL_EXITQ 0x4000000 /* __loadx(flag,buf, buf_len) */
+#define VKI_DL_PREUNLOADQ 0x5000000 /* __loadx(flag,buf, buf_len, module=
_handle) */
+#define VKI_DL_INIT 0x6000000 /* __loadx(flag,NULL) */
+#define VKI_DL_GETSYM 0x7000000 /* __loadx(flag,symbol, index, modul=
es_data_origin) */
+#define VKI_DL_SETDEPEND 0x8000000 /* __loadx(flag,import_data_org, imp=
ort_index, */
+ /* export_data_org, exp=
ort_index) */
+#define VKI_DL_DELDEPEND 0x9000000 /* __loadx(flag,import_data_org, imp=
ort_index, */
+ /* export_data_org, exp=
ort_index) */
+#define VKI_DL_GLOBALSYM 0xA000000 /* __loadx(flag,symbol_name, ptr_to_=
rec_index, */
+ /* ptr_to_rec=
_data_org) */
+#define VKI_DL_UNIX_SYSCALL 0xB000000 /* __loadx(flag,syscall_symbol_nam=
e) */
+
+#define VKI_DL_FUNCTION_MASK 0xFF000000
+#define VKI_DL_SRCHDEPENDS 0x00100000
+#define VKI_DL_SRCHMODULE 0x00080000
+#define VKI_DL_SRCHLOADLIST 0x00040000
+#define VKI_DL_LOAD_LDX1 0x00040000
+#define VKI_DL_LOAD_RTL 0x00020000
+#define VKI_DL_HASHSTRING 0x00020000
+#define VKI_DL_INFO_OK 0x00010000
+#define VKI_DL_LOAD_DLINFO 0x00010000
+#define VKI_DL_UNLOADED 0x00020000
+
+
+#endif // __VKI_PPC32_AIX5_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Added: trunk/include/vki/vki-ppc64-aix5.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/vki/vki-ppc64-aix5.h (rev 0)
+++ trunk/include/vki/vki-ppc64-aix5.h 2006-10-17 01:04:15 UTC (rev 6245)
@@ -0,0 +1,458 @@
+
+/*--------------------------------------------------------------------*/
+/*--- 64-bit AIX5-specific kernel interface. vki-ppc64-aix5.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2006-2006 OpenWorks LLP
+ in...@op...
+
+ 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.
+*/
+
+/* This file defines types and constants for the kernel interface, and t=
o
+ make that clear everything is prefixed VKI_/vki_.
+*/
+
+/* This file was generated by running auxprogs/aix5_VKI_info.c. */
+
+#ifndef __VKI_PPC64_AIX5_H
+#define __VKI_PPC64_AIX5_H
+
+#if !defined(VGP_ppc64_aix5)
+# error This file should be included in 64-bit AIX5 builds only.
+#endif
+
+//--------------------------------------------------------------
+// VERIFIED
+//--------------------------------------------------------------
+
+/* ---------------- Errors ---------------- */
+
+#define VKI_EINVAL 22
+#define VKI_EINTR 4
+#define VKI_ENOSYS 109
+#define VKI_EAGAIN 11
+#define VKI_ENOMEM 12
+#define VKI_EACCES 13
+#define VKI_EEXIST 17
+#define VKI_EPERM 1
+#define VKI_ENOENT 2
+#define VKI_ESRCH 3
+#define VKI_EBADF 9
+#define VKI_EFAULT 14
+#define VKI_EMFILE 24
+#define VKI_ECHILD 10
+#define VKI_EOVERFLOW 127
+#define VKI_ERESTARTSYS 0 /* AIX doesn't have this */
+
+/* ---------------- File I/O ---------------- */
+
+#define VKI_O_WRONLY 0x00000001
+#define VKI_O_RDONLY 0x00000000
+#define VKI_O_APPEND 0x00000008
+#define VKI_O_CREAT 0x00000100
+#define VKI_O_RDWR 0x00000002
+#define VKI_O_EXCL 0x00000400
+#define VKI_O_TRUNC 0x00000200
+
+#define VKI_S_IRUSR 0x00000100
+#define VKI_S_IXUSR 0x00000040
+#define VKI_S_IXGRP 0x00000008
+#define VKI_S_IXOTH 0x00000001
+#define VKI_S_IWUSR 0x00000080
+#define VKI_S_ISUID 0x00000800
+#define VKI_S_ISGID 0x00000400
+#define VKI_S_IFMT 0x0000f000
+#define VKI_S_IFDIR 0x00004000
+#define VKI_S_IFCHR 0x00002000
+#define VKI_S_IFBLK 0x00006000
+
+/* Next 3 are from include/vki/vki-linux.h */
+#define VKI_S_ISDIR(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFDIR)
+#define VKI_S_ISCHR(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFCHR)
+#define VKI_S_ISBLK(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFBLK)
+
+#define VKI_F_DUPFD 0x00000000
+#define VKI_F_SETFD 0x00000002
+#define VKI_FD_CLOEXEC 0x00000001
+
+#define VKI_R_OK 0x00000004
+#define VKI_W_OK 0x00000002
+#define VKI_X_OK 0x00000001
+
+/* Known:
+ sizeof(struct stat) =3D 176
+ st_dev: off 0 sz 8
+ st_ino: off 8 sz 8
+ st_mode: off 16 sz 4
+ st_uid: off 24 sz 4
+ st_gid: off 28 sz 4
+ st_size: off 168 sz 8
+*/
+struct vki_stat {
+ /* 0 */ ULong st_dev;
+ /* 8 */ ULong st_ino;
+ /* 16 */ UInt st_mode;
+ /* 20 */ UInt __off20;
+ /* 24 */ UInt st_uid;
+ /* 28 */ UInt st_gid;
+ /* 32 */ UChar __off28[168-32];
+ /* 168 */ ULong st_size;
+};
+
+#define VKI_STX_NORMAL 0
+
+typedef ULong vki_size_t;
+
+#define VKI_SEEK_SET 0
+#define VKI_PATH_MAX 1023
+
+/* Known:
+ sizeof(struct iovec) =3D 16
+ iov_base: off 0 sz 8
+ iov_len: off 8 sz 8
+
+*/
+struct vki_iovec {
+ /* 0 */ Addr iov_base;
+ /* 8 */ ULong iov_len;
+};
+
+#define _VKI_IOC_NONE 0
+#define _VKI_IOC_READ 1 /* kernel reads, userspace writes */
+#define _VKI_IOC_WRITE 2 /* kernel writes, userspace reads */
+#define _VKI_IOC_DIR(_x) (((_x) >> 30) & 3)
+#define _VKI_IOC_SIZE(_x) (((_x) >> 16) & 0x7F)
+
+/* ---------------- MMappery ---------------- */
+
+#define VKI_PAGE_SIZE 4096 /* this is checked by the launcher */
+
+#define VKI_PROT_NONE 0x00000000
+#define VKI_PROT_READ 0x00000001
+#define VKI_PROT_WRITE 0x00000002
+#define VKI_PROT_EXEC 0x00000004
+
+#define VKI_MAP_FIXED 0x00000100
+#define VKI_MAP_PRIVATE 0x00000002
+#define VKI_MAP_ANONYMOUS 0x00000010
+
+/* ---------------- RLimitery ---------------- */
+
+/* rlimit: these pertain to syscall "appgetrlimit" */
+#define VKI_RLIMIT_DATA 0x00000002
+#define VKI_RLIMIT_NOFILE 0x00000007
+#define VKI_RLIMIT_STACK 0x00000003
+#define VKI_RLIMIT_CORE 0x00000004
+
+/* Known:
+ sizeof(struct rlimit) =3D 16
+ rlim_cur: off 0 sz 8
+ rlim_max: off 8 sz 8
+*/
+struct vki_rlimit {
+ /* 0 */ ULong rlim_cur;
+ /* 8 */ ULong rlim_max;
+};
+
+/* ---------------- Time ---------------- */
+
+/* Known:
+ sizeof(struct timeval) =3D 16
+ tv_sec: off 0 sz 8
+ tv_usec: off 8 sz 4
+*/
+struct vki_timeval {
+ /* 0 */ ULong tv_sec; /* seconds */
+ /* 8 */ UInt tv_usec; /* microseconds */
+ /* 12 */ UInt __off12;
+};
+
+/* Known:
+ sizeof(struct timespec) =3D 16
+ tv_sec: off 0 sz 8
+ tv_nsec: off 8 sz 8
+*/
+struct vki_timespec {
+ /* 0 */ ULong tv_sec; /* seconds */
+ /* 8 */ ULong tv_nsec; /* nanoseconds */
+};
+
+/* ---------------- Signals ---------------- */
+
+/* This layout verified 27 July 06. */
+#define _VKI_NSIG_BPW 64
+#define _VKI_NSIG 256
+#define _VKI_NSIG_WORDS (_VKI_NSIG / _VKI_NSIG_BPW)
+
+typedef struct {
+ ULong sig[_VKI_NSIG_WORDS];
+} vki_sigset_t;
+
+#define VKI_SIGSEGV 11
+#define VKI_SIGBUS 10
+#define VKI_SIGFPE 8
+#define VKI_SIGHUP 1
+#define VKI_SIGINT 2
+#define VKI_SIGQUIT 3
+#define VKI_SIGABRT 6
+#define VKI_SIGUSR1 30
+#define VKI_SIGUSR2 31
+#define VKI_SIGPIPE 13
+#define VKI_SIGALRM 14
+#define VKI_SIGTERM 15
+/* VKI_SIGSTKFLT does not exist on AIX 5.2 */
+#define VKI_SIGTTIN 21
+#define VKI_SIGTTOU 22
+#define VKI_SIGXCPU 24
+#define VKI_SIGXFSZ 25
+#define VKI_SIGVTALRM 34
+#define VKI_SIGPROF 32
+#define VKI_SIGIO 23
+#define VKI_SIGPWR 29
+/* VKI_SIGUNUSED does not exist on AIX 5.2 */
+#define VKI_SIGRTMIN 50
+#define VKI_SIGRTMAX 57
+#define VKI_SIGTRAP 5
+#define VKI_SIGCONT 19
+#define VKI_SIGCHLD 20
+#define VKI_SIGWINCH 28
+#define VKI_SIGURG 16
+#define VKI_SIGILL 4
+#define VKI_SIGSTOP 17
+#define VKI_SIGKILL 9
+#define VKI_SIGTSTP 18
+#define VKI_SIGSYS 12
+
+/* Known:
+ sizeof(struct sigaction) =3D 48
+ sa_sigaction: off 0 sz 8
+ sa_handler: off 0 sz 8
+ sa_mask: off 8 sz 32
+ sa_flags: off 40 sz 4
+*/
+struct vki_sigaction {
+ /* 0 */ void* ksa_handler;
+ /* 8 */ vki_sigset_t sa_mask;
+ /* 40 */ UInt sa_flags;
+ /* 44 */ UInt __off44;
+};
+
+#define VKI_SA_ONSTACK 1
+#define VKI_SA_RESTART 8
+#define VKI_SA_RESETHAND 2
+#define VKI_SA_SIGINFO 256
+#define VKI_SA_NODEFER 512
+#define VKI_SA_NOCLDSTOP 4
+#define VKI_SA_NOCLDWAIT 1024
+
+#define VKI_SA_RESTORER 0 /* AIX doesn't have this */
+#define VKI_SA_NOMASK 0 /* AIX doesn't have this */
+#define VKI_SA_ONESHOT 0 /* AIX doesn't have this */
+
+#define VKI_SS_ONSTACK 1
+#define VKI_SS_DISABLE 2
+
+#define VKI_MINSIGSTKSZ 1200
+
+#define VKI_SI_TKILL 0 /* AIX doesn't have this */
+#define VKI_SI_USER 0 /* but it does have this */
+
+#define VKI_SIG_BLOCK 0
+#define VKI_SIG_SETMASK 2
+#define VKI_SIG_UNBLOCK 1
+#define VKI_SIG_IGN (void*)1
+#define VKI_SIG_DFL (void*)0
+
+#define VKI_SEGV_ACCERR 51
+#define VKI_SEGV_MAPERR 50
+
+#define VKI_TRAP_TRACE 61
+#define VKI_BUS_OBJERR 3
+#define VKI_BUS_ADRERR 2
+#define VKI_BUS_ADRALN 1
+#define VKI_FPE_FLTSUB 27
+#define VKI_FPE_FLTINV 26
+#define VKI_FPE_FLTRES 25
+#define VKI_FPE_FLTUND 24
+#define VKI_FPE_FLTOVF 23
+#define VKI_FPE_FLTDIV 22
+#define VKI_FPE_INTOVF 21
+#define VKI_FPE_INTDIV 20
+
+#define VKI_ILL_BADSTK 37
+#define VKI_ILL_COPROC 36
+#define VKI_ILL_PRVREG 35
+#define VKI_ILL_PRVOPC 34
+#define VKI_ILL_ILLTRP 33
+#define VKI_ILL_ILLADR 32
+#define VKI_ILL_ILLOPN 31
+#define VKI_ILL_ILLOPC 30
+
+/* Known:=20
+ sizeof(siginfo_t) =3D 64
+ si_signo: off 0 sz 4
+ si_code: off 8 sz 4
+ si_pid: off 12 sz 4
+ si_addr: off 24 sz 8
+*/
+typedef struct {
+ /* 0 */ UInt si_signo;
+ /* 4 */ UInt __off4;
+ /* 8 */ UInt si_code;
+ /* 12 */ UInt si_pid;
+ /* 16 */ UInt __off16;
+ /* 20 */ UInt __off20;
+ /* 24 */ void* si_addr;
+ /* 32 */ UInt __off32;
+ /* 36 */ UInt __off36;
+ /* 40 */ UInt __off40;
+ /* 44 */ UInt __off44;
+ /* 48 */ UInt __off48;
+ /* 52 */ UInt __off52;
+ /* 56 */ UInt __off56;
+ /* 60 */ UInt __off60;
+} vki_siginfo_t;
+
+/* Known:
+ sizeof(stack_t) =3D 40
+ ss_sp: off 0 sz 8
+ ss_size: off 8 sz 8
+ ss_flags: off 16 sz 4
+*/
+typedef struct vki_sigaltstack {
+ /* 0 */ void* ss_sp;
+ /* 8 */ ULong ss_size;
+ /* 16 */ UInt ss_flags;
+ /* 20 */ UInt __off20;
+ /* 24 */ ULong __off24;
+ /* 32 */ ULong __off32;
+} vki_stack_t;
+
+/* ---------------- Misc ---------------- */
+
+#define VKI_PTRACE_TRACEME 0 /* nb: is really PT_TRACE_ME */
+#define VKI_PTRACE_DETACH 31 /* nb: is really PT_DETACH */
+
+
+//--------------------------------------------------------------
+// BOGUS
+//--------------------------------------------------------------
+
+struct vki_dirent {
+ int bogus;
+};
+
+struct vki_sockaddr {
+ int bogus;
+};
+
+struct vki_pollfd {
+ int bogus;
+};
+
+/* Structure describing an Internet (IP) socket address. */
+//struct vki_sockaddr_in {
+// int bogus;
+//};
+
+struct vki_ucontext {
+ int bogus;
+};
+
+
+//--------------------------------------------------------------
+// FROM glibc-ports-2.4/sysdeps/unix/sysv/aix/dlldr.h
+//--------------------------------------------------------------
+
+/* Copyright (C) 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+
+/*
+
+ int __loadx(flag, module, arg1, arg2, arg3)
+
+ The __loadx() is a call to ld_loadutil() kernel function, which
+ does the real work. Note ld_loadutil() is not exported an cannot be
+ called directly from user space.
+
+ void *ld_loadutil() call is a utility function used for loader extensio=
ns
+ supporting run-time linking and dl*() functions.
+
+ void * - will return the modules entry point if it succeds of NULL
+ on failure.
+
+ int flag - the flag field performas a dual role: the top 8 bits specify
+ the work for __loadx() to perform, the bottom 8 bits are
+ used to pass flags to the work routines, all other bits are
+ reserved.
+
+*/
+
+#define VKI_DL_LOAD 0x1000000 /* __loadx(flag,buf, buf_len, filena=
me, libr_path) */
+#define VKI_DL_POSTLOADQ 0x2000000 /* __loadx(flag,buf, buf_len, module=
_handle) */
+#define VKI_DL_EXECQ 0x3000000 /* __loadx(flag,buf, buf_len) */
+#define VKI_DL_EXITQ 0x4000000 /* __loadx(flag,buf, buf_len) */
+#define VKI_DL_PREUNLOADQ 0x5000000 /* __loadx(flag,buf, buf_len, module=
_handle) */
+#define VKI_DL_INIT 0x6000000 /* __loadx(flag,NULL) */
+#define VKI_DL_GETSYM 0x7000000 /* __loadx(flag,symbol, index, modul=
es_data_origin) */
+#define VKI_DL_SETDEPEND 0x8000000 /* __loadx(flag,import_data_org, imp=
ort_index, */
+ /* export_data_org, exp=
ort_index) */
+#define VKI_DL_DELDEPEND 0x9000000 /* __loadx(flag,import_data_org, imp=
ort_index, */
+ /* export_data_org, exp=
ort_index) */
+#define VKI_DL_GLOBALSYM 0xA000000 /* __loadx(flag,symbol_name, ptr_to_=
rec_index, */
+ /* ptr_to_rec=
_data_org) */
+#define VKI_DL_UNIX_SYSCALL 0xB000000 /* __loadx(flag,syscall_symbol_nam=
e) */
+
+#define VKI_DL_FUNCTION_MASK 0xFF000000
+#define VKI_DL_SRCHDEPENDS 0x00100000
+#define VKI_DL_SRCHMODULE 0x00080000
+#define VKI_DL_SRCHLOADLIST 0x00040000
+#define VKI_DL_LOAD_LDX1 0x00040000
+#define VKI_DL_LOAD_RTL 0x00020000
+#define VKI_DL_HASHSTRING 0x00020000
+#define VKI_DL_INFO_OK 0x00010000
+#define VKI_DL_LOAD_DLINFO 0x00010000
+#define VKI_DL_UNLOADED 0x00020000
+
+
+#endif // __VKI_PPC64_AIX5_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Added: trunk/include/vki/vki-scnums-aix5.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/vki/vki-scnums-aix5.h (rev 0)
+++ trunk/include/vki/vki-scnums-aix5.h 2006-10-17 01:04:15 UTC (rev 6245=
)
@@ -0,0 +1,1613 @@
+
+/*--------------------------------------------------------------------*/
+/*--- System call numbers for ppc32-aix5 and ppc64-aix5. ---*/
+/*--- vki-scnums-aix5.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2006-2006 OpenWorks LLP
+ in...@op...
+
+ 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.
+*/
+
+#ifndef __VKI_SCNUMS_AIX5_H
+#define __VKI_SCNUMS_AIX5_H
+
+#if !defined(VGP_ppc32_aix5) && !defined(VGP_ppc64_aix5)
+# error This file should be included in AIX5 builds only.
+#endif
+
+//--------------------------------------------------------------
+// Syscalls for AIX 5.2 running on ppc32
+//--------------------------------------------------------------
+
+/* Make it possible to include this file in assembly sources. */
+#if !defined(VG_IN_ASSEMBLY_SOURCE)
+
+/* This is the initial value for a syscall number, when we don't
+ know what it is. */
+#define __NR_AIX5_UNKNOWN (-1)
+
+/* Vanilla AIX 5.2 ones */
+
+extern Int VG_(aix5_NR_utrchook_sc);
+#define __NR_AIX5_utrchook_sc VG_(aix5_NR_utrchook_sc)
+
+extern Int VG_(aix5_NR_thread_create);
+#define __NR_AIX5_thread_create VG_(aix5_NR_thread_create)
+
+extern Int VG_(aix5_NR_kfork);
+#define __NR_AIX5_kfork VG_(aix5_NR_kfork)
+
+extern Int VG_(aix5_NR_kra_fork);
+#define __NR_AIX5_kra_fork VG_(aix5_NR_kra_fork)
+
+extern Int VG_(aix5_NR_execve);
+#define __NR_AIX5_execve VG_(aix5_NR_execve)
+
+extern Int VG_(aix5_NR_ra_execve);
+#define __NR_AIX5_ra_execve VG_(aix5_NR_ra_execve)
+
+extern Int VG_(aix5_NR__load);
+#define __NR_AIX5__load VG_(aix5_NR__load)
+
+extern Int VG_(aix5_NR___unload);
+#define __NR_AIX5___unload VG_(aix5_NR___unload)
+
+extern Int VG_(aix5_NR_loadbind);
+#define __NR_AIX5_loadbind VG_(aix5_NR_loadbind)
+
+extern Int VG_(aix5_NR___loadx);
+#define __NR_AIX5___loadx VG_(aix5_NR___loadx)
+
+extern Int VG_(aix5_NR_bindprocessor);
+#define __NR_AIX5_bindprocessor VG_(aix5_NR_bindprocessor)
+
+extern Int VG_(aix5_NR_trcgent);
+#define __NR_AIX5_trcgent VG_(aix5_NR_trcgent)
+
+extern Int VG_(aix5_NR_trcgen);
+#define __NR_AIX5_trcgen VG_(aix5_NR_trcgen)
+
+extern Int VG_(aix5_NR_trchk);
+#define __NR_AIX5_trchk VG_(aix5_NR_trchk)
+
+extern Int VG_(aix5_NR_trchkt);
+#define __NR_AIX5_trchkt VG_(aix5_NR_trchkt)
+
+extern Int VG_(aix5_NR_trchkl);
+#define __NR_AIX5_trchkl VG_(aix5_NR_trchkl)
+
+extern Int VG_(aix5_NR_trchklt);
+#define __NR_AIX5_trchklt VG_(aix5_NR_trchklt)
+
+extern Int VG_(aix5_NR_trchkg);
+#define __NR_AIX5_trchkg VG_(aix5_NR_trchkg)
+
+extern Int VG_(aix5_NR_trchkgt);
+#define __NR_AIX5_trchkgt VG_(aix5_NR_trchkgt)
+
+extern Int VG_(aix5_NR_kill);
+#define __NR_AIX5_kill VG_(aix5_NR_kill)
+
+extern Int VG_(aix5_NR__addcpucosts);
+#define __NR_AIX5__addcpucosts VG_(aix5_NR__addcpucosts)
+
+extern Int VG_(aix5_NR_mycpu);
+#define __NR_AIX5_mycpu VG_(aix5_NR_mycpu)
+
+extern Int VG_(aix5_NR_adjtime);
+#define __NR_AIX5_adjtime VG_(aix5_NR_adjtime)
+
+extern Int VG_(aix5_NR_checkpnt_block);
+#define __NR_AIX5_checkpnt_block VG_(aix5_NR_checkpnt_block)
+
+extern Int VG_(aix5_NR__checkpnt_kill);
+#define __NR_AIX5__checkpnt_kill VG_(aix5_NR__checkpnt_kill)
+
+extern Int VG_(aix5_NR__checkpnt_fail);
+#define __NR_AIX5__checkpnt_fail VG_(aix5_NR__checkpnt_fail)
+
+extern Int VG_(aix5_NR__checkpnt_commit);
+#define __NR_AIX5__checkpnt_commit VG_(aix5_NR__checkpnt_commit)
+
+extern Int VG_(aix5_NR__checkpnt_register);
+#define __NR_AIX5__checkpnt_register VG_(aix5_NR__checkpnt_register)
+
+extern Int VG_(aix5_NR__checkpnt);
+#define __NR_AIX5__checkpnt VG_(aix5_NR__checkpnt)
+
+extern Int VG_(aix5_NR_setcrid);
+#define __NR_AIX5_setcrid VG_(aix5_NR_setcrid)
+
+extern Int VG_(aix5_NR_getcrid);
+#define __NR_AIX5_getcrid VG_(aix5_NR_getcrid)
+
+extern Int VG_(aix5_NR_mkcrid);
+#define __NR_AIX5_mkcrid VG_(aix5_NR_mkcrid)
+
+extern Int VG_(aix5_NR_checkpnt_wait);
+#define __NR_AIX5_checkpnt_wait VG_(aix5_NR_checkpnt_wait)
+
+extern Int VG_(aix5_NR_checkpnt_deliver);
+#define __NR_AIX5_checkpnt_deliver VG_(aix5_NR_checkpnt_deliver)
+
+extern Int VG_(aix5_NR_gencore);
+#define __NR_AIX5_gencore VG_(aix5_NR_gencore)
+
+extern Int VG_(aix5_NR_thread_terminate);
+#define __NR_AIX5_thread_terminate VG_(aix5_NR_thread_terminate)
+
+extern Int VG_(aix5_NR__exit);
+#define __NR_AIX5__exit VG_(aix5_NR__exit)
+
+extern Int VG_(aix5_NR_kwaitpid64);
+#define __NR_AIX5_kwaitpid64 VG_(aix5_NR_kwaitpid64)
+
+extern Int VG_(aix5_NR_kwaitpid);
+#define __NR_AIX5_kwaitpid VG_(aix5_NR_kwaitpid)
+
+extern Int VG_(aix5_NR_yield);
+#define __NR_AIX5_yield VG_(aix5_NR_yield)
+
+extern Int VG_(aix5_NR_getprocs64);
+#define __NR_AIX5_getprocs64 VG_(aix5_NR_getprocs64)
+
+extern Int VG_(aix5_NR_getevars);
+#define __NR_AIX5_getevars VG_(aix5_NR_getevars)
+
+extern Int VG_(aix5_NR_getargs);
+#define __NR_AIX5_getargs VG_(aix5_NR_getargs)
+
+extern Int VG_(aix5_NR_getthrds64);
+#define __NR_AIX5_getthrds64 VG_(aix5_NR_getthrds64)
+
+extern Int VG_(aix5_NR_getthrds);
+#define __NR_AIX5_getthrds VG_(aix5_NR_getthrds)
+
+extern Int VG_(aix5_NR_getprocs);
+#define __NR_AIX5_getprocs VG_(aix5_NR_getprocs)
+
+extern Int VG_(aix5_NR_sigcleanup);
+#define __NR_AIX5_sigcleanup VG_(aix5_NR_sigcleanup)
+
+extern Int VG_(aix5_NR__setpri);
+#define __NR_AIX5__setpri VG_(aix5_NR__setpri)
+
+extern Int VG_(aix5_NR__getpri);
+#define __NR_AIX5__getpri VG_(aix5_NR__getpri)
+
+extern Int VG_(aix5_NR_profil);
+#define __NR_AIX5_profil VG_(aix5_NR_profil)
+
+extern Int VG_(aix5_NR_reboot);
+#define __NR_AIX5_reboot VG_(aix5_NR_reboot)
+
+extern Int VG_(aix5_NR_appgetrlimit);
+#define __NR_AIX5_appgetrlimit VG_(aix5_NR_appgetrlimit)
+
+extern Int VG_(aix5_NR_appsetrlimit);
+#define __NR_AIX5_appsetrlimit VG_(aix5_NR_appsetrlimit)
+
+extern Int VG_(aix5_NR__setpriority);
+#define __NR_AIX5__setpriority VG_(aix5_NR__setpriority)
+
+extern Int VG_(aix5_NR__getpriority);
+#define __NR_AIX5__getpriority VG_(aix5_NR__getpriority)
+
+extern Int VG_(aix5_NR_setrlimit64);
+#define __NR_AIX5_setrlimit64 VG_(aix5_NR_setrlimit64)
+
+extern Int VG_(aix5_NR_getrlimit64);
+#define __NR_AIX5_getrlimit64 VG_(aix5_NR_getrlimit64)
+
+extern Int VG_(aix5_NR_appgetrusage);
+#define __NR_AIX5_appgetrusage VG_(aix5_NR_appgetrusage)
+
+extern Int VG_(aix5_NR_getrusage64);
+#define __NR_AIX5_getrusage64 VG_(aix5_NR_getrusage64)
+
+extern Int VG_(aix5_NR_getvtid);
+#define __NR_AIX5_getvtid VG_(aix5_NR_getvtid)
+
+extern Int VG_(aix5_NR_getrtid);
+#define __NR_AIX5_getrtid VG_(aix5_NR_getrtid)
+
+extern Int VG_(aix5_NR_getrpid);
+#define __NR_AIX5_getrpid VG_(aix5_NR_getrpid)
+
+extern Int VG_(aix5_NR_restart_wait);
+#define __NR_AIX5_restart_wait VG_(aix5_NR_restart_wait)
+
+extern Int VG_(aix5_NR_restart);
+#define __NR_AIX5_restart VG_(aix5_NR_restart)
+
+extern Int VG_(aix5_NR__rmcpucosts);
+#define __NR_AIX5__rmcpucosts VG_(aix5_NR__rmcpucosts)
+
+extern Int VG_(aix5_NR__clock_getcpuclockid);
+#define __NR_AIX5__clock_getcpuclockid VG_(aix5_NR__clock_getcpuclockid)
+
+extern Int VG_(aix5_NR__clock_settime);
+#define __NR_AIX5__clock_settime VG_(aix5_NR__clock_settime)
+
+extern Int VG_(aix5_NR__clock_gettime);
+#define __NR_AIX5__clock_gettime VG_(aix5_NR__clock_gettime)
+
+extern Int VG_(aix5_NR__clock_getres);
+#define __NR_AIX5__clock_getres VG_(aix5_NR__clock_getres)
+
+extern Int VG_(aix5_NR__timer_settime);
+#define __NR_AIX5__timer_settime VG_(aix5_NR__timer_settime)
+
+extern Int VG_(aix5_NR__timer_gettime);
+#define __NR_AIX5__timer_gettime VG_(aix5_NR__timer_gettime)
+
+extern Int VG_(aix5_NR__timer_getoverrun);
+#define __NR_AIX5__timer_getoverrun VG_(aix5_NR__timer_getoverrun)
+
+extern Int VG_(aix5_NR__timer_delete);
+#define __NR_AIX5__timer_delete VG_(aix5_NR__timer_delete)
+
+extern Int VG_(aix5_NR__timer_create);
+#define __NR_AIX5__timer_create VG_(aix5_NR__timer_create)
+
+extern Int VG_(aix5_NR__sigqueue);
+#define __NR_AIX5__sigqueue VG_(aix5_NR__sigqueue)
+
+extern Int VG_(aix5_NR__sigsuspend);
+#define __NR_AIX5__sigsuspend VG_(aix5_NR__sigsuspend)
+
+extern Int VG_(aix5_NR__sigaction);
+#define __NR_AIX5__sigaction VG_(aix5_NR__sigaction)
+
+extern Int VG_(aix5_NR_sigprocmask);
+#define __NR_AIX5_sigprocmask VG_(aix5_NR_sigprocmask)
+
+extern Int VG_(aix5_NR_siglocalmask);
+#define __NR_AIX5_siglocalmask VG_(aix5_NR_siglocalmask)
+
+extern Int VG_(aix5_NR_count_event_waiters);
+#define __NR_AIX5_count_event_waiters VG_(aix5_NR_count_event_waiters)
+
+extern Int VG_(aix5_NR_thread_waitact);
+#define __NR_AIX5_thread_waitact VG_(aix5_NR_thread_waitact)
+
+extern Int VG_(aix5_NR_thread_waitlock_local);
+#define __NR_AIX5_thread_waitlock_local VG_(aix5_NR_thread_waitlock_loca=
l)
+
+extern Int VG_(aix5_NR_thread_waitlock);
+#define __NR_AIX5_thread_waitlock VG_(aix5_NR_thread_waitlock)
+
+extern Int VG_(aix5_NR_thread_wait);
+#define __NR_AIX5_thread_wait VG_(aix5_NR_thread_wait)
+
+extern Int VG_(aix5_NR_thread_unlock);
+#define __NR_AIX5_thread_unlock VG_(aix5_NR_thread_unlock)
+
+extern Int VG_(aix5_NR_thread_twakeup_unlock);
+#define __NR_AIX5_thread_twakeup_unlock VG_(aix5_NR_thread_twakeup_unloc=
k)
+
+extern Int VG_(aix5_NR_thread_twakeup_event);
+#define __NR_AIX5_thread_twakeup_event VG_(aix5_NR_thread_twakeup_event)
+
+extern Int VG_(aix5_NR_thread_twakeup);
+#define __NR_AIX5_thread_twakeup VG_(aix5_NR_thread_twakeup)
+
+extern Int VG_(aix5_NR_thread_tsleep_event);
+#define __NR_AIX5_thread_tsleep_event VG_(aix5_NR_thread_tsleep_event)
+
+extern Int VG_(aix5_NR_thread_tsleep_chkpnt);
+#define __NR_AIX5_thread_tsleep_chkpnt VG_(aix5_NR_thread_tsleep_chkpnt)
+
+extern Int VG_(aix5_NR_thread_tsleep);
+#define __NR_AIX5_thread_tsleep VG_(aix5_NR_thread_tsleep)
+
+extern Int VG_(aix5_NR_thread_post_many);
+#define __NR_AIX5_thread_post_many VG_(aix5_NR_thread_post_many)
+
+extern Int VG_(aix5_NR_thread_post);
+#define __NR_AIX5_thread_post VG_(aix5_NR_thread_post)
+
+extern Int VG_(aix5_NR_ue_proc_unregister);
+#define __NR_AIX5_ue_proc_unregister VG_(aix5_NR_ue_proc_unregister)
+
+extern Int VG_(aix5_NR_ue_proc_register);
+#define __NR_AIX5_ue_proc_register VG_(aix5_NR_ue_proc_register)
+
+extern Int VG_(aix5_NR_kthread_ctl);
+#define __NR_AIX5_kthread_ctl VG_(aix5_NR_kthread_ctl)
+
+extern Int VG_(aix5_NR__thread_setsched);
+#define __NR_AIX5__thread_setsched VG_(aix5_NR__thread_setsched)
+
+extern Int VG_(aix5_NR_threads_runnable);
+#define __NR_AIX5_threads_runnable VG_(aix5_NR_threads_runnable)
+
+extern Int VG_(aix5_NR_thread_getregs);
+#define __NR_AIX5_thread_getregs VG_(aix5_NR_thread_getregs)
+
+extern Int VG_(aix5_NR_thread_terminate_unlock);
+#define __NR_AIX5_thread_terminate_unlock VG_(aix5_NR_thread_terminate_u=
nlock)
+
+extern Int VG_(aix5_NR_thread_terminate_ack);
+#define __NR_AIX5_thread_terminate_ack VG_(aix5_NR_thread_terminate_ack)
+
+extern Int VG_(aix5_NR_thread_setstate_fast);
+#define __NR_AIX5_thread_setstate_fast VG_(aix5_NR_thread_setstate_fast)
+
+extern Int VG_(aix5_NR_thread_setstate);
+#define __NR_AIX5_thread_setstate VG_(aix5_NR_thread_setstate)
+
+extern Int VG_(aix5_NR_thread_setmymask_fast);
+#define __NR_AIX5_thread_setmymask_fast VG_(aix5_NR_thread_setmymask_fas=
t)
+
+extern Int VG_(aix5_NR_thread_setmystate_fast);
+#define __NR_AIX5_thread_setmystate_fast VG_(aix5_NR_thread_setmystate_f=
ast)
+
+extern Int VG_(aix5_NR_thread_setmystate);
+#define __NR_AIX5_thread_setmystate VG_(aix5_NR_thread_setmystate)
+
+extern Int VG_(aix5_NR_thread_init);
+#define __NR_AIX5_thread_init VG_(aix5_NR_thread_init)
+
+extern Int VG_(aix5_NR_times);
+#define __NR_AIX5_times VG_(aix5_NR_times)
+
+extern Int VG_(aix5_NR__nsleep);
+#define __NR_AIX5__nsleep VG_(aix5_NR__nsleep)
+
+extern Int VG_(aix5_NR_reltimerid);
+#define __NR_AIX5_reltimerid VG_(aix5_NR_reltimerid)
+
+extern Int VG_(aix5_NR_appresinc);
+#define __NR_AIX5_appresinc VG_(aix5_NR_appresinc)
+
+extern Int VG_(aix5_NR_apprestimer);
+#define __NR_AIX5_apprestimer VG_(aix5_NR_apprestimer)
+
+extern Int VG_(aix5_NR_appresabs);
+#define __NR_AIX5_appresabs VG_(aix5_NR_appresabs)
+
+extern Int VG_(aix5_NR_appsettimer);
+#define __NR_AIX5_appsettimer VG_(aix5_NR_appsettimer)
+
+extern Int VG_(aix5_NR_appgettimer);
+#define __NR_AIX5_appgettimer VG_(aix5_NR_appgettimer)
+
+extern Int VG_(aix5_NR_gettimerid);
+#define __NR_AIX5_gettimerid VG_(aix5_NR_gettimerid)
+
+extern Int VG_(aix5_NR_incinterval);
+#define __NR_AIX5_incinterval VG_(aix5_NR_incinterval)
+
+extern Int VG_(aix5_NR_absinterval);
+#define __NR_AIX5_absinterval VG_(aix5_NR_absinterval)
+
+extern Int VG_(aix5_NR_getinterval);
+#define __NR_AIX5_getinterval VG_(aix5_NR_getinterval)
+
+extern Int VG_(aix5_NR_upfget);
+#define __NR_AIX5_upfget VG_(aix5_NR_upfget)
+
+extern Int VG_(aix5_NR__wlm_wait);
+#define __NR_AIX5__wlm_wait VG_(aix5_NR__wlm_wait)
+
+extern Int VG_(aix5_NR__wlm_post);
+#define __NR_AIX5__wlm_post VG_(aix5_NR__wlm_post)
+
+extern Int VG_(aix5_NR__wlm_event_init);
+#define __NR_AIX5__wlm_event_init VG_(aix5_NR__wlm_event_init)
+
+extern Int VG_(aix5_NR__wlm_set_tag);
+#define __NR_AIX5__wlm_set_tag VG_(aix5_NR__wlm_set_tag)
+
+extern Int VG_(aix5_NR__wlm_set);
+#define __NR_AIX5__wlm_set VG_(aix5_NR__wlm_set)
+
+extern Int VG_(aix5_NR_ptrace64);
+#define __NR_AIX5_ptrace64 VG_(aix5_NR_ptrace64)
+
+extern Int VG_(aix5_NR_ptracex);
+#define __NR_AIX5_ptracex VG_(aix5_NR_ptracex)
+
+extern Int VG_(aix5_NR_ptrace);
+#define __NR_AIX5_ptrace VG_(aix5_NR_ptrace)
+
+extern Int VG_(aix5_NR_ksetcontext_sigreturn);
+#define __NR_AIX5_ksetcontext_sigreturn VG_(aix5_NR_ksetcontext_sigretur=
n)
+
+extern Int VG_(aix5_NR_ksetcontext);
+#define __NR_AIX5_ksetcontext VG_(aix5_NR_ksetcontext)
+
+extern Int VG_(aix5_NR_kgetcontext);
+#define __NR_AIX5_kgetcontext VG_(aix5_NR_kgetcontext)
+
+extern Int VG_(aix5_NR_sigreturn);
+#define __NR_AIX5_sigreturn VG_(aix5_NR_sigreturn)
+
+extern Int VG_(aix5_NR__wlm_get_bio_stats);
+#define __NR_AIX5__wlm_get_bio_stats VG_(aix5_NR__wlm_get_bio_stats)
+
+extern Int VG_(aix5_NR_splice);
+#define __NR_AIX5_splice VG_(aix5_NR_splice)
+
+extern Int VG_(aix5_NR_rmsock);
+#define __NR_AIX5_rmsock VG_(aix5_NR_rmsock)
+
+extern Int VG_(aix5_NR_nrecvmsg);
+#define __NR_AIX5_nrecvmsg VG_(aix5_NR_nrecvmsg)
+
+extern Int VG_(aix5_NR_socket_aio_dequeue);
+#define __NR_AIX5_socket_aio_dequeue VG_(aix5_NR_socket_aio_dequeue)
+
+extern Int VG_(aix5_NR_getkerninfo);
+#define __NR_AIX5_getkerninfo VG_(aix5_NR_getkerninfo)
+
+extern Int VG_(aix5_NR_getpeereid);
+#define __NR_AIX5_getpeereid VG_(aix5_NR_getpeereid)
+
+extern Int VG_(aix5_NR_getpeername);
+#define __NR_AIX5_getpeername VG_(aix5_NR_getpeername)
+
+extern Int VG_(aix5_NR_ngetpeername);
+#define __NR_AIX5_ngetpeername VG_(aix5_NR_ngetpeername)
+
+extern Int VG_(aix5_NR_getsockname);
+#define __NR_AIX5_getsockname VG_(aix5_NR_getsockname)
+
+extern Int VG_(aix5_NR_ngetsockname);
+#define __NR_AIX5_ngetsockname VG_(aix5_NR_ngetsockname)
+
+extern Int VG_(aix5_NR_getsockopt);
+#define __NR_AIX5_getsockopt VG_(aix5_NR_getsockopt)
+
+extern Int VG_(aix5_NR_setsockopt);
+#define __NR_AIX5_setsockopt VG_(aix5_NR_setsockopt)
+
+extern Int VG_(aix5_NR_shutdown);
+#define __NR_AIX5_shutdown VG_(aix5_NR_shutdown)
+
+extern Int VG_(aix5_NR_recvmsg);
+#define __NR_AIX5_recvmsg VG_(aix5_NR_recvmsg)
+
+extern Int VG_(aix...
[truncated message content] |
|
From: <sv...@va...> - 2006-10-17 00:58:11
|
Author: sewardj
Date: 2006-10-17 01:58:07 +0100 (Tue, 17 Oct 2006)
New Revision: 6244
Log:
Merge r6088:
Baseline suppressions for AIX5.
Added:
trunk/aix5libc.supp
Added: trunk/aix5libc.supp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/aix5libc.supp (rev 0)
+++ trunk/aix5libc.supp 2006-10-17 00:58:07 UTC (rev 6244)
@@ -0,0 +1,807 @@
+
+## AIX clients start off by executing a short code stub which
+## loads the preloads, and then jumps to the real client. The
+## stub reads data belonging to V (by design) and it's easier
+## to hide the resulting errors than mess properly with permissions.
+{
+ VG_(trampoline_stuff_start) hack
+ Memcheck:Addr4
+ fun:vgPlain_trampoline_stuff_start
+}
+
+## Not really a bug in the thread library, just padding=20
+## problems.
+# Syscall param thread_setmystate(arg1) points to uninitialised byte(s)
+# at 0xD011F36C: _set_pthread+680 (in /usr/lib/libpthreads.a)
+# by 0xD01142E4: _alloc_initial_pthread+804 (in /usr/lib/libpthreads.=
a)
+# by 0xD01123AC: pthread_init+2880 (in /usr/lib/libpthreads.a)
+# by 0x10000344: call_pthread_init+20 (in /proc/557146/object/a.out)
+# by 0x10000258: __threads_init+64 (in /proc/557146/object/a.out)
+# by 0xD0325278: __modinit+356 (in /usr/lib/threads/libc.a)
+# by 0x10000198: __start+72 (in /proc/557146/object/a.out)
+{
+ AIX-thread_setmystate-padding-kludge-1
+ Memcheck:Param
+ thread_setmystate(arg1)
+ fun:_set_pthread
+ fun:_alloc_initial_pthread
+ fun:pthread_init
+}
+{
+ AIX-thread_setmystate-padding-kludge-2
+ Memcheck:Param
+ thread_setmystate(arg1)
+ fun:_set_pthread
+ fun:_fork_child
+ fun:_atfork_child
+ fun:__fork
+}
+{
+ AIX-thread_setmystate-padding-kludge-3
+ Memcheck:Param
+ thread_setmystate(arg1)
+ fun:_sigsetmask
+ fun:_p_sigaction
+}
+{
+ AIX-thread_setmystate-padding-kludge-4
+ Memcheck:Param
+ thread_setmystate(arg1)
+ fun:_sigsetmask
+ fun:sigthreadmask
+}
+{
+ AIX-thread_setmystate-padding-kludge-5
+ Memcheck:Param
+ thread_setmystate(arg1)
+ fun:_sigsetmask
+ fun:_fork_*
+}
+
+# AIX's libc contains a qsort routine which expertly does
+# memcpy(src, dst, N) for src=3D=3Ddst. This is technically a
+# violation of POSIX and so Memcheck complains.
+{
+ AIX-libc-qsort-bug-1
+ Memcheck:Overlap
+ fun:memcpy
+ fun:qs2
+ fun:qsort
+}
+{
+ AIX-libc-qsort-bug-2
+ Memcheck:Overlap
+ fun:memcpy
+ fun:qs2
+ fun:qs2
+ fun:qsort
+}
+{
+ AIX-libc-qsort-bug-3
+ Memcheck:Overlap
+ fun:memcpy
+ fun:qs2
+ fun:qs2
+ fun:qs2
+}
+
+## Thread library initialisation, cause unknown.
+# Conditional jump or move depends on uninitialised value(s)
+# at 0xD030DD30: fseeko64_unlocked (in /usr/lib/libc.a)
+# by 0xD030DFF0: fseeko64 (in /usr/lib/libc.a)
+# by 0xD0453F2C: nlist64 (in /usr/lib/libc.a)
+# by 0xD01267FC: _pth_init_kgetsig (in /usr/lib/libpthread.a)
+# by 0xD01123DC: pthread_init (in /usr/lib/libpthread.a)
+# by 0x10000344: call_pthread_init (in /proc/645084/object/a.out)
+# by 0x10000258: __threads_init (in /proc/645084/object/a.out)
+# by 0xD0325278: __modinit (in /usr/lib/libc.a)
+# by 0x10000198: (below main) (in /proc/645084/object/a.out)
+{
+ AIX-thread-library-init-1
+ Memcheck:Cond
+ fun:fseeko64_unlocked
+ fun:fseeko64
+}
+
+## More of the same (cause again unknown)
+# Conditional jump or move depends on uninitialised value(s)
+# at 0xD030E1F0: __ftell (in /usr/lib/libc.a)
+# by 0xD030E334: ftello64 (in /usr/lib/libc.a)
+# by 0xD0454044: nlist64 (in /usr/lib/libc.a)
+# by 0xD01267FC: _pth_init_kgetsig (in /usr/lib/libpthread.a)
+# by 0xD01123DC: pthread_init (in /usr/lib/libpthread.a)
+# by 0x10000344: call_pthread_init (in /proc/448094/object/a.out)
+# by 0x10000258: __threads_init (in /proc/448094/object/a.out)
+# by 0xD0325278: __modinit (in /usr/lib/libc.a)
+# by 0x10000198: (below main) (in /proc/448094/object/a.out)
+{
+ AIX-thread-library-init-2
+ Memcheck:Cond
+ fun:__ftell
+ fun:ftello64
+ fun:nlist64
+}
+
+## Related wierdness (klseek is undocumented, so the wrapper
+## is a guess at best)
+{
+ AIX-libc-klseek-1
+ Memcheck:Param
+ klseek(offset)
+ fun:lseek64
+ fun:fseeko64_unlocked
+ fun:fseeko64
+}
+{
+ AIX-libc-klseek-2
+ Memcheck:Param
+ klseek(whence)
+ fun:lseek64
+ fun:fseeko64_unlocked
+ fun:fseeko64
+}
+
+## Buffer overrun in libc regexp stuff?
+# Invalid read of size 1
+# at 0xD08A2F50: memcpy (mc_replace_strmem.c:437)
+# by 0xD0328B30: match_re (in /usr/lib/libc.a)
+# by 0xD032A464: match_re (in /usr/lib/libc.a)
+# by 0xD032A464: match_re (in /usr/lib/libc.a)
+# by 0xD032A464: match_re (in /usr/lib/libc.a)
+# by 0xD0328AD4: match_re (in /usr/lib/libc.a)
+# by 0xD032A464: match_re (in /usr/lib/libc.a)
+# by 0xD032816C: __regexec_std (in /usr/lib/libc.a)
+# by 0xD0330AA8: regexec (in /usr/lib/libc.a)
+{
+ AIX-regexp-dodgyness-1
+ Memcheck:Addr1
+ fun:memcpy
+ fun:match_re
+ fun:match_re
+ fun:match_re
+}
+
+## Misuse of memcpy
+# Source and destination overlap in memcpy(0x32154ECC, 0x32154EC8, 8)
+# at 0xD13A4F30: memcpy (mc_replace_strmem.c:437)
+# by 0xD03D34BC: __ntree_locate (in /usr/lib/libc.a)
+# by 0xD03D3090: ntree_search (in /usr/lib/libc.a)
+# by 0xD0406E8C: colon_search (in /usr/lib/libc.a)
+# by 0xD03DE068: method_getpw_common (in /usr/lib/libc.a)
+# by 0xD03DEB18: method_getpwuid (in /usr/lib/libc.a)
+# by 0xD03C89DC: _getpwuid_shadow_r (in /usr/lib/libc.a)
+# by 0xD03C62FC: _getpwuid_shadow (in /usr/lib/libc.a)
+{
+ AIX-overlapping-memcpy-1
+ Memcheck:Overlap
+ fun:memcpy
+ fun:__ntree_locate
+ fun:ntree_search
+ fun:colon_search
+}
+{
+ AIX-overlapping-memcpy-2
+ Memcheck:Overlap
+ fun:memcpy
+ fun:__ntree_locate
+ fun:__ntree_locate
+ fun:ntree_search
+}
+
+## No idea what this is caused by
+# Conditional jump or move depends on uninitialised value(s)
+# at 0xD03069F8: fflush_unlocked (in /usr/lib/libc.a)
+# by 0xD03077AC: fflush (in /usr/lib/libc.a)
+# by 0xD03D545C: common_close (in /usr/lib/libc.a)
+# by 0xD03D46B8: common_unlock (in /usr/lib/libc.a)
+# by 0xD040712C: colon_search (in /usr/lib/libc.a)
+# by 0xD03DE068: method_getpw_common (in /usr/lib/libc.a)
+# by 0xD03DEB18: method_getpwuid (in /usr/lib/libc.a)
+{
+ AIX-fflush-unlocked-1
+ Memcheck:Cond
+ fun:fflush_unlocked
+ fun:fflush
+ fun:common_close
+ fun:common_unlock
+}
+
+## No idea what this is caused by
+# Conditional jump or move depends on uninitialised value(s)
+# at 0xD03EBC30: __method_getentry_v2 (in /usr/lib/libc.a)
+# by 0xD03E887C: does_user_exist (in /usr/lib/libc.a)
+# by 0xD03E9010: getuserattrs (in /usr/lib/libc.a)
+# by 0xD03E4E68: getuserattr (in /usr/lib/libc.a)
+# by 0xD03C8BA4: _getpwuid_shadow_r (in /usr/lib/libc.a)
+# by 0xD03CBE4C: getpwuid (in /usr/lib/libc.a)
+{
+ AIX-__method_getentry_v2-1
+ Memcheck:Cond
+ fun:__method_getentry_v2
+ fun:does_user_exist
+ fun:getuserattrs
+ fun:getuserattr
+}
+{
+ AIX-__method_getentry_v2-2
+ Memcheck:Cond
+ fun:__method_getentry_v2
+ fun:does_user_exist
+ fun:process_module
+ fun:getuserattrs
+}
+
+## No idea what this is caused by
+# Conditional jump or move depends on uninitialised value(s)
+# at 0xD03F7120: seekdir64 (in /usr/lib/libc.a)
+# by 0xD041A63C: opendir64 (in /usr/lib/libc.a)
+# by 0xD041961C: getwd (in /usr/lib/libc.a)
+# by 0xD04194B4: getcwd (in /usr/lib/libc.a)
+{
+ AIX-seekdir64
+ Memcheck:Cond
+ fun:seekdir64
+ fun:opendir64
+}
+
+## No idea what this is caused by
+# Conditional jump or move depends on uninitialised value(s)
+# at 0xD036C80C: ungetwc (in /usr/lpp/ppe.poe/lib/threads/libc.a(shr.=
o))
+# by 0xD0369D94: ungetcc (in /usr/lpp/ppe.poe/lib/threads/libc.a(shr.=
o))
+# by 0xD03695EC: _doscan (in /usr/lpp/ppe.poe/lib/threads/libc.a(shr.=
o))
+# by 0xD037544C: sscanf (in /usr/lpp/ppe.poe/lib/threads/libc.a(shr.o=
))
+# by 0xD1BAD9BC: lapi_atoi (in /usr/lib/liblapi_r.a(liblapi_r.o))
+# by 0xD1BA8DBC: _read_int_env (in /usr/lib/liblapi_r.a(liblapi_r.o))
+# by 0xD1BAB86C: _lapi_init_env_once (in /usr/lib/liblapi_r.a(liblapi=
_r.o))
+# by 0xD1BAB44C: _lapi_perproc_setup (in /usr/lib/liblapi_r.a(liblapi=
_r.o))
+# by 0xD0118E50: pthread_once (in /usr/lib/libpthreads.a(shr_xpg5.o))
+# by 0xD1BA86B8: LAPI__Init (in /usr/lib/liblapi_r.a(liblapi_r.o))
+# by 0xD0EC7A70: lapi_init (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpci_r=
.o))
+# by 0xD0EC9524: mpci_connect (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpc=
i_r.o))
+{
+ AIX-LAPI-ungetwc-1
+ Memcheck:Cond
+ fun:ungetwc
+ fun:ungetcc
+ fun:_doscan
+ fun:sscanf
+}
+{
+ AIX-LAPI-ungetwc-2
+ Memcheck:Cond
+ fun:ungetwc
+ fun:ungetcc
+ fun:number
+ fun:_doscan
+}
+
+## No idea what this is caused by
+# Conditional jump or move depends on uninitialised value(s)
+# at 0xD030CAD0: atoi (in /usr/lpp/ppe.poe/lib/threads/libc.a(shr.o))
+# by 0xD0E48DAC: _udp_open_socket (in /usr/lib/liblapi_r.a(liblapiudp=
_r.o))
+# by 0xD0E4B17C: _udp_open (in /usr/lib/liblapi_r.a(liblapiudp_r.o))
+# by 0xD1BAC77C: _lapi_init_function (in /usr/lib/liblapi_r.a(liblapi=
_r.o))
+# by 0xD1BAE4F0: _lapi_non_pss_init (in /usr/lib/liblapi_r.a(liblapi_=
r.o))
+# by 0xD1BA883C: LAPI__Init (in /usr/lib/liblapi_r.a(liblapi_r.o))
+# by 0xD0EC7A70: lapi_init (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpci_r=
.o))
+# by 0xD0EC9524: mpci_connect (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpc=
i_r.o))
+# by 0xD06AA28C: _css_init (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpicor=
e_r.o))
+# by 0xD06AB664: _mp_init_msg_passing (in /usr/lpp/ppe.poe/lib/libmpi=
_r.a(mpicore_r.o))
+# by 0xD0647F54: MPI__Init (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpicor=
e_r.o))
+{
+ AIX-LAPI-atoi-1
+ Memcheck:Cond
+ fun:atoi
+ fun:_udp_open_socket
+ fun:_udp_open
+ fun:_lapi_init_function
+}
+{
+ AIX-LAPI-atoi-2
+ Memcheck:Value4
+ fun:atoi
+ fun:_udp_open_socket
+ fun:_udp_open
+ fun:_lapi_init_function
+}
+{
+ AIX-LAPI-atoi-3
+ Memcheck:Value8
+ fun:atoi
+ fun:_udp_open_socket
+ fun:_udp_open
+ fun:_lapi_init_function
+}
+
+## MPI stuff. Not sure what's going on here. Is this a=20
+## legit padding problem? Dunno.
+# Syscall param write(buf) points to uninitialised byte(s)
+# at 0xD0310068: write (in /usr/lpp/ppe.poe/lib/threads/libc.a(shr.o)=
)
+# by 0xD1CD03B0: pm_SSM_write (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpi=
poe_r.o))
+# by 0xD1CD5FB0: mp_main (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpipoe_r=
.o))
+# by 0x100005D8: poe_remote_main (in /proc/872668/object/a.out)
+# by 0xD0325414: mod_init1 (in /usr/lpp/ppe.poe/lib/threads/libc.a(sh=
r.o))
+# by 0xD0325328: __modinit (in /usr/lpp/ppe.poe/lib/threads/libc.a(sh=
r.o))
+# by 0x10000198: (below main) (in /proc/872668/object/a.out)
+# Address 0x32131422 is 10 bytes inside a block of size 19 alloc'd
+# at 0xD4230514: malloc (vg_replace_malloc.c:168)
+# by 0xD1CD035C: pm_SSM_write (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpi=
poe_r.o))
+# by 0xD1CD5FB0: mp_main (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpipoe_r=
.o))
+# by 0x100005D8: poe_remote_main (in /proc/872668/object/a.out)
+# by 0xD0325414: mod_init1 (in /usr/lpp/ppe.poe/lib/threads/libc.a(sh=
r.o))
+# by 0xD0325328: __modinit (in /usr/lpp/ppe.poe/lib/threads/libc.a(sh=
r.o))
+# by 0x10000198: (below main) (in /proc/872668/object/a.out)
+{
+ AIX-MPI-pm_SSM_write-1
+ Memcheck:Param
+ write(buf)
+ fun:write
+ fun:pm_SSM_write
+ fun:mp_main
+}
+{
+ AIX-MPI-pm_SSM_write-2
+ Memcheck:Param
+ write(buf)
+ fun:write
+ fun:pm_SSM_write
+ fun:_mp_send_child_pid
+}
+{
+ AIX-MPI-pm_SSM_write-3
+ Memcheck:Param
+ write(buf)
+ fun:write
+ fun:pm_SSM_write
+ fun:_mp_finalize_req
+}
+{
+ AIX-MPI-pm_SSM_write-4
+ Memcheck:Param
+ write(buf)
+ fun:write
+ fun:pm_SSM_write
+ fun:pm_atexit
+}
+{
+ AIX-MPI-pm_SSM_write-5
+ Memcheck:Param
+ write(buf)
+ fun:write
+ fun:pm_SSM_write
+ fun:_udp_init
+}
+{
+ AIX-MPI-pm_SSM_write-6
+ Memcheck:Param
+ write(buf)
+ fun:write
+ fun:pm_SSM_write
+ fun:_us_info
+}
+{
+ AIX-MPI-pm_SSM_read-1
+ Memcheck:Param
+ write(buf)
+ fun:write
+ fun:pm_SSM_read
+ fun:pm_atexit
+}
+{
+ AIX-MPI-pm_SSM_read-2
+ Memcheck:Param
+ write(buf)
+ fun:write
+ fun:pm_SSM_read
+ fun:poe_unlock_all
+}
+{
+ AIX-MPI-pm_SSM_read-3
+ Memcheck:Param
+ write(buf)
+ fun:write
+ fun:pm_SSM_read
+ fun:_css_init
+}
+{
+ AIX-MPI-pm_SSM_read-3
+ Memcheck:Param
+ write(buf)
+ fun:write
+ fun:pm_SSM_read
+ fun:pthread_mutex_lock
+}
+{
+ AIX-MPI-pm_SSM_read-4
+ Memcheck:Param
+ write(buf)
+ fun:write
+ fun:pm_SSM_read
+ fun:_mp_Wtime_stop
+}
+{
+ AIX-MPI-pm_SSM_read-5
+ Memcheck:Param
+ write(buf)
+ fun:write
+ fun:pm_SSM_read
+ fun:pthread_mutex_unlock
+}
+
+
+## More MPI stuff
+# Invalid read of size 8
+# at 0xD3EB34D8: read_canopus (in /usr/lib/swclock.o)
+# by 0xD3EB31A0: swclockRead (hps_scri.c:431)
+# by 0xD08B6AD4: HPSOclk_reset (in /usr/lpp/ppe.poe/lib/libppe_r.a(dy=
namic.o))
+# by 0xD08B6CB4: HPSOclk_init (in /usr/lpp/ppe.poe/lib/libppe_r.a(dyn=
amic.o))
+# by 0xD16BC9F0: _mp_Wtime_init (in /usr/lpp/ppe.poe/lib/libmpi_r.a(m=
pipoe_r.o))
+# by 0xD1FEA3A8: _css_init (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpicor=
e_r.o))
+# by 0xD1FEB664: _mp_init_msg_passing (in /usr/lpp/ppe.poe/lib/libmpi=
_r.a(mpicore_r.o))
+# by 0xD1F87F54: MPI__Init (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpicor=
e_r.o))
+# Address 0x40000000 is not stack'd, malloc'd or (recently) free'd
+{
+ AIX-MPI-read_canopus
+ Memcheck:Addr8
+ fun:read_canopus
+ fun:swclockRead
+ fun:HPSOclk_reset
+ fun:HPSOclk_init
+}
+
+## More MPI stuff (many variants of these)
+# Conditional jump or move depends on uninitialised value(s)
+# at 0xD1E8297C: ipcompare (in /usr/lib/liblapi_r.a(liblapi_r.o))
+# by 0xD033CADC: qs1 (in /usr/lpp/ppe.poe/lib/threads/libc.a(shr.o))
+# by 0xD1E82A38: _derive_up_down_instances (in /usr/lib/liblapi_r.a(l=
iblapi\
+#_r.o))
+# by 0xD1E83484: NAM_monitor_thread (in /usr/lib/liblapi_r.a(liblapi_=
r.o))
+# by 0xD0111440: _pthread_body (in /usr/lib/libpthreads.a(shr_xpg5.o)=
)
+{
+ AIX-MPI-ipcompare-1
+ Memcheck:Cond
+ fun:ipcompare
+ fun:qs1
+ fun:_derive_up_down_instances
+ fun:NAM_monitor_thread
+}
+{
+ AIX-MPI-ipcompare-2
+ Memcheck:Cond
+ fun:ipcompare
+ fun:qs1
+ fun:qsort
+ fun:_derive_up_down_instances
+}
+{
+ AIX-MPI-ipcompare-3
+ Memcheck:Cond
+ fun:ipcompare
+ fun:qs1
+ fun:qs1
+ fun:qsort
+}
+{
+ AIX-MPI-ipcompare-4
+ Memcheck:Cond
+ fun:ipcompare
+ fun:qs1
+ fun:qs1
+ fun:qs1
+}
+{
+ AIX-MPI-ipcompare-5
+ Memcheck:Cond
+ fun:ipcompare
+ fun:bsearch_*_1
+ fun:NAM_monitor_thread
+}
+
+## More MPI stuff
+# Conditional jump or move depends on uninitialised value(s)
+# at 0xD1CA2240: barrier_shft_b (in /usr/lpp/ppe.poe/lib/libmpi_r.a(m=
picore_r.o))
+# by 0xD1CE6FAC: _mpi_barrier (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpi=
core_r.o))
+# by 0xD1D11720: _mpi_init (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpicor=
e_r.o))
+# by 0xD1D733D8: _css_init (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpicor=
e_r.o))
+# by 0xD1D74644: _mp_init_msg_passing (in /usr/lpp/ppe.poe/lib/libmpi=
_r.a(mpicore_r.o))
+# by 0xD1D10F34: MPI__Init (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpicor=
e_r.o))
+# by 0xD33DD5D0: PMPI_Init (libmpiwrap.c:1789)
+# by 0xD33E48F8: before (libmpiwrap.c:186)
+# by 0xD33DD55C: PMPI_Init (libmpiwrap.c:1788)
+{
+ AIX-MPI-barrier_shft_b-1
+ Memcheck:Cond
+ fun:barrier_shft_b
+ fun:_mpi_barrier
+ fun:_mpi_init
+ fun:_css_init
+}
+{
+ AIX-MPI-barrier_shft_b-2
+ Memcheck:Cond
+ fun:barrier_shft_b
+ fun:_mpi_barrier
+ fun:MPI__Finalize
+}
+{
+ AIX-MPI-barrier_shft_b-3
+ Memcheck:Cond
+ fun:barrier_shft_b
+ fun:_mpi_barrier
+ fun:MPI__Barrier
+}
+
+## MPI
+# Invalid read of size 1
+# at 0xD21B8FB8: can_writepkt (in /usr/lib/libhal_r.a(hal_hps.o))
+# by 0xD1E86D7C: _stripe_hal_writepkt_noflip (in /usr/lib/liblapi_r.a=
(liblapi_r.o))
+# by 0xD1E33BB8: _process_one_contig_item (in /usr/lib/liblapi_r.a(li=
blapi_r.o))
+# by 0xD1E4E3A8: _Am_xfer (in /usr/lib/liblapi_r.a(liblapi_r.o))
+# by 0xD1E4EB9C: _Dgsp_xfer (in /usr/lib/liblapi_r.a(liblapi_r.o))
+# by 0xD1E49EC0: LAPI__Xfer (in /usr/lib/liblapi_r.a(liblapi_r.o))
+# by 0xD1DCF2FC: mpci_send (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpci_r=
.o))
+# by 0xD1C90F6C: _mpi_start (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpico=
re_r.o))
+# by 0xD1C90648: _mpi_xisend (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpic=
ore_r.o))
+# by 0xD1C89898: MPI__Isend (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpico=
re_r.o))
+# by 0xD3910FD4: generic_Isend (libmpiwrap.c:1129)
+# by 0xFFFFFFFB: ???
+# Address 0x370A4794 is 0 bytes after a block of size 20 alloc'd
+# at 0xD38DE514: malloc (vg_replace_malloc.c:168)
+# by 0x100004BC: main (mpi_vg_demo2.c:56)
+{
+ AIX-MPI-can_writepkt-1
+ Memcheck:Addr1
+ fun:can_writepkt
+ fun:_stripe_hal_writepkt_noflip
+ fun:_process_one_contig_item
+ fun:_Am_xfer
+}
+{
+ AIX-MPI-can_writepkt-2
+ Memcheck:Addr1
+ obj:*
+ fun:_make_localbuf_copy
+ fun:_Am_xfer
+ fun:_Dgsp_xfer
+}
+
+## MPI
+# Invalid write of size 4
+# at 0xD1D14B18: check_ranks (in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpic=
ore_r.o))
+# by 0xD1D147C8: MPI__Group_incl (in /usr/lpp/ppe.poe/lib/libmpi_r.a(=
mpicore_r.o))
+# Address 0x2FF12154 is not stack'd, malloc'd or (recently) free'd
+{
+ AIX-MPI-check_ranks-1
+ Memcheck:Addr4
+ fun:check_ranks
+ fun:MPI__Group_incl
+}
+
+## X, holes in structs?
+{
+ AIX-X11-write-_X11TransSocketWrite
+ Memcheck:Param
+ write(buf)
+ fun:write
+ fun:_X11TransSocketWrite
+ fun:_X11TransWrite
+}
+
+## Who knows
+{
+ AIX-fread_unlocked-1
+ Memcheck:Cond
+ fun:*memcpy
+ fun:fread_unlocked
+ fun:fread
+}
+{
+ AIX-fread_unlocked-2
+ Memcheck:Value8
+ fun:*memcpy
+ fun:fread_unlocked
+ fun:fread
+}
+{
+ AIX-fread_unlocked-3
+ Memcheck:Value4
+ fun:*memcpy
+ fun:fread_unlocked
+ fun:fread
+}
+{
+ AIX-fread_unlocked-4
+ Memcheck:Cond
+ fun:fread_unlocked
+ fun:fread
+}
+
+## Looks like inlined strcpy etc in module with no symbols; nothing
+# to be done about it.
+{
+ AIX-uconv-1
+ Memcheck:Cond
+ obj:/*/UTF32TBL__64
+ obj:/*/UTF32TBL__64
+ obj:/*/UTF32TBL__64
+}
+{
+ AIX-uconv-2
+ Memcheck:Value8
+ obj:/*/UTF32TBL__64
+ obj:/*/UTF32TBL__64
+ obj:/*/UTF32TBL__64
+}
+{
+ AIX-uconv-3
+ Memcheck:Addr8
+ obj:/*/UTF32TBL__64
+ obj:/*/UTF32TBL__64
+ obj:/*/UTF32TBL__64
+}
+
+
+#####################################################################
+### AIX 64-bit ###
+#####################################################################
+
+{
+ AIX64-uu-sz8
+ Memcheck:Addr8
+ obj:/usr/ccs/bin/usla64
+ obj:/usr/ccs/bin/usla64
+}
+{
+ AIX64-uu-sz4
+ Memcheck:Addr4
+ obj:/usr/ccs/bin/usla64
+ obj:/usr/ccs/bin/usla64
+}
+{
+ AIX64-uu-sz2
+ Memcheck:Addr2
+ obj:/usr/ccs/bin/usla64
+ obj:/usr/ccs/bin/usla64
+}
+{
+ AIX64-uu-sz1
+ Memcheck:Addr1
+ obj:/usr/ccs/bin/usla64
+ obj:/usr/ccs/bin/usla64
+}
+
+{
+ AIX64-uc-sz8
+ Memcheck:Addr8
+ obj:/usr/ccs/bin/usla64
+ obj:*/libc.a(shr*.o)
+}
+{
+ AIX64-uc-sz4
+ Memcheck:Addr4
+ obj:/usr/ccs/bin/usla64
+ obj:*/libc.a(shr*.o)
+}
+{
+ AIX64-uc-sz2
+ Memcheck:Addr2
+ obj:/usr/ccs/bin/usla64
+ obj:*/libc.a(shr*.o)
+}
+{
+ AIX64-uc-sz1
+ Memcheck:Addr1
+ obj:/usr/ccs/bin/usla64
+ obj:*/libc.a(shr*.o)
+}
+
+{
+ AIX64-?uu-sz8
+ Memcheck:Addr8
+ fun:*
+ obj:/usr/ccs/bin/usla64
+ obj:/usr/ccs/bin/usla64
+}
+{
+ AIX64-?uu-sz4
+ Memcheck:Addr4
+ fun:*
+ obj:/usr/ccs/bin/usla64
+ obj:/usr/ccs/bin/usla64
+}
+
+{
+ AIX64-?uc-sz8
+ Memcheck:Addr8
+ fun:*
+ obj:/usr/ccs/bin/usla64
+ obj:*/libc.a(shr*.o)
+}
+{
+ AIX64-?uc-sz4
+ Memcheck:Addr4
+ fun:*
+ obj:/usr/ccs/bin/usla64
+ obj:*/libc.a(shr*.o)
+}
+{
+ AIX64-?uc-sz2
+ Memcheck:Addr2
+ fun:*
+ obj:/usr/ccs/bin/usla64
+ obj:*/libc.a(shr*.o)
+}
+{
+ AIX64-?uc-sz1
+ Memcheck:Addr1
+ fun:*
+ obj:/usr/ccs/bin/usla64
+ obj:*/libc.a(shr*.o)
+}
+
+{
+ AIX64-usla_exec_init_mods-sz8
+ Memcheck:Addr8
+ fun:usl_exec_init_mods
+}
+
+{
+ AIX64-usla_main-sz8
+ Memcheck:Addr8
+ fun:usla_main
+}
+
+{
+ AIX64-__modfini64-sz8
+ Memcheck:Addr8
+ fun:__modfini64
+}
+
+{
+ AIX64-load-lib?-sz8
+ Memcheck:Addr8
+ fun:load
+ obj:*/lib?.a(shr*.o)
+}
+
+{
+ AIX64-__loadx-libc-sz8
+ Memcheck:Addr8
+ fun:__loadx
+ obj:*/libc.a(shr*.o)
+}
+
+{
+ AIX64-loadquery-libC-sz8
+ Memcheck:Addr8
+ fun:loadquery
+ obj:*/libC.a(shr*.o)
+}
+
+{
+ AIX64-__loadx-pthread_init-sz8
+ Memcheck:Addr8
+ fun:__loadx
+ fun:pthread_init
+}
+
+{
+ AIX64-unload-libC-sz8
+ Memcheck:Addr8
+ fun:unload
+ obj:*/libC.a(shr*.o)
+}
+
+{
+ AIX64-loadquery-__C_runtime_startup-sz8
+ Memcheck:Addr8
+ fun:loadquery
+ fun:__C_runtime_startup
+}
+
+{
+ AIX64-load-libppe-sz8
+ Memcheck:Addr8
+ fun:load
+ obj:*/libppe*.a(*.o)
+}
|
|
From: <sv...@va...> - 2006-10-17 00:57:27
|
Author: sewardj
Date: 2006-10-17 01:57:24 +0100 (Tue, 17 Oct 2006)
New Revision: 6243
Log:
Merge r6087:
Changes for AIX5. No surprises here. New stuff:
- generates automake symbols of name VGP_platform and VGO_os,=20
whereas previously it just made VG_platform
- Do checks to enable building MPI wrapper library for both the
primary and secondary target.
Modified:
trunk/configure.in
Modified: trunk/configure.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/configure.in 2006-10-17 00:56:43 UTC (rev 6242)
+++ trunk/configure.in 2006-10-17 00:57:24 UTC (rev 6243)
@@ -108,7 +108,11 @@
esac
=20
=20
-# Checks for the platform
+# Checks for the platform, with the aim of setting VG_ARCH. Note
+# that VG_ARCH must be set to reflect the most that this CPU can
+# do: for example if it is a 64-bit capable PowerPC, then it must
+# be set to ppc64 and not ppc32. Ditto for amd64.
+
AC_CANONICAL_HOST
=20
AC_MSG_CHECKING([for a supported CPU])
@@ -135,6 +139,7 @@
;;
=20
powerpc64)
+# This value can only happen on Linux, not on AIX
AC_MSG_RESULT([ok (${host_cpu})])
VG_ARCH=3D"ppc64"
valt_load_address_normal=3D"0x38000000"
@@ -142,8 +147,17 @@
;;
=20
powerpc)
+# Complexity. 'powerpc' on AIX implies a 64-bit capable CPU.
+# Whereas in Linux that means only a 32-bit capable CPU.
AC_MSG_RESULT([ok (${host_cpu})])
- VG_ARCH=3D"ppc32"
+ case "${host_os}" in
+ aix5.*)
+ VG_ARCH=3D"ppc64"
+ ;;
+ *)
+ VG_ARCH=3D"ppc32"
+ ;;
+ esac
valt_load_address_normal=3D"0x38000000"
valt_load_address_inner=3D"0x28000000"
;;
@@ -227,6 +241,19 @@
=20
;;
=20
+ aix5.1.*)
+ AC_MSG_RESULT([ok (${host_os})])
+ VG_OS=3D"aix5"
+ ;;
+ aix5.2.*)
+ AC_MSG_RESULT([ok (${host_os})])
+ VG_OS=3D"aix5"
+ ;; =20
+ aix5.3.*)
+ AC_MSG_RESULT([ok (${host_os})])
+ VG_OS=3D"aix5"
+ ;; =20
+
*freebsd*)
AC_MSG_RESULT([ok (${host_os})])
VG_OS=3D"freebsd"
@@ -301,6 +328,19 @@
VG_PLATFORM_SEC=3D""
AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
;;
+ ppc64-aix5)
+ if test x$vg_cv_only64bit =3D xyes; then
+ VG_PLATFORM_PRI=3D"PPC64_AIX5"
+ VG_PLATFORM_SEC=3D""
+ elif test x$vg_cv_only32bit =3D xyes; then
+ VG_PLATFORM_PRI=3D"PPC32_AIX5"
+ VG_PLATFORM_SEC=3D""
+ else
+ VG_PLATFORM_PRI=3D"PPC64_AIX5"
+ VG_PLATFORM_SEC=3D"PPC32_AIX5"
+ fi
+ AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
+ ;;
ppc64-linux)
if test x$vg_cv_only64bit =3D xyes; then
VG_PLATFORM_PRI=3D"PPC64_LINUX"
@@ -322,27 +362,52 @@
;;
esac
=20
-# Set up VG_<platform>. Either one or two of these become defined.
+# Set up VGP_<platform>. Either one or two of these become defined.
#
-AM_CONDITIONAL(VG_X86_LINUX, =20
+AM_CONDITIONAL(VGP_X86_LINUX, =20
test x$VG_PLATFORM_PRI =3D xX86_LINUX \
-o x$VG_PLATFORM_SEC =3D xX86_LINUX)
-AM_CONDITIONAL(VG_AMD64_LINUX,=20
+AM_CONDITIONAL(VGP_AMD64_LINUX,=20
test x$VG_PLATFORM_PRI =3D xAMD64_LINUX)
-AM_CONDITIONAL(VG_PPC32_LINUX,=20
+AM_CONDITIONAL(VGP_PPC32_LINUX,=20
test x$VG_PLATFORM_PRI =3D xPPC32_LINUX \=20
-o x$VG_PLATFORM_SEC =3D xPPC32_LINUX)
-AM_CONDITIONAL(VG_PPC64_LINUX,=20
+AM_CONDITIONAL(VGP_PPC64_LINUX,=20
test x$VG_PLATFORM_PRI =3D xPPC64_LINUX)
+AM_CONDITIONAL(VGP_PPC32_AIX5,=20
+ test x$VG_PLATFORM_PRI =3D xPPC32_AIX5 \=20
+ -o x$VG_PLATFORM_SEC =3D xPPC32_AIX5)
+AM_CONDITIONAL(VGP_PPC64_AIX5,=20
+ test x$VG_PLATFORM_PRI =3D xPPC64_AIX5)
=20
+# Similarly, set up VGO_<os>. Exactly one of these becomes defined.
+# Relies on the assumption that the primary and secondary targets are=20
+# for the same OS, so therefore only necessary to test the primary.
+#
+AM_CONDITIONAL(VGO_LINUX,
+ test x$VG_PLATFORM_PRI =3D xX86_LINUX \
+ -o x$VG_PLATFORM_PRI =3D xAMD64_LINUX \
+ -o x$VG_PLATFORM_PRI =3D xPPC32_LINUX \
+ -o x$VG_PLATFORM_PRI =3D xPPC64_LINUX)
+AM_CONDITIONAL(VGO_AIX5,
+ test x$VG_PLATFORM_PRI =3D xPPC32_AIX5 \
+ -o x$VG_PLATFORM_PRI =3D xPPC64_AIX5)
=20
+
+# Sometimes, in the Makefile.am-s, it's useful to know
+# whether or not there is a secondary target.
+#
+AM_CONDITIONAL(VGP_HAVE_SECONDARY,
+ test x$VG_PLATFORM_SEC !=3D x)
+
+
# This variable will collect the individual suppression files
# depending on the results of autoconf
DEFAULT_SUPP=3D""
AC_SUBST(DEFAULT_SUPP)
=20
=20
-glibc=3D""
+libc=3D""
=20
AC_EGREP_CPP([GLIBC_22], [
#include <features.h>
@@ -352,7 +417,7 @@
#endif
#endif
],
-glibc=3D"2.2")
+libc=3D"2.2")
=20
AC_EGREP_CPP([GLIBC_23], [
#include <features.h>
@@ -362,7 +427,7 @@
#endif
#endif
],
-glibc=3D"2.3")
+libc=3D"2.3")
=20
AC_EGREP_CPP([GLIBC_24], [
#include <features.h>
@@ -372,7 +437,7 @@
#endif
#endif
],
-glibc=3D"2.4")
+libc=3D"2.4")
=20
AC_EGREP_CPP([GLIBC_25], [
#include <features.h>
@@ -382,11 +447,19 @@
#endif
#endif
],
-glibc=3D"2.5")
+libc=3D"2.5")
=20
-AC_MSG_CHECKING([the glibc version])
+AC_EGREP_CPP([AIX5_LIBC], [
+#include <standards.h>
+#if defined(_AIXVERSION_510) || defined(_AIXVERSION_520) || defined(_AIX=
VERSION_530)
+ AIX5_LIBC
+#endif
+],
+libc=3D"aix5")
=20
-case "${glibc}" in
+AC_MSG_CHECKING([the libc version])
+
+case "${libc}" in
2.2)
AC_MSG_RESULT(2.2 family)
AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x])
@@ -410,16 +483,23 @@
AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x])
DEFAULT_SUPP=3D"glibc-2.5.supp ${DEFAULT_SUPP}"
;;
+=09
+ aix5)
+ AC_MSG_RESULT(AIX 5.1, 5.2 or 5.3)
+ AC_DEFINE([AIX5_LIBC], 1, [Define to 1 if you're using AIX 5.1, 5.2 or =
5.3])
+ DEFAULT_SUPP=3D"aix5libc.supp ${DEFAULT_SUPP}"
+ ;;
=20
*)
AC_MSG_RESULT(unsupported version)
AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.5])
+ AC_MSG_ERROR([or AIX 5.2/5.3 libc])
;;
esac
=20
=20
# We don't know how to detect the X client library version
-# (detecting the server version is easy, bu no help). So we
+# (detecting the server version is easy, but no help). So we
# just use a hack: always include the suppressions for both
# versions 3 and 4.
AC_PATH_X
@@ -450,6 +530,27 @@
AC_SUBST(FLAG_M32)
=20
=20
+# does this compiler support -maix32 ?
+AC_MSG_CHECKING([if gcc accepts -maix32])
+
+safe_CFLAGS=3D$CFLAGS
+CFLAGS=3D"-maix32"
+
+AC_TRY_COMPILE(, [
+int main () { return 0 ; }
+],
+[
+FLAG_MAIX32=3D"-maix32"
+AC_MSG_RESULT([yes])
+], [
+FLAG_MAIX32=3D""
+AC_MSG_RESULT([no])
+])
+CFLAGS=3D$safe_CFLAGS
+
+AC_SUBST(FLAG_MAIX32)
+
+
# does this compiler support -m64 ?
AC_MSG_CHECKING([if gcc accepts -m64])
=20
@@ -471,6 +572,27 @@
AC_SUBST(FLAG_M64)
=20
=20
+# does this compiler support -maix64 ?
+AC_MSG_CHECKING([if gcc accepts -maix64])
+
+safe_CFLAGS=3D$CFLAGS
+CFLAGS=3D"-maix64"
+
+AC_TRY_COMPILE(, [
+int main () { return 0 ; }
+],
+[
+FLAG_MAIX64=3D"-maix64"
+AC_MSG_RESULT([yes])
+], [
+FLAG_MAIX64=3D""
+AC_MSG_RESULT([no])
+])
+CFLAGS=3D$safe_CFLAGS
+
+AC_SUBST(FLAG_MAIX64)
+
+
# does this compiler support -mmmx ?
AC_MSG_CHECKING([if gcc accepts -mmmx])
=20
@@ -655,11 +777,18 @@
AC_CHECK_FUNCS([floor memchr memset mkdir strchr strdup strpbrk strrchr =
strstr semtimedop])
=20
=20
-# Do we have a useable MPI setup on the primary target
-# (mpicc, and suitable MPI2 headers?)
+# Do we have a useable MPI setup on the primary and/or secondary targets=
?
+# On Linux, by default, assumes mpicc and -m32/-m64
+# On AIX, by default, assumes mpxlc and -q32/-q64
# Note: this is a kludge in that it assumes the specified mpicc=20
-# understands '-m32' or '-m64', as established above
+# understands -m32/-m64/-q32/-q64 regardless of what is specified using
+# --with-mpicc=3D.
MPI_CC=3D"mpicc"
+if test x$VG_PLATFORM_PRI =3D xPPC32_AIX5 \
+ -o x$VG_PLATFORM_PRI =3D xPPC64_AIX5 ; then
+ MPI_CC=3D"mpxlc"
+fi
+
mflag_primary=3D
if test x$VG_PLATFORM_PRI =3D xX86_LINUX \
-o x$VG_PLATFORM_PRI =3D xPPC32_LINUX ; then
@@ -667,13 +796,30 @@
elif test x$VG_PLATFORM_PRI =3D xAMD64_LINUX \
-o x$VG_PLATFORM_PRI =3D xPPC64_LINUX ; then
mflag_primary=3D$FLAG_M64
+elif test x$VG_PLATFORM_PRI =3D xPPC32_AIX5 ; then
+ mflag_primary=3D-q32
+elif test x$VG_PLATFORM_PRI =3D xPPC64_AIX5 ; then
+ mflag_primary=3D-q64
fi
=20
+mflag_secondary=3D
+if test x$VG_PLATFORM_SEC =3D xX86_LINUX \
+ -o x$VG_PLATFORM_SEC =3D xPPC32_LINUX ; then
+ mflag_secondary=3D$FLAG_M32
+elif test x$VG_PLATFORM_SEC =3D xPPC32_AIX5 ; then
+ mflag_secondary=3D-q32
+fi
+
+
AC_ARG_WITH(mpicc,
[ --with-mpicc=3D Specify name of MPI2-ised C compiler],
MPI_CC=3D$withval
)
-AC_MSG_CHECKING([for usable MPI2-compliant mpicc and mpi.h])
+AC_SUBST(MPI_CC)
+
+## See if MPI_CC works for the primary target
+##
+AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and=
mpi.h])
saved_CC=3D$CC
saved_CFLAGS=3D$CFLAGS
CC=3D$MPI_CC
@@ -686,17 +832,47 @@
r |=3D MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL );
return r;=20
], [
-ac_have_mpi2=3Dyes
+ac_have_mpi2_pri=3Dyes
AC_MSG_RESULT([yes, $MPI_CC])
], [
-ac_have_mpi2=3Dno
+ac_have_mpi2_pri=3Dno
AC_MSG_RESULT([no])
])
CC=3D$saved_CC
CFLAGS=3D$saved_CFLAGS
+AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri =3D xyes)
=20
-AM_CONDITIONAL(BUILD_MPIWRAP, test x$ac_have_mpi2 =3D xyes)
-AC_SUBST(MPI_CC)
+## See if MPI_CC works for the secondary target. Complication: what if
+## there is no secondary target? We need this to then fail.
+## Kludge this by making MPI_CC something which will surely fail in
+## such a case.
+##
+AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler a=
nd mpi.h])
+saved_CC=3D$CC
+saved_CFLAGS=3D$CFLAGS
+if test x$VG_PLATFORM_SEC =3D x ; then
+ CC=3D"$MPI_CC this will surely fail"
+else
+ CC=3D$MPI_CC
+fi
+CFLAGS=3D$mflag_secondary
+AC_TRY_LINK([
+#include <mpi.h>
+#include <stdio.h>
+],[
+ int r =3D MPI_Init(NULL,NULL);
+ r |=3D MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL );
+ return r;=20
+], [
+ac_have_mpi2_sec=3Dyes
+AC_MSG_RESULT([yes, $MPI_CC])
+], [
+ac_have_mpi2_sec=3Dno
+AC_MSG_RESULT([no])
+])
+CC=3D$saved_CC
+CFLAGS=3D$saved_CFLAGS
+AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec =3D xyes)
=20
=20
# -------------------- ok. We're done. --------------------
|
Author: sewardj
Date: 2006-10-17 01:56:43 +0100 (Tue, 17 Oct 2006)
New Revision: 6242
Log:
Merge r6086:
Makefile.am changes for AIX5. Almost all boilerplate stuff fitting in
with the existing factorisation scheme. The only change of interest
is that configure.in now generates automake symbols of name
VGP_platform and VGO_os, whereas previously it just made VG_platform
which was a bit inconsistent with the VGP/VGO/VGA scheme used in C
code.
Modified:
trunk/Makefile.am
trunk/Makefile.core.am
trunk/Makefile.flags.am
trunk/Makefile.install.am
trunk/Makefile.tool-flags.am
trunk/Makefile.tool.am
trunk/auxprogs/Makefile.am
trunk/cachegrind/Makefile.am
trunk/cachegrind/tests/Makefile.am
trunk/callgrind/Makefile.am
trunk/coregrind/Makefile.am
trunk/helgrind/Makefile.am
trunk/helgrind/tests/Makefile.am
trunk/include/Makefile.am
trunk/lackey/Makefile.am
trunk/massif/Makefile.am
trunk/memcheck/Makefile.am
trunk/memcheck/tests/Makefile.am
trunk/none/Makefile.am
trunk/none/tests/Makefile.am
Modified: trunk/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -18,6 +18,7 @@
=20
SUPP_FILES =3D \
glibc-2.2.supp glibc-2.3.supp glibc-2.4.supp glibc-2.5.supp \
+ aix5libc.supp \
xfree-3.supp xfree-4.supp
=20
dist_val_DATA =3D $(SUPP_FILES) default.supp
@@ -32,22 +33,30 @@
CLEANFILES =3D=20
DISTCLEANFILES =3D default.supp
=20
-if VG_X86_LINUX
+if VGP_X86_LINUX
BUILT_SOURCES +=3D valt_load_address_x86_linux.lds
CLEANFILES +=3D valt_load_address_x86_linux.lds
endif
-if VG_AMD64_LINUX
+if VGP_AMD64_LINUX
BUILT_SOURCES +=3D valt_load_address_amd64_linux.lds
CLEANFILES +=3D valt_load_address_amd64_linux.lds
endif
-if VG_PPC32_LINUX
+if VGP_PPC32_LINUX
BUILT_SOURCES +=3D valt_load_address_ppc32_linux.lds
CLEANFILES +=3D valt_load_address_ppc32_linux.lds
endif
-if VG_PPC64_LINUX
+if VGP_PPC64_LINUX
BUILT_SOURCES +=3D valt_load_address_ppc64_linux.lds
CLEANFILES +=3D valt_load_address_ppc64_linux.lds
endif
+if VGP_PPC32_AIX5
+# No need to generate valt_load_address*.lds; the final executables
+# can be linked to be at any address. They will be relocated by
+# AIX kernel when they are loaded.
+endif
+if VGP_PPC64_AIX5
+# Ditto
+endif
=20
default.supp: $(SUPP_FILES)
=20
@@ -99,6 +108,8 @@
# These list the bits of vex we need to copy into the tarball
=20
VEX_PRIMARY_SOURCES =3D \
+ VEX/quote.txt \
+ VEX/newline.txt \
VEX/HACKING.README \
VEX/LICENSE.README \
VEX/LICENSE.GPL \
Modified: trunk/Makefile.core.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/Makefile.core.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/Makefile.core.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -46,10 +46,28 @@
-DVGO_linux=3D1 \
-DVGP_ppc64_linux=3D1
=20
+add_includes_ppc32_aix5 =3D -I$(top_srcdir)/coregrind \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/coregrind/ppc32 \
+ -I$(top_srcdir)/coregrind/aix5 \
+ -I$(top_srcdir)/coregrind/ppc32-aix5 \
+ -I$(top_srcdir)/include \
+ -I@VEX_DIR@/pub \
+ -DVG_PLATFORM=3D"\"ppc32-aix5\"" \
+ -DVGA_ppc32=3D1 \
+ -DVGO_aix5=3D1 \
+ -DVGP_ppc32_aix5=3D1
+
+add_includes_ppc64_aix5 =3D -I$(top_srcdir)/coregrind \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/coregrind/ppc64 \
+ -I$(top_srcdir)/coregrind/aix5 \
+ -I$(top_srcdir)/coregrind/ppc64-aix5 \
+ -I$(top_srcdir)/include \
+ -I@VEX_DIR@/pub \
+ -DVG_PLATFORM=3D"\"ppc64-aix5\"" \
+ -DVGA_ppc64=3D1 \
+ -DVGO_aix5=3D1 \
+ -DVGP_ppc64_aix5=3D1
+
include $(top_srcdir)/Makefile.flags.am
-
-PRELOAD_LDFLAGS_COMMON =3D -nostdlib -shared -Wl,-z,interpose,-z,initfir=
st
-PRELOAD_LDFLAGS_X86_LINUX =3D $(PRELOAD_LDFLAGS_COMMON) @FLAG_M32@
-PRELOAD_LDFLAGS_AMD64_LINUX =3D $(PRELOAD_LDFLAGS_COMMON) -m64
-PRELOAD_LDFLAGS_PPC32_LINUX =3D $(PRELOAD_LDFLAGS_COMMON) @FLAG_M32@
-PRELOAD_LDFLAGS_PPC64_LINUX =3D $(PRELOAD_LDFLAGS_COMMON) -m64
Modified: trunk/Makefile.flags.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/Makefile.flags.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/Makefile.flags.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -15,8 +15,8 @@
AM_FLAG_M3264_AMD64_LINUX =3D @FLAG_M64@
AM_CPPFLAGS_AMD64_LINUX =3D $(add_includes_amd64_linux)
AM_CFLAGS_AMD64_LINUX =3D $(WERROR) @FLAG_M64@ -fomit-frame-pointer =
\
- @PREFERRED_STACK_BOUNDARY@ $(AM_CFLAGS_BASE)
-AM_CCASFLAGS_AMD64_LINUX =3D $(add_includes_amd64_linux) -m64 -g
+ @PREFERRED_STACK_BOUNDARY@ $(AM_CFLAGS_BASE)
+AM_CCASFLAGS_AMD64_LINUX =3D $(add_includes_amd64_linux) @FLAG_M64@ -g
=20
AM_FLAG_M3264_PPC32_LINUX =3D @FLAG_M32@
AM_CPPFLAGS_PPC32_LINUX =3D $(add_includes_ppc32_linux)
@@ -26,8 +26,20 @@
AM_FLAG_M3264_PPC64_LINUX =3D @FLAG_M64@
AM_CPPFLAGS_PPC64_LINUX =3D $(add_includes_ppc64_linux)
AM_CFLAGS_PPC64_LINUX =3D $(WERROR) @FLAG_M64@ $(AM_CFLAGS_BASE)
-AM_CCASFLAGS_PPC64_LINUX =3D $(add_includes_ppc64_linux) -Wa,-maltivec =
-m64 -g
+AM_CCASFLAGS_PPC64_LINUX =3D $(add_includes_ppc64_linux) -Wa,-maltivec =
@FLAG_M64@ -g
=20
+AM_FLAG_M3264_PPC32_AIX5 =3D @FLAG_MAIX32@
+AM_CPPFLAGS_PPC32_AIX5 =3D $(add_includes_ppc32_aix5)
+AM_CFLAGS_PPC32_AIX5 =3D $(WERROR) @FLAG_MAIX32@ -mcpu=3Dpowerpc $(=
AM_CFLAGS_BASE)
+AM_CCASFLAGS_PPC32_AIX5 =3D $(add_includes_ppc32_aix5) \
+ @FLAG_MAIX32@ -mcpu=3Dpowerpc -g
+
+AM_FLAG_M3264_PPC64_AIX5 =3D @FLAG_MAIX64@
+AM_CPPFLAGS_PPC64_AIX5 =3D $(add_includes_ppc64_aix5)
+AM_CFLAGS_PPC64_AIX5 =3D $(WERROR) @FLAG_MAIX64@ -mcpu=3Dpowerpc64 =
$(AM_CFLAGS_BASE)
+AM_CCASFLAGS_PPC64_AIX5 =3D $(add_includes_ppc64_aix5) \
+ @FLAG_MAIX64@ -mcpu=3Dpowerpc64 -g
+
# Flags for the primary target. These must be used to build the
# regtests and performance tests. In fact, these must be used to
# build anything which is built only once on a dual-arch build.
@@ -36,3 +48,21 @@
AM_CPPFLAGS_PRI =3D $(AM_CPPFLAGS_@VG_PLATFORM_PRI@)
AM_CFLAGS_PRI =3D $(AM_CFLAGS_@VG_PLATFORM_PRI@)
AM_CCASFLAGS_PRI =3D $(AM_CCASFLAGS_@VG_PLATFORM_PRI@)
+
+if VGP_HAVE_SECONDARY
+ AM_FLAG_M3264_SEC =3D $(AM_FLAG_M3264_@VG_PLATFORM_SEC@)
+else
+ AM_FLAG_M3264_SEC =3D=20
+endif
+
+
+# Baseline link flags for making dynamic shared objects.
+#
+PRELOAD_LDFLAGS_COMMON_LINUX =3D -nostdlib -shared -Wl,-z,interpose,-z,i=
nitfirst
+PRELOAD_LDFLAGS_COMMON_AIX5 =3D -nostdlib -shared -Wl,-G -Wl,-bnogc
+PRELOAD_LDFLAGS_X86_LINUX =3D $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M3=
2@
+PRELOAD_LDFLAGS_AMD64_LINUX =3D $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M6=
4@
+PRELOAD_LDFLAGS_PPC32_LINUX =3D $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M3=
2@
+PRELOAD_LDFLAGS_PPC64_LINUX =3D $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M6=
4@
+PRELOAD_LDFLAGS_PPC32_AIX5 =3D $(PRELOAD_LDFLAGS_COMMON_AIX5) @FLAG_MA=
IX32@
+PRELOAD_LDFLAGS_PPC64_AIX5 =3D $(PRELOAD_LDFLAGS_COMMON_AIX5) @FLAG_MA=
IX64@
Modified: trunk/Makefile.install.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/Makefile.install.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/Makefile.install.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -19,7 +19,7 @@
done ; \
fi ; \
if [ -n "$(noinst_LIBRARIES)" ] ; then \
- for f in $(noinst_LIBRARIES); do \
+ for f in $(noinst_LIBRARIES) expr_wont_match_me; do \
if expr match $$f libcoregrind_ > /dev/null ; then \
pU=3D`echo $$f | sed -e 's/libcoregrind_//g' -e 's/\.a//g'` ; \
pD=3D`echo $$pU | sed -e 's/_/-/g'` ; \
Modified: trunk/Makefile.tool-flags.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/Makefile.tool-flags.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/Makefile.tool-flags.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -22,4 +22,16 @@
-DVGO_linux=3D1 \
-DVGP_ppc64_linux=3D1
=20
+add_includes_ppc32_aix5 =3D -I$(top_srcdir)/include \
+ -I@VEX_DIR@/pub \
+ -DVGA_ppc32=3D1 \
+ -DVGO_aix5=3D1 \
+ -DVGP_ppc32_aix5=3D1
+
+add_includes_ppc64_aix5 =3D -I$(top_srcdir)/include \
+ -I@VEX_DIR@/pub \
+ -DVGA_ppc64=3D1 \
+ -DVGO_aix5=3D1 \
+ -DVGP_ppc64_aix5=3D1
+
include $(top_srcdir)/Makefile.flags.am
Modified: trunk/Makefile.tool.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/Makefile.tool.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/Makefile.tool.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -18,6 +18,12 @@
LIBREPLACEMALLOC_PPC64_LINUX =3D \
$(top_builddir)/coregrind/libreplacemalloc_toolpreload_ppc64_linux.a
=20
+LIBREPLACEMALLOC_PPC32_AIX5 =3D \
+ $(top_builddir)/coregrind/libreplacemalloc_toolpreload_ppc32_aix5.a
+
+LIBREPLACEMALLOC_PPC64_AIX5 =3D \
+ $(top_builddir)/coregrind/libreplacemalloc_toolpreload_ppc64_aix5.a
+
COREGRIND_LIBS_X86_LINUX =3D \
$(top_builddir)/coregrind/libcoregrind_x86_linux.a \
@VEX_DIR@/libvex_x86_linux.a
@@ -34,58 +40,84 @@
$(top_builddir)/coregrind/libcoregrind_ppc64_linux.a \
@VEX_DIR@/libvex_ppc64_linux.a
=20
+COREGRIND_LIBS_PPC32_AIX5 =3D \
+ $(top_builddir)/coregrind/libcoregrind_ppc32_aix5.a \
+ @VEX_DIR@/libvex_ppc32_aix5.a
+
+COREGRIND_LIBS_PPC64_AIX5 =3D \
+ $(top_builddir)/coregrind/libcoregrind_ppc64_aix5.a \
+ @VEX_DIR@/libvex_ppc64_aix5.a
+
##.PHONY: @VEX_DIR@/libvex.a
=20
@VEX_DIR@/libvex_x86_linux.a: @VEX_DIR@/priv/main/vex_svnversion.h
- $(MAKE) -C @VEX_DIR@ CC=3D"$(CC)" libvex_x86_linux.a \
+ $(MAKE) -C @VEX_DIR@ CC=3D"$(CC)" AR=3D"$(AR)" \
+ libvex_x86_linux.a \
EXTRA_CFLAGS=3D"$(AM_CFLAGS_X86_LINUX) @FLAG_WDECL_AFTER_STMT@"
=20
@VEX_DIR@/libvex_amd64_linux.a: @VEX_DIR@/priv/main/vex_svnversion.h
- $(MAKE) -C @VEX_DIR@ CC=3D"$(CC)" libvex_amd64_linux.a \
+ $(MAKE) -C @VEX_DIR@ CC=3D"$(CC)" AR=3D"$(AR)" \
+ libvex_amd64_linux.a \
EXTRA_CFLAGS=3D"$(AM_CFLAGS_AMD64_LINUX) @FLAG_WDECL_AFTER_STMT@"
=20
@VEX_DIR@/libvex_ppc32_linux.a: @VEX_DIR@/priv/main/vex_svnversion.h
- $(MAKE) -C @VEX_DIR@ CC=3D"$(CC)" libvex_ppc32_linux.a \
+ $(MAKE) -C @VEX_DIR@ CC=3D"$(CC)" AR=3D"$(AR)" \
+ libvex_ppc32_linux.a \
EXTRA_CFLAGS=3D"$(AM_CFLAGS_PPC32_LINUX) @FLAG_WDECL_AFTER_STMT@"
=20
@VEX_DIR@/libvex_ppc64_linux.a: @VEX_DIR@/priv/main/vex_svnversion.h
- $(MAKE) -C @VEX_DIR@ CC=3D"$(CC)" libvex_ppc64_linux.a \
+ $(MAKE) -C @VEX_DIR@ CC=3D"$(CC)" AR=3D"$(AR)" \
+ libvex_ppc64_linux.a \
EXTRA_CFLAGS=3D"$(AM_CFLAGS_PPC64_LINUX) @FLAG_WDECL_AFTER_STMT@"
=20
+@VEX_DIR@/libvex_ppc32_aix5.a: @VEX_DIR@/priv/main/vex_svnversion.h
+ $(MAKE) -C @VEX_DIR@ CC=3D"$(CC)" AR=3D"$(AR) -X32" \
+ libvex_ppc32_aix5.a \
+ EXTRA_CFLAGS=3D"$(AM_CFLAGS_PPC32_AIX5) @FLAG_WDECL_AFTER_STMT@"
+
+@VEX_DIR@/libvex_ppc64_aix5.a: @VEX_DIR@/priv/main/vex_svnversion.h
+ $(MAKE) -C @VEX_DIR@ CC=3D"$(CC)" AR=3D"$(AR) -X64" \
+ libvex_ppc64_aix5.a \
+ EXTRA_CFLAGS=3D"$(AM_CFLAGS_PPC64_AIX5) @FLAG_WDECL_AFTER_STMT@"
+
@VEX_DIR@/priv/main/vex_svnversion.h:
$(MAKE) -C @VEX_DIR@ CC=3D"$(CC)" version
=20
TOOL_LDADD_COMMON =3D -lgcc
-TOOL_LDFLAGS_COMMON =3D -static \
+TOOL_LDFLAGS_COMMON_LINUX =3D -static \
-Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \
-nodefaultlibs -nostartfiles -u _start
+TOOL_LDFLAGS_COMMON_AIX5 =3D -static -Wl,-e_start_valgrind
=20
+
TOOL_LDADD_X86_LINUX =3D $(COREGRIND_LIBS_X86_LINUX) $(TOOL_LDADD_COMMON=
)
TOOL_LDFLAGS_X86_LINUX =3D \
- $(TOOL_LDFLAGS_COMMON) @FLAG_M32@ \
+ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ \
-Wl,-T,$(top_builddir)/valt_load_address_x86_linux.lds
=20
TOOL_LDADD_AMD64_LINUX =3D $(COREGRIND_LIBS_AMD64_LINUX) $(TOOL_LDADD_CO=
MMON)
TOOL_LDFLAGS_AMD64_LINUX =3D \
- $(TOOL_LDFLAGS_COMMON) -m64 \
+ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ \
-Wl,-T,$(top_builddir)/valt_load_address_amd64_linux.lds
=20
TOOL_LDADD_PPC32_LINUX =3D $(COREGRIND_LIBS_PPC32_LINUX) $(TOOL_LDADD_CO=
MMON)
TOOL_LDFLAGS_PPC32_LINUX =3D \
- $(TOOL_LDFLAGS_COMMON) @FLAG_M32@ \
+ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M32@ \
-Wl,-T,$(top_builddir)/valt_load_address_ppc32_linux.lds
=20
TOOL_LDADD_PPC64_LINUX =3D $(COREGRIND_LIBS_PPC64_LINUX) $(TOOL_LDADD_CO=
MMON)
TOOL_LDFLAGS_PPC64_LINUX =3D \
- $(TOOL_LDFLAGS_COMMON) -m64 \
+ $(TOOL_LDFLAGS_COMMON_LINUX) @FLAG_M64@ \
-Wl,-T,$(top_builddir)/valt_load_address_ppc64_linux.lds
=20
-PRELOAD_LDFLAGS_COMMON =3D -nostdlib -shared -Wl,-z,interpose,-z,initfir=
st
-PRELOAD_LDFLAGS_X86_LINUX =3D $(PRELOAD_LDFLAGS_COMMON) @FLAG_M32@
-PRELOAD_LDFLAGS_AMD64_LINUX =3D $(PRELOAD_LDFLAGS_COMMON) -m64
-PRELOAD_LDFLAGS_PPC32_LINUX =3D $(PRELOAD_LDFLAGS_COMMON) @FLAG_M32@
-PRELOAD_LDFLAGS_PPC64_LINUX =3D $(PRELOAD_LDFLAGS_COMMON) -m64
+TOOL_LDADD_PPC32_AIX5 =3D $(COREGRIND_LIBS_PPC32_AIX5) $(TOOL_LDADD_COMM=
ON)
+TOOL_LDFLAGS_PPC32_AIX5 =3D \
+ $(TOOL_LDFLAGS_COMMON_AIX5) @FLAG_MAIX32@
=20
+TOOL_LDADD_PPC64_AIX5 =3D $(COREGRIND_LIBS_PPC64_AIX5) $(TOOL_LDADD_COMM=
ON)
+TOOL_LDFLAGS_PPC64_AIX5 =3D \
+ $(TOOL_LDFLAGS_COMMON_AIX5) @FLAG_MAIX64@ -Wl,-bbigtoc
+
LIBREPLACEMALLOC_LDFLAGS_X86_LINUX =3D \
-Wl,--whole-archive \
$(LIBREPLACEMALLOC_X86_LINUX) \
@@ -102,3 +134,7 @@
-Wl,--whole-archive \
$(LIBREPLACEMALLOC_PPC64_LINUX) \
-Wl,--no-whole-archive
+LIBREPLACEMALLOC_LDFLAGS_PPC32_AIX5 =3D \
+ $(LIBREPLACEMALLOC_PPC32_AIX5)
+LIBREPLACEMALLOC_LDFLAGS_PPC64_AIX5 =3D \
+ $(LIBREPLACEMALLOC_PPC64_AIX5)
Modified: trunk/auxprogs/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/auxprogs/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/auxprogs/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -6,6 +6,8 @@
noinst_SCRIPTS =3D gen-mdg DotToScc.hs primes.c \
gsl16test gsl16-badfree.patch gsl16-wavelet.patch \
ppcfround.c ppc64shifts.c libmpiwrap.c mpiwrap_type_test.c \
+ aix5_VKI_info.c libmpiwrap_aix5.exp \
+ aix5_proc_self_sysent.c \
posixtestsuite-1.5.1-diff-results \
posixtestsuite-1.5.1-diff.txt
=20
@@ -26,43 +28,103 @@
=20
=20
#------------------------- mpi wrappers -----------------------
-# Build libmpiwrap.so for the primary target only.
+# Build libmpiwrap.so for the primary target, and for the secondary
+# target if relevant.
#
# This is really horrible.
#
-# Don't let automake install this, since it puts it in the
-# wrong place. Instead install it ourselves in the right
+# Don't let automake install this, since it puts the .so's in the
+# wrong place. Instead install them ourselves in the right
# place using the install-exec-local target below.
#
# Also, automake isn't good at supporting non-$(CC) compilers.
# But we need to use $(MPI_CC) here. Hence the nasty hack of
-# directly saying how to build libmpiwrap.so, instead of
+# directly saying how to build libmpiwrap-*.so, instead of
# using automake's standard gunk.
#
-if BUILD_MPIWRAP
-noinst_PROGRAMS =3D libmpiwrap.so
-#libmpiwrap_so_SOURCES =3D mpiwrap.c
-#libmpiwrap_so_CFLAGS =3D $(AM_FLAG_M3264_PRI) \
-# -g -O -fPIC -fno-omit-frame-pointer \
-# -I../include -I@MPI_PREFIX@/include
-#libmpiwrap_so_LDFLAGS =3D $(AM_FLAG_M3264_PRI) -g -shared
-#
-# Note re leading '-'s: tells GNU make to keep going even if command fai=
ls
-#
-libmpiwrap.so: libmpiwrap.c
- -$(MPI_CC) -g -O -fno-omit-frame-pointer -Wall -fPIC -shared \
+if VGO_AIX5
+ HACKY_FLAGS_PRI =3D -g -O -bE:libmpiwrap_aix5.exp -bM:SRE -bnoentry \
+ -qflag=3Dw:w \
+ `echo $(AM_FLAG_M3264_PRI) | sed s/maix/q/g`
+ HACKY_FLAGS_SEC =3D -g -O -bE:libmpiwrap_aix5.exp -bM:SRE -bnoentry \
+ -qflag=3Dw:w \
+ `echo $(AM_FLAG_M3264_SEC) | sed s/maix/q/g`
+else
+ HACKY_FLAGS_PRI =3D -g -O -fno-omit-frame-pointer -Wall -fpic -shared \
+ $(AM_FLAG_M3264_PRI)
+ HACKY_FLAGS_SEC =3D -g -O -fno-omit-frame-pointer -Wall -fpic -shared \
+ $(AM_FLAG_M3264_SEC)
+endif
+
+
+## First, we have to say how to build the .so's ..
+##
+noinst_PROGRAMS =3D
+if BUILD_MPIWRAP_PRI
+noinst_PROGRAMS +=3D libmpiwrap-@VG_PLATFORM_PRI@.so
+libmpiwrap-@VG_PLATFORM_PRI@.so: libmpiwrap.c
+ $(MPI_CC) $(HACKY_FLAGS_PRI) \
-I../include \
- $(AM_FLAG_M3264_PRI) \
- -o libmpiwrap.so libmpiwrap.c
+ -o libmpiwrap-@VG_PLATFORM_PRI@.so libmpiwrap.c
+endif
+if BUILD_MPIWRAP_SEC
+noinst_PROGRAMS +=3D libmpiwrap-@VG_PLATFORM_SEC@.so
+libmpiwrap-@VG_PLATFORM_SEC@.so: libmpiwrap.c
+ $(MPI_CC) $(HACKY_FLAGS_SEC) \
+ -I../include \
+ -o libmpiwrap-@VG_PLATFORM_SEC@.so libmpiwrap.c
+endif
=20
+
+## And here we say how to install them.
+##
+# The following install hack is serialised by "libmpiwrap.so".
+# Hence force -j 1.
+.NOTPARALLEL:
+
install-exec-local:
+if BUILD_MPIWRAP_PRI
# convert (eg) X86_LINUX to x86-linux
# really should use sed here, rather than assume tr is available
pD=3D`echo @VG_PLATFORM_PRI@ | tr A-Z_ a-z-` ; \
$(mkinstalldirs) $(DESTDIR)$(valdir)/$$pD;
- -pD=3D`echo @VG_PLATFORM_PRI@ | tr A-Z_ a-z-` ; \
- $(INSTALL_PROGRAM) ./libmpiwrap.so $(DESTDIR)$(valdir)/$$pD
+ rm -f ./libmpiwrap.so; \
+ cp ./libmpiwrap-@VG_PLATFORM_PRI@.so ./libmpiwrap.so; \
+ $(INSTALL_PROGRAM) ./libmpiwrap.so \
+ $(DESTDIR)$(valdir)/$$pD; \
+ rm -f ./libmpiwrap.so
endif
+if BUILD_MPIWRAP_SEC
+ pD=3D`echo @VG_PLATFORM_SEC@ | tr A-Z_ a-z-` ; \
+ $(mkinstalldirs) $(DESTDIR)$(valdir)/$$pD; \
+ rm -f ./libmpiwrap.so; \
+ cp ./libmpiwrap-@VG_PLATFORM_SEC@.so ./libmpiwrap.so; \
+ $(INSTALL_PROGRAM) ./libmpiwrap.so \
+ $(DESTDIR)$(valdir)/$$pD; \
+ rm -f ./libmpiwrap.so
+endif
+
+
+## And some hacks for 'make dist'
+## It would seem that using nodist_SOURCES is the right fix, but
+## I can't figure out how to do it.
+##
+if BUILD_MPIWRAP_PRI
+#nodist_SOURCES =3D libmpiwrap-@VG_PLATFORM_PRI@.c
+libmpiwrap-@VG_PLATFORM_PRI@.c:
+ rm -f libmpiwrap-@VG_PLATFORM_PRI@.c
+ touch libmpiwrap-@VG_PLATFORM_PRI@.c
+libmpiwrap-.c:
+ rm -f libmpiwrap-.c
+ touch libmpiwrap-.c
+endif
+if BUILD_MPIWRAP_SEC
+#nodist_SOURCES =3D libmpiwrap-@VG_PLATFORM_SEC@.c
+libmpiwrap-@VG_PLATFORM_SEC@.c:
+ rm -f libmpiwrap-@VG_PLATFORM_SEC@.c
+ touch libmpiwrap-@VG_PLATFORM_SEC@.c
+endif
+
#
#----------------------------------------------------------
=20
Modified: trunk/cachegrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cachegrind/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/cachegrind/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -5,18 +5,24 @@
noinst_HEADERS =3D cg_arch.h cg_sim.c
=20
noinst_PROGRAMS =3D=20
-if VG_X86_LINUX
+if VGP_X86_LINUX
noinst_PROGRAMS +=3D cachegrind-x86-linux
endif
-if VG_AMD64_LINUX
+if VGP_AMD64_LINUX
noinst_PROGRAMS +=3D cachegrind-amd64-linux
endif
-if VG_PPC32_LINUX
+if VGP_PPC32_LINUX
noinst_PROGRAMS +=3D cachegrind-ppc32-linux
endif
-if VG_PPC64_LINUX
+if VGP_PPC64_LINUX
noinst_PROGRAMS +=3D cachegrind-ppc64-linux
endif
+if VGP_PPC32_AIX5
+noinst_PROGRAMS +=3D cachegrind-ppc32-aix5
+endif
+if VGP_PPC64_AIX5
+noinst_PROGRAMS +=3D cachegrind-ppc64-aix5
+endif
=20
CACHEGRIND_SOURCES_COMMON =3D cg_main.c
CACHEGRIND_SOURCES_X86 =3D cg-x86.c
@@ -51,3 +57,17 @@
cachegrind_ppc64_linux_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC64_LINUX)
cachegrind_ppc64_linux_LDADD =3D $(TOOL_LDADD_PPC64_LINUX)
cachegrind_ppc64_linux_LDFLAGS =3D $(TOOL_LDFLAGS_PPC64_LINUX)
+
+cachegrind_ppc32_aix5_SOURCES =3D $(CACHEGRIND_SOURCES_COMMON) $(CA=
CHEGRIND_SOURCES_PPC32)
+cachegrind_ppc32_aix5_CPPFLAGS =3D $(AM_CPPFLAGS_PPC32_AIX5)
+cachegrind_ppc32_aix5_CFLAGS =3D $(AM_CFLAGS_PPC32_AIX5)
+cachegrind_ppc32_aix5_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC32_AIX5)
+cachegrind_ppc32_aix5_LDADD =3D $(TOOL_LDADD_PPC32_AIX5)
+cachegrind_ppc32_aix5_LDFLAGS =3D $(TOOL_LDFLAGS_PPC32_AIX5)
+
+cachegrind_ppc64_aix5_SOURCES =3D $(CACHEGRIND_SOURCES_COMMON) $(CA=
CHEGRIND_SOURCES_PPC64)
+cachegrind_ppc64_aix5_CPPFLAGS =3D $(AM_CPPFLAGS_PPC64_AIX5)
+cachegrind_ppc64_aix5_CFLAGS =3D $(AM_CFLAGS_PPC64_AIX5)
+cachegrind_ppc64_aix5_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC64_AIX5)
+cachegrind_ppc64_aix5_LDADD =3D $(TOOL_LDADD_PPC64_AIX5)
+cachegrind_ppc64_aix5_LDFLAGS =3D $(TOOL_LDFLAGS_PPC64_AIX5)
Modified: trunk/cachegrind/tests/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cachegrind/tests/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/cachegrind/tests/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -3,16 +3,16 @@
include $(top_srcdir)/Makefile.flags.am
=20
SUBDIRS =3D .
-if VG_X86_LINUX
+if VGP_X86_LINUX
SUBDIRS +=3D x86
endif
-if VG_AMD64_LINUX
+if VGP_AMD64_LINUX
SUBDIRS +=3D amd64
endif
-if VG_PPC32_LINUX
+if VGP_PPC32_LINUX
SUBDIRS +=3D ppc32
endif
-if VG_PPC64_LINUX
+if VGP_PPC64_LINUX
SUBDIRS +=3D ppc64
endif
=20
@@ -37,3 +37,14 @@
myprint_so_SOURCES =3D myprint.c
myprint_so_LDFLAGS =3D $(AM_FLAG_M3264_PRI) -shared -fPIC
myprint_so_CFLAGS =3D $(AM_FLAG_M3264_PRI) -fPIC
+
+if VGP_PPC32_AIX5
+if VGP_PPC64_AIX5
+else
+ # persuade the AIX linker not to junk apparently unused
+ # function descriptors. Unfortunately -Wl,-G -Wl,-bnogc
+ # produces a link error on 64-bit AIX, hence only 32-bit
+ # gets these flags.
+ wrap5_LDFLAGS =3D $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc
+endif
+endif
Modified: trunk/callgrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/callgrind/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/callgrind/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -5,18 +5,24 @@
noinst_HEADERS =3D global.h costs.h events.h
=20
noinst_PROGRAMS =3D=20
-if VG_X86_LINUX
+if VGP_X86_LINUX
noinst_PROGRAMS +=3D callgrind-x86-linux
endif
-if VG_AMD64_LINUX
+if VGP_AMD64_LINUX
noinst_PROGRAMS +=3D callgrind-amd64-linux
endif
-if VG_PPC32_LINUX
+if VGP_PPC32_LINUX
noinst_PROGRAMS +=3D callgrind-ppc32-linux
endif
-if VG_PPC64_LINUX
+if VGP_PPC64_LINUX
noinst_PROGRAMS +=3D callgrind-ppc64-linux
endif
+if VGP_PPC32_AIX5
+noinst_PROGRAMS +=3D callgrind-ppc32-aix5
+endif
+if VGP_PPC64_AIX5
+noinst_PROGRAMS +=3D callgrind-ppc64-aix5
+endif
=20
CALLGRIND_SOURCES_COMMON =3D main.c events.c bb.c clo.c \
costs.c bbcc.c command.c debug.c fn.c \
@@ -58,7 +64,19 @@
callgrind_ppc64_linux_LDADD =3D $(TOOL_LDADD_PPC64_LINUX)
callgrind_ppc64_linux_LDFLAGS =3D $(TOOL_LDFLAGS_PPC64_LINUX)
=20
+callgrind_ppc32_aix5_SOURCES =3D $(CALLGRIND_SOURCES_COMMON) $(CALL=
GRIND_SOURCES_PPC32)
clincludedir =3D $(includedir)/valgrind
+callgrind_ppc32_aix5_CPPFLAGS =3D $(AM_CPPFLAGS_PPC32_AIX5)
+callgrind_ppc32_aix5_CFLAGS =3D $(CALLGRIND_CFLAGS_COMMON) $(AM_CF=
LAGS_PPC32_AIX5)
+callgrind_ppc32_aix5_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC32_AIX5)
+callgrind_ppc32_aix5_LDADD =3D $(TOOL_LDADD_PPC32_AIX5)
+callgrind_ppc32_aix5_LDFLAGS =3D $(TOOL_LDFLAGS_PPC32_AIX5)
=20
+callgrind_ppc64_aix5_SOURCES =3D $(CALLGRIND_SOURCES_COMMON) $(CALL=
GRIND_SOURCES_PPC64)
+callgrind_ppc64_aix5_CPPFLAGS =3D $(AM_CPPFLAGS_PPC64_AIX5)
clinclude_HEADERS =3D \
callgrind.h
+callgrind_ppc64_aix5_CFLAGS =3D $(CALLGRIND_CFLAGS_COMMON) $(AM_CF=
LAGS_PPC64_AIX5)
+callgrind_ppc64_aix5_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC64_AIX5)
+callgrind_ppc64_aix5_LDADD =3D $(TOOL_LDADD_PPC64_AIX5)
+callgrind_ppc64_aix5_LDFLAGS =3D $(TOOL_LDFLAGS_PPC64_AIX5)
Modified: trunk/coregrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/coregrind/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -12,23 +12,31 @@
AM_CPPFLAGS_AMD64_LINUX +=3D -DVG_LIBDIR=3D"\"$(valdir)"\"
AM_CPPFLAGS_PPC32_LINUX +=3D -DVG_LIBDIR=3D"\"$(valdir)"\"
AM_CPPFLAGS_PPC64_LINUX +=3D -DVG_LIBDIR=3D"\"$(valdir)"\"
+AM_CPPFLAGS_PPC32_AIX5 +=3D -DVG_LIBDIR=3D"\"$(valdir)"\"
+AM_CPPFLAGS_PPC64_AIX5 +=3D -DVG_LIBDIR=3D"\"$(valdir)"\"
=20
=20
default.supp: $(SUPP_FILES)
=20
noinst_LIBRARIES =3D
-if VG_X86_LINUX
+if VGP_X86_LINUX
noinst_LIBRARIES +=3D libcoregrind_x86_linux.a libreplacemalloc_toolprel=
oad_x86_linux.a
endif
-if VG_AMD64_LINUX
+if VGP_AMD64_LINUX
noinst_LIBRARIES +=3D libcoregrind_amd64_linux.a libreplacemalloc_toolpr=
eload_amd64_linux.a
endif
-if VG_PPC32_LINUX
+if VGP_PPC32_LINUX
noinst_LIBRARIES +=3D libcoregrind_ppc32_linux.a libreplacemalloc_toolpr=
eload_ppc32_linux.a
endif
-if VG_PPC64_LINUX
+if VGP_PPC64_LINUX
noinst_LIBRARIES +=3D libcoregrind_ppc64_linux.a libreplacemalloc_toolpr=
eload_ppc64_linux.a
endif
+if VGP_PPC32_AIX5
+noinst_LIBRARIES +=3D libcoregrind_ppc32_aix5.a libreplacemalloc_toolpre=
load_ppc32_aix5.a
+endif
+if VGP_PPC64_AIX5
+noinst_LIBRARIES +=3D libcoregrind_ppc64_aix5.a libreplacemalloc_toolpre=
load_ppc64_aix5.a
+endif
=20
#------------------------- launcher -----------------------
# Build the launcher (valgrind) for the primary target only.
@@ -36,9 +44,16 @@
bin_PROGRAMS =3D \
valgrind
=20
+if VGO_AIX5
valgrind_SOURCES =3D \
- launcher.c \
+ launcher-aix5.c \
+ m_debuglog.c \
+ m_vkiscnums.c
+else
+valgrind_SOURCES =3D \
+ launcher-linux.c \
m_debuglog.c
+endif
=20
valgrind_CPPFLAGS =3D $(AM_CPPFLAGS_PRI)
valgrind_CFLAGS =3D $(AM_CFLAGS_PRI)
@@ -49,18 +64,24 @@
=20
=20
noinst_PROGRAMS =3D
-if VG_X86_LINUX
+if VGP_X86_LINUX
noinst_PROGRAMS +=3D vgpreload_core-x86-linux.so
endif
-if VG_AMD64_LINUX
+if VGP_AMD64_LINUX
noinst_PROGRAMS +=3D vgpreload_core-amd64-linux.so
endif
-if VG_PPC32_LINUX
+if VGP_PPC32_LINUX
noinst_PROGRAMS +=3D vgpreload_core-ppc32-linux.so
endif
-if VG_PPC64_LINUX
+if VGP_PPC64_LINUX
noinst_PROGRAMS +=3D vgpreload_core-ppc64-linux.so
endif
+if VGP_PPC32_AIX5
+noinst_PROGRAMS +=3D vgpreload_core-ppc32-aix5.so
+endif
+if VGP_PPC64_AIX5
+noinst_PROGRAMS +=3D vgpreload_core-ppc64-aix5.so
+endif
=20
noinst_HEADERS =3D \
pub_core_aspacemgr.h \
@@ -116,6 +137,7 @@
m_debuginfo/priv_readstabs.h \
m_debuginfo/priv_readdwarf.h \
m_debuginfo/priv_readelf.h \
+ m_debuginfo/priv_readxcoff.h \
m_demangle/ansidecl.h \
m_demangle/dyn-string.h \
m_demangle/demangle.h \
@@ -125,8 +147,11 @@
m_syswrap/priv_syswrap-generic.h \
m_syswrap/priv_syswrap-linux.h \
m_syswrap/priv_syswrap-linux-variants.h \
+ m_syswrap/priv_syswrap-aix5.h \
m_syswrap/priv_syswrap-main.h \
- m_aspacemgr/priv_aspacemgr.h
+ m_aspacemgr/priv_aspacemgr.h \
+ launcher-aix5-bootblock.h \
+ m_initimg/simple_huffman.c
=20
BUILT_SOURCES =3D=20
CLEANFILES =3D=20
@@ -169,9 +194,6 @@
m_vkiscnums.c \
m_aspacemgr/aspacemgr-common.c \
m_debuginfo/storage.c \
- m_debuginfo/readdwarf.c \
- m_debuginfo/readstabs.c \
- m_debuginfo/readelf.c \
m_debuginfo/debuginfo.c \
m_demangle/cp-demangle.c \
m_demangle/cplus-dem.c \
@@ -181,7 +203,6 @@
m_replacemalloc/replacemalloc_core.c \
m_scheduler/scheduler.c \
m_scheduler/sema.c \
- m_syswrap/syswrap-generic.c \
m_syswrap/syswrap-main.c
=20
COREGRIND_LINUX_SOURCE =3D \
@@ -189,8 +210,18 @@
m_syswrap/syswrap-linux.c \
m_syswrap/syswrap-linux-variants.c \
m_aspacemgr/aspacemgr-linux.c \
- m_initimg/initimg-linux.c
+ m_initimg/initimg-linux.c \
+ m_debuginfo/readelf.c \
+ m_debuginfo/readdwarf.c \
+ m_debuginfo/readstabs.c \
+ m_syswrap/syswrap-generic.c
=20
+COREGRIND_AIX5_SOURCE =3D \
+ m_aspacemgr/aspacemgr-aix5.c \
+ m_initimg/initimg-aix5.c \
+ m_debuginfo/readxcoff.c \
+ m_syswrap/syswrap-aix5.c
+
libcoregrind_x86_linux_a_SOURCES =3D \
$(COREGRIND_SOURCES_COMMON) \
$(COREGRIND_LINUX_SOURCE) \
@@ -243,6 +274,35 @@
libcoregrind_ppc64_linux_a_CFLAGS =3D $(AM_CFLAGS_PPC64_LINUX)
libcoregrind_ppc64_linux_a_CCASFLAGS =3D $(AM_CCASFLAGS_PPC64_LINUX)
=20
+libcoregrind_ppc32_aix5_a_SOURCES =3D \
+ $(COREGRIND_SOURCES_COMMON) \
+ $(COREGRIND_AIX5_SOURCE) \
+ m_coredump/coredump-ppc32-aix5.c \
+ m_dispatch/dispatch-ppc32-aix5.S \
+ m_sigframe/sigframe-ppc32-aix5.c \
+ m_syswrap/syscall-ppc32-aix5.S \
+ m_syswrap/syswrap-ppc32-aix5.c
+
+libcoregrind_ppc32_aix5_a_CPPFLAGS =3D $(AM_CPPFLAGS_PPC32_AIX5)
+libcoregrind_ppc32_aix5_a_CFLAGS =3D $(AM_CFLAGS_PPC32_AIX5)
+libcoregrind_ppc32_aix5_a_CCASFLAGS =3D $(AM_CCASFLAGS_PPC32_AIX5)
+libcoregrind_ppc32_aix5_a_AR =3D $(AR) -X32 cru
+
+libcoregrind_ppc64_aix5_a_SOURCES =3D \
+ $(COREGRIND_SOURCES_COMMON) \
+ $(COREGRIND_AIX5_SOURCE) \
+ m_coredump/coredump-ppc64-aix5.c \
+ m_dispatch/dispatch-ppc64-aix5.S \
+ m_sigframe/sigframe-ppc64-aix5.c \
+ m_syswrap/syscall-ppc64-aix5.S \
+ m_syswrap/syswrap-ppc64-aix5.c
+
+libcoregrind_ppc64_aix5_a_CPPFLAGS =3D $(AM_CPPFLAGS_PPC64_AIX5)
+libcoregrind_ppc64_aix5_a_CFLAGS =3D $(AM_CFLAGS_PPC64_AIX5)
+libcoregrind_ppc64_aix5_a_CCASFLAGS =3D $(AM_CCASFLAGS_PPC64_AIX5)
+libcoregrind_ppc64_aix5_a_AR =3D $(AR) -X64 cru
+
+
libreplacemalloc_toolpreload_x86_linux_a_SOURCES =3D m_replacemalloc/vg_=
replace_malloc.c
libreplacemalloc_toolpreload_x86_linux_a_CPPFLAGS =3D $(AM_CPPFLAGS_X86_=
LINUX)
libreplacemalloc_toolpreload_x86_linux_a_CFLAGS =3D $(AM_CFLAGS_X86_LINU=
X) -fpic -fno-omit-frame-pointer
@@ -259,14 +319,28 @@
libreplacemalloc_toolpreload_ppc64_linux_a_CPPFLAGS =3D $(AM_CPPFLAGS_PP=
C64_LINUX)
libreplacemalloc_toolpreload_ppc64_linux_a_CFLAGS =3D $(AM_CFLAGS_PPC64_=
LINUX) -fpic -fno-omit-frame-pointer
=20
+libreplacemalloc_toolpreload_ppc32_aix5_a_SOURCES =3D m_replacemalloc/vg=
_replace_malloc.c
+libreplacemalloc_toolpreload_ppc32_aix5_a_CPPFLAGS =3D $(AM_CPPFLAGS_PPC=
32_AIX5)
+libreplacemalloc_toolpreload_ppc32_aix5_a_CFLAGS =3D $(AM_CFLAGS_PPC32_A=
IX5) -fpic -fno-omit-frame-pointer
+libreplacemalloc_toolpreload_ppc32_aix5_a_AR =3D $(AR) -X32 cru
+
+libreplacemalloc_toolpreload_ppc64_aix5_a_SOURCES =3D m_replacemalloc/vg=
_replace_malloc.c
+libreplacemalloc_toolpreload_ppc64_aix5_a_CPPFLAGS =3D $(AM_CPPFLAGS_PPC=
64_AIX5)
+libreplacemalloc_toolpreload_ppc64_aix5_a_CFLAGS =3D $(AM_CFLAGS_PPC64_A=
IX5) -fpic -fno-omit-frame-pointer
+libreplacemalloc_toolpreload_ppc64_aix5_a_AR =3D $(AR) -X64 cru
+
m_dispatch/dispatch-x86-linux.S: libvex_guest_offsets.h
m_dispatch/dispatch-amd64-linux.S: libvex_guest_offsets.h
m_dispatch/dispatch-ppc32-linux.S: libvex_guest_offsets.h
m_dispatch/dispatch-ppc64-linux.S: libvex_guest_offsets.h
+m_dispatch/dispatch-ppc32-aix5.S: libvex_guest_offsets.h
+m_dispatch/dispatch-ppc64-aix5.S: libvex_guest_offsets.h
m_syswrap/syscall-x86-linux.S: libvex_guest_offsets.h
m_syswrap/syscall-amd64-linux.S: libvex_guest_offsets.h
m_syswrap/syscall-ppc32-linux.S: libvex_guest_offsets.h
m_syswrap/syscall-ppc64-linux.S: libvex_guest_offsets.h
+m_syswrap/syscall-ppc32-aix5.S: libvex_guest_offsets.h
+m_syswrap/syscall-ppc64-aix5.S: libvex_guest_offsets.h
m_syswrap/syswrap-main.c: libvex_guest_offsets.h
=20
libvex_guest_offsets.h:
@@ -294,8 +368,18 @@
vgpreload_core_ppc64_linux_so_CFLAGS =3D $(AM_CFLAGS_PPC64_LINUX) $(AM_C=
FLAGS_PIC)
vgpreload_core_ppc64_linux_so_LDFLAGS =3D $(PRELOAD_LDFLAGS_PPC64_LINUX)
=20
+vgpreload_core_ppc32_aix5_so_SOURCES =3D $(VGPRELOAD_CORE_SOURCES_COMMON=
)
+vgpreload_core_ppc32_aix5_so_CPPFLAGS =3D $(AM_CPPFLAGS_PPC32_AIX5)
+vgpreload_core_ppc32_aix5_so_CFLAGS =3D $(AM_CFLAGS_PPC32_AIX5) $(AM_CFL=
AGS_PIC)
+vgpreload_core_ppc32_aix5_so_LDFLAGS =3D $(PRELOAD_LDFLAGS_PPC32_AIX5)
+
+vgpreload_core_ppc64_aix5_so_SOURCES =3D $(VGPRELOAD_CORE_SOURCES_COMMON=
)
+vgpreload_core_ppc64_aix5_so_CPPFLAGS =3D $(AM_CPPFLAGS_PPC64_AIX5)
+vgpreload_core_ppc64_aix5_so_CFLAGS =3D $(AM_CFLAGS_PPC64_AIX5) $(AM_CFL=
AGS_PIC)
+vgpreload_core_ppc64_aix5_so_LDFLAGS =3D $(PRELOAD_LDFLAGS_PPC64_AIX5)
+
clean-local:
- $(MAKE) -C @VEX_DIR@ CC=3D"$(CC)" clean
+ $(MAKE) -C @VEX_DIR@ CC=3D"$(CC)" AR=3D"$(AR)" clean
=20
MANUAL_DEPS =3D $(noinst_HEADERS) $(include_HEADERS)
=20
Modified: trunk/helgrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/helgrind/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/helgrind/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -1,18 +1,24 @@
include $(top_srcdir)/Makefile.tool.am
=20
noinst_PROGRAMS =3D=20
-if VG_X86_LINUX
+if VGP_X86_LINUX
noinst_PROGRAMS +=3D helgrind-x86-linux vgpreload_helgrind-x86-linux.so
endif
-if VG_AMD64_LINUX
+if VGP_AMD64_LINUX
noinst_PROGRAMS +=3D helgrind-amd64-linux vgpreload_helgrind-amd64-linux=
.so
endif
-if VG_PPC32_LINUX
+if VGP_PPC32_LINUX
noinst_PROGRAMS +=3D helgrind-ppc32-linux vgpreload_helgrind-ppc32-linux=
.so
endif
-if VG_PPC64_LINUX
+if VGP_PPC64_LINUX
noinst_PROGRAMS +=3D helgrind-ppc64-linux vgpreload_helgrind-ppc64-linux=
.so
endif
+if VGP_PPC32_AIX5
+noinst_PROGRAMS +=3D helgrind-ppc32-aix5 vgpreload_helgrind-ppc32-aix5.s=
o
+endif
+if VGP_PPC64_AIX5
+noinst_PROGRAMS +=3D helgrind-ppc64-aix5 vgpreload_helgrind-ppc64-aix5.s=
o
+endif
=20
vgpreload_helgrind_x86_linux_so_SOURCES =3D=20
vgpreload_helgrind_x86_linux_so_CPPFLAGS =3D $(AM_CPPFLAGS_X86_LINUX=
)
@@ -46,6 +52,22 @@
$(PRELOAD_LDFLAGS_PPC64_LINUX) \
$(LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX)
=20
+vgpreload_helgrind_ppc32_aix5_so_SOURCES =3D=20
+vgpreload_helgrind_ppc32_aix5_so_CPPFLAGS =3D $(AM_CPPFLAGS_PPC32_AI=
X5)
+vgpreload_helgrind_ppc32_aix5_so_CFLAGS =3D $(AM_CFLAGS_PPC32_AIX5=
) $(AM_CFLAGS_PIC)
+vgpreload_helgrind_ppc32_aix5_so_DEPENDENCIES =3D $(LIBREPLACEMALLOC_PPC=
32_AIX5)
+vgpreload_helgrind_ppc32_aix5_so_LDFLAGS =3D \
+ $(PRELOAD_LDFLAGS_PPC32_AIX5) \
+ $(LIBREPLACEMALLOC_LDFLAGS_PPC32_AIX5)
+
+vgpreload_helgrind_ppc64_aix5_so_SOURCES =3D=20
+vgpreload_helgrind_ppc64_aix5_so_CPPFLAGS =3D $(AM_CPPFLAGS_PPC64_AI=
X5)
+vgpreload_helgrind_ppc64_aix5_so_CFLAGS =3D $(AM_CFLAGS_PPC64_AIX5=
) $(AM_CFLAGS_PIC)
+vgpreload_helgrind_ppc64_aix5_so_DEPENDENCIES =3D $(LIBREPLACEMALLOC_PPC=
64_AIX5)
+vgpreload_helgrind_ppc64_aix5_so_LDFLAGS =3D \
+ $(PRELOAD_LDFLAGS_PPC64_AIX5) \
+ $(LIBREPLACEMALLOC_LDFLAGS_PPC64_AIX5)
+
HELGRIND_SOURCES_COMMON =3D hg_main.c
=20
helgrind_x86_linux_SOURCES =3D $(HELGRIND_SOURCES_COMMON)
@@ -76,6 +98,20 @@
helgrind_ppc64_linux_LDADD =3D $(TOOL_LDADD_PPC64_LINUX)
helgrind_ppc64_linux_LDFLAGS =3D $(TOOL_LDFLAGS_PPC64_LINUX)
=20
+helgrind_ppc32_aix5_SOURCES =3D $(HELGRIND_SOURCES_COMMON)
+helgrind_ppc32_aix5_CPPFLAGS =3D $(AM_CPPFLAGS_PPC32_AIX5)
+helgrind_ppc32_aix5_CFLAGS =3D $(AM_CFLAGS_PPC32_AIX5)
+helgrind_ppc32_aix5_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC32_AIX5)
+helgrind_ppc32_aix5_LDADD =3D $(TOOL_LDADD_PPC32_AIX5)
+helgrind_ppc32_aix5_LDFLAGS =3D $(TOOL_LDFLAGS_PPC32_AIX5)
+
+helgrind_ppc64_aix5_SOURCES =3D $(HELGRIND_SOURCES_COMMON)
+helgrind_ppc64_aix5_CPPFLAGS =3D $(AM_CPPFLAGS_PPC64_AIX5)
+helgrind_ppc64_aix5_CFLAGS =3D $(AM_CFLAGS_PPC64_AIX5)
+helgrind_ppc64_aix5_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC64_AIX5)
+helgrind_ppc64_aix5_LDADD =3D $(TOOL_LDADD_PPC64_AIX5)
+helgrind_ppc64_aix5_LDFLAGS =3D $(TOOL_LDFLAGS_PPC64_AIX5)
+
hgincludedir =3D $(includedir)/valgrind
=20
hginclude_HEADERS =3D helgrind.h
Modified: trunk/helgrind/tests/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/helgrind/tests/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/helgrind/tests/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -19,10 +19,14 @@
# force -gstabs, because we don't print symaddr for DWARF yet
# Sigh, gcc-3.4.3 on ppc64 generates bogus .stabs. So disable it
# for now on ppc64-linux.
-if VG_PPC64_LINUX
+if VGP_PPC64_LINUX
AM_CFLAGS =3D $(WERROR) -Winline -Wall -Wshadow -g $(AM_FLAG_M3264_=
PRI)
else
-AM_CFLAGS =3D $(WERROR) -Winline -Wall -Wshadow -gstabs $(AM_FLAG_M3264_=
PRI)
+
+# In fact -gstabs is broken on many systems now
+#AM_CFLAGS =3D $(WERROR) -Winline -Wall -Wshadow -gstabs $(AM_FLAG_M3264=
_PRI)
+AM_CFLAGS =3D $(WERROR) -Winline -Wall -Wshadow -g $(AM_FLAG_M3264_=
PRI)
+
endif
=20
LDADD =3D -lpthread
Modified: trunk/include/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/include/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -28,19 +28,22 @@
pub_tool_stacktrace.h \
pub_tool_threadstate.h \
pub_tool_tooliface.h \
+ pub_tool_vki.h \
pub_tool_vkiscnums.h \
valgrind.h \
- vki/vki-linux.h \
- vki/vki-amd64-linux.h \
- vki/vki-ppc32-linux.h \
- vki/vki-ppc64-linux.h \
- vki/vki-x86-linux.h \
vki/vki-linux.h \
vki/vki-posixtypes-amd64-linux.h \
vki/vki-posixtypes-ppc32-linux.h \
vki/vki-posixtypes-ppc64-linux.h \
vki/vki-posixtypes-x86-linux.h \
+ vki/vki-amd64-linux.h \
+ vki/vki-ppc32-aix5.h \
+ vki/vki-ppc64-aix5.h \
+ vki/vki-ppc32-linux.h \
+ vki/vki-ppc64-linux.h \
+ vki/vki-x86-linux.h \
vki/vki-scnums-amd64-linux.h \
vki/vki-scnums-ppc32-linux.h \
vki/vki-scnums-ppc64-linux.h \
- vki/vki-scnums-x86-linux.h
+ vki/vki-scnums-x86-linux.h \
+ vki/vki-scnums-aix5.h
Modified: trunk/lackey/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/lackey/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/lackey/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -1,18 +1,24 @@
include $(top_srcdir)/Makefile.tool.am
=20
noinst_PROGRAMS =3D=20
-if VG_X86_LINUX
+if VGP_X86_LINUX
noinst_PROGRAMS +=3D lackey-x86-linux
endif
-if VG_AMD64_LINUX
+if VGP_AMD64_LINUX
noinst_PROGRAMS +=3D lackey-amd64-linux
endif
-if VG_PPC32_LINUX
+if VGP_PPC32_LINUX
noinst_PROGRAMS +=3D lackey-ppc32-linux
endif
-if VG_PPC64_LINUX
+if VGP_PPC64_LINUX
noinst_PROGRAMS +=3D lackey-ppc64-linux
endif
+if VGP_PPC32_AIX5
+noinst_PROGRAMS +=3D lackey-ppc32-aix5
+endif
+if VGP_PPC64_AIX5
+noinst_PROGRAMS +=3D lackey-ppc64-aix5
+endif
=20
LACKEY_SOURCES_COMMON =3D lk_main.c
=20
@@ -43,3 +49,17 @@
lackey_ppc64_linux_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC64_LINUX)
lackey_ppc64_linux_LDADD =3D $(TOOL_LDADD_PPC64_LINUX)
lackey_ppc64_linux_LDFLAGS =3D $(TOOL_LDFLAGS_PPC64_LINUX)
+
+lackey_ppc32_aix5_SOURCES =3D $(LACKEY_SOURCES_COMMON)
+lackey_ppc32_aix5_CPPFLAGS =3D $(AM_CPPFLAGS_PPC32_AIX5)
+lackey_ppc32_aix5_CFLAGS =3D $(AM_CFLAGS_PPC32_AIX5)
+lackey_ppc32_aix5_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC32_AIX5)
+lackey_ppc32_aix5_LDADD =3D $(TOOL_LDADD_PPC32_AIX5)
+lackey_ppc32_aix5_LDFLAGS =3D $(TOOL_LDFLAGS_PPC32_AIX5)
+
+lackey_ppc64_aix5_SOURCES =3D $(LACKEY_SOURCES_COMMON)
+lackey_ppc64_aix5_CPPFLAGS =3D $(AM_CPPFLAGS_PPC64_AIX5)
+lackey_ppc64_aix5_CFLAGS =3D $(AM_CFLAGS_PPC64_AIX5)
+lackey_ppc64_aix5_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC64_AIX5)
+lackey_ppc64_aix5_LDADD =3D $(TOOL_LDADD_PPC64_AIX5)
+lackey_ppc64_aix5_LDFLAGS =3D $(TOOL_LDFLAGS_PPC64_AIX5)
Modified: trunk/massif/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/massif/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/massif/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -3,18 +3,24 @@
SUBDIRS +=3D hp2ps
=20
noinst_PROGRAMS =3D=20
-if VG_X86_LINUX
+if VGP_X86_LINUX
noinst_PROGRAMS +=3D massif-x86-linux vgpreload_massif-x86-linux.so
endif
-if VG_AMD64_LINUX
+if VGP_AMD64_LINUX
noinst_PROGRAMS +=3D massif-amd64-linux vgpreload_massif-amd64-linux.so
endif
-if VG_PPC32_LINUX
+if VGP_PPC32_LINUX
noinst_PROGRAMS +=3D massif-ppc32-linux vgpreload_massif-ppc32-linux.so
endif
-if VG_PPC64_LINUX
+if VGP_PPC64_LINUX
noinst_PROGRAMS +=3D massif-ppc64-linux vgpreload_massif-ppc64-linux.so
endif
+if VGP_PPC32_AIX5
+noinst_PROGRAMS +=3D massif-ppc32-aix5 vgpreload_massif-ppc32-aix5.so
+endif
+if VGP_PPC64_AIX5
+noinst_PROGRAMS +=3D massif-ppc64-aix5 vgpreload_massif-ppc64-aix5.so
+endif
=20
vgpreload_massif_x86_linux_so_SOURCES =3D=20
vgpreload_massif_x86_linux_so_CPPFLAGS =3D $(AM_CPPFLAGS_X86_LINUX)
@@ -48,6 +54,22 @@
$(PRELOAD_LDFLAGS_PPC64_LINUX) \
$(LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX)
=20
+vgpreload_massif_ppc32_aix5_so_SOURCES =3D=20
+vgpreload_massif_ppc32_aix5_so_CPPFLAGS =3D $(AM_CPPFLAGS_PPC32_AIX5=
)
+vgpreload_massif_ppc32_aix5_so_CFLAGS =3D $(AM_CFLAGS_PPC32_AIX5) =
$(AM_CFLAGS_PIC)
+vgpreload_massif_ppc32_aix5_so_DEPENDENCIES =3D $(LIBREPLACEMALLOC_PPC32=
_AIX5)
+vgpreload_massif_ppc32_aix5_so_LDFLAGS =3D \
+ $(PRELOAD_LDFLAGS_PPC32_AIX5) \
+ $(LIBREPLACEMALLOC_LDFLAGS_PPC32_AIX5)
+
+vgpreload_massif_ppc64_aix5_so_SOURCES =3D=20
+vgpreload_massif_ppc64_aix5_so_CPPFLAGS =3D $(AM_CPPFLAGS_PPC64_AIX5=
)
+vgpreload_massif_ppc64_aix5_so_CFLAGS =3D $(AM_CFLAGS_PPC64_AIX5) =
$(AM_CFLAGS_PIC)
+vgpreload_massif_ppc64_aix5_so_DEPENDENCIES =3D $(LIBREPLACEMALLOC_PPC64=
_AIX5)
+vgpreload_massif_ppc64_aix5_so_LDFLAGS =3D \
+ $(PRELOAD_LDFLAGS_PPC64_AIX5) \
+ $(LIBREPLACEMALLOC_LDFLAGS_PPC64_AIX5)
+
MASSIF_SOURCES_COMMON =3D ms_main.c
=20
massif_x86_linux_SOURCES =3D $(MASSIF_SOURCES_COMMON)
@@ -77,3 +99,17 @@
massif_ppc64_linux_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC64_LINUX)
massif_ppc64_linux_LDADD =3D $(TOOL_LDADD_PPC64_LINUX)
massif_ppc64_linux_LDFLAGS =3D $(TOOL_LDFLAGS_PPC64_LINUX)
+
+massif_ppc32_aix5_SOURCES =3D $(MASSIF_SOURCES_COMMON)
+massif_ppc32_aix5_CPPFLAGS =3D $(AM_CPPFLAGS_PPC32_AIX5)
+massif_ppc32_aix5_CFLAGS =3D $(AM_CFLAGS_PPC32_AIX5)
+massif_ppc32_aix5_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC32_AIX5)
+massif_ppc32_aix5_LDADD =3D $(TOOL_LDADD_PPC32_AIX5)
+massif_ppc32_aix5_LDFLAGS =3D $(TOOL_LDFLAGS_PPC32_AIX5)
+
+massif_ppc64_aix5_SOURCES =3D $(MASSIF_SOURCES_COMMON)
+massif_ppc64_aix5_CPPFLAGS =3D $(AM_CPPFLAGS_PPC64_AIX5)
+massif_ppc64_aix5_CFLAGS =3D $(AM_CFLAGS_PPC64_AIX5)
+massif_ppc64_aix5_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC64_AIX5)
+massif_ppc64_aix5_LDADD =3D $(TOOL_LDADD_PPC64_AIX5)
+massif_ppc64_aix5_LDFLAGS =3D $(TOOL_LDFLAGS_PPC64_AIX5)
Modified: trunk/memcheck/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/memcheck/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -1,18 +1,24 @@
include $(top_srcdir)/Makefile.tool.am
=20
noinst_PROGRAMS =3D=20
-if VG_X86_LINUX
+if VGP_X86_LINUX
noinst_PROGRAMS +=3D memcheck-x86-linux vgpreload_memcheck-x86-linux.so
endif
-if VG_AMD64_LINUX
+if VGP_AMD64_LINUX
noinst_PROGRAMS +=3D memcheck-amd64-linux vgpreload_memcheck-amd64-linux=
.so
endif
-if VG_PPC32_LINUX
+if VGP_PPC32_LINUX
noinst_PROGRAMS +=3D memcheck-ppc32-linux vgpreload_memcheck-ppc32-linux=
.so
endif
-if VG_PPC64_LINUX
+if VGP_PPC64_LINUX
noinst_PROGRAMS +=3D memcheck-ppc64-linux vgpreload_memcheck-ppc64-linux=
.so
endif
+if VGP_PPC32_AIX5
+noinst_PROGRAMS +=3D memcheck-ppc32-aix5 vgpreload_memcheck-ppc32-aix5.s=
o
+endif
+if VGP_PPC64_AIX5
+noinst_PROGRAMS +=3D memcheck-ppc64-aix5 vgpreload_memcheck-ppc64-aix5.s=
o
+endif
=20
VGPRELOAD_MEMCHECK_SOURCES_COMMON =3D mc_replace_strmem.c
=20
@@ -52,6 +58,24 @@
$(PRELOAD_LDFLAGS_PPC64_LINUX) \
$(LIBREPLACEMALLOC_LDFLAGS_PPC64_LINUX)
=20
+vgpreload_memcheck_ppc32_aix5_so_SOURCES =3D $(VGPRELOAD_MEMCHECK_S=
OURCES_COMMON)
+vgpreload_memcheck_ppc32_aix5_so_CPPFLAGS =3D $(AM_CPPFLAGS_PPC32_AI=
X5)
+vgpreload_memcheck_ppc32_aix5_so_CFLAGS =3D $(AM_CFLAGS_PPC32_AIX5=
) $(AM_CFLAGS_PIC) -O2
+vgpreload_memcheck_ppc32_aix5_so_CCASFLAGS =3D $(AM_CCASFLAGS_PPC32_A=
IX5)
+vgpreload_memcheck_ppc32_aix5_so_DEPENDENCIES =3D $(LIBREPLACEMALLOC_PPC=
32_AIX5)
+vgpreload_memcheck_ppc32_aix5_so_LDFLAGS =3D \
+ $(PRELOAD_LDFLAGS_PPC32_AIX5) \
+ $(LIBREPLACEMALLOC_LDFLAGS_PPC32_AIX5)
+
+vgpreload_memcheck_ppc64_aix5_so_SOURCES =3D $(VGPRELOAD_MEMCHECK_S=
OURCES_COMMON)
+vgpreload_memcheck_ppc64_aix5_so_CPPFLAGS =3D $(AM_CPPFLAGS_PPC64_AI=
X5)
+vgpreload_memcheck_ppc64_aix5_so_CFLAGS =3D $(AM_CFLAGS_PPC64_AIX5=
) $(AM_CFLAGS_PIC) -O2
+vgpreload_memcheck_ppc64_aix5_so_CCASFLAGS =3D $(AM_CCASFLAGS_PPC64_A=
IX5)
+vgpreload_memcheck_ppc64_aix5_so_DEPENDENCIES =3D $(LIBREPLACEMALLOC_PPC=
64_AIX5)
+vgpreload_memcheck_ppc64_aix5_so_LDFLAGS =3D \
+ $(PRELOAD_LDFLAGS_PPC64_AIX5) \
+ $(LIBREPLACEMALLOC_LDFLAGS_PPC64_AIX5)
+
MEMCHECK_SOURCES_COMMON =3D \
mc_leakcheck.c \
mc_malloc_wrappers.c \
@@ -90,6 +114,22 @@
memcheck_ppc64_linux_LDADD =3D $(TOOL_LDADD_PPC64_LINUX)
memcheck_ppc64_linux_LDFLAGS =3D $(TOOL_LDFLAGS_PPC64_LINUX)
=20
+memcheck_ppc32_aix5_SOURCES =3D $(MEMCHECK_SOURCES_COMMON)
+memcheck_ppc32_aix5_CPPFLAGS =3D $(AM_CPPFLAGS_PPC32_AIX5)
+memcheck_ppc32_aix5_CFLAGS =3D $(AM_CFLAGS_PPC32_AIX5) -O2
+memcheck_ppc32_aix5_CCASFLAGS =3D $(AM_CCASFLAGS_PPC32_AIX5)
+memcheck_ppc32_aix5_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC32_AIX5)
+memcheck_ppc32_aix5_LDADD =3D $(TOOL_LDADD_PPC32_AIX5)
+memcheck_ppc32_aix5_LDFLAGS =3D $(TOOL_LDFLAGS_PPC32_AIX5)
+
+memcheck_ppc64_aix5_SOURCES =3D $(MEMCHECK_SOURCES_COMMON)
+memcheck_ppc64_aix5_CPPFLAGS =3D $(AM_CPPFLAGS_PPC64_AIX5)
+memcheck_ppc64_aix5_CFLAGS =3D $(AM_CFLAGS_PPC64_AIX5) -O2
+memcheck_ppc64_aix5_CCASFLAGS =3D $(AM_CCASFLAGS_PPC64_AIX5)
+memcheck_ppc64_aix5_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC64_AIX5)
+memcheck_ppc64_aix5_LDADD =3D $(TOOL_LDADD_PPC64_AIX5)
+memcheck_ppc64_aix5_LDFLAGS =3D $(TOOL_LDFLAGS_PPC64_AIX5)
+
mcincludedir =3D $(includedir)/valgrind
=20
mcinclude_HEADERS =3D \
Modified: trunk/memcheck/tests/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/memcheck/tests/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -3,16 +3,16 @@
include $(top_srcdir)/Makefile.flags.am
=20
SUBDIRS =3D .
-if VG_X86_LINUX
+if VGP_X86_LINUX
SUBDIRS +=3D x86
endif
-if VG_AMD64_LINUX
+if VGP_AMD64_LINUX
SUBDIRS +=3D amd64
endif
-if VG_PPC32_LINUX
+if VGP_PPC32_LINUX
SUBDIRS +=3D ppc32
endif
-if VG_PPC64_LINUX
+if VGP_PPC64_LINUX
SUBDIRS +=3D ppc64
endif
=20
@@ -133,6 +133,7 @@
wrap7.vgtest wrap7.stdout.exp wrap7.stderr.exp \
wrap8.vgtest wrap8.stdout.exp wrap8.stderr.exp \
wrap8.stdout.exp2 wrap8.stderr.exp2 \
+ wrap8.stdout.exp3 wrap8.stderr.exp3 \
writev.stderr.exp writev.stderr.exp2 writev.stderr.exp3 writev.vgtest \
xml1.stderr.exp xml1.stderr.exp2 xml1.stderr.exp3 \
xml1.stderr.exp64 xml1.stderr.exp64_2 xml1.stdout.exp \
@@ -205,18 +206,55 @@
deep_templates_SOURCES =3D deep_templates.cpp
deep_templates_CXXFLAGS =3D $(AM_FLAG_M3264_PRI) $(AM_CFLAGS) -O -gstabs
=20
+if VGP_PPC32_AIX5
+if VGP_PPC64_AIX5
+else
+ # persuade the AIX linker not to junk apparently unused
+ # function descriptors. Unfortunately -Wl,-G -Wl,-bnogc
+ # produces a link error on 64-bit AIX, hence only 32-bit
+ # gets these flags.
+ wrap1_LDFLAGS =3D $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc
+ wrap2_LDFLAGS =3D $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc
+ wrap3_LDFLAGS =3D $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc
+ wrap4_LDFLAGS =3D $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc
+ wrap5_LDFLAGS =3D $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc
+ wrap6_LDFLAGS =3D $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc
+ wrap8_LDFLAGS =3D $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc
+endif
+endif
+
# Build shared object for wrap7
wrap7_SOURCES =3D wrap7.c
wrap7_DEPENDENCIES =3D wrap7so.so
-wrap7_LDFLAGS =3D $(AM_FLAG_M3264_PRI) \
+if VGP_PPC64_AIX5=20
+ wrap7_LDADD =3D `pwd`/wrap7so.so
+ wrap7_LDFLAGS =3D $(AM_FLAG_M3264_PRI)
+else
+if VGP_PPC32_AIX5
+ wrap7_LDADD =3D `pwd`/wrap7so.so
+ wrap7_LDFLAGS =3D $(AM_FLAG_M3264_PRI) -Wl,-G -Wl,-bnogc
+else
+ wrap7_LDADD =3D wrap7so.so
+ wrap7_LDFLAGS =3D $(AM_FLAG_M3264_PRI) \
-Wl,-rpath,$(top_builddir)/memcheck/tests
-wrap7_LDADD =3D wrap7so.so
+endif
+endif
+
wrap7so_so_SOURCES =3D wrap7so.c
wrap7so_so_LDADD =3D=20
wrap7so_so_DEPENDENCIES =3D=20
-wrap7so_so_LDFLAGS =3D -fpic $(AM_FLAG_M3264_PRI) \
- -Wl,-soname -Wl,wrap7so.so -shared
wrap7so_so_CFLAGS =3D -fpic $(AM_FLAG_M3264_PRI)
+if VGP_PPC64_AIX5
+ wrap7so_so_LDFLAGS =3D -fpic $(AM_FLAG_M3264_PRI) -shared
+else
+if VGP_PPC32_AIX5
+ wrap7so_so_LDFLAGS =3D -fpic $(AM_FLAG_M3264_PRI) -shared \
+ -Wl,-G -Wl,-bnogc
+else
+ wrap7so_so_LDFLAGS =3D -fpic $(AM_FLAG_M3264_PRI) -shared \
+ -Wl,-soname -Wl,wrap7so.so
+endif
+endif
=20
# Valgrind unit self-tests
#hello_LDFLAGS =3D -Wl,-defsym,valt_load_address=3D0x50000000 \
Modified: trunk/none/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/none/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -1,18 +1,24 @@
include $(top_srcdir)/Makefile.tool.am
=20
noinst_PROGRAMS =3D=20
-if VG_X86_LINUX
+if VGP_X86_LINUX
noinst_PROGRAMS +=3D none-x86-linux
endif
-if VG_AMD64_LINUX
+if VGP_AMD64_LINUX
noinst_PROGRAMS +=3D none-amd64-linux
endif
-if VG_PPC32_LINUX
+if VGP_PPC32_LINUX
noinst_PROGRAMS +=3D none-ppc32-linux
endif
-if VG_PPC64_LINUX
+if VGP_PPC64_LINUX
noinst_PROGRAMS +=3D none-ppc64-linux
endif
+if VGP_PPC32_AIX5
+noinst_PROGRAMS +=3D none-ppc32-aix5
+endif
+if VGP_PPC64_AIX5
+noinst_PROGRAMS +=3D none-ppc64-aix5
+endif
=20
NONE_SOURCES_COMMON =3D nl_main.c
=20
@@ -43,3 +49,17 @@
none_ppc64_linux_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC64_LINUX)
none_ppc64_linux_LDADD =3D $(TOOL_LDADD_PPC64_LINUX)
none_ppc64_linux_LDFLAGS =3D $(TOOL_LDFLAGS_PPC64_LINUX)
+
+none_ppc32_aix5_SOURCES =3D $(NONE_SOURCES_COMMON)
+none_ppc32_aix5_CPPFLAGS =3D $(AM_CPPFLAGS_PPC32_AIX5)
+none_ppc32_aix5_CFLAGS =3D $(AM_CFLAGS_PPC32_AIX5)
+none_ppc32_aix5_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC32_AIX5)
+none_ppc32_aix5_LDADD =3D $(TOOL_LDADD_PPC32_AIX5)
+none_ppc32_aix5_LDFLAGS =3D $(TOOL_LDFLAGS_PPC32_AIX5)
+
+none_ppc64_aix5_SOURCES =3D $(NONE_SOURCES_COMMON)
+none_ppc64_aix5_CPPFLAGS =3D $(AM_CPPFLAGS_PPC64_AIX5)
+none_ppc64_aix5_CFLAGS =3D $(AM_CFLAGS_PPC64_AIX5)
+none_ppc64_aix5_DEPENDENCIES =3D $(COREGRIND_LIBS_PPC64_AIX5)
+none_ppc64_aix5_LDADD =3D $(TOOL_LDADD_PPC64_AIX5)
+none_ppc64_aix5_LDFLAGS =3D $(TOOL_LDFLAGS_PPC64_AIX5)
Modified: trunk/none/tests/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/Makefile.am 2006-10-17 00:39:31 UTC (rev 6241)
+++ trunk/none/tests/Makefile.am 2006-10-17 00:56:43 UTC (rev 6242)
@@ -3,16 +3,16 @@
include $(top_srcdir)/Makefile.flags.am
=20
SUBDIRS =3D .
-if VG_X86_LINUX
+if VGP_X86_LINUX
SUBDIRS +=3D x86
endif
-if VG_AMD64_LINUX
+if VGP_AMD64_LINUX
SUBDIRS +=3D amd64
endif
-if VG_PPC32_LINUX
+if VGP_PPC32_LINUX
SUBDIRS +=3D ppc32
endif
-if VG_PPC64_LINUX
+if VGP_PPC64_LINUX
SUBDIRS +=3D ppc64
endif
=20
@@ -175,7 +175,11 @@
pth_once_LDADD =3D -lpthread
pth_rwlock_LDADD =3D -lpthread
pth_stackalign_LDADD =3D -lpthread
-res_search_LDADD =3D -lresolv -lpthread
+if VGP_PPC32_AIX5
+ res_search_LDADD =3D -lpthread
+else
+ res_search_LDADD =3D -lresolv -lpthread
+endif
semlimit_LDADD =3D -lpthread
susphello_LDADD =3D -lpthread
thread_exits_LDADD =3D -lpthread
@@ -183,12 +187,21 @@
threadederrno_LDADD =3D -lpthread
tls_SOURCES =3D tls.c tls2.c
tls_DEPENDENCIES =3D tls.so
-tls_LDFLAGS =3D -Wl,-rpath,$(top_builddir)/none/tests
+if VGP_PPC32_AIX5
+ tls_LDFLAGS =3D=20
+else
+ tls_LDFLAGS =3D -Wl,-rpath,$(top_builddir)/none/tests
+endif
tls_LDADD =3D tls.so -lpthread
tls_so_SOURCES =3D tls_so.c
-tls_so_LDADD =3D tls2.so
tls_so_DEPENDENCIES =3D tls2.so
-tls_so_LDFLAGS =3D -Wl,-rpath,$(top_builddir)/none/tests -shared -fPIC
+if VGP_PPC32_AIX5
+ tls_so_LDFLAGS =3D -shared -fPIC
+ tls_so_LDADD =3D `pwd`/tls2.so
+else
+ tls_so_LDFLAGS =3D -Wl,-rpath,$(top_builddir)/none/tests -shared -fPIC
+ tls_so_LDADD =3D tls2.so
+endif
tls_so_CFLAGS =3D $(AM_FLAG_M3264_PRI) -fPIC
tls2_so_SOURCES =3D tls2_so.c
tls2_so_LDFLAGS =3D -shared
|
|
From: <sv...@va...> - 2006-10-17 00:39:34
|
Author: sewardj
Date: 2006-10-17 01:39:31 +0100 (Tue, 17 Oct 2006)
New Revision: 6241
Log:
Merge r6106 (rename the Linux launcher and add an AIX5 one.)
Added:
trunk/coregrind/launcher-aix5-bootblock.h
trunk/coregrind/launcher-aix5.c
trunk/coregrind/launcher-linux.c
Removed:
trunk/coregrind/launcher.c
Added: trunk/coregrind/launcher-aix5-bootblock.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/launcher-aix5-bootblock.h (re=
v 0)
+++ trunk/coregrind/launcher-aix5-bootblock.h 2006-10-17 00:39:31 UTC (re=
v 6241)
@@ -0,0 +1,85 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Structure written into the child process by launcher-aix5.c. ---*/
+/*--- launcher-aix5-bootblock.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2006-2006 OpenWorks LLP
+ in...@op...
+
+ 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.
+*/
+
+
+/* This is the structure written into the child process by the AIX5
+ launcher. The tool's entry point (see bottom of
+ coregrind/m_main.c) must be aware of the layout as it will have to
+ read info from it at startup. This struct is designed to work
+ equally well in 32- and 64-bit mode. It must be placed at an
+ 8-aligned address in the child. */
+
+#define N_BOOTBLOCK_INSNS 60 /* number of insns */
+#define N_BOOTBLOCK_ERRMSG 64 /* max bytes in the error message */
+#define N_BOOTBLOCK_TOOLFILE 256 /* max bytes in the tool file name */
+
+typedef
+
+ struct {
+ /* Adler32 checksum of the uncompressed data of the compressed
+ page (the second part of which contains this struct. */
+ /* 0 */ UInt adler32;
+=20
+ /* The system call numbers for enough critical syscalls that the
+ tool can start both debug logging and also read the
+ /proc/../sysent file. */
+ /* 4 */ UInt __NR_getpid;
+ /* 8 */ UInt __NR_write;
+ /* 12 */ UInt __NR_exit;
+ /* 16 */ UInt __NR_open;
+ /* 20 */ UInt __NR_read;
+ /* 24 */ UInt __NR_close;
+ /* 28 */ UInt __off28;
+
+ /* The 37 integer registers for the client, as they should be at
+ startup. On 32-bit targets the registers are stored in the
+ lower half of each quadword, which, since this is a bigendian
+ platform, is the higher-addressed 4 bytes. */
+ /* MUST BE 8-aligned */
+ /* 32 */ ULong iregs_pc_cr_lr_ctr_xer[37];
+
+ /* The instructions for the bootstrap loader. */
+ /* 328 */ UInt code[N_BOOTBLOCK_INSNS];
+
+ /* A zero-terminated error message to be used when the bootstrap
+ loader fails. */
+ /* 628 */ UChar errmsg[N_BOOTBLOCK_ERRMSG];
+
+ /* The name of the tool file, again zero-terminated. */
+ /* 692 */ UChar toolfile[N_BOOTBLOCK_TOOLFILE];
+
+ /* 1024 */
+ }
+ AIX5Bootblock;
+
+/*--------------------------------------------------------------------*/
+/*--- end launcher-aix5-bootblock.h ---*/
+/*--------------------------------------------------------------------*/
Added: trunk/coregrind/launcher-aix5.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/launcher-aix5.c (rev 0)
+++ trunk/coregrind/launcher-aix5.c 2006-10-17 00:39:31 UTC (rev 6241)
@@ -0,0 +1,1636 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Launching Valgrind on AIX5. launcher-aix5.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2006-2006 OpenWorks LLP
+ in...@op...
+
+ 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.
+*/
+
+/* Cut-down version of the normal launcher, except it is completely
+ different on AIX5. Does not handle shell scripts, only real
+ machine code XCOFF executables.
+
+ Note: this is a "normal" program and not part of Valgrind proper,
+ and so it doesn't have to conform to Valgrind's arcane rules on
+ no-glibc-usage etc.
+*/
+
+#include <stdio.h>
+#include <assert.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <sys/ptrace.h>
+#include <sys/wait.h>
+
+/* Get both struct __ld_info32 and struct __ld_info64. */
+#define __LDINFO_PTRACE32__ 1
+#define __LDINFO_PTRACE64__ 1
+#include <sys/ldr.h>
+
+#include <sys/reg.h> /* GPR0 .. GPR31 */
+#include <sys/procfs.h> /* prsysent_t */
+
+#include "pub_core_debuglog.h"
+#include "pub_core_vki.h"
+#include "pub_core_vkiscnums.h"
+#include "pub_core_libcproc.h" // For VALGRIND_LIB, VALGRIND_LAUNCHER
+
+/* Get the definition for the AIX5Bootblock structure. This is what
+ we will generate and patch into the child's address space. */
+#include "launcher-aix5-bootblock.h"
+
+/* Simple routines for Huffman compression/decompression */
+#include "m_initimg/simple_huffman.c"
+
+
+/* -------------------------------------------------------------- */
+/* --- --- */
+/* --- A uniform interface to the ptrace facilities we need. --- */
+/* --- --- */
+/* -------------------------------------------------------------- */
+
+typedef
+ struct {
+ pid_t pid;
+ Bool is64;
+ }=20
+ Child;
+
+
+/* Read len bytes from target's rsrc to local ldst. Returns True if
+ error. */
+static=20
+Bool ptrace_READ_BLOCK ( Child* ch, Int len, void* ldst, Addr64 rsrc )
+{
+ Int r;
+ assert(len >=3D 0 && len <=3D 1024);
+ r =3D ptrace64( PT_READ_BLOCK, (ULong)ch->pid, rsrc, len, ldst );
+ if (r =3D=3D len)
+ return False; /* success */
+ return True; /* error */
+}
+
+
+/* Write len bytes to target's rdst from local lsrc. Returns True if
+ error. */
+static
+Bool ptrace_WRITE_BLOCK ( Child* child, Int len, Addr64 rdst, void* lsrc=
)
+{
+ Int r;
+ assert(len >=3D 0 && len <=3D 1024);
+ r =3D ptrace64( PT_WRITE_BLOCK, (ULong)child->pid, rdst, len, lsrc );
+ if (r =3D=3D len)
+ return False; /* success */
+ return True; /* error */
+}
+
+
+/* Read a GPR from the target. Returns True if error. */
+static
+Bool ptrace_READ_GPR ( Child* child, Int reg, ULong* ldst )
+{
+ ULong w64;
+ UInt w32;
+ errno =3D 0;
+ if (child->is64) {
+ (void)ptrace64( PT_READ_GPR,=20
+ (ULong)child->pid, (ULong)reg, 8, (Int*)(&w64) );
+ if (errno !=3D 0) return True; /* error */
+ } else {
+ w32 =3D ptrace64( PT_READ_GPR,=20
+ (ULong)child->pid, (ULong)reg, 0, 0 );
+ if (errno !=3D 0) return True; /* error */
+ w64 =3D (ULong)w32;
+ }
+ *ldst =3D w64;
+ return False; /* success */
+}
+
+
+/* Write a GPR to the target. Returns True if error. */
+static
+Bool ptrace_WRITE_GPR ( Child* child, Int reg, ULong val )
+{
+ ULong w64;
+ UInt w32;
+ errno =3D 0;
+ if (child->is64) {
+ w64 =3D val;
+ (void)ptrace64( PT_WRITE_GPR,
+ (ULong)child->pid, (ULong)reg, 8, (Int*)&w64 );
+ if (errno !=3D 0) return True; /* error */
+ } else {
+ w32 =3D (UInt)val;
+ (void)ptrace64( PT_WRITE_GPR,=20
+ (ULong)child->pid, (ULong)reg, w32, 0 );
+ if (errno !=3D 0) return True; /* error */
+ }
+ return False; /* success */
+}
+
+
+/* -------------------------------------------------------------- */
+/* --- --- */
+/* --- Helper functions --- */
+/* --- --- */
+/* -------------------------------------------------------------- */
+
+/* Search the path for the client program */
+static const char* find_client ( const char* clientname )
+{
+ static char fullname[PATH_MAX];
+ const char *path =3D getenv("PATH");
+ const char *colon;
+
+ while (path)
+ {
+ if ((colon =3D strchr(path, ':')) =3D=3D NULL)
+ {
+ strcpy(fullname, path);
+ path =3D NULL;
+ }
+ else
+ {
+ memcpy(fullname, path, colon - path);
+ fullname[colon - path] =3D '\0';
+ path =3D colon + 1;
+ }
+ strcat(fullname, "/");
+ strcat(fullname, clientname);
+
+ if (access(fullname, R_OK|X_OK) =3D=3D 0)
+ return fullname;
+ }
+
+ return clientname;
+}
+
+/* Examine the given file. If it looks like valid XCOFF32 return 32,
+ if valid XCOFF64 return 64, else return 0. */
+static Int examine_client ( const char* clientname )
+{
+ UChar buf[16];
+ Int n;
+ FILE* f =3D fopen( clientname, "r" );
+ if (f =3D=3D NULL)
+ return 0;
+ n =3D fread( buf, 1, 16, f );
+ fclose(f);
+ if (n !=3D 16)
+ return 0;
+ if (buf[0] =3D=3D 0x01 && buf[1] =3D=3D 0xDF)
+ return 32; /* XCOFF32 */
+ if (buf[0] =3D=3D 0x01 && buf[1] =3D=3D 0xF7)
+ return 64; /* XCOFF64 */
+ return 0;
+}
+
+static Bool file_exists ( char* fname )
+{
+ struct stat buf;
+ int r =3D stat(fname, &buf);
+ return r =3D=3D 0;
+}
+
+static Addr64 ROUNDDN_PAGE ( Addr64 v )
+{
+ ULong p =3D (ULong)v;
+ ULong a =3D PAGE_SIZE;
+ p &=3D ~(a-1);
+ return (Addr64)p;
+}
+
+static Bool IS_PAGE_ALIGNED ( Addr64 v )
+{
+ ULong p =3D (ULong)v;
+ ULong a =3D PAGE_SIZE;
+ if (p & (a-1))
+ return False;
+ else
+ return True;
+}
+
+static Bool IS_8_ALIGNED ( Addr64 v )
+{
+ ULong p =3D (ULong)v;
+ ULong a =3D 8;
+ if (p & (a-1))
+ return False;
+ else
+ return True;
+}
+
+
+/* Read a 4096-byte page from CHILD's address space at location SRC,
+ into local address space at DST. Returns True if error, False
+ otherwise.
+*/
+static Bool ptrace_read_page ( Child* child, UChar* ldst, Addr64 rsrc )
+{
+ Int off;
+ Bool err;
+
+ assert(IS_PAGE_ALIGNED(rsrc));
+
+ off =3D 0;
+ err =3D ptrace_READ_BLOCK(child, 1024, ldst + off, rsrc + off);
+ if (err) return err;
+
+ off +=3D 1024;
+ err =3D ptrace_READ_BLOCK(child, 1024, ldst + off, rsrc + off);
+ if (err) return err;
+
+ off +=3D 1024;
+ err =3D ptrace_READ_BLOCK(child, 1024, ldst + off, rsrc + off);
+ if (err) return err;
+
+ off +=3D 1024;
+ err =3D ptrace_READ_BLOCK(child, 1024, ldst + off, rsrc + off);
+ if (err) return err;
+
+ off +=3D 1024;
+ assert(off =3D=3D PAGE_SIZE);
+
+ return False;
+}
+
+
+/* Write a 4096-byte page from local address space at SRC to CHILD's
+ address space at location DST. Returns True if error, False
+ otherwise.
+*/
+static Bool ptrace_write_page ( Child* child, Addr64 rdst, UChar* lsrc )
+{
+ Int off;
+ Bool err;
+
+ assert(IS_PAGE_ALIGNED(rdst));
+
+ off =3D 0;
+ err =3D ptrace_WRITE_BLOCK(child, 1024, rdst + off, lsrc + off);
+ if (err) return err;
+
+ off +=3D 1024;
+ err =3D ptrace_WRITE_BLOCK(child, 1024, rdst + off, lsrc + off);
+ if (err) return err;
+
+ off +=3D 1024;
+ err =3D ptrace_WRITE_BLOCK(child, 1024, rdst + off, lsrc + off);
+ if (err) return err;
+
+ off +=3D 1024;
+ err =3D ptrace_WRITE_BLOCK(child, 1024, rdst + off, lsrc + off);
+ if (err) return err;
+
+ off +=3D 1024;
+ assert(off =3D=3D PAGE_SIZE);
+
+ return False;
+}
+
+
+/* Get 37 integer registers (GPR0 .. GPR31, PC, CR, LR, CTR, XER) from
+ CHILD into the given array. Returns True if there is any kind of
+ error. */
+static=20
+Bool ptrace_get_iregs_pc_cr_lr_ctr_xer (=20
+ Child* child,=20
+ /*OUT*/ULong* iregs_pc_cr_lr_ctr_xer=20
+ )
+{
+ Int i, j;
+ Bool err;
+
+ for (i =3D GPR0; i <=3D GPR31; i++) {
+ j =3D i - GPR0;
+ assert(j >=3D 0 && j < 32);
+ err =3D ptrace_READ_GPR( child, i, &iregs_pc_cr_lr_ctr_xer[j] );
+ if (err) return err;
+ }
+
+ /* PC */
+ err =3D ptrace_READ_GPR( child, IAR, &iregs_pc_cr_lr_ctr_xer[32+0] );
+ if (err) return err;
+
+ /* CR */
+ err =3D ptrace_READ_GPR( child, CR, &iregs_pc_cr_lr_ctr_xer[32+1] );
+ if (err) return err;
+
+ /* LR */
+ err =3D ptrace_READ_GPR( child, LR, &iregs_pc_cr_lr_ctr_xer[32+2] );
+ if (err) return err;
+
+ /* CTR */
+ err =3D ptrace_READ_GPR( child, CTR, &iregs_pc_cr_lr_ctr_xer[32+3] );
+ if (err) return err;
+
+ /* XER */
+ err =3D ptrace_READ_GPR( child, XER, &iregs_pc_cr_lr_ctr_xer[32+4] );
+ if (err) return err;
+
+ return False;
+}
+
+
+/* Set CHILD's program counter to the given value. Returns True if
+ there is any kind of error. */
+static=20
+Bool ptrace_put_pc ( Child* child, ULong newpc )
+{
+ return ptrace_WRITE_GPR( child, IAR, newpc );
+}
+
+
+/* Set CHILD's R31 to the given value. Returns True if there is any
+ kind of error. */
+static=20
+Bool ptrace_put_r31 ( Child* child, ULong newr31 )
+{
+ return ptrace_WRITE_GPR( child, GPR31, newr31 );
+}
+
+
+/* ------ Instruction generators ------ */
+
+static UInt mkFormD ( UInt opc1, UInt r1, UInt r2, UInt imm )
+{
+ UInt theInstr;
+ assert(opc1 < 0x40);
+ assert(r1 < 0x20);
+ assert(r2 < 0x20);
+ imm =3D imm & 0xFFFF;
+ theInstr =3D ((opc1<<26) | (r1<<21) | (r2<<16) | (imm));
+ return theInstr;
+}
+static UInt mkFormX ( UInt opc1,=20
+ UInt r1, UInt r2, UInt r3, UInt opc2, UInt b0 )
+{
+ UInt theInstr;
+ assert(opc1 < 0x40);
+ assert(r1 < 0x20);
+ assert(r2 < 0x20);
+ assert(r3 < 0x20);
+ assert(opc2 < 0x400);
+ assert(b0 < 0x2);
+ theInstr =3D ((opc1<<26) | (r1<<21) | (r2<<16) |
+ (r3<<11) | (opc2<<1) | (b0));
+ return theInstr;
+}
+static UInt mkFormXFX ( UInt r1, UInt f2, UInt opc2 )
+{
+ UInt theInstr;
+ assert(r1 < 0x20);
+ assert(f2 < 0x20);
+ assert(opc2 < 0x400);
+ switch (opc2) {
+ case 144: // mtcrf
+ assert(f2 < 0x100);
+ f2 =3D f2 << 1;
+ break;
+ case 339: // mfspr
+ case 371: // mftb
+ case 467: // mtspr
+ assert(f2 < 0x400);
+ // re-arrange split field
+ f2 =3D ((f2>>5) & 0x1F) | ((f2 & 0x1F)<<5);
+ break;
+ default: assert(0);
+ }
+ theInstr =3D ((31<<26) | (r1<<21) | (f2<<11) | (opc2<<1));
+ return theInstr;
+}
+static UInt mkFormMD ( UInt opc1, UInt r1, UInt r2,
+ UInt imm1, UInt imm2, UInt opc2 )
+{
+ UInt theInstr;
+ assert(opc1 < 0x40);
+ assert(r1 < 0x20);
+ assert(r2 < 0x20);
+ assert(imm1 < 0x40);
+ assert(imm2 < 0x40);
+ assert(opc2 < 0x08);
+ imm2 =3D ((imm2 & 0x1F) << 1) | (imm2 >> 5);
+ theInstr =3D ((opc1<<26) | (r1<<21) | (r2<<16) |
+ ((imm1 & 0x1F)<<11) | (imm2<<5) |
+ (opc2<<2) | ((imm1 >> 5)<<1));
+ return theInstr;
+}
+static UInt mkFormXO ( UInt opc1, UInt r1, UInt r2,
+ UInt r3, UInt b10, UInt opc2, UInt b0 )
+{
+ UInt theInstr;
+ assert(opc1 < 0x40);
+ assert(r1 < 0x20);
+ assert(r2 < 0x20);
+ assert(r3 < 0x20);
+ assert(b10 < 0x2);
+ assert(opc2 < 0x200);
+ assert(b0 < 0x2);
+ theInstr =3D ((opc1<<26) | (r1<<21) | (r2<<16) |
+ (r3<<11) | (b10 << 10) | (opc2<<1) | (b0));
+ return theInstr;
+}
+
+static UInt gen_lis_r_N ( UInt r, UInt N ) {
+ return mkFormD(15, r, 0, N & 0xFFFF); /* lis r,r,N */
+}
+static UInt gen_ori_r_r_N ( UInt r, UInt N ) {
+ return mkFormD(24, r, r, N & 0xFFFF); /* ori r,r,N */
+}
+static UInt gen_addi_rd_rs_N ( UInt rd, UInt rs, UInt N ) {
+ assert(rs !=3D 0);
+ return mkFormD(14, rd, rs, N & 0xFFFF); /* addi rd,rs,N */
+}
+static UInt gen_crorc_6_6_6 ( void ) {
+ return 0x4CC63342; /* crorc 6,6,6 */
+}
+static UInt gen_mr_rd_rs ( UInt rd, UInt rs ) {
+ return mkFormX(31, rs, rd, rs, 444, 0); /* or rd,rs,ts */
+}
+static UInt gen_bl_next ( void ) {
+ return 0x48000005; /* bl .+4 */
+}
+static UInt gen_mflr_r ( UInt r ) {
+ return mkFormXFX(r, 8, 339); /* mflr r */
+}
+static UInt gen_mtlr_r ( UInt r ) {
+ return mkFormXFX(r, 8, 467); /* mtlr r */
+}
+static UInt gen_blr ( void ) {
+ return 0x4E800020; /* blr */
+}
+__attribute__((unused))
+static UInt gen_blrl ( void ) {
+ return 0x4E800021; /* blrl */
+}
+static UInt gen_add_r_N ( UInt r, UInt N ) {
+ return mkFormD(14, r, r, N & 0xFFFF); /* addi r,r,N */
+}
+static UInt gen_cmpli_cr7_r_N ( UInt r, UInt N ) {
+ return mkFormD(10, 7<<2, r, N & 0xFFFF); /* cmpli cr7,r,N */
+}
+static UInt gen_bne_cr7_delta ( UInt delta ) {
+ return 0x409E0000 | (delta & 0x0000FFFC); /* bne- cr7,delta */
+}
+__attribute__((unused))
+static UInt gen_beq_cr7_delta ( UInt delta ) {
+ return 0x419E0000 | (delta & 0x0000FFFC); /* beq- cr7,delta */
+}
+static UInt gen_sc ( void ) {
+ return 0x44000002; /* sc */
+}
+static UInt gen_lwz_rd_off_ra ( UInt rd, UInt off, UInt ra ) {
+ return mkFormD(32, rd, ra, off); /* lwz rd, off(ra) */
+}
+static UInt gen_add_rd_rL_rR (UInt rd, UInt rsrcL, UInt rsrcR ) {
+ return mkFormXO(31, rd, rsrcL, rsrcR, 0, 266, 0);
+}
+static UInt gen_subf_rd_rL_rR (UInt rd, UInt rsrcL, UInt rsrcR ) {
+ return mkFormXO(31, rd, rsrcL, rsrcR, 0, 40, 0);
+}
+
+static Int emit_insn ( UInt* code, Int ix, UInt insn ) {
+ code[ix++] =3D insn;
+ return ix;
+}
+static Int emit_li32 ( UInt* code, Int ix, UInt rd, UInt imm32 ) {
+ code[ix++] =3D gen_lis_r_N(rd, imm32 >> 16);
+ code[ix++] =3D gen_ori_r_r_N(rd, imm32 & 0xFFFF);
+ return ix;
+}
+static Int emit_dosc ( UInt* code, Int ix ) {
+ /* Generate code to do a syscall and continue at the next insn.
+ Note: trashes r29. */
+ code[ix++] =3D gen_crorc_6_6_6();
+ code[ix++] =3D gen_bl_next();
+ code[ix++] =3D gen_mflr_r(29);
+ code[ix++] =3D gen_add_r_N(29,16);
+ code[ix++] =3D gen_mtlr_r(29);
+ code[ix++] =3D gen_sc();
+ return ix;
+}
+
+/* Generate 64-bit insns */
+static Int emit_li64 ( UInt* code, Int ix, UInt rd, ULong imm64 ) {
+ if (imm64 >=3D 0xFFFFFFFF80000000ULL || imm64 < 0x80000000ULL) {
+ // sign-extendable from 32 bits
+ // addis rd,r0,(imm64>>16) =3D> lis rd, (imm64>>16)
+ code[ix++] =3D mkFormD(15, rd, 0, (imm64>>16) & 0xFFFF);
+ // ori rd, rd, (imm64 & 0xFFFF)
+ code[ix++] =3D mkFormD(24, rd, rd, imm64 & 0xFFFF);
+ } else {
+ // load high word
+ // lis rd, (imm64>>48) & 0xFFFF
+ code[ix++] =3D mkFormD(15, rd, 0, (imm64>>48) & 0xFFFF);
+ // ori rd, rd, (imm64>>32) & 0xFFFF
+ code[ix++] =3D mkFormD(24, rd, rd, (imm64>>32) & 0xFFFF);
+ // shift rd low word to high word =3D> rldicr
+ code[ix++] =3D mkFormMD(30, rd, rd, 32, 31, 1);
+ // load low word
+ // oris rd, rd, (imm64>>16) & 0xFFFF
+ code[ix++] =3D mkFormD(25, rd, rd, (imm64>>16) & 0xFFFF);
+ // ori rd, rd, (imm64) & 0xFFFF
+ code[ix++] =3D mkFormD(24, rd, rd, imm64 & 0xFFFF);
+ }
+ return ix;
+}
+static UInt gen_ld_rd_off_ra ( UInt rd, UInt off, UInt ra ) {
+ assert((off & 3) =3D=3D 0);
+ return mkFormD(58, rd, ra, off); /* ld rd, off(ra) */
+}
+
+static UInt compute_adler32 ( void* addr, UWord len )
+{
+ UInt s1 =3D 1;
+ UInt s2 =3D 0;
+ UChar* buf =3D (UChar*)addr;
+ while (len > 0) {
+ s1 +=3D buf[0];
+ s2 +=3D s1;
+ s1 %=3D 65521;
+ s2 %=3D 65521;
+ len--;
+ buf++;
+ }
+ return (s2 << 16) + s1;
+}
+
+
+/* -------------------------------------------------------------- */
+/* --- --- */
+/* --- BEGIN write bootstrap loader into child process --- */
+/* --- --- */
+/* -------------------------------------------------------------- */
+
+/* From using truss, __loadx is used to load a module into a running
+ process in 32-bit mode, and kload in 64-bit mode. __loadx is
+ simple: it returns a pointer to a standard function descriptor to
+ the entry point.
+
+ kload isn't: it returns a pointer which, from examination of
+ /proc/<pid>/maps, doesn't point into the loaded object image. It
+ does appear to point to some kind of struct, words [4] and [6] of
+ which do point into the loaded object image. From comparison with
+ /proc/<pid>/maps, they are respectively the actual VMAs of the text
+ and data sections of the loaded module.
+
+ Knowing this it is possible to find the entry point descriptor:
+ - figure out where the auxiliary header is. We have a pointer to
+ the start of the mapped text section, so just add the size of
+ the XCOFF file header to that.
+ - figure out the data bias. We know the avma of the data section;
+ and the svma of it is in the auxiliary header in field
+ o_data_start. The data bias is therefore the difference between
+ them.
+ - The auxiliary header also gives the svma of the entry point
+ descriptor; (o_entry); therefore its avma is o_entry + the data
+ bias.
+
+ ULong* kr =3D (result of kload)
+ // r3 is this value
+
+ AOUTHDR* aux =3D kr[4] (text_avma) + 24 (size of XCOFF file header);
+ // ld 9,32(3) kr[4]
+ // addi 9,9,24 + 24
+ // 9=3Daux
+
+ ULong data_avma =3D kr[6];
+ // ld 11,48(3) kr[6]
+ // 9=3Daux
+ // 11=3Ddata_avma
+
+ ULong data_svma =3D aux->o_data_start;
+ // ld 0,16(9) aux->o_data_start
+ // 9=3Daux
+ // 11=3Ddata_avma
+ // 0=3Ddata_svma
+
+ ULong data_bias =3D data_avma - data_svma;
+ // subf 11,0,11
+ // 9=3Daux
+ // 11=3Ddata_bias
+ // 0=3Ddata_svma
+
+ ULong ent_svma =3D (ULong)aux->o_entry;
+ // ld 9,80(9) aux->o_entry
+ // 9=3Dent_svma
+ // 11=3Ddata_bias
+ // 0=3Ddata_svma
+
+ ULong ent_avma =3D ent_svma + data_bias;
+ // add 10,9,11
+ // 9=3Dent_svma
+ // 11=3Ddata_bias
+ // 0=3Ddata_svma
+ // 10=3Dent_avma
+*/
+
+#define LAUNCHER_SYSENT_SIZE 100000
+static char sysent_buf[LAUNCHER_SYSENT_SIZE];
+
+/* The executable loaded must have no more than N_LDINFOs direct
+ shared-object dependencies. Just increase this value and rebuild,
+ if you ever run out. We have two arrays, one for each kind of
+ target process. */
+#define N_LDINFOs 1000
+static struct __ld_info32 ld_info32_array[N_LDINFOs];
+static struct __ld_info64 ld_info64_array[N_LDINFOs];
+
+
+static=20
+UChar* bootstrap_errmsg=20
+ =3D "\nvalgrind: bootstrap loader failed. Cannot continue.\n\n=
";
+
+
+/* Write the bootstrap loader and associated data (iow, an
+ AIX5Bootblock structure) into CHILD, so that when
+ ptrace-detached, it will continue by loading TOOLNAME and
+ continuing with that. Returns NULL on success or an error string
+ on failure. */
+
+static char* write_bootstrap_loader_into_child=20
+ ( Child* child, char* toolfile )
+{
+ /* ------ STEP 1: Fill in most parts of the bootblock. ------ */
+
+ /* All parts except code[], off_zdata and len_zdata. */
+
+ AIX5Bootblock block;
+
+ VG_(debugLog)(1, "launcher", "parent: size of bootblock is %ld\n",
+ sizeof(AIX5Bootblock));
+
+ assert(IS_8_ALIGNED( sizeof(AIX5Bootblock) ));
+
+ memset(&block, 0, sizeof(block));
+
+ /* --- OFFSETS--- */
+
+ /* off_zdata not known yet */
+ /* len_zdata not known yet */
+
+ /* --- SYSCALL NUMBERS --- */
+
+ /* Read some system call entries from the child's
+ /proc/<pid>/sysent file. */
+ char sysent_name[50];
+ FILE* sysent_file;
+ int sysent_used =3D 0;
+ prsysent_t* sysent_hdr;
+ int i;
+
+ VG_(debugLog)(1, "launcher",=20
+ "parent: reading child's /proc/../sysent\n");
+
+ sprintf(sysent_name, "/proc/%d/sysent", child->pid);
+ sysent_file =3D fopen(sysent_name, "r");
+ if (sysent_file =3D=3D NULL)
+ return "Can't open child's /proc/<pid>/sysent file";
+
+ sysent_used =3D fread(sysent_buf, 1, LAUNCHER_SYSENT_SIZE, sysent_fil=
e);
+ if (sysent_used =3D=3D 0)
+ return "Error reading child's /proc/<pid>/sysent file";
+ if (sysent_used =3D=3D LAUNCHER_SYSENT_SIZE)
+ return "LAUNCHER_SYSENT_SIZE is too low; increase and recompile";
+ assert(sysent_used > 0 && sysent_used < LAUNCHER_SYSENT_SIZE);
+
+ fclose(sysent_file);
+
+ sysent_hdr =3D (prsysent_t*)&sysent_buf[0];
+
+ /* Find some syscall numbers for the child. */
+ Int __nr__getpid =3D -1;
+ Int __nr_kwrite =3D -1;
+ Int __nr___loadx =3D -1; /* 32-bit child only */
+ Int __nr_kload =3D -1; /* 64-bit child only */
+ Int __nr__exit =3D -1;
+ Int __nr_open =3D -1;
+ Int __nr_kread =3D -1;
+ Int __nr_close =3D -1;
+
+ for (i =3D 0; i < sysent_hdr->pr_nsyscalls; i++) {
+ char* name =3D &sysent_buf[ sysent_hdr->pr_syscall[i].pr_nameoff ]=
;
+ int nmbr =3D sysent_hdr->pr_syscall[i].pr_number;
+ if (0 =3D=3D strcmp(name, "_getpid"))
+ __nr__getpid =3D nmbr;
+ if (0 =3D=3D strcmp(name, "kwrite"))
+ __nr_kwrite =3D nmbr;
+ if (0 =3D=3D strcmp(name, "__loadx"))
+ __nr___loadx =3D nmbr;
+ if (0 =3D=3D strcmp(name, "kload"))
+ __nr_kload =3D nmbr;
+ if (0 =3D=3D strcmp(name, "_exit"))
+ __nr__exit =3D nmbr;
+ if (0 =3D=3D strcmp(name, "open"))
+ __nr_open =3D nmbr;
+ if (0 =3D=3D strcmp(name, "kread"))
+ __nr_kread =3D nmbr;
+ if (0 =3D=3D strcmp(name, "close"))
+ __nr_close =3D nmbr;
+ }
+
+ if (__nr__getpid =3D=3D -1=20
+ || __nr_kwrite =3D=3D -1=20
+ || ((!child->is64) && __nr___loadx =3D=3D -1)
+ || ((child->is64) && __nr_kload =3D=3D -1)
+ || __nr__exit =3D=3D -1
+ || __nr_open =3D=3D -1=20
+ || __nr_kread =3D=3D -1=20
+ || __nr_close =3D=3D -1)
+ return "can't establish syscall #s needed for bootstrap";
+
+ block.__NR_getpid =3D __nr__getpid;
+ block.__NR_write =3D __nr_kwrite;
+ block.__NR_exit =3D __nr__exit;
+ block.__NR_open =3D __nr_open;
+ block.__NR_read =3D __nr_kread;
+ block.__NR_close =3D __nr_close;
+
+ /* --- REGS --- */
+
+ /* Continue by copying out the child's current integer register
+ state. */
+ VG_(debugLog)(1, "launcher",=20
+ "parent: reading child's int registers\n");
+
+ Bool err =3D ptrace_get_iregs_pc_cr_lr_ctr_xer=20
+ ( child, &block.iregs_pc_cr_lr_ctr_xer[0] );
+ if (err)
+ return "read of child's int registers failed";
+
+ /* --- CODE --- */
+
+ /* We'll leave that till last (is difficult). */
+
+ /* --- ERRMSG --- */
+
+ if (1 + strlen(bootstrap_errmsg) > N_BOOTBLOCK_ERRMSG)
+ return "bootstrap error message won't fit in bootblock";
+
+ for (i =3D 0; bootstrap_errmsg[i]; i++)
+ block.errmsg[i] =3D bootstrap_errmsg[i];
+ assert(i <=3D N_BOOTBLOCK_ERRMSG);
+
+ /* --- TOOLFILE --- */
+
+ if (1 + strlen(toolfile) > N_BOOTBLOCK_TOOLFILE)
+ return "tool file path is too long, won't fit in bootblock";
+
+ for (i =3D 0; toolfile[i]; i++)
+ block.toolfile[i] =3D toolfile[i];
+ assert(i <=3D N_BOOTBLOCK_TOOLFILE);
+
+
+ /* ------ STEP 2: Generate the bootblock code. ------ */
+
+ VG_(debugLog)(1, "launcher",=20
+ "parent: creating bootblock code ..\n");
+
+ /* This is the tricky bit. The resulting code has to be position
+ independent since we don't yet know where it's going to be
+ placed. The code is entered with r31 pointing at the bootblock.
+ r29-31 are callee-saved, so presumably they don't get trashed
+ across syscalls. r30 is used as scratch, and r29 is also used
+ as scratch by 'emit_dosc'. */
+
+ /* Preliminaries: to do a syscall, we have to do 'crorc 6,6,6' and
+ put the continuation address in LR, which is a bit of a drag.
+ Hence the following macro:
+
+ SYSCALL_SEQUENCE =3D crorc 6,6,6
+ bl .+4
+ mflr 29
+ addi 29,29,16
+ mtlr 29
+ sc
+
+ Also: 'imm' is an imaginary instruction to get a 32-bit literal in=
to
+ a register. It's really li followed by oris.
+ */
+
+ /* So, the code. First, prepare for and do a _loadx syscall, to
+ get the tool aboard:
+ imm 2, __NR__loadx
+ imm 3, VKI_DL_LOAD
+ imm 4, 0
+ mr 5, 4
+ addi 6, 31, offset_of_toolfile
+ mr 7, 4
+ mr 8, 4
+ mr 9, 4
+ mr 10,4
+ SYSCALL_SEQUENCE
+
+ If the syscall failed, r4 will be nonzero. Branch elsewhere if so=
.
+ cmpi 4, 0
+ bne error
+ */
+ int ix =3D 0;
+
+# if 1
+# define TRAP \
+ do { \
+ ix=3Demit_insn( &block.code[0],ix, 0x7fe00008 ); } \
+ while (0)
+# define SEGV \
+ do { \
+ if (child->is64) { \
+ ix=3Demit_li64( &block.code[0],ix, 28,0); \
+ ix=3Demit_insn( &block.code[0],ix, \
+ gen_ld_rd_off_ra(27,0xfffc,28)); \
+ } else { \
+ ix=3Demit_li32( &block.code[0],ix, 28,0); \
+ ix=3Demit_insn( &block.code[0],ix, \
+ gen_lwz_rd_off_ra(27,0xffff,28)); \
+ } \
+ } while (0)
+# define ILL \
+ do { \
+ ix=3Demit_insn( &block.code[0],ix, 0 ); } \
+ while (0) =20
+# endif
+
+ if (child->is64) {
+
+ /* 64-bit sequence */
+ /* Set up for 'sys_kload(toolfile, 0, 0)'
+ li64 2, __NR_kload
+ addi 3, 31, offset_toolfile
+ li64 4, 0
+ mr 5, 4
+ mr 6, 4
+ mr 7, 4
+ mr 8, 4
+ mr 9, 4
+ mr 10,4
+ SYSCALL_SEQUENCE
+
+ // if kload failed, r3 will hold zero
+ cmpdi 3,0
+ beq error
+
+ // from result of kload, figure out entry point address
+ // as described above
+ ld 9,32(3)
+ addi 9,9,24
+ ld 11,48(3)
+ ld 0,16(9)
+ subf 11,0,11
+ ld 9,80(9)
+ add 10,9,11 // r10 is entry descriptor avma
+
+ void(*fn)(void*) =3D (void(*)(void*))ent_avma;
+ fn();
+ ld 9,0(10)
+ mtlr 9
+ ld 2,8(10)
+ ld 11,16(10)
+ mr 3,31 // arg to pass
+ blr
+ */
+ ix =3D emit_li64( &block.code[0],ix, 2, __nr_kload );
+ ix =3D emit_insn( &block.code[0],ix,=20
+ gen_addi_rd_rs_N(3,31,offsetof(AIX5Bootblock,toolf=
ile)));
+ ix =3D emit_li64( &block.code[0],ix, 4, 0 );
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(5,4) );
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(6,4) );
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(7,4) );
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(8,4) );
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(9,4) );
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(10,4) );
+ ix =3D emit_dosc( &block.code[0],ix );
+
+ ix =3D emit_insn( &block.code[0],ix, gen_cmpli_cr7_r_N(3,0) );
+ Int ix_beq =3D ix; /* Patch this later */
+ ix =3D emit_insn( &block.code[0],ix, 0 );
+
+ ix =3D emit_insn( &block.code[0],ix, gen_ld_rd_off_ra( 9, 32, 3 ) =
);
+ ix =3D emit_insn( &block.code[0],ix, gen_addi_rd_rs_N( 9, 9, 24 ) =
);
+ ix =3D emit_insn( &block.code[0],ix, gen_ld_rd_off_ra( 11, 48, 3 )=
);
+ ix =3D emit_insn( &block.code[0],ix, gen_ld_rd_off_ra( 0, 16, 9 ) =
);
+ ix =3D emit_insn( &block.code[0],ix, gen_subf_rd_rL_rR( 11, 0, 11 =
) );
+ ix =3D emit_insn( &block.code[0],ix, gen_ld_rd_off_ra( 9, 80, 9 ) =
);
+ ix =3D emit_insn( &block.code[0],ix, gen_add_rd_rL_rR( 10, 9, 11 )=
);
+
+ ix =3D emit_insn( &block.code[0],ix, gen_ld_rd_off_ra( 9, 0, 10 ) =
);
+ ix =3D emit_insn( &block.code[0],ix, gen_mtlr_r( 9 ) );
+ ix =3D emit_insn( &block.code[0],ix, gen_ld_rd_off_ra( 2, 8, 10 ) =
);
+ ix =3D emit_insn( &block.code[0],ix, gen_ld_rd_off_ra( 11, 16, 10 =
) );
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(3, 31) );
+ ix =3D emit_insn( &block.code[0],ix, gen_blr() );
+ TRAP;
+ assert(ix <=3D N_BOOTBLOCK_INSNS);
+
+ /* error:
+ We get here if the kload syscall fails. Write a terse message
+ to stderr saying so, then exit, carrying the error code of the
+ kload call. The latter is saved in r30 across the write() call=
.
+ mr 30,4 (4 contains the error result from kload)
+ imm 2, __NR_write
+ imm 3,2 (2=3Dstderr)
+ addi 4, 31, offset_of_errormsg
+ imm 5, length(errormsg)
+ SYSCALL_SEQUENCE
+ imm 2, __NR_exit
+ mr 3, 30
+ SYSCALL_SEQUENCE
+ =20
+ Well, we shouldn't be alive here. But just in case we do, put
+ a zero word, which will generate SIGILL and definitely stop the
+ party.
+ .word 0
+ */
+ /* fill in the conditional jump */
+ (void)emit_insn( &block.code[0],ix_beq,=20
+ gen_beq_cr7_delta(4*(ix-ix_beq)));
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(30,4) );
+ ix =3D emit_li64( &block.code[0],ix, 2, __nr_kwrite);
+ ix =3D emit_li64( &block.code[0],ix, 3, 2);
+ ix =3D emit_insn( &block.code[0],ix,=20
+ gen_addi_rd_rs_N(4,31,offsetof(AIX5Bootblock,errms=
g)));
+ ix =3D emit_li64( &block.code[0],ix, 5, strlen(bootstrap_errmsg));
+ ix =3D emit_dosc( &block.code[0],ix );
+ ix =3D emit_li64( &block.code[0],ix, 2, __nr__exit);
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(3,30) );
+ ix =3D emit_dosc( &block.code[0],ix );
+ ix =3D emit_insn( &block.code[0],ix, 0 );
+ assert(ix <=3D N_BOOTBLOCK_INSNS);
+
+ } else {
+
+ /* 32-bit sequence */
+ ix =3D emit_li32( &block.code[0],ix, 2, __nr___loadx );
+ ix =3D emit_li32( &block.code[0],ix, 3, VKI_DL_LOAD );
+ ix =3D emit_li32( &block.code[0],ix, 4, 0 );
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(5,4) );
+ ix =3D emit_insn( &block.code[0],ix,=20
+ gen_addi_rd_rs_N(6,31,offsetof(AIX5Bootblock,toolf=
ile)));
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(7,4) );
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(8,4) );
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(9,4) );
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(10,4) );
+ ix =3D emit_dosc( &block.code[0],ix );
+ ix =3D emit_insn( &block.code[0],ix, gen_cmpli_cr7_r_N(4,0) );
+ Int ix_bne =3D ix; /* Patch this later */
+ ix =3D emit_insn( &block.code[0],ix, 0 );
+ assert(ix <=3D N_BOOTBLOCK_INSNS);
+
+ /* Looks like we're good. r3 now points at a standard function
+ descriptor for the entry point of the module we just loaded.
+ Load r2/r11 from the descriptor, then put the address of the
+ bootstrap area in r3, and jump to the code address. Not a
+ call -- we don't intend to return here. Note, must use r30
+ as scratch here since r31 is live.
+ lwz 30, 0(3)
+ mtlr 30
+ lwz 2, 4(3)
+ lwz 11, 8(3)
+ mr 3, 31
+ blr
+ */
+ ix =3D emit_insn( &block.code[0],ix, gen_lwz_rd_off_ra(30, 0, 3));
+ ix =3D emit_insn( &block.code[0],ix, gen_mtlr_r(30) );
+ ix =3D emit_insn( &block.code[0],ix, gen_lwz_rd_off_ra( 2, 4, 3));
+ ix =3D emit_insn( &block.code[0],ix, gen_lwz_rd_off_ra(11, 8, 3));
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(3,31));
+ ix =3D emit_insn( &block.code[0],ix, gen_blr() );
+ assert(ix <=3D N_BOOTBLOCK_INSNS);
+
+ /* error:
+ We get here if the _loadx syscall fails. Write a terse message
+ to stderr saying so, then exit, carrying the error code of the
+ _loadx call. The latter is saved in r30 across the write() cal=
l.
+ mr 30,4 (4 contains the error result from __loadx)
+ imm 2, __NR_write
+ imm 3,2 (2=3Dstderr)
+ addi 4, 31, offset_of_errormsg
+ imm 5, length(errormsg)
+ SYSCALL_SEQUENCE
+ imm 2, __NR_exit
+ mr 3, 30
+ SYSCALL_SEQUENCE
+ =20
+ Well, we shouldn't be alive here. But just in case we do, put
+ a zero word, which will generate SIGILL and definitely stop the
+ party.
+ .word 0
+ */
+ /* fill in the conditional jump */
+ (void)emit_insn( &block.code[0],ix_bne,=20
+ gen_bne_cr7_delta(4*(ix-ix_bne)));
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(30,4) );
+ ix =3D emit_li32( &block.code[0],ix, 2, __nr_kwrite);
+ ix =3D emit_li32( &block.code[0],ix, 3, 2);
+ ix =3D emit_insn( &block.code[0],ix,=20
+ gen_addi_rd_rs_N(4,31,offsetof(AIX5Bootblock,errms=
g)));
+ ix =3D emit_li32( &block.code[0],ix, 5, strlen(bootstrap_errmsg));
+ ix =3D emit_dosc( &block.code[0],ix );
+ ix =3D emit_li32( &block.code[0],ix, 2, __nr__exit);
+ ix =3D emit_insn( &block.code[0],ix, gen_mr_rd_rs(3,30) );
+ ix =3D emit_dosc( &block.code[0],ix );
+ ix =3D emit_insn( &block.code[0],ix, 0 );
+ assert(ix <=3D N_BOOTBLOCK_INSNS);
+
+ }
+
+ VG_(debugLog)(1, "launcher",=20
+ "parent: .. %d instructions emitted\n", ix);
+
+# if 0
+ for (i =3D 0; i < ix; i++) {
+ if (0) printf("code[%d] =3D 0x%08x\n", i, block.code[i]);
+ char buff[100];
+ sprintf(buff, "echo 0x%x | ./ascii2u32", block.code[i]);
+ system(buff);
+ }
+# endif
+
+ /* ------ STEP 3: Find out where to place stuff in the child. ------ =
*/
+
+ /* We'll have to hijack some space in the data section of the main
+ executable. First off, find the first and last pages of said
+ data section. We can't use the text section, because the child
+ is unable to write to its own text section, to undo the
+ compression of the hijacked page. We can't use the stack
+ because it appears, although stacks in AIX 5.3 appear to be
+ executable, the child gets SIGKILL'd after the ptrace detach if
+ its program counter is pointing into its stack. The data
+ section of the main executable appears to be executable, though,
+ so use that.
+
+ This requires wading though the list of loaded modules in the
+ child, to find the main executable. */
+
+ long lr;
+ if (child->is64) {
+ lr =3D ptrace64(PT_LDINFO, (ULong)child->pid,
+ (ULong)(UWord)&ld_info64_array,=20
+ sizeof(ld_info64_array), 0/*ignored*/);
+ } else {
+ lr =3D ptrace64(PT_LDINFO, (ULong)child->pid,
+ (ULong)(UWord)&ld_info32_array,=20
+ sizeof(ld_info32_array), 0/*ignored*/);
+ }
+ VG_(debugLog)(1, "launcher", "parent: ptrace PT_LDINFO got %ld\n", lr=
);
+ if (lr =3D=3D -1)
+ return "ptrace(PT_LDINFO, ...) failed";
+ else=20
+ assert(lr =3D=3D 0);
+
+ /* We have to iterate through the entire array to close the object
+ files that this has opened. Duh. */
+ if (child->is64) {
+ char* p =3D (char*)&ld_info64_array;
+ while (1) {
+ struct __ld_info64* info =3D (struct __ld_info64*)p;
+ =20
+ VG_(debugLog)(1,=20
+ "launcher", "parent: text 0x%llx-0x%llx data 0x%llx-0x%llx\n=
",
+ (Addr64)info->ldinfo_textorg,=20
+ (Addr64)info->ldinfo_textorg + (Addr64)info->ldinfo_textsize=
,
+ (Addr64)info->ldinfo_dataorg,=20
+ (Addr64)info->ldinfo_dataorg + (Addr64)info->ldinfo_datasize
+ );
+
+ Int ir =3D close(info->_file._ldinfo_fd);
+ assert(ir =3D=3D 0);
+ /* The last entry in the array is marked by having a zero
+ offset-link field. */
+ if (info->ldinfo_next =3D=3D 0)
+ break;
+ p +=3D info->ldinfo_next;
+ }
+ } else {
+ char* p =3D (char*)&ld_info32_array;
+ while (1) {
+ struct __ld_info32* info =3D (struct __ld_info32*)p;
+ =20
+ VG_(debugLog)(1,=20
+ "launcher", "parent: text 0x%llx-0x%llx data 0x%llx-0x%llx\n=
",
+ (Addr64)(UWord)info->ldinfo_textorg,=20
+ (Addr64)(UWord)info->ldinfo_textorg + info->ldinfo_textsize,
+ (Addr64)(UWord)info->ldinfo_dataorg,=20
+ (Addr64)(UWord)info->ldinfo_dataorg + info->ldinfo_datasize
+ );
+
+ Int ir =3D close(info->_file._ldinfo_fd);
+ assert(ir =3D=3D 0);
+ /* The last entry in the array is marked by having a zero
+ offset-link field. */
+ if (info->ldinfo_next =3D=3D 0)
+ break;
+ p +=3D info->ldinfo_next;
+ }
+ }
+
+ /* The first entry in that array -- and it is guaranteed to to have
+ at least one entry -- is that of the the main executable. We
+ need to put our bootblock in one of the pages the main
+ executable's data segment. The abovementioned AIX 'ptrace'
+ documentation says:
+
+ To allow a debugger to generate code more easily (in order to
+ handle fast trap instructions, for example), memory from the
+ end of the main program up to the next segment boundary can be
+ modified. That memory is read-only to the process but can be
+ modified by the debugger.
+
+ which would be great if it actually worked reliably; but not so.
+ On AIX 5.2 this is true, but on 5.3 it appears to be impossible
+ to read or write (via ptrace) anything beyond the last page of
+ the executable's text section.
+ */
+ Addr64 c_cand_text_first, c_cand_text_last;
+
+ if (child->is64) {
+ c_cand_text_first
+ =3D (Addr64)ld_info64_array[0].ldinfo_dataorg;
+ c_cand_text_last=20
+ =3D c_cand_text_first
+ + ld_info64_array[0].ldinfo_datasize - 1;
+ } else {
+ c_cand_text_first
+ =3D (Addr64)(UWord)ld_info32_array[0].ldinfo_dataorg;
+ c_cand_text_last=20
+ =3D c_cand_text_first
+ + ld_info32_array[0].ldinfo_datasize - 1;
+ }
+
+ VG_(debugLog)(1, "launcher",=20
+ "parent: candidate first 0x%llx last 0x%llx\n",
+ c_cand_text_first, c_cand_text_last);
+
+ /* Page align the text section limits. */
+ Addr64 c_first_page =3D ROUNDDN_PAGE( c_cand_text_first );
+ Addr64 c_last_page =3D ROUNDDN_PAGE( c_cand_text_last );
+
+ /* It's safe to try out any page p satisfying
+ c_first_page <=3D p && p <=3D c_last_page
+ */
+
+ /* CHOOSE A PAGE. Do a test compression of available pages until
+ we find one for which compression yields enough free space to
+ put the bootblock in. */
+ Int zsize;
+ Addr64 c_chosen_page =3D 0;
+ Addr64 c_page;
+ UChar p_page_unzbuf[PAGE_SIZE];
+ UChar p_page_unzbuf2[PAGE_SIZE];
+ UChar p_page_zbuf[PAGE_SIZE + 384 + 8/*paranoia*/];
+
+ for (c_page =3D c_first_page; c_page <=3D c_last_page; c_page +=3D PA=
GE_SIZE) {
+ assert(IS_PAGE_ALIGNED(c_page));
+ err =3D ptrace_read_page( child, p_page_unzbuf, c_page );
+ if (err)
+ return "read of page from child failed(1)";
+ zsize =3D Huffman_Compress(p_page_unzbuf, p_page_zbuf, PAGE_SIZE);
+ assert(zsize >=3D 0 && zsize <=3D PAGE_SIZE + 384);
+
+ /* Do a test decompression, to check the compress/decompress
+ cycle works properly */
+ Huffman_Uncompress( p_page_zbuf, p_page_unzbuf2,=20
+ PAGE_SIZE + 384, PAGE_SIZE);
+ assert(0 =3D=3D memcmp(p_page_unzbuf, p_page_unzbuf2, PAGE_SIZE));
+
+ VG_(debugLog)(1, "launcher",=20
+ "parent: page 0x%llx has %d usable bytes\n",=20
+ c_page, PAGE_SIZE - zsize);
+
+ if ( (Int)(PAGE_SIZE - zsize)=20
+ >=3D (Int)sizeof(AIX5Bootblock)+8/*paranoia*/) {
+ c_chosen_page =3D c_page;
+ break;
+ }
+ }
+
+ if (c_chosen_page =3D=3D NULL)
+ return "can't find a page with enough free space for bootblock";
+
+ /* Compress the chosen page, leaving the compressed data at the
+ start of the page, and put the bootblock at the end of the
+ page. */
+
+ VG_(debugLog)(1, "launcher",=20
+ "parent: reading page at 0x%llx\n", c_chosen_page);
+
+ err =3D ptrace_read_page( child, p_page_unzbuf, c_chosen_page );
+ if (err)
+ return "read of page from child failed(2)";
+
+ block.adler32 =3D compute_adler32( p_page_unzbuf, PAGE_SIZE );
+ VG_(debugLog)(1, "launcher",=20
+ "parent: adler32 of unz page is 0x%x\n", block.adler=
32);
+
+ memset(p_page_zbuf, 0, sizeof(p_page_zbuf));
+ zsize =3D Huffman_Compress(p_page_unzbuf, p_page_zbuf, PAGE_SIZE);
+ assert(zsize >=3D 0 && zsize <=3D PAGE_SIZE + 384);
+
+ assert(PAGE_SIZE - zsize >=3D sizeof(AIX5Bootblock)+8/*paranoia*/);
+
+ UChar* p_dst =3D p_page_zbuf + PAGE_SIZE - sizeof(AIX5Bootblock);
+ Addr64 c_dst =3D c_chosen_page + PAGE_SIZE - sizeof(AIX5Bootblock);
+ assert(IS_8_ALIGNED(c_dst));
+
+ VG_(debugLog)(1, "launcher",=20
+ "parent: free space starts at 0x%llx in child\n",
+ c_chosen_page + zsize);
+ VG_(debugLog)(1, "launcher",=20
+ "parent: bootblock will be at 0x%llx in child\n",
+ c_dst);
+
+ *(AIX5Bootblock*)p_dst =3D block;
+
+ VG_(debugLog)(1, "launcher",=20
+ "parent: writing page at 0x%llx\n", c_chosen_page);
+
+ err =3D ptrace_write_page( child, c_chosen_page, p_page_zbuf );
+ if (err)
+ return "write of page to child failed";
+
+ /* Do a test read back to ensure ptrace didn't screw up. */
+
+ err =3D ptrace_read_page( child, p_page_unzbuf2, c_chosen_page );
+ if (err)
+ return "test read back of boot page failed (1)";
+ if (0 !=3D memcmp(p_page_zbuf, p_page_unzbuf2, PAGE_SIZE))
+ return "test read back of boot page failed (2)";
+
+ /* Finally .. set the program counter so that when we detach, our
+ magic stub is run, not the original program. */
+
+ VG_(debugLog)(1, "launcher",=20
+ "parent: set child's pc to 0x%llx\n",
+ c_dst + offsetof(AIX5Bootblock,code) );
+ err =3D ptrace_put_pc ( child, c_dst + offsetof(AIX5Bootblock,code) )=
;
+ if (err)
+ return "write of new initial pc into child failed";
+
+ VG_(debugLog)(1, "launcher",=20
+ "parent: set child's r31 to 0x%llx\n", c_dst);
+ err =3D ptrace_put_r31 ( child, c_dst );
+ if (err)
+ return "write of new r31 into child failed";
+
+ return NULL; /* success */
+}
+
+
+/* -------------------------------------------------------------- */
+/* --- --- */
+/* --- END write bootstrap loader into child process --- */
+/* --- --- */
+/* -------------------------------------------------------------- */
+
+static void barf ( int exitcode, char* argv0, char* msg )
+{
+ fprintf(stderr, "%s: %s\n", argv0, msg);
+ exit(exitcode);
+}
+
+int main ( int argc, char** argv, char** envp )
+{
+ Child child;
+ Int i, loglevel;
+ const char *toolname =3D NULL;
+ const char *clientname =3D NULL;
+
+ /* First, look in our own /proc/<pid>/sysent file to find
+ the syscall numbers for kwrite and _getpid. These are needed
+ to make the VG_(debugLog) usable. We'll temporarily use
+ the sysent_buf used by write_bootstrap_loader_into_child for this
+ purpose. */
+
+ char sysent_name[50];
+ FILE* sysent_file;
+ int sysent_used =3D 0;
+ prsysent_t* sysent_hdr;
+
+ child.pid =3D 0;
+ child.is64 =3D False;
+
+ sprintf(sysent_name, "/proc/%d/sysent", getpid());
+ sysent_file =3D fopen(sysent_name, "r");
+ if (sysent_file =3D=3D NULL)
+ barf(1, argv[0], "Can't open my own /proc/<pid>/sysent file");
+
+ sysent_used =3D fread(sysent_buf, 1, LAUNCHER_SYSENT_SIZE, sysent_fil=
e);
+ if (sysent_used =3D=3D 0)
+ barf(1, argv[0], "Error reading my own /proc/<pid>/sysent file");
+ if (sysent_used =3D=3D LAUNCHER_SYSENT_SIZE)
+ barf(1, argv[0], "LAUNCHER_SYSENT_SIZE is too low; increase and re=
compile");
+ assert(sysent_used > 0 && sysent_used < LAUNCHER_SYSENT_SIZE);
+
+ fclose(sysent_file);
+
+ sysent_hdr =3D (prsysent_t*)&sysent_buf[0];
+
+ /* Find some syscall numbers for the child. Note, we copy them
+ from our own /proc/../sysent file, which isn't really right. */
+ Word __nr__getpid =3D -1;
+ Word __nr_kwrite =3D -1;
+ for (i =3D 0; i < sysent_hdr->pr_nsyscalls; i++) {
+ char* name =3D &sysent_buf[ sysent_hdr->pr_syscall[i].pr_nameoff ]=
;
+ int nmbr =3D sysent_hdr->pr_syscall[i].pr_number;
+ if (0 =3D=3D strcmp(name, "_getpid"))
+ __nr__getpid =3D nmbr;
+ if (0 =3D=3D strcmp(name, "kwrite"))
+ __nr_kwrite =3D nmbr;
+ }
+ if (__nr__getpid =3D=3D -1 || __nr_kwrite =3D=3D -1)
+ barf(1, argv[0], "can't establish syscall #s needed for startup");
+
+ /* "Tell" m_vkiscnums about them */
+ __NR_getpid =3D __nr__getpid;
+ __NR_write =3D __nr_kwrite;
+
+ /* Right, now we're safe to start the debug logging system. */
+ /* Start the debugging-log system ASAP. First find out how many
+ "-d"s were specified. This is a pre-scan of the command line.
+ At the same time, look for the tool name. */
+ loglevel =3D 0;
+ for (i =3D 1; i < argc; i++) {
+ if (argv[i][0] !=3D '-') {
+ clientname =3D argv[i];
+ break;
+ }
+ if (0 =3D=3D strcmp(argv[i], "--")) {
+ if (i+1 < argc)
+ clientname =3D argv[i+1];
+ break;
+ }
+ if (0 =3D=3D strcmp(argv[i], "-d"))
+ loglevel++;
+ if (0 =3D=3D strncmp(argv[i], "--tool=3D", 7))
+ toolname =3D argv[i] + 7;
+ }
+
+ /* ... and start the debug logger. Now we can safely emit logging
+ messages all through startup. */
+ VG_(debugLog_startup)(loglevel, "Stage 1");
+
+ /* Make sure we know which tool we're using */
+ if (toolname) {
+ VG_(debugLog)(1, "launcher", "tool '%s' requested\n", toolname);
+ } else {
+ VG_(debugLog)(1, "launcher",
+ "no tool requested, defaulting to 'memcheck'\n");
+ toolname =3D "memcheck";
+ }
+
+ /* Do some preliminary sanity checks */
+ long pagesize =3D sysconf(_SC_PAGESIZE);
+ if (pagesize !=3D 4096)
+ barf(1, argv[0], "config error: sysconf(_SC_PAGESIZE) is not 4096"=
);
+
+ assert(PAGE_SIZE =3D=3D 4096); /* stay sane */
+
+ if (argc < 2 || toolname =3D=3D NULL || clientname =3D=3D NULL)
+ barf(1, argv[0], "usage: valgrind [args-for-valgrind] prog args");=
=20
+
+ /* Find the client, and figure out if it's a 32- or 64-bit
+ executable. */
+ VG_(debugLog)(1, "launcher", "searching for client in $PATH\n");
+ if (strchr(clientname, '/') =3D=3D NULL)
+ clientname =3D find_client(clientname);
+ VG_(debugLog)(1, "launcher", "found %s\n", clientname);
+
+ Int client_exekind =3D examine_client ( clientname );
+ switch (client_exekind) {
+ case 32:=20
+ child.is64 =3D False;=20
+ break;
+ case 64:=20
+ child.is64 =3D True;=20
+ break;
+ default:=20
+ fprintf(stderr, "%s: requested executable %s\n",=20
+ argv[0], clientname);
+ fprintf(stderr, "%s: not found, or is not a valid XCOFF32 "
+ "or XCOFF64 executable.\n", argv[0]);
+ return 1;
+ }
+
+ VG_(debugLog)(1, "launcher", "client is an XCOFF%d executable\n",=20
+ client_exekind);
+
+ const char* valgrind_lib =3D VG_LIBDIR;
+ const char* platform =3D child.is64 ? "ppc64-aix5" : "ppc32-aix5";
+
+ VG_(debugLog)(1, "launcher", "looking for the tool file\n");
+
+ char* toolfile =3D malloc(strlen(valgrind_lib)=20
+ + strlen(toolname) + strlen(platform) + 3);
+ if (toolfile =3D=3D NULL) {
+ fprintf(stderr,"%s: malloc of toolfile failed\n", argv[0]);
+ return 1;
+ }
+ sprintf(toolfile, "%s/%s/%s", valgrind_lib, platform, toolname);
+
+ if (!file_exists(toolfile)) {
+ fprintf(stderr,"%s: can't stat %s\n", argv[0], toolfile);
+ return 1;
+ }
+
+ /* Force the client to use a 1:1 threading model - this works
+ because the client inherits our environment. */
+ VG_(debugLog)(1, "launcher", "doing putenv(\"AIXTHREAD_SCOPE=3DS\")\n=
");
+ Int putenv_err =3D putenv("AIXTHREAD_SCOPE=3DS");
+ if (putenv_err) {
+ fprintf(stderr,"%s: putenv(\"AIXTHREAD_SCOPE=3DS\") failed\n", arg=
v[0]);
+ return 1;
+ }
+
+ VG_(debugLog)(1, "launcher", "doing putenv(\"MP_SHARED_MEMORY=3Dno\")=
\n");
+ putenv_err =3D putenv("MP_SHARED_MEMORY=3Dno");
+ if (putenv_err) {
+ fprintf(stderr,"%s: putenv(\"MP_SHARED_MEMORY=3Dno\") failed\n", a=
rgv[0]);
+ return 1;
+ }
+
+ /* Also, cook up the fully qualified name of this executable. The
+ following is a kludge, but I don't see how to really get the
+ fully qualified name on AIX. */
+ char* up_n_down =3D "/../../bin/valgrind";
+ char* launcher =3D malloc(strlen(valgrind_lib)
+ + strlen(up_n_down) + 2);
+ if (launcher =3D=3D NULL) {
+ fprintf(stderr,"%s: malloc of launcher failed\n", argv[0]);
+ return 1;
+ }
+ sprintf(launcher, "%s%s", valgrind_lib, up_n_down);
+
+ if (!file_exists(launcher)) {
+ fprintf(stderr,"%s: can't stat %s\n", argv[0], launcher);
+ return 1;
+ }
+
+ /* First, fork. =20
+
+ In the child, ask for a ptrace, then exec argv[2 ..]. This
+ causes the kernel to complete the exec, hence loading the
+ child, but does not start it; instead the child remains frozen
+ so that the parent can mess with it via ptrace().
+ */
+ VG_(debugLog)(1, "launcher", "doing fork()\n");
+ child.pid =3D fork();
+ if (child.pid =3D=3D -1) {
+ fprintf(stderr,"%s: fork() failed\n", argv[0]);
+ return 1;
+ }
+
+ if (child.pid =3D=3D 0) {
+ /* --- CHILD --- */
+ VG_(debugLog)(1, "launcher", "child: before ptrace\n");
+ long rl =3D ptrace64(PT_TRACE_ME, 0,0,0,0);
+ if (rl !=3D 0) {
+ fprintf(stderr,"%s: child: ptrace(PT_TRACE_ME, ...) failed\n", =
argv[0]);
+ fprintf(stderr,"%s: ", argv[0]);
+ perror(NULL);
+ fflush(stderr);
+ _exit(1);
+ }
+ VG_(debugLog)(1, "launcher", "child: before execve\n");
+
+ /* make VALGRIND_LAUNCHER point at something plausible. */
+ VG_(debugLog)(1, "launcher", "child: launcher =3D %s\n", launcher)=
;
+ int r =3D setenv("VALGRIND_LAUNCHER", launcher, 1/*overwrite*/);
+ if (r) {
+ /* setenv failed. */
+ fprintf(stderr,"%s: child: setenv failed\n", argv[0]);
+ fprintf(stderr,"%s: ", argv[0]);
+ perror(NULL);
+ fflush(stderr);
+ _exit(1);
+ /* NOTREACHED */
+ }
+
+ /* This is kind-of strange. We're execvp-ing the client but
+ argv[0] is the toolname, which is irrelevant - m_main ignores
+ it. However, setting it like this at least makes m_main's
+ view of the world (as far as the argv goes) look the same as
+ it does in Linux-land:=20
+ tool-exe-name [args for V] client-name [args for client]
+ */
+ argv[0] =3D toolfile;
+ int ri =3D execvp(clientname, &argv[0]);
+ /* WE ONLY GET HERE IF execve FAILED */
+ assert(ri =3D=3D -1);
+ fprintf(stderr,"%s: exec failed: %s: ", argv[0], clientname);
+ perror("");
+ return 1;
+ /* NOTREACHED */
+ }
+
+ /* --- PARENT --- */
+ VG_(debugLog)(1, "launcher", "parent: waitpid-ing for child\n");
+ int status;
+ /* Wait to hear back from the child. */
+ pid_t p2 =3D waitpid(child.pid, &status, 0);
+ /* We could hear back for two reasons. (1) the exec was
+ successful, and because the child is being ptraced, it is now
+ waiting for the parent. (2) the exec failed, and so the child
+ did _exit(). */
+ VG_(debugLog)(1, "launcher", "parent: waitpid got pid %d\n", (int)p2)=
;
+ VG_(debugLog)(1, "launcher", "parent: waitpid got status 0x%x\n", sta=
tus);
+ assert(p2 =3D=3D child.pid); /* Huh?! We only have one child. */
+
+ if (WIFEXITED(status)) {
+ /* Case (2) - exec failed. */
+ fprintf(stderr, "parent: child's exec failed.\n");
+ return 0;
+ }
+
+ /* else case (1) must apply */
+ assert(WIFSTOPPED(status));
+
+ /* ------ BEGIN write bootstrap pages into child ------ */
+
+ /* In this section, if for any reason we can't continue to the
+ child-detach and so have to give up, we have to kill the child,
+ else it'll become a zombie. That's what the code at
+ latched_error: does. */
+ char* badness=20
+ =3D write_bootstrap_loader_into_child ( &child, toolfile );
+ /* Returns NULL if no error, else points to a string of at least
+ some descriptiveness. */
+ if (badness)
+ goto latched_error;
+
+ /* ------ END write bootstrap pages into child ------ */
+
+ VG_(debugLog)(1, "launcher", "parent: detaching child\n");
+ long lr =3D ptrace64(PT_DETACH, (ULong)child.pid, 0, SIGCONT, 0);
+ VG_(debugLog)(1, "launcher", "parent: detach got %ld\n", lr);
+ assert(lr =3D=3D 0);
+ VG_(debugLog)(1, "launcher", "parent: waiting for child to finish\n")=
;
+
+ p2 =3D waitpid(child.pid, &status, 0);
+ assert(p2 =3D=3D child.pid);
+ if (0)
+ fprintf(stderr,"parent: child finished, status 0x%x 0x%x\n",=20
+ status, WEXITSTATUS(status));
+
+ if (WIFEXITED(status)) {
+ VG_(debugLog)(1, "launcher",=20
+ "parent: child finished normally, exit code %d\n"=
,
+ WEXITSTATUS(status));
+ return WEXITSTATUS(status);
+ }=20
+ else if (WIFSIGNALED(status)) {
+ VG_(debugLog)(1, "launcher",
+ "parent: child exited on signal %d\n",
+ (int)WTERMSIG(status));
+ /* Since the child exited with a signal, we'd better
+ whack ourselves on the head with the same signal. */
+ kill( getpid(), (int)WTERMSIG(status) );
+ /* presumably NOTREACHED? */
+ return 0; /* This is completely bogus */
+ }=20
+ else {
+ /* erm. Can we ever get here? */
+ assert(0);
+ return 0;
+ }
+
+ latched_error:
+ /* We get here if there was some kind of problem messing with the
+ child whilst we still had it latched by ptrace. In this case we
+ ...
[truncated message content] |
Author: sewardj
Date: 2006-10-17 01:28:22 +0100 (Tue, 17 Oct 2006)
New Revision: 1669
Log:
Merge r1663-r1666:
- AIX5 build changes
- genoffsets.c: print the offsets of a few more ppc registers
- Get rid of a bunch of ad-hoc hacks which hardwire in certain
assumptions about guest and host ABIs. Instead pass that info
in a VexMiscInfo structure. This cleans up various grotty bits.
- Add to ppc32 guest state, redirection-stack stuff already present
in ppc64 guest state. This is to enable function redirection/
wrapping in the presence of TOC pointers in 32-bit mode.
- Add to both ppc32 and ppc64 guest states, a new pseudo-register
LR_AT_SC. This holds the link register value at the most recent
'sc', so that AIX can back up to restart a syscall if needed.
- Add to both ppc32 and ppc64 guest states, a SPRG3 register.
- Use VexMiscInfo to handle 'sc' on AIX differently from Linux:
on AIX, 'sc' continues at the location stated in the link=20
register, not at the next insn.
Added:
trunk/newline.txt
trunk/quote.txt
Modified:
trunk/Makefile
trunk/auxprogs/genoffsets.c
trunk/priv/guest-amd64/gdefs.h
trunk/priv/guest-amd64/toIR.c
trunk/priv/guest-generic/bb_to_IR.c
trunk/priv/guest-generic/bb_to_IR.h
trunk/priv/guest-ppc/gdefs.h
trunk/priv/guest-ppc/ghelpers.c
trunk/priv/guest-ppc/toIR.c
trunk/priv/guest-x86/gdefs.h
trunk/priv/guest-x86/toIR.c
trunk/priv/host-amd64/hdefs.h
trunk/priv/host-amd64/isel.c
trunk/priv/host-ppc/hdefs.c
trunk/priv/host-ppc/hdefs.h
trunk/priv/host-ppc/isel.c
trunk/priv/host-x86/hdefs.h
trunk/priv/host-x86/isel.c
trunk/priv/main/vex_main.c
trunk/pub/libvex.h
trunk/pub/libvex_basictypes.h
trunk/pub/libvex_guest_ppc32.h
trunk/pub/libvex_guest_ppc64.h
trunk/test_main.c
Modified: trunk/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/Makefile 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/Makefile 2006-10-17 00:28:22 UTC (rev 1669)
@@ -137,7 +137,19 @@
if [ ! -f TAG_ppc64_linux ] ; then rm -f $(LIB_OBJS) TAG_* libvex.a ; f=
i
touch TAG_ppc64_linux
=20
+libvex_ppc32_aix5.a: TAG_ppc32_aix5 libvex.a
+ mv -f libvex.a libvex_ppc32_aix5.a
+TAG_ppc32_aix5:
+ if [ ! -f TAG_ppc32_aix5 ] ; then rm -f $(LIB_OBJS) TAG_* libvex.a ; fi
+ touch TAG_ppc32_aix5
=20
+libvex_ppc64_aix5.a: TAG_ppc64_aix5 libvex.a
+ mv -f libvex.a libvex_ppc64_aix5.a
+TAG_ppc64_aix5:
+ if [ ! -f TAG_ppc64_aix5 ] ; then rm -f $(LIB_OBJS) TAG_* libvex.a ; fi
+ touch TAG_ppc64_aix5
+
+
# This doesn't get rid of priv/main/vex_svnversion.h, because
# that can't be regenerated in the final Valgrind tarball, and
# so if 'make clean' did get rid of it, then in the tarball,
@@ -148,9 +160,10 @@
=20
version:
rm -f priv/main/vex_svnversion.h
- echo -n "\"" > priv/main/vex_svnversion.h
+ cat quote.txt >> priv/main/vex_svnversion.h
svnversion -n . >> priv/main/vex_svnversion.h
- echo "\"" >> priv/main/vex_svnversion.h
+ cat quote.txt >> priv/main/vex_svnversion.h
+ cat newline.txt >> priv/main/vex_svnversion.h
=20
minidist: version
rm -f vex--minidist-2005MMDD.tar
Modified: trunk/auxprogs/genoffsets.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/auxprogs/genoffsets.c 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/auxprogs/genoffsets.c 2006-10-17 00:28:22 UTC (rev 1669)
@@ -143,6 +143,9 @@
printf("#define OFFSET_ppc32_GPR0 %3d\n",
offsetof(VexGuestPPC32State,guest_GPR0));
=20
+ printf("#define OFFSET_ppc32_GPR2 %3d\n",
+ offsetof(VexGuestPPC32State,guest_GPR2));
+
printf("#define OFFSET_ppc32_GPR3 %3d\n",
offsetof(VexGuestPPC32State,guest_GPR3));
=20
@@ -161,6 +164,12 @@
printf("#define OFFSET_ppc32_GPR8 %3d\n",
offsetof(VexGuestPPC32State,guest_GPR8));
=20
+ printf("#define OFFSET_ppc32_GPR9 %3d\n",
+ offsetof(VexGuestPPC32State,guest_GPR9));
+
+ printf("#define OFFSET_ppc32_GPR10 %3d\n",
+ offsetof(VexGuestPPC32State,guest_GPR10));
+
printf("#define OFFSET_ppc32_CIA %3d\n",
offsetof(VexGuestPPC32State,guest_CIA));
=20
@@ -173,6 +182,9 @@
printf("#define OFFSET_ppc64_GPR0 %4d\n",
offsetof(VexGuestPPC64State,guest_GPR0));
=20
+ printf("#define OFFSET_ppc64_GPR2 %4d\n",
+ offsetof(VexGuestPPC64State,guest_GPR2));
+
printf("#define OFFSET_ppc64_GPR3 %4d\n",
offsetof(VexGuestPPC64State,guest_GPR3));
=20
@@ -191,6 +203,12 @@
printf("#define OFFSET_ppc64_GPR8 %4d\n",
offsetof(VexGuestPPC64State,guest_GPR8));
=20
+ printf("#define OFFSET_ppc64_GPR9 %4d\n",
+ offsetof(VexGuestPPC64State,guest_GPR9));
+
+ printf("#define OFFSET_ppc64_GPR10 %4d\n",
+ offsetof(VexGuestPPC64State,guest_GPR10));
+
printf("#define OFFSET_ppc64_CIA %4d\n",
offsetof(VexGuestPPC64State,guest_CIA));
=20
Added: trunk/newline.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/newline.txt (rev 0)
+++ trunk/newline.txt 2006-10-17 00:28:22 UTC (rev 1669)
@@ -0,0 +1 @@
+
Modified: trunk/priv/guest-amd64/gdefs.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-amd64/gdefs.h 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/guest-amd64/gdefs.h 2006-10-17 00:28:22 UTC (rev 1669)
@@ -66,6 +66,7 @@
Addr64 guest_IP,
VexArch guest_arch,
VexArchInfo* archinfo,
+ VexMiscInfo* miscinfo,
Bool host_bigendian );
=20
/* Used by the optimiser to specialise calls to helpers. */
Modified: trunk/priv/guest-amd64/toIR.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-amd64/toIR.c 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/guest-amd64/toIR.c 2006-10-17 00:28:22 UTC (rev 1669)
@@ -1931,14 +1931,24 @@
generates an AbiHint to say that -128(%rsp) .. -1(%rsp) should now
be regarded as uninitialised.
*/
-static void make_redzone_AbiHint ( IRTemp new_rsp, HChar* who )
+static=20
+void make_redzone_AbiHint ( VexMiscInfo* vmi, IRTemp new_rsp, HChar* who=
)
{
+ Int szB =3D vmi->guest_stack_redzone_size;
+ vassert(szB >=3D 0);
+
+ /* A bit of a kludge. Currently the only AbI we've guested AMD64
+ for is ELF. So just check it's the expected 128 value
+ (paranoia). */
+ vassert(szB =3D=3D 128);
+
if (0) vex_printf("AbiHint: %s\n", who);
vassert(typeOfIRTemp(irbb->tyenv, new_rsp) =3D=3D Ity_I64);
- stmt( IRStmt_AbiHint(=20
- binop(Iop_Sub64, mkexpr(new_rsp), mkU64(128)),=20
- 128=20
- ));
+ if (szB > 0)
+ stmt( IRStmt_AbiHint(=20
+ binop(Iop_Sub64, mkexpr(new_rsp), mkU64(szB)),=20
+ szB
+ ));
}
=20
=20
@@ -3626,7 +3636,8 @@
=20
/* Group 5 extended opcodes. */
static
-ULong dis_Grp5 ( Prefix pfx, Int sz, Long delta, DisResult* dres )
+ULong dis_Grp5 ( VexMiscInfo* vmi,
+ Prefix pfx, Int sz, Long delta, DisResult* dres )
{
Int len;
UChar modrm;
@@ -3666,7 +3677,7 @@
assign(t2, binop(Iop_Sub64, getIReg64(R_RSP), mkU64(8)));
putIReg64(R_RSP, mkexpr(t2));
storeLE( mkexpr(t2), mkU64(guest_RIP_bbstart+delta+1));
- make_redzone_AbiHint(t2, "call-Ev(reg)");
+ make_redzone_AbiHint(vmi, t2, "call-Ev(reg)");
jmp_treg(Ijk_Call,t3);
dres->whatNext =3D Dis_StopHere;
showSz =3D False;
@@ -3721,7 +3732,7 @@
assign(t2, binop(Iop_Sub64, getIReg64(R_RSP), mkU64(8)));
putIReg64(R_RSP, mkexpr(t2));
storeLE( mkexpr(t2), mkU64(guest_RIP_bbstart+delta+len));
- make_redzone_AbiHint(t2, "call-Ev(mem)");
+ make_redzone_AbiHint(vmi, t2, "call-Ev(mem)");
jmp_treg(Ijk_Call,t3);
dres->whatNext =3D Dis_StopHere;
showSz =3D False;
@@ -7565,7 +7576,7 @@
//.. }
=20
static
-void dis_ret ( ULong d64 )
+void dis_ret ( VexMiscInfo* vmi, ULong d64 )
{
IRTemp t1 =3D newTemp(Ity_I64);=20
IRTemp t2 =3D newTemp(Ity_I64);
@@ -7574,7 +7585,7 @@
assign(t2, loadLE(Ity_I64,mkexpr(t1)));
assign(t3, binop(Iop_Add64, mkexpr(t1), mkU64(8+d64)));
putIReg64(R_RSP, mkexpr(t3));
- make_redzone_AbiHint(t3, "ret");
+ make_redzone_AbiHint(vmi, t3, "ret");
jmp_treg(Ijk_Ret,t2);
}
=20
@@ -8218,7 +8229,8 @@
Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
void* callback_opaque,
Long delta64,
- VexArchInfo* archinfo=20
+ VexArchInfo* archinfo,
+ VexMiscInfo* vmi
)
{
IRType ty;
@@ -12170,7 +12182,7 @@
case 0xC3: /* RET */
if (haveF2(pfx)) goto decode_failure;
/* F3 is acceptable on AMD. */
- dis_ret(0);
+ dis_ret(vmi, 0);
dres.whatNext =3D Dis_StopHere;
DIP(haveF3(pfx) ? "rep ; ret\n" : "ret\n");
break;
@@ -12184,7 +12196,7 @@
assign(t1, binop(Iop_Sub64, getIReg64(R_RSP), mkU64(8)));
putIReg64(R_RSP, mkexpr(t1));
storeLE( mkexpr(t1), mkU64(guest_RIP_bbstart+delta));
- make_redzone_AbiHint(t1, "call-d32");
+ make_redzone_AbiHint(vmi, t1, "call-d32");
if (resteerOkFn( callback_opaque, (Addr64)d64) ) {
/* follow into the call target. */
dres.whatNext =3D Dis_Resteer;
@@ -13711,7 +13723,7 @@
=20
case 0xFF: /* Grp5 Ev */
if (haveF2orF3(pfx)) goto decode_failure;
- delta =3D dis_Grp5 ( pfx, sz, delta, &dres );
+ delta =3D dis_Grp5 ( vmi, pfx, sz, delta, &dres );
break;
=20
/* ------------------------ Escapes to 2-byte opcodes -- */
@@ -14340,6 +14352,7 @@
Addr64 guest_IP,
VexArch guest_arch,
VexArchInfo* archinfo,
+ VexMiscInfo* miscinfo,
Bool host_bigendian_IN )
{
DisResult dres;
@@ -14357,7 +14370,7 @@
guest_RIP_next_mustcheck =3D False;
=20
dres =3D disInstr_AMD64_WRK ( put_IP, resteerOkFn, callback_opaque,
- delta, archinfo );
+ delta, archinfo, miscinfo );
=20
/* If disInstr_AMD64_WRK tried to figure out the next rip, check it
got it right. Failure of this assertion is serious and denotes
Modified: trunk/priv/guest-generic/bb_to_IR.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-generic/bb_to_IR.c 2006-10-04 18:18:22 UTC (rev 1668=
)
+++ trunk/priv/guest-generic/bb_to_IR.c 2006-10-17 00:28:22 UTC (rev 1669=
)
@@ -101,6 +101,7 @@
/*IN*/ Bool host_bigendian,
/*IN*/ VexArch arch_guest,
/*IN*/ VexArchInfo* archinfo_guest,
+ /*IN*/ VexMiscInfo* miscinfo_both,
/*IN*/ IRType guest_word_type,
/*IN*/ Bool do_self_check,
/*IN*/ Bool (*preamble_function)(void*,IRBB=
*),
@@ -234,6 +235,7 @@
guest_IP_curr_instr,
arch_guest,
archinfo_guest,
+ miscinfo_both,
host_bigendian );
=20
/* stay sane ... */
@@ -342,6 +344,7 @@
=20
UInt len2check, adler32;
IRTemp tistart_tmp, tilen_tmp;
+ HWord p_adler_helper;
=20
vassert(vge->n_used =3D=3D 1);
len2check =3D vge->len[0];
@@ -373,6 +376,10 @@
irbb->stmts[selfcheck_idx+3]
=3D IRStmt_Put( offB_TILEN, IRExpr_Tmp(tilen_tmp) );
=20
+ p_adler_helper =3D miscinfo_both->host_ppc_calls_use_fndescrs
+ ? ((HWord*)(&genericg_compute_adler32))[0]
+ : (HWord)&genericg_compute_adler32;
+
irbb->stmts[selfcheck_idx+4]
=3D IRStmt_Exit(=20
IRExpr_Binop(=20
@@ -381,11 +388,7 @@
Ity_I32,=20
2/*regparms*/,=20
"genericg_compute_adler32",
-#if defined(__powerpc__) && defined(__powerpc64__)
- (void*)((ULong*)(&genericg_compute_adler32))[0],
-#else
- &genericg_compute_adler32,
-#endif
+ (void*)p_adler_helper,
mkIRExprVec_2(=20
mkIRExpr_HWord( (HWord)guest_code ),=20
mkIRExpr_HWord( (HWord)len2check )
Modified: trunk/priv/guest-generic/bb_to_IR.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-generic/bb_to_IR.h 2006-10-04 18:18:22 UTC (rev 1668=
)
+++ trunk/priv/guest-generic/bb_to_IR.h 2006-10-17 00:28:22 UTC (rev 1669=
)
@@ -143,6 +143,9 @@
/*IN*/ VexArch guest_arch,
/*IN*/ VexArchInfo* archinfo,
=20
+ /* Misc info about guest and host */
+ /*IN*/ VexMiscInfo* miscinfo,
+
/* Is the host bigendian? */
/*IN*/ Bool host_bigendian
=20
@@ -164,6 +167,7 @@
/*IN*/ Bool host_bigendian,
/*IN*/ VexArch arch_guest,
/*IN*/ VexArchInfo* archinfo_guest,
+ /*IN*/ VexMiscInfo* miscinfo_both,
/*IN*/ IRType guest_word_type,
/*IN*/ Bool do_self_check,
/*IN*/ Bool (*preamble_function)(void*,IRBB=
*),
Modified: trunk/priv/guest-ppc/gdefs.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-ppc/gdefs.h 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/guest-ppc/gdefs.h 2006-10-17 00:28:22 UTC (rev 1669)
@@ -67,6 +67,7 @@
Addr64 guest_IP,
VexArch guest_arch,
VexArchInfo* archinfo,
+ VexMiscInfo* miscinfo,
Bool host_bigendian );
=20
/* Used by the optimiser to specialise calls to helpers. */
Modified: trunk/priv/guest-ppc/ghelpers.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-ppc/ghelpers.c 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/guest-ppc/ghelpers.c 2006-10-17 00:28:22 UTC (rev 1669)
@@ -78,7 +78,7 @@
/* Reads a complete, consistent 64-bit TB value. */
ULong ppcg_dirtyhelper_MFTB ( void )
{
-# if defined(__powerpc__)
+# if defined(__powerpc__) || defined(_AIX)
ULong res;
UInt lo, hi1, hi2;
while (1) {
@@ -320,6 +320,7 @@
/* VISIBLE TO LIBVEX CLIENT */
void LibVEX_GuestPPC32_initialise ( /*OUT*/VexGuestPPC32State* vex_state=
)
{
+ Int i;
vex_state->guest_GPR0 =3D 0;
vex_state->guest_GPR1 =3D 0;
vex_state->guest_GPR2 =3D 0;
@@ -464,6 +465,14 @@
vex_state->guest_TILEN =3D 0;
=20
vex_state->guest_NRADDR =3D 0;
+ vex_state->guest_NRADDR_GPR2 =3D 0;
+
+ vex_state->guest_REDIR_SP =3D -1;
+ for (i =3D 0; i < VEX_GUEST_PPC32_REDIR_STACK_SIZE; i++)
+ vex_state->guest_REDIR_STACK[i] =3D 0;
+
+ vex_state->guest_CIA_AT_SC =3D 0;
+ vex_state->guest_SPRG3_RO =3D 0;
}
=20
=20
@@ -620,6 +629,9 @@
vex_state->guest_REDIR_SP =3D -1;
for (i =3D 0; i < VEX_GUEST_PPC64_REDIR_STACK_SIZE; i++)
vex_state->guest_REDIR_STACK[i] =3D 0;
+
+ vex_state->guest_CIA_AT_SC =3D 0;
+ vex_state->guest_SPRG3_RO =3D 0;
}
=20
=20
@@ -733,7 +745,7 @@
=20
/* Describe any sections to be regarded by Memcheck as
'always-defined'. */
- .n_alwaysDefd =3D 8,
+ .n_alwaysDefd =3D 12,
=20
.alwaysDefd=20
=3D { /* 0 */ ALWAYSDEFD32(guest_CIA),
@@ -743,7 +755,11 @@
/* 4 */ ALWAYSDEFD32(guest_VSCR),
/* 5 */ ALWAYSDEFD32(guest_FPROUND),
/* 6 */ ALWAYSDEFD32(guest_RESVN),
- /* 7 */ ALWAYSDEFD32(guest_NRADDR)
+ /* 7 */ ALWAYSDEFD32(guest_NRADDR),
+ /* 8 */ ALWAYSDEFD32(guest_NRADDR_GPR2),
+ /* 9 */ ALWAYSDEFD32(guest_REDIR_SP),
+ /* 10 */ ALWAYSDEFD32(guest_REDIR_STACK),
+ /* 11 */ ALWAYSDEFD32(guest_CIA_AT_SC)
}
};
=20
@@ -767,7 +783,7 @@
=20
/* Describe any sections to be regarded by Memcheck as
'always-defined'. */
- .n_alwaysDefd =3D 11,
+ .n_alwaysDefd =3D 12,
=20
.alwaysDefd=20
=3D { /* 0 */ ALWAYSDEFD64(guest_CIA),
@@ -780,7 +796,8 @@
/* 7 */ ALWAYSDEFD64(guest_NRADDR),
/* 8 */ ALWAYSDEFD64(guest_NRADDR_GPR2),
/* 9 */ ALWAYSDEFD64(guest_REDIR_SP),
- /* 10 */ ALWAYSDEFD64(guest_REDIR_STACK)
+ /* 10 */ ALWAYSDEFD64(guest_REDIR_STACK),
+ /* 11 */ ALWAYSDEFD64(guest_CIA_AT_SC)
}
};
=20
Modified: trunk/priv/guest-ppc/toIR.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-ppc/toIR.c 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/guest-ppc/toIR.c 2006-10-17 00:28:22 UTC (rev 1669)
@@ -75,7 +75,7 @@
Non-Java mode would give us more inaccuracy, as our intermediate
results would then be zeroed, too.
=20
- - 64-bit mode: AbiHints for the stack red zone are only emitted for
+ - AbiHints for the stack red zone are only emitted for
unconditional calls and returns (bl, blr). They should also be
emitted for conditional calls and returns, but we don't have a=20
way to express that right now. Ah well.
@@ -102,7 +102,7 @@
7C210B78 (or 1,1,1) %R3 =3D client_request ( %R4 )
7C421378 (or 2,2,2) %R3 =3D guest_NRADDR
7C631B78 (or 3,3,3) branch-and-link-to-noredir %R11
- 7C842378 (or 4,4,4) %R3 =3D guest_NRADDR_GPR2 (64-bit mode only)
+ 7C842378 (or 4,4,4) %R3 =3D guest_NRADDR_GPR2
=20
Any other bytes following the 16-byte preamble are illegal and
constitute a failure in instruction decoding. This all assumes
@@ -178,17 +178,21 @@
// Given a pointer to a function as obtained by "& functionname" in C,
// produce a pointer to the actual entry point for the function. For
// most platforms it's the identity function. Unfortunately, on
-// ppc64-linux it isn't (sigh).
-static void* fnptr_to_fnentry( void* f )
+// ppc64-linux it isn't (sigh) and ditto for ppc32-aix5 and
+// ppc64-aix5.
+static void* fnptr_to_fnentry( VexMiscInfo* vmi, void* f )
{
-#if defined(__powerpc64__)
- /* f is a pointer to a 3-word function descriptor, of which
- the first word is the entry address. */
- ULong* fdescr =3D (ULong*)f;
- return (void*)(fdescr[0]);
-#else
- return f;
-#endif
+ if (vmi->host_ppc_calls_use_fndescrs) {
+ /* f is a pointer to a 3-word function descriptor, of which the
+ first word is the entry address. */
+ /* note, this is correct even with cross-jitting, since this is
+ purely a host issue, not a guest one. */
+ HWord* fdescr =3D (HWord*)f;
+ return (void*)(fdescr[0]);
+ } else {
+ /* Simple; "& f" points directly at the code for f. */
+ return f;
+ }
}
=20
=20
@@ -213,27 +217,26 @@
(mode64 ? offsetof(VexGuestPPC64State, _x) : \
offsetof(VexGuestPPC32State, _x))
=20
-#define OFFB_CIA offsetofPPCGuestState(guest_CIA)
-#define OFFB_LR offsetofPPCGuestState(guest_LR)
-#define OFFB_CTR offsetofPPCGuestState(guest_CTR)
-#define OFFB_XER_SO offsetofPPCGuestState(guest_XER_SO)
-#define OFFB_XER_OV offsetofPPCGuestState(guest_XER_OV)
-#define OFFB_XER_CA offsetofPPCGuestState(guest_XER_CA)
-#define OFFB_XER_BC offsetofPPCGuestState(guest_XER_BC)
-#define OFFB_FPROUND offsetofPPCGuestState(guest_FPROUND)
-#define OFFB_VRSAVE offsetofPPCGuestState(guest_VRSAVE)
-#define OFFB_VSCR offsetofPPCGuestState(guest_VSCR)
-#define OFFB_EMWARN offsetofPPCGuestState(guest_EMWARN)
-#define OFFB_TISTART offsetofPPCGuestState(guest_TISTART)
-#define OFFB_TILEN offsetofPPCGuestState(guest_TILEN)
-#define OFFB_RESVN offsetofPPCGuestState(guest_RESVN)
-#define OFFB_NRADDR offsetofPPCGuestState(guest_NRADDR)
+#define OFFB_CIA offsetofPPCGuestState(guest_CIA)
+#define OFFB_CIA_AT_SC offsetofPPCGuestState(guest_CIA_AT_SC)
+#define OFFB_SPRG3_RO offsetofPPCGuestState(guest_SPRG3_RO)
+#define OFFB_LR offsetofPPCGuestState(guest_LR)
+#define OFFB_CTR offsetofPPCGuestState(guest_CTR)
+#define OFFB_XER_SO offsetofPPCGuestState(guest_XER_SO)
+#define OFFB_XER_OV offsetofPPCGuestState(guest_XER_OV)
+#define OFFB_XER_CA offsetofPPCGuestState(guest_XER_CA)
+#define OFFB_XER_BC offsetofPPCGuestState(guest_XER_BC)
+#define OFFB_FPROUND offsetofPPCGuestState(guest_FPROUND)
+#define OFFB_VRSAVE offsetofPPCGuestState(guest_VRSAVE)
+#define OFFB_VSCR offsetofPPCGuestState(guest_VSCR)
+#define OFFB_EMWARN offsetofPPCGuestState(guest_EMWARN)
+#define OFFB_TISTART offsetofPPCGuestState(guest_TISTART)
+#define OFFB_TILEN offsetofPPCGuestState(guest_TILEN)
+#define OFFB_RESVN offsetofPPCGuestState(guest_RESVN)
+#define OFFB_NRADDR offsetofPPCGuestState(guest_NRADDR)
+#define OFFB_NRADDR_GPR2 offsetofPPCGuestState(guest_NRADDR_GPR2)
=20
-/* This only exists in the 64-bit guest state */
-#define OFFB64_NRADDR_GPR2 \
- offsetof(VexGuestPPC64State,guest_NRADDR_GPR2)
=20
-
/*------------------------------------------------------------*/
/*--- Extract instruction fields --- */
/*------------------------------------------------------------*/
@@ -324,6 +327,8 @@
PPC_GST_TISTART,// For icbi: start of area to invalidate
PPC_GST_TILEN, // For icbi: length of area to invalidate
PPC_GST_RESVN, // For lwarx/stwcx.
+ PPC_GST_CIA_AT_SC, // the CIA of the most recently executed SC insn
+ PPC_GST_SPRG3_RO, // SPRG3
PPC_GST_MAX
} PPC_GST;
=20
@@ -1203,19 +1208,28 @@
}
=20
=20
-/* Generate AbiHints which mark points at which the ELF ppc64 ABI says
- that the stack red zone (viz, -288(r1) .. -1(r1)) becomes
- undefined. That is at function calls and returns. Only in 64-bit
- mode - ELF ppc32 doesn't have this "feature".
+/* Generate AbiHints which mark points at which the ELF or PowerOpen
+ ABIs say that the stack red zone (viz, -N(r1) .. -1(r1), for some
+ N) becomes undefined. That is at function calls and returns. ELF
+ ppc32 doesn't have this "feature" (how fortunate for it).
*/
-static void make_redzone_AbiHint ( HChar* who )
+static void make_redzone_AbiHint ( VexMiscInfo* vmi, HChar* who )
{
+ Int szB =3D vmi->guest_stack_redzone_size;
if (0) vex_printf("AbiHint: %s\n", who);
- vassert(mode64);
- stmt( IRStmt_AbiHint(=20
- binop(Iop_Sub64, getIReg(1), mkU64(288)),=20
- 288=20
- ));
+ vassert(szB >=3D 0);
+ if (szB > 0) {
+ if (mode64)
+ stmt( IRStmt_AbiHint(=20
+ binop(Iop_Sub64, getIReg(1), mkU64(szB)),=20
+ szB
+ ));
+ else
+ stmt( IRStmt_AbiHint(=20
+ binop(Iop_Sub32, getIReg(1), mkU32(szB)),=20
+ szB
+ ));
+ }
}
=20
=20
@@ -2051,6 +2065,12 @@
{
IRType ty =3D mode64 ? Ity_I64 : Ity_I32;
switch (reg) {
+ case PPC_GST_SPRG3_RO:
+ return IRExpr_Get( OFFB_SPRG3_RO, ty );
+
+ case PPC_GST_CIA:=20
+ return IRExpr_Get( OFFB_CIA, ty );
+
case PPC_GST_LR:=20
return IRExpr_Get( OFFB_LR, ty );
=20
@@ -2181,6 +2201,10 @@
IRType ty_src =3D typeOfIRExpr(irbb->tyenv,src );
vassert( reg < PPC_GST_MAX );
switch (reg) {
+ case PPC_GST_CIA_AT_SC:=20
+ vassert( ty_src =3D=3D ty );
+ stmt( IRStmt_Put( OFFB_CIA_AT_SC, src ) );
+ break;
case PPC_GST_CIA:=20
vassert( ty_src =3D=3D ty );
stmt( IRStmt_Put( OFFB_CIA, src ) );
@@ -3714,7 +3738,7 @@
/*
Integer Store Instructions
*/
-static Bool dis_int_store ( UInt theInstr )
+static Bool dis_int_store ( UInt theInstr, VexMiscInfo* vmi )
{
/* D-Form, X-Form, DS-Form */
UChar opc1 =3D ifieldOPC(theInstr);
@@ -4211,6 +4235,7 @@
Integer Branch Instructions
*/
static Bool dis_branch ( UInt theInstr,=20
+ VexMiscInfo* vmi,
/*OUT*/DisResult* dres,
Bool (*resteerOkFn)(void*,Addr64),
void* callback_opaque )
@@ -4263,8 +4288,10 @@
=20
if (flag_LK) {
putGST( PPC_GST_LR, e_nia );
- if (mode64)
- make_redzone_AbiHint( "branch-and-link (unconditional call)"=
);
+ if (vmi->guest_ppc_zap_RZ_at_bl
+ && vmi->guest_ppc_zap_RZ_at_bl( (ULong)tgt) )
+ make_redzone_AbiHint( vmi,=20
+ "branch-and-link (unconditional call)"=
);
}
=20
if (resteerOkFn( callback_opaque, tgt )) {
@@ -4378,8 +4405,8 @@
Ijk_Boring,
c_nia ));
=20
- if (vanilla_return && mode64)
- make_redzone_AbiHint( "branch-to-lr (unconditional return)" =
);
+ if (vanilla_return && vmi->guest_ppc_zap_RZ_at_blr)
+ make_redzone_AbiHint( vmi, "branch-to-lr (unconditional retu=
rn)" );
=20
/* blrl is pretty strange; it's like a return that sets the
return address of its caller to the insn following this
@@ -4627,7 +4654,8 @@
/*
System Linkage Instructions
*/
-static Bool dis_syslink ( UInt theInstr, DisResult* dres )
+static Bool dis_syslink ( UInt theInstr,=20
+ VexMiscInfo* miscinfo, DisResult* dres )
{
IRType ty =3D mode64 ? Ity_I64 : Ity_I32;
=20
@@ -4638,11 +4666,22 @@
=20
// sc (System Call, PPC32 p504)
DIP("sc\n");
- =20
+
+ /* Copy CIA into the CIA_AT_SC pseudo-register, so that on AIX
+ Valgrind can back the guest up to this instruction if it needs
+ to restart the syscall. */
+ putGST( PPC_GST_CIA_AT_SC, getGST( PPC_GST_CIA ) );
+
/* It's important that all ArchRegs carry their up-to-date value
at this point. So we declare an end-of-block here, which
forces any TempRegs caching ArchRegs to be flushed. */
- irbb->next =3D mkSzImm( ty, nextInsnAddr() );
+ /* At this point, AIX's behaviour differs from Linux's: AIX resumes
+ after the syscall at %lr, whereas Linux does the obvious thing
+ and resumes at the next instruction. Hence we need to encode
+ that into the generated IR. */
+ irbb->next =3D miscinfo->guest_ppc_sc_continues_at_LR
+ ? /*AIXishly*/getGST( PPC_GST_LR )
+ : /*Linuxfully*/mkSzImm( ty, nextInsnAddr() );
irbb->jumpkind =3D Ijk_Sys_syscall;
=20
dres->whatNext =3D Dis_StopHere;
@@ -5193,7 +5232,7 @@
/*
Processor Control Instructions
*/
-static Bool dis_proc_ctl ( UInt theInstr )
+static Bool dis_proc_ctl ( VexMiscInfo* vmi, UInt theInstr )
{
UChar opc1 =3D ifieldOPC(theInstr);
=20
@@ -5290,7 +5329,12 @@
putIReg( rD_addr, mkSzWiden32(ty, getGST( PPC_GST_VRSAVE ),
/* Signed */False) );
break;
- =20
+
+ case 0x103:
+ DIP("mfspr r%u, SPRG3(readonly)\n", rD_addr);
+ putIReg( rD_addr, getGST( PPC_GST_SPRG3_RO ) );
+ break;
+
default:
vex_printf("dis_proc_ctl(ppc)(mfspr,SPR)(0x%x)\n", SPR);
return False;
@@ -5304,7 +5348,7 @@
val,=20
0/*regparms*/,=20
"ppcg_dirtyhelper_MFTB",=20
- fnptr_to_fnentry(&ppcg_dirtyhelper_MFTB),=20
+ fnptr_to_fnentry(vmi, &ppcg_dirtyhelper_MF=
TB),=20
args );
/* execute the dirty call, dumping the result in val. */
stmt( IRStmt_Dirty(d) );
@@ -6708,7 +6752,7 @@
/*
AltiVec Load Instructions
*/
-static Bool dis_av_load ( UInt theInstr )
+static Bool dis_av_load ( VexMiscInfo* vmi, UInt theInstr )
{
/* X-Form */
UChar opc1 =3D ifieldOPC(theInstr);
@@ -6744,13 +6788,13 @@
d =3D unsafeIRDirty_0_N (
0/*regparms*/,=20
"ppc32g_dirtyhelper_LVS",
- fnptr_to_fnentry(&ppc32g_dirtyhelper_LVS),
+ fnptr_to_fnentry(vmi, &ppc32g_dirtyhelper_LVS),
args );
} else {
d =3D unsafeIRDirty_0_N (
0/*regparms*/,=20
"ppc64g_dirtyhelper_LVS",
- fnptr_to_fnentry(&ppc64g_dirtyhelper_LVS),
+ fnptr_to_fnentry(vmi, &ppc64g_dirtyhelper_LVS),
args );
}
DIP("lvsl v%d,r%u,r%u\n", vD_addr, rA_addr, rB_addr);
@@ -6777,13 +6821,13 @@
d =3D unsafeIRDirty_0_N (
0/*regparms*/,=20
"ppc32g_dirtyhelper_LVS",
- fnptr_to_fnentry(&ppc32g_dirtyhelper_LVS),
+ fnptr_to_fnentry(vmi, &ppc32g_dirtyhelper_LVS),
args );
} else {
d =3D unsafeIRDirty_0_N (
0/*regparms*/,=20
"ppc64g_dirtyhelper_LVS",
- fnptr_to_fnentry(&ppc64g_dirtyhelper_LVS),
+ fnptr_to_fnentry(vmi, &ppc64g_dirtyhelper_LVS),
args );
}
DIP("lvsr v%d,r%u,r%u\n", vD_addr, rA_addr, rB_addr);
@@ -8694,7 +8738,8 @@
Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
void* callback_opaque,
Long delta64,
- VexArchInfo* archinfo=20
+ VexArchInfo* archinfo,
+ VexMiscInfo* miscinfo
)
{
UChar opc1;
@@ -8797,14 +8842,12 @@
goto decode_success;
}
else
- if (mode64=20
- && getUIntBigendianly(code+16) =3D=3D 0x7C842378 /* or 4,4,=
4 */) {
+ if (getUIntBigendianly(code+16) =3D=3D 0x7C842378 /* or 4,4,4 *=
/) {
/* %R3 =3D guest_NRADDR_GPR2 */
DIP("r3 =3D guest_NRADDR_GPR2\n");
delta +=3D 20;
dres.len =3D 20;
- vassert(ty =3D=3D Ity_I64);
- putIReg(3, IRExpr_Get( OFFB64_NRADDR_GPR2, ty ));
+ putIReg(3, IRExpr_Get( OFFB_NRADDR_GPR2, ty ));
goto decode_success;
}
/* We don't know what it is. Set opc1/opc2 so decode_failure
@@ -8860,7 +8903,7 @@
/* Integer Store Instructions */
case 0x26: case 0x27: case 0x2C: // stb, stbu, sth
case 0x2D: case 0x24: case 0x25: // sthu, stw, stwu
- if (dis_int_store( theInstr )) goto decode_success;
+ if (dis_int_store( theInstr, miscinfo )) goto decode_success;
goto decode_failure;
=20
/* Integer Load and Store Multiple Instructions */
@@ -8870,13 +8913,14 @@
=20
/* Branch Instructions */
case 0x12: case 0x10: // b, bc
- if (dis_branch(theInstr, &dres, resteerOkFn, callback_opaque))=20
+ if (dis_branch(theInstr, miscinfo, &dres,=20
+ resteerOkFn, callback_opaque))=20
goto decode_success;
goto decode_failure;
=20
/* System Linkage Instructions */
case 0x11: // sc
- if (dis_syslink(theInstr, &dres)) goto decode_success;
+ if (dis_syslink(theInstr, miscinfo, &dres)) goto decode_success;
goto decode_failure;
=20
/* Trap Instructions */
@@ -8941,7 +8985,7 @@
/* 64bit Integer Stores */
case 0x3E: // std, stdu
if (!mode64) goto decode_failure;
- if (dis_int_store( theInstr )) goto decode_success;
+ if (dis_int_store( theInstr, miscinfo )) goto decode_success;
goto decode_failure;
=20
case 0x3F:
@@ -9033,7 +9077,8 @@
=20
/* Branch Instructions */
case 0x210: case 0x010: // bcctr, bclr
- if (dis_branch(theInstr, &dres, resteerOkFn, callback_opaque))=20
+ if (dis_branch(theInstr, miscinfo, &dres,=20
+ resteerOkFn, callback_opaque))=20
goto decode_success;
goto decode_failure;
=20
@@ -9129,13 +9174,13 @@
/* Integer Store Instructions */
case 0x0F7: case 0x0D7: case 0x1B7: // stbux, stbx, sthux
case 0x197: case 0x0B7: case 0x097: // sthx, stwux, stwx
- if (dis_int_store( theInstr )) goto decode_success;
+ if (dis_int_store( theInstr, miscinfo )) goto decode_success;
goto decode_failure;
=20
/* 64bit Integer Store Instructions */
case 0x0B5: case 0x095: // stdux, stdx
if (!mode64) goto decode_failure;
- if (dis_int_store( theInstr )) goto decode_success;
+ if (dis_int_store( theInstr, miscinfo )) goto decode_success;
goto decode_failure;
=20
/* Integer Load and Store with Byte Reverse Instructions */
@@ -9173,7 +9218,7 @@
/* Processor Control Instructions */
case 0x200: case 0x013: case 0x153: // mcrxr, mfcr, mfspr
case 0x173: case 0x090: case 0x1D3: // mftb, mtcrf, mtspr
- if (dis_proc_ctl( theInstr )) goto decode_success;
+ if (dis_proc_ctl( miscinfo, theInstr )) goto decode_success;
goto decode_failure;
=20
/* Cache Management Instructions */
@@ -9229,7 +9274,7 @@
case 0x007: case 0x027: case 0x047: // lvebx, lvehx, lvewx
case 0x067: case 0x167: // lvx, lvxl
if (!allow_V) goto decode_noV;
- if (dis_av_load( theInstr )) goto decode_success;
+ if (dis_av_load( miscinfo, theInstr )) goto decode_success;
goto decode_failure;
=20
/* AV Store */
@@ -9469,6 +9514,7 @@
Addr64 guest_IP,
VexArch guest_arch,
VexArchInfo* archinfo,
+ VexMiscInfo* miscinfo,
Bool host_bigendian_IN )
{
IRType ty;
@@ -9504,7 +9550,7 @@
guest_CIA_bbstart =3D mkSzAddr(ty, guest_IP - delta);
=20
dres =3D disInstr_PPC_WRK ( put_IP, resteerOkFn, callback_opaque,
- delta, archinfo );
+ delta, archinfo, miscinfo );
=20
return dres;
}
Modified: trunk/priv/guest-x86/gdefs.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-x86/gdefs.h 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/guest-x86/gdefs.h 2006-10-17 00:28:22 UTC (rev 1669)
@@ -66,6 +66,7 @@
Addr64 guest_IP,
VexArch guest_arch,
VexArchInfo* archinfo,
+ VexMiscInfo* miscinfo,
Bool host_bigendian );
=20
/* Used by the optimiser to specialise calls to helpers. */
Modified: trunk/priv/guest-x86/toIR.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-x86/toIR.c 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/guest-x86/toIR.c 2006-10-17 00:28:22 UTC (rev 1669)
@@ -12902,6 +12902,7 @@
Addr64 guest_IP,
VexArch guest_arch,
VexArchInfo* archinfo,
+ VexMiscInfo* miscinfo,
Bool host_bigendian_IN )
{
DisResult dres;
Modified: trunk/priv/host-amd64/hdefs.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/host-amd64/hdefs.h 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/host-amd64/hdefs.h 2006-10-17 00:28:22 UTC (rev 1669)
@@ -725,7 +725,9 @@
extern AMD64Instr* genSpill_AMD64 ( HReg rreg, Int offset, Bool=
);
extern AMD64Instr* genReload_AMD64 ( HReg rreg, Int offset, Bool=
);
extern void getAllocableRegs_AMD64 ( Int*, HReg** );
-extern HInstrArray* iselBB_AMD64 ( IRBB*, VexArch, VexArchInfo=
* );
+extern HInstrArray* iselBB_AMD64 ( IRBB*, VexArch,
+ VexArchInfo*,
+ VexMiscInfo* );
=20
#endif /* ndef __LIBVEX_HOST_AMD64_HDEFS_H */
=20
Modified: trunk/priv/host-amd64/isel.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/host-amd64/isel.c 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/host-amd64/isel.c 2006-10-17 00:28:22 UTC (rev 1669)
@@ -3801,8 +3801,9 @@
=20
/* Translate an entire BB to amd64 code. */
=20
-HInstrArray* iselBB_AMD64 ( IRBB* bb, VexArch arch_host,
- VexArchInfo* archinfo_host )
+HInstrArray* iselBB_AMD64 ( IRBB* bb, VexArch arch_host,
+ VexArchInfo* archinfo_host,
+ VexMiscInfo* vmi/*UNUSED*/ )
{
Int i, j;
HReg hreg, hregHI;
Modified: trunk/priv/host-ppc/hdefs.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/host-ppc/hdefs.c 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/host-ppc/hdefs.c 2006-10-17 00:28:22 UTC (rev 1669)
@@ -1123,67 +1123,13 @@
=20
/* Pretty Print instructions */
static void ppLoadImm ( HReg dst, ULong imm, Bool mode64 ) {
-#if 1
vex_printf("li_word ");
ppHRegPPC(dst);
if (!mode64) {
- vassert(imm =3D=3D (ULong)(Long)(Int)(UInt)imm);
vex_printf(",0x%08x", (UInt)imm);
} else {
vex_printf(",0x%016llx", imm);
}
-#else
- if (imm >=3D 0xFFFFFFFFFFFF8000ULL || imm < 0x8000) {
- // sign-extendable from 16 bits
- vex_printf("li ");
- ppHRegPPC(dst);
- vex_printf(",0x%x", (UInt)imm);
- } else {
- if (imm >=3D 0xFFFFFFFF80000000ULL || imm < 0x80000000ULL) {
- // sign-extendable from 32 bits
- vex_printf("lis ");
- ppHRegPPC(dst);
- vex_printf(",0x%x ; ", (UInt)(imm >> 16));
- vex_printf("ori ");
- ppHRegPPC(dst);
- vex_printf(",");
- ppHRegPPC(dst);
- vex_printf(",0x%x", (UInt)(imm & 0xFFFF));
- } else {
- // full 64bit immediate load: 5 (five!) insns.
- vassert(mode64);
-
- // load high word
- vex_printf("lis ");
- ppHRegPPC(dst);
- vex_printf(",0x%x ; ", (UInt)(imm >> 48) & 0xFFFF);
- vex_printf("ori ");
- ppHRegPPC(dst);
- vex_printf(",");
- ppHRegPPC(dst);
- vex_printf(",0x%x ; ", (UInt)(imm >> 32) & 0xFFFF);
- =20
- // shift r_dst low word to high word =3D> rldicr
- vex_printf("rldicr ");
- ppHRegPPC(dst);
- vex_printf(",");
- ppHRegPPC(dst);
- vex_printf(",32,31 ; ");
-
- // load low word
- vex_printf("oris ");
- ppHRegPPC(dst);
- vex_printf(",");
- ppHRegPPC(dst);
- vex_printf(",0x%x ; ", (UInt)(imm >> 16) & 0xFFFF);
- vex_printf("ori ");
- ppHRegPPC(dst);
- vex_printf(",");
- ppHRegPPC(dst);
- vex_printf(",0x%x", (UInt)(imm >> 0) & 0xFFFF);
- }
- }
-#endif
}
=20
static void ppMovReg ( HReg dst, HReg src ) {
@@ -2496,19 +2442,26 @@
vassert(mode64);
=20
// load high word
+
// lis r_dst, (imm>>48) & 0xFFFF
p =3D mkFormD(p, 15, r_dst, 0, (imm>>48) & 0xFFFF);
+
// ori r_dst, r_dst, (imm>>32) & 0xFFFF
- p =3D mkFormD(p, 24, r_dst, r_dst, (imm>>32) & 0xFFFF);
+ if ((imm>>32) & 0xFFFF)
+ p =3D mkFormD(p, 24, r_dst, r_dst, (imm>>32) & 0xFFFF);
=20
// shift r_dst low word to high word =3D> rldicr
p =3D mkFormMD(p, 30, r_dst, r_dst, 32, 31, 1);
=20
// load low word
+
// oris r_dst, r_dst, (imm>>16) & 0xFFFF
- p =3D mkFormD(p, 25, r_dst, r_dst, (imm>>16) & 0xFFFF);
+ if ((imm>>16) & 0xFFFF)
+ p =3D mkFormD(p, 25, r_dst, r_dst, (imm>>16) & 0xFFFF);
+
// ori r_dst, r_dst, (imm) & 0xFFFF
- p =3D mkFormD(p, 24, r_dst, r_dst, imm & 0xFFFF);
+ if (imm & 0xFFFF)
+ p =3D mkFormD(p, 24, r_dst, r_dst, imm & 0xFFFF);
}
}
return p;
Modified: trunk/priv/host-ppc/hdefs.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/host-ppc/hdefs.h 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/host-ppc/hdefs.h 2006-10-17 00:28:22 UTC (rev 1669)
@@ -838,7 +838,9 @@
extern PPCInstr* genSpill_PPC ( HReg rreg, UShort offsetB, Bo=
ol mode64 );
extern PPCInstr* genReload_PPC ( HReg rreg, UShort offsetB, Bo=
ol mode64 );
extern void getAllocableRegs_PPC ( Int*, HReg**, Bool mode64 );
-extern HInstrArray* iselBB_PPC ( IRBB*, VexArch, VexArchInfo* =
);
+extern HInstrArray* iselBB_PPC ( IRBB*, VexArch,
+ VexArchInfo*,
+ VexMiscInfo* );
=20
#endif /* ndef __LIBVEX_HOST_PPC_HDEFS_H */
=20
Modified: trunk/priv/host-ppc/isel.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/host-ppc/isel.c 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/host-ppc/isel.c 2006-10-17 00:28:22 UTC (rev 1669)
@@ -253,6 +253,9 @@
was most recently set. Setting to NULL is always safe. Used to
avoid redundant settings of the FPU's rounding mode, as
described in set_FPU_rounding_mode below.
+
+ - A VexMiscInfo*, needed for knowing how to generate
+ function calls for this target
*/
=20
typedef
@@ -275,6 +278,8 @@
Bool mode64;
=20
IRExpr* previous_rm;
+
+ VexMiscInfo* vmi;
}
ISelEnv;
=20
@@ -532,7 +537,7 @@
=20
/* Given a guest-state array descriptor, an index expression and a
bias, generate a PPCAMode pointing at the relevant piece of=20
- guest state. Only needed in 64-bit mode. */
+ guest state. */
static
PPCAMode* genGuestArrayOffset ( ISelEnv* env, IRArray* descr,
IRExpr* off, Int bias )
@@ -542,23 +547,22 @@
Int nElems =3D descr->nElems;
Int shift =3D 0;
=20
- vassert(env->mode64);
-
/* Throw out any cases we don't need. In theory there might be a
day where we need to handle others, but not today. */
=20
if (nElems !=3D 16 && nElems !=3D 32)
- vpanic("genGuestArrayOffset(ppc64 host)(1)");
+ vpanic("genGuestArrayOffset(ppc host)(1)");
=20
switch (elemSz) {
+ case 4: shift =3D 2; break;
case 8: shift =3D 3; break;
- default: vpanic("genGuestArrayOffset(ppc64 host)(2)");
+ default: vpanic("genGuestArrayOffset(ppc host)(2)");
}
=20
if (bias < -100 || bias > 100) /* somewhat arbitrarily */
- vpanic("genGuestArrayOffset(ppc64 host)(3)");
+ vpanic("genGuestArrayOffset(ppc host)(3)");
if (descr->base < 0 || descr->base > 2000) /* somewhat arbitrarily */
- vpanic("genGuestArrayOffset(ppc64 host)(4)");
+ vpanic("genGuestArrayOffset(ppc host)(4)");
=20
/* Compute off into a reg, %off. Then return:
=20
@@ -580,7 +584,7 @@
PPCRH_Imm(False/*signed*/, toUShort(nElems-1))));
addInstr(env, PPCInstr_Shft(
Pshft_SHL,=20
- False/*64-bit shift*/,
+ env->mode64 ? False : True/*F:64-bit, T:32-bit shift=
*/,
rtmp, rtmp,=20
PPCRH_Imm(False/*unsigned*/, toUShort(shift))));
addInstr(env, PPCInstr_Alu(
@@ -631,6 +635,11 @@
ULong target;
Bool mode64 =3D env->mode64;
=20
+ /* Do we need to force use of an odd-even reg pair for 64-bit
+ args? */
+ Bool regalign_int64s
+ =3D (!mode64) && env->vmi->host_ppc32_regalign_int64_args;
+
/* Marshal args for a call and do the call.
=20
If passBBP is True, %rbp (the baseblock pointer) is to be passed
@@ -756,8 +765,9 @@
iselWordExpr_R(env, args[i]) ));
} else { // Ity_I64
HReg rHi, rLo;
- if (argreg%2 =3D=3D 1) // ppc32 abi spec for passing LONG=
_LONG
- argreg++; // XXX: odd argreg =3D> even rN
+ if (regalign_int64s && (argreg%2) =3D=3D 1)=20
+ // ppc32 ELF abi spec for passing LONG_LON=
G
+ argreg++; // XXX: odd argreg =3D> even rN
vassert(argreg < PPC_N_REGPARMS-1);
iselInt64Expr(&rHi,&rLo, env, args[i]);
argiregs |=3D (1 << (argreg+3));
@@ -799,8 +809,9 @@
tmpregs[argreg] =3D iselWordExpr_R(env, args[i]);
} else { // Ity_I64
HReg rHi, rLo;
- if (argreg%2 =3D=3D 1) // ppc32 abi spec for passing LONG=
_LONG
- argreg++; // XXX: odd argreg =3D> even rN
+ if (regalign_int64s && (argreg%2) =3D=3D 1)
+ // ppc32 ELF abi spec for passing LONG_LONG
+ argreg++; // XXX: odd argreg =3D> even rN
vassert(argreg < PPC_N_REGPARMS-1);
iselInt64Expr(&rHi,&rLo, env, args[i]);
tmpregs[argreg++] =3D rHi;
@@ -1788,17 +1799,23 @@
break;
}
=20
- case Iex_GetI:=20
+ case Iex_GetI: {
+ PPCAMode* src_am
+ =3D genGuestArrayOffset( env, e->Iex.GetI.descr,
+ e->Iex.GetI.ix, e->Iex.GetI.bias );
+ HReg r_dst =3D newVRegI(env);
if (mode64 && ty =3D=3D Ity_I64) {
- PPCAMode* src_am
- =3D genGuestArrayOffset( env, e->Iex.GetI.descr,
- e->Iex.GetI.ix, e->Iex.GetI.bias=
);
- HReg r_dst =3D newVRegI(env);
addInstr(env, PPCInstr_Load( toUChar(8),
r_dst, src_am, mode64 ));
return r_dst;
}
+ if ((!mode64) && ty =3D=3D Ity_I32) {
+ addInstr(env, PPCInstr_Load( toUChar(4),
+ r_dst, src_am, mode64 ));
+ return r_dst;
+ }
break;
+ }
=20
/* --------- CCALL --------- */
case Iex_CCall: {
@@ -2485,8 +2502,8 @@
HReg tLo =3D newVRegI(env);
HReg tHi =3D newVRegI(env);
vassert(e->Iex.Const.con->tag =3D=3D Ico_U64);
- addInstr(env, PPCInstr_LI(tHi, wHi, False/*mode32*/));
- addInstr(env, PPCInstr_LI(tLo, wLo, False/*mode32*/));
+ addInstr(env, PPCInstr_LI(tHi, (Long)(Int)wHi, False/*mode32*/));
+ addInstr(env, PPCInstr_LI(tLo, (Long)(Int)wLo, False/*mode32*/));
*rHi =3D tHi;
*rLo =3D tLo;
return;
@@ -3674,21 +3691,26 @@
}
=20
/* --------- Indexed PUT --------- */
- case Ist_PutI:
- if (mode64) {
- PPCAMode* dst_am
- =3D genGuestArrayOffset(
- env, stmt->Ist.PutI.descr,=20
- stmt->Ist.PutI.ix, stmt->Ist.PutI.bias );
- IRType ty =3D typeOfIRExpr(env->type_env, stmt->Ist.PutI.data);
- if (ty =3D=3D Ity_I64) {
- HReg r_src =3D iselWordExpr_R(env, stmt->Ist.PutI.data);
- addInstr(env, PPCInstr_Store( toUChar(8),
- dst_am, r_src, mode64 ));
- return;
- }
+ case Ist_PutI: {
+ PPCAMode* dst_am
+ =3D genGuestArrayOffset(
+ env, stmt->Ist.PutI.descr,=20
+ stmt->Ist.PutI.ix, stmt->Ist.PutI.bias );
+ IRType ty =3D typeOfIRExpr(env->type_env, stmt->Ist.PutI.data);
+ if (mode64 && ty =3D=3D Ity_I64) {
+ HReg r_src =3D iselWordExpr_R(env, stmt->Ist.PutI.data);
+ addInstr(env, PPCInstr_Store( toUChar(8),
+ dst_am, r_src, mode64 ));
+ return;
}
+ if ((!mode64) && ty =3D=3D Ity_I32) {
+ HReg r_src =3D iselWordExpr_R(env, stmt->Ist.PutI.data);
+ addInstr(env, PPCInstr_Store( toUChar(4),
+ dst_am, r_src, mode64 ));
+ return;
+ }
break;
+ }
=20
/* --------- TMP --------- */
case Ist_Tmp: {
@@ -3856,8 +3878,9 @@
=20
/* Translate an entire BB to ppc code. */
=20
-HInstrArray* iselBB_PPC ( IRBB* bb, VexArch arch_host,
- VexArchInfo* archinfo_host )
+HInstrArray* iselBB_PPC ( IRBB* bb, VexArch arch_host,
+ VexArchInfo* archinfo_host,
+ VexMiscInfo* vmi )
{
Int i, j;
HReg hreg, hregHI;
@@ -3904,6 +3927,7 @@
/* and finally ... */
env->hwcaps =3D hwcaps_host;
env->previous_rm =3D NULL;
+ env->vmi =3D vmi;
=20
/* For each IR temporary, allocate a suitably-kinded virtual
register. */
Modified: trunk/priv/host-x86/hdefs.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/host-x86/hdefs.h 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/host-x86/hdefs.h 2006-10-17 00:28:22 UTC (rev 1669)
@@ -665,7 +665,9 @@
extern X86Instr* genSpill_X86 ( HReg rreg, Int offset, Bool )=
;
extern X86Instr* genReload_X86 ( HReg rreg, Int offset, Bool )=
;
extern void getAllocableRegs_X86 ( Int*, HReg** );
-extern HInstrArray* iselBB_X86 ( IRBB*, VexArch, VexArchInfo* =
);
+extern HInstrArray* iselBB_X86 ( IRBB*, VexArch,
+ VexArchInfo*,
+ VexMiscInfo* );
=20
#endif /* ndef __LIBVEX_HOST_X86_HDEFS_H */
=20
Modified: trunk/priv/host-x86/isel.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/host-x86/isel.c 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/host-x86/isel.c 2006-10-17 00:28:22 UTC (rev 1669)
@@ -3604,8 +3604,9 @@
=20
/* Translate an entire BB to x86 code. */
=20
-HInstrArray* iselBB_X86 ( IRBB* bb, VexArch arch_host,
- VexArchInfo* archinfo_host )
+HInstrArray* iselBB_X86 ( IRBB* bb, VexArch arch_host,
+ VexArchInfo* archinfo_host,
+ VexMiscInfo* vmi/*UNUSED*/ )
{
Int i, j;
HReg hreg, hregHI;
Modified: trunk/priv/main/vex_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/main/vex_main.c 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/priv/main/vex_main.c 2006-10-17 00:28:22 UTC (rev 1669)
@@ -193,7 +193,8 @@
HInstr* (*genReload) ( HReg, Int, Bool );
void (*ppInstr) ( HInstr*, Bool );
void (*ppReg) ( HReg );
- HInstrArray* (*iselBB) ( IRBB*, VexArch, VexArchInfo* );
+ HInstrArray* (*iselBB) ( IRBB*, VexArch, VexArchInfo*,=20
+ VexMiscInfo* );
Int (*emit) ( UChar*, Int, HInstr*, Bool, void* );
IRExpr* (*specHelper) ( HChar*, IRExpr** );
Bool (*preciseMemExnsFn) ( Int, Int );
@@ -432,6 +433,7 @@
host_is_bigendian,
vta->arch_guest,
&vta->archinfo_guest,
+ &vta->miscinfo_both,
guest_word_type,
vta->do_self_check,
vta->preamble_function,
@@ -558,7 +560,8 @@
" Instruction selection "
"------------------------\n");
=20
- vcode =3D iselBB ( irbb, vta->arch_host, &vta->archinfo_host );
+ vcode =3D iselBB ( irbb, vta->arch_host, &vta->archinfo_host,=20
+ &vta->miscinfo_both );
=20
vexAllocSanityCheck();
=20
@@ -695,7 +698,6 @@
}
=20
=20
-
/* Write default settings info *vai. */
void LibVEX_default_VexArchInfo ( /*OUT*/VexArchInfo* vai )
{
@@ -703,7 +705,18 @@
vai->ppc_cache_line_szB =3D 0;
}
=20
+/* Write default settings info *vmi. */
+void LibVEX_default_VexMiscInfo ( /*OUT*/VexMiscInfo* vmi )
+{
+ vmi->guest_stack_redzone_size =3D 0;
+ vmi->guest_ppc_zap_RZ_at_blr =3D False;
+ vmi->guest_ppc_zap_RZ_at_bl =3D NULL;
+ vmi->guest_ppc_sc_continues_at_LR =3D False;
+ vmi->host_ppc_calls_use_fndescrs =3D False;
+ vmi->host_ppc32_regalign_int64_args =3D False;
+}
=20
+
/* Return a string showing the hwcaps in a nice way. The string will
be NULL for invalid combinations of flags, so these functions also
serve as a way to validate hwcaps values. */
Modified: trunk/pub/libvex.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/pub/libvex.h 2006-10-04 18:18:22 UTC (rev 1668)
+++ trunk/pub/libvex.h 2006-10-17 00:28:22 UTC (rev 1669)
@@ -110,8 +110,8 @@
=20
=20
/* This struct is a bit of a hack, but is needed to carry misc
- important bits of info about an arch. Fields which are optional or
- ignored on some arch should be set to zero. */
+ important bits of info about an arch. Fields which are meaningless
+ or ignored for the platform in question should be set to zero. */
=20
typedef
struct {
@@ -127,6 +127,90 @@
void LibVEX_default_VexArchInfo ( /*OUT*/VexArchInfo* vai );
=20
=20
+/* This struct carries guest and host ABI variant information that may
+ be needed. Fields which are meaningless or ignored for the
+ platform in question should be set to zero.
+
+ Settings which are believed to be correct are:
+
+ guest_stack_redzone_size
+ guest is ppc32-linux =3D=3D> 0
+ guest is ppc64-linux =3D=3D> 288
+ guest is ppc32-aix5 =3D=3D> 220
+ guest is ppc64-aix5 =3D=3D> unknown
+ guest is amd64-linux =3D=3D> 128
+ guest is other =3D=3D> inapplicable
+
+ guest_ppc_zap_RZ_at_blr
+ guest is ppc64-linux =3D=3D> True
+ guest is ppc32-linux =3D=3D> False
+ guest is ppc64-aix5 =3D=3D> unknown
+ guest is ppc32-aix5 =3D=3D> False
+ guest is other =3D=3D> inapplicable
+
+ guest_ppc_zap_RZ_at_bl
+ guest is ppc64-linux =3D=3D> const True
+ guest is ppc32-linux =3D=3D> const False
+ guest is ppc64-aix5 =3D=3D> unknown
+ guest is ppc32-aix5 =3D=3D> True except for calls =
to
+ millicode, $SAVEFn, $RESTF=
n
+ guest is other =3D=3D> inapplicable
+
+ guest_ppc_sc_continues_at_LR:
+ guest is ppc32-aix5 or ppc64-aix5 =3D=3D> True
+ guest is ppc32-linux or ppc64-linux =3D=3D> False
+ guest is other =3D=3D> inapplicable
+
+ host_ppc_calls_use_fndescrs:
+ host is ppc32-linux =3D=3D> False
+ host is ppc64-linux =3D=3D> True
+ host is ppc32-aix5 or ppc64-aix5 =3D=3D> True
+ host is other =3D=3D> inapplicable
+
+ host_ppc32_regalign_int64_args:
+ host is ppc32-linux =3D=3D> True
+ host is ppc32-aix5 =3D=3D> False
+ host is other =3D=3D> inapplicable
+*/
+
+typedef
+ struct {
+ /* PPC and AMD64 GUESTS only: how many bytes below the=20
+ stack pointer are validly addressible? */
+ Int guest_stack_redzone_size;
+
+ /* PPC GUESTS only: should we zap the stack red zone at a 'blr'
+ (function return) ? */
+ Bool guest_ppc_zap_RZ_at_blr;
+
+ /* PPC GUESTS only: should we zap the stack red zone at a 'bl'
+ (function call) ? Is supplied with the guest address of the
+ target of the call since that may be significant. If NULL,
+ is assumed equivalent to a fn which always returns False. */
+ Bool (*guest_ppc_zap_RZ_at_bl)(Addr64);
+
+ /* PPC32/PPC64 GUESTS only: where does the kernel resume after
+ 'sc'? False =3D> Linux style, at the next insn. True =3D> AIX
+ style, at the address stated in the link register. */
+ Bool guest_ppc_sc_continues_at_LR;
+
+ /* PPC32/PPC64 HOSTS only: does '&f' give us a pointer to a
+ function descriptor on the host, or to the function code
+ itself? True =3D> descriptor, False =3D> code. */
+ Bool host_ppc_calls_use_fndescrs;
+
+ /* PPC32 HOSTS only: when generating code to pass a 64-bit value
+ (actual parameter) in a pair of regs, should we skip an arg
+ reg if it is even-numbered? True =3D> yes, False =3D> no. */
+ Bool host_ppc32_regalign_int64_args;
+ }
+ VexMiscInfo;
+
+/* Write default settings info *vmi. */
+extern=20
+void LibVEX_default_VexMiscInfo ( /*OUT*/VexMiscInfo* vmi );
+
+
/*-------------------------------------------------------*/
/*--- Control of Vex's optimiser (iropt). ---*/
/*-------------------------------------------------------*/
@@ -320,11 +404,13 @@
many of them, it seems better to have a structure. */
typedef
struct {
- /* IN: The instruction sets we are translating from and to. */
+ /* IN: The instruction sets we are translating from and to. And
+ guest/host misc info. */
VexArch arch_guest;
VexArchInfo archinfo_guest;
VexArch arch_host;
VexArchInfo archinfo_host;
+ VexMiscInfo miscinfo_both;
=20
/* IN: an opaque value which is passed as the first arg to all
...
[truncated message content] |