From owner-p4-projects@FreeBSD.ORG Tue Oct 28 00:09:00 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 08F4D106569C; Tue, 28 Oct 2008 00:09:00 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C07F81065681 for ; Tue, 28 Oct 2008 00:08:59 +0000 (UTC) (envelope-from peter-gmail@wemm.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id AE8008FC13 for ; Tue, 28 Oct 2008 00:08:59 +0000 (UTC) (envelope-from peter-gmail@wemm.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m9S08xO1094134 for ; Tue, 28 Oct 2008 00:08:59 GMT (envelope-from peter-gmail@wemm.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m9S08xch094132 for perforce@freebsd.org; Tue, 28 Oct 2008 00:08:59 GMT (envelope-from peter-gmail@wemm.org) Date: Tue, 28 Oct 2008 00:08:59 GMT Message-Id: <200810280008.m9S08xch094132@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter-gmail@wemm.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 152068 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Oct 2008 00:09:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=152068 Change 152068 by peter@peter_overcee on 2008/10/28 00:08:49 Convert pipe wrapper back to C, using res/res2 Affected files ... .. //depot/projects/valgrind/coregrind/m_libcfile.c#7 edit .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-amd64-freebsd.c#4 edit .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-x86-freebsd.c#9 edit Differences ... ==== //depot/projects/valgrind/coregrind/m_libcfile.c#7 (text+ko) ==== @@ -155,13 +155,20 @@ return ret; } -#if !defined(VGO_freebsd) Int VG_(pipe) ( Int fd[2] ) { - SysRes res = VG_(do_syscall1)(__NR_pipe, (UWord)fd); + SysRes res; +#if defined(VGO_freebsd) + res = VG_(do_syscall0)(__NR_pipe); + if (!res.isError) { + fd[0] = res.res; + fd[1] = res.res2; + } +#else + res = VG_(do_syscall1)(__NR_pipe, (UWord)fd); +#endif return res.isError ? -1 : 0; } -#endif OffT VG_(lseek) ( Int fd, OffT offset, Int whence ) { ==== //depot/projects/valgrind/coregrind/m_syswrap/syswrap-amd64-freebsd.c#4 (text+ko) ==== @@ -61,27 +61,6 @@ #include "priv_syswrap-freebsd.h" /* for decls of freebsd-ish wrappers */ #include "priv_syswrap-main.h" -/* Simulate C-style return values for pipe(2). This does not belong - here at all, it should be in m_libcfile.c. -*/ -// AAA: fix this wrapper. has to preserve C-style arg1 pointer. -asm( -".text\n" -".globl vgPlain_pipe\n" -"vgPlain_pipe:\n" -" mov $42,%eax\n" /* SYS_pipe */ -" syscall\n" -" jb 1f\n" -" movq 8(%rsp),%rcx\n" -" movq %rax,(%rcx)\n" -" movq %rdx,8(%rcx)\n" -" movl $0,%eax\n" -" ret\n" -"1: negl %eax\n" -" ret\n" -); - - /* --------------------------------------------------------------------- clone() handling ------------------------------------------------------------------ */ ==== //depot/projects/valgrind/coregrind/m_syswrap/syswrap-x86-freebsd.c#9 (text+ko) ==== @@ -60,26 +60,6 @@ #include "priv_syswrap-freebsd.h" /* for decls of linux-ish wrappers */ #include "priv_syswrap-main.h" -/* Simulate C-style return values for pipe(2). This does not belong - here at all, it should be in m_libcfile.c. -*/ -asm( -".text\n" -".globl vgPlain_pipe\n" -"vgPlain_pipe:\n" -" mov $42,%eax\n" /* SYS_pipe */ -" int $0x80\n" -" jb 1f\n" -" movl 4(%esp),%ecx\n" -" movl %eax,(%ecx)\n" -" movl %edx,4(%ecx)\n" -" movl $0,%eax\n" -" ret\n" -"1: negl %eax\n" -" ret\n" -); - - /* --------------------------------------------------------------------- clone() handling ------------------------------------------------------------------ */