We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2670a39 commit 265d6abCopy full SHA for 265d6ab
arch/riscv/include/asm/processor.h
@@ -110,7 +110,7 @@ struct thread_struct {
110
struct __riscv_d_ext_state fstate;
111
unsigned long bad_cause;
112
unsigned long envcfg;
113
- unsigned long status;
+ unsigned long sum;
114
u32 riscv_v_flags;
115
u32 vstate_ctrl;
116
struct __riscv_v_ext_state vstate;
arch/riscv/kernel/asm-offsets.c
@@ -34,7 +34,7 @@ void asm_offsets(void)
34
OFFSET(TASK_THREAD_S9, task_struct, thread.s[9]);
35
OFFSET(TASK_THREAD_S10, task_struct, thread.s[10]);
36
OFFSET(TASK_THREAD_S11, task_struct, thread.s[11]);
37
- OFFSET(TASK_THREAD_STATUS, task_struct, thread.status);
+ OFFSET(TASK_THREAD_SUM, task_struct, thread.sum);
38
39
OFFSET(TASK_TI_CPU, task_struct, thread_info.cpu);
40
OFFSET(TASK_TI_PREEMPT_COUNT, task_struct, thread_info.preempt_count);
@@ -347,8 +347,8 @@ void asm_offsets(void)
347
offsetof(struct task_struct, thread.s[11])
348
- offsetof(struct task_struct, thread.ra)
349
);
350
- DEFINE(TASK_THREAD_STATUS_RA,
351
- offsetof(struct task_struct, thread.status)
+ DEFINE(TASK_THREAD_SUM_RA,
+ offsetof(struct task_struct, thread.sum)
352
353
354
arch/riscv/kernel/entry.S
@@ -399,14 +399,15 @@ SYM_FUNC_START(__switch_to)
399
REG_S s11, TASK_THREAD_S11_RA(a3)
400
401
/* save the user space access flag */
402
- li s0, SR_SUM
403
- csrr s1, CSR_STATUS
404
- REG_S s1, TASK_THREAD_STATUS_RA(a3)
+ csrr s0, CSR_STATUS
+ REG_S s0, TASK_THREAD_SUM_RA(a3)
405
406
/* Save the kernel shadow call stack pointer */
407
scs_save_current
408
/* Restore context from next->thread */
409
- REG_L s0, TASK_THREAD_STATUS_RA(a4)
+ REG_L s0, TASK_THREAD_SUM_RA(a4)
+ li s1, SR_SUM
410
+ and s0, s0, s1
411
csrs CSR_STATUS, s0
412
REG_L ra, TASK_THREAD_RA_RA(a4)
413
REG_L sp, TASK_THREAD_SP_RA(a4)
0 commit comments