This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.19-503-g1670e20


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  1670e207c57513da84462c2a018f01653e7d1cc6 (commit)
       via  11a28aee60fae347aa7db306965297c24443ff88 (commit)
       via  a17e5ffb80a17449add001ff7901e317afa6f632 (commit)
       via  b5be4597716eff94149f5529c8eb2cd3b4296188 (commit)
       via  645d44abe3ca6253a9d4762f092e4a1b9d294b11 (commit)
       via  a8b4f04ad7dff4f39797a7ab7f8babda54266026 (commit)
       via  af4e8ef9443e258ebeb0ddf3c5c9579f24dfacd5 (commit)
      from  26b0d2e1a1606da10c4dc4e109d7b9f2d92aab6a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1670e207c57513da84462c2a018f01653e7d1cc6

commit 1670e207c57513da84462c2a018f01653e7d1cc6
Author: Richard Henderson <rth@redhat.com>
Date:   Thu May 22 16:57:20 2014 -0400

    aarch64: Rely on syscalls preserving registers
    
    In several cases we've had asm routines rely on syscalls not clobbering
    call-clobbered registers, and that's now deemed ABI.  So take advantage
    of this in the INLINE_SYSCALL path as well.
    
    Shrinks libc.so by about 1k.

diff --git a/ChangeLog b/ChangeLog
index 8ea6ef9..8e06a7e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2014-05-29  Richard Henderson  <rth@twiddle.net>
 
+	* sysdeps/unix/sysv/linux/aarch64/sysdep.h (INTERNAL_VSYSCALL_NCS):
+	Remove comma before expanding ASM_ARGS_##nr.
+	(INTERNAL_SYSCALL_RAW): Make _sys_result signed, instead of casting.
+	Make _x0 a strict output; make _x8 a strict input; adjust expansion
+	of ASM_ARGS_##nr.
+	(CLOBBER_ARGS_0, CLOBBER_ARGS_1, CLOBBER_ARGS_2): Remove.
+	(CLOBBER_ARGS_3, CLOBBER_ARGS_4, CLOBBER_ARGS_5): Remove.
+	(CLOBBER_ARGS_6, CLOBBER_ARGS_7): Remove.
+	(ASM_ARGS_1): Add leading comma.
+
 	* sysdeps/unix/sysv/linux/aarch64/sysdep.h [NOT_IN_libc]
 	(SYSCALL_ERROR_HANDLER): Use tpidr_el0 instead of a call
 	to __errno_location.
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
index 8cce986..4686599 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
@@ -231,7 +231,7 @@
     LOAD_ARGS_##nr (args)					\
     asm volatile ("blr %1"					\
 		  : "=r" (_x0)					\
-		  : "r" (funcptr), ASM_ARGS_##nr		\
+		  : "r" (funcptr) ASM_ARGS_##nr			\
 		  : "x30", "memory");				\
     (long) _x0;							\
   })
@@ -254,17 +254,15 @@
 
 # undef INTERNAL_SYSCALL_RAW
 # define INTERNAL_SYSCALL_RAW(name, err, nr, args...)		\
