From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126948 invoked by alias); 13 Nov 2017 15:46:25 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 126904 invoked by uid 89); 13 Nov 2017 15:46:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,KAM_STOCKGEN,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: drew.franken.de Received: from mail-n.franken.de (HELO drew.franken.de) (193.175.24.27) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 13 Nov 2017 15:46:24 +0000 Received: from aqua.hirmke.de (aquarius.franken.de [193.175.24.89]) (Authenticated sender: aquarius) by mail-n.franken.de (Postfix) with ESMTPSA id 86E5472106C24 for ; Mon, 13 Nov 2017 16:46:18 +0100 (CET) Received: from calimero.vinschen.de (calimero.vinschen.de [192.168.129.6]) by aqua.hirmke.de (Postfix) with ESMTP id 6688D5E08A6 for ; Mon, 13 Nov 2017 16:46:16 +0100 (CET) Received: by calimero.vinschen.de (Postfix, from userid 500) id 6568EA806CB; Mon, 13 Nov 2017 16:46:16 +0100 (CET) From: Corinna Vinschen To: newlib@sourceware.org Subject: [PATCH 6/6] Cygwin: ___getreent: Expose assembler inline implementation into userspace Date: Mon, 13 Nov 2017 15:46:00 -0000 Message-Id: <20171113154616.25189-7-vinschen@redhat.com> In-Reply-To: <20171113154616.25189-1-vinschen@redhat.com> References: <20171113154616.25189-1-vinschen@redhat.com> X-IsSubscribed: yes X-SW-Source: 2017/txt/msg01108.txt.bz2 From: Corinna Vinschen Now that we fixed the offsets and now that local_clib is always at the start of the TLS area, we can use the stack offset of the TLS area as pointer to the local _reent. Signed-off-by: Corinna Vinschen --- winsup/cygwin/include/cygwin/config.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/winsup/cygwin/include/cygwin/config.h b/winsup/cygwin/include/cygwin/config.h index 282637b67130..55f2b2d8964d 100644 --- a/winsup/cygwin/include/cygwin/config.h +++ b/winsup/cygwin/include/cygwin/config.h @@ -34,15 +34,10 @@ extern "C" { Cygwin internal data structure) into newlib. The machinery to compute these offsets already exists for the sake of gendef so we might as well just use it here. */ +#include -#if defined (_COMPILING_NEWLIB) || defined (__INSIDE_CYGWIN__) -#ifdef __x86_64__ -#include "../tlsoffsets64.h" -#else -#include "../tlsoffsets.h" -#endif __attribute__((__gnu_inline__)) -extern inline struct _reent *__getreent (void) +extern inline struct _reent *___getreent (void) { register char *ret; #ifdef __x86_64__ @@ -50,9 +45,10 @@ extern inline struct _reent *__getreent (void) #else __asm __volatile__ ("movl %%fs:4,%0" : "=r" (ret)); #endif - return (struct _reent *) (ret + tls_local_clib); + return (struct _reent *) (ret - __CYGTLS_PADSIZE); } -#endif /* _COMPILING_NEWLIB || __INSIDE_CYGWIN__ */ +#undef __getreent +#define __getreent() (___getreent()) #ifdef __x86_64__ # define __SYMBOL_PREFIX -- 2.9.5