Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/amd64/src/tls.c

    rae7d03c rd3e938c  
    3838#include <stddef.h>
    3939
     40#ifdef CONFIG_RTLD
     41#include <rtld/rtld.h>
     42#endif
     43
    4044tcb_t *tls_alloc_arch(size_t size, size_t align)
    4145{
     
    4852}
    4953
     54/*
     55 * Rtld TLS support
     56 */
     57
     58typedef struct {
     59        unsigned long int ti_module;
     60        unsigned long int ti_offset;
     61} tls_index;
     62
     63void __attribute__((__regparm__(1)))
     64    *__tls_get_addr(tls_index *ti);
     65
     66void __attribute__((__regparm__(1)))
     67    *__tls_get_addr(tls_index *ti)
     68{
     69        uint8_t *tls;
     70
     71#ifdef CONFIG_RTLD
     72        if (runtime_env != NULL) {
     73                return rtld_tls_get_addr(runtime_env, __tcb_get(),
     74                    ti->ti_module, ti->ti_offset);
     75        }
     76#endif
     77        /* Get address of static TLS block */
     78        tls = tls_get();
     79        return tls + ti->ti_offset;
     80}
     81
    5082/** @}
    5183 */
Note: See TracChangeset for help on using the changeset viewer.