riscv: Add TLS support

Update #3433.
This commit is contained in:
Sebastian Huber
2018-06-28 08:20:47 +02:00
parent afb60eb183
commit 694e79a0b7
2 changed files with 9 additions and 0 deletions

View File

@@ -35,6 +35,7 @@
#include <rtems/score/cpu.h>
#include <rtems/score/address.h>
#include <rtems/score/tls.h>
void _CPU_Context_Initialize(
Context_Control *context,
@@ -54,4 +55,11 @@ void _CPU_Context_Initialize(
context->ra = (uintptr_t) entry_point;
context->sp = (uintptr_t) stack;
context->isr_dispatch_disable = 0;
if ( tls_area != NULL ) {
void *tls_block;
tls_block = _TLS_TCB_before_TLS_block_initialize( tls_area );
context->tp = (uintptr_t) tls_block;
}
}

View File

@@ -67,6 +67,7 @@ SYM(_CPU_Context_switch):
LREG ra, RISCV_CONTEXT_RA(a1)
LREG sp, RISCV_CONTEXT_SP(a1)
LREG tp, RISCV_CONTEXT_TP(a1)
LREG s0, RISCV_CONTEXT_S0(a1)
LREG s1, RISCV_CONTEXT_S1(a1)
LREG s2, RISCV_CONTEXT_S2(a1)