Subversion Repositories HelenOS

Rev

Rev 2479 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2479 Rev 2586
Line 30... Line 30...
30
 * @{
30
 * @{
31
 */
31
 */
32
/** @file
32
/** @file
33
 */
33
 */
34
 
34
 
35
#include <thread.h>
35
#include <tls.h>
36
#include <malloc.h>
36
#include <sys/types.h>
37
 
37
 
38
/** Allocate TLS & TCB for initial module threads
-
 
39
 *
-
 
40
 * @param data Start of data section
-
 
41
 * @return pointer to tcb_t structure
-
 
42
 *
-
 
43
 */
-
 
44
tcb_t * __alloc_tls(void **data, size_t size)
38
tcb_t * __alloc_tls(void **data, size_t size)
45
{
39
{
46
    tcb_t *result;
-
 
47
 
-
 
48
    result = malloc(sizeof(tcb_t) + size);
40
    return tls_alloc_variant_1(data, size);
49
    *data = ((void *)result) + sizeof(tcb_t);
-
 
50
    return result;
-
 
51
}
41
}
52
 
42
 
53
void __free_tls_arch(tcb_t *tcb, size_t size)
43
void __free_tls_arch(tcb_t *tcb, size_t size)
54
{
44
{
55
    free(tcb);
45
    tls_free_variant_1(tcb, size);
56
}
46
}
57
 
47
 
58
/** @}
48
/** @}
59
 */
49
 */