mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-04 09:50:43 +08:00
Stub out VX_ENTER_TLS_DTOR for VxWorks != 6
As of today, the __gthread_enter/leave entry points are only meaningful on VxWorks 6. Refactor the VX_ENTER_TLS_DTOR macros accordingly. 2020-10-15 Rasmus Villemoes <rv@rasmusvillemoes.dk> libgcc/ * config/gthr-vxworks-tls.c (VX_ENTER_TLS_DTOR): Nil except on VxWorks 6. Co-authored-by: Olivier Hainque <hainque@adacore.com>
This commit is contained in:
parent
2d23fd23bb
commit
4cde835fd7
@ -94,7 +94,9 @@ static int self_owner;
|
||||
static volatile int delete_hook_installed;
|
||||
|
||||
/* TLS data access internal API. A straight __thread variable starting with
|
||||
VxWorks 7, a pointer returned by kernel provided routines otherwise. */
|
||||
VxWorks 7, a pointer returned by kernel provided routines otherwise. And
|
||||
on VxWorks 6, the kernel expects us to notify entry/exit of regions
|
||||
handling such variables by calls to kernel provided __gthread routines. */
|
||||
|
||||
#if _VXWORKS_MAJOR_GE(7)
|
||||
|
||||
@ -103,23 +105,29 @@ static __thread struct tls_data *__gthread_tls_data;
|
||||
#define VX_GET_TLS_DATA() __gthread_tls_data
|
||||
#define VX_SET_TLS_DATA(x) __gthread_tls_data = (x)
|
||||
|
||||
#define VX_ENTER_TLS_DTOR()
|
||||
#define VX_LEAVE_TLS_DTOR()
|
||||
|
||||
#else
|
||||
|
||||
extern void *__gthread_get_tls_data (void);
|
||||
extern void __gthread_set_tls_data (void *data);
|
||||
|
||||
extern void __gthread_enter_tls_dtor_context (void);
|
||||
extern void __gthread_leave_tls_dtor_context (void);
|
||||
|
||||
#define VX_GET_TLS_DATA() __gthread_get_tls_data()
|
||||
#define VX_SET_TLS_DATA(x) __gthread_set_tls_data(x)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _VXWORKS_MAJOR_EQ(6)
|
||||
|
||||
extern void __gthread_enter_tls_dtor_context (void);
|
||||
extern void __gthread_leave_tls_dtor_context (void);
|
||||
|
||||
#define VX_ENTER_TLS_DTOR() __gthread_enter_tls_dtor_context ()
|
||||
#define VX_LEAVE_TLS_DTOR() __gthread_leave_tls_dtor_context ()
|
||||
|
||||
#else
|
||||
|
||||
#define VX_ENTER_TLS_DTOR()
|
||||
#define VX_LEAVE_TLS_DTOR()
|
||||
|
||||
#endif
|
||||
|
||||
/* This is a global structure which records all of the active keys.
|
||||
|
Loading…
x
Reference in New Issue
Block a user