feat(thread): futex + TLS + pthread_self substrate
This commit is contained in:
@@ -74,6 +74,9 @@
|
||||
|
||||
#include "../internal/errno.h" /* VLIBC_TCB_ERRNO_OFF */
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define VLIBC_TCB_SELF_OFF 0
|
||||
|
||||
/* VLIBC_TCB_ERRNO_OFF (8) is consumed from src/internal/errno.h. */
|
||||
@@ -84,4 +87,31 @@
|
||||
|
||||
#define VLIBC_TCB_SIZE 24
|
||||
|
||||
/*
|
||||
* New-thread TLS geometry (todo 44). All four are set by init_main_tls()
|
||||
* in src/start/tls.c and read by src/thread/tls.c (__vlibc_tls_setup):
|
||||
*
|
||||
* __vlibc_static_tls_size PT_TLS p_memsz of the main executable — the
|
||||
* one DEFAULT-VISIBILITY EXPORTED symbol of
|
||||
* the group: #62 grows it on dlopen, #45 reads
|
||||
* it when sizing new-thread TLS blocks.
|
||||
* __vlibc_static_tls_filesz PT_TLS p_filesz (.tdata part).
|
||||
* __vlibc_static_tls_align PT_TLS p_align (16 when there is no PT_TLS).
|
||||
* __vlibc_static_tls_template the PRIMAL TLS image address: the mapped
|
||||
* .tdata at p_vaddr, never the main thread's
|
||||
* LIVE TLS block (which mutates). In the
|
||||
* file-fallback path it is the main block
|
||||
* itself — the only copy that exists then.
|
||||
*
|
||||
* The three hidden ones keep their attribute on the definitions (as with
|
||||
* environ's hidden alias in src/start/environ.c); __vlibc_static_tls_size
|
||||
* deliberately carries none so it stays an exported ABI object.
|
||||
*/
|
||||
// NOLINTBEGIN(bugprone-reserved-identifier)
|
||||
extern size_t __vlibc_static_tls_size;
|
||||
extern uintptr_t __vlibc_static_tls_template;
|
||||
extern size_t __vlibc_static_tls_filesz;
|
||||
extern size_t __vlibc_static_tls_align;
|
||||
// NOLINTEND(bugprone-reserved-identifier)
|
||||
|
||||
#endif /* VLIBC_INTERNAL_START_TCB_H */
|
||||
|
||||
Reference in New Issue
Block a user