Changeset 118a872 in mainline


Ignore:
Timestamp:
2016-05-23T17:34:27Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0a981e3
Parents:
b3364b7c
Message:

Fix amd64 not working properly. Clearly there is something to this alignment.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/tls.c

    rb3364b7c r118a872  
    3636 */
    3737
     38#include <align.h>
    3839#include <tls.h>
    3940#include <malloc.h>
     
    148149        tcb_t *tcb;
    149150
    150         *data = malloc(sizeof(tcb_t) + size);
     151        size = ALIGN_UP(size, &_tls_alignment);
     152        *data = memalign((uintptr_t) &_tls_alignment, sizeof(tcb_t) + size);
    151153        if (*data == NULL)
    152154                return NULL;
     
    167169void tls_free_variant_2(tcb_t *tcb, size_t size)
    168170{
     171        size = ALIGN_UP(size, &_tls_alignment);
    169172        void *start = ((void *) tcb) - size;
    170173        free(start);
Note: See TracChangeset for help on using the changeset viewer.