-  ({ unsigned long _sys_result;					\
+  ({ long _sys_result;						\
      {								\
        LOAD_ARGS_##nr (args)					\
        register long _x8 asm ("x8") = (name);			\
        asm volatile ("svc	0	// syscall " # name     \
-		     : "+r" (_x0), "+r" (_x8)			\
-		     : ASM_ARGS_##nr				\
-		     : "memory", CLOBBER_ARGS_##nr);		\
+		     : "=r" (_x0) : "r"(_x8) ASM_ARGS_##nr : "memory");	\
        _sys_result = _x0;					\
      }								\
-     (long) _sys_result; })
+     _sys_result; })
 
 # undef INTERNAL_SYSCALL
 # define INTERNAL_SYSCALL(name, err, nr, args...)		\
@@ -281,54 +279,44 @@
 # undef INTERNAL_SYSCALL_ERRNO
 # define INTERNAL_SYSCALL_ERRNO(val, err)	(-(val))
 
-# define CLOBBER_ARGS_0       CLOBBER_ARGS_1
-# define CLOBBER_ARGS_1 "x1", CLOBBER_ARGS_2
-# define CLOBBER_ARGS_2 "x2", CLOBBER_ARGS_3
-# define CLOBBER_ARGS_3 "x3", CLOBBER_ARGS_4
-# define CLOBBER_ARGS_4 "x4", CLOBBER_ARGS_5
-# define CLOBBER_ARGS_5 "x5", CLOBBER_ARGS_6
-# define CLOBBER_ARGS_6 "x6", CLOBBER_ARGS_7
-# define CLOBBER_ARGS_7 \
-  "x7", "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", "x18"
-
 # define LOAD_ARGS_0()				\
   register long _x0 asm ("x0");
-
-# define ASM_ARGS_0
 # define LOAD_ARGS_1(x0)			\
   long _x0tmp = (long) (x0);			\
   LOAD_ARGS_0 ()				\
   _x0 = _x0tmp;
-# define ASM_ARGS_1	"r" (_x0)
 # define LOAD_ARGS_2(x0, x1)			\
   long _x1tmp = (long) (x1);			\
   LOAD_ARGS_1 (x0)				\
   register long _x1 asm ("x1") = _x1tmp;
-# define ASM_ARGS_2	ASM_ARGS_1, "r" (_x1)
 # define LOAD_ARGS_3(x0, x1, x2)		\
   long _x2tmp = (long) (x2);			\
   LOAD_ARGS_2 (x0, x1)				\
   register long _x2 asm ("x2") = _x2tmp;
-# define ASM_ARGS_3	ASM_ARGS_2, "r" (_x2)
 # define LOAD_ARGS_4(x0, x1, x2, x3)		\
   long _x3tmp = (long) (x3);			\
   LOAD_ARGS_3 (x0, x1, x2)			\
   register long _x3 asm ("x3") = _x3tmp;
-# define ASM_ARGS_4	ASM_ARGS_3, "r" (_x3)
 # define LOAD_ARGS_5(x0, x1, x2, x3, x4)	\
   long _x4tmp = (long) (x4);			\
   LOAD_ARGS_4 (x0, x1, x2, x3)			\
   register long _x4 asm ("x4") = _x4tmp;
-# define ASM_ARGS_5	ASM_ARGS_4, "r" (_x4)
 # define LOAD_ARGS_6(x0, x1, x2, x3, x4, x5)	\
   long _x5tmp = (long) (x5);			\
   LOAD_ARGS_5 (x0, x1, x2, x3, x4)		\
   register long _x5 asm ("x5") = _x5tmp;
-# define ASM_ARGS_6	ASM_ARGS_5, "r" (_x5)
 # define LOAD_ARGS_7(x0, x1, x2, x3, x4, x5, x6)\
   long _x6tmp = (long) (x6);			\
   LOAD_ARGS_6 (x0, x1, x2, x3, x4, x5)		\
   register long _x6 asm ("x6") = _x6tmp;
+
+# define ASM_ARGS_0
+# define ASM_ARGS_1	, "r" (_x0)
+# define ASM_ARGS_2	ASM_ARGS_1, "r" (_x1)
+# define ASM_ARGS_3	ASM_ARGS_2, "r" (_x2)
+# define ASM_ARGS_4	ASM_ARGS_3, "r" (_x3)
+# define ASM_ARGS_5	ASM_ARGS_4, "r" (_x4)
+# define ASM_ARGS_6	ASM_ARGS_5, "r" (_x5)
 # define ASM_ARGS_7	ASM_ARGS_6, "r" (_x6)
 
 # undef INTERNAL_SYSCALL_NCS

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=11a28aee60fae347aa7db306965297c24443ff88

commit 11a28aee60fae347aa7db306965297c24443ff88
Author: Richard Henderson <rth@redhat.com>
Date:   Tue May 20 16:34:59 2014 -0400

    aarch64: Use tpidr_el0 rather than __errno_location in librt

diff --git a/ChangeLog b/ChangeLog
index 5b9b820..8ea6ef9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,13 @@
 2014-05-29  Richard Henderson  <rth@twiddle.net>
 
+	* sysdeps/unix/sysv/linux/aarch64/sysdep.h [NOT_IN_libc]
+	(SYSCALL_ERROR_HANDLER): Use tpidr_el0 instead of a call
+	to __errno_location.
+	* sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data (libpthread.so):
+	Remove the expected plt for __errno_location.
+
 	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
-	[!NOT_IN_libc] (SINGLE_THREAD_P): Use tpidr_el0 instead of a
+	[NOT_IN_libc] (SINGLE_THREAD_P): Use tpidr_el0 instead of a
 	call to __read_tp.
 
 	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO):
