Changeset 6b781c0 in mainline for uspace/libc/arch/arm32/src/thread.c


Ignore:
Timestamp:
2007-06-08T15:02:49Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c03ee1c
Parents:
3ee8a075
Message:

Merge arm32 into trunk.

File:
1 edited

Legend:

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

    r3ee8a075 r6b781c0  
    11/*
    2  * Copyright (c) 2006 Ondrej Palkovsky
     2 * Copyright (c) 2007 Pavel Jancik
    33 * All rights reserved.
    44 *
     
    3333 */
    3434/** @file
     35 *  @brief Uspace threads and TLS.
    3536 */
    3637
     
    3839#include <malloc.h>
    3940
    40 /** Allocate TLS & TCB for initial module threads
     41/** Allocates TLS & TCB.
    4142 *
    42  * @param data Start of data section
    43  * @return pointer to tcb_t structure
     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.
    4446 */
    4547tcb_t * __alloc_tls(void **data, size_t size)
    4648{
    47         /* TODO */
    48         return NULL;
     49        tcb_t *result;
     50
     51        result = malloc(sizeof(tcb_t) + size);
     52        *data = ((void *)result) + sizeof(tcb_t);
     53        return result;
    4954}
    5055
     56/** Deallocates TLS & TCB.
     57 *
     58 * @param tcb TCB structure to be deallocated (along with corresponding TLS).
     59 * @param size Not used.
     60 */
    5161void __free_tls_arch(tcb_t *tcb, size_t size)
    5262{
    53         /* TODO */
     63        free(tcb);
    5464}
    5565
Note: See TracChangeset for help on using the changeset viewer.