summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-06-27 08:37:34 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-06-29 10:04:37 +0200
commita49a3c8eed0663bfc4de8b854dcede1573daf246 (patch)
treeed74263e0830553a7a7f181f3f42a32423befaff
parentriscv: Fix CPU_STACK_ALIGNMENT (diff)
downloadrtems-a49a3c8eed0663bfc4de8b854dcede1573daf246.tar.bz2
riscv: Do not clear thread context
Do not clear the complete thread context. Initialize only the necessary members. The Context_Control::is_executing member must be preserved across _CPU_Context_Initialize() calls. Update #3433.
-rw-r--r--cpukit/score/cpu/riscv/riscv-context-initialize.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/cpukit/score/cpu/riscv/riscv-context-initialize.c b/cpukit/score/cpu/riscv/riscv-context-initialize.c
index 619c691f53..f558fbd591 100644
--- a/cpukit/score/cpu/riscv/riscv-context-initialize.c
+++ b/cpukit/score/cpu/riscv/riscv-context-initialize.c
@@ -32,11 +32,8 @@
#include "config.h"
#endif
-#include <string.h>
-
#include <rtems/score/cpu.h>
#include <rtems/score/riscv-utility.h>
-#include <rtems/score/interr.h>
void _CPU_Context_Initialize(
Context_Control *context,
@@ -52,8 +49,6 @@ void _CPU_Context_Initialize(
uintptr_t stack_high = stack + stack_area_size;
- memset(context, 0, sizeof(*context));
-
/* Stack Pointer - sp/x2 */
context->x[2] = stack_high;
/* Frame Pointer - fp/x8 */
@@ -61,6 +56,8 @@ void _CPU_Context_Initialize(
/* Return Address - ra/x1 */
context->x[1] = (uintptr_t) entry_point;
+ context->isr_dispatch_disable = 0;
+
/* Enable interrupts and FP */
context->mstatus = MSTATUS_FS | MSTATUS_MIE;
}