From patchwork Thu Nov 7 09:52:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 289245 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 BD21D2C0079 for ; Thu, 7 Nov 2013 20:52:36 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7E7F03039B; Thu, 7 Nov 2013 09:52:35 +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 c18aRvm9Yn8m; Thu, 7 Nov 2013 09:52:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 4A1052F923; Thu, 7 Nov 2013 09:52:29 +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 EDAD51BFA74 for ; Thu, 7 Nov 2013 09:52:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E76768BB15 for ; Thu, 7 Nov 2013 09:52:27 +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 ONJuOus8uUZs for ; Thu, 7 Nov 2013 09:52:25 +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 46BAE8B02F for ; Thu, 7 Nov 2013 09:52:25 +0000 (UTC) Received: from tarshish.tkos.co.il (unknown [10.0.8.6]) by sivan.tkos.co.il (Postfix) with ESMTPA id D62A6B4F90; Thu, 7 Nov 2013 11:52:24 +0200 (IST) From: Baruch Siach To: uclibc@uclibc.org Subject: [PATCH v3] librt: fix mq_timed{send,receive} return instructions Date: Thu, 7 Nov 2013 11:52:18 +0200 Message-Id: <415b8a900c65f0ca9a3441847635d85d79ef60bc.1383817616.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 --- v3: Add a common ret_ERRVAL, and redefine for special archs (Bernhard Reutner-Fischer) v2: Add ret_ERRVAL to architectures missing it as noted by Bernhard Reutner-Fischer. --- libc/sysdeps/linux/arm/sysdep.h | 1 + libc/sysdeps/linux/common/sysdep.h | 4 ++++ libc/sysdeps/linux/i386/sysdep.h | 2 -- libc/sysdeps/linux/ia64/sysdep.h | 1 - libc/sysdeps/linux/mips/sysdep.h | 2 -- libc/sysdeps/linux/powerpc/powerpc32/sysdep.h | 1 + libc/sysdeps/linux/powerpc/powerpc64/sysdep.h | 1 + libc/sysdeps/linux/sh/sysdep.h | 2 -- libc/sysdeps/linux/x86_64/sysdep.h | 2 -- librt/mq_timedreceive.S | 2 +- librt/mq_timedsend.S | 2 +- 11 files changed, 9 insertions(+), 11 deletions(-) diff --git a/libc/sysdeps/linux/arm/sysdep.h b/libc/sysdeps/linux/arm/sysdep.h index d4a86d3..5c751f5 100644 --- a/libc/sysdeps/linux/arm/sysdep.h +++ b/libc/sysdeps/linux/arm/sysdep.h @@ -156,6 +156,7 @@ #define PSEUDO_END_ERRVAL(name) \ END (name) +#undef ret_ERRVAL #define ret_ERRVAL PSEUDO_RET_NOERRNO #if defined NOT_IN_libc diff --git a/libc/sysdeps/linux/common/sysdep.h b/libc/sysdeps/linux/common/sysdep.h index 8e39b5b..9c9b69a 100644 --- a/libc/sysdeps/linux/common/sysdep.h +++ b/libc/sysdeps/linux/common/sysdep.h @@ -48,6 +48,10 @@ #define JUMPTARGET(sym) sym #endif +#ifndef ret_ERRVAL +#define ret_ERRVAL ret +#endif + /* Macros to generate eh_frame unwind information. */ # ifdef HAVE_ASM_CFI_DIRECTIVES # define cfi_sections(sect...) .cfi_sections sect diff --git a/libc/sysdeps/linux/i386/sysdep.h b/libc/sysdeps/linux/i386/sysdep.h index 7a8d2e2..40088ad 100644 --- a/libc/sysdeps/linux/i386/sysdep.h +++ b/libc/sysdeps/linux/i386/sysdep.h @@ -195,8 +195,6 @@ __x86.get_pc_thunk.reg: \ #define PSEUDO_END_ERRVAL(name) \ END (name) -#define ret_ERRVAL ret - #ifndef __PIC__ # define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */ #else diff --git a/libc/sysdeps/linux/ia64/sysdep.h b/libc/sysdeps/linux/ia64/sysdep.h index eacc22b..7cbd77e 100644 --- a/libc/sysdeps/linux/ia64/sysdep.h +++ b/libc/sysdeps/linux/ia64/sysdep.h @@ -169,7 +169,6 @@ #define ret br.ret.sptk.few b0 #define ret_NOERRNO ret -#define ret_ERRVAL ret #endif /* not __ASSEMBLER__ */ diff --git a/libc/sysdeps/linux/mips/sysdep.h b/libc/sysdeps/linux/mips/sysdep.h index 04e0da5..6dba1fb 100644 --- a/libc/sysdeps/linux/mips/sysdep.h +++ b/libc/sysdeps/linux/mips/sysdep.h @@ -77,8 +77,6 @@ #undef PSEUDO_END_ERRVAL #define PSEUDO_END_ERRVAL(sym) .end sym; .size sym,.-sym -#define ret_ERRVAL ret - #define r0 v0 #define r1 v1 /* The mips move insn is d,s. */ diff --git a/libc/sysdeps/linux/powerpc/powerpc32/sysdep.h b/libc/sysdeps/linux/powerpc/powerpc32/sysdep.h index 6d641dc..d9a4704 100644 --- a/libc/sysdeps/linux/powerpc/powerpc32/sysdep.h +++ b/libc/sysdeps/linux/powerpc/powerpc32/sysdep.h @@ -132,6 +132,7 @@ #define PSEUDO_RET_ERRVAL \ blr +#undef ret_ERRVAL #define ret_ERRVAL PSEUDO_RET_ERRVAL #undef PSEUDO_END_ERRVAL diff --git a/libc/sysdeps/linux/powerpc/powerpc64/sysdep.h b/libc/sysdeps/linux/powerpc/powerpc64/sysdep.h index 701fad8..902b63b 100644 --- a/libc/sysdeps/linux/powerpc/powerpc64/sysdep.h +++ b/libc/sysdeps/linux/powerpc/powerpc64/sysdep.h @@ -227,6 +227,7 @@ LT_LABELSUFFIX(name,_name_end): ; \ #define PSEUDO_RET_ERRVAL \ blr +#undef ret_ERRVAL #define ret_ERRVAL PSEUDO_RET_ERRVAL #undef PSEUDO_END_ERRVAL diff --git a/libc/sysdeps/linux/sh/sysdep.h b/libc/sysdeps/linux/sh/sysdep.h index c692617..69bcbe1 100644 --- a/libc/sysdeps/linux/sh/sysdep.h +++ b/libc/sysdeps/linux/sh/sysdep.h @@ -141,8 +141,6 @@ #define PSEUDO_END_ERRVAL(name) \ END (name) -#define ret_ERRVAL ret - #ifndef __PIC__ # define SYSCALL_ERROR_HANDLER \ mov.l 0f,r1; \ diff --git a/libc/sysdeps/linux/x86_64/sysdep.h b/libc/sysdeps/linux/x86_64/sysdep.h index fdf7de1..ed7e26e 100644 --- a/libc/sysdeps/linux/x86_64/sysdep.h +++ b/libc/sysdeps/linux/x86_64/sysdep.h @@ -182,8 +182,6 @@ lose: \ # define PSEUDO_END_ERRVAL(name) \ END (name) -# define ret_ERRVAL ret - # ifndef __PIC__ # define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */ # elif defined(RTLD_PRIVATE_ERRNO) 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)