Changeset 1ea99cc in mainline for uspace/lib/libc/arch/ia32/src/tls.c
- Timestamp:
- 2009-08-20T20:47:35Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b50b5af2
- Parents:
- 24edc18
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/arch/ia32/src/tls.c
r24edc18 r1ea99cc 37 37 #include <tls.h> 38 38 #include <sys/types.h> 39 #include <align.h> 39 40 40 41 tcb_t * __alloc_tls(void **data, size_t size) … … 48 49 } 49 50 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 50 78 /** @} 51 79 */
Note:
See TracChangeset
for help on using the changeset viewer.