From patchwork Mon Aug 31 21:11:08 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: 8535 Received: (qmail 53025 invoked by alias); 31 Aug 2015 21:11:18 -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 52874 invoked by uid 89); 31 Aug 2015 21:11:16 -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-qk0-f177.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=3DDovIRc5sAQV0u3NDYif48imW/PEKlWyxEOmarYyIQ=; b=eQXaCZl7AQip1IZYqf6x6cYxSUjr3WonI14+SX5TTyn3TTjbZh9pb0iwTR9ebcWi8U FJGIhf7oWKNiV04RVQZ04XwO8gINFaTdR+EEI4UsX+v1y5iVzWiZn5uMmXBOwBvO7h1V E+Wf7GvSW9Has8hKdJ+ovTu6kGqK+onMXRqGOk92ECvv3n3FrkS55TqrdA8k2AAL3NfW MCTuskhkjPHr7K+QiH5j+DTXXrmdFsD/5SVlfQjCtqFnwLCQIdhGUn50EdUQ5SDuCFLh zQF41LWg0LIEpmHPh7OR21ivy4X5HGUmvm6VOEJ1Cc2qNhYCBajxOLblXtq7Wg4qrdTi TNbQ== X-Gm-Message-State: ALoCoQluAbe9LrxTapmNBK7lCeQFsbz93YG3p+t+KhOSuRgJRA0ikmiD/9egx3QCuE8apicUg3BM X-Received: by 10.129.86.5 with SMTP id k5mr23829545ywb.156.1441055470889; Mon, 31 Aug 2015 14:11:10 -0700 (PDT) From: Adhemerval Zanella Subject: [PATCH 04/08] nptl: x32: Fix Race conditions in pthread cancellation, (BZ#12683) To: GNU C Library Message-ID: <55E4C2EC.9070902@linaro.org> Date: Mon, 31 Aug 2015 18:11:08 -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