From patchwork Thu Nov 7 07:03:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 289209 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id AFAC82C0040 for ; Thu, 7 Nov 2013 18:03:50 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7C99E316CE; Thu, 7 Nov 2013 07:03:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q5Le-oG2sEmy; Thu, 7 Nov 2013 07:03:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 3DDF3317EA; Thu, 7 Nov 2013 07:03:44 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 224E81C292B for ; Thu, 7 Nov 2013 07:03:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1D8D18B4EE for ; Thu, 7 Nov 2013 07:03:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eS8neh2uaSk2 for ; Thu, 7 Nov 2013 07:03:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sivan.tkos.co.il (guitar.tcltek.co.il [192.115.133.116]) by whitealder.osuosl.org (Postfix) with ESMTP id 4CBC38A965 for ; Thu, 7 Nov 2013 07:03:41 +0000 (UTC) Received: from tarshish.tkos.co.il (unknown [10.0.8.6]) by sivan.tkos.co.il (Postfix) with ESMTPA id 31291B4F90; Thu, 7 Nov 2013 09:03:40 +0200 (IST) From: Baruch Siach To: uclibc@uclibc.org Subject: [PATCH v2] librt: fix mq_timed{send,receive} return instructions Date: Thu, 7 Nov 2013 09:03:30 +0200 Message-Id: <0834f308731ac7effd22ea37b885f28b317945db.1383807606.git.baruch@tkos.co.il> X-Mailer: git-send-email 1.8.4.rc3 X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: uclibc-bounces@uclibc.org Sender: uclibc-bounces@uclibc.org Not all architectures use 'ret' as function return instruction. For example, xtensa usually uses 'retw'. Use the ret_ERRVAL arch dependant macro instead. Signed-off-by: Baruch Siach --- v2: Add ret_ERRVAL to architectures missing it as noted by Bernhard Reutner-Fischer. --- libc/sysdeps/linux/bfin/sysdep.h | 2 ++ libc/sysdeps/linux/cris/sysdep.h | 2 ++ libc/sysdeps/linux/metag/sysdep.h | 2 ++ libc/sysdeps/linux/sparc/sysdep.h | 2 ++ librt/mq_timedreceive.S | 2 +- librt/mq_timedsend.S | 2 +- 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libc/sysdeps/linux/bfin/sysdep.h b/libc/sysdeps/linux/bfin/sysdep.h index 352fbf4..0de2eba 100644 --- a/libc/sysdeps/linux/bfin/sysdep.h +++ b/libc/sysdeps/linux/bfin/sysdep.h @@ -16,6 +16,8 @@ #define ENTRY(sym) .global sym; .type sym, STT_FUNC; sym: #define ENDPROC(sym) .size sym, . - sym +#define ret_ERRVAL ret + #endif #endif diff --git a/libc/sysdeps/linux/cris/sysdep.h b/libc/sysdeps/linux/cris/sysdep.h index a034650..94b0fe8 100644 --- a/libc/sysdeps/linux/cris/sysdep.h +++ b/libc/sysdeps/linux/cris/sysdep.h @@ -49,6 +49,8 @@ #undef SYS_ify #define SYS_ify(syscall_name) __NR_##syscall_name +#define ret_ERRVAL ret + /* Syntactic details of assembly-code. */ /* It is *not* generally true that "ELF uses byte-counts for .align, most diff --git a/libc/sysdeps/linux/metag/sysdep.h b/libc/sysdeps/linux/metag/sysdep.h index a12f393..274d79c 100644 --- a/libc/sysdeps/linux/metag/sysdep.h +++ b/libc/sysdeps/linux/metag/sysdep.h @@ -22,6 +22,8 @@ SYSCALL_ERROR_HANDLER \ END (name) +#define ret_ERRVAL ret + #if defined NOT_IN_libc # define SYSCALL_ERROR __local_syscall_error # ifdef RTLD_PRIVATE_ERRNO diff --git a/libc/sysdeps/linux/sparc/sysdep.h b/libc/sysdeps/linux/sparc/sysdep.h index cf3e3af..7a6aa85 100644 --- a/libc/sysdeps/linux/sparc/sysdep.h +++ b/libc/sysdeps/linux/sparc/sysdep.h @@ -10,6 +10,8 @@ #define LOADSYSCALL(x) mov __NR_##x, %g1 +#define ret_ERRVAL ret + #define ENTRY(name) \ .align 4; \ .global C_SYMBOL_NAME(name); \ diff --git a/librt/mq_timedreceive.S b/librt/mq_timedreceive.S index 43a5fda..00fecac 100644 --- a/librt/mq_timedreceive.S +++ b/librt/mq_timedreceive.S @@ -3,6 +3,6 @@ #error Missing definition of NR_timedreceive needed for cancellation. #endif PSEUDO(mq_timedreceive, mq_timedreceive, 5) -ret +ret_ERRVAL PSEUDO_END(mq_timedreceive) librt_hidden_def(mq_timedreceive) diff --git a/librt/mq_timedsend.S b/librt/mq_timedsend.S index 13d91da..ee8d483 100644 --- a/librt/mq_timedsend.S +++ b/librt/mq_timedsend.S @@ -3,6 +3,6 @@ #error Missing definition of NR_timedsend needed for cancellation. #endif PSEUDO(mq_timedsend, mq_timedsend, 5) -ret +ret_ERRVAL PSEUDO_END(mq_timedsend) librt_hidden_def(mq_timedsend)