Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Aug 2007 00:41:42 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 125473 for review
Message-ID:  <200708210041.l7L0fgcr015747@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=125473

Change 125473 by peter@peter_cheese on 2007/08/21 00:41:28

	Remove nargs and indir_sysno stuff.  We don't need it for
	reconstructing the args on the stack anymore and it removes one
	infrastructural difference to the linux version.

Affected files ...

.. //depot/projects/valgrind/coregrind/Makefile.am#3 edit
.. //depot/projects/valgrind/coregrind/m_syswrap/makeargsize.sh#2 delete
.. //depot/projects/valgrind/coregrind/m_syswrap/makeargsize6.sh#3 delete
.. //depot/projects/valgrind/coregrind/m_syswrap/priv_types_n_macros.h#3 edit
.. //depot/projects/valgrind/coregrind/m_syswrap/sysargcount.c#3 delete
.. //depot/projects/valgrind/coregrind/m_syswrap/syscall-x86-freebsd.S#3 edit
.. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-main.c#4 edit

Differences ...

==== //depot/projects/valgrind/coregrind/Makefile.am#3 (text+ko) ====

@@ -209,8 +209,7 @@
 	m_dispatch/dispatch-x86-freebsd.S \
 	m_sigframe/sigframe-x86-freebsd.c \
 	m_syswrap/syscall-x86-freebsd.S \
-	m_syswrap/syswrap-x86-freebsd.c \
-	m_syswrap/sysargcount.c
+	m_syswrap/syswrap-x86-freebsd.c
 
 libcoregrind_x86_freebsd_a_CPPFLAGS = $(AM_CPPFLAGS_X86_FREEBSD)
 libcoregrind_x86_freebsd_a_CFLAGS = $(AM_CFLAGS_X86_FREEBSD)

==== //depot/projects/valgrind/coregrind/m_syswrap/priv_types_n_macros.h#3 (text+ko) ====

@@ -60,8 +60,6 @@
 #ifdef VGO_freebsd
       UWord arg7;
       UWord arg8;
-      Word indir_sysno;	/* -1 if indirect syscall() or __syscall() */
-      UWord nargs;
 #endif
    }
    SyscallArgs;

==== //depot/projects/valgrind/coregrind/m_syswrap/syscall-x86-freebsd.S#3 (text+ko) ====

@@ -81,8 +81,6 @@
 #ifdef VGO_freebsd
       UWord arg7;		// 28
       UWord arg8;		// 32
-      Word indir_sysno; 	// 36 (-1 if indirect syscall() or __syscall())
-      UWord nargs;		// 40
 #endif
 				   
 */

==== //depot/projects/valgrind/coregrind/m_syswrap/syswrap-main.c#4 (text+ko) ====

@@ -318,11 +318,6 @@
    the platform-specific in-guest-state format to the canonical
    formats, and back. */
 
-#if defined(VGP_x86_freebsd)
-extern int sysargcount[];	/* HACK! HACK! */
-extern int numsysargcount;	/* HACK! HACK! */
-#endif
-
 static 
 void getSyscallArgsFromGuestState ( /*OUT*/SyscallArgs*       canonical,
                                     /*IN*/ VexGuestArchState* gst_vanilla )
@@ -374,25 +369,21 @@
    switch (gst->guest_EAX) {
    default:
       canonical->sysno = gst->guest_EAX;
-      canonical->indir_sysno = -1;
       break;
    case 198:
       canonical->sysno = argv[1];
-      canonical->indir_sysno = 198;
       argv += 2;
       break;
    case 0:
       canonical->sysno = argv[1];
-      canonical->indir_sysno = 0;
       argv += 1;
       break;
    }
-   if (canonical->sysno < numsysargcount)
-      canonical->nargs = sysargcount[canonical->sysno];
-   else
-      canonical->nargs = 0;
-   memset(&canonical->arg1, 0xfe, (char *)&canonical->indir_sysno - (char *)&canonical->arg1);
-   memcpy(&canonical->arg1, &argv[1], canonical->nargs * sizeof(UWord));
+   /*
+    * Blindly copy 8 arguments from the stack. Valgrind checks
+    * for initialized-ness elsewhere.
+    */
+   memcpy(&canonical->arg1, &argv[1], 8 * sizeof(UWord));
 
 #else
 #  error "getSyscallArgsFromGuestState: unknown arch"
@@ -445,7 +436,6 @@
 
 #elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd)
    /* Nothing.  Uses args passed out of band. */
-#endif
 
 #else
 #  error "putSyscallArgsIntoGuestState: unknown arch"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708210041.l7L0fgcr015747>