From patchwork Thu Sep 17 20:04:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 8750 Received: (qmail 106883 invoked by alias); 17 Sep 2015 20:04:25 -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 106816 invoked by uid 89); 17 Sep 2015 20:04:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f171.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-type:content-transfer-encoding; bh=aOXILA5P58ZmMD4y3abEf0+jt5XlR7prj3K8v8lYpGY=; b=QJ8IElsnKOHhON/qhDyymYMdOTrZzr5XgmOwscNs60KUwzt41fH3OtuDUxFStaSojU qSrZ3Gvv3QP27kcnOPmVvvn3ihqX1/3yAKEnd8qZdvg7EZIACBpZ53HgRJWEnNZMS7/y 7ojtIuLTc63bqVRsLB1PAd+fFuDBv+pkNzKVW5WkGwi9Tegv4+YBN/JihbudZbElE1rS iv5TNH7nYZaC4myE9O40RHzkK7/cAK+hdk43NdDHukkz4qKGYHcSX0x+Iv0SNJ0F1JFS vGsobtzn/PXlMJZwyntcTgNqxNLrXW7g/bt3+gUhk5I22G0bCkpI9AzphpMjPRq5Sr7z QuBw== X-Gm-Message-State: ALoCoQkvpOO99IGDH+U66rf6oOQKS1NdN6CvIl8w9V6q9/c1Om4bsVFSzVPrrY7DbDm3oPdsZbyQ X-Received: by 10.129.43.134 with SMTP id r128mr1195759ywr.9.1442520257366; Thu, 17 Sep 2015 13:04:17 -0700 (PDT) From: Adhemerval Zanella Subject: [PATCH 04/10] nptl: x32: Fix Race conditions in pthread cancellation (BZ#12683) To: GNU C Library Message-ID: <55FB1CC1.8060007@linaro.org> Date: Thu, 17 Sep 2015 17:04:17 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 This patches adds the x32 modification required for the BZ#12683 fix. It basically adjust the syscall size used to pass the arguments to the syscall cancel wrappers. --- * sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h (__syscall_arg_t): Define type for x32. (__SSC): Add platform specific macro. -- diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h index 2324168..f2dc8f0 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h +++ b/sysdeps/unix/sysv/linux/x86_64/x32/sysdep.h @@ -18,6 +18,27 @@ #ifndef _LINUX_X32_SYSDEP_H #define _LINUX_X32_SYSDEP_H 1 +#ifndef __ASSEMBLER__ +#include + +typedef long long int __syscall_arg_t; + +/* Syscall arguments for x32 follows x86_64 size, however pointers are 32 + bits in size. This suppress the GCC warning "cast from pointer to + integer of different size" when calling __syscall_cancel with + pointer as arguments. */ +# define __SSC(__x) \ + ({ \ + __syscall_arg_t __ret; \ + DIAG_PUSH_NEEDS_COMMENT; \ + DIAG_IGNORE_NEEDS_COMMENT (4.7, "-Wpointer-to-int-cast"); \ + __ret = (sizeof(1 ? (__x) : 0ULL) < 8 ? \ + (unsigned long int) (__x) : (long long int) (__x)); \ + DIAG_POP_NEEDS_COMMENT; \ + __ret; \ + }) +#endif + /* There is some commonality. */ #include #include