forked from Imagelibrary/rtems
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user