Patchwork [v4,1/2] libc/sysdeps: commonize ret_ERRVAL

login
register
mail settings
Submitter Baruch Siach
Date Nov. 7, 2013, 12:38 p.m.
Message ID <10c2c5c130aa3c1f3aef2161e0428058d9078abf.1383827721.git.baruch@tkos.co.il>
Download mbox | patch
Permalink /patch/289309/
State Accepted, archived
Headers show

Comments

Baruch Siach - Nov. 7, 2013, 12:38 p.m.
* Add a common ret_ERRVAL definition

* Remove ret_ERRVAL from architectures using the common 'ret'

* Add 'undef' to architectures that need a different return instruction

* Add '#include <common/sysdep.h>' to cris and ia64 that were missing it

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
v4: New patch in this version
---
 libc/sysdeps/linux/arm/sysdep.h               | 1 +
 libc/sysdeps/linux/common/sysdep.h            | 2 ++
 libc/sysdeps/linux/cris/sysdep.h              | 2 +-
 libc/sysdeps/linux/i386/sysdep.h              | 2 --
 libc/sysdeps/linux/ia64/sysdep.h              | 2 +-
 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 --
 libc/sysdeps/linux/xtensa/sysdep.h            | 1 +
 11 files changed, 8 insertions(+), 10 deletions(-)
aldot - Dec. 20, 2013, 2:48 p.m.
On Thu, Nov 07, 2013 at 02:38:17PM +0200, Baruch Siach wrote:
> * Add a common ret_ERRVAL definition
> 
> * Remove ret_ERRVAL from architectures using the common 'ret'
> 
> * Add 'undef' to architectures that need a different return instruction
> 
> * Add '#include <common/sysdep.h>' to cris and ia64 that were missing it

Applied these 2 patches, thanks!

Patch

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..d7fb314 100644
--- a/libc/sysdeps/linux/common/sysdep.h
+++ b/libc/sysdeps/linux/common/sysdep.h
@@ -48,6 +48,8 @@ 
 #define JUMPTARGET(sym)		sym
 #endif
 
+#define ret_ERRVAL ret
+
 /* 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/cris/sysdep.h b/libc/sysdeps/linux/cris/sysdep.h
index a034650..35c02c7 100644
--- a/libc/sysdeps/linux/cris/sysdep.h
+++ b/libc/sysdeps/linux/cris/sysdep.h
@@ -19,7 +19,7 @@ 
 #ifndef _SYSDEP_H_
 #define _SYSDEP_H_
 
-#include <sys/syscall.h>
+#include <common/sysdep.h>
 
 #ifndef C_LABEL
 
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..3e7e467 100644
--- a/libc/sysdeps/linux/ia64/sysdep.h
+++ b/libc/sysdeps/linux/ia64/sysdep.h
@@ -20,6 +20,7 @@ 
 #ifndef _LINUX_IA64_SYSDEP_H
 #define _LINUX_IA64_SYSDEP_H 1
 
+#include <common/sysdep.h>
 #include <features.h>
 #include <asm/unistd.h>
 
@@ -169,7 +170,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/libc/sysdeps/linux/xtensa/sysdep.h b/libc/sysdeps/linux/xtensa/sysdep.h
index 494d40d..afe95cc 100644
--- a/libc/sysdeps/linux/xtensa/sysdep.h
+++ b/libc/sysdeps/linux/xtensa/sysdep.h
@@ -123,6 +123,7 @@ 
 #define	PSEUDO_END_ERRVAL(name)						      \
   END (name)
 
+#undef ret_ERRVAL
 #define ret_ERRVAL retw
 
 #if defined RTLD_PRIVATE_ERRNO