|
From: <sv...@va...> - 2005-07-19 22:36:18
|
Author: tom
Date: 2005-07-19 23:35:58 +0100 (Tue, 19 Jul 2005)
New Revision: 4197
Log:
Support ARCH_GET_FS with arch_prctl on amd64.
Modified:
trunk/coregrind/m_syswrap/syswrap-amd64-linux.c
Modified: trunk/coregrind/m_syswrap/syswrap-amd64-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
--- trunk/coregrind/m_syswrap/syswrap-amd64-linux.c 2005-07-19 21:46:19 U=
TC (rev 4196)
+++ trunk/coregrind/m_syswrap/syswrap-amd64-linux.c 2005-07-19 22:35:58 U=
TC (rev 4197)
@@ -717,9 +717,19 @@
// PRE_MEM_READs/PRE_MEM_WRITEs as necessary...
=20
/* "do" the syscall ourselves; the kernel never sees it */
- vg_assert(ARG1 =3D=3D VKI_ARCH_SET_FS);
- tst =3D VG_(get_ThreadState)(tid);
- tst->arch.vex.guest_FS_ZERO =3D ARG2;
+ if (ARG1 =3D=3D VKI_ARCH_SET_FS) {
+ tst =3D VG_(get_ThreadState)(tid);
+ tst->arch.vex.guest_FS_ZERO =3D ARG2;
+ }
+ else if (ARG1 =3D=3D VKI_ARCH_GET_FS) {
+ PRE_MEM_WRITE("arch_prctl(addr)", ARG2, sizeof(unsigned long));
+ tst =3D VG_(get_ThreadState)(tid);
+ *(unsigned long *)ARG2 =3D tst->arch.vex.guest_FS_ZERO;
+ POST_MEM_WRITE(ARG2, sizeof(unsigned long));
+ }
+ else {
+ VG_(core_panic)("Unsupported arch_prtctl option");
+ }
=20
/* Note; the Status writeback to guest state that happens after
this wrapper returns does not change guest_FS_ZERO; hence that
|