mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-10 05:03:06 +03:00
nptl: Increase default TCB alignment to 32
rseq support will use a 32-byte aligned field in struct pthread, so the whole struct needs to have at least that alignment. nptl/tst-tls3mod.c uses TCB_ALIGNMENT, therefore include <descr.h> to obtain the fallback definition. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
This commit is contained in:
@@ -36,7 +36,9 @@
|
|||||||
#include <tls-internal-struct.h>
|
#include <tls-internal-struct.h>
|
||||||
|
|
||||||
#ifndef TCB_ALIGNMENT
|
#ifndef TCB_ALIGNMENT
|
||||||
# define TCB_ALIGNMENT sizeof (double)
|
# define TCB_ALIGNMENT 32
|
||||||
|
#elif TCB_ALIGNMENT < 32
|
||||||
|
# error TCB_ALIGNMENT must be at least 32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <pthreaddef.h>
|
#include <pthreaddef.h>
|
||||||
|
#include <descr.h>
|
||||||
|
|
||||||
|
|
||||||
extern pthread_barrier_t b;
|
extern pthread_barrier_t b;
|
||||||
|
@@ -28,8 +28,5 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 2048
|
#define MINIMAL_REST_STACK 2048
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 16
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
||||||
|
@@ -27,8 +27,5 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 4096
|
#define MINIMAL_REST_STACK 4096
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 16
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
||||||
|
@@ -28,8 +28,5 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 2048
|
#define MINIMAL_REST_STACK 2048
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 4
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
||||||
|
@@ -28,9 +28,6 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 2048
|
#define MINIMAL_REST_STACK 2048
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 16
|
|
||||||
|
|
||||||
|
|
||||||
/* Location of current stack frame.
|
/* Location of current stack frame.
|
||||||
|
|
||||||
|
@@ -28,8 +28,5 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 2048
|
#define MINIMAL_REST_STACK 2048
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 8
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
||||||
|
@@ -30,9 +30,6 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 16384
|
#define MINIMAL_REST_STACK 16384
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 16
|
|
||||||
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME __stack_pointer
|
#define CURRENT_STACK_FRAME __stack_pointer
|
||||||
|
@@ -27,9 +27,6 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 2048
|
#define MINIMAL_REST_STACK 2048
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 16
|
|
||||||
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
||||||
|
@@ -31,8 +31,5 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 2048
|
#define MINIMAL_REST_STACK 2048
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 16
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
||||||
|
@@ -27,9 +27,6 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 2048
|
#define MINIMAL_REST_STACK 2048
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 16
|
|
||||||
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
||||||
|
@@ -28,8 +28,5 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 2048
|
#define MINIMAL_REST_STACK 2048
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 4
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
||||||
|
@@ -28,9 +28,6 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 4096
|
#define MINIMAL_REST_STACK 4096
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 16
|
|
||||||
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
||||||
|
@@ -28,8 +28,5 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 2048
|
#define MINIMAL_REST_STACK 2048
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 16
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
||||||
|
@@ -28,9 +28,6 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 2048
|
#define MINIMAL_REST_STACK 2048
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 16
|
|
||||||
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
||||||
|
@@ -29,9 +29,6 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 2048
|
#define MINIMAL_REST_STACK 2048
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 8
|
|
||||||
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
||||||
|
@@ -27,9 +27,6 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 2048
|
#define MINIMAL_REST_STACK 2048
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 16
|
|
||||||
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
|
#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))
|
||||||
|
@@ -27,10 +27,6 @@
|
|||||||
/* Minimal stack size after allocating thread descriptor and guard size. */
|
/* Minimal stack size after allocating thread descriptor and guard size. */
|
||||||
#define MINIMAL_REST_STACK 4096
|
#define MINIMAL_REST_STACK 4096
|
||||||
|
|
||||||
/* Alignment requirement for TCB. */
|
|
||||||
#define TCB_ALIGNMENT 16
|
|
||||||
|
|
||||||
|
|
||||||
/* Location of current stack frame. */
|
/* Location of current stack frame. */
|
||||||
#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
|
#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
|
||||||
register char *stack_pointer __asm__("%sp");
|
register char *stack_pointer __asm__("%sp");
|
||||||
|
Reference in New Issue
Block a user