|
From: <sv...@va...> - 2005-06-28 19:05:05
|
Author: sewardj
Date: 2005-06-28 20:04:51 +0100 (Tue, 28 Jun 2005)
New Revision: 4042
Log:
Change scope from VG_ to ML_ various assembly symbols to do with doing
syscalls for the client.
Modified:
trunk/coregrind/m_syswrap/syscall-amd64-linux.S
trunk/coregrind/m_syswrap/syscall-ppc32-linux.S
trunk/coregrind/m_syswrap/syscall-x86-linux.S
trunk/coregrind/m_syswrap/syswrap-main.c
Modified: trunk/coregrind/m_syswrap/syscall-amd64-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
--- trunk/coregrind/m_syswrap/syscall-amd64-linux.S 2005-06-28 18:51:35 U=
TC (rev 4041)
+++ trunk/coregrind/m_syswrap/syscall-amd64-linux.S 2005-06-28 19:04:51 U=
TC (rev 4042)
@@ -55,12 +55,13 @@
sigprocmasks failed (there's no way to determine which one
failed).
=20
- VG_(interrupted_syscall)() does the thread state fixup in the
- case where we were interrupted by a signal.
+ VG_(fixup_guest_state_after_syscall_interrupted) does the
+ thread state fixup in the case where we were interrupted by a
+ signal.
=09
Prototype:
=20
- Int VG_(do_syscall_for_client_WRK(
+ Int ML_(do_syscall_for_client_WRK(
Int syscallno, // rdi
void* guest_state, // rsi
const vki_sigset_t *sysmask, // rdx
@@ -72,8 +73,8 @@
/* from vki_arch.h */=09
#define VKI_SIG_SETMASK 2
=09
-.globl VG_(do_syscall_for_client_WRK)
-VG_(do_syscall_for_client_WRK):
+.globl ML_(do_syscall_for_client_WRK)
+ML_(do_syscall_for_client_WRK):
/* save callee-saved regs */
pushq %rbx
pushq %rbp
@@ -170,19 +171,20 @@
ret
=20
.section .rodata
-/* export the ranges so that VG_(interrupted_syscall) can do the
- right thing */
+/* export the ranges so that
+ VG_(fixup_guest_state_after_syscall_interrupted) can do the
+ right thing */
=09
-.globl VG_(blksys_setup)
-.globl VG_(blksys_restart)
-.globl VG_(blksys_complete)
-.globl VG_(blksys_committed)
-.globl VG_(blksys_finished)
-VG_(blksys_setup): .quad 1b
-VG_(blksys_restart): .quad 2b
-VG_(blksys_complete): .quad 3b
-VG_(blksys_committed): .quad 4b
-VG_(blksys_finished): .quad 5b
+.globl ML_(blksys_setup)
+.globl ML_(blksys_restart)
+.globl ML_(blksys_complete)
+.globl ML_(blksys_committed)
+.globl ML_(blksys_finished)
+ML_(blksys_setup): .quad 1b
+ML_(blksys_restart): .quad 2b
+ML_(blksys_complete): .quad 3b
+ML_(blksys_committed): .quad 4b
+ML_(blksys_finished): .quad 5b
.previous
=20
/* Let the linker know we don't need an executable stack */
Modified: trunk/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
--- trunk/coregrind/m_syswrap/syscall-ppc32-linux.S 2005-06-28 18:51:35 U=
TC (rev 4041)
+++ trunk/coregrind/m_syswrap/syscall-ppc32-linux.S 2005-06-28 19:04:51 U=
TC (rev 4042)
@@ -54,12 +54,13 @@
sigprocmasks failed (there's no way to determine which one
failed).
=20
- VG_(interrupted_syscall)() does the thread state fixup in the
- case where we were interrupted by a signal.
+ VG_(fixup_guest_state_after_syscall_interrupted) does the
+ thread state fixup in the case where we were interrupted by a
+ signal.
=20
Prototype:
=20
- Int VG_(do_syscall_for_client_WRK)(
+ Int ML_(do_syscall_for_client_WRK)(
Int syscallno, // r3
void* guest_state, // r4
const vki_sigset_t *sysmask, // r5
@@ -69,8 +70,8 @@
/* from vki_arch.h */
#define VKI_SIG_SETMASK 2
=20
-.globl VG_(do_syscall_for_client_WRK)
-VG_(do_syscall_for_client_WRK):
+.globl ML_(do_syscall_for_client_WRK)
+ML_(do_syscall_for_client_WRK):
/* make a stack frame */
stwu 1,-32(1)
stw 31,28(1)
@@ -140,16 +141,16 @@
VG_(fixup_guest_state_after_syscall_interrupted) can do the
right thing */
=20
-.globl VG_(blksys_setup)
-.globl VG_(blksys_restart)
-.globl VG_(blksys_complete)
-.globl VG_(blksys_committed)
-.globl VG_(blksys_finished)
-VG_(blksys_setup): .long 1b
-VG_(blksys_restart): .long 2b
-VG_(blksys_complete): .long 3b
-VG_(blksys_committed): .long 4b
-VG_(blksys_finished): .long 5b
+.globl ML_(blksys_setup)
+.globl ML_(blksys_restart)
+.globl ML_(blksys_complete)
+.globl ML_(blksys_committed)
+.globl ML_(blksys_finished)
+ML_(blksys_setup): .long 1b
+ML_(blksys_restart): .long 2b
+ML_(blksys_complete): .long 3b
+ML_(blksys_committed): .long 4b
+ML_(blksys_finished): .long 5b
=20
.previous
=09
Modified: trunk/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
--- trunk/coregrind/m_syswrap/syscall-x86-linux.S 2005-06-28 18:51:35 UTC=
(rev 4041)
+++ trunk/coregrind/m_syswrap/syscall-x86-linux.S 2005-06-28 19:04:51 UTC=
(rev 4042)
@@ -55,12 +55,13 @@
sigprocmasks failed (there's no way to determine which one
failed).
=20
- VG_(interrupted_syscall)() does the thread state fixup in the
- case where we were interrupted by a signal.
+ VG_(fixup_guest_state_after_syscall_interrupted) does the
+ thread state fixup in the case where we were interrupted by a
+ signal.
=09
Prototype:
=20
- Int VG_(do_syscall_for_client_WRK)(
+ Int ML_(do_syscall_for_client_WRK)(
Int syscallno, // 0
void* guest_state, // 4
const vki_sigset_t *sysmask, // 8
@@ -72,8 +73,8 @@
/* from vki_arch.h */=09
#define VKI_SIG_SETMASK 2
=09
-.globl VG_(do_syscall_for_client_WRK)
-VG_(do_syscall_for_client_WRK):
+.globl ML_(do_syscall_for_client_WRK)
+ML_(do_syscall_for_client_WRK):
/* save callee-saved regs */
push %esi
push %edi
@@ -136,16 +137,16 @@
VG_(fixup_guest_state_after_syscall_interrupted) can do the
right thing */
=09
-.globl VG_(blksys_setup)
-.globl VG_(blksys_restart)
-.globl VG_(blksys_complete)
-.globl VG_(blksys_committed)
-.globl VG_(blksys_finished)
-VG_(blksys_setup): .long 1b
-VG_(blksys_restart): .long 2b
-VG_(blksys_complete): .long 3b
-VG_(blksys_committed): .long 4b
-VG_(blksys_finished): .long 5b
+.globl ML_(blksys_setup)
+.globl ML_(blksys_restart)
+.globl ML_(blksys_complete)
+.globl ML_(blksys_committed)
+.globl ML_(blksys_finished)
+ML_(blksys_setup): .long 1b
+ML_(blksys_restart): .long 2b
+ML_(blksys_complete): .long 3b
+ML_(blksys_committed): .long 4b
+ML_(blksys_finished): .long 5b
.previous
=09
/* Let the linker know we don't need an executable stack */
Modified: trunk/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
--- trunk/coregrind/m_syswrap/syswrap-main.c 2005-06-28 18:51:35 UTC (rev=
4041)
+++ trunk/coregrind/m_syswrap/syswrap-main.c 2005-06-28 19:04:51 UTC (rev=
4042)
@@ -185,12 +185,13 @@
VG_(fixup_guest_state_after_syscall_interrupted) to adjust the
thread's context to do the right thing.
=20
- The _WRK function is handwritten assembly. It has some very magic
+ The _WRK function is handwritten assembly, implemented per-platform
+ in coregrind/m_syswrap/syscall-$PLAT.S. It has some very magic
properties. See comments at the top of
VG_(fixup_guest_state_after_syscall_interrupted) below for details.
*/
extern
-void VG_(do_syscall_for_client_WRK)( Int syscallno,=20
+void ML_(do_syscall_for_client_WRK)( Int syscallno,=20
void* guest_state,
const vki_sigset_t *syscall_mask,
const vki_sigset_t *restore_mask,
@@ -202,7 +203,7 @@
const vki_sigset_t* syscall_mask )
{
vki_sigset_t saved;
- VG_(do_syscall_for_client_WRK)(
+ ML_(do_syscall_for_client_WRK)(
syscallno, &tst->arch.vex,=20
syscall_mask, &saved, _VKI_NSIG_WORDS * sizeof(UWord)
);
@@ -901,13 +902,14 @@
*/
=20
=20
-/* These are addresses within VG_(_do_syscall_for_client). See syscall.=
S for
- details. */
-extern const Addr VG_(blksys_setup);
-extern const Addr VG_(blksys_restart);
-extern const Addr VG_(blksys_complete);
-extern const Addr VG_(blksys_committed);
-extern const Addr VG_(blksys_finished);
+/* These are addresses within ML_(do_syscall_for_client_WRK). See
+ syscall-$PLAT.S for details.=20
+*/
+extern const Addr ML_(blksys_setup);
+extern const Addr ML_(blksys_restart);
+extern const Addr ML_(blksys_complete);
+extern const Addr ML_(blksys_committed);
+extern const Addr ML_(blksys_finished);
=20
=20
/* Back up guest state to restart a system call. */
@@ -1046,9 +1048,9 @@
/* Figure out what the state of the syscall was by examining the
(real) IP at the time of the signal, and act accordingly. */
=20
- if (ip < VG_(blksys_setup) || ip >=3D VG_(blksys_finished)) {
+ if (ip < ML_(blksys_setup) || ip >=3D ML_(blksys_finished)) {
VG_(printf)(" not in syscall (%p - %p)\n",=20
- VG_(blksys_setup), VG_(blksys_finished));
+ ML_(blksys_setup), ML_(blksys_finished));
/* Looks like we weren't in a syscall at all. Hmm. */
vg_assert(sci->status.what !=3D SsIdle);
return;
@@ -1059,7 +1061,7 @@
Hence: */
vg_assert(sci->status.what !=3D SsIdle);
=20
- if (ip >=3D VG_(blksys_setup) && ip < VG_(blksys_restart)) {
+ if (ip >=3D ML_(blksys_setup) && ip < ML_(blksys_restart)) {
/* syscall hasn't even started; go around again */
if (debug)
VG_(printf)(" not started: restart\n");
@@ -1068,7 +1070,7 @@
}=20
=20
else=20
- if (ip =3D=3D VG_(blksys_restart)) {
+ if (ip =3D=3D ML_(blksys_restart)) {
/* We're either about to run the syscall, or it was interrupted
and the kernel restarted it. Restart if asked, otherwise
EINTR it. */
@@ -1085,7 +1087,7 @@
}
=20
else=20
- if (ip >=3D VG_(blksys_complete) && ip < VG_(blksys_committed)) {
+ if (ip >=3D ML_(blksys_complete) && ip < ML_(blksys_committed)) {
/* Syscall complete, but result hasn't been written back yet.
Write the SysRes we were supplied with back to the guest
state. */
@@ -1098,7 +1100,7 @@
}=20
=20
else=20
- if (ip >=3D VG_(blksys_committed) && ip < VG_(blksys_finished)) {
+ if (ip >=3D ML_(blksys_committed) && ip < ML_(blksys_finished)) {
/* Result committed, but the signal mask has not been restored;
we expect our caller (the signal handler) will have fixed
this up. */
|