Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2479 → Rev 2656

/trunk/uspace/lib/libc/arch/arm32/src/tls.c/thread.c
32,35 → 32,19
* @{
*/
/** @file
* @brief Uspace threads and TLS.
*/
 
#include <thread.h>
#include <malloc.h>
#include <tls.h>
#include <sys/types.h>
 
/** Allocates TLS & TCB.
*
* @param data Start of data section (output parameter).
* @param size Size of (tbss + tdata) sections.
* @return Pointer to the allocated #tcb_t structure.
*/
tcb_t * __alloc_tls(void **data, size_t size)
{
tcb_t *result;
 
result = malloc(sizeof(tcb_t) + size);
*data = ((void *)result) + sizeof(tcb_t);
return result;
return tls_alloc_variant_1(data, size);
}
 
/** Deallocates TLS & TCB.
*
* @param tcb TCB structure to be deallocated (along with corresponding TLS).
* @param size Not used.
*/
void __free_tls_arch(tcb_t *tcb, size_t size)
{
free(tcb);
tls_free_variant_1(tcb, size);
}
 
/** @}