Changeset 9ab91f16 in mainline


Ignore:
Timestamp:
2006-06-06T21:34:10Z (18 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9a71438
Parents:
80076f6
Message:

Fixed incorrect TLS in ppc32.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libc/arch/ppc32/src/thread.c

    r80076f6 r9ab91f16  
    3838tcb_t * __alloc_tls(void **data, size_t size)
    3939{
    40         tcb_t *tcb;
    41        
    42         *data = malloc(sizeof(tcb_t) + size);
    43         tcb = (tcb_t *) (*data + size);
    44         return tcb;
     40        tcb_t *result;
     41
     42        result = malloc(sizeof(tcb_t) + size);
     43        *data = ((void *)result) + sizeof(tcb_t);
     44        return result;
    4545}
    4646
    4747void __free_tls_arch(tcb_t *tcb, size_t size)
    4848{
    49         void *start = ((void *) tcb) - size;
    50         free(start);
     49        free(tcb);
    5150}
Note: See TracChangeset for help on using the changeset viewer.