Skip to content

Commit 336b739

Browse files
committed
Set cpu_mode in context_set()
Leaving the field zeroed-out from thread_create() results in boot failures on some ARM boards.
1 parent 485281e commit 336b739

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/arch/arm32/include/arch/context.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <align.h>
4040
#include <arch/stack.h>
4141
#include <arch/context_struct.h>
42+
#include <arch/regutils.h>
4243

4344
/* Put one item onto the stack to support get_stack_base() and align it up. */
4445
#define SP_DELTA (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
@@ -48,6 +49,7 @@
4849
(c)->pc = (uintptr_t) (_pc); \
4950
(c)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; \
5051
(c)->fp = 0; \
52+
(c)->cpu_mode = SUPERVISOR_MODE; \
5153
} while (0)
5254

5355
#ifndef __ASSEMBLER__

0 commit comments

Comments
 (0)