diff --git a/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data b/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data
index 84af95d..dfca9a7 100644
--- a/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data
+++ b/sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data
@@ -12,4 +12,3 @@ libm.so: matherr
 libm.so: __signbit
 libm.so: __signbitf
 libm.so: __signbitl
-libpthread.so: __errno_location
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
index 0e91f83..8cce986 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
@@ -123,21 +123,12 @@
 
 #   define SYSCALL_ERROR_HANDLER				\
 .Lsyscall_error:						\
-	stp     x29, x30, [sp, -32]!;				\
-	cfi_adjust_cfa_offset (32);				\
-	cfi_rel_offset (x29, 0);				\
-	cfi_rel_offset (x30, 8);				\
-        add     x29, sp, 0;					\
-        str     x19, [sp,16];					\
-	neg	x19, x0;					\
-	bl	C_SYMBOL_NAME(__errno_location);		\
-	str	w19, [x0];					\
+	adrp	x1, :gottprel:errno;				\
+	neg	w2, w0;						\
+	ldr	x1, [x1, :gottprel_lo12:errno];			\
+	mrs	x3, tpidr_el0;					\
 	mov	x0, -1;						\
-        ldr     x19, [sp,16];					\
-        ldp     x29, x30, [sp], 32;				\
-	cfi_adjust_cfa_offset (-32);				\
-	cfi_restore (x29);					\
-	cfi_restore (x30);					\
+	str	w2, [x1, x3];					\
 	RET;
 #  endif
 # else

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a17e5ffb80a17449add001ff7901e317afa6f632

commit a17e5ffb80a17449add001ff7901e317afa6f632
Author: Richard Henderson <rth@redhat.com>
Date:   Tue May 20 16:17:20 2014 -0400

    aarch64: Use tpidr_el0 rather than __read_tp in librt

diff --git a/ChangeLog b/ChangeLog
index 26812de..5b9b820 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2014-05-29  Richard Henderson  <rth@twiddle.net>
 
+	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
+	[!NOT_IN_libc] (SINGLE_THREAD_P): Use tpidr_el0 instead of a
+	call to __read_tp.
+
 	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO):
 	Always allocate 64 bytes of stack frame.  Use ldp/stp to create
 	it and break it down.
diff --git a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
index 0f5bb51..546ed7b 100644
--- a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
@@ -113,17 +113,9 @@ extern int __local_multiple_threads attribute_hidden;
 				   header.multiple_threads) == 0, 1)
 #  else
 #   define SINGLE_THREAD_P(R)						\
-	stp	x0, x30, [sp, -16]!;					\
-	cfi_adjust_cfa_offset (16);					\
-	cfi_rel_offset (x0, 0);						\
-	cfi_rel_offset (x30, 8);					\
-	bl	__read_tp;						\
-	sub	x0, x0, PTHREAD_SIZEOF;					\
-	ldr	w##R, [x0, PTHREAD_MULTIPLE_THREADS_OFFSET];		\
-	ldp	x0, x30, [sp], 16;					\
-	cfi_restore (x0);						\
-	cfi_restore (x30);						\
-	cfi_adjust_cfa_offset (-16)
+	mrs     x##R, tpidr_el0;					\
+	sub	x##R, x##R, PTHREAD_SIZEOF;				\
+	ldr	w##R, [x##R, PTHREAD_MULTIPLE_THREADS_OFFSET]
 #  endif
 # endif
 

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b5be4597716eff94149f5529c8eb2cd3b4296188

