diff --git a/arch/csky/abiv1/inc/abi/entry.h b/arch/csky/abiv1/inc/abi/entry.h index 61d94ec7dd160f119426a876152be597c65f4f7c..b3559db0c8a8dbe089798567d66d773b90eff38d 100644 --- a/arch/csky/abiv1/inc/abi/entry.h +++ b/arch/csky/abiv1/inc/abi/entry.h @@ -80,7 +80,6 @@ .endm .macro RESTORE_ALL - psrclr ie ldw lr, (sp, 4) ldw a0, (sp, 8) mtcr a0, epc diff --git a/arch/csky/abiv2/inc/abi/entry.h b/arch/csky/abiv2/inc/abi/entry.h index ab63c41abccadf7c3ba2f2d6b0c526a5b5dad7ec..698df2f294bec8ecb2974d0e3cb45285e0505ec8 100644 --- a/arch/csky/abiv2/inc/abi/entry.h +++ b/arch/csky/abiv2/inc/abi/entry.h @@ -63,7 +63,6 @@ .endm .macro RESTORE_ALL - psrclr ie ldw tls, (sp, 0) ldw lr, (sp, 4) ldw a0, (sp, 8) diff --git a/arch/csky/kernel/entry.S b/arch/csky/kernel/entry.S index 3760397fdd3d9ea83a563f42635a80fccdaeb002..bfbef30f8a53d199274dcf6a01c988070b081ac3 100644 --- a/arch/csky/kernel/entry.S +++ b/arch/csky/kernel/entry.S @@ -208,9 +208,9 @@ ENTRY(ret_from_fork) jbsr syscall_trace_exit ret_from_exception: + psrclr ie ld syscallid, (sp, LSAVE_PSR) btsti syscallid, 31 - bt 1f /* * Load address of current->thread_info, Then get address of task_struct @@ -220,11 +220,20 @@ ret_from_exception: bmaski r10, THREAD_SHIFT andn r9, r10 + bt 1f ldw r12, (r9, TINFO_FLAGS) andi r12, (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | _TIF_UPROBE) cmpnei r12, 0 bt exit_work 1: +#ifdef CONFIG_PREEMPTION + ldw r12, (r9, TINFO_PREEMPT) + cmpnei r12, 0 + bt 2f + jbsr preempt_schedule_irq /* irq en/disable is done inside */ +2: +#endif + #ifdef CONFIG_TRACE_IRQFLAGS ld r10, (sp, LSAVE_PSR) btsti r10, 6 @@ -241,6 +250,7 @@ exit_work: btsti r12, TIF_NEED_RESCHED bt work_resched + psrset ie mov a0, sp mov a1, r12 jmpi do_notify_resume @@ -291,34 +301,10 @@ ENTRY(csky_irq) jbsr trace_hardirqs_off #endif -#ifdef CONFIG_PREEMPTION - mov r9, sp /* Get current stack pointer */ - bmaski r10, THREAD_SHIFT - andn r9, r10 /* Get thread_info */ - - /* - * Get task_struct->stack.preempt_count for current, - * and increase 1. - */ - ldw r12, (r9, TINFO_PREEMPT) - addi r12, 1 - stw r12, (r9, TINFO_PREEMPT) -#endif mov a0, sp jbsr csky_do_IRQ -#ifdef CONFIG_PREEMPTION - subi r12, 1 - stw r12, (r9, TINFO_PREEMPT) - cmpnei r12, 0 - bt 2f - ldw r12, (r9, TINFO_FLAGS) - btsti r12, TIF_NEED_RESCHED - bf 2f - jbsr preempt_schedule_irq /* irq en/disable is done inside */ -#endif -2: jmpi ret_from_exception /*