Changeset d2bb25e7 in mainline for uspace/lib/c/generic/tls.c


Ignore:
Timestamp:
2016-05-17T22:51:37Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9c07c3d
Parents:
e2f26002
Message:

Use DTVs. symbol_get_addr() should not implicitly read current thread pointer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/tls.c

    re2f26002 rd2bb25e7  
    9797void tls_free(tcb_t *tcb)
    9898{
     99        free(tcb->dtv);
    99100        tls_free_arch(tcb, tls_get_size());
    100101}
     
    109110tcb_t *tls_alloc_variant_1(void **data, size_t size)
    110111{
    111         tcb_t *result;
     112        tcb_t *tcb;
    112113
    113         result = malloc(sizeof(tcb_t) + size);
    114         if (!result)
     114        tcb = malloc(sizeof(tcb_t) + size);
     115        if (!tcb)
    115116                return NULL;
    116         *data = ((void *)result) + sizeof(tcb_t);
     117        *data = ((void *)tcb) + sizeof(tcb_t);
     118        tcb->dtv = NULL;
    117119
    118         return result;
     120        return tcb;
    119121}
    120122
     
    147149        tcb = (tcb_t *) (*data + size);
    148150        tcb->self = tcb;
     151        tcb->dtv = NULL;
    149152
    150153        return tcb;
Note: See TracChangeset for help on using the changeset viewer.