commit b5be4597716eff94149f5529c8eb2cd3b4296188
Author: Richard Henderson <rth@redhat.com>
Date:   Sun May 25 14:57:53 2014 -0400

    aarch64: Improve syscall-cancel stack frame
    
    One push instead of N; use stp/ldp to halve the insns.

diff --git a/ChangeLog b/ChangeLog
index 3a20a65..26812de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2014-05-29  Richard Henderson  <rth@twiddle.net>
 
+	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO):
+	Always allocate 64 bytes of stack frame.  Use ldp/stp to create
+	it and break it down.
+	(DOCARGS_0, DOCARGS_1): Do nothing.
+	(DOCARGS_2): Update to store into the new stack frame.
+	(DOCARGS_3, DOCARGS_4, DOCARGS_5, DOCARGS_6): Likewise.
+	(UNDOCARGS_1): Update to restore from the new stack frame.
+	(UNDOCARGS_2, UNDOCARGS_3, UNDOCARGS_4): Likewise.
+	(UNDOCARGS_5, UNDOCARGS_6): Likewise.
+
 	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
 	(SINGLE_THREAD_P): New parameter for result regno.
 	(PSEUDO): Update to match; use cbz instead of beq.
diff --git a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
index bdb5c73..0f5bb51 100644
--- a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
@@ -38,20 +38,22 @@ ENTRY (__##syscall_name##_nocancel);					\
 ENTRY (name);								\
 	SINGLE_THREAD_P(16);						\
 	cbz	w16, .Lpseudo_nocancel;					\
-	DOCARGS_##args;	/* save syscall args etc. around CENABLE.  */	\
+	/* Setup common stack frame no matter the number of args.	\
+	   Also save the first arg, since it's basically free.  */	\
+	stp	x30, x0, [sp, -64]!;					\
+	cfi_adjust_cfa_offset (64);					\
+	cfi_rel_offset (x30, 0);					\
+	DOCARGS_##args;		/* save syscall args around CENABLE.  */ \
 	CENABLE;							\
-	mov	x16, x0;	/* put mask in safe place.  */		\
+	mov	x16, x0;	/* save mask around syscall.  */	\
 	UNDOCARGS_##args;	/* restore syscall args.  */		\
-	mov	x8, SYS_ify (syscall_name);	/* do the call.  */	\
-	svc	0;							\
-	str	x0, [sp, -16]!;	/* save syscall return value.  */	\
-	cfi_adjust_cfa_offset (16);					\
-	mov	x0, x16;	 /* get mask back.  */			\
+	DO_CALL (syscall_name, args);					\
+	str	x0, [sp, 8];	/* save result around CDISABLE.  */	\
+	mov	x0, x16;	/* restore mask for CDISABLE.  */	\
 	CDISABLE;							\
-	ldr	x0, [sp], 16;						\
-	cfi_adjust_cfa_offset (-16);					\
-	ldr	x30, [sp], 16;						\
-	cfi_adjust_cfa_offset (-16);					\
+	/* Break down the stack frame, restoring result at once.  */	\
+	ldp	x30, x0, [sp], 64;					\
+	cfi_adjust_cfa_offset (-64);					\
 	cfi_restore (x30);						\
 	b	.Lpseudo_finish;					\
 	cfi_endproc;							\
@@ -63,83 +65,21 @@ ENTRY (name);								\
 	SYSCALL_ERROR_HANDLER;						\
 	cfi_endproc
 
-# define DOCARGS_0							\
-	str x30, [sp, -16]!;						\
-	cfi_adjust_cfa_offset (16);					\
-	cfi_rel_offset (x30, 0)
+# define DOCARGS_0
+# define DOCARGS_1
+# define DOCARGS_2	str x1, [sp, 16]
+# define DOCARGS_3	stp x1, x2, [sp, 16]
+# define DOCARGS_4	DOCARGS_3; str x3, [sp, 32]
+# define DOCARGS_5	DOCARGS_3; stp x3, x4, [sp, 32]
+# define DOCARGS_6	DOCARGS_5; str x5, [sp, 48]
 
 # define UNDOCARGS_0
-
-# define DOCARGS_1							\
-	DOCARGS_0;							\
-	str x0, [sp, -16]!;						\
-	cfi_adjust_cfa_offset (16);					\
-	cfi_rel_offset (x0, 0)
-
-# define UNDOCARGS_1							\
-	ldr x0, [sp], 16;						\
-	cfi_restore (x0);						\
-	cfi_adjust_cfa_offset (-16);					\
-
-# define DOCARGS_2							\
-	DOCARGS_1;							\
-	str x1, [sp, -16]!;						\
-	cfi_adjust_cfa_offset (16);					\
-	cfi_rel_offset (x1, 0)
-
-# define UNDOCARGS_2							\
-	ldr x1, [sp], 16;						\
-	cfi_restore (x1);						\
-	cfi_adjust_cfa_offset (-16);					\
-	UNDOCARGS_1
-
-# define DOCARGS_3							\
-	DOCARGS_2;							\
-	str x2, [sp, -16]!;						\
-	cfi_adjust_cfa_offset (16);					\
-	cfi_rel_offset (x2, 0)
-
-# define UNDOCARGS_3							\
-	ldr x2, [sp], 16;						\
-	cfi_restore (x2);						\
-	cfi_adjust_cfa_offset (-16);					\
-	UNDOCARGS_2
-
-# define DOCARGS_4							\
-	DOCARGS_3;							\
-	str x3, [sp, -16]!;						\
-	cfi_adjust_cfa_offset (16);					\
-	cfi_rel_offset (x3, 0)
-
-# define UNDOCARGS_4							\
-	ldr x3, [sp], 16;						\
-	cfi_restore (x3);						\
-	cfi_adjust_cfa_offset (-16);					\
-	UNDOCARGS_3
-
-# define DOCARGS_5							\
-	DOCARGS_4;							\
-	str x4, [sp, -16]!;						\
-	cfi_adjust_cfa_offset (16);					\
-	cfi_rel_offset (x4, 0)
-
-# define UNDOCARGS_5							\
-	ldr x4, [sp], 16;						\
-	cfi_restore (x4);						\
-	cfi_adjust_cfa_offset (-16);					\
-	UNDOCARGS_4
-
-# define DOCARGS_6							\
-	DOCARGS_5;							\
-	str x5, [sp, -16]!;						\
-	cfi_adjust_cfa_offset (16);					\
-	cfi_rel_offset (x5, 0)
-
-# define UNDOCARGS_6							\
-	ldr x5, [sp], 16;						\
-	cfi_restore (x5);						\
-	cfi_adjust_cfa_offset (-16);					\
-	UNDOCARGS_5
+# define UNDOCARGS_1	ldr x0, [sp, 8]
+# define UNDOCARGS_2	ldp x0, x1, [sp, 8]
+# define UNDOCARGS_3	UNDOCARGS_1; ldp x1, x2, [sp, 16]
+# define UNDOCARGS_4	UNDOCARGS_2; ldp x2, x3, [sp, 24]
+# define UNDOCARGS_5	UNDOCARGS_3; ldp x3, x4, [sp, 32]
+# define UNDOCARGS_6	UNDOCARGS_4; ldp x4, x5, [sp, 40]
 
 # ifdef IS_IN_libpthread
 #  define CENABLE	bl __pthread_enable_asynccancel

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=645d44abe3ca6253a9d4762f092e4a1b9d294b11

commit 645d44abe3ca6253a9d4762f092e4a1b9d294b11
Author: Richard Henderson <rth@redhat.com>
Date:   Sun May 25 14:15:14 2014 -0400

    aarch64: Pass regno parameter to SINGLE_THREAD_P
    
    Use cbz instead of cmp+b.eq.

diff --git a/ChangeLog b/ChangeLog
index 9f741a4..3a20a65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2014-05-29  Richard Henderson  <rth@twiddle.net>
 
+	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
+	(SINGLE_THREAD_P): New parameter for result regno.
+	(PSEUDO): Update to match; use cbz instead of beq.
+
 	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO):
 	Use ENTRY to define the _nocancel entry point.  Share the syscall
 	and syscall error check paths with the cancel path.
