summaryrefslogtreecommitdiff
path: root/libc/sysdeps/unix/sysv/linux/x86_64
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/unix/sysv/linux/x86_64')
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S4
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h4
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c14
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/init-first.c7
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list1
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h39
-rw-r--r--libc/sysdeps/unix/sysv/linux/x86_64/time.c9
7 files changed, 33 insertions, 45 deletions
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S b/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
index 3881082cf..d8cbe0684 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
@@ -34,7 +34,7 @@ longjmp_msg:
cfi_remember_state; \
cfi_def_cfa_offset(16); \
leaq longjmp_msg(%rip), %rdi; \
- call __GI___fortify_fail; \
+ call HIDDEN_JUMPTARGET(__fortify_fail); \
nop; \
cfi_restore_state
#else
@@ -42,7 +42,7 @@ longjmp_msg:
cfi_remember_state; \
cfi_def_cfa_offset(16); \
movq $longjmp_msg, %rdi; \
- call __fortify_fail; \
+ call HIDDEN_JUMPTARGET(__fortify_fail); \
nop; \
cfi_restore_state
#endif
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h b/libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h
index 7153e2143..e86c3578b 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/bits/sem.h
@@ -40,13 +40,9 @@ struct semid_ds
{
struct ipc_perm sem_perm; /* operation permission struct */
__time_t sem_otime; /* last semop() time */
-#if __WORDSIZE == 32
unsigned long int __unused1;
-#endif
__time_t sem_ctime; /* last time changed by semctl() */
-#if __WORDSIZE == 32
unsigned long int __unused2;
-#endif
unsigned long int sem_nsems; /* number of semaphores in set */
unsigned long int __unused3;
unsigned long int __unused4;
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c b/libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
new file mode 100644
index 000000000..7802701e2
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
@@ -0,0 +1,14 @@
+#include "bits/libc-vdso.h"
+
+#ifdef SHARED
+# define SYSCALL_GETTIME(id, tp) \
+ ({ long int (*f) (clockid_t, struct timespec *) = __vdso_clock_gettime; \
+ PTR_DEMANGLE (f); \
+ f (id, tp); })
+# define INTERNAL_GETTIME(id, tp) \
+ ({ long int (*f) (clockid_t, struct timespec *) = __vdso_clock_gettime; \
+ PTR_DEMANGLE (f); \
+ f (id, tp); })
+#endif
+
+#include "../clock_gettime.c"
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c b/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c
index 25cf08bd7..cb39acae1 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c
@@ -17,6 +17,8 @@
02111-1307 USA. */
#ifdef SHARED
+# include <time.h>
+# include <sysdep.h>
# include <dl-vdso.h>
# include <bits/libc-vdso.h>
@@ -27,12 +29,17 @@ strong_alias (__vdso_clock_gettime, __GI___vdso_clock_gettime attribute_hidden)
long int (*__vdso_getcpu) (unsigned *, unsigned *, void *) attribute_hidden;
+extern long int __syscall_clock_gettime (clockid_t, struct timespec *);
+
+
static inline void
_libc_vdso_platform_setup (void)
{
PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
void *p = _dl_vdso_vsym ("clock_gettime", &linux26);
+ if (p == NULL)
+ p = __syscall_clock_gettime;
PTR_MANGLE (p);
__GI___vdso_clock_gettime = p;
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list
index 3e231a0b6..ccddb8422 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/syscalls.list
@@ -14,6 +14,7 @@ semop - semop i:ipi __semop semop
semtimedop - semtimedop i:ipip semtimedop
semget - semget i:iii __semget semget
semctl - semctl i:iiii __semctl semctl
+syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime
# proper socket implementations:
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index 2b9ea85d8..64362300a 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2005, 2007, 2011 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
@@ -124,7 +124,7 @@
movl %edx, (%rcx); \
orq $-1, %rax; \
jmp L(pseudo_end);
-# elif USE___THREAD
+# else
# ifndef NOT_IN_libc
# define SYSCALL_ERROR_ERRNO __libc_errno
# else
@@ -138,34 +138,6 @@
movl %edx, %fs:(%rcx); \
orq $-1, %rax; \
jmp L(pseudo_end);
-# elif defined _LIBC_REENTRANT
-/* Store (- %rax) into errno through the GOT.
- Note that errno occupies only 4 bytes. */
-# define SYSCALL_ERROR_HANDLER \
-0: \
- xorl %edx, %edx; \
- subq %rax, %rdx; \
- pushq %rdx; \
- cfi_adjust_cfa_offset(8); \
- PUSH_ERRNO_LOCATION_RETURN; \
- call BP_SYM (__errno_location)@PLT; \
- POP_ERRNO_LOCATION_RETURN; \
- popq %rdx; \
- cfi_adjust_cfa_offset(-8); \
- movl %edx, (%rax); \
- orq $-1, %rax; \
- jmp L(pseudo_end);
-
-/* A quick note: it is assumed that the call to `__errno_location' does
- not modify the stack! */
-# else /* Not _LIBC_REENTRANT. */
-# define SYSCALL_ERROR_HANDLER \
-0:movq errno@GOTPCREL(%RIP), %rcx; \
- xorl %edx, %edx; \
- subq %rax, %rdx; \
- movl %edx, (%rcx); \
- orq $-1, %rax; \
- jmp L(pseudo_end);
# endif /* PIC */
/* The Linux/x86-64 kernel expects the system call parameters in
@@ -279,8 +251,8 @@
if (INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err)) \
{ \
iserr: \
- __set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err)); \
- sc_ret = -1L; \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err)); \
+ sc_ret = -1L; \
} \
out: \
sc_ret; \
@@ -304,9 +276,6 @@
v_ret; \
})
-/* List of system calls which are supported as vsyscalls. */
-# define HAVE_CLOCK_GETTIME_VSYSCALL 1
-
# else
# define INLINE_VSYSCALL(name, nr, args...) \
INLINE_SYSCALL (name, nr, ##args)
diff --git a/libc/sysdeps/unix/sysv/linux/x86_64/time.c b/libc/sysdeps/unix/sysv/linux/x86_64/time.c
index c1c1a7526..a613eb0f5 100644
--- a/libc/sysdeps/unix/sysv/linux/x86_64/time.c
+++ b/libc/sysdeps/unix/sysv/linux/x86_64/time.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,02, 2003, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2001,02,2003,2011 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
@@ -16,13 +16,11 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#ifdef SHARED
#include <dl-vdso.h>
-
#define VSYSCALL_ADDR_vtime 0xffffffffff600400
-
-#ifdef SHARED
void *time_ifunc (void) __asm__ ("time");
void *
@@ -34,7 +32,9 @@ time_ifunc (void)
return _dl_vdso_vsym ("time", &linux26) ?: (void *) VSYSCALL_ADDR_vtime;
}
__asm (".type time, %gnu_indirect_function");
+
#else
+
# include <time.h>
# include <sysdep.h>
@@ -44,6 +44,7 @@ time (time_t *t)
INTERNAL_SYSCALL_DECL (err);
return INTERNAL_SYSCALL (time, err, 1, t);
}
+
#endif
strong_alias (time, __GI_time)