|
From: <sv...@va...> - 2005-11-24 03:54:45
|
Author: sewardj
Date: 2005-11-24 03:54:38 +0000 (Thu, 24 Nov 2005)
New Revision: 5231
Log:
ppc32 only: clarify meaning of second arg of VG_(mk_SysRes_ppc32_linux)
and fix an inconsistent use of it, from m_signals.
Modified:
trunk/coregrind/m_signals.c
trunk/coregrind/m_syscall.c
trunk/coregrind/pub_core_syscall.h
Modified: trunk/coregrind/m_signals.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_signals.c 2005-11-23 03:42:57 UTC (rev 5230)
+++ trunk/coregrind/m_signals.c 2005-11-24 03:54:38 UTC (rev 5231)
@@ -155,10 +155,12 @@
# define VG_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.mc_gregs[1]=
)
# define VG_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.mc_gregs[1]=
)
# define VG_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.mc_gregs[0]=
)
-# define VG_UCONTEXT_SYSCALL_SYSRES(uc) =
\
- /* Convert the values in uc_mcontext r3,cr into a SysRes. */ =
\
- VG_(mk_SysRes_ppc32_linux)( (uc)->uc_mcontext.mc_gregs[3], =
\
- (uc)->uc_mcontext.mc_gregs[VKI_PT_CCR] )
+# define VG_UCONTEXT_SYSCALL_SYSRES(uc) \
+ /* Convert the values in uc_mcontext r3,cr into a SysRes. */ \
+ VG_(mk_SysRes_ppc32_linux)( \
+ (uc)->uc_mcontext.mc_gregs[3], \
+ (((uc)->uc_mcontext.mc_gregs[VKI_PT_CCR] >> 28) & 1) \
+ )
# define VG_UCONTEXT_LINK_REG(uc) ((uc)->uc_mcontext.mc_gregs[VK=
I_PT_LNK])=20
=20
#else
Modified: trunk/coregrind/m_syscall.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_syscall.c 2005-11-23 03:42:57 UTC (rev 5230)
+++ trunk/coregrind/m_syscall.c 2005-11-24 03:54:38 UTC (rev 5231)
@@ -70,9 +70,10 @@
}
=20
/* PPC uses the CR7.SO bit to flag an error (CR0 in IBM-speke) */
-SysRes VG_(mk_SysRes_ppc32_linux) ( UInt val, UInt errflag ) {
+/* Note this must be in the bottom bit of the second arg */
+SysRes VG_(mk_SysRes_ppc32_linux) ( UInt val, UInt cr0so ) {
SysRes res;
- res.isError =3D errflag !=3D 0;
+ res.isError =3D (cr0so & 1) !=3D 0;
res.val =3D val;
return res;
}
@@ -167,13 +168,14 @@
".previous\n"
);
#elif defined(VGP_ppc32_linux)
-/* Incoming args (syscall number + up to 6 args) come in %r0, %r3:%r8
+/* Incoming args (syscall number + up to 6 args) come in %r3:%r9.
=20
The syscall number goes in %r0. The args are passed to the syscall i=
n
the regs %r3:%r8, i.e. the kernel's syscall calling convention.
=20
The %cr0.so bit flags an error.
- We return the syscall return value in %r3, and the %cr in %r4.
+ We return the syscall return value in %r3, and the %cr0.so in=20
+ the lowest bit of %r4.
We return a ULong, of which %r3 is the high word, and %r4 the low.
No callee-save regs are clobbered, so no saving/restoring is needed.
*/
@@ -214,8 +216,8 @@
#elif defined(VGP_ppc32_linux)
ULong ret =3D do_syscall_WRK(sysno,a1,a2,a3,a4,a5,a6);
UInt val =3D (UInt)(ret>>32);
- UInt errflag =3D (UInt)(ret);
- return VG_(mk_SysRes_ppc32_linux)( val, errflag );
+ UInt cr0so =3D (UInt)(ret);
+ return VG_(mk_SysRes_ppc32_linux)( val, cr0so );
#else
# error Unknown platform
#endif
Modified: trunk/coregrind/pub_core_syscall.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/pub_core_syscall.h 2005-11-23 03:42:57 UTC (rev 5230)
+++ trunk/coregrind/pub_core_syscall.h 2005-11-24 03:54:38 UTC (rev 5231)
@@ -63,7 +63,7 @@
=20
extern SysRes VG_(mk_SysRes_x86_linux) ( Word val );
extern SysRes VG_(mk_SysRes_amd64_linux) ( Word val );
-extern SysRes VG_(mk_SysRes_ppc32_linux) ( UInt val, UInt errflag );
+extern SysRes VG_(mk_SysRes_ppc32_linux) ( UInt val, UInt cr0so );
extern SysRes VG_(mk_SysRes_Error) ( UWord val );
extern SysRes VG_(mk_SysRes_Success) ( UWord val );
=20
|