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


Ignore:
Timestamp:
2011-05-17T07:44:17Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
04c418d, 2586860, 5e6e50b
Parents:
72cd53d (diff), 0d8a304 (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 mainline changes

Conflicts:
kernel/generic/src/console/console.c

size of klog, taken upstream

uspace/app/klog/klog.c

taken upstream (upstream fixed the broken output on huge load)

uspace/app/tester/Makefile
uspace/app/tester/tester.c
uspace/app/tester/tester.h

merged without problems

uspace/lib/c/include/as.h

merged without problems (upstream use bare declarations)

Also needed to fix some missing includes.

File:
1 edited

Legend:

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

    r72cd53d r3375bd4  
    3737#include <tls.h>
    3838#include <sys/types.h>
     39#include <align.h>
    3940
    4041tcb_t * __alloc_tls(void **data, size_t size)
     
    4849}
    4950
     51/*
     52 * Rtld TLS support
     53 */
     54
     55typedef struct {
     56        unsigned long int ti_module;
     57        unsigned long int ti_offset;
     58} tls_index;
     59
     60void __attribute__ ((__regparm__ (1)))
     61    *___tls_get_addr(tls_index *ti);
     62
     63void __attribute__ ((__regparm__ (1)))
     64    *___tls_get_addr(tls_index *ti)
     65{
     66        size_t tls_size;
     67        uint8_t *tls;
     68
     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
     75        return tls + ti->ti_offset;
     76}
     77
    5078/** @}
    5179 */
Note: See TracChangeset for help on using the changeset viewer.