Rev 1864 | Rev 2071 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1864 | Rev 2061 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | */ |
35 | */ |
36 | 36 | ||
37 | #include <thread.h> |
37 | #include <thread.h> |
38 | #include <malloc.h> |
38 | #include <malloc.h> |
39 | 39 | ||
- | 40 | /* |
|
- | 41 | * sparc64 uses thread-local storage data structures, variant II, as described |
|
- | 42 | * in: |
|
- | 43 | * Drepper U.: ELF Handling For Thread-Local Storage, 2005 |
|
- | 44 | */ |
|
- | 45 | ||
40 | /** Allocate TLS & TCB for initial module threads |
46 | /** Allocate TLS variant II data structures for a thread. |
- | 47 | * |
|
- | 48 | * Only static model is supported. |
|
41 | * |
49 | * |
- | 50 | * @param data Pointer to pointer to thread local data. This is actually an |
|
- | 51 | * output argument. |
|
42 | * @param data Start of data section |
52 | * @param size Size of thread local data. |
43 | * @return pointer to tcb_t structure |
53 | * @return Pointer to TCB structure. |
44 | */ |
54 | */ |
45 | tcb_t * __alloc_tls(void **data, size_t size) |
55 | tcb_t * __alloc_tls(void **data, size_t size) |
46 | { |
56 | { |
47 | tcb_t *tcb; |
57 | tcb_t *tcb; |
48 | 58 | ||
Line 52... | Line 62... | ||
52 | tcb->self = tcb; |
62 | tcb->self = tcb; |
53 | 63 | ||
54 | return tcb; |
64 | return tcb; |
55 | } |
65 | } |
56 | 66 | ||
- | 67 | /** Free TLS variant II data structures of a thread. |
|
- | 68 | * |
|
- | 69 | * Only static model is supported. |
|
- | 70 | * |
|
- | 71 | * @param tcb Pointer to TCB structure. |
|
- | 72 | * @param size Size of thread local data. |
|
- | 73 | */ |
|
57 | void __free_tls_arch(tcb_t *tcb, size_t size) |
74 | void __free_tls_arch(tcb_t *tcb, size_t size) |
58 | { |
75 | { |
59 | void *start = ((void *)tcb) - size; |
76 | void *start = ((void *) tcb) - size; |
60 | free(start); |
77 | free(start); |
61 | } |
78 | } |