Changeset cfa70add in mainline for uspace/libc/arch/sparc64/src/thread.c
- Timestamp:
- 2006-09-03T23:37:14Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fd85ae5
- Parents:
- 002e613
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/libc/arch/sparc64/src/thread.c
r002e613 rcfa70add 27 27 */ 28 28 29 /** @addtogroup libcsparc64 29 /** @addtogroup libcsparc64 sparc64 30 * @ingroup lc 30 31 * @{ 31 32 */ 32 33 /** @file 34 * 33 35 */ 34 36 … … 40 42 * @param data Start of data section 41 43 * @return pointer to tcb_t structure 42 *43 44 */ 44 45 tcb_t * __alloc_tls(void **data, size_t size) 45 46 { 46 tcb_t *result; 47 tcb_t *tcb; 48 49 *data = malloc(sizeof(tcb_t) + size); 47 50 48 result = malloc(sizeof(tcb_t) + size); 49 *data = ((void *)result) + sizeof(tcb_t); 50 return result; 51 tcb = (tcb_t *) (*data + size); 52 tcb->self = tcb; 53 54 return tcb; 51 55 } 52 56 53 57 void __free_tls_arch(tcb_t *tcb, size_t size) 54 58 { 55 free(tcb); 59 void *start = ((void *)tcb) - size; 60 free(start); 56 61 } 57 62
Note:
See TracChangeset
for help on using the changeset viewer.