summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/x86_64
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /sysdeps/unix/sysv/linux/x86_64
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'sysdeps/unix/sysv/linux/x86_64')
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/Dist11
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h54
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/mman.h6
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/shm.h1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h8
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/brk.c43
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/clone.S8
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h4
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/getcontext.S18
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/makecontext.c22
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/readelflib.c6
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/setcontext.S14
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sigaction.c6
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sigsuspend.c1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/swapcontext.S12
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sys/epoll.h9
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysconf.c54
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysdep.h39
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/ucontext_i.h47
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym34
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/umount.c32
23 files changed, 125 insertions, 312 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/Dist b/sysdeps/unix/sysv/linux/x86_64/Dist
new file mode 100644
index 0000000000..57dd1b2221
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/Dist
@@ -0,0 +1,11 @@
+clone.S
+ldd-rewrite.sed
+__start_context.S
+ucontext_i.h
+umount.c
+sys/debugreg.h
+sys/io.h
+sys/perm.h
+sys/procfs.h
+sys/reg.h
+sys/user.h
diff --git a/sysdeps/unix/sysv/linux/x86_64/Makefile b/sysdeps/unix/sysv/linux/x86_64/Makefile
index 0f20367236..627275db09 100644
--- a/sysdeps/unix/sysv/linux/x86_64/Makefile
+++ b/sysdeps/unix/sysv/linux/x86_64/Makefile
@@ -9,7 +9,3 @@ endif
ifeq ($(subdir),stdlib)
sysdep_routines += __start_context
endif
-
-ifeq ($(subdir),stdlib)
-gen-as-const-headers += ucontext_i.sym
-endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
index fa1d02bc1f..9198c70bd4 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux/x86-64.
- Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2004 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
@@ -21,12 +21,9 @@
# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
#endif
+
#include <sys/types.h>
#include <bits/wordsize.h>
-#ifdef __USE_GNU
-# include <bits/uio.h>
-#endif
-
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
@@ -113,7 +110,7 @@
# define F_NOTIFY 1026 /* Request notfications on a directory. */
#endif
-/* For F_[GET|SET]FD. */
+/* For F_[GET|SET]FL. */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
@@ -197,55 +194,10 @@ struct flock64
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
#endif
-
-#ifdef __USE_GNU
-/* Flags for SYNC_FILE_RANGE. */
-# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages
- in the range before performing the
- write. */
-# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those
- dirty pages in the range which are
- not presently under writeback. */
-# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in
- the range after performing the
- write. */
-
-/* Flags for SPLICE and VMSPLICE. */
-# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */
-# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing
- (but we may still block on the fd
- we splice from/to). */
-# define SPLICE_F_MORE 4 /* Expect more data. */
-# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */
-#endif
-
__BEGIN_DECLS
-#ifdef __USE_GNU
-
/* Provide kernel hint to read ahead. */
extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
__THROW;
-
-/* Selective file content synch'ing. */
-extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
- unsigned int __flags);
-
-
-/* Splice address range into a pipe. */
-extern int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
- unsigned int __flags);
-
-/* Splice two files together. */
-extern int splice (int __fdin, __off64_t *__offin, int __fdout,
- __off64_t *__offout, size_t __len, unsigned int __flags)
- __THROW;
-
-/* In-kernel implementation of tee for pipe buffers. */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
- __THROW;
-
-#endif
-
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/mman.h b/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
index 535c9edcf9..a7bac26935 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/mman.h
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/x86_64 version.
- Copyright (C) 2001, 2003, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003 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
@@ -79,7 +79,6 @@
/* Flags for `mremap'. */
#ifdef __USE_GNU
# define MREMAP_MAYMOVE 1
-# define MREMAP_FIXED 2
#endif
/* Advice to `madvise'. */
@@ -89,9 +88,6 @@
# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
# define MADV_WILLNEED 3 /* Will need these pages. */
# define MADV_DONTNEED 4 /* Don't need these pages. */
-# define MADV_REMOVE 9 /* Remove these pages and resources. */
-# define MADV_DONTFORK 10 /* Do not inherit across fork. */
-# define MADV_DOFORK 11 /* Do inherit across fork. */
#endif
/* The POSIX people had to invent similar names for the same things. */
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/shm.h b/sysdeps/unix/sysv/linux/x86_64/bits/shm.h
index 3d8c05d212..4282d75617 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/shm.h
@@ -80,7 +80,6 @@ struct shmid_ds
# define SHM_DEST 01000 /* segment will be destroyed on last detach */
# define SHM_LOCKED 02000 /* segment will not be swapped */
# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */
-# define SHM_NORESERVE 010000 /* don't check for reservations */
struct shminfo
{
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h b/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h
index c0d5fe72d4..08d4c52b2f 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h
@@ -70,14 +70,6 @@ struct _fpstate
__uint32_t padding[56];
};
-#ifndef sigcontext_struct
-/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
- we need sigcontext. Some packages have come to rely on
- sigcontext_struct being defined on 32-bit x86, so define this for
- their benefit. */
-# define sigcontext_struct sigcontext
-#endif
-
struct sigcontext
{
unsigned short gs, __gsh;
diff --git a/sysdeps/unix/sysv/linux/x86_64/brk.c b/sysdeps/unix/sysv/linux/x86_64/brk.c
index 8b18c4dbb9..09b7dd4707 100644
--- a/sysdeps/unix/sysv/linux/x86_64/brk.c
+++ b/sysdeps/unix/sysv/linux/x86_64/brk.c
@@ -1,42 +1 @@
-/* brk system call for Linux/x86_64.
- Copyright (C) 1995, 1996, 2000, 2001, 2006 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, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <errno.h>
-#include <unistd.h>
-#include <sysdep.h>
-
-/* This must be initialized data because commons can't have aliases. */
-void *__curbrk = 0;
-
-int
-__brk (void *addr)
-{
- void *newbrk;
-
- __curbrk = newbrk = (void *) INLINE_SYSCALL (brk, 1, addr);
-
- if (newbrk < addr)
- {
- __set_errno (ENOMEM);
- return -1;
- }
-
- return 0;
-}
-weak_alias (__brk, brk)
+#include <sysdeps/unix/sysv/linux/hppa/brk.c>
diff --git a/sysdeps/unix/sysv/linux/x86_64/clone.S b/sysdeps/unix/sysv/linux/x86_64/clone.S
index 8a12b09035..9695e1eaf8 100644
--- a/sysdeps/unix/sysv/linux/x86_64/clone.S
+++ b/sysdeps/unix/sysv/linux/x86_64/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2004 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
@@ -74,7 +74,7 @@ ENTRY (BP_SYM (__clone))
movq %r8, %rdx
movq %r9, %r8
movq 8(%rsp), %r10
- movl $SYS_ify(clone),%eax
+ movq $SYS_ify(clone),%rax
/* End FDE now, because in the child the unwind info will be
wrong. */
@@ -91,7 +91,7 @@ L(pseudo_end):
L(thread_start):
/* Clear the frame pointer. The ABI suggests this be done, to mark
the outermost frame obviously. */
- xorl %ebp, %ebp
+ xorq %rbp, %rbp
#ifdef RESET_PID
testq $CLONE_THREAD, %rdi
@@ -99,7 +99,7 @@ L(thread_start):
testq $CLONE_VM, %rdi
movl $-1, %eax
jne 2f
- movl $SYS_ify(getpid), %eax
+ movq $SYS_ify(getpid), %rax
syscall
2: movl %eax, %fs:PID
movl %eax, %fs:TID
diff --git a/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c b/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c
index 6662a94d09..7e26fecb3a 100644
--- a/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c
+++ b/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.c
@@ -1,5 +1,5 @@
#ifdef IS_IN_ldconfig
-# include <sysdeps/i386/dl-procinfo.c>
+#include <sysdeps/i386/dl-procinfo.c>
#else
-# include <sysdeps/generic/dl-procinfo.c>
+#include <sysdeps/generic/dl-procinfo.c>
#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h b/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h
index 31455204c3..b360b4288a 100644
--- a/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h
@@ -1,5 +1,5 @@
#ifdef IS_IN_ldconfig
-# include <sysdeps/unix/sysv/linux/i386/dl-procinfo.h>
+#include <sysdeps/unix/sysv/linux/i386/dl-procinfo.h>
#else
-# include <sysdeps/generic/dl-procinfo.h>
+#include <sysdeps/generic/dl-procinfo.h>
#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/getcontext.S b/sysdeps/unix/sysv/linux/x86_64/getcontext.S
index 4bbc7a4d2e..2f2c710040 100644
--- a/sysdeps/unix/sysv/linux/x86_64/getcontext.S
+++ b/sysdeps/unix/sysv/linux/x86_64/getcontext.S
@@ -1,5 +1,5 @@
/* Save current context.
- Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -67,22 +67,18 @@ ENTRY(__getcontext)
/* Save the current signal mask with
rt_sigprocmask (SIG_BLOCK, NULL, set,_NSIG/8). */
leaq oSIGMASK(%rdi), %rdx
- xorl %esi,%esi
-#if SIG_BLOCK == 0
- xorl %edi, %edi
-#else
- movl $SIG_BLOCK, %edi
-#endif
- movl $_NSIG8,%r10d
- movl $__NR_rt_sigprocmask, %eax
+ xorq %rsi,%rsi
+ movq $SIG_BLOCK, %rdi
+ movq $_NSIG8,%r10
+ movq $__NR_rt_sigprocmask, %rax
syscall
cmpq $-4095, %rax /* Check %rax for error. */
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
/* All done, return 0 for success. */
- xorl %eax, %eax
+ xorq %rax, %rax
L(pseudo_end):
ret
PSEUDO_END(__getcontext)
-weak_alias (__getcontext, getcontext)
+weak_alias(__getcontext, getcontext)
diff --git a/sysdeps/unix/sysv/linux/x86_64/makecontext.c b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
index 5deea7d1b2..c763556b93 100644
--- a/sysdeps/unix/sysv/linux/x86_64/makecontext.c
+++ b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
@@ -1,5 +1,5 @@
/* Create new context.
- Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -20,7 +20,6 @@
#include <sysdep.h>
#include <stdarg.h>
-#include <stdint.h>
#include <ucontext.h>
#include "ucontext_i.h"
@@ -53,29 +52,28 @@ void
__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
{
extern void __start_context (void);
- unsigned long int *sp, idx_uc_link;
+ unsigned long *sp, idx_uc_link;
va_list ap;
int i;
/* Generate room on stack for parameter if needed and uc_link. */
- sp = (unsigned long int *) ((uintptr_t) ucp->uc_stack.ss_sp
- + ucp->uc_stack.ss_size);
+ sp = (long *) ((long) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
sp -= (argc > 6 ? argc - 6 : 0) + 1;
/* Align stack and make space for trampoline address. */
- sp = (unsigned long int *) ((((uintptr_t) sp) & -16L) - 8);
+ sp = (long *) ((((long) sp) & -16L) - 8);
idx_uc_link = (argc > 6 ? argc - 6 : 0) + 1;
/* Setup context ucp. */
/* Address to jump to. */
- ucp->uc_mcontext.gregs[REG_RIP] = (long int) func;
+ ucp->uc_mcontext.gregs[REG_RIP] = (long) func;
/* Setup rbx.*/
- ucp->uc_mcontext.gregs[REG_RBX] = (long int) &sp[idx_uc_link];
- ucp->uc_mcontext.gregs[REG_RSP] = (long int) sp;
+ ucp->uc_mcontext.gregs[REG_RBX] = (long) &sp[idx_uc_link];
+ ucp->uc_mcontext.gregs[REG_RSP] = (long) sp;
/* Setup stack. */
- sp[0] = (unsigned long int) &__start_context;
- sp[idx_uc_link] = (unsigned long int) ucp->uc_link;
+ sp[0] = (long) &__start_context;
+ sp[idx_uc_link] = (long) ucp->uc_link;
va_start (ap, argc);
/* Handle arguments. */
@@ -110,4 +108,4 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
}
-weak_alias (__makecontext, makecontext)
+weak_alias(__makecontext, makecontext)
diff --git a/sysdeps/unix/sysv/linux/x86_64/readelflib.c b/sysdeps/unix/sysv/linux/x86_64/readelflib.c
index 5a49af3fa6..c672f1df5a 100644
--- a/sysdeps/unix/sysv/linux/x86_64/readelflib.c
+++ b/sysdeps/unix/sysv/linux/x86_64/readelflib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999 and
Jakub Jelinek <jakub@redhat.com>, 1999.
@@ -53,10 +53,10 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
#undef process_elf_file
#define process_elf_file process_elf32_file
#define __ELF_NATIVE_CLASS 32
-#include "elf/readelflib.c"
+#include "sysdeps/generic/readelflib.c"
#undef __ELF_NATIVE_CLASS
#undef process_elf_file
#define process_elf_file process_elf64_file
#define __ELF_NATIVE_CLASS 64
-#include "elf/readelflib.c"
+#include "sysdeps/generic/readelflib.c"
diff --git a/sysdeps/unix/sysv/linux/x86_64/setcontext.S b/sysdeps/unix/sysv/linux/x86_64/setcontext.S
index 61fc07f44f..65c03d8a01 100644
--- a/sysdeps/unix/sysv/linux/x86_64/setcontext.S
+++ b/sysdeps/unix/sysv/linux/x86_64/setcontext.S
@@ -1,5 +1,5 @@
/* Install given context.
- Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -40,10 +40,10 @@ ENTRY(__setcontext)
/* Set the signal mask with
rt_sigprocmask (SIG_SETMASK, mask, NULL, _NSIG/8). */
leaq oSIGMASK(%rdi), %rsi
- xorl %edx, %edx
- movl $SIG_SETMASK, %edi
- movl $_NSIG8,%r10d
- movl $__NR_rt_sigprocmask, %eax
+ xorq %rdx, %rdx
+ movq $SIG_SETMASK, %rdi
+ movq $_NSIG8,%r10
+ movq $__NR_rt_sigprocmask, %rax
syscall
popq %rdi /* Reload %rdi, adjust stack. */
cfi_adjust_cfa_offset(-8)
@@ -96,10 +96,10 @@ ENTRY(__setcontext)
cfi_startproc
/* Clear rax to indicate success. */
- xorl %eax, %eax
+ xorq %rax, %rax
L(pseudo_end):
ret
PSEUDO_END(__setcontext)
-weak_alias (__setcontext, setcontext)
+weak_alias(__setcontext, setcontext)
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigaction.c b/sysdeps/unix/sysv/linux/x86_64/sigaction.c
index d6f4558cef..9123047092 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sigaction.c
+++ b/sysdeps/unix/sysv/linux/x86_64/sigaction.c
@@ -1,5 +1,5 @@
/* POSIX.1 `sigaction' call for Linux/x86-64.
- Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003 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
@@ -79,10 +79,6 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
}
libc_hidden_def (__libc_sigaction)
-#ifdef WRAPPER_INCLUDE
-# include WRAPPER_INCLUDE
-#endif
-
#ifndef LIBC_SIGACTION
weak_alias (__libc_sigaction, __sigaction)
libc_hidden_weak (__sigaction)
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigsuspend.c b/sysdeps/unix/sysv/linux/x86_64/sigsuspend.c
new file mode 100644
index 0000000000..9c5c79e63e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/sigsuspend.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/ia64/sigsuspend.c>
diff --git a/sysdeps/unix/sysv/linux/x86_64/swapcontext.S b/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
index fc7996ccdc..4394e2ae9f 100644
--- a/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/x86_64/swapcontext.S
@@ -1,5 +1,5 @@
/* Save current context and install the given one.
- Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -73,9 +73,9 @@ ENTRY(__swapcontext)
rt_sigprocmask (SIG_BLOCK, newset, oldset,_NSIG/8). */
leaq oSIGMASK(%rdi), %rdx
leaq oSIGMASK(%rsi), %rsi
- movl $SIG_SETMASK, %edi
- movl $_NSIG8,%r10d
- movl $__NR_rt_sigprocmask, %eax
+ movq $SIG_SETMASK, %rdi
+ movq $_NSIG8,%r10
+ movq $__NR_rt_sigprocmask, %rax
syscall
cmpq $-4095, %rax /* Check %rax for error. */
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
@@ -114,10 +114,10 @@ ENTRY(__swapcontext)
movq oRSI(%rsi), %rsi
/* Clear rax to indicate success. */
- xorl %eax, %eax
+ xorq %rax, %rax
L(pseudo_end):
ret
PSEUDO_END(__swapcontext)
-weak_alias (__swapcontext, swapcontext)
+weak_alias(__swapcontext, swapcontext)
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h b/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h
index 02672d3c75..cffddb58b3 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sys/epoll.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002,2003,2004,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 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
@@ -98,12 +98,9 @@ extern int epoll_ctl (int __epfd, int __op, int __fd,
"events" parameter is a buffer that will contain triggered
events. The "maxevents" is the maximum number of events to be
returned ( usually size of "events" ). The "timeout" parameter
- specifies the maximum wait time in milliseconds (-1 == infinite).
-
- This function is a cancellation point and therefore not marked with
- __THROW. */
+ specifies the maximum wait time in milliseconds (-1 == infinite). */
extern int epoll_wait (int __epfd, struct epoll_event *__events,
- int __maxevents, int __timeout);
+ int __maxevents, int __timeout) __THROW;
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysconf.c b/sysdeps/unix/sysv/linux/x86_64/sysconf.c
index 5a898b7857..407fd46bc3 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysconf.c
+++ b/sysdeps/unix/sysv/linux/x86_64/sysconf.c
@@ -1,5 +1,5 @@
/* Get file-specific information about a file. Linux version.
- Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 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
@@ -45,24 +45,11 @@ static const struct intel_02_cache_info
{ 0x29, _SC_LEVEL3_CACHE_SIZE, 4194304, 8, 64 },
{ 0x2c, _SC_LEVEL1_DCACHE_SIZE, 32768, 8, 64 },
{ 0x30, _SC_LEVEL1_ICACHE_SIZE, 32768, 8, 64 },
- { 0x39, _SC_LEVEL2_CACHE_SIZE, 131072, 4, 64 },
- { 0x3a, _SC_LEVEL2_CACHE_SIZE, 196608, 6, 64 },
- { 0x3b, _SC_LEVEL2_CACHE_SIZE, 131072, 2, 64 },
- { 0x3c, _SC_LEVEL2_CACHE_SIZE, 262144, 4, 64 },
- { 0x3d, _SC_LEVEL2_CACHE_SIZE, 393216, 6, 64 },
- { 0x3e, _SC_LEVEL2_CACHE_SIZE, 524288, 4, 64 },
{ 0x41, _SC_LEVEL2_CACHE_SIZE, 131072, 4, 32 },
{ 0x42, _SC_LEVEL2_CACHE_SIZE, 262144, 4, 32 },
{ 0x43, _SC_LEVEL2_CACHE_SIZE, 524288, 4, 32 },
{ 0x44, _SC_LEVEL2_CACHE_SIZE, 1048576, 4, 32 },
{ 0x45, _SC_LEVEL2_CACHE_SIZE, 2097152, 4, 32 },
- { 0x46, _SC_LEVEL3_CACHE_SIZE, 4194304, 4, 64 },
- { 0x47, _SC_LEVEL3_CACHE_SIZE, 8388608, 8, 64 },
- { 0x49, _SC_LEVEL2_CACHE_SIZE, 4194304, 16, 64 },
- { 0x4a, _SC_LEVEL3_CACHE_SIZE, 6291456, 12, 64 },
- { 0x4b, _SC_LEVEL3_CACHE_SIZE, 8388608, 16, 64 },
- { 0x4c, _SC_LEVEL3_CACHE_SIZE, 12582912, 12, 64 },
- { 0x4d, _SC_LEVEL3_CACHE_SIZE, 16777216, 16, 64 },
{ 0x60, _SC_LEVEL1_DCACHE_SIZE, 16384, 8, 64 },
{ 0x66, _SC_LEVEL1_DCACHE_SIZE, 8192, 4, 64 },
{ 0x67, _SC_LEVEL1_DCACHE_SIZE, 16384, 4, 64 },
@@ -73,7 +60,6 @@ static const struct intel_02_cache_info
{ 0x7b, _SC_LEVEL2_CACHE_SIZE, 524288, 8, 64 },
{ 0x7c, _SC_LEVEL2_CACHE_SIZE, 1048576, 8, 64 },
{ 0x7d, _SC_LEVEL2_CACHE_SIZE, 2097152, 8, 64 },
- { 0x7f, _SC_LEVEL2_CACHE_SIZE, 524288, 2, 64 },
{ 0x82, _SC_LEVEL2_CACHE_SIZE, 262144, 8, 32 },
{ 0x83, _SC_LEVEL2_CACHE_SIZE, 524288, 8, 32 },
{ 0x84, _SC_LEVEL2_CACHE_SIZE, 1048576, 8, 32 },
@@ -101,7 +87,6 @@ intel_02_known_compare (const void *p1, const void *p2)
static long int
-__attribute__ ((noinline))
intel_check_word (int name, unsigned int value, bool *has_level_2,
bool *no_level_2_or_3)
{
@@ -128,33 +113,6 @@ intel_check_word (int name, unsigned int value, bool *has_level_2,
}
else
{
- if (byte == 0x49 && folded_name == _SC_LEVEL3_CACHE_SIZE)
- {
- /* Intel reused this value. For family 15, model 6 it
- specifies the 3rd level cache. Otherwise the 2nd
- level cache. */
- unsigned int eax;
- unsigned int ebx;
- unsigned int ecx;
- unsigned int edx;
- asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1"
- : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx)
- : "0" (1));
-
- unsigned int family = ((eax >> 20) & 0xff) + ((eax >> 8) & 0xf);
- unsigned int model = ((((eax >>16) & 0xf) << 4)
- + ((eax >> 4) & 0xf));
- if (family == 15 && model == 6)
- {
- /* The level 3 cache is encoded for this model like
- the level 2 cache is for other models. Pretend
- the caller asked for the level 2 cache. */
- name = (_SC_LEVEL2_CACHE_SIZE
- + (name - _SC_LEVEL3_CACHE_SIZE));
- folded_name = _SC_LEVEL3_CACHE_SIZE;
- }
- }
-
struct intel_02_cache_info *found;
struct intel_02_cache_info search;
@@ -191,7 +149,7 @@ intel_check_word (int name, unsigned int value, bool *has_level_2,
}
-static long int __attribute__ ((noinline))
+static long int
handle_intel (int name, unsigned int maxidx)
{
assert (maxidx >= 2);
@@ -248,7 +206,7 @@ handle_intel (int name, unsigned int maxidx)
}
-static long int __attribute__ ((noinline))
+static long int
handle_amd (int name)
{
unsigned int eax;
@@ -321,6 +279,12 @@ handle_amd (int name)
long int
__sysconf (int name)
{
+ if (name == _SC_CPUTIME || name == _SC_THREAD_CPUTIME)
+ {
+ /* XXX Test whether TSC is usable. */
+ return 200112L;
+ }
+
/* We only handle the cache information here (for now). */
if (name < _SC_LEVEL1_ICACHE_SIZE || name > _SC_LEVEL4_CACHE_LINESIZE)
return linux_sysconf (name);
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index 5dfffca455..fd92d7ae16 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2001,02,03,04 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
@@ -119,7 +119,7 @@
# define SYSCALL_ERROR_HANDLER \
0: \
leaq rtld_errno(%rip), %rcx; \
- xorl %edx, %edx; \
+ xorq %rdx, %rdx; \
subq %rax, %rdx; \
movl %edx, (%rcx); \
orq $-1, %rax; \
@@ -133,7 +133,7 @@
# define SYSCALL_ERROR_HANDLER \
0: \
movq SYSCALL_ERROR_ERRNO@GOTTPOFF(%rip), %rcx;\
- xorl %edx, %edx; \
+ xorq %rdx, %rdx; \
subq %rax, %rdx; \
movl %edx, %fs:(%rcx); \
orq $-1, %rax; \
@@ -143,7 +143,7 @@
Note that errno occupies only 4 bytes. */
# define SYSCALL_ERROR_HANDLER \
0: \
- xorl %edx, %edx; \
+ xorq %rdx, %rdx; \
subq %rax, %rdx; \
pushq %rdx; \
cfi_adjust_cfa_offset(8); \
@@ -161,7 +161,7 @@
#else /* Not _LIBC_REENTRANT. */
# define SYSCALL_ERROR_HANDLER \
0:movq errno@GOTPCREL(%RIP), %rcx; \
- xorl %edx, %edx; \
+ xorq %rdx, %rdx; \
subq %rax, %rdx; \
movl %edx, (%rcx); \
orq $-1, %rax; \
@@ -208,7 +208,7 @@
#undef DO_CALL
#define DO_CALL(syscall_name, args) \
DOARGS_##args \
- movl $SYS_ify (syscall_name), %eax; \
+ movq $SYS_ify (syscall_name), %rax; \
syscall;
#define DOARGS_0 /* nothing */
@@ -311,31 +311,4 @@
#endif /* __ASSEMBLER__ */
-
-/* Pointer mangling support. */
-#if defined NOT_IN_libc && defined IS_IN_rtld
-/* We cannot use the thread descriptor because in ld.so we use setjmp
- earlier than the descriptor is initialized. */
-# ifdef __ASSEMBLER__
-# define PTR_MANGLE(reg) xorq __pointer_chk_guard_local(%rip), reg
-# define PTR_DEMANGLE(reg) PTR_MANGLE (reg)
-# else
-# define PTR_MANGLE(reg) asm ("xorq __pointer_chk_guard_local(%%rip), %0"\
- : "=r" (reg) : "0" (reg))
-# define PTR_DEMANGLE(reg) PTR_MANGLE (reg)
-# endif
-#else
-# ifdef __ASSEMBLER__
-# define PTR_MANGLE(reg) xorq %fs:POINTER_GUARD, reg
-# define PTR_DEMANGLE(reg) PTR_MANGLE (reg)
-# else
-# define PTR_MANGLE(var) asm ("xorq %%fs:%c2, %0" \
- : "=r" (var) \
- : "0" (var), \
- "i" (offsetof (tcbhead_t, \
- pointer_guard)))
-# define PTR_DEMANGLE(var) PTR_MANGLE (var)
-# endif
-#endif
-
#endif /* linux/x86_64/sysdep.h */
diff --git a/sysdeps/unix/sysv/linux/x86_64/ucontext_i.h b/sysdeps/unix/sysv/linux/x86_64/ucontext_i.h
new file mode 100644
index 0000000000..5451a308ee
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/ucontext_i.h
@@ -0,0 +1,47 @@
+/* Offsets and other constants needed in the *context() function
+ implementation for Linux/x86-64.
+ Copyright (C) 2002 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#define SIG_BLOCK 0
+#define SIG_SETMASK 2
+
+/* Since we cannot include a header to define _NSIG/8, we define it
+ here. */
+#define _NSIG8 8
+
+/* Offsets of the fields in the ucontext_t structure. */
+#define oRBP 120
+#define oRSP 160
+#define oRBX 128
+#define oR8 40
+#define oR9 48
+#define oR12 72
+#define oR13 80
+#define oR14 88
+#define oR15 96
+#define oRDI 104
+#define oRSI 112
+#define oRDX 136
+#define oRAX 144
+#define oRCX 152
+#define oRIP 168
+#define oFPREGS 208
+#define oSIGMASK 280
+#define oFPREGSMEM 408
+#define oMXCSR 432
diff --git a/sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym b/sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym
deleted file mode 100644
index b3cfe9aa4c..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <stddef.h>
-#include <signal.h>
-#include <sys/ucontext.h>
-
---
-
-SIG_BLOCK
-SIG_SETMASK
-
-_NSIG8 (_NSIG / 8)
-
-#define ucontext(member) offsetof (ucontext_t, member)
-#define mcontext(member) ucontext (uc_mcontext.member)
-#define mreg(reg) mcontext (gregs[REG_##reg])
-
-oRBP mreg (RBP)
-oRSP mreg (RSP)
-oRBX mreg (RBX)
-oR8 mreg (R8)
-oR9 mreg (R9)
-oR12 mreg (R12)
-oR13 mreg (R13)
-oR14 mreg (R14)
-oR15 mreg (R15)
-oRDI mreg (RDI)
-oRSI mreg (RSI)
-oRDX mreg (RDX)
-oRAX mreg (RAX)
-oRCX mreg (RCX)
-oRIP mreg (RIP)
-oFPREGS mcontext (fpregs)
-oSIGMASK ucontext (uc_sigmask)
-oFPREGSMEM ucontext (__fpregs_mem)
-oMXCSR ucontext (__fpregs_mem.mxcsr)
diff --git a/sysdeps/unix/sysv/linux/x86_64/umount.c b/sysdeps/unix/sysv/linux/x86_64/umount.c
index a17c5c5799..9a91ba5b2f 100644
--- a/sysdeps/unix/sysv/linux/x86_64/umount.c
+++ b/sysdeps/unix/sysv/linux/x86_64/umount.c
@@ -1,31 +1 @@
-/* Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by David Huggins-Daines <dhd@debian.org>, 2000.
-
- 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, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/* Since we don't have an oldumount system call, do what the kernel
- does down here. */
-
-extern long int __umount2 (const char *name, int flags);
-
-long int
-__umount (const char *name)
-{
- return __umount2 (name, 0);
-}
-
-weak_alias (__umount, umount);
+#include <sysdeps/unix/sysv/linux/hppa/umount.c>