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