From owner-p4-projects@FreeBSD.ORG Wed Apr 18 11:14:47 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B375616A40A; Wed, 18 Apr 2007 11:14:47 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7251816A406 for ; Wed, 18 Apr 2007 11:14:47 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 642FD13C469 for ; Wed, 18 Apr 2007 11:14:47 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l3IBElKw013727 for ; Wed, 18 Apr 2007 11:14:47 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l3IBElPS013724 for perforce@freebsd.org; Wed, 18 Apr 2007 11:14:47 GMT (envelope-from gonzo@FreeBSD.org) Date: Wed, 18 Apr 2007 11:14:47 GMT Message-Id: <200704181114.l3IBElPS013724@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko To: Perforce Change Reviews Cc: Subject: PERFORCE change 118357 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: Wed, 18 Apr 2007 11:14:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=118357 Change 118357 by gonzo@gonzo_jeeves on 2007/04/18 11:14:28 o Leave only REENTRANT version and call __error instead of __errno. Affected files ... .. //depot/projects/mips2/src/lib/libc/mips/sys/cerror.S#3 edit .. //depot/projects/mips2/src/lib/libc/mips/sys/ptrace.S#2 edit Differences ... ==== //depot/projects/mips2/src/lib/libc/mips/sys/cerror.S#3 (text+ko) ==== @@ -39,8 +39,15 @@ ASMSTR("$NetBSD: cerror.S,v 1.13 2003/08/07 16:42:17 agc Exp $") #endif /* LIBC_SCCS and not lint */ -#ifdef _REENTRANT - .globl _C_LABEL(__errno) + + /* + * The __error() function is thread aware. For non-threaded + * programs and the initial threaded in threaded programs, + * it returns a pointer to the global errno variable. + */ + .globl _C_LABEL(__error) + .type _C_LABEL(__error),%function + LEAF(__cerror) .frame sp, CALLFRAME_SIZ, ra PIC_PROLOGUE(__cerror, t9) @@ -49,7 +56,7 @@ sw ra, CALLFRAME_RA(sp) sw v0, 12(sp) # save errno value - la t9, _C_LABEL(__errno) # locate address of errno + la t9, _C_LABEL(__error) # locate address of errno jalr t9 lw t0, 12(sp) @@ -60,16 +67,3 @@ li v1, -1 j ra END(__cerror) -#else - .globl _C_LABEL(errno) -LEAF(__cerror) - .set noreorder -#ifdef __ABICALLS__ - .cpload t9 -#endif - sw v0, _C_LABEL(errno) - li v0, -1 - j ra - li v1, -1 -END(__cerror) -#endif /* _REENTRANT */ ==== //depot/projects/mips2/src/lib/libc/mips/sys/ptrace.S#2 (text+ko) ==== @@ -45,7 +45,9 @@ .cpload t9 .set reorder #endif - sw zero, _C_LABEL(errno) + la t9, _C_LABEL(__error) # locate address of errno + jalr t9 + sw zero, 0(v0) li v0, SYS_ptrace syscall bne a3, zero, 1f