Ignore:
File:
1 edited

Legend:

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

    r1ea99cc rfa23560  
    3737#include <tls.h>
    3838#include <sys/types.h>
    39 #include <align.h>
    4039
    4140tcb_t * __alloc_tls(void **data, size_t size)
     
    4948}
    5049
    51 //#ifdef __SHARED__
    52 
    53 typedef struct {
    54         unsigned long int ti_module;
    55         unsigned long int ti_offset;
    56 } tls_index;
    57 
    58 void __attribute__ ((__regparm__ (1)))
    59     *___tls_get_addr(tls_index *ti);
    60 
    61 void __attribute__ ((__regparm__ (1)))
    62     *___tls_get_addr(tls_index *ti)
    63 {
    64         size_t tls_size;
    65         uint8_t *tls;
    66 
    67         /* Calculate size of TLS block */
    68         tls_size = ALIGN_UP(&_tbss_end - &_tdata_start, &_tls_alignment);
    69 
    70         /* The TLS block is just before TCB */
    71         tls = (uint8_t *)__tcb_get() - tls_size;
    72 
    73         return tls + ti->ti_offset;
    74 }
    75 
    76 //#endif
    77 
    7850/** @}
    7951 */
Note: See TracChangeset for help on using the changeset viewer.