]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Change scope from VG_ to ML_ various assembly symbols to do with doing
authorJulian Seward <jseward@acm.org>
Tue, 28 Jun 2005 19:04:51 +0000 (19:04 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 28 Jun 2005 19:04:51 +0000 (19:04 +0000)
syscalls for the client.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4042

coregrind/m_syswrap/syscall-amd64-linux.S
coregrind/m_syswrap/syscall-ppc32-linux.S
coregrind/m_syswrap/syscall-x86-linux.S
coregrind/m_syswrap/syswrap-main.c

index 9030255af72abfa8b07f161dd5cd241e531f2e36..04dbfa592fbe7dcbcb932b5f06ca046bfb655d41 100644 (file)
        sigprocmasks failed (there's no way to determine which one
        failed).
 
-       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.
        
        Prototype:
 
-       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 */  
 #define VKI_SIG_SETMASK        2
        
-.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 @@ VG_(do_syscall_for_client_WRK):
        ret
 
 .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 */
        
-.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
 
 /* Let the linker know we don't need an executable stack */
index 57d698c93c0f3569c23fa2b4f831621b64f15cd6..e33ddc3477ad7b92aca87b75f8cf9632bce5b5e4 100644 (file)
         sigprocmasks failed (there's no way to determine which one
         failed).
 
-        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.
 
         Prototype:
 
-       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
 
-.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_(do_syscall_for_client_WRK):
    VG_(fixup_guest_state_after_syscall_interrupted) can do the
    right thing */
 
-.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
                
index 025a1131ac7079ebbffd992bb606a99d166447dd..150a528aeb33fd73fcd35a5cb12cd19dbfe814a6 100644 (file)
        sigprocmasks failed (there's no way to determine which one
        failed).
 
-       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.
        
        Prototype:
 
-       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 */  
 #define VKI_SIG_SETMASK        2
        
-.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_(do_syscall_for_client_WRK):
    VG_(fixup_guest_state_after_syscall_interrupted) can do the
    right thing */
        
-.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
        
 /* Let the linker know we don't need an executable stack */
index 3df4f72526d06b09b217345b9cf92a920493c33b..0760947dfcaa598a9d70d8388f9bb756a7bc2d5c 100644 (file)
    VG_(fixup_guest_state_after_syscall_interrupted) to adjust the
    thread's context to do the right thing.
 
-   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, 
+void ML_(do_syscall_for_client_WRK)( Int syscallno, 
                                      void* guest_state,
                                      const vki_sigset_t *syscall_mask,
                                      const vki_sigset_t *restore_mask,
@@ -202,7 +203,7 @@ void do_syscall_for_client ( Int syscallno,
                              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, 
       syscall_mask, &saved, _VKI_NSIG_WORDS * sizeof(UWord)
    );
@@ -901,13 +902,14 @@ void VG_(post_syscall) (ThreadId tid)
 */
 
 
-/* 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. 
+*/
+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);
 
 
 /* Back up guest state to restart a system call. */
@@ -1046,9 +1048,9 @@ VG_(fixup_guest_state_after_syscall_interrupted)( ThreadId tid,
    /* Figure out what the state of the syscall was by examining the
       (real) IP at the time of the signal, and act accordingly. */
 
-   if (ip < VG_(blksys_setup) || ip >= VG_(blksys_finished)) {
+   if (ip < ML_(blksys_setup) || ip >= ML_(blksys_finished)) {
       VG_(printf)("  not in syscall (%p - %p)\n", 
-                  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 != SsIdle);
       return;
@@ -1059,7 +1061,7 @@ VG_(fixup_guest_state_after_syscall_interrupted)( ThreadId tid,
       Hence: */
    vg_assert(sci->status.what != SsIdle);
 
-   if (ip >= VG_(blksys_setup) && ip < VG_(blksys_restart)) {
+   if (ip >= 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 @@ VG_(fixup_guest_state_after_syscall_interrupted)( ThreadId tid,
    } 
 
    else 
-   if (ip == VG_(blksys_restart)) {
+   if (ip == 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 @@ VG_(fixup_guest_state_after_syscall_interrupted)( ThreadId tid,
    }
 
    else 
-   if (ip >= VG_(blksys_complete) && ip < VG_(blksys_committed)) {
+   if (ip >= 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 @@ VG_(fixup_guest_state_after_syscall_interrupted)( ThreadId tid,
    } 
 
    else 
-   if (ip >= VG_(blksys_committed) && ip < VG_(blksys_finished)) {
+   if (ip >= 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. */