Changeset c968b27 in rtems


Ignore:
Timestamp:
Jan 8, 2021, 8:04:22 AM (3 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
9165349d
Parents:
e324f82
git-author:
Sebastian Huber <sebastian.huber@…> (01/08/21 08:04:22)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/01/21 05:26:18)
Message:

nios2: Add TLS support

Update #4214.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/nios2/nios2-context-initialize.c

    re324f82 rc968b27  
    11/*
    2  * Copyright (c) 2011 embedded brains GmbH
     2 * Copyright (c) 2011, 2021 embedded brains GmbH
    33 *
    44 * Copyright (c) 2006 Kolja Waschk (rtemsdev/ixo.de)
     
    2121#include <rtems/score/nios2-utility.h>
    2222#include <rtems/score/interr.h>
     23#include <rtems/score/tls.h>
    2324
    2425void _CPU_Context_Initialize(
     
    4546    Nios2_MPU_Region_descriptor desc = {
    4647      .index = mpu_config->data_index_for_stack_protection,
    47       /* FIXME: Brocken stack allocator */
    48       .base = (void *) ((int) stack_area_begin & ~((1 << mpu_config->data_region_size_log2) - 1)),
    49       .end = (char *) stack_area_begin + stack_area_size,
     48      .base = stack_area_begin,
     49      .end = (const void *) RTEMS_ALIGN_UP(
     50        (uintptr_t) stack_area_begin + stack_area_size +
     51          _TLS_Get_allocation_size(),
     52        1U << mpu_config->data_region_size_log2
     53      ),
    5054      .perm = NIOS2_MPU_DATA_PERM_SVR_READWRITE_USER_NONE,
    5155      .data = true,
     
    6670    }
    6771  }
     72
     73  if ( tls_area != NULL ) {
     74    context->r23 = (uintptr_t) tls_area +
     75      _TLS_Get_thread_control_block_area_size( (uintptr_t) _TLS_Alignment ) +
     76       0x7000;
     77    _TLS_TCB_before_TLS_block_initialize( tls_area );
     78  }
    6879}
Note: See TracChangeset for help on using the changeset viewer.