Changeset fa23560 in mainline for uspace/lib/libc/arch/arm32/src/tls.c


Ignore:
Timestamp:
2007-10-30T22:54:11Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4d21cf8
Parents:
b2a0f6dd
Message:

Unify implementations of TLS variant I and variant II alloc_tls() and
free_tls_arch().

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/arch/arm32/src/tls.c

    rb2a0f6dd rfa23560  
    3333 */
    3434/** @file
    35  *  @brief Uspace threads and TLS.
    3635 */
    3736
    38 #include <thread.h>
    39 #include <malloc.h>
     37#include <tls.h>
     38#include <sys/types.h>
    4039
    41 /** Allocates TLS & TCB.
    42  *
    43  * @param data Start of data section (output parameter).
    44  * @param size Size of (tbss + tdata) sections.
    45  * @return     Pointer to the allocated #tcb_t structure.
    46  */
    4740tcb_t * __alloc_tls(void **data, size_t size)
    4841{
    49         tcb_t *result;
    50 
    51         result = malloc(sizeof(tcb_t) + size);
    52         *data = ((void *)result) + sizeof(tcb_t);
    53         return result;
     42        return tls_alloc_variant_1(data, size);
    5443}
    5544
    56 /** Deallocates TLS & TCB.
    57  *
    58  * @param tcb TCB structure to be deallocated (along with corresponding TLS).
    59  * @param size Not used.
    60  */
    6145void __free_tls_arch(tcb_t *tcb, size_t size)
    6246{
    63         free(tcb);
     47        tls_free_variant_1(tcb, size);
    6448}
    6549
Note: See TracChangeset for help on using the changeset viewer.