diff --git a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
index 41502de..bdb5c73 100644
--- a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
@@ -36,8 +36,8 @@ ENTRY (__##syscall_name##_nocancel);					\
 	.subsection 2;							\
 	.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
 ENTRY (name);								\
-	SINGLE_THREAD_P;						\
-	beq .Lpseudo_nocancel;						\
+	SINGLE_THREAD_P(16);						\
+	cbz	w16, .Lpseudo_nocancel;					\
 	DOCARGS_##args;	/* save syscall args etc. around CENABLE.  */	\
 	CENABLE;							\
 	mov	x16, x0;	/* put mask in safe place.  */		\
@@ -161,10 +161,9 @@ ENTRY (name);								\
 extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 #  else
-#   define SINGLE_THREAD_P						\
-	adrp	x16, __local_multiple_threads;				\
-	ldr	w16, [x16, :lo12:__local_multiple_threads];		\
-	cmp	w16, 0;
+#   define SINGLE_THREAD_P(R)						\
+	adrp	x##R, __local_multiple_threads;				\
+	ldr	w##R, [x##R, :lo12:__local_multiple_threads]
 #  endif
 # else
 /*  There is no __local_multiple_threads for librt, so use the TCB.  */
@@ -173,19 +172,18 @@ extern int __local_multiple_threads attribute_hidden;
   __builtin_expect (THREAD_GETMEM (THREAD_SELF,				\
 				   header.multiple_threads) == 0, 1)
 #  else
-#   define SINGLE_THREAD_P						\
+#   define SINGLE_THREAD_P(R)						\
 	stp	x0, x30, [sp, -16]!;					\
 	cfi_adjust_cfa_offset (16);					\
 	cfi_rel_offset (x0, 0);						\
 	cfi_rel_offset (x30, 8);					\
 	bl	__read_tp;						\
 	sub	x0, x0, PTHREAD_SIZEOF;					\
-	ldr	w16, [x0, PTHREAD_MULTIPLE_THREADS_OFFSET];		\
+	ldr	w##R, [x0, PTHREAD_MULTIPLE_THREADS_OFFSET];		\
 	ldp	x0, x30, [sp], 16;					\
 	cfi_restore (x0);						\
 	cfi_restore (x30);						\
-	cfi_adjust_cfa_offset (-16);					\
-	cmp	w16, 0;
+	cfi_adjust_cfa_offset (-16)
 #  endif
 # endif
 

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a8b4f04ad7dff4f39797a7ab7f8babda54266026

commit a8b4f04ad7dff4f39797a7ab7f8babda54266026
Author: Richard Henderson <rth@redhat.com>
Date:   Sun May 25 14:07:17 2014 -0400

    aarch64: Share code in syscall-cancel.h
    
    Fold nocancel and error handling paths.

diff --git a/ChangeLog b/ChangeLog
index 9bc50c3..9f741a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2014-05-29  Richard Henderson  <rth@twiddle.net>
 
+	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h (PSEUDO):
+	Use ENTRY to define the _nocancel entry point.  Share the syscall
+	and syscall error check paths with the cancel path.
+	(PSEUDO_END): New.
+
 	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h: Adjust
 	whitespace; tabs before and after asm mnemonics.
 
diff --git a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
index 26d4c0e..41502de 100644
--- a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
@@ -27,24 +27,17 @@
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				\
 	.section ".text";						\
-	.type	__##syscall_name##_nocancel,%function;			\
-	.globl	__##syscall_name##_nocancel;				\
-__##syscall_name##_nocancel:						\
-	cfi_startproc;							\
+ENTRY (__##syscall_name##_nocancel);					\
+.Lpseudo_nocancel:							\
 	DO_CALL (syscall_name, args);					\
+.Lpseudo_finish:							\
 	cmn	x0, 4095;						\
 	b.cs	.Lsyscall_error;					\
-	PSEUDO_RET;							\
-	cfi_endproc;							\
+	.subsection 2;							\
 	.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
 ENTRY (name);								\
 	SINGLE_THREAD_P;						\
-	bne .Lpseudo_cancel;						\
-	DO_CALL (syscall_name, 0);					\
-	cmn x0, 4095;							\
-	b.cs .Lsyscall_error;						\
-	PSEUDO_RET;							\
-.Lpseudo_cancel:							\
+	beq .Lpseudo_nocancel;						\
 	DOCARGS_##args;	/* save syscall args etc. around CENABLE.  */	\
 	CENABLE;							\
 	mov	x16, x0;	/* put mask in safe place.  */		\
@@ -60,8 +53,15 @@ ENTRY (name);								\
 	ldr	x30, [sp], 16;						\
 	cfi_adjust_cfa_offset (-16);					\
 	cfi_restore (x30);						\
-	cmn	x0, 4095;						\
-	b.cs	.Lsyscall_error;
+	b	.Lpseudo_finish;					\
+	cfi_endproc;							\
+	.size	name, .-name;						\
+	.previous
+
+# undef PSEUDO_END
+# define PSEUDO_END(name)						\
+	SYSCALL_ERROR_HANDLER;						\
+	cfi_endproc
 
 # define DOCARGS_0							\
 	str x30, [sp, -16]!;						\

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=af4e8ef9443e258ebeb0ddf3c5c9579f24dfacd5

commit af4e8ef9443e258ebeb0ddf3c5c9579f24dfacd5
Author: Richard Henderson <rth@redhat.com>
Date:   Sun May 25 13:00:00 2014 -0400

    aarch64: Tabify sysdep-cancel.h

diff --git a/ChangeLog b/ChangeLog
index a93d367..9bc50c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-05-29  Richard Henderson  <rth@twiddle.net>
+
+	* sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h: Adjust
+	whitespace; tabs before and after asm mnemonics.
+
 2014-05-29  Eric Wong  <normalperson@yhbt.net>
 
 	[BZ #15132]
diff --git a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
index c300b2d..26d4c0e 100644
--- a/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/aarch64/nptl/sysdep-cancel.h
@@ -26,42 +26,42 @@
 
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)				\
-  .section ".text";							\
-  .type __##syscall_name##_nocancel,%function;				\
-  .globl __##syscall_name##_nocancel;					\
-  __##syscall_name##_nocancel:						\
-    cfi_startproc;							\
-    DO_CALL (syscall_name, args);					\
-    cmn x0, 4095;							\
-    b.cs .Lsyscall_error;						\
-    PSEUDO_RET;								\
-    cfi_endproc;							\
-    .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel;	\
-  ENTRY (name);								\
-    SINGLE_THREAD_P;							\
-    bne .Lpseudo_cancel;						\
-    DO_CALL (syscall_name, 0);						\
-    cmn x0, 4095;							\
-    b.cs .Lsyscall_error;						\
-    PSEUDO_RET;								\
-  .Lpseudo_cancel:							\
-    DOCARGS_##args;	/* save syscall args etc. around CENABLE.  */	\
-    CENABLE;								\
-    mov x16, x0;	/* put mask in safe place.  */			\
-    UNDOCARGS_##args;	/* restore syscall args.  */			\
-    mov x8, SYS_ify (syscall_name);	/* do the call.  */		\
-    svc	0;								\
-    str x0, [sp, -16]!;	/* save syscall return value.  */		\
-    cfi_adjust_cfa_offset (16);						\
-    mov x0, x16;	 /* get mask back.  */				\
-    CDISABLE;								\
-    ldr x0, [sp], 16;							\
-    cfi_adjust_cfa_offset (-16);					\
-    ldr x30, [sp], 16;							\
-    cfi_adjust_cfa_offset (-16);					\
-    cfi_restore (x30);							\
-    cmn x0, 4095;							\
-    b.cs .Lsyscall_error;
+	.section ".text";						\
+	.type	__##syscall_name##_nocancel,%function;			\
+	.globl	__##syscall_name##_nocancel;				\
+__##syscall_name##_nocancel:						\
+	cfi_startproc;							\
+	DO_CALL (syscall_name, args);					\
+	cmn	x0, 4095;						\
+	b.cs	.Lsyscall_error;					\
+	PSEUDO_RET;							\
+	cfi_endproc;							\
+	.size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
+ENTRY (name);								\
+	SINGLE_THREAD_P;						\
+	bne .Lpseudo_cancel;						\
+	DO_CALL (syscall_name, 0);					\
+	cmn x0, 4095;							\
+	b.cs .Lsyscall_error;						\
+	PSEUDO_RET;							\
+.Lpseudo_cancel:							\
+	DOCARGS_##args;	/* save syscall args etc. around CENABLE.  */	\
+	CENABLE;							\
+	mov	x16, x0;	/* put mask in safe place.  */		\
+	UNDOCARGS_##args;	/* restore syscall args.  */		\
+	mov	x8, SYS_ify (syscall_name);	/* do the call.  */	\
+	svc	0;							\
+	str	x0, [sp, -16]!;	/* save syscall return value.  */	\
+	cfi_adjust_cfa_offset (16);					\
+	mov	x0, x16;	 /* get mask back.  */			\
+	CDISABLE;							\
+	ldr	x0, [sp], 16;						\
+	cfi_adjust_cfa_offset (-16);					\
+	ldr	x30, [sp], 16;						\
+	cfi_adjust_cfa_offset (-16);					\
+	cfi_restore (x30);						\
+	cmn	x0, 4095;						\
+	b.cs	.Lsyscall_error;
 
 # define DOCARGS_0							\
 	str x30, [sp, -16]!;						\
@@ -162,9 +162,9 @@ extern int __local_multiple_threads attribute_hidden;
 #   define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
 #  else
 #   define SINGLE_THREAD_P						\
-  adrp	x16, __local_multiple_threads;					\
-  ldr	w16, [x16, :lo12:__local_multiple_threads];			\
-  cmp	w16, 0;
+	adrp	x16, __local_multiple_threads;				\
+	ldr	w16, [x16, :lo12:__local_multiple_threads];		\
+	cmp	w16, 0;
 #  endif
 # else
 /*  There is no __local_multiple_threads for librt, so use the TCB.  */
@@ -174,18 +174,18 @@ extern int __local_multiple_threads attribute_hidden;
 				   header.multiple_threads) == 0, 1)
 #  else
 #   define SINGLE_THREAD_P						\
