mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-05 01:00:14 +00:00
* sysdeps/unix/sysv/linux/x86_64/bits/mman.h: Define MAP_STACK.
* sysdeps/unix/sysv/linux/i386/bits/mman.h: Likewise.
This commit is contained in:
parent
62a1ffc6fa
commit
965805e888
@ -1,3 +1,8 @@
|
|||||||
|
2008-08-15 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/x86_64/bits/mman.h: Define MAP_STACK.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/bits/mman.h: Likewise.
|
||||||
|
|
||||||
2008-08-14 Ulrich Drepper <drepper@redhat.com>
|
2008-08-14 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* sysdeps/x86_64/memset.S: Reduce size of tables for PIC.
|
* sysdeps/x86_64/memset.S: Reduce size of tables for PIC.
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
2008-08-15 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/x86_64/pthreaddef.h: Remove ARCH_MAP_FLAGS and
|
||||||
|
ARCH_RETRY_MMAP definitions.
|
||||||
|
* allocatestack.c: Remove definition of ARCH_MAP_FLAGS.
|
||||||
|
Define MAP_STACK when not defined.
|
||||||
|
(allocate_stack): Use MAP_STACK instead of ARCH_MAP_FLAGS. Remove
|
||||||
|
handling of ARCH_RETRY_MMAP.
|
||||||
|
|
||||||
2008-07-30 Ulrich Drepper <drepper@redhat.com>
|
2008-07-30 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* tst-align2.c (f): Print message that f is reached.
|
* tst-align2.c (f): Print message that f is reached.
|
||||||
|
@ -84,10 +84,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Let the architecture add some flags to the mmap() call used to
|
/* Newer kernels have the MAP_STACK flag to indicate a mapping is used for
|
||||||
allocate stacks. */
|
a stack. Use it when possible. */
|
||||||
#ifndef ARCH_MAP_FLAGS
|
#ifndef MAP_STACK
|
||||||
# define ARCH_MAP_FLAGS 0
|
# define MAP_STACK 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This yields the pointer that TLS support code calls the thread pointer. */
|
/* This yields the pointer that TLS support code calls the thread pointer. */
|
||||||
@ -454,21 +454,15 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
mem = mmap (NULL, size, prot,
|
mem = mmap (NULL, size, prot,
|
||||||
MAP_PRIVATE | MAP_ANONYMOUS | ARCH_MAP_FLAGS, -1, 0);
|
MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);
|
||||||
|
|
||||||
if (__builtin_expect (mem == MAP_FAILED, 0))
|
if (__builtin_expect (mem == MAP_FAILED, 0))
|
||||||
{
|
{
|
||||||
#ifdef ARCH_RETRY_MMAP
|
|
||||||
mem = ARCH_RETRY_MMAP (size, prot);
|
|
||||||
if (__builtin_expect (mem == MAP_FAILED, 0))
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
if (errno == ENOMEM)
|
if (errno == ENOMEM)
|
||||||
errno = EAGAIN;
|
__set_errno (EAGAIN);
|
||||||
|
|
||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* SIZE is guaranteed to be greater than zero.
|
/* SIZE is guaranteed to be greater than zero.
|
||||||
So we can never get a null pointer back from mmap. */
|
So we can never get a null pointer back from mmap. */
|
||||||
|
@ -36,16 +36,6 @@
|
|||||||
({ char *frame; asm ("movq %%rsp, %0" : "=r" (frame)); frame; })
|
({ char *frame; asm ("movq %%rsp, %0" : "=r" (frame)); frame; })
|
||||||
|
|
||||||
|
|
||||||
/* We prefer to have the stack allocated in the low 4GB since this
|
|
||||||
allows faster context switches. */
|
|
||||||
#define ARCH_MAP_FLAGS MAP_32BIT
|
|
||||||
|
|
||||||
/* If it is not possible to allocate memory there retry without that
|
|
||||||
flag. */
|
|
||||||
#define ARCH_RETRY_MMAP(size, prot) \
|
|
||||||
mmap (NULL, size, prot, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)
|
|
||||||
|
|
||||||
|
|
||||||
/* XXX Until we have a better place keep the definitions here. */
|
/* XXX Until we have a better place keep the definitions here. */
|
||||||
|
|
||||||
/* While there is no such syscall. */
|
/* While there is no such syscall. */
|
||||||
|
@ -63,6 +63,7 @@
|
|||||||
# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */
|
# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */
|
||||||
# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */
|
# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */
|
||||||
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
|
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
|
||||||
|
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Flags to `msync'. */
|
/* Flags to `msync'. */
|
||||||
|
@ -64,6 +64,7 @@
|
|||||||
# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */
|
# define MAP_NORESERVE 0x04000 /* Don't check for reservations. */
|
||||||
# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */
|
# define MAP_POPULATE 0x08000 /* Populate (prefault) pagetables. */
|
||||||
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
|
# define MAP_NONBLOCK 0x10000 /* Do not block on IO. */
|
||||||
|
# define MAP_STACK 0x20000 /* Allocation is for a stack. */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Flags to `msync'. */
|
/* Flags to `msync'. */
|
||||||
|
Loading…
Reference in New Issue
Block a user