Add thread-local storage support for arm:

- Switch to Variant I TCB layout
- Use function from rtld for TCB allocation/deallocation
This commit is contained in:
Oleksandr Tymoshenko 2012-02-14 00:17:43 +00:00
parent dc3b6c3aa0
commit 8ecdc98b5b
2 changed files with 5 additions and 4 deletions

View File

@ -37,14 +37,17 @@ _tcb_ctor(struct pthread *thread, int initial)
{
struct tcb *tcb;
tcb = malloc(sizeof(struct tcb));
tcb = _rtld_allocate_tls((initial) ? _tcb_get() : NULL,
sizeof(struct tcb), 16);
if (tcb)
tcb->tcb_thread = thread;
return (tcb);
}
void
_tcb_dtor(struct tcb *tcb)
{
free(tcb);
_rtld_free_tls(tcb, sizeof(struct tcb), 16);
}

View File

@ -43,10 +43,8 @@
* Variant II tcb, first two members are required by rtld.
*/
struct tcb {
struct tcb *tcb_self; /* required by rtld */
void *tcb_dtv; /* required by rtld */
struct pthread *tcb_thread; /* our hook */
void *tcb_spare[1];
};
/*