Date: Fri, 7 Nov 2008 23:21:35 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 152638 for review Message-ID: <200811072321.mA7NLZ4c062661@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=152638 Change 152638 by peter@peter_hammer on 2008/11/07 23:20:41 res2 (%edx) handling across syscalls is "special" on i386. syscalls may or may not specify it. It is otherwise preserved across a syscall, and some asm stubs in libc depend on this (eg: brk()). This is not the case for amd64 where the syscall interface uses the C calling convention and trashes the scratch registers. %rdx is a scratch register. I always trash it in valgrind on amd64. Affected files ... .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-main.c#14 edit Differences ... ==== //depot/projects/valgrind/coregrind/m_syswrap/syswrap-main.c#14 (text+ko) ==== @@ -313,7 +313,8 @@ //VG_(printf)( "eq_SyscallStatus: what %d %d res %ld %ld res2 %ld %ld err %ld %ld isError %d %d\n", s1->what, s2->what, s1->sres.res, s2->sres.res, s1->sres.res2, s2->sres.res2, s1->sres.err, s2->sres.err, s1->sres.isError, s2->sres.isError); return s1->what == s2->what && s1->sres.res == s2->sres.res -#if defined(VGO_freebsd) +#if defined(VGP_amd64_freebsd) + /* x86 should check this too, but syscall wrappers that call do_syscallN() don't preserve res2 */ && s1->sres.res2 == s2->sres.res2 #endif #if !defined(VGO_freebsd) /* getSyscallStatusFromMumble is out of sync */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811072321.mA7NLZ4c062661>