Changeset f570cdf in mainline for uspace/lib/c/arch/ia32/src/tls.c


Ignore:
Timestamp:
2016-05-24T15:32:57Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c170438
Parents:
dcc150cb (diff), 0a981e3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with mainline

File:
1 edited

Legend:

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

    rdcc150cb rf570cdf  
    11/*
    22 * Copyright (c) 2006 Ondrej Palkovsky
     3 * Copyright (c) 2016 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    3940#include <align.h>
    4041
     42#ifdef CONFIG_RTLD
     43#include <rtld/rtld.h>
     44#endif
     45
    4146tcb_t *tls_alloc_arch(void **data, size_t size)
    4247{
     
    6469    *___tls_get_addr(tls_index *ti)
    6570{
    66         size_t tls_size;
    6771        uint8_t *tls;
    6872
    69         /* Calculate size of TLS block */
    70         tls_size = ALIGN_UP(&_tbss_end - &_tdata_start, &_tls_alignment);
    71 
    72         /* The TLS block is just before TCB */
    73         tls = (uint8_t *)__tcb_get() - tls_size;
    74 
     73#ifdef CONFIG_RTLD
     74        if (runtime_env != NULL) {
     75                return rtld_tls_get_addr(runtime_env, __tcb_get(),
     76                    ti->ti_module, ti->ti_offset);
     77        }
     78#endif
     79        /* Get address of static TLS block */
     80        tls = tls_get();
    7581        return tls + ti->ti_offset;
    7682}
Note: See TracChangeset for help on using the changeset viewer.