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.22-612-g8ead7a9


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  8ead7a9b94a085e6fba69b8b22e2ba0e2677f0d5 (commit)
      from  2094350c9c9c1b87cf34b193ad6541e4a29b62dc (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=8ead7a9b94a085e6fba69b8b22e2ba0e2677f0d5

commit 8ead7a9b94a085e6fba69b8b22e2ba0e2677f0d5
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Dec 17 11:46:49 2015 -0800

    Provide x32 times
    
    Since times returns 64-bit clock_t on x32, we need to provide x32 times
    by redefining INTERNAL_SYSCALL_NCS and INTERNAL_SYSCALL_ERROR_P with
    64-bit return type for syscall.  All system calls returning 64-bit
    integer, which are lseek, time and times, must be handled specially for
    x32.  lseek is handled by x32 lseek.S and time doesn't check syscall
    return.  times is the only missed one.  Before this patch, there are
    
    0000000 <__times>:
       0:	b8 64 00 00 40       	mov    $0x40000064,%eax
       5:	0f 05                	syscall
       7:	48 63 d0             	movslq %eax,%rdx
                                    ^^^^^^^^^^ Incorrect signed extension
       a:	48 83 fa f2          	cmp    $0xfffffffffffffff2,%rdx
       e:	75 07                	jne    17 <__times+0x17>
      10:	3d 00 f0 ff ff       	cmp    $0xfffff000,%eax
                                    ^^^^^^^^^^^^^^^^^^^^^ 32-bit compare
      15:	77 11                	ja     28 <__times+0x28>
      17:	48 83 fa ff          	cmp    $0xffffffffffffffff,%rdx
      1b:	b8 00 00 00 00       	mov    $0x0,%eax
      20:	48 0f 45 c2          	cmovne %rdx,%rax
      24:	c3                   	retq
    
    After this patch, there are
    
    00000000 <__times>:
       0:	b8 64 00 00 40       	mov    $0x40000064,%eax
       5:	0f 05                	syscall
       7:	48 83 f8 f2          	cmp    $0xfffffffffffffff2,%rax
       b:	75 08                	jne    15 <__times+0x15>
       d:	48 3d 00 f0 ff ff    	cmp    $0xfffffffffffff000,%rax
      13:	77 13                	ja     28 <__times+0x28>
      15:	48 83 f8 ff          	cmp    $0xffffffffffffffff,%rax
      19:	ba 00 00 00 00       	mov    $0x0,%edx
      1e:	48 0f 44 c2          	cmove  %rdx,%rax
      22:	c3                   	retq
    
    The incorrect signed extension and 32-bit compare are gone.
    
    	[BZ #19363]
    	* sysdeps/unix/sysv/linux/x86_64/x32/times.c: New file.

diff --git a/ChangeLog b/ChangeLog
index 6cd6d72..9a32440 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-12-17  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #19363]
+	* sysdeps/unix/sysv/linux/x86_64/x32/times.c: New file.
+
 2015-12-17  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
 	* sysdeps/powerpc/power7/fpu/s_logb.c (__logb): Fix return for
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/times.c b/sysdeps/unix/sysv/linux/x86_64/x32/times.c
new file mode 100644
index 0000000..3002d92
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/times.c
@@ -0,0 +1,38 @@
+/* Linux times.  X32 version.
+   Copyright (C) 2015 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+/* Linux times system call returns 64-bit integer.  */
+#undef INTERNAL_SYSCALL_NCS
+#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
+  ({									      \
+    unsigned long long int resultvar;					      \
+    LOAD_ARGS_##nr (args)						      \
+    LOAD_REGS_##nr							      \
+    asm volatile (							      \
+    "syscall\n\t"							      \
+    : "=a" (resultvar)							      \
+    : "0" (name) ASM_ARGS_##nr : "memory", REGISTERS_CLOBBERED_BY_SYSCALL);   \
+    (long long int) resultvar; })
+
+#undef INTERNAL_SYSCALL_ERROR_P
+#define INTERNAL_SYSCALL_ERROR_P(val, err) \
+  ((unsigned long long int) (val) >= -4095LL)
+
+#include <sysdeps/unix/sysv/linux/times.c>

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

Summary of changes:
 ChangeLog                                          |    5 ++
 .../sysv/linux/x86_64/x32/times.c}                 |   40 +++++++++----------
 2 files changed, 24 insertions(+), 21 deletions(-)
 copy sysdeps/{powerpc/powerpc64/multiarch/stpcpy-power8.S => unix/sysv/linux/x86_64/x32/times.c} (53%)


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]