Changeset 2c2295ab in mainline
- Timestamp:
- 2007-10-28T21:03:02Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8ecba18b
- Parents:
- 941cc8b
- Location:
- uspace/lib/libc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/arch/amd64/src/thread.c
r941cc8b r2c2295ab 37 37 #include <thread.h> 38 38 #include <malloc.h> 39 #include <align.h> 39 40 40 41 /** Allocate TLS & TCB for initial module threads … … 47 48 tcb_t *tcb; 48 49 49 *data = malloc(sizeof(tcb_t) + size); 50 size = ALIGN_UP(size, &_tls_alignment); 51 *data = memalign(&_tls_alignment, sizeof(tcb_t) + size); 50 52 51 53 tcb = (tcb_t *) (*data + size); … … 57 59 void __free_tls_arch(tcb_t *tcb, size_t size) 58 60 { 61 size = ALIGN_UP(size, &_tls_alignment); 59 62 void *start = ((void *)tcb) - size; 60 63 free(start); -
uspace/lib/libc/arch/sparc64/src/thread.c
r941cc8b r2c2295ab 37 37 #include <thread.h> 38 38 #include <malloc.h> 39 #include <align.h> 39 40 40 41 /* … … 57 58 tcb_t *tcb; 58 59 59 *data = malloc(sizeof(tcb_t) + size); 60 size = ALIGN_UP(size, &_tls_alignment); 61 *data = memalign(&_tls_alignment, sizeof(tcb_t) + size); 60 62 61 63 tcb = (tcb_t *) (*data + size); … … 74 76 void __free_tls_arch(tcb_t *tcb, size_t size) 75 77 { 78 size = ALIGN_UP(size, &_tls_alignment); 76 79 void *start = ((void *) tcb) - size; 77 80 free(start); -
uspace/lib/libc/include/thread.h
r941cc8b r2c2295ab 42 42 typedef uint64_t thread_id_t; 43 43 44 extern char _tls_alignment; 45 44 46 extern void __thread_entry(void); 45 47 extern void __thread_main(uspace_arg_t *uarg);
Note:
See TracChangeset
for help on using the changeset viewer.