Changeset a949f4a in mainline for uspace/lib/c/arch/ia64/src/tls.c


Ignore:
Timestamp:
2019-07-16T15:07:01Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2cc569a3, 9fb280c
Parents:
fa603e99
git-author:
Jiri Svoboda <jiri@…> (2019-07-15 17:03:31)
git-committer:
Jiri Svoboda <jiri@…> (2019-07-16 15:07:01)
Message:

Dynamic linking on IA-64 (WIP)

File:
1 edited

Legend:

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

    rfa603e99 ra949f4a  
    11/*
     2 * Copyright (c) 2019 Jiri Svoboda
    23 * Copyright (c) 2006 Ondrej Palkovsky
    34 * All rights reserved.
     
    3738#include <tls.h>
    3839
     40#ifdef CONFIG_RTLD
     41#include <rtld/rtld.h>
     42#endif
     43
    3944tcb_t *tls_alloc_arch(size_t size, size_t align)
    4045{
     
    4752}
    4853
     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 *__tls_get_addr(tls_index *ti);
     64
     65void *__tls_get_addr(tls_index *ti)
     66{
     67        uint8_t *tls;
     68
     69#ifdef CONFIG_RTLD
     70        if (runtime_env != NULL) {
     71                return rtld_tls_get_addr(runtime_env, __tcb_get(),
     72                    ti->ti_module, ti->ti_offset);
     73        }
     74#endif
     75        /* Get address of static TLS block */
     76        tls = tls_get();
     77        return tls + ti->ti_offset;
     78}
     79
    4980/** @}
    5081 */
Note: See TracChangeset for help on using the changeset viewer.