From patchwork Tue Oct 20 14:56:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Benson X-Patchwork-Id: 9256 Received: (qmail 63047 invoked by alias); 20 Oct 2015 15:03:39 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 62987 invoked by uid 89); 20 Oct 2015 15:03:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com From: Gary Benson To: libc-alpha@sourceware.org Subject: [RFC][PATCH 13/22] Add Infinity THREAD_SELF macros to sysdeps/s390/nptl/tls.h Date: Tue, 20 Oct 2015 15:56:06 +0100 Message-Id: <1445352975-17844-14-git-send-email-gbenson@redhat.com> In-Reply-To: <1445352975-17844-1-git-send-email-gbenson@redhat.com> References: <1445352975-17844-1-git-send-email-gbenson@redhat.com> This commit adds Infinity THREAD_SELF macros for s390. I was confused as to how the size for the 64-bit version of DB_THREAD_SELF used __WORDSIZE where the 32-bit version just has 32. I've used __s390x__ as a conditional and used __WORDSIZE in the presumably 64-bit version for Infinity but please advise if this should be changed. --- sysdeps/s390/nptl/tls.h | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/sysdeps/s390/nptl/tls.h b/sysdeps/s390/nptl/tls.h index e6f8a47..cf679ea 100644 --- a/sysdeps/s390/nptl/tls.h +++ b/sysdeps/s390/nptl/tls.h @@ -147,6 +147,16 @@ typedef struct # define DB_THREAD_SELF REGISTER (32, 32, 18 * 4, 0) \ REGISTER (64, __WORDSIZE, 18 * 8, 0) +/* Magic for Infinity to know how to do THREAD_SELF. */ +# define I8_THREAD_SELF I8_TS_REGISTER +# if defined __s390x__ +# define I8_TS_REG_SIZE __WORDSIZE +# define I8_TS_REG_OFFSET 18 * 8 +# else +# define I8_TS_REG_SIZE 32 +# define I8_TS_REG_OFFSET 18 * 4 +# define I8_TS_REG_BIAS 0 + /* Access to data in the thread descriptor is easy. */ #define THREAD_GETMEM(descr, member) \ descr->member