summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/x86_64
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
commit0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (patch)
tree2ea1f8305970753e4a657acb2ccc15ca3eec8e2c /sysdeps/unix/sysv/linux/x86_64
parent7d58530341304d403a6626d7f7a1913165fe2f32 (diff)
2.5-18.1
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, 312 insertions, 125 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/Dist b/sysdeps/unix/sysv/linux/x86_64/Dist
deleted file mode 100644
index 57dd1b2221..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/Dist
+++ /dev/null
@@ -1,11 +0,0 @@
-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 627275db09..0f20367236 100644
--- a/sysdeps/unix/sysv/linux/x86_64/Makefile
+++ b/sysdeps/unix/sysv/linux/x86_64/Makefile
@@ -9,3 +9,7 @@ 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 9198c70bd4..fa1d02bc1f 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 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2004, 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
@@ -21,9 +21,12 @@
# 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 */
@@ -110,7 +113,7 @@
# define F_NOTIFY 1026 /* Request notfications on a directory. */
#endif
-/* For F_[GET|SET]FL. */
+/* For F_[GET|SET]FD. */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
@@ -194,10 +197,55 @@ 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 a7bac26935..535c9edcf9 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 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003, 2005, 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
@@ -79,6 +79,7 @@
/* Flags for `mremap'. */
#ifdef __USE_GNU
# define MREMAP_MAYMOVE 1
+# define MREMAP_FIXED 2
#endif
/* Advice to `madvise'. */
@@ -88,6 +89,9 @@
# 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 4282d75617..3d8c05d212 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/shm.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/shm.h
@@ -80,6 +80,7 @@ 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 08d4c52b2f..c0d5fe72d4 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/sigcontext.h
@@ -70,6 +70,14 @@ 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 09b7dd4707..8b18c4dbb9 100644
--- a/sysdeps/unix/sysv/linux/x86_64/brk.c
+++ b/sysdeps/unix/sysv/linux/x86_64/brk.c
@@ -1 +1,42 @@
-#include <sysdeps/unix/sysv/linux/hppa/brk.c>
+/* 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)
diff --git a/sysdeps/unix/sysv/linux/x86_64/clone.S b/sysdeps/unix/sysv/linux/x86_64/clone.S
index 9695e1eaf8..8a12b09035 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 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2004, 2005 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
- movq $SYS_ify(clone),%rax
+ movl $SYS_ify(clone),%eax
/* 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. */
- xorq %rbp, %rbp
+ xorl %ebp, %ebp
#ifdef RESET_PID
testq $CLONE_THREAD, %rdi
@@ -99,7 +99,7 @@ L(thread_start):
testq $CLONE_VM, %rdi
movl $-1, %eax
jne 2f
- movq $SYS_ify(getpid), %rax
+ movl $SYS_ify(getpid), %eax
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 7e26fecb3a..6662a94d09 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 b360b4288a..31455204c3 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 2f2c710040..4bbc7a4d2e 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 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -67,18 +67,22 @@ ENTRY(__getcontext)
/* Save the current signal mask with
rt_sigprocmask (SIG_BLOCK, NULL, set,_NSIG/8). */
leaq oSIGMASK(%rdi), %rdx
- xorq %rsi,%rsi
- movq $SIG_BLOCK, %rdi
- movq $_NSIG8,%r10
- movq $__NR_rt_sigprocmask, %rax
+ xorl %esi,%esi
+#if SIG_BLOCK == 0
+ xorl %edi, %edi
+#else
+ movl $SIG_BLOCK, %edi
+#endif
+ movl $_NSIG8,%r10d
+ movl $__NR_rt_sigprocmask, %eax
syscall
cmpq $-4095, %rax /* Check %rax for error. */
jae SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
/* All done, return 0 for success. */
- xorq %rax, %rax
+ xorl %eax, %eax
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 c763556b93..5deea7d1b2 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 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2002.
@@ -20,6 +20,7 @@
#include <sysdep.h>
#include <stdarg.h>
+#include <stdint.h>
#include <ucontext.h>
#include "ucontext_i.h"
@@ -52,28 +53,29 @@ void
__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
{
extern void __start_context (void);
- unsigned long *sp, idx_uc_link;
+ unsigned long int *sp, idx_uc_link;
va_list ap;
int i;
/* Generate room on stack for parameter if needed and uc_link. */
- sp = (long *) ((long) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
+ sp = (unsigned long int *) ((uintptr_t) 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 = (long *) ((((long) sp) & -16L) - 8);
+ sp = (unsigned long int *) ((((uintptr_t) 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) func;
+ ucp->uc_mcontext.gregs[REG_RIP] = (long int) func;
/* Setup rbx.*/
- ucp->uc_mcontext.gregs[REG_RBX] = (long) &sp[idx_uc_link];
- ucp->uc_mcontext.gregs[REG_RSP] = (long) sp;
+ ucp->uc_mcontext.gregs[REG_RBX] = (long int) &sp[idx_uc_link];
+ ucp->uc_mcontext.gregs[REG_RSP] = (long int) sp;
/* Setup stack. */
- sp[0] = (long) &__start_context;
- sp[idx_uc_link] = (long) ucp->uc_link;
+ sp[0] = (unsigned long int) &__start_context;
+ sp[idx_uc_link] = (unsigned long int) ucp->uc_link;
va_start (ap, argc);
/* Handle arguments. */
@@ -108,4 +110,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 c672f1df5a..5a49af3fa6 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 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2001, 2002, 2005 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 "sysdeps/generic/readelflib.c"
+#include "elf/readelflib.c"
#undef __ELF_NATIVE_CLASS
#undef process_elf_file
#define process_elf_file process_elf64_file
#define __ELF_NATIVE_CLASS 64
-#include "sysdeps/generic/readelflib.c"
+#include "elf/readelflib.c"
diff --git a/sysdeps/unix/sysv/linux/x86_64/setcontext.S b/sysdeps/unix/sysv/linux/x86_64/setcontext.S
index 65c03d8a01..61fc07f44f 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 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 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
- xorq %rdx, %rdx
- movq $SIG_SETMASK, %rdi
- movq $_NSIG8,%r10
- movq $__NR_rt_sigprocmask, %rax
+ xorl %edx, %edx
+ movl $SIG_SETMASK, %edi
+ movl $_NSIG8,%r10d
+ movl $__NR_rt_sigprocmask, %eax
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. */
- xorq %rax, %rax
+ xorl %eax, %eax
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 9123047092..d6f4558cef 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 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2005 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,6 +79,10 @@ __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
deleted file mode 100644
index 9c5c79e63e..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/sigsuspend.c
+++ /dev/null
@@ -1 +0,0 @@
-#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 4394e2ae9f..fc7996ccdc 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 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2005 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
- movq $SIG_SETMASK, %rdi
- movq $_NSIG8,%r10
- movq $__NR_rt_sigprocmask, %rax
+ movl $SIG_SETMASK, %edi
+ movl $_NSIG8,%r10d
+ movl $__NR_rt_sigprocmask, %eax
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. */
- xorq %rax, %rax
+ xorl %eax, %eax
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 cffddb58b3..02672d3c75 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 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2004,2005,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
@@ -98,9 +98,12 @@ 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). */
+ specifies the maximum wait time in milliseconds (-1 == infinite).
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
extern int epoll_wait (int __epfd, struct epoll_event *__events,
- int __maxevents, int __timeout) __THROW;
+ int __maxevents, int __timeout);
__END_DECLS
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysconf.c b/sysdeps/unix/sysv/linux/x86_64/sysconf.c
index 407fd46bc3..5a898b7857 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 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 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
@@ -45,11 +45,24 @@ 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 },
@@ -60,6 +73,7 @@ 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 },
@@ -87,6 +101,7 @@ 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)
{
@@ -113,6 +128,33 @@ 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;
@@ -149,7 +191,7 @@ intel_check_word (int name, unsigned int value, bool *has_level_2,
}
-static long int
+static long int __attribute__ ((noinline))
handle_intel (int name, unsigned int maxidx)
{
assert (maxidx >= 2);
@@ -206,7 +248,7 @@ handle_intel (int name, unsigned int maxidx)
}
-static long int
+static long int __attribute__ ((noinline))
handle_amd (int name)
{
unsigned int eax;
@@ -279,12 +321,6 @@ 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 fd92d7ae16..5dfffca455 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,02,03,04 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2004, 2005 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; \
- xorq %rdx, %rdx; \
+ xorl %edx, %edx; \
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;\
- xorq %rdx, %rdx; \
+ xorl %edx, %edx; \
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: \
- xorq %rdx, %rdx; \
+ xorl %edx, %edx; \
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; \
- xorq %rdx, %rdx; \
+ xorl %edx, %edx; \
subq %rax, %rdx; \
movl %edx, (%rcx); \
orq $-1, %rax; \
@@ -208,7 +208,7 @@
#undef DO_CALL
#define DO_CALL(syscall_name, args) \
DOARGS_##args \
- movq $SYS_ify (syscall_name), %rax; \
+ movl $SYS_ify (syscall_name), %eax; \
syscall;
#define DOARGS_0 /* nothing */
@@ -311,4 +311,31 @@
#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
deleted file mode 100644
index 5451a308ee..0000000000
--- a/sysdeps/unix/sysv/linux/x86_64/ucontext_i.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* 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
new file mode 100644
index 0000000000..b3cfe9aa4c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym
@@ -0,0 +1,34 @@
+#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 9a91ba5b2f..a17c5c5799 100644
--- a/sysdeps/unix/sysv/linux/x86_64/umount.c
+++ b/sysdeps/unix/sysv/linux/x86_64/umount.c
@@ -1 +1,31 @@
-#include <sysdeps/unix/sysv/linux/hppa/umount.c>
+/* 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);