Changes in uspace/lib/c/generic/tls.c [63f8966:31399f3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/tls.c
r63f8966 r31399f3 42 42 #include <str.h> 43 43 #include <align.h> 44 #include <unistd.h> 44 45 45 46 /** Create TLS (Thread Local Storage) data structures. … … 50 51 * @return Pointer to TCB. 51 52 */ 52 tcb_t * __make_tls(void)53 tcb_t *tls_make(void) 53 54 { 54 55 void *data; … … 56 57 size_t tls_size = &_tbss_end - &_tdata_start; 57 58 58 tcb = __alloc_tls(&data, tls_size); 59 tcb = tls_alloc_arch(&data, tls_size); 60 if (!tcb) 61 return NULL; 59 62 60 63 /* … … 71 74 } 72 75 73 void __free_tls(tcb_t *tcb)76 void tls_free(tcb_t *tcb) 74 77 { 75 78 size_t tls_size = &_tbss_end - &_tdata_start; 76 __free_tls_arch(tcb, tls_size);79 tls_free_arch(tcb, tls_size); 77 80 } 78 81 … … 89 92 90 93 result = malloc(sizeof(tcb_t) + size); 94 if (!result) 95 return NULL; 91 96 *data = ((void *)result) + sizeof(tcb_t); 97 92 98 return result; 93 99 } … … 118 124 size = ALIGN_UP(size, &_tls_alignment); 119 125 *data = memalign((uintptr_t) &_tls_alignment, sizeof(tcb_t) + size); 120 126 if (!*data) 127 return NULL; 121 128 tcb = (tcb_t *) (*data + size); 122 129 tcb->self = tcb;
Note:
See TracChangeset
for help on using the changeset viewer.