|
From: <sv...@va...> - 2006-10-03 19:06:37
|
Author: sewardj
Date: 2006-10-03 20:06:29 +0100 (Tue, 03 Oct 2006)
New Revision: 6140
Log:
- track SysRes changes
- track VG_(am_find_nsegment) const-ness change
- increase number of client syscall args supported from 6 to 8
- simplify type SyscallStatus. Simply hold a copy of the SysRes
for the syscall rather than have this be a data structure
incorporating something very similar to the fields of a SysRes,
and more besides. Change various macros in priv_types_n_macros.h
to match.
- syswrap-main.c: instantiate the various impedance-matching
functions for AIX.
Modified:
branches/AIX5/coregrind/m_syswrap/priv_types_n_macros.h
branches/AIX5/coregrind/m_syswrap/syscall-ppc32-aix5.S
branches/AIX5/coregrind/m_syswrap/syscall-ppc32-linux.S
branches/AIX5/coregrind/m_syswrap/syscall-ppc64-aix5.S
branches/AIX5/coregrind/m_syswrap/syscall-ppc64-linux.S
branches/AIX5/coregrind/m_syswrap/syscall-x86-linux.S
branches/AIX5/coregrind/m_syswrap/syswrap-generic.c
branches/AIX5/coregrind/m_syswrap/syswrap-linux-variants.c
branches/AIX5/coregrind/m_syswrap/syswrap-linux.c
branches/AIX5/coregrind/m_syswrap/syswrap-main.c
branches/AIX5/coregrind/m_syswrap/syswrap-ppc32-aix5.c
branches/AIX5/coregrind/m_syswrap/syswrap-ppc32-linux.c
branches/AIX5/coregrind/m_syswrap/syswrap-ppc64-aix5.c
branches/AIX5/coregrind/m_syswrap/syswrap-ppc64-linux.c
branches/AIX5/coregrind/m_syswrap/syswrap-x86-linux.c
Modified: branches/AIX5/coregrind/m_syswrap/priv_types_n_macros.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
--- branches/AIX5/coregrind/m_syswrap/priv_types_n_macros.h 2006-10-02 00=
:38:05 UTC (rev 6139)
+++ branches/AIX5/coregrind/m_syswrap/priv_types_n_macros.h 2006-10-03 19=
:06:29 UTC (rev 6140)
@@ -57,14 +57,23 @@
UWord arg4;
UWord arg5;
UWord arg6;
+ UWord arg7;
+ UWord arg8;
}
SyscallArgs;
=20
/* Current status of a syscall being done on behalf of the client. */
typedef
struct {
- enum { SsSuccess=3D1, SsFailure, SsHandToKernel, SsIdle } what;
- UWord val; /* only meaningful for .what =3D=3D Success or Failure =
*/
+ enum {=20
+ /* call is complete, result is in 'res' */
+ SsComplete=3D1,
+ /* syscall not yet completed; must be handed to the kernel */
+ SsHandToKernel,=20
+ /* not currently handling a syscall for this thread */
+ SsIdle=20
+ } what;
+ SysRes sres; /* only meaningful for .what =3D=3D SsComplete */
}
SyscallStatus;
=20
@@ -78,6 +87,8 @@
Int o_arg4;
Int o_arg5;
Int o_arg6;
+ Int o_arg8;
+ Int o_arg7;
Int o_retval;
}
SyscallArgLayout;
@@ -121,14 +132,31 @@
*/
=20
=20
-/* These are defined in the relevant platform-specific files --
- syswrap-arch-os.c */
+#if defined(VGO_linux)
+/* On Linux, finding the wrapper is easy: just look up in fixed,
+ platform-specific tables. These are defined in the relevant
+ platform-specific files -- syswrap-arch-os.c */
=20
extern const SyscallTableEntry ML_(syscall_table)[];
=20
extern const UInt ML_(syscall_table_size);
- =20
=20
+#elif defined(VGP_ppc32_aix5)
+/* On AIX5 this is more complex than the simple fixed table lookup on
+ Linux, since the syscalls don't have fixed numbers. So it's
+ simplest to use a function, which does all the required messing
+ around. */
+extern
+SyscallTableEntry* ML_(get_ppc32_aix5_syscall_entry) ( UInt sysno );
+
+#elif defined(VGP_ppc64_aix5)
+extern
+SyscallTableEntry* ML_(get_ppc64_aix5_syscall_entry) ( UInt sysno );
+
+#else
+# error Unknown OS
+#endif =20
+
/* ---------------------------------------------------------------------
Declaring and defining wrappers.
------------------------------------------------------------------ */
@@ -197,6 +225,11 @@
[sysno] =3D { vgSysWrap_##auxstr##_##name##_before, \
vgSysWrap_##auxstr##_##name##_after }
=20
+#define WRAPPER_PRE_NAME(auxstr, name) \
+ vgSysWrap_##auxstr##_##name##_before
+#define WRAPPER_POST_NAME(auxstr, name) \
+ vgSysWrap_##auxstr##_##name##_after
+
/* Add a generic wrapper to a syscall table. */
#define GENX_(sysno, name) WRAPPER_ENTRY_X_(generic, sysno, name)
#define GENXY(sysno, name) WRAPPER_ENTRY_XY(generic, sysno, name)
@@ -206,8 +239,19 @@
#define LINX_(sysno, name) WRAPPER_ENTRY_X_(linux, sysno, name)=20
#define LINXY(sysno, name) WRAPPER_ENTRY_XY(linux, sysno, name)
=20
+/* Add an AIX5-specific, arch-independent wrapper to a syscall
+ table. */
+#define AIXXY(sysno, name) \
+ { & sysno, \
+ { & WRAPPER_PRE_NAME(aix5, name), \
+ & WRAPPER_POST_NAME(aix5, name) }}=20
=20
+#define AIXX_(sysno, name) \
+ { & sysno, \
+ { & WRAPPER_PRE_NAME(aix5, name), \
+ NULL }}=20
=20
+
/* ---------------------------------------------------------------------
Macros useful for writing wrappers concisely. These refer to the
parameters declared by DEFN_{PRE,POST}_TEMPLATE and so in a way do
@@ -224,6 +268,8 @@
#define ARG4 (arrghs->arg4)
#define ARG5 (arrghs->arg5)
#define ARG6 (arrghs->arg6)
+#define ARG7 (arrghs->arg7)
+#define ARG8 (arrghs->arg8)
=20
/* Reference to the syscall's current result status/value. Note that
=20
@@ -240,41 +286,38 @@
inspecting status->what, use RES_unchecked. This is dangerous and
therefore discouraged. =20
*/
-#define SUCCESS (status->what =3D=3D SsSuccess)
-#define FAILURE (status->what =3D=3D SsFailure)
+#define SUCCESS (status->what =3D=3D SsComplete && !status->sres.i=
sError)
+#define FAILURE (status->what =3D=3D SsComplete && status->sres.i=
sError)
#define SWHAT (status->what)
-#define RES_unchecked (status->val) /* do not use! */
-#define RES (getRES(status)) /* use this instead, if possible=
*/
+#define RES_unchecked (status->sres.res) /* do not use! */
+#define RES (getRES(status)) /* use this instead, if possibl=
e */
=20
static inline UWord getRES ( SyscallStatus* st ) {
- vg_assert(st->what =3D=3D SsSuccess);
- return st->val;
+ vg_assert(st->what =3D=3D SsComplete);
+ vg_assert(!st->sres.isError);
+ return st->sres.res;
}
=20
=20
=20
/* Set the current result status/value in various ways. */
#define SET_STATUS_Success(zzz) \
- do { status->what =3D SsSuccess; \
- status->val =3D (zzz); \
+ do { status->what =3D SsComplete; \
+ status->sres =3D VG_(mk_SysRes_Success)(zzz); \
} while (0)
=20
#define SET_STATUS_Failure(zzz) \
do { Word wzz =3D (Word)(zzz); \
/* Catch out wildly bogus error values. */ \
vg_assert(wzz >=3D 0 && wzz < 10000); \
- status->what =3D SsFailure; \
- status->val =3D wzz; \
+ status->what =3D SsComplete; \
+ status->sres =3D VG_(mk_SysRes_Error)(wzz); \
} while (0)
=20
#define SET_STATUS_from_SysRes(zzz) \
do { \
- SysRes zres =3D (zzz); \
- if (zres.isError) { \
- SET_STATUS_Failure(zres.val); \
- } else { \
- SET_STATUS_Success(zres.val); \
- } \
+ status->what =3D SsComplete; \
+ status->sres =3D (zzz); \
} while (0)
=20
/* A lamentable kludge */
@@ -284,17 +327,7 @@
status->val =3D wzz; \
} while (0)
=20
-#define SET_STATUS_from_SysRes_NO_SANITY_CHECK(zzz) \
- do { \
- SysRes zres =3D (zzz); \
- if (zres.isError) { \
- SET_STATUS_Failure_NO_SANITY_CHECK(zres.val); \
- } else { \
- SET_STATUS_Success(zres.val); \
- } \
- } while (0)
=20
-
#define PRINT(format, args...) \
if (VG_(clo_trace_syscalls)) \
VG_(printf)(format, ## args)
@@ -329,6 +362,7 @@
do { \
Int here =3D layout->o_arg##n; \
vg_assert(sizeof(t) <=3D sizeof(UWord)); \
+ vg_assert(here >=3D 0); \
VG_(tdict).track_pre_reg_read( \
Vg_CoreSysCall, tid, s"("#a")", \
here, sizeof(t) \
@@ -343,8 +377,10 @@
*/
#define PRRAn_BE(n,s,t,a) \
do { \
+ Int here =3D layout->o_arg##n; \
Int next =3D layout->o_arg##n + sizeof(UWord); \
vg_assert(sizeof(t) <=3D sizeof(UWord)); \
+ vg_assert(here >=3D 0); \
VG_(tdict).track_pre_reg_read( \
Vg_CoreSysCall, tid, s"("#a")", \
next-sizeof(t), sizeof(t) \
Modified: branches/AIX5/coregrind/m_syswrap/syscall-ppc32-aix5.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/AIX5/coregrind/m_syswrap/syscall-ppc32-aix5.S 2006-10-02 00:=
38:05 UTC (rev 6139)
+++ branches/AIX5/coregrind/m_syswrap/syscall-ppc32-aix5.S 2006-10-03 19:=
06:29 UTC (rev 6140)
@@ -117,7 +117,6 @@
mr 6,7 /* nsigwords -- needed on AIX ? */
=20
/* actually do the sigprocmask */
- crorc 6,6,6
.long 0x48000005 /* bl here+4 */
mflr 26
addi 26,26,16
@@ -139,7 +138,6 @@
lwz 10,OFFSET_ppc32_GPR10(30)
mr 2,31 /* syscall number */
=20
- crorc 6,6,6
.long 0x48000005 /* bl here+4 */
mflr 26
addi 26,26,16
@@ -167,7 +165,6 @@
mr 6,28 /* nsigwords -- needed on AIX ? */
=20
/* actually do the sigprocmask */
- crorc 6,6,6
.long 0x48000005 /* bl here+4 */
mflr 26
addi 26,26,16
Modified: branches/AIX5/coregrind/m_syswrap/syscall-ppc32-linux.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/AIX5/coregrind/m_syswrap/syscall-ppc32-linux.S 2006-10-02 00=
:38:05 UTC (rev 6139)
+++ branches/AIX5/coregrind/m_syswrap/syscall-ppc32-linux.S 2006-10-03 19=
:06:29 UTC (rev 6140)
@@ -28,7 +28,7 @@
*/
=20
#include "pub_core_basics_asm.h"
-#include "vki_unistd.h"
+#include "pub_core_vkiscnums.h"
#include "libvex_guest_offsets.h"
=09
=20
Modified: branches/AIX5/coregrind/m_syswrap/syscall-ppc64-aix5.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/AIX5/coregrind/m_syswrap/syscall-ppc64-aix5.S 2006-10-02 00:=
38:05 UTC (rev 6139)
+++ branches/AIX5/coregrind/m_syswrap/syscall-ppc64-aix5.S 2006-10-03 19:=
06:29 UTC (rev 6140)
@@ -117,7 +117,6 @@
mr 6,7 /* nsigwords -- needed on AIX ? */
=20
/* actually do the sigprocmask */
- crorc 6,6,6
.long 0x48000005 /* bl here+4 */
mflr 26
addi 26,26,16
@@ -139,7 +138,6 @@
ld 10,OFFSET_ppc64_GPR10(30)
mr 2,31 /* syscall number */
=20
- crorc 6,6,6
.long 0x48000005 /* bl here+4 */
mflr 26
addi 26,26,16
@@ -167,7 +165,6 @@
mr 6,28 /* nsigwords -- needed on AIX ? */
=20
/* actually do the sigprocmask */
- crorc 6,6,6
.long 0x48000005 /* bl here+4 */
mflr 26
addi 26,26,16
Modified: branches/AIX5/coregrind/m_syswrap/syscall-ppc64-linux.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/AIX5/coregrind/m_syswrap/syscall-ppc64-linux.S 2006-10-02 00=
:38:05 UTC (rev 6139)
+++ branches/AIX5/coregrind/m_syswrap/syscall-ppc64-linux.S 2006-10-03 19=
:06:29 UTC (rev 6140)
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
=20
- Copyright (C) 2005 Paul Mackerras <pa...@sa...>
+ Copyright (C) 2005-2006 Paul Mackerras <pa...@sa...>
=20
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -28,7 +28,7 @@
*/
=20
#include "pub_core_basics_asm.h"
-#include "vki_unistd.h"
+#include "pub_core_vkiscnums.h"
#include "libvex_guest_offsets.h"
=09
=20
Modified: branches/AIX5/coregrind/m_syswrap/syscall-x86-linux.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/AIX5/coregrind/m_syswrap/syscall-x86-linux.S 2006-10-02 00:3=
8:05 UTC (rev 6139)
+++ branches/AIX5/coregrind/m_syswrap/syscall-x86-linux.S 2006-10-03 19:0=
6:29 UTC (rev 6140)
@@ -29,7 +29,7 @@
*/
=20
#include "pub_core_basics_asm.h"
-#include "vki_unistd.h"
+#include "pub_core_vkiscnums.h"
#include "libvex_guest_offsets.h"
=09
=09
Modified: branches/AIX5/coregrind/m_syswrap/syswrap-generic.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
--- branches/AIX5/coregrind/m_syswrap/syswrap-generic.c 2006-10-02 00:38:=
05 UTC (rev 6139)
+++ branches/AIX5/coregrind/m_syswrap/syswrap-generic.c 2006-10-03 19:06:=
29 UTC (rev 6140)
@@ -29,6 +29,8 @@
*/
=20
#include "pub_core_basics.h"
+#include "pub_core_vki.h"
+#include "pub_core_vkiscnums.h"
#include "pub_core_threadstate.h"
#include "pub_core_debuginfo.h" // VG_(di_notify_*)
#include "pub_core_aspacemgr.h"
@@ -55,9 +57,7 @@
#include "priv_types_n_macros.h"
#include "priv_syswrap-generic.h"
=20
-#include "vki_unistd.h" /* for the __NR_* constants */
=20
-
/* Returns True iff address range is something the client can
plausibly mess with: all of it is either already belongs to the
client or is free or a reservation. */
@@ -177,7 +177,7 @@
# define MIN_SIZET(_aa,_bb) (_aa) < (_bb) ? (_aa) : (_bb)
=20
Bool ok, d;
- NSegment* old_seg;
+ NSegment const* old_seg;
Addr advised;
Bool f_fixed =3D toBool(flags & VKI_MREMAP_FIXED);
Bool f_maymove =3D toBool(flags & VKI_MREMAP_MAYMOVE);
@@ -335,14 +335,14 @@
the next segment along. So make very sure that the proposed
new area really is free. This is perhaps overly
conservative, but it fixes #129866. */
- NSegment* segLo =3D VG_(am_find_nsegment)( needA );
- NSegment* segHi =3D VG_(am_find_nsegment)( needA + needL - 1 );
+ NSegment const* segLo =3D VG_(am_find_nsegment)( needA );
+ NSegment const* segHi =3D VG_(am_find_nsegment)( needA + needL - 1=
);
if (segLo =3D=3D NULL || segHi =3D=3D NULL=20
|| segLo !=3D segHi || segLo->kind !=3D SkFree)
ok =3D False;
}
if (ok && advised =3D=3D needA) {
- ok =3D VG_(am_extend_map_client)( &d, old_seg, needL );
+ ok =3D VG_(am_extend_map_client)( &d, (NSegment*)old_seg, needL );
if (ok) {
VG_TRACK( new_mem_mmap, needA, needL,=20
old_seg->hasR,=20
@@ -393,15 +393,15 @@
this-or-nothing) is too lenient, and may allow us to trash
the next segment along. So make very sure that the proposed
new area really is free. */
- NSegment* segLo =3D VG_(am_find_nsegment)( needA );
- NSegment* segHi =3D VG_(am_find_nsegment)( needA + needL - 1 );
+ NSegment const* segLo =3D VG_(am_find_nsegment)( needA );
+ NSegment const* segHi =3D VG_(am_find_nsegment)( needA + needL - 1=
);
if (segLo =3D=3D NULL || segHi =3D=3D NULL=20
|| segLo !=3D segHi || segLo->kind !=3D SkFree)
ok =3D False;
}
if (!ok || advised !=3D needA)
goto eNOMEM;
- ok =3D VG_(am_extend_map_client)( &d, old_seg, needL );
+ ok =3D VG_(am_extend_map_client)( &d, (NSegment*)old_seg, needL );
if (!ok)
goto eNOMEM;
VG_TRACK( new_mem_mmap, needA, needL,=20
@@ -703,23 +703,23 @@
return;
}
=20
- while ((ret =3D VG_(getdents)(f.val, &d, sizeof(d))) !=3D 0) {
+ while ((ret =3D VG_(getdents)(f.res, &d, sizeof(d))) !=3D 0) {
if (ret =3D=3D -1)
goto out;
=20
if (VG_(strcmp)(d.d_name, ".") && VG_(strcmp)(d.d_name, "..")) {
Int fno =3D VG_(atoll)(d.d_name);
=20
- if (fno !=3D f.val)
+ if (fno !=3D f.res)
if (VG_(clo_track_fds))
record_fd_open_named(-1, fno);
}
=20
- VG_(lseek)(f.val, d.d_off, VKI_SEEK_SET);
+ VG_(lseek)(f.res, d.d_off, VKI_SEEK_SET);
}
=20
out:
- VG_(close)(f.val);
+ VG_(close)(f.res);
}
=20
static
@@ -947,7 +947,8 @@
=20
static Addr do_brk ( Addr newbrk )
{
- NSegment *aseg, *rseg;
+ NSegment const* aseg;
+ NSegment const* rseg;
Addr newbrkP;
SizeT delta;
Bool ok;
@@ -968,7 +969,7 @@
if (newbrk >=3D VG_(brk_base) && newbrk < VG_(brk_limit)) {
/* shrinking the data segment. Be lazy and don't munmap the
excess area. */
- NSegment* seg =3D VG_(am_find_nsegment)(newbrk);
+ NSegment const * seg =3D VG_(am_find_nsegment)(newbrk);
if (seg && seg->hasT)
VG_(discard_translations)( newbrk, VG_(brk_limit) - newbrk,=20
"do_brk(shrink)" );
@@ -982,7 +983,7 @@
if (seg) {
/* pre: newbrk < VG_(brk_limit)=20
=3D> newbrk <=3D VG_(brk_limit)-1 */
- NSegment* seg2;
+ NSegment const * seg2;
vg_assert(newbrk < VG_(brk_limit));
seg2 =3D VG_(am_find_nsegment)( VG_(brk_limit)-1 );
if (seg2 && seg =3D=3D seg2 && seg->hasW)
@@ -998,7 +999,7 @@
aseg =3D VG_(am_find_nsegment)( VG_(brk_limit)-1 );
else
aseg =3D VG_(am_find_nsegment)( VG_(brk_limit) );
- rseg =3D VG_(am_next_nsegment)( aseg, True/*forwards*/ );
+ rseg =3D VG_(am_next_nsegment)( (NSegment*)aseg, True/*forwards*/ );
=20
/* These should be assured by setup_client_dataseg in m_main. */
vg_assert(aseg);
@@ -1026,7 +1027,7 @@
vg_assert(delta > 0);
vg_assert(VG_IS_PAGE_ALIGNED(delta));
=20
- ok =3D VG_(am_extend_into_adjacent_reservation_client)( aseg, delta )=
;
+ ok =3D VG_(am_extend_into_adjacent_reservation_client)( (NSegment*)as=
eg, delta );
if (!ok) goto bad;
=20
VG_(brk_limit) =3D newbrk;
@@ -1163,12 +1164,12 @@
{
SysRes r =3D res;
vg_assert(!res.isError); /* guaranteed by caller */
- if (!ML_(fd_allowed)(res.val, "socket", tid, True)) {
- VG_(close)(res.val);
+ if (!ML_(fd_allowed)(res.res, "socket", tid, True)) {
+ VG_(close)(res.res);
r =3D VG_(mk_SysRes_Error)( VKI_EMFILE );
} else {
if (VG_(clo_track_fds))
- ML_(record_fd_open_nameless)(tid, res.val);
+ ML_(record_fd_open_nameless)(tid, res.res);
}
return r;
}
@@ -1209,8 +1210,8 @@
{
SysRes r =3D res;
vg_assert(!res.isError); /* guaranteed by caller */
- if (!ML_(fd_allowed)(res.val, "accept", tid, True)) {
- VG_(close)(res.val);
+ if (!ML_(fd_allowed)(res.res, "accept", tid, True)) {
+ VG_(close)(res.res);
r =3D VG_(mk_SysRes_Error)( VKI_EMFILE );
} else {
Addr addr_p =3D arg1;
@@ -1219,7 +1220,7 @@
buf_and_len_post_check ( tid, res, addr_p, addrlen_p,
"socketcall.accept(addrlen_out)" );
if (VG_(clo_track_fds))
- ML_(record_fd_open_nameless)(tid, res.val);
+ ML_(record_fd_open_nameless)(tid, res.res);
}
return r;
}
@@ -1712,7 +1713,7 @@
void
ML_(generic_POST_sys_shmdt) ( ThreadId tid, UWord res, UWord arg0 )
{
- NSegment* s =3D VG_(am_find_nsegment)(arg0);
+ NSegment const* s =3D VG_(am_find_nsegment)(arg0);
=20
if (s !=3D NULL) {
Addr s_start =3D s->start;
@@ -1890,18 +1891,18 @@
if (!sres.isError) {
/* Notify aspacem and the tool. */
ML_(notify_aspacem_and_tool_of_mmap)(=20
- (Addr)sres.val, /* addr kernel actually assigned */
+ (Addr)sres.res, /* addr kernel actually assigned */
arg2, arg3,=20
arg4, /* the original flags value */
arg5, arg6=20
);
/* Load symbols? */
- VG_(di_notify_mmap)( (Addr)sres.val, False/*allow_SkFileV*/ );
+ VG_(di_notify_mmap)( (Addr)sres.res, False/*allow_SkFileV*/ );
}
=20
/* Stay sane */
if (!sres.isError && (arg4 & VKI_MAP_FIXED))
- vg_assert(sres.val =3D=3D arg1);
+ vg_assert(sres.res =3D=3D arg1);
=20
return sres;
}
@@ -1961,7 +1962,7 @@
tst =3D VG_(get_ThreadState)(tid);
/* Set the thread's status to be exiting, then claim that the
syscall succeeded. */
- tst->exitreason =3D VgSrc_ExitSyscall;
+ tst->exitreason =3D VgSrc_ExitThread;
tst->os_state.exitcode =3D ARG1;
SET_STATUS_Success(0);
}
@@ -2370,7 +2371,7 @@
// ok, etc.
res =3D VG_(pre_exec_check)((const Char*)ARG1, NULL);
if (res.isError) {
- SET_STATUS_Failure( res.val );
+ SET_STATUS_Failure( res.res );
return;
}
=20
@@ -2390,7 +2391,7 @@
/* Resistance is futile. Nuke all other threads. POSIX mandates
this. (Really, nuke them all, since the new process will make
its own new thread.) */
- VG_(nuke_all_threads_except)( tid, VgSrc_ExitSyscall );
+ VG_(nuke_all_threads_except)( tid, VgSrc_ExitThread );
VG_(reap_threads)(tid);
=20
// Set up the child's exe path.
@@ -2509,7 +2510,6 @@
{
vki_sigset_t allsigs;
vki_siginfo_t info;
- static const struct vki_timespec zero =3D { 0, 0 };
=20
for (i =3D 1; i < VG_(max_signal); i++) {
struct vki_sigaction sa;
@@ -2523,7 +2523,7 @@
}
=20
VG_(sigfillset)(&allsigs);
- while(VG_(sigtimedwait)(&allsigs, &info, &zero) > 0)
+ while(VG_(sigtimedwait_zero)(&allsigs, &info) > 0)
;
=20
VG_(sigprocmask)(VKI_SIG_SETMASK, &tst->sig_mask, NULL);
@@ -4743,7 +4743,7 @@
tst->os_state.fatalsig =3D VKI_SIGKILL;
=20
if (!VG_(is_running_thread)(tid))
- VG_(kill_thread)(tid);
+ VG_(get_thread_out_of_syscall)(tid);
}
=20
return True;
@@ -4833,13 +4833,13 @@
The sanity check provided by the kernel is that the vma must
have the VM_GROWSDOWN/VM_GROWSUP flag set as appropriate. */
UInt grows =3D ARG3 & (VKI_PROT_GROWSDOWN|VKI_PROT_GROWSUP);
- NSegment *aseg =3D VG_(am_find_nsegment)(ARG1);
- NSegment *rseg;
+ NSegment const *aseg =3D VG_(am_find_nsegment)(ARG1);
+ NSegment const *rseg;
=20
vg_assert(aseg);
=20
if (grows =3D=3D VKI_PROT_GROWSDOWN) {
- rseg =3D VG_(am_next_nsegment)( aseg, False/*backwards*/ );
+ rseg =3D VG_(am_next_nsegment)( (NSegment*)aseg, False/*backwar=
ds*/ );
if (rseg &&
rseg->kind =3D=3D SkResvn &&
rseg->smode =3D=3D SmUpper &&
@@ -4852,7 +4852,7 @@
SET_STATUS_Failure( VKI_EINVAL );
}
} else if (grows =3D=3D VKI_PROT_GROWSUP) {
- rseg =3D VG_(am_next_nsegment)( aseg, True/*forwards*/ );
+ rseg =3D VG_(am_next_nsegment)( (NSegment*)aseg, True/*forwards=
*/ );
if (rseg &&
rseg->kind =3D=3D SkResvn &&
rseg->smode =3D=3D SmLower &&
@@ -4974,7 +4974,7 @@
sres =3D VG_(dup)( VG_(cl_cmdline_fd) );
SET_STATUS_from_SysRes( sres );
if (!sres.isError) {
- OffT off =3D VG_(lseek)( sres.val, 0, VKI_SEEK_SET );
+ OffT off =3D VG_(lseek)( sres.res, 0, VKI_SEEK_SET );
if (off < 0)
SET_STATUS_Failure( VKI_EMFILE );
}
Modified: branches/AIX5/coregrind/m_syswrap/syswrap-linux-variants.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
--- branches/AIX5/coregrind/m_syswrap/syswrap-linux-variants.c 2006-10-02=
00:38:05 UTC (rev 6139)
+++ branches/AIX5/coregrind/m_syswrap/syswrap-linux-variants.c 2006-10-03=
19:06:29 UTC (rev 6140)
@@ -46,6 +46,7 @@
=20
=20
#include "pub_core_basics.h"
+#include "pub_core_vki.h"
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuginfo.h" // VG_(di_notify_*)
Modified: branches/AIX5/coregrind/m_syswrap/syswrap-linux.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
--- branches/AIX5/coregrind/m_syswrap/syswrap-linux.c 2006-10-02 00:38:05=
UTC (rev 6139)
+++ branches/AIX5/coregrind/m_syswrap/syswrap-linux.c 2006-10-03 19:06:29=
UTC (rev 6140)
@@ -29,6 +29,8 @@
*/
=20
#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_debuginfo.h" // VG_(di_notify_*)
@@ -53,7 +55,6 @@
#include "priv_syswrap-generic.h"
#include "priv_syswrap-linux.h"
=20
-#include "vki_unistd.h" /* for the __NR_* constants */
=20
// Run a thread from beginning to end and return the thread's
// scheduler-return-code.
@@ -70,7 +71,7 @@
vg_assert(tst->status =3D=3D VgTs_Init);
=20
/* make sure we get the CPU lock before doing anything significant */
- VG_(set_running)(tid);
+ VG_(set_running)(tid, "thread_wrapper(starting new thread)");
=20
if (0)
VG_(printf)("thread tid %d started: stack =3D %p\n",
@@ -324,7 +325,7 @@
# error Unknown platform
#endif
=20
- if (!res.isError && res.val =3D=3D 0) {
+ if (!res.isError && res.res =3D=3D 0) {
/* child */
VG_(do_atfork_child)(tid);
=20
@@ -332,11 +333,11 @@
VG_(sigprocmask)(VKI_SIG_SETMASK, &fork_saved_mask, NULL);
}=20
else=20
- if (!res.isError && res.val > 0) {
+ if (!res.isError && res.res > 0) {
/* parent */
if (VG_(clo_trace_syscalls))
VG_(printf)(" clone(fork): process %d created child %d\n",=20
- VG_(getpid)(), res.val);
+ VG_(getpid)(), res.res);
=20
/* restore signal mask */
VG_(sigprocmask)(VKI_SIG_SETMASK, &fork_saved_mask, NULL);
@@ -552,11 +553,11 @@
)
continue;
=20
- VG_(threads)[t].exitreason =3D VgSrc_ExitSyscall;
+ VG_(threads)[t].exitreason =3D VgSrc_ExitThread;
VG_(threads)[t].os_state.exitcode =3D ARG1;
=20
if (t !=3D tid)
- VG_(kill_thread)(t); /* unblock it, if blocked */
+ VG_(get_thread_out_of_syscall)(t); /* unblock it, if blocked */
}
=20
/* We have to claim the syscall already succeeded. */
@@ -2367,7 +2368,7 @@
sres =3D VG_(dup)( VG_(cl_cmdline_fd) );
SET_STATUS_from_SysRes( sres );
if (!sres.isError) {
- OffT off =3D VG_(lseek)( sres.val, 0, VKI_SEEK_SET );
+ OffT off =3D VG_(lseek)( sres.res, 0, VKI_SEEK_SET );
if (off < 0)
SET_STATUS_Failure( VKI_EMFILE );
}
Modified: branches/AIX5/coregrind/m_syswrap/syswrap-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
--- branches/AIX5/coregrind/m_syswrap/syswrap-main.c 2006-10-02 00:38:05 =
UTC (rev 6139)
+++ branches/AIX5/coregrind/m_syswrap/syswrap-main.c 2006-10-03 19:06:29 =
UTC (rev 6140)
@@ -30,6 +30,8 @@
=20
#include "libvex_guest_offsets.h"
#include "pub_core_basics.h"
+#include "pub_core_vki.h"
+#include "pub_core_vkiscnums.h"
#include "pub_core_threadstate.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
@@ -50,13 +52,17 @@
=20
=20
/* Useful info which needs to be recorded somewhere:
- Use of registers in syscalls (on linux) is:
+ Use of registers in syscalls is:
=20
- NUM ARG1 ARG2 ARG3 ARG4 ARG5 ARG6 RESULT
- x86 eax ebx ecx edx esi edi ebp eax (=3D=3D NUM=
)
- amd64 rax rdi rsi rdx r10 r8 r9 rax (=3D=3D NUM=
)
- ppc32 r0 r3 r4 r5 r6 r7 r8 r3+CR0.SO (=3D=3D ARG=
1)
- ppc64 r0 r3 r4 r5 r6 r7 r8 r3+CR0.SO (=3D=3D ARG=
1)
+ NUM ARG1 ARG2 ARG3 ARG4 ARG5 ARG6 ARG7 ARG8 RESULT
+ LINUX:
+ x86 eax ebx ecx edx esi edi ebp n/a n/a eax (=3D=3D =
NUM)
+ amd64 rax rdi rsi rdx r10 r8 r9 n/a n/a rax (=3D=3D =
NUM)
+ ppc32 r0 r3 r4 r5 r6 r7 r8 n/a n/a r3+CR0.SO (=3D=3D =
ARG1)
+ ppc64 r0 r3 r4 r5 r6 r7 r8 n/a n/a r3+CR0.SO (=3D=3D =
ARG1)
+ AIX:
+ ppc32 r2 r3 r4 r5 r6 r7 r8 r9 r10 r3(res),r4(err)
+ ppc64 r2 r3 r4 r5 r6 r7 r8 r9 r10 r3(res),r4(err)
*/
=20
/* This is the top level of the system-call handler module. All
@@ -223,11 +229,15 @@
VG_(fixup_guest_state_after_syscall_interrupted) below for details.
*/
extern
-UWord ML_(do_syscall_for_client_WRK)( Int syscallno,=20
+UWord ML_(do_syscall_for_client_WRK)( Word syscallno,=20
void* guest_state,
const vki_sigset_t *syscall_mask,
const vki_sigset_t *restore_mask,
- Int nsigwords );
+ Word nsigwords
+# if defined(VGO_aix5)
+ , Word __nr_sigprocmask
+# endif
+ );
=20
static
void do_syscall_for_client ( Int syscallno,
@@ -239,6 +249,9 @@
=3D ML_(do_syscall_for_client_WRK)(
syscallno, &tst->arch.vex,=20
syscall_mask, &saved, _VKI_NSIG_WORDS * sizeof(UWord)
+# if defined(VGO_aix5)
+ , __NR_rt_sigprocmask
+# endif
);
vg_assert2(
err =3D=3D 0,
@@ -262,38 +275,28 @@
&& a1->arg3 =3D=3D a2->arg3
&& a1->arg4 =3D=3D a2->arg4
&& a1->arg5 =3D=3D a2->arg5
- && a1->arg6 =3D=3D a2->arg6;
+ && a1->arg6 =3D=3D a2->arg6
+ && a1->arg7 =3D=3D a2->arg7
+ && a1->arg8 =3D=3D a2->arg8;
}
=20
static
Bool eq_SyscallStatus ( SyscallStatus* s1, SyscallStatus* s2 )
{
return s1->what =3D=3D s2->what=20
- && s1->val =3D=3D s2->val;
+ && s1->sres.res =3D=3D s2->sres.res
+ && s1->sres.err =3D=3D s2->sres.err;
}
=20
=20
-/* Convert between SysRet and SyscallStatus, to the extent possible. */
+/* Convert between SysRes and SyscallStatus, to the extent possible. */
=20
-/* This is unused. */
-/*
static
-SysRes convert_SyscallStatus_to_SysRes ( SyscallStatus status )
-{
- SysRes res;
- vg_assert(status.what =3D=3D SsSuccess || status.what =3D=3D SsFailur=
e);
- res.isError =3D status.what =3D=3D SsFailure;
- res.val =3D status.val;
- return res;
-}
-*/
-
-static
SyscallStatus convert_SysRes_to_SyscallStatus ( SysRes res )
{
SyscallStatus status;
- status.what =3D res.isError ? SsFailure : SsSuccess;
- status.val =3D res.val;
+ status.what =3D SsComplete;
+ status.sres =3D res;
return status;
}
=20
@@ -315,6 +318,8 @@
canonical->arg4 =3D gst->guest_ESI;
canonical->arg5 =3D gst->guest_EDI;
canonical->arg6 =3D gst->guest_EBP;
+ canonical->arg7 =3D 0;
+ canonical->arg8 =3D 0;
=20
#elif defined(VGP_amd64_linux)
VexGuestAMD64State* gst =3D (VexGuestAMD64State*)gst_vanilla;
@@ -325,7 +330,10 @@
canonical->arg4 =3D gst->guest_R10;
canonical->arg5 =3D gst->guest_R8;
canonical->arg6 =3D gst->guest_R9;
+ canonical->arg7 =3D 0;
+ canonical->arg8 =3D 0;
=20
+
#elif defined(VGP_ppc32_linux)
VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
canonical->sysno =3D gst->guest_GPR0;
@@ -335,7 +343,10 @@
canonical->arg4 =3D gst->guest_GPR6;
canonical->arg5 =3D gst->guest_GPR7;
canonical->arg6 =3D gst->guest_GPR8;
+ canonical->arg7 =3D 0;
+ canonical->arg8 =3D 0;
=20
+
#elif defined(VGP_ppc64_linux)
VexGuestPPC64State* gst =3D (VexGuestPPC64State*)gst_vanilla;
canonical->sysno =3D gst->guest_GPR0;
@@ -345,7 +356,34 @@
canonical->arg4 =3D gst->guest_GPR6;
canonical->arg5 =3D gst->guest_GPR7;
canonical->arg6 =3D gst->guest_GPR8;
+ canonical->arg7 =3D 0;
+ canonical->arg8 =3D 0;
=20
+
+#elif defined(VGP_ppc32_aix5)
+ VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
+ canonical->sysno =3D gst->guest_GPR2;
+ canonical->arg1 =3D gst->guest_GPR3;
+ canonical->arg2 =3D gst->guest_GPR4;
+ canonical->arg3 =3D gst->guest_GPR5;
+ canonical->arg4 =3D gst->guest_GPR6;
+ canonical->arg5 =3D gst->guest_GPR7;
+ canonical->arg6 =3D gst->guest_GPR8;
+ canonical->arg7 =3D gst->guest_GPR9;
+ canonical->arg8 =3D gst->guest_GPR10;
+
+#elif defined(VGP_ppc64_aix5)
+ VexGuestPPC64State* gst =3D (VexGuestPPC64State*)gst_vanilla;
+ canonical->sysno =3D gst->guest_GPR2;
+ canonical->arg1 =3D gst->guest_GPR3;
+ canonical->arg2 =3D gst->guest_GPR4;
+ canonical->arg3 =3D gst->guest_GPR5;
+ canonical->arg4 =3D gst->guest_GPR6;
+ canonical->arg5 =3D gst->guest_GPR7;
+ canonical->arg6 =3D gst->guest_GPR8;
+ canonical->arg7 =3D gst->guest_GPR9;
+ canonical->arg8 =3D gst->guest_GPR10;
+
#else
# error "getSyscallArgsFromGuestState: unknown arch"
#endif
@@ -395,6 +433,30 @@
gst->guest_GPR7 =3D canonical->arg5;
gst->guest_GPR8 =3D canonical->arg6;
=20
+#elif defined(VGP_ppc32_aix5)
+ VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
+ gst->guest_GPR2 =3D canonical->sysno;
+ gst->guest_GPR3 =3D canonical->arg1;
+ gst->guest_GPR4 =3D canonical->arg2;
+ gst->guest_GPR5 =3D canonical->arg3;
+ gst->guest_GPR6 =3D canonical->arg4;
+ gst->guest_GPR7 =3D canonical->arg5;
+ gst->guest_GPR8 =3D canonical->arg6;
+ gst->guest_GPR9 =3D canonical->arg7;
+ gst->guest_GPR10 =3D canonical->arg8;
+
+#elif defined(VGP_ppc64_aix5)
+ VexGuestPPC64State* gst =3D (VexGuestPPC64State*)gst_vanilla;
+ gst->guest_GPR2 =3D canonical->sysno;
+ gst->guest_GPR3 =3D canonical->arg1;
+ gst->guest_GPR4 =3D canonical->arg2;
+ gst->guest_GPR5 =3D canonical->arg3;
+ gst->guest_GPR6 =3D canonical->arg4;
+ gst->guest_GPR7 =3D canonical->arg5;
+ gst->guest_GPR8 =3D canonical->arg6;
+ gst->guest_GPR9 =3D canonical->arg7;
+ gst->guest_GPR10 =3D canonical->arg8;
+
#else
# error "putSyscallArgsIntoGuestState: unknown arch"
#endif
@@ -404,103 +466,118 @@
void getSyscallStatusFromGuestState ( /*OUT*/SyscallStatus* canonica=
l,
/*IN*/ VexGuestArchState* gst_vani=
lla )
{
-#if defined(VGP_x86_linux)
+# if defined(VGP_x86_linux)
VexGuestX86State* gst =3D (VexGuestX86State*)gst_vanilla;
- Int i =3D (Int)gst->guest_EAX;
- canonical->what =3D i >=3D -4095 && i <=3D -1 ? SsFailure : SsSucce=
ss;
- canonical->val =3D (UWord)(canonical->what=3D=3DSsFailure ? -i : i);
+ canonical->sres =3D VG_(mk_SysRes_x86_linux)( gst->guest_EAX );
+ canonical->what =3D SsComplete;
=20
-#elif defined(VGP_amd64_linux)
+# elif defined(VGP_amd64_linux)
VexGuestAMD64State* gst =3D (VexGuestAMD64State*)gst_vanilla;
- Long i =3D (Long)gst->guest_RAX;
- canonical->what =3D i >=3D -4095 && i <=3D -1 ? SsFailure : SsSucce=
ss;
- canonical->val =3D (UWord)(canonical->what=3D=3DSsFailure ? -i : i);
+ canonical->sres =3D VG_(mk_SysRes_amd64_linux)( gst->guest_RAX );
+ canonical->what =3D SsComplete;
=20
-#elif defined(VGP_ppc32_linux)
+# elif defined(VGP_ppc32_linux)
+ VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
+ UInt cr =3D LibVEX_GuestPPC32_get_CR( gst );
+ UInt cr0so =3D (cr >> 28) & 1;
+ canonical->sres =3D VG_(mk_SysRes_ppc32_linux)( gst->guest_GPR3, cr0s=
o );
+ canonical->what =3D SsComplete;
+
+# elif defined(VGP_ppc64_linux)
+ VexGuestPPC64State* gst =3D (VexGuestPPC64State*)gst_vanilla;
+ UInt cr =3D LibVEX_GuestPPC64_get_CR( gst );
+ UInt cr0so =3D (cr >> 28) & 1;
+ canonical->sres =3D VG_(mk_SysRes_ppc32_linux)( gst->guest_GPR3, cr0s=
o );
+ canonical->what =3D SsComplete;
+
+# elif defined(VGP_ppc32_aix5)
VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
- UInt cr =3D LibVEX_GuestPPC32_get_CR( gst );
- UInt err =3D (cr >> 28) & 1; // CR0.SO
- canonical->what =3D (err =3D=3D 1) ? SsFailure : SsSuccess;
- canonical->val =3D (UWord)gst->guest_GPR3;
+ canonical->sres =3D VG_(mk_SysRes_ppc32_aix5)( gst->guest_GPR3,=20
+ gst->guest_GPR4 );
+ canonical->what =3D SsComplete;
=20
-#elif defined(VGP_ppc64_linux)
+# elif defined(VGP_ppc64_aix5)
VexGuestPPC64State* gst =3D (VexGuestPPC64State*)gst_vanilla;
- UInt cr =3D LibVEX_GuestPPC64_get_CR( gst );
- UInt err =3D (cr >> 28) & 1; // CR0.SO
- canonical->what =3D (err =3D=3D 1) ? SsFailure : SsSuccess;
- canonical->val =3D (UWord)gst->guest_GPR3;
+ canonical->sres =3D VG_(mk_SysRes_ppc64_aix5)( gst->guest_GPR3,=20
+ gst->guest_GPR4 );
+ canonical->what =3D SsComplete;
=20
-#else
-# error "getSyscallStatusFromGuestState: unknown arch"
-#endif
+# else
+# error "getSyscallStatusFromGuestState: unknown arch"
+# endif
}
=20
static=20
void putSyscallStatusIntoGuestState ( /*IN*/ SyscallStatus* canonica=
l,
/*OUT*/VexGuestArchState* gst_vani=
lla )
{
-#if defined(VGP_x86_linux)
+# if defined(VGP_x86_linux)
VexGuestX86State* gst =3D (VexGuestX86State*)gst_vanilla;
- vg_assert(canonical->what =3D=3D SsSuccess=20
- || canonical->what =3D=3D SsFailure);
- if (canonical->what =3D=3D SsFailure) {
+ vg_assert(canonical->what =3D=3D SsComplete);
+ if (canonical->sres.isError) {
/* This isn't exactly right, in that really a Failure with res
not in the range 1 .. 4095 is unrepresentable in the
Linux-x86 scheme. Oh well. */
- gst->guest_EAX =3D - (Int)canonical->val;
+ gst->guest_EAX =3D - (Int)canonical->sres.err;
} else {
- gst->guest_EAX =3D canonical->val;
+ gst->guest_EAX =3D canonical->sres.res;
}
-#elif defined(VGP_amd64_linux)
+
+# elif defined(VGP_amd64_linux)
VexGuestAMD64State* gst =3D (VexGuestAMD64State*)gst_vanilla;
- vg_assert(canonical->what =3D=3D SsSuccess=20
- || canonical->what =3D=3D SsFailure);
- if (canonical->what =3D=3D SsFailure) {
+ vg_assert(canonical->what =3D=3D SsComplete);
+ if (canonical->sres.isError) {
/* This isn't exactly right, in that really a Failure with res
not in the range 1 .. 4095 is unrepresentable in the
Linux-x86 scheme. Oh well. */
- gst->guest_RAX =3D - (Long)canonical->val;
+ gst->guest_RAX =3D - (Long)canonical->sres.err;
} else {
- gst->guest_RAX =3D canonical->val;
+ gst->guest_RAX =3D canonical->sres.res;
}
=20
-#elif defined(VGP_ppc32_linux)
+# elif defined(VGP_ppc32_linux)
VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
+ vg_assert(canonical->what =3D=3D SsComplete);
UInt old_cr =3D LibVEX_GuestPPC32_get_CR(gst);
-
- vg_assert(canonical->what =3D=3D SsSuccess=20
- || canonical->what =3D=3D SsFailure);
-
- gst->guest_GPR3 =3D canonical->val;
-
- if (canonical->what =3D=3D SsFailure) {
+ if (canonical->sres.isError) {
/* set CR0.SO */
LibVEX_GuestPPC32_put_CR( old_cr | (1<<28), gst );
+ gst->guest_GPR3 =3D canonical->sres.err;
} else {
/* clear CR0.SO */
LibVEX_GuestPPC32_put_CR( old_cr & ~(1<<28), gst );
+ gst->guest_GPR3 =3D canonical->sres.res;
}
=20
-#elif defined(VGP_ppc64_linux)
+# elif defined(VGP_ppc64_linux)
VexGuestPPC64State* gst =3D (VexGuestPPC64State*)gst_vanilla;
+ vg_assert(canonical->what =3D=3D SsComplete);
UInt old_cr =3D LibVEX_GuestPPC64_get_CR(gst);
-
- vg_assert(canonical->what =3D=3D SsSuccess=20
- || canonical->what =3D=3D SsFailure);
-
- gst->guest_GPR3 =3D canonical->val;
-
- if (canonical->what =3D=3D SsFailure) {
+ if (canonical->sres.isError) {
/* set CR0.SO */
LibVEX_GuestPPC64_put_CR( old_cr | (1<<28), gst );
+ gst->guest_GPR3 =3D canonical->sres.err;
} else {
/* clear CR0.SO */
LibVEX_GuestPPC64_put_CR( old_cr & ~(1<<28), gst );
+ gst->guest_GPR3 =3D canonical->sres.res;
}
=20
-#else
-# error "putSyscallStatusIntoGuestState: unknown arch"
-#endif
+# elif defined(VGP_ppc32_aix5)
+ VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
+ vg_assert(canonical->what =3D=3D SsComplete);
+ gst->guest_GPR3 =3D canonical->sres.res;
+ gst->guest_GPR4 =3D canonical->sres.err;
+
+# elif defined(VGP_ppc64_aix5)
+ VexGuestPPC64State* gst =3D (VexGuestPPC64State*)gst_vanilla;
+ vg_assert(canonical->what =3D=3D SsComplete);
+ gst->guest_GPR3 =3D canonical->sres.res;
+ gst->guest_GPR4 =3D canonical->sres.err;
+
+# else
+# error "putSyscallStatusIntoGuestState: unknown arch"
+# endif
}
=20
=20
@@ -519,6 +596,8 @@
layout->o_arg4 =3D OFFSET_x86_ESI;
layout->o_arg5 =3D OFFSET_x86_EDI;
layout->o_arg6 =3D OFFSET_x86_EBP;
+ layout->o_arg7 =3D -1; /* impossible value */
+ layout->o_arg8 =3D -1; /* impossible value */
layout->o_retval =3D OFFSET_x86_EAX;
=20
#elif defined(VGP_amd64_linux)
@@ -529,6 +608,8 @@
layout->o_arg4 =3D OFFSET_amd64_R10;
layout->o_arg5 =3D OFFSET_amd64_R8;
layout->o_arg6 =3D OFFSET_amd64_R9;
+ layout->o_arg7 =3D -1; /* impossible value */
+ layout->o_arg8 =3D -1; /* impossible value */
layout->o_retval =3D OFFSET_amd64_RAX;
=20
#elif defined(VGP_ppc32_linux)
@@ -539,6 +620,8 @@
layout->o_arg4 =3D OFFSET_ppc32_GPR6;
layout->o_arg5 =3D OFFSET_ppc32_GPR7;
layout->o_arg6 =3D OFFSET_ppc32_GPR8;
+ layout->o_arg7 =3D -1; /* impossible value */
+ layout->o_arg8 =3D -1; /* impossible value */
layout->o_retval =3D OFFSET_ppc32_GPR3;
=20
#elif defined(VGP_ppc64_linux)
@@ -549,8 +632,34 @@
layout->o_arg4 =3D OFFSET_ppc64_GPR6;
layout->o_arg5 =3D OFFSET_ppc64_GPR7;
layout->o_arg6 =3D OFFSET_ppc64_GPR8;
+ layout->o_arg7 =3D -1; /* impossible value */
+ layout->o_arg8 =3D -1; /* impossible value */
layout->o_retval =3D OFFSET_ppc64_GPR3;
=20
+#elif defined(VGP_ppc32_aix5)
+ layout->o_sysno =3D OFFSET_ppc32_GPR2;
+ layout->o_arg1 =3D OFFSET_ppc32_GPR3;
+ layout->o_arg2 =3D OFFSET_ppc32_GPR4;
+ layout->o_arg3 =3D OFFSET_ppc32_GPR5;
+ layout->o_arg4 =3D OFFSET_ppc32_GPR6;
+ layout->o_arg5 =3D OFFSET_ppc32_GPR7;
+ layout->o_arg6 =3D OFFSET_ppc32_GPR8;
+ layout->o_arg7 =3D OFFSET_ppc32_GPR9;
+ layout->o_arg8 =3D OFFSET_ppc32_GPR10;
+ layout->o_retval =3D OFFSET_ppc32_GPR3;
+
+#elif defined(VGP_ppc64_aix5)
+ layout->o_sysno =3D OFFSET_ppc64_GPR2;
+ layout->o_arg1 =3D OFFSET_ppc64_GPR3;
+ layout->o_arg2 =3D OFFSET_ppc64_GPR4;
+ layout->o_arg3 =3D OFFSET_ppc64_GPR5;
+ layout->o_arg4 =3D OFFSET_ppc64_GPR6;
+ layout->o_arg5 =3D OFFSET_ppc64_GPR7;
+ layout->o_arg6 =3D OFFSET_ppc64_GPR8;
+ layout->o_arg7 =3D OFFSET_ppc64_GPR9;
+ layout->o_arg8 =3D OFFSET_ppc64_GPR10;
+ layout->o_retval =3D OFFSET_ppc64_GPR3;
+
#else
# error "getSyscallLayout: unknown arch"
#endif
@@ -589,13 +698,24 @@
=20
static const SyscallTableEntry* get_syscall_entry ( UInt syscallno )
{
- const SyscallTableEntry* sys =3D &bad_sys;
+ const SyscallTableEntry* sys =3D NULL;
=20
+# if defined(VGO_linux)
if (syscallno < ML_(syscall_table_size) &&
ML_(syscall_table)[syscallno].before !=3D NULL)
sys =3D &ML_(syscall_table)[syscallno];
=20
- return sys;
+# elif defined(VGP_ppc32_aix5)
+ sys =3D ML_(get_ppc32_aix5_syscall_entry) ( syscallno );
+
+# elif defined(VGP_ppc64_aix5)
+ sys =3D ML_(get_ppc64_aix5_syscall_entry) ( syscallno );
+
+# else
+# error Unknown OS
+# endif
+
+ return sys =3D=3D NULL ? &bad_sys : sys;
}
=20
=20
@@ -677,9 +797,11 @@
sysno =3D sci->orig_args.sysno;
=20
/* The default what-to-do-next thing is hand the syscall to the
- kernel, so we pre-set that here. */
+ kernel, so we pre-set that here. Set .sres to something
+ harmless looking (is irrelevant because .what is not
+ SsComplete.) */
sci->status.what =3D SsHandToKernel;
- sci->status.val =3D 0;
+ sci->status.sres =3D VG_(mk_SysRes_Error)(0);
sci->flags =3D 0;
=20
/* Fetch the syscall's handlers. If no handlers exist for this
@@ -730,14 +852,13 @@
*/
/* Now we proceed according to what the pre-handler decided. */
vg_assert(sci->status.what =3D=3D SsHandToKernel
- || sci->status.what =3D=3D SsSuccess
- || sci->status.what =3D=3D SsFailure);
+ || sci->status.what =3D=3D SsComplete);
vg_assert(sci->args.sysno =3D=3D sci->orig_args.sysno);
=20
- if (sci->status.what =3D=3D SsSuccess) {
+ if (sci->status.what =3D=3D SsComplete && !sci->status.sres.isError) =
{
/* The pre-handler completed the syscall itself, declaring
success. */
- PRINT(" --> [pre-success] Success(0x%llx)\n", (Long)sci->status.va=
l );
+ PRINT(" --> [pre-success] Success(0x%llx)\n", (ULong)sci->status.s=
res.res );
=20
/* In this case the allowable flags are to ask for a signal-poll
and/or a yield after the call. Changing the args isn't
@@ -747,9 +868,9 @@
}
=20
else
- if (sci->status.what =3D=3D SsFailure) {
+ if (sci->status.what =3D=3D SsComplete && sci->status.sres.isError) {
/* The pre-handler decided to fail syscall itself. */
- PRINT(" --> [pre-fail] Failure(0x%llx)\n", (Long)sci->status.val )=
;
+ PRINT(" --> [pre-fail] Failure(0x%llx)\n", (ULong)sci->status.sres=
.err );
/* In this case, the pre-handler is also allowed to ask for the
post-handler to be run anyway. Changing the args is not
allowed. */
@@ -794,7 +915,7 @@
putSyscallArgsIntoGuestState( &sci->args, &tst->arch.vex );
=20
/* Drop the lock */
- VG_(set_sleeping)(tid, VgTs_WaitSys);
+ VG_(set_sleeping)(tid, VgTs_WaitSys, "VG_(client_syscall)[async=
]");
=20
/* Do the call, which operates directly on the guest state,
not on our abstracted copies of the args/result. */
@@ -809,16 +930,18 @@
to the scheduler. */
=20
/* Reacquire the lock */
- VG_(set_running)(tid);
+ VG_(set_running)(tid, "VG_(client_syscall)[async]");
=20
/* Even more impedance matching. Extract the syscall status
from the guest state. */
getSyscallStatusFromGuestState( &sci->status, &tst->arch.vex );
+ vg_assert(sci->status.what =3D=3D SsComplete);
=20
PRINT("SYSCALL[%d,%d](%3d) ... [async] --> %s(0x%llx)\n",
VG_(getpid)(), tid, sysno,=20
- sci->status.what=3D=3DSsSuccess ? "Success" : "Failure",
- (Long)sci->status.val );
+ sci->status.sres.isError ? "Failure" : "Success",
+ sci->status.sres.isError ? (ULong)sci->status.sres.err
+ : (ULong)sci->status.sres.res );
=20
} else {
=20
@@ -828,21 +951,21 @@
kernel, there's no point in flushing them back to the
guest state. Indeed doing so could be construed as
incorrect. */
-
SysRes sres=20
- =3D VG_(do_syscall6)(sysno, sci->args.arg1, sci->args.arg2,=20
- sci->args.arg3, sci->args.arg4,=20
- sci->args.arg5, sci->args.arg6 );
+ =3D VG_(do_syscall)(sysno, sci->args.arg1, sci->args.arg2,=20
+ sci->args.arg3, sci->args.arg4,=20
+ sci->args.arg5, sci->args.arg6,
+ sci->args.arg7, sci->args.arg8 );
sci->status =3D convert_SysRes_to_SyscallStatus(sres);
=20
PRINT("[sync] --> %s(0x%llx)\n",
- sci->status.what=3D=3DSsSuccess ? "Success" : "Failure",
- (Long)sci->status.val );
+ sci->status.sres.isError ? "Failure" : "Success",
+ sci->status.sres.isError ? (ULong)sci->status.sres.err
+ : (ULong)sci->status.sres.res );
}
}
=20
- vg_assert(sci->status.what =3D=3D SsFailure=20
- || sci->status.what =3D=3D SsSuccess);
+ vg_assert(sci->status.what =3D=3D SsComplete);
=20
vg_assert(VG_(is_running_thread)(tid));
=20
@@ -900,8 +1023,7 @@
/* Validate current syscallInfo entry. In particular we require
that the current .status matches what's actually in the guest
state. */
- vg_assert(sci->status.what =3D=3D SsFailure=20
- || sci->status.what =3D=3D SsSuccess);
+ vg_assert(sci->status.what =3D=3D SsComplete);
=20
getSyscallStatusFromGuestState( &test_status, &tst->arch.vex );
vg_assert(eq_SyscallStatus( &sci->status, &test_status ));
@@ -922,13 +1044,14 @@
VG_TRACK( post_reg_write, Vg_CoreSysCall, tid, layout.o_retval,=20
sizeof(UWord) );
=20
- /* Consider, either success or failure. Now run the post handler if:
+ /* pre: status =3D=3D Complete (asserted above) */
+ /* Consider either success or failure. Now run the post handler if:
- it exists, and
- - status=3D=3DSuccess or (status=3D=3DFail and PostOnFail is set)
+ - Success or (Failure and PostOnFail is set)
*/
if (ent->after
- && (sci->status.what =3D=3D SsSuccess
- || (sci->status.what =3D=3D SsFailure
+ && ((!sci->status.sres.isError)
+ || (sci->status.sres.isError
&& (sci->flags & SfPostOnFail) ))) {
=20
(ent->after)( tid, &sci->args, &sci->status );
@@ -941,14 +1064,11 @@
putSyscallStatusIntoGuestState( &sci->status, &tst->arch.vex );
=20
/* Do any post-syscall actions required by the tool. */
- if (VG_(needs).syscall_wrapper) {
- SysRes res;
- res.val =3D sci->status.val;
- res.isError =3D sci->status.what =3D=3D SsFailure;
- VG_TDICT_CALL(tool_post_syscall, tid, sysno, res);
- }
+ if (VG_(needs).syscall_wrapper)
+ VG_TDICT_CALL(tool_post_syscall, tid, sysno, sci->status.sres);
=20
/* The syscall is done. */
+ vg_assert(sci->status.what =3D=3D SsComplete);
sci->status.what =3D SsIdle;
=20
/* The pre/post wrappers may have concluded that pending signals
@@ -1061,6 +1181,32 @@
vg_assert(p[0] =3D=3D 0x44 && p[1] =3D=3D 0x0 && p[2] =3D=3D 0x0 &=
& p[3] =3D=3D 0x2);
}
=20
+#elif defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ /* Hmm. This is problematic, because on AIX the kernel resumes
+ after a syscall at LR, not at the insn following SC. Hence
+ there is no obvious way to figure out where the SC is. Current
+ solution is to have a pseudo-register in the guest state,
+ CIA_AT_SC, which holds the address of the most recent SC
+ executed. Backing up to that syscall then simply involves
+ copying that value back into CIA (the program counter). */
+ arch->vex.guest_CIA =3D arch->vex.guest_CIA_AT_SC;
+
+ /* Make sure our caller is actually sane, and we're really backing
+ back over a syscall.
+
+ sc =3D=3D 44 00 00 02
+ */
+ {
+ UChar *p =3D (UChar *)arch->vex.guest_CIA;
+
+ if (p[0] !=3D 0x44 || p[1] !=3D 0x0 || p[2] !=3D 0x0 || p[3] !=3D =
0x02)
+ VG_(message)(Vg_DebugMsg,
+ "?! restarting over syscall at %p %02x %02x %02x %=
02x\n",
+ arch->vex.guest_CIA, p[0], p[1], p[2], p[3]);
+
+ vg_assert(p[0] =3D=3D 0x44 && p[1] =3D=3D 0x0 && p[2] =3D=3D 0x0 &=
& p[3] =3D=3D 0x2);
+ }
+
#else
# error "ML_(fixup_guest_state_to_restart_syscall): unknown plat"
#endif
@@ -1100,7 +1246,7 @@
VG_(fixup_guest_state_after_syscall_interrupted)( ThreadId tid,=20
Addr ip,=20
UWord sysnum,=20
- SysRes sysret,
+ SysRes sres,
Bool restart)
{
/* Note that the sysnum arg seems to contain not-dependable-on info
@@ -1122,8 +1268,8 @@
(Int)tid,
(ULong)ip,=20
restart ? "True" : "False",=20
- sysret.isError ? "True" : "False",
- (Long)(Word)sysret.val );
+ sres.isError ? "True" : "False",
+ (Long)(Word)(sres.isError ? sres.err : sres.res) );
=20
vg_assert(VG_(is_valid_tid)(tid));
vg_assert(tid >=3D 1 && tid < VG_N_THREADS);
@@ -1180,8 +1326,8 @@
Write the SysRes we were supplied with back to the guest
state. */
if (debug)
- VG_(printf)(" completed\n", sysret);
- canonical =3D convert_SysRes_to_SyscallStatus( sysret );
+ VG_(printf)(" completed\n");
+ canonical =3D convert_SysRes_to_SyscallStatus( sres );
putSyscallStatusIntoGuestState( &canonical, &th_regs->vex );
sci->status =3D canonical;
VG_(post_syscall)(tid);
Modified: branches/AIX5/coregrind/m_syswrap/syswrap-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
--- branches/AIX5/coregrind/m_syswrap/syswrap-ppc32-aix5.c 2006-10-02 00:=
38:05 UTC (rev 6139)
+++ branches/AIX5/coregrind/m_syswrap/syswrap-ppc32-aix5.c 2006-10-03 19:=
06:29 UTC (rev 6140)
@@ -205,7 +205,6 @@
"mr 2,23\n\t" /* r2 =3D __NR_exit */
"mr 3,22\n\t" /* set r3 =3D tst->os_state.exitcode =
*/
/* set up for syscall */
- "crorc 6,6,6\n\t"
".long 0x48000005\n\t" /* "bl here+4" */
"mflr 29\n\t"
"addi 29,29,16\n\t"
@@ -514,7 +513,7 @@
"thread_setstate (NEW)");
=20
/* Intercept and handle ourselves any attempts to cancel=20
- another thread (our ourselves). */
+ another thread (including this one). */
=20
if (ats_new && (!ats_old) && ats_new->flags =3D=3D TSTATE_INTR) {
dst_ts =3D NULL;
Modified: branches/AIX5/coregrind/m_syswrap/syswrap-ppc32-linux.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
--- branches/AIX5/coregrind/m_syswrap/syswrap-ppc32-linux.c 2006-10-02 00=
:38:05 UTC (rev 6139)
+++ branches/AIX5/coregrind/m_syswrap/syswrap-ppc32-linux.c 2006-10-03 19=
:06:29 UTC (rev 6140)
@@ -29,6 +29,8 @@
*/
=20
#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_debuglog.h"
@@ -50,9 +52,7 @@
#include "priv_syswrap-linux.h" /* for decls of linux-ish wrappers *=
/
#include "priv_syswrap-main.h"
=20
-#include "vki_unistd.h" /* for the __NR_* constants */
=20
-
/* ---------------------------------------------------------------------
clone() handling
------------------------------------------------------------------ */
@@ -239,7 +239,7 @@
ThreadState* ctst =3D VG_(get_ThreadState)(ctid);
ULong word64;
UWord* stack;
- NSegment* seg;
+ NSegment const* seg;
SysRes res;
vki_sigset_t blockall, savedmask;
=20
@@ -1060,7 +1060,7 @@
It's a conceptual copy-n-paste from the x86 equivalent, but I'm=20
equally unclear as to whether it is needed there either.
*/
- SET_STATUS_from_SysRes_NO_SANITY_CHECK(
+ SET_STATUS_from_SysRes(
VG_(mk_SysRes_ppc32_linux)(=20
tst->arch.vex.guest_GPR3,
/* get CR0.SO */
@@ -1095,7 +1095,7 @@
VG_(sigframe_destroy)(tid, True);
=20
/* See comments above in PRE(sys_sigreturn) about this. */
- SET_STATUS_from_SysRes_NO_SANITY_CHECK(
+ SET_STATUS_from_SysRes(
VG_(mk_SysRes_ppc32_linux)(=20
tst->arch.vex.guest_GPR3,
/* get CR0.SO */
Modified: branches/AIX5/coregrind/m_syswrap/syswrap-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
--- branches/AIX5/coregrind/m_syswrap/syswrap-ppc64-aix5.c 2006-10-02 00:=
38:05 UTC (rev 6139)
+++ branches/AIX5/coregrind/m_syswrap/syswrap-ppc64-aix5.c 2006-10-03 19:=
06:29 UTC (rev 6140)
@@ -205,7 +205,6 @@
"mr 2,23\n\t" /* r2 =3D __NR_exit */
"mr 3,22\n\t" /* set r3 =3D tst->os_state.exitcode =
*/
/* set up for syscall */
- "crorc 6,6,6\n\t"
".long 0x48000005\n\t" /* "bl here+4" */
"mflr 29\n\t"
"addi 29,29,16\n\t"
Modified: branches/AIX5/coregrind/m_syswrap/syswrap-ppc64-linux.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
--- branches/AIX5/coregrind/m_syswrap/syswrap-ppc64-linux.c 2006-10-02 00=
:38:05 UTC (rev 6139)
+++ branches/AIX5/coregrind/m_syswrap/syswrap-ppc64-linux.c 2006-10-03 19=
:06:29 UTC (rev 6140)
@@ -29,6 +29,8 @@
*/
=20
#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_debuglog.h"
@@ -50,9 +52,7 @@
#include "priv_syswrap-linux.h" /* for decls of linux-ish wrappers *=
/
#include "priv_syswrap-main.h"
=20
-#include "vki_unistd.h" /* for the __NR_* constants */
=20
-
/* ---------------------------------------------------------------------
clone() handling
------------------------------------------------------------------ */
@@ -267,7 +267,7 @@
ThreadState* ctst =3D VG_(get_ThreadState)(ctid);
ULong word64;
UWord* stack;
- NSegment* seg;
+ NSegment const* seg;
SysRes res;
vki_sigset_t blockall, savedmask;
=20
@@ -1073,7 +1073,7 @@
VG_(sigframe_destroy)(tid, True);
=20
/* See comments above in PRE(sys_sigreturn) about this. */
- SET_STATUS_from_SysRes_NO_SANITY_CHECK(
+ SET_STATUS_from_SysRes(
VG_(mk_SysRes_ppc64_linux)(=20
tst->arch.vex.guest_GPR3,
/* get CR0.SO */
Modified: branches/AIX5/coregrind/m_syswrap/syswrap-x86-linux.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...
[truncated message content] |