Skip to content

Commit 9e2ca15

Browse files
committed
csky: Fixup remove unnecessary save/restore PSR code
All processes' PSR could success from SETUP_MMU, so need set it in INIT_THREAD again. And use a3 instead of r7 in __switch_to for code convention. Signed-off-by: Guo Ren <[email protected]>
1 parent 6633a5a commit 9e2ca15

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

arch/csky/include/asm/processor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ extern struct cpuinfo_csky cpu_data[];
4242

4343
struct thread_struct {
4444
unsigned long ksp; /* kernel stack pointer */
45-
unsigned long sr; /* saved status register */
4645
unsigned long trap_no; /* saved status register */
4746

4847
/* FPU regs */
@@ -51,7 +50,6 @@ struct thread_struct {
5150

5251
#define INIT_THREAD { \
5352
.ksp = sizeof(init_stack) + (unsigned long) &init_stack, \
54-
.sr = DEFAULT_PSR_VALUE, \
5553
}
5654

5755
/*

arch/csky/kernel/asm-offsets.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ int main(void)
1919

2020
/* offsets into the thread struct */
2121
DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp));
22-
DEFINE(THREAD_SR, offsetof(struct thread_struct, sr));
2322
DEFINE(THREAD_FESR, offsetof(struct thread_struct, user_fp.fesr));
2423
DEFINE(THREAD_FCR, offsetof(struct thread_struct, user_fp.fcr));
2524
DEFINE(THREAD_FPREG, offsetof(struct thread_struct, user_fp.vr));

arch/csky/kernel/entry.S

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,6 @@ ENTRY(__switch_to)
330330
lrw a3, TASK_THREAD
331331
addu a3, a0
332332

333-
mfcr a2, psr /* Save PSR value */
334-
stw a2, (a3, THREAD_SR) /* Save PSR in task struct */
335-
336333
SAVE_SWITCH_STACK
337334

338335
stw sp, (a3, THREAD_KSP)
@@ -343,12 +340,9 @@ ENTRY(__switch_to)
343340

344341
ldw sp, (a3, THREAD_KSP) /* Set next kernel sp */
345342

346-
ldw a2, (a3, THREAD_SR) /* Set next PSR */
347-
mtcr a2, psr
348-
349343
#if defined(__CSKYABIV2__)
350-
addi r7, a1, TASK_THREAD_INFO
351-
ldw tls, (r7, TINFO_TP_VALUE)
344+
addi a3, a1, TASK_THREAD_INFO
345+
ldw tls, (a3, TINFO_TP_VALUE)
352346
#endif
353347

354348
RESTORE_SWITCH_STACK

0 commit comments

Comments
 (0)