diff options
Diffstat (limited to 'sysdeps/i386/nptl')
-rw-r--r-- | sysdeps/i386/nptl/Makefile | 8 | ||||
-rw-r--r-- | sysdeps/i386/nptl/pthread-offsets.h | 5 | ||||
-rw-r--r-- | sysdeps/i386/nptl/pthread_spin_init.c | 2 | ||||
-rw-r--r-- | sysdeps/i386/nptl/pthread_spin_lock.S | 2 | ||||
-rw-r--r-- | sysdeps/i386/nptl/pthread_spin_unlock.S | 2 | ||||
-rw-r--r-- | sysdeps/i386/nptl/pthreaddef.h | 2 | ||||
-rw-r--r-- | sysdeps/i386/nptl/tcb-offsets.sym | 6 | ||||
-rw-r--r-- | sysdeps/i386/nptl/tls.h | 52 |
8 files changed, 27 insertions, 52 deletions
diff --git a/sysdeps/i386/nptl/Makefile b/sysdeps/i386/nptl/Makefile index eee3d75ed7..73024033ee 100644 --- a/sysdeps/i386/nptl/Makefile +++ b/sysdeps/i386/nptl/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2016 Free Software Foundation, Inc. +# Copyright (C) 2002-2018 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 @@ -18,9 +18,3 @@ ifeq ($(subdir),csu) gen-as-const-headers += tcb-offsets.sym endif - -ifeq ($(subdir),nptl) -CFLAGS-pthread_create.c += -mpreferred-stack-boundary=4 -CFLAGS-tst-align.c += -mpreferred-stack-boundary=4 -CFLAGS-tst-align2.c += -mpreferred-stack-boundary=4 -endif diff --git a/sysdeps/i386/nptl/pthread-offsets.h b/sysdeps/i386/nptl/pthread-offsets.h new file mode 100644 index 0000000000..9617354dc7 --- /dev/null +++ b/sysdeps/i386/nptl/pthread-offsets.h @@ -0,0 +1,5 @@ +#define __PTHREAD_MUTEX_NUSERS_OFFSET 16 +#define __PTHREAD_MUTEX_KIND_OFFSET 12 +#define __PTHREAD_MUTEX_SPINS_OFFSET 20 +#define __PTHREAD_MUTEX_ELISION_OFFSET 22 +#define __PTHREAD_MUTEX_LIST_OFFSET 20 diff --git a/sysdeps/i386/nptl/pthread_spin_init.c b/sysdeps/i386/nptl/pthread_spin_init.c index b9b33719fd..1c49df4f03 100644 --- a/sysdeps/i386/nptl/pthread_spin_init.c +++ b/sysdeps/i386/nptl/pthread_spin_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2016 Free Software Foundation, Inc. +/* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/sysdeps/i386/nptl/pthread_spin_lock.S b/sysdeps/i386/nptl/pthread_spin_lock.S index e311d957d4..1980fec75f 100644 --- a/sysdeps/i386/nptl/pthread_spin_lock.S +++ b/sysdeps/i386/nptl/pthread_spin_lock.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2012-2016 Free Software Foundation, Inc. +/* Copyright (C) 2012-2018 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 diff --git a/sysdeps/i386/nptl/pthread_spin_unlock.S b/sysdeps/i386/nptl/pthread_spin_unlock.S index a552cf92c1..2e7108604c 100644 --- a/sysdeps/i386/nptl/pthread_spin_unlock.S +++ b/sysdeps/i386/nptl/pthread_spin_unlock.S @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2016 Free Software Foundation, Inc. +/* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/sysdeps/i386/nptl/pthreaddef.h b/sysdeps/i386/nptl/pthreaddef.h index c22a6e1d10..deacd92edf 100644 --- a/sysdeps/i386/nptl/pthreaddef.h +++ b/sysdeps/i386/nptl/pthreaddef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2016 Free Software Foundation, Inc. +/* Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. diff --git a/sysdeps/i386/nptl/tcb-offsets.sym b/sysdeps/i386/nptl/tcb-offsets.sym index 7bdf161b29..2ec9e787c1 100644 --- a/sysdeps/i386/nptl/tcb-offsets.sym +++ b/sysdeps/i386/nptl/tcb-offsets.sym @@ -4,7 +4,6 @@ RESULT offsetof (struct pthread, result) TID offsetof (struct pthread, tid) -PID offsetof (struct pthread, pid) CANCELHANDLING offsetof (struct pthread, cancelhandling) CLEANUP_JMP_BUF offsetof (struct pthread, cleanup_jmp_buf) MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads) @@ -13,6 +12,5 @@ CLEANUP offsetof (struct pthread, cleanup) CLEANUP_PREV offsetof (struct _pthread_cleanup_buffer, __prev) MUTEX_FUTEX offsetof (pthread_mutex_t, __data.__lock) POINTER_GUARD offsetof (tcbhead_t, pointer_guard) -#ifndef __ASSUME_PRIVATE_FUTEX -PRIVATE_FUTEX offsetof (tcbhead_t, private_futex) -#endif +FEATURE_1_OFFSET offsetof (tcbhead_t, feature_1) +SSP_BASE_OFFSET offsetof (tcbhead_t, ssp_base) diff --git a/sysdeps/i386/nptl/tls.h b/sysdeps/i386/nptl/tls.h index a6dfa9b377..12285d3217 100644 --- a/sysdeps/i386/nptl/tls.h +++ b/sysdeps/i386/nptl/tls.h @@ -1,5 +1,5 @@ /* Definition for thread-local data handling. nptl/i386 version. - Copyright (C) 2002-2016 Free Software Foundation, Inc. + Copyright (C) 2002-2018 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 @@ -26,21 +26,9 @@ # include <stdint.h> # include <stdlib.h> # include <sysdep.h> -# include <libc-internal.h> +# include <libc-pointer-arith.h> /* For cast_to_integer. */ # include <kernel-features.h> - - -/* Type for the dtv. */ -typedef union dtv -{ - size_t counter; - struct - { - void *val; - bool is_static; - } pointer; -} dtv_t; - +# include <dl-dtv.h> typedef struct { @@ -53,17 +41,22 @@ typedef struct uintptr_t stack_guard; uintptr_t pointer_guard; int gscope_flag; -#ifndef __ASSUME_PRIVATE_FUTEX - int private_futex; -#else - int __glibc_reserved1; -#endif + /* Bit 0: X86_FEATURE_1_IBT. + Bit 1: X86_FEATURE_1_SHSTK. + */ + unsigned int feature_1; /* Reservation of some values for the TM ABI. */ - void *__private_tm[4]; + void *__private_tm[3]; /* GCC split stack support. */ void *__private_ss; + /* The lowest address of shadow stack, */ + unsigned long ssp_base; } tcbhead_t; +/* morestack.S in libgcc uses offset 0x30 to access __private_ss, */ +_Static_assert (offsetof (tcbhead_t, __private_ss) == 0x30, + "offset of __private_ss != 0x30"); + # define TLS_MULTIPLE_THREADS_IN_TCB 1 #else /* __ASSEMBLER__ */ @@ -406,22 +399,6 @@ tls_fill_user_desc (union user_desc_init *desc, abort (); }) -/* Call the user-provided thread function. */ -#define CALL_THREAD_FCT(descr) \ - ({ void *__res; \ - int __ignore1, __ignore2; \ - asm volatile ("pushl %%eax\n\t" \ - "pushl %%eax\n\t" \ - "pushl %%eax\n\t" \ - "pushl %%gs:%P4\n\t" \ - "call *%%gs:%P3\n\t" \ - "addl $16, %%esp" \ - : "=a" (__res), "=c" (__ignore1), "=d" (__ignore2) \ - : "i" (offsetof (struct pthread, start_routine)), \ - "i" (offsetof (struct pthread, arg))); \ - __res; }) - - /* Set the stack guard field in TCB head. */ #define THREAD_SET_STACK_GUARD(value) \ THREAD_SETMEM (THREAD_SELF, header.stack_guard, value) @@ -439,6 +416,7 @@ tls_fill_user_desc (union user_desc_init *desc, /* Get and set the global scope generation counter in the TCB head. */ +#define THREAD_GSCOPE_IN_TCB 1 #define THREAD_GSCOPE_FLAG_UNUSED 0 #define THREAD_GSCOPE_FLAG_USED 1 #define THREAD_GSCOPE_FLAG_WAIT 2 |