glibc/sysdeps
H.J. Lu 8ead7a9b94 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.
2015-12-17 11:47:06 -08:00
..
aarch64 [AArch64] Regenerate libm-test-ulps 2015-12-01 12:57:16 +00:00
alpha Move bits/atomic.h to atomic-machine.h (bug 14912). 2015-09-11 20:00:19 +00:00
arm math: add LDBL_CLASSIFY_COMPAT support 2015-12-03 13:00:46 -05:00
generic Replace MUTEX_INITIALIZER with _LIBC_LOCK_INITIALIZER in generic code 2015-11-24 16:37:15 +01:00
gnu Rename localedir to complocaledir (bug 14259). 2015-11-27 10:22:38 -05:00
hppa Fix math_private.h multiple include guards. 2015-11-20 23:46:23 +00:00
i386 Fix hurd build with hidden support 2015-11-25 02:35:18 +01:00
ia64 Fix lgamma setting signgam for ISO C (bug 15421). 2015-11-20 22:49:59 +00:00
ieee754 Fix indentation. 2015-12-11 09:19:37 -08:00
init_array NPTL: Initializer for .init_array-only configurations. 2015-02-13 13:19:11 -08:00
m68k math: add LDBL_CLASSIFY_COMPAT support 2015-12-03 13:00:46 -05:00
mach Add __CPU_MASK_TYPE for __cpu_mask 2015-12-01 10:25:44 -08:00
microblaze math: add LDBL_CLASSIFY_COMPAT support 2015-12-03 13:00:46 -05:00
mips mips: fix testsuite build for O32 FPXX ABI on pre-R2 CPU 2015-12-09 19:03:46 +01:00
nacl Add __CPU_MASK_TYPE for __cpu_mask 2015-12-01 10:25:44 -08:00
nios2 math: add LDBL_CLASSIFY_COMPAT support 2015-12-03 13:00:46 -05:00
nptl Replace MUTEX_INITIALIZER with _LIBC_LOCK_INITIALIZER in generic code 2015-11-24 16:37:15 +01:00
posix Remove signal handling for nanosleep (bug 16364) 2015-11-20 11:16:07 -02:00
powerpc Fix POWER7 logb results for negative subnormals (bug 19375) 2015-12-17 14:34:33 -02:00
pthread Convert 113 more function definitions to prototype style (files with assertions). 2015-10-20 11:54:09 +00:00
s390 S390: Use __asm__ instead of asm. 2015-11-20 08:56:40 +01:00
sh math: add LDBL_CLASSIFY_COMPAT support 2015-12-03 13:00:46 -05:00
sparc Convert 69 more function definitions to prototype style (line wrap cases). 2015-10-19 21:23:47 +00:00
tile tile: define __NO_LONG_DOUBLE_MATH 2015-11-24 14:09:31 -05:00
unix Provide x32 times 2015-12-17 11:47:06 -08:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
wordsize-64 Add LFS support for fts functions (bug 11460) 2015-11-06 11:24:16 +01:00
x86 Add Prefer_MAP_32BIT_EXEC to map executable pages with MAP_32BIT 2015-12-15 13:16:02 -08:00
x86_64 Better workaround for aliases of *_finite symbols in vector math library. 2015-11-27 16:22:26 +03:00