-  stp	x0, x30, [sp, -16]!;						\
-  cfi_adjust_cfa_offset (16);						\
-  cfi_rel_offset (x0, 0);						\
-  cfi_rel_offset (x30, 8);						\
-  bl	__read_tp;							\
-  sub	x0, x0, PTHREAD_SIZEOF;						\
-  ldr	w16, [x0, PTHREAD_MULTIPLE_THREADS_OFFSET];			\
-  ldp	x0, x30, [sp], 16;						\
-  cfi_restore (x0);							\
-  cfi_restore (x30);							\
-  cfi_adjust_cfa_offset (-16);						\
-  cmp	w16, 0
+	stp	x0, x30, [sp, -16]!;					\
+	cfi_adjust_cfa_offset (16);					\
+	cfi_rel_offset (x0, 0);						\
+	cfi_rel_offset (x30, 8);					\
+	bl	__read_tp;						\
+	sub	x0, x0, PTHREAD_SIZEOF;					\
+	ldr	w16, [x0, PTHREAD_MULTIPLE_THREADS_OFFSET];		\
+	ldp	x0, x30, [sp], 16;					\
+	cfi_restore (x0);						\
+	cfi_restore (x30);						\
+	cfi_adjust_cfa_offset (-16);					\
+	cmp	w16, 0;
 #  endif
 # endif
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |   44 +++++
 sysdeps/unix/sysv/linux/aarch64/nptl/localplt.data |    1 -
 .../unix/sysv/linux/aarch64/nptl/sysdep-cancel.h   |  188 ++++++--------------
 sysdeps/unix/sysv/linux/aarch64/sysdep.h           |   55 ++----
 4 files changed, 120 insertions(+), 168 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]