From patchwork Tue Oct 20 14:56:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Benson X-Patchwork-Id: 9255 Received: (qmail 59960 invoked by alias); 20 Oct 2015 15:03:10 -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 59872 invoked by uid 89); 20 Oct 2015 15:03:09 -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 18/22] New gen-as-const-header infinity-thread_self.h Date: Tue, 20 Oct 2015 15:56:11 +0100 Message-Id: <1445352975-17844-19-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 a new generated assembler constants header infinity-thread_self.h, and adds a rule to build it to sysdeps/generic/Makefile. sysdeps/$cpu/nptl/tls.h files are expected to define macros that mirror those defined for libthread_db. infinity-thread_self.sym contains various compile-time checks to ensure a consistent set of Infinity macros is defined. --- sysdeps/generic/Makefile | 2 + sysdeps/generic/infinity-thread_self.sym | 74 ++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 0 deletions(-) create mode 100644 sysdeps/generic/infinity-thread_self.sym diff --git a/sysdeps/generic/Makefile b/sysdeps/generic/Makefile index ed269f3..b5132d6 100644 --- a/sysdeps/generic/Makefile +++ b/sysdeps/generic/Makefile @@ -26,3 +26,5 @@ sysdep_routines += framestate unwind-pe shared-only-routines += framestate unwind-pe endif endif + +gen-as-const-headers += infinity-thread_self.sym diff --git a/sysdeps/generic/infinity-thread_self.sym b/sysdeps/generic/infinity-thread_self.sym new file mode 100644 index 0000000..de68048 --- /dev/null +++ b/sysdeps/generic/infinity-thread_self.sym @@ -0,0 +1,74 @@ +#include + +-- Each machine's tls.h should define I8_THREAD_SELF to one of these. +#define I8_TS_CONST_THREAD_AREA 1 +#define I8_TS_REGISTER 2 +#define I8_TS_REGISTER_THREAD_AREA 3 + +#ifndef I8_THREAD_SELF +# error "tls.h must #define I8_THREAD_SELF" +#endif + +-- If tls.h defined DB_THREAD_SELF_INCLUDE then we need to include it. +#ifdef DB_THREAD_SELF_INCLUDE +# include DB_THREAD_SELF_INCLUDE +#endif + +#if I8_THREAD_SELF == I8_TS_CONST_THREAD_AREA +# ifndef I8_TS_CTA_VALUE +# error "I8_TS_CONST_THREAD_AREA machines must #define I8_TS_CTA_VALUE" +# endif +#else +# define I8_TS_CTA_VALUE -1 +#endif + +#if I8_THREAD_SELF == I8_TS_REGISTER +# ifndef I8_TS_REG_SIZE +# error "I8_TS_REGISTER machines must #define I8_TS_REG_SIZE" +# endif +# ifndef I8_TS_REG_OFFSET +# error "I8_TS_REGISTER machines must #define I8_TS_REG_OFFSET" +# endif +# ifndef I8_TS_REG_BIAS +# error "I8_TS_REGISTER machines must #define I8_TS_REG_BIAS" +# endif +#else +# define I8_TS_REG_SIZE -1 +# define I8_TS_REG_OFFSET -1 +# define I8_TS_REG_BIAS -1 +#endif + +#if I8_THREAD_SELF == I8_TS_REGISTER_THREAD_AREA +# ifndef I8_TS_RTA_SIZE +# error "I8_TS_REGISTER_THREAD_AREA machines must #define I8_TS_RTA_SIZE" +# endif +# ifndef I8_TS_RTA_OFFSET +# error "I8_TS_REGISTER_THREAD_AREA machines must #define I8_TS_RTA_OFFSET" +# endif +# ifndef I8_TS_RTA_SCALE +# error "I8_TS_REGISTER_THREAD_AREA machines must #define I8_TS_RTA_SCALE" +# endif +#else +# define I8_TS_RTA_SIZE -1 +# define I8_TS_RTA_OFFSET -1 +# define I8_TS_RTA_SCALE -1 +#endif + + +-- Constants to export + +I8_THREAD_SELF + +I8_TS_CONST_THREAD_AREA +I8_TS_REGISTER +I8_TS_REGISTER_THREAD_AREA + +I8_TS_CTA_VALUE + +I8_TS_REG_SIZE +I8_TS_REG_OFFSET +I8_TS_REG_BIAS + +I8_TS_RTA_SIZE +I8_TS_RTA_OFFSET +I8_TS_RTA